/* ============================================================
   LEDFX — kosmiczny design system (dark / neon)
   Marka: trójkąt Penrose'a + neon czerwień/magenta + elektryczny cyan
   ============================================================ */

:root {
  /* Tło / kosmos */
  --void:      #05060b;
  --bg:        #080a12;
  --bg-2:      #0c0f1a;
  --panel:     rgba(255,255,255,.045);
  --panel-2:   rgba(255,255,255,.07);
  --border:    rgba(255,255,255,.10);
  --border-2:  rgba(255,255,255,.18);

  /* Neon (z marki) */
  --red:       #ff2b4e;
  --magenta:   #ff2d8b;
  --cyan:      #1fe0ff;
  --violet:    #8b5cff;
  --green:     #2ee6a6;
  --amber:     #ffb020;

  /* Tekst */
  --text:      #eef0fa;
  --muted:     #9aa0bd;
  --faint:     #5b6180;

  --grad:      linear-gradient(100deg, var(--red), var(--magenta) 45%, var(--violet) 75%, var(--cyan));
  --grad-soft: linear-gradient(100deg, rgba(255,43,78,.18), rgba(31,224,255,.14));

  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 24px 60px rgba(0,0,0,.55);
  --glow-red:  0 0 0 1px rgba(255,43,78,.35), 0 0 28px rgba(255,43,78,.35);
  --glow-cyan: 0 0 0 1px rgba(31,224,255,.30), 0 0 26px rgba(31,224,255,.30);

  --font:  'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --disp:  'Space Grotesk', var(--font);
  --sidebar-w: 250px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--void);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  min-height: 100vh;
}

/* Kosmiczne tło: gradienty + delikatna siatka + gwiazdy */
.cosmos {
  position: fixed; inset: 0; z-index: -2; overflow: hidden;
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(255,43,78,.18), transparent 60%),
    radial-gradient(1000px 700px at 12% 108%, rgba(31,224,255,.14), transparent 60%),
    radial-gradient(900px 600px at 50% 50%, rgba(139,92,255,.08), transparent 70%),
    var(--void);
}
.cosmos::before {  /* siatka technologiczna */
  content: ""; position: absolute; inset: -2px;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 85%);
}
.cosmos::after {  /* gwiazdy */
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,.7), transparent),
    radial-gradient(1.5px 1.5px at 75% 20%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 85% 65%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 60% 85%, rgba(255,255,255,.4), transparent),
    radial-gradient(1px 1px at 10% 80%, rgba(255,255,255,.5), transparent);
  opacity: .5; animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .35; } to { opacity: .65; } }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { font-family: var(--disp); font-weight: 700; letter-spacing: -.02em; line-height: 1.12; margin: 0 0 .4em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.text-sm { font-size: 13px; }
.center { text-align: center; }

/* ---------- LOGO ---------- */
.logo { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; }
.logo svg, .logo img { display: block; }
.logo .tri { filter: drop-shadow(0 0 14px rgba(31,224,255,.28)) drop-shadow(0 0 6px rgba(255,43,78,.20)); }
.logo-word { font-family: var(--disp); font-weight: 300; letter-spacing: .12em; }
/* wielkie S ma byc WIDOCZNE - zyczenie usera 30.08.2026: bez lowercase, litera +25% */
.logo-word b { display: inline-block; }
.logo-word b::first-letter { font-size: 1.25em; line-height: 1; }
.logo-word b { font-weight: 300; }                  /* cienka kreska - zyczenie usera 30.08.2026 */
.logo-word .pl { font-size: .7em; }                 /* .tech o 30% mniejsze niz nazwa */
.logo-word b { color: #fff; }
.logo-word .pl { color: var(--cyan); }

/* ---------- PRZYCISKI ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: 600 14px/1 var(--font); padding: 11px 18px; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text);
  transition: .18s ease; text-decoration: none;
}
.btn:hover { border-color: var(--cyan); box-shadow: var(--glow-cyan); text-decoration: none; transform: translateY(-1px); }
.btn-primary { border: none; background: var(--grad); color: #fff; box-shadow: 0 8px 30px rgba(255,43,78,.35); }
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 10px 38px rgba(255,43,78,.5); }
.btn-ghost { background: transparent; }
.btn-lg { padding: 14px 26px; font-size: 15px; }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-danger:hover { border-color: var(--red); box-shadow: var(--glow-red); color: #ffd5dd; }

/* ---------- PANELE / KARTY (glassmorphism) ---------- */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); backdrop-filter: blur(14px) saturate(120%);
  box-shadow: var(--shadow); padding: 20px;
}
.card-pad { padding: 22px 24px; }
.glass { background: var(--panel); border: 1px solid var(--border); backdrop-filter: blur(12px); border-radius: var(--radius); }

/* ---------- ODZNAKI / CHIPY ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-2); color: var(--muted); white-space: nowrap; }
.badge-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.is-dziala, .badge.is-gotowy { color: var(--green); border-color: rgba(46,230,166,.4); }
.badge.is-w_budowie, .badge.is-w_realizacji, .badge.is-zaawansowany { color: var(--cyan); border-color: rgba(31,224,255,.4); }
.badge.is-serwis, .badge.is-wstrzymany { color: var(--amber); border-color: rgba(255,176,32,.4); }
.badge.is-planowana, .badge.is-pomysl, .badge.is-research, .badge.is-wczesny { color: var(--violet); border-color: rgba(139,92,255,.4); }
.badge.is-alarm { color: var(--red); border-color: rgba(255,43,78,.5); }

/* ---------- FLASH / KOMUNIKATY ---------- */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; border: 1px solid var(--border-2); }
.flash-error { background: rgba(255,43,78,.12); border-color: rgba(255,43,78,.4); color: #ffd0d8; }
.flash-ok { background: rgba(46,230,166,.12); border-color: rgba(46,230,166,.4); color: #c7ffe9; }
.auth-notice { border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 18px; border: 1px solid var(--border-2); background: var(--panel-2); }
.auth-notice--alert { border-color: rgba(255,176,32,.4); background: rgba(255,176,32,.10); }
.auth-notice-title { font-weight: 700; margin-bottom: 4px; }
.auth-notice-body { font-size: 13.5px; color: var(--muted); }

/* ---------- FORMULARZE ---------- */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.form-control, input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], textarea, select {
  width: 100%; font: 400 14.5px var(--font); color: var(--text);
  background: rgba(0,0,0,.30); border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  padding: 11px 13px; transition: .15s; outline: none;
}
.form-control:focus, input:focus, textarea:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(31,224,255,.15); }
textarea { resize: vertical; min-height: 80px; }
select option { background: var(--bg-2); }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 18px; }

.pw-field { position: relative; }
.pw-field input { padding-right: 44px; }
.pw-reveal { position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--amber); cursor: pointer; padding: 4px; opacity: .8; }
.pw-reveal:hover { opacity: 1; }
.pw-reveal--on { color: var(--cyan); }
.pw-match { font-size: 12.5px; margin: -4px 0 10px; }
.pw-match--ok { color: var(--green); }
.pw-match--no { color: var(--red); }

/* ============================================================
   LOGOWANIE
   ============================================================ */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-box { width: 100%; max-width: 400px; }
.login-box .card { padding: 30px 28px; }
.login-logo { text-align: center; margin-bottom: 22px; }
.login-box .btn-primary { width: 100%; }
.login-footer { margin-top: 22px; text-align: center; }

/* Stopka „Powered by Sierściuch" (kanon) */
/* stopka siersciuch.tech (user 30.08.2026): znak + nazwa, BEZ „Powered by" */
.hh-powered { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; color: #ef4444; white-space: nowrap; line-height: 1; }
.hh-powered-znak { height: 22px; width: auto; display: block; }
.hh-powered-pre { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; line-height: 1; }
.hh-powered-sig { font-family: 'Pacifico', cursive; font-size: 24px; line-height: 1.1; }

/* ============================================================
   LAYOUT PANELU (sidebar + topbar)
   ============================================================ */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(12,15,26,.92), rgba(8,10,18,.92));
  border-right: 1px solid var(--border); backdrop-filter: blur(10px);
  padding: 18px 14px; display: flex; flex-direction: column; gap: 4px;
}
.sidebar-brand { padding: 6px 8px 16px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500; font-size: 14.5px; transition: .15s; text-decoration: none;
}
.nav-link:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav-link.active { color: #fff; background: var(--grad-soft); border: 1px solid var(--border-2); }
.nav-link .ico { width: 20px; text-align: center; font-size: 16px; }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); padding: 14px 12px 6px; }
.sidebar-spacer { flex: 1; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 14px 26px; background: rgba(8,10,18,.72); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 19px; margin: 0; }
.topbar .spacer { flex: 1; }
.topbar .user { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 14px; }
.content { padding: 26px; flex: 1; }
.page-foot { padding: 22px 26px 30px; border-top: 1px solid var(--border); margin-top: auto; }

/* ---------- TABELE ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; text-transform: uppercase;
  letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--border-2); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
.tbl tr:hover td { background: var(--panel); }
.tbl a { color: var(--text); font-weight: 600; }

/* ---------- GRID / NAGŁÓWKI SEKCJI ---------- */
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: 26px; }
.page-head .spacer { flex: 1; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.stat { padding: 18px 20px; }
.stat .num { font-family: var(--disp); font-size: 32px; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: 13px; }

/* ---------- KANBAN ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: 250px; gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.kanban-col { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.kanban-col h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }
.kanban-card { background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  padding: 12px; margin-bottom: 10px; display: block; color: var(--text); }
.kanban-card:hover { border-color: var(--cyan); box-shadow: var(--glow-cyan); text-decoration: none; }
.kanban-card .t { font-weight: 600; margin-bottom: 6px; }

/* ============================================================
   BLOKI — modułowe „okna"
   ============================================================ */
.bloki-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; align-items: start; }
.blok { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(12px); overflow: hidden; }
.blok--full { grid-column: span 2; }
.blok--half { grid-column: span 1; }
.blok--third { grid-column: span 1; }
.blok-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(255,255,255,.03), transparent); }
.blok-ico { font-size: 17px; filter: drop-shadow(0 0 6px rgba(31,224,255,.4)); }
.blok-title { font-size: 15px; margin: 0; flex: 1; font-family: var(--disp); }
.blok-actions { display: flex; align-items: center; gap: 4px; }
.blok-btn { background: none; border: 1px solid var(--border-2); color: var(--muted); border-radius: 8px;
  width: 28px; height: 28px; cursor: pointer; transition: .15s; }
.blok-btn:hover { color: var(--text); border-color: var(--cyan); }
.blok-grip { cursor: grab; color: var(--faint); padding: 0 4px; }
.blok-body { padding: 16px; }
.blok-body table.tbl { font-size: 13px; }
.blok.sortable-ghost { opacity: .4; }

/* dodaj-blok przycisk */
.add-blok { border: 1.5px dashed var(--border-2); background: transparent; color: var(--muted);
  border-radius: var(--radius); padding: 18px; width: 100%; cursor: pointer; font: 600 14px var(--font);
  transition: .15s; }
.add-blok:hover { border-color: var(--cyan); color: var(--cyan); }
.blok-typ-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.blok-typ { text-align: left; padding: 12px; border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  background: var(--panel-2); color: var(--text); cursor: pointer; transition: .15s; }
.blok-typ:hover { border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.blok-typ .e { font-size: 22px; }
.blok-typ .n { font-weight: 600; margin-top: 4px; }
.blok-typ .d { font-size: 12px; color: var(--muted); }

/* notatka */
.note { background: rgba(255,176,32,.08); border-left: 3px solid var(--amber); padding: 12px 14px; border-radius: 8px; white-space: pre-wrap; }

/* kosztorys */
.kosztorys-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.kosztorys-total { display: flex; justify-content: space-between; padding: 12px 0 2px; font-family: var(--disp); font-size: 18px; }
.kosztorys-total b { color: var(--cyan); }

/* galeria / kamery */
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 10px; }
.thumb-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.cam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 16px; }
.cam { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #000; position: relative; }
.cam img, .cam iframe, .cam video { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; border: 0; }
.cam-label { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.6); padding: 5px 10px; border-radius: 999px; font-size: 12px; }
.cam-live { position: absolute; right: 10px; top: 10px; background: var(--red); color: #fff; font-size: 11px;
  font-weight: 700; padding: 3px 9px; border-radius: 999px; box-shadow: var(--glow-red); }
.cam-live::before { content: "● "; }

/* ============================================================
   WIZYTÓWKA (landing)
   ============================================================ */
.pub-nav { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px;
  padding: 14px 6vw; background: rgba(5,6,11,.55); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.pub-nav .spacer { flex: 1; }
.pub-nav a.lnk { color: var(--muted); font-weight: 500; }
.pub-nav a.lnk:hover { color: var(--text); text-decoration: none; }

.hero { position: relative; padding: 12vh 6vw 11vh; text-align: center; overflow: hidden; }
.hero h1 { font-size: clamp(38px, 7vw, 86px); line-height: .98; margin: 18px 0 14px; }
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: clamp(16px, 2.2vw, 21px); color: var(--muted); max-width: 660px; margin: 0 auto 30px; }
.hero .cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-tri { margin: 0 auto; }

.section { padding: 8vh 6vw; }
.section h2 { font-size: clamp(26px, 4vw, 40px); text-align: center; margin-bottom: 8px; }
.section .sub { text-align: center; color: var(--muted); max-width: 620px; margin: 0 auto 44px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 18px; }
.feature { padding: 24px; }
.feature .e { font-size: 30px; filter: drop-shadow(0 0 10px rgba(255,43,78,.4)); }
.feature h3 { margin: 14px 0 8px; font-size: 19px; }
.feature p { color: var(--muted); font-size: 14.5px; margin: 0; }
.machine-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px; }
.oferta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap: 16px; }
.oferta-card { overflow: hidden; padding: 0; }
.oferta-card .ph { aspect-ratio: 4/3; background: var(--grad-soft); display: grid; place-items: center; font-size: 40px; }
.oferta-card .bd { padding: 16px 18px; }

.pub-foot { padding: 7vh 6vw 5vh; border-top: 1px solid var(--border); text-align: center; }

/* ---------- RESPONSYWNOŚĆ ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -100%; z-index: 50; width: 260px; transition: left .25s; }
  .sidebar.open { left: 0; }
  .menu-toggle { display: inline-flex !important; }
  .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; }
  .bloki-grid { grid-template-columns: 1fr; }
  .blok--full,.blok--half,.blok--third { grid-column: span 1; }
}
.menu-toggle { display: none; background: none; border: 1px solid var(--border-2); color: var(--text);
  border-radius: 8px; width: 38px; height: 38px; cursor: pointer; }

/* ---------- MAGAZYN: karty kategorii ---------- */
.mag-kat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 14px; }
.mag-kat-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.mag-kat-card:hover { border-color: var(--cyan); transform: translateY(-2px); }
.mag-kat-alarm { border-color: var(--red) !important; }
.mag-kat-ico { font-size: 28px; flex-shrink: 0; }
.mag-kat-body { flex: 1; min-width: 0; }
.mag-kat-nazwa { font-weight: 600; font-size: 15px; text-transform: capitalize; }
.mag-kat-sub { display: flex; gap: 10px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.mag-kat-arr { color: var(--faint); font-size: 18px; flex-shrink: 0; }
.mag-kat-card:hover .mag-kat-arr { color: var(--cyan); }
