/* FusioDrive — Panel zarządzania. Motyw zgodny z szablonem FusioDrive PRO:
   czerń, akcent elektrycznego błękitu (#3b82f6), duże zaokrąglenia, poświata. */
:root {
  --bg: #050507; --sidebar: #09090b; --panel: #121216; --panel-2: #0a0a0c;
  --border: #27272a; --border-soft: rgba(39,39,42,.8);
  --text: #f8fafc; --muted: #a1a1aa; --muted-2: #71717a;
  --blue: #3b82f6; --blue-600: #2563eb; --blue-300: #93c5fd; --blue-glow: rgba(37,99,235,.35);
  --emerald: #10b981; --rose: #f43f5e; --amber: #f59e0b;
  --radius: 16px; --radius-sm: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI Variable', 'Segoe UI', Roboto, sans-serif;
  font-size: 14px; -webkit-font-smoothing: antialiased;
}
code, pre, .mono { font-family: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace; }
#app { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar { width: 240px; background: var(--sidebar); border-right: 1px solid var(--border-soft);
  display: flex; flex-direction: column; padding: 16px 12px; flex-shrink: 0; }
.brand { display: flex; gap: 11px; align-items: center; padding: 6px 8px 18px; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: #000; border: 1px solid var(--border); box-shadow: 0 8px 24px -8px var(--blue-glow); padding: 5px; }
.brand-mark svg, .brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-name { font-weight: 800; letter-spacing: -.02em; }
.brand-name b { color: var(--blue-300); font-weight: 800; font-size: 11px; font-family: var(--mono); margin-left: 4px; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.nav button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 600; font-size: 13px; transition: all .15s; }
.nav button:hover { background: rgba(255,255,255,.04); color: var(--text); }
.nav button.active { background: rgba(59,130,246,.14); color: var(--blue-300); box-shadow: inset 2px 0 0 var(--blue); }
.nav .ico { width: 18px; text-align: center; color: var(--blue); }
.nav button.active .ico { color: var(--blue-300); }
.sidebar-foot { margin-top: auto; }

/* Content */
.content { flex: 1; display: flex; flex-direction: column; overflow: hidden; background:
  radial-gradient(1200px 400px at 70% -10%, rgba(37,99,235,.08), transparent 70%), var(--bg); }
.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--border-soft); }
.topbar h1 { font-size: 18px; margin: 0; font-weight: 800; letter-spacing: -.02em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.view { padding: 24px; overflow: auto; }

/* Cards & grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 18px; box-shadow: 0 1px 0 rgba(255,255,255,.02) inset; }
.card h3 { margin: 0 0 8px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); font-size: 12px; }

/* Buttons */
.btn { all: unset; cursor: pointer; padding: 9px 15px; border-radius: 12px; font-weight: 700;
  font-size: 13px; background: linear-gradient(180deg, var(--blue), var(--blue-600)); color: #fff;
  box-shadow: 0 6px 18px -8px var(--blue-glow); transition: filter .15s, transform .05s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); box-shadow: none; }
.btn-ghost:hover { background: rgba(255,255,255,.04); border-color: #3f3f46; }
.btn-danger { background: transparent; border: 1px solid rgba(244,63,94,.4); color: #fda4af; box-shadow: none; }
.btn-danger:hover { background: rgba(244,63,94,.1); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 10px; }

/* Lists / tables */
.row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; }
.row:hover { background: rgba(255,255,255,.03); }
.list { background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius); overflow: hidden; }
.list .row { border-radius: 0; }
.list .row + .row { border-top: 1px solid var(--border-soft); }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border-soft); }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #60a5fa); }

/* Pills / badges */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-size: 11px; font-weight: 700; border: 1px solid transparent; }
.pill-ok { background: rgba(59,130,246,.14); color: var(--blue-300); border-color: rgba(59,130,246,.3); }
.pill-muted { background: rgba(255,255,255,.05); color: var(--muted); }
.pill-admin { background: rgba(59,130,246,.14); color: var(--blue-300); border-color: rgba(59,130,246,.3); }
.pill-standard { background: rgba(245,158,11,.14); color: #fcd34d; border-color: rgba(245,158,11,.3); }
.pill-revoked { background: rgba(244,63,94,.14); color: #fda4af; border-color: rgba(244,63,94,.3); }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--muted-2); }
.dot.on { background: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.25); }

/* Breadcrumb */
.crumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.crumbs a { cursor: pointer; color: var(--blue-300); }
.crumbs a:hover { color: #fff; }

/* QR */
.qr-wrap { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.qr-box { background: #fff; padding: 16px; border-radius: 16px; width: 240px; height: 240px; display: grid;
  place-items: center; box-shadow: 0 12px 40px -12px var(--blue-glow); }
.qr-box svg { width: 100%; height: 100%; }

.empty { color: var(--muted); padding: 48px; text-align: center; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--panel); border: 1px solid var(--border); padding: 12px 18px; border-radius: 12px;
  opacity: 0; transition: all .25s; pointer-events: none; box-shadow: 0 16px 48px -16px #000; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(244,63,94,.5); color: #fda4af; }
input.inp, select.inp { background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  padding: 9px 12px; border-radius: 10px; font-size: 13px; width: 100%; font-family: inherit; }
input.inp:focus, select.inp:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }

/* Status pill w stopce sidebara */
#server-pill { width: 100%; justify-content: center; padding: 9px; }

/* Miniatury i galeria multimediów */
.ico-cell { width: 40px; height: 40px; display: inline-grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.thumb-sm { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; background: var(--panel-2); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.thumb-card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border-soft);
  border-radius: 14px; overflow: hidden; text-decoration: none; transition: border-color .15s, transform .1s; }
.thumb-card:hover { border-color: rgba(59,130,246,.5); transform: translateY(-2px); }
.thumb-card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--panel-2); display: block; }
.thumb-card.noimg img { display: none; }
.thumb-card.noimg::before { content: '🖼'; font-size: 42px; text-align: center; padding: 28px 0; }
.thumb-card.noimg[data-kind="video"]::before { content: '🎬'; }
.thumb-cap { padding: 8px 10px; font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
