@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&family=Rajdhani:wght@500;600;700&family=Space+Mono:wght@400;700&family=Sora:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600;700&family=Chakra+Petch:wght@400;500;600;700&display=swap');

/* ============================================================
   MOTYWY — [data-theme] na <html> ustawiany przez PHP (getCurrentTheme()
   w includes/theme.php, jedno globalne ustawienie w site_settings).
   Każdy motyw nadpisuje TYLKO ogólne zmienne UI (tło/karty/tekst/akcenty
   ogólne/czcionki) — zmienne --rank-* (kolory rang w Rosterze/Garażu/
   Broniach) świadomie NIE są tu ruszane w żadnym motywie: to jest
   ustalone kodowanie znaczenia (Chief=czerwony, Cadet=szary), a nie
   estetyka strony, więc musi zostać identyczne niezależnie od motywu,
   inaczej traci się spójność między zakładkami.
   ============================================================ */
:root {
    --bg-main: #0b0f19;
    --bg-sidebar: #090c14;
    --bg-card: #131a29;
    --bg-card-hover: #171f31;
    --border-color: #1e293b;
    --border-color-light: #2a3548;
    --text-main: #f1f5f9;
    --text-muted: #8896ab;
    --text-dim: #5b6b85;

    --accent-red: #ef4444;
    --accent-red-dim: rgba(239, 68, 68, 0.14);
    --accent-yellow: #f59e0b;
    --accent-yellow-dim: rgba(245, 158, 11, 0.14);
    --accent-blue: #3b82f6;
    --accent-blue-dim: rgba(59, 130, 246, 0.14);
    --accent-green: #22c55e;
    --accent-green-dim: rgba(34, 197, 94, 0.14);

    /* Kolory rang — od dowództwa (głęboka czerwień) po kadetów (szary),
       używane na liście kont w Panelu Zarządu i w podglądzie importu. */
    --rank-chief: #dc2626;
    --rank-chief-dim: rgba(220, 38, 38, 0.14);
    --rank-command: #ea580c;
    --rank-command-dim: rgba(234, 88, 12, 0.14);
    --rank-captain: #f59e0b;
    --rank-captain-dim: rgba(245, 158, 11, 0.14);
    --rank-lieutenant: #eab308;
    --rank-lieutenant-dim: rgba(234, 179, 8, 0.14);
    --rank-detective: #14b8a6;
    --rank-detective-dim: rgba(20, 184, 166, 0.14);
    --rank-sergeant: #06b6d4;
    --rank-sergeant-dim: rgba(6, 182, 212, 0.14);
    --rank-officer: #3b82f6;
    --rank-officer-dim: rgba(59, 130, 246, 0.14);
    --rank-cadet: #64748b;
    --rank-cadet-dim: rgba(100, 116, 139, 0.14);

    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* ---------- Motyw: Czerwony (SAPD Classic) ---------- */
[data-theme="red"] {
    --bg-main: #170a0a;
    --bg-sidebar: #120808;
    --bg-card: #241010;
    --bg-card-hover: #2c1414;
    --border-color: #3d1818;
    --border-color-light: #4a1e1e;
    --text-main: #fef2f2;
    --text-muted: #b89191;
    --text-dim: #7a5f5f;
    --accent-blue: #ef4444;
    --accent-blue-dim: rgba(239, 68, 68, 0.14);
    --font-ui: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

/* ---------- Motyw: Zielony (Tactical) ---------- */
[data-theme="green"] {
    --bg-main: #0a1410;
    --bg-sidebar: #08100c;
    --bg-card: #10201a;
    --bg-card-hover: #142820;
    --border-color: #1c3529;
    --border-color-light: #234332;
    --text-main: #f0fdf4;
    --text-muted: #8fb8a2;
    --text-dim: #5c7a6a;
    --accent-blue: #22c55e;
    --accent-blue-dim: rgba(34, 197, 94, 0.14);
    --font-ui: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Space Mono', 'Courier New', monospace;
}

/* ---------- Motyw: Fioletowy (Executive) ---------- */
[data-theme="purple"] {
    --bg-main: #120b1a;
    --bg-sidebar: #0e0815;
    --bg-card: #1c1128;
    --bg-card-hover: #241631;
    --border-color: #362043;
    --border-color-light: #432a52;
    --text-main: #faf5ff;
    --text-muted: #b09dc4;
    --text-dim: #77678a;
    --accent-blue: #a855f7;
    --accent-blue-dim: rgba(168, 85, 247, 0.14);
    --font-ui: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* ---------- Motyw: Pomarańczowy (HSU / High Speed) ---------- */
[data-theme="orange"] {
    --bg-main: #180f08;
    --bg-sidebar: #130b06;
    --bg-card: #241609;
    --bg-card-hover: #2c1c0c;
    --border-color: #422a10;
    --border-color-light: #523415;
    --text-main: #fff7ed;
    --text-muted: #c4a583;
    --text-dim: #8a7259;
    --accent-blue: #f97316;
    --accent-blue-dim: rgba(249, 115, 22, 0.14);
    --font-ui: 'Chakra Petch', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Space Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-ui);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden; /* zabezpieczenie: nic (np. pieczęć wychodząca poza sidebar) nie ma tworzyć poziomego scrolla całej strony */
}

a { color: inherit; text-decoration: none; }

/* ---------- Sidebar ---------- */
.sidebar {
    width: 250px;
    flex-shrink: 0;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-header {
    padding: 22px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header .badge-shield {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent-blue);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.sidebar-header .badge-shield svg { width: 12px; height: 12px; }

.sidebar-header h1 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.sidebar-header span.subtitle {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    list-style: none;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 14px;
    color: var(--text-muted);
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.sidebar-menu li a svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.8; }

/* Licznik "aktywnych spraw" przy zakładce (Raporty w toku, Poszukiwani
   aktualnie POSZUKIWANI) — pusty/ukryty gdy 0, żeby nie zaśmiecać
   widoku znacznikiem przy każdej zakładce. Kolor NIE zależy od motywu
   (--accent-red jest stały we wszystkich 5 motywów) — zawsze czerwony,
   niezależnie jaki kolor akcentu ma wybrany motyw strony. */
.sidebar-count-badge {
    margin-left: auto; background: var(--accent-red); color: white;
    font-size: 10.5px; font-weight: 700; line-height: 1;
    padding: 3px 6px; border-radius: 10px; font-family: var(--font-mono);
}
.sidebar-count-badge:empty { display: none; }

.sidebar-menu li.active a,
.sidebar-menu li a:hover {
    background-color: var(--accent-blue-dim);
    color: var(--accent-blue);
}

.sidebar-menu li.active a svg,
.sidebar-menu li a:hover svg { opacity: 1; }

/* Separator kategorii w menu bocznym — grupuje zakładki wizualnie.
   V2: prostszy, bardziej "panel administracyjny" niż "terminal Discorda"
   — mała kolorowa kreska po lewej zamiast linii ciągnącej się przez całą
   szerokość po obu stronach tekstu. */
.sidebar-section-label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 18px 14px 7px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-dim);
    user-select: none;
}
.sidebar-section-label:first-child { margin-top: 4px; }
.sidebar-section-label::before {
    content: '';
    width: 10px;
    height: 2px;
    border-radius: 1px;
    background: var(--accent-blue);
    opacity: 0.55;
    flex-shrink: 0;
}

/* Przycisk Panelu Zarządu — pływające kółko w prawym dolnym rogu ekranu.
   z-index celowo poniżej modali (100), żeby modal otwarty nad nim go
   zasłaniał zamiast wystawać ponad wszystko. */
.zarzad-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06);
    z-index: 40;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.zarzad-fab svg { width: 19px; height: 19px; }
.zarzad-fab:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
}
@media (max-width: 860px) {
    .zarzad-fab { right: 14px; bottom: 14px; width: 42px; height: 42px; }
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    background: var(--accent-blue-dim);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.user-chip .name { font-size: 13px; font-weight: 600; }
.user-chip .role { font-size: 11px; color: var(--text-dim); }

.btn-logout {
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 1px solid var(--border-color-light);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.btn-logout:hover { border-color: var(--accent-red); color: var(--accent-red); }

/* ---------- Main ---------- */
.main-container { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    height: 58px;
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.topbar-stats { display: flex; align-items: center; gap: 22px; font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }
.topbar-stats b { color: var(--text-main); font-weight: 700; }

.live-dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    margin-right: 6px;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.content-area { padding: 26px 28px; flex: 1; overflow-y: auto; }

.section-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.section-title { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.section-desc { font-size: 13px; color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn {
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: opacity 0.15s, background-color 0.15s;
    font-family: var(--font-ui);
}
.btn svg { width: 14px; height: 14px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-outline { background: transparent; border: 1px solid var(--border-color-light); color: var(--text-main); }
.btn-outline:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.btn-primary { background: var(--accent-blue); color: white; }
.btn-primary:hover { opacity: 0.88; }
.btn-danger { background: var(--accent-red-dim); color: var(--accent-red); border: 1px solid rgba(239, 68, 68, 0.3); }
.btn-danger:hover { background: var(--accent-red); color: white; }
.btn-sm { padding: 6px 11px; font-size: 11px; }

/* ---------- Search / inputs ---------- */
.search-box, .form-input, .form-select, .form-textarea {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 11px 14px;
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    font-family: var(--font-ui);
    transition: border-color 0.15s;
}
.search-box { margin-bottom: 18px; }
.search-box:focus, .form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent-blue); }
.form-textarea { resize: vertical; min-height: 70px; }
.form-textarea-large { min-height: 160px; }

.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }

/* ---------- Table ---------- */
.data-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: 10px; overflow: hidden; border: 1px solid var(--border-color); }
.data-table th { background: rgba(255,255,255,0.02); padding: 13px 18px; text-align: left; font-size: 10.5px; text-transform: uppercase; color: var(--text-dim); letter-spacing: 0.6px; border-bottom: 1px solid var(--border-color); font-weight: 600; }
.data-table td { padding: 14px 18px; font-size: 13px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.015); }
.data-table .mono { font-family: var(--font-mono); color: var(--text-muted); font-size: 12px; }
.data-table .actions-cell { display: flex; gap: 6px; justify-content: flex-end; }

/* Miniaturka pojazdu w garażu — nad nazwą modelu, jak ustalone: mała, 48px wysokości */
/* Przycisk-nazwa modelu w garażu — klik rozwija szczegóły ze zdjęciem */
.vehicle-name-toggle { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: var(--text-main); font-size: 13px; font-family: inherit; cursor: pointer; padding: 4px 0; text-align: left; }
.vehicle-name-toggle:hover { color: var(--accent-blue); }
.vehicle-name-toggle .chevron { flex-shrink: 0; transition: transform 0.15s; color: var(--text-dim); }
.vehicle-name-toggle .chevron.chevron-open { transform: rotate(90deg); }

/* Wiersz rozwinięcia — duże zdjęcie po lewej, zakres rang po prawej */
.vehicle-expand-row td { background: rgba(255,255,255,0.015); padding: 16px 18px; }
.vehicle-expand-content { display: flex; gap: 20px; align-items: flex-start; }
.vehicle-photo-large { width: 220px; height: 140px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-color-light); flex-shrink: 0; }
.vehicle-photo-large-placeholder { display: flex; align-items: center; justify-content: center; width: 220px; height: 140px; background: rgba(255,255,255,0.03); border: 1px dashed var(--border-color-light); border-radius: 8px; color: var(--text-dim); font-size: 12px; flex-shrink: 0; }
.vehicle-expand-details { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-content: start; padding-top: 4px; }
.vehicle-expand-label { font-size: 10.5px; text-transform: uppercase; color: var(--text-dim); letter-spacing: 0.4px; padding-top: 2px; }
.vehicle-expand-value { font-size: 13px; color: var(--text-main); }
.vehicle-tuning-row { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-color); }
.vehicle-tuning-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* Changelog — grupowane po dacie/wersji, styl "patch notes" */
.changelog-group { margin-bottom: 22px; }
.changelog-group:last-child { margin-bottom: 0; }
.changelog-date { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; color: var(--text-main); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border-color); }
.changelog-entries { display: flex; flex-direction: column; gap: 6px; }
.changelog-entry { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; padding: 6px 0; }
.changelog-tag { flex-shrink: 0; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
.changelog-added { background: var(--accent-green-dim); color: var(--accent-green); }
.changelog-removed { background: var(--accent-red-dim); color: var(--accent-red); }
.changelog-fixed { background: var(--accent-yellow-dim); color: var(--accent-yellow); }
.changelog-text { flex: 1; color: var(--text-muted); line-height: 1.5; }
.changelog-entry .btn-danger { margin-left: auto; flex-shrink: 0; }

/* Lista "ID - status" w głównym wierszu Garażu, jedna linia per ID gry */
.vehicle-id-status-line { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 0; }
.vehicle-id-status-text { color: var(--text-muted); }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-dot-green { background: var(--accent-green); }
.status-dot-red { background: var(--accent-red); }
.status-dot-yellow { background: var(--accent-yellow); }
.status-dot-muted { background: var(--text-dim); }

/* Blok szczegółów per pojedyncze ID gry w rozwinięciu (przebieg/paliwo/tuning) */
.vehicle-id-detail-block { padding: 10px 0; border-top: 1px solid var(--border-color); }
.vehicle-id-detail-block:first-child { border-top: none; padding-top: 4px; }
.vehicle-id-detail-header { font-size: 12px; font-weight: 600; color: var(--text-main); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-dim); font-size: 13px; }

/* ---------- Badges ---------- */
.badge { padding: 4px 9px; border-radius: 5px; font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; text-transform: uppercase; letter-spacing: 0.3px; }
.badge-red { background: var(--accent-red-dim); color: var(--accent-red); border: 1px solid rgba(239, 68, 68, 0.25); }
.badge-yellow { background: var(--accent-yellow-dim); color: var(--accent-yellow); border: 1px solid rgba(245, 158, 11, 0.25); }
.badge-green { background: var(--accent-green-dim); color: var(--accent-green); border: 1px solid rgba(34, 197, 94, 0.25); }
.badge-muted { background: rgba(255,255,255,0.04); color: var(--text-dim); border: 1px solid var(--border-color-light); }
.badge-rank-chief { background: var(--rank-chief-dim); color: var(--rank-chief); border: 1px solid rgba(220, 38, 38, 0.3); }
.badge-rank-command { background: var(--rank-command-dim); color: var(--rank-command); border: 1px solid rgba(234, 88, 12, 0.3); }
.badge-rank-captain { background: var(--rank-captain-dim); color: var(--rank-captain); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-rank-lieutenant { background: var(--rank-lieutenant-dim); color: var(--rank-lieutenant); border: 1px solid rgba(234, 179, 8, 0.3); }
.badge-rank-detective { background: var(--rank-detective-dim); color: var(--rank-detective); border: 1px solid rgba(20, 184, 166, 0.3); }
.badge-rank-sergeant { background: var(--rank-sergeant-dim); color: var(--rank-sergeant); border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-rank-officer { background: var(--rank-officer-dim); color: var(--rank-officer); border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-rank-cadet { background: var(--rank-cadet-dim); color: var(--rank-cadet); border: 1px solid rgba(100, 116, 139, 0.3); }
.badge-blue { background: var(--accent-blue-dim); color: var(--accent-blue); border: 1px solid rgba(59, 130, 246, 0.3); }

/* Import składu z Discorda */
.import-textarea { width: 100%; min-height: 220px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5; }
.import-preview-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 12px; }
.import-preview-table th { text-align: left; padding: 7px 8px; color: var(--text-dim); font-size: 10px; text-transform: uppercase; letter-spacing: 0.3px; border-bottom: 1px solid var(--border-color-light); }
.import-preview-table td { padding: 7px 8px; border-bottom: 1px solid var(--border-color); }
.import-preview-table tr:last-child td { border-bottom: none; }
.import-preview-table .cell-login { font-family: var(--font-mono); }
.import-preview-table .cell-pass { font-family: var(--font-mono); color: var(--accent-yellow); }
.import-warn-box { background: var(--accent-yellow-dim); border: 1px solid rgba(245, 158, 11, 0.3); color: var(--accent-yellow); font-size: 12px; padding: 10px 13px; border-radius: 7px; margin-top: 14px; }
.import-skip-box { background: rgba(255,255,255,0.03); border: 1px solid var(--border-color-light); color: var(--text-muted); font-size: 11.5px; padding: 10px 13px; border-radius: 7px; margin-top: 10px; }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(4, 6, 12, 0.7);
    display: none; align-items: center; justify-content: center; z-index: 100;
    backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: var(--bg-card); border: 1px solid var(--border-color-light);
    border-radius: 12px; padding: 24px; width: 440px; max-width: 92vw;
    max-height: 86vh; overflow-y: auto;
}
.modal-title { font-size: 15px; font-weight: 700; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ---------- Tabs (content) ---------- */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---------- Radio ---------- */
.radio-panel {
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px;
    display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 380px;
}
.radio-log { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.radio-msg { font-size: 13px; line-height: 1.5; }
.radio-msg .who { font-weight: 700; font-family: var(--font-mono); font-size: 12px; }
.radio-msg .who.self { color: var(--accent-green); }
.radio-msg .who.other { color: var(--accent-blue); }
.radio-msg .callsign { color: var(--text-dim); font-weight: 400; }
.radio-msg .ts { color: var(--text-dim); font-size: 10.5px; margin-left: 6px; }
.radio-input-row { display: flex; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--border-color); }
.radio-input-row input { flex: 1; }
.radio-status { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-dim); padding: 10px 16px; border-top: 1px solid var(--border-color); font-family: var(--font-mono); }

/* ---------- Permission grid (panel Zarządu) ---------- */
.perm-grid { display: grid; grid-template-columns: 1fr repeat(3, 60px); gap: 8px; align-items: center; font-size: 12px; }
.perm-grid .perm-head { color: var(--text-dim); font-size: 10px; text-transform: uppercase; text-align: center; }
.perm-grid .perm-mod-name { color: var(--text-main); font-weight: 500; }
.perm-checkbox { width: 17px; height: 17px; margin: 0 auto; display: block; accent-color: var(--accent-blue); cursor: pointer; }

.account-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 16px 18px; margin-bottom: 10px; transition: border-color 0.15s; }
.account-card:hover { border-color: var(--border-color-light); }
.account-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.account-card .acc-name { font-weight: 600; font-size: 13.5px; }
.account-card .acc-login { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    body { flex-direction: column; }
    /* Menu podzielone na 4 osobne <ul> (po jednym na sekcję, dla separatorów
       na desktopie) musi na mobile znów wyglądać jak JEDEN ciągły poziomy,
       przewijany pasek — nie cztery osobne, krótkie paski jeden pod drugim.
       .sidebar dostaje jeden wspólny poziomy scroll i flex-wrap: nowrap
       (żadnego zawijania na kolejne linie), a każdy .sidebar-menu przestaje
       przewijać się sam i traci flex-basis, żeby zszyć się wizualnie z
       sąsiednimi listami w jeden ciągły pasek zamiast oddzielnych bloków. */
    .sidebar {
        width: 100%; height: auto; position: relative;
        flex-direction: row; flex-wrap: nowrap; align-items: center;
        overflow-x: auto;
    }
    /* Nagłówek "SAPD MDT & CAD" domyślnie ma dwuliniowy pionowy layout
       (badge + h1) z dużym paddingiem — na szerokim ekranie to nie problem,
       bo sidebar jest pionowy i wysoki. W poziomym pasku mobilnym ten sam
       nagłówek wymuszałby wysokość całego .sidebar (bo jest jego dzieckiem
       flex w wierszu), więc dostaje kompaktową wersję: mniejszy padding,
       bez etykiety "DailyRPG System" (zostaje sam skrócony tytuł), żeby
       zmieścić się w tej samej wąskiej wysokości co pasek zakładek obok. */
    .sidebar-header { padding: 8px 12px; border-bottom: none; border-right: 1px solid var(--border-color); flex-shrink: 0; display: flex; align-items: center; }
    .sidebar-header .badge-shield { display: none; }
    .sidebar-header h1 { font-size: 13px; white-space: nowrap; }
    .sidebar-menu { flex-direction: row; overflow-x: visible; padding: 10px 4px; flex-shrink: 0; }
    .sidebar-footer { display: none; }
    .content-area { padding: 18px; }
    .topbar-stats { display: none; }
    /* Separatory kategorii chowamy na mobile — w poziomym, przewijanym
       pasku zakładek nie dają czytelnego podziału, tylko łamią układ na
       kilka osobnych rzędów zamiast jednego płynnego paska. */
    .sidebar-section-label { display: none; }
}

/* ---------- Focus visibility ---------- */
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    .live-dot { animation: none; }
}

/* ---------- Skład (roster) ---------- */
.roster-section-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--text-dim); margin: 22px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border-color);
}
.roster-section-label:first-child { margin-top: 0; }
.roster-rank-row {
    display: flex; align-items: center; gap: 14px; padding: 11px 16px;
    background: var(--bg-card); border: 1px solid var(--border-color); border-left: 3px solid var(--rank-row-accent, var(--border-color-light));
    border-radius: 8px; margin-bottom: 6px;
}
.roster-rank-row.roster-rank-empty { opacity: 0.45; }
.roster-rank-name { flex: 0 0 220px; font-size: 13px; font-weight: 600; color: var(--rank-row-accent, var(--text-muted)); }
.roster-rank-people { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.roster-person-chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 4px;
    background: rgba(255,255,255,0.03); border: 1px solid var(--border-color-light); border-radius: 20px; font-size: 12px;
}
.roster-person-avatar {
    width: 20px; height: 20px; border-radius: 50%; background: var(--rank-row-accent, var(--text-dim)); color: var(--bg-main);
    display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.roster-empty-label { font-size: 12px; color: var(--text-dim); font-style: italic; }
@media (max-width: 700px) {
    .roster-rank-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .roster-rank-name { flex-basis: auto; }
}

/* ---------- Odznaki ---------- */
/* Reużywa .roster-rank-row/.roster-rank-name z wyżej (ta sama wizualna
   "karta rangi"), tylko lista wewnątrz pokazuje numery odznak (zajęte
   i wolne) zamiast osób bez numerów. */
.badge-chip {
    display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px;
    border-radius: 7px; font-size: 12px; border: 1px solid var(--border-color-light);
}
.badge-chip-taken { background: rgba(255,255,255,0.03); }
.badge-chip-free { background: transparent; border-style: dashed; opacity: 0.5; }
.badge-chip-number { font-family: var(--font-mono); font-weight: 700; color: var(--rank-row-accent, var(--accent-blue)); }
.badge-chip-name { color: var(--text-muted); }
.badge-chip-free .badge-chip-name { color: var(--text-dim); font-style: italic; }

/* ---------- Mandaty: lista katalogu (checkboxy) + podsumowanie ---------- */
.citation-catalog-list {
    max-height: 280px; overflow-y: auto; border: 1px solid var(--border-color);
    border-radius: 8px; padding: 4px;
}
.citation-catalog-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px;
    border-radius: 6px; cursor: pointer; font-size: 12.5px;
}
.citation-catalog-item:hover { background: rgba(255,255,255,0.03); }
.citation-catalog-item input[type="checkbox"] { width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }
.citation-catalog-item-name { flex: 1; }
.citation-catalog-item-meta { color: var(--text-dim); font-family: var(--font-mono); font-size: 11.5px; white-space: nowrap; }
.citation-summary {
    margin-top: 14px; background: var(--accent-blue-dim); border: 1px solid rgba(59,130,246,0.25);
    border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px;
}
.citation-summary-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.citation-summary-row strong { font-family: var(--font-mono); color: var(--accent-blue); font-size: 14px; }

/* ---------- Kartoteka ---------- */
/* Te klasy (panel-stat-*, panel-overview-list-item) pierwotnie istniały
   TYLKO w panel.php (Panel Zarządu ma własny, niezależny system stylów
   — nie ładuje main.css w ogóle) — Kartoteka na index.php je używała
   ale bez ŻADNEJ definicji tutaj, więc renderowała się jako surowy,
   nieostylowany HTML. To był prawdopodobnie główny powód "nieczytelności"
   zgłoszonej przez KaSyN, nie tylko brak kolorów. Zduplikowane tutaj
   (nie przeniesione z panel.php) celowo — panel.php nie ładuje tego
   pliku, więc usunięcie stamtąd zepsułoby Panel. */
.panel-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.panel-stat-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 16px; }
.panel-stat-value { font-size: 26px; font-weight: 700; font-family: var(--font-mono); line-height: 1; margin-bottom: 6px; }
.panel-stat-label { font-size: 11.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.4px; }
.panel-overview-list-item { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border-color); font-size: 12.5px; }
.panel-overview-list-item:last-child { border-bottom: none; }

/* Nowe w tej turze — kolorowa "kropka" przy nagłówku każdej sekcji
   (Poszukiwania/Areszt/Mandaty), spójna z kolorem karty statystyk i
   lewego paska danej sekcji, żeby kategorię dało się rozpoznać po
   samym kolorze, bez czytania tekstu nagłówka. */
.kartoteka-section-title { display: flex; align-items: center; gap: 8px; }
.kartoteka-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* ---------- Multi-autocomplete (pole "Funkcjonariusze" w Raportach) ---------- */
/* Własny komponent, nie natywny <datalist> — datalist podmienia CAŁĄ
   wartość pola, co psułoby już wpisane nazwiska rozdzielone przecinkami.
   Ten dropdown pozycjonuje się absolutnie względem rodzica (wymaga
   position:relative na wrapperze — patrz modals.php), podmienia TYLKO
   aktualnie pisany fragment (patrz attachMultiAutocomplete w app.js). */
.multi-autocomplete-suggestions {
    display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
    background: var(--bg-card); border: 1px solid var(--border-color-light); border-radius: 8px;
    max-height: 200px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.multi-autocomplete-suggestions.open { display: block; }
.multi-autocomplete-item { padding: 8px 12px; font-size: 12.5px; cursor: pointer; }
.multi-autocomplete-item:hover, .multi-autocomplete-item.active { background: rgba(255,255,255,0.05); }

/* ---------- Wyszukiwanie globalne (topbar) ---------- */
.global-search-results {
    display: none; position: absolute; top: calc(100% + 6px); right: 0; width: 380px; z-index: 40;
    background: var(--bg-card); border: 1px solid var(--border-color-light); border-radius: 10px;
    max-height: 420px; overflow-y: auto; box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}
.global-search-results.open { display: block; }
.global-search-group-label {
    padding: 8px 14px 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-dim); font-weight: 700;
}
.global-search-item {
    display: block; padding: 8px 14px; cursor: pointer; font-size: 12.5px; color: var(--text-main);
}
.global-search-item:hover { background: rgba(255,255,255,0.05); }
.global-search-item-sub { font-size: 11px; color: var(--text-dim); margin-top: 1px; }
.global-search-empty { padding: 16px; text-align: center; color: var(--text-dim); font-size: 12.5px; }

/* ---------- Przełącznik grup składu (SAPD / SWAT / HSU) ---------- */
.roster-group-switch {
    display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-card);
    border: 1px solid var(--border-color); border-radius: 9px; margin-bottom: 14px;
}
.roster-group-btn {
    padding: 7px 18px; border: none; border-radius: 6px; background: transparent; color: var(--text-muted);
    font-size: 12.5px; font-weight: 600; font-family: inherit; cursor: pointer; transition: background 0.12s, color 0.12s;
}
.roster-group-btn:hover { color: var(--text-main); background: rgba(255,255,255,0.04); }
.roster-group-btn.active { background: var(--accent-blue-dim); color: var(--accent-blue); }


/* ============================================================
   TŁA MOTYWÓW — subtelna, tematyczna dekoracja w tle, jedna per
   motyw, dopasowana do jego tożsamości (patrz komentarze przy
   każdym [data-theme] blok wyżej: Classic/Tactical/Executive/
   High Speed). Umieszczona na body::before (nie .content-area),
   żeby działać identycznie na WSZYSTKICH stronach naraz — login.php
   nie ma .content-area, ale ma inną strukturę (.login-box) z
   własnym tłem, więc dekoracja i tak tylko "wypełnia" puste miejsca
   wokół, tak samo jak robi to za tabelami w index.php/panel.php.

   KLUCZOWE dla czytelności: niska opacity + maska gradientowa
   (zanika od rogu do przezroczystości) + position:fixed w jednym
   rogu (nie powtarzający się wzór na całej stronie) — to nigdy nie
   może utrudniać czytania gęstych tabel z danymi, strona zostaje w
   pełni użytkowym narzędziem. pointer-events:none — dekoracja nigdy
   nie przechwytuje kliknięć.
   ============================================================ */
body { position: relative; }
body::before {
    content: '';
    position: fixed;
    top: -60px;
    right: -60px;
    width: 620px;
    height: 620px;
    background-repeat: no-repeat;
    background-position: top right;
    background-size: contain;
    opacity: 0.075;
    pointer-events: none;
    z-index: 0;
    -webkit-mask-image: radial-gradient(circle at top right, black 0%, black 25%, transparent 68%);
    mask-image: radial-gradient(circle at top right, black 0%, black 25%, transparent 68%);
}
[data-theme="blue"] body::before { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20600%20600%22%3E%20%3Ccircle%20cx%3D%22300%22%20cy%3D%22300%22%20r%3D%22290%22%20fill%3D%22none%22%20stroke%3D%22%233b82f6%22%20stroke-width%3D%223.5%22/%3E%20%3Ccircle%20cx%3D%22300%22%20cy%3D%22300%22%20r%3D%22250%22%20fill%3D%22none%22%20stroke%3D%22%233b82f6%22%20stroke-width%3D%221.5%22/%3E%20%3Cpolygon%20points%3D%22300.0%2C30.0%20360.0%2C196.1%20533.8%2C165.0%20420.0%2C300.0%20533.8%2C435.0%20360.0%2C403.9%20300.0%2C570.0%20240.0%2C403.9%2066.2%2C435.0%20180.0%2C300.0%2066.2%2C165.0%20240.0%2C196.1%22%20fill%3D%22none%22%20stroke%3D%22%233b82f6%22%20stroke-width%3D%225%22/%3E%20%3Ccircle%20cx%3D%22300%22%20cy%3D%22300%22%20r%3D%2295%22%20fill%3D%22none%22%20stroke%3D%22%233b82f6%22%20stroke-width%3D%223.5%22/%3E%20%3C/svg%3E"); }
[data-theme="red"] body::before { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20600%20600%22%3E%20%3Ccircle%20cx%3D%22300%22%20cy%3D%22300%22%20r%3D%2280%22%20fill%3D%22none%22%20stroke%3D%22%23ef4444%22%20stroke-width%3D%222%22/%3E%20%3Ccircle%20cx%3D%22300%22%20cy%3D%22300%22%20r%3D%22180%22%20fill%3D%22none%22%20stroke%3D%22%23ef4444%22%20stroke-width%3D%221.5%22%20stroke-dasharray%3D%222%2C6%22/%3E%20%3Cpath%20d%3D%22M134.7%2C227.9%20L100.8%2C227.5%20L127.0%2C249.0%20M153.0%2C195.4%20L117.9%2C187.7%20L140.6%2C215.6%20M177.7%2C167.3%20L142.9%2C151.8%20L160.4%2C185.6%20M207.7%2C144.9%20L175.0%2C121.4%20L185.9%2C160.2%20M241.6%2C129.2%20L212.9%2C98.0%20L215.9%2C140.3%20M278.0%2C120.7%20L255.1%2C82.6%20L249.2%2C126.7%20M315.4%2C120.0%20L300.0%2C76.0%20L284.6%2C120.0%20M351.5%2C126.8%20L345.3%2C80.6%20L321.3%2C120.6%20M384.8%2C140.5%20L387.9%2C96.2%20L357.8%2C128.9%20M414.7%2C160.6%20L426.2%2C119.8%20L391.8%2C144.5%20M440.1%2C186.2%20L458.6%2C150.4%20L421.8%2C166.8%20M459.8%2C216.2%20L483.8%2C186.6%20L446.6%2C194.8%20M473.2%2C249.6%20L501.1%2C226.8%20L465.1%2C227.3%22%20fill%3D%22none%22%20stroke%3D%22%23ef4444%22%20stroke-width%3D%222.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22/%3E%20%3C/svg%3E"); }
[data-theme="green"] body::before { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20600%20600%22%3E%20%3Cpath%20d%3D%22M90.2%2C49.0%20L40.0%2C78.0%20L-10.2%2C49.0%20L-10.2%2C-9.0%20L40.0%2C-38.0%20L90.2%2C-9.0%20Z%20M190.7%2C49.0%20L140.5%2C78.0%20L90.2%2C49.0%20L90.2%2C-9.0%20L140.5%2C-38.0%20L190.7%2C-9.0%20Z%20M291.1%2C49.0%20L240.9%2C78.0%20L190.7%2C49.0%20L190.7%2C-9.0%20L240.9%2C-38.0%20L291.1%2C-9.0%20Z%20M391.6%2C49.0%20L341.4%2C78.0%20L291.1%2C49.0%20L291.1%2C-9.0%20L341.4%2C-38.0%20L391.6%2C-9.0%20Z%20M492.1%2C49.0%20L441.8%2C78.0%20L391.6%2C49.0%20L391.6%2C-9.0%20L441.8%2C-38.0%20L492.1%2C-9.0%20Z%20M592.5%2C49.0%20L542.3%2C78.0%20L492.1%2C49.0%20L492.1%2C-9.0%20L542.3%2C-38.0%20L592.5%2C-9.0%20Z%20M140.5%2C136.0%20L90.2%2C165.0%20L40.0%2C136.0%20L40.0%2C78.0%20L90.2%2C49.0%20L140.5%2C78.0%20Z%20M240.9%2C136.0%20L190.7%2C165.0%20L140.5%2C136.0%20L140.5%2C78.0%20L190.7%2C49.0%20L240.9%2C78.0%20Z%20M341.4%2C136.0%20L291.1%2C165.0%20L240.9%2C136.0%20L240.9%2C78.0%20L291.1%2C49.0%20L341.4%2C78.0%20Z%20M441.8%2C136.0%20L391.6%2C165.0%20L341.4%2C136.0%20L341.4%2C78.0%20L391.6%2C49.0%20L441.8%2C78.0%20Z%20M542.3%2C136.0%20L492.1%2C165.0%20L441.8%2C136.0%20L441.8%2C78.0%20L492.1%2C49.0%20L542.3%2C78.0%20Z%20M642.8%2C136.0%20L592.5%2C165.0%20L542.3%2C136.0%20L542.3%2C78.0%20L592.5%2C49.0%20L642.8%2C78.0%20Z%20M90.2%2C223.0%20L40.0%2C252.0%20L-10.2%2C223.0%20L-10.2%2C165.0%20L40.0%2C136.0%20L90.2%2C165.0%20Z%20M190.7%2C223.0%20L140.5%2C252.0%20L90.2%2C223.0%20L90.2%2C165.0%20L140.5%2C136.0%20L190.7%2C165.0%20Z%20M291.1%2C223.0%20L240.9%2C252.0%20L190.7%2C223.0%20L190.7%2C165.0%20L240.9%2C136.0%20L291.1%2C165.0%20Z%20M391.6%2C223.0%20L341.4%2C252.0%20L291.1%2C223.0%20L291.1%2C165.0%20L341.4%2C136.0%20L391.6%2C165.0%20Z%20M492.1%2C223.0%20L441.8%2C252.0%20L391.6%2C223.0%20L391.6%2C165.0%20L441.8%2C136.0%20L492.1%2C165.0%20Z%20M592.5%2C223.0%20L542.3%2C252.0%20L492.1%2C223.0%20L492.1%2C165.0%20L542.3%2C136.0%20L592.5%2C165.0%20Z%20M140.5%2C310.0%20L90.2%2C339.0%20L40.0%2C310.0%20L40.0%2C252.0%20L90.2%2C223.0%20L140.5%2C252.0%20Z%20M240.9%2C310.0%20L190.7%2C339.0%20L140.5%2C310.0%20L140.5%2C252.0%20L190.7%2C223.0%20L240.9%2C252.0%20Z%20M341.4%2C310.0%20L291.1%2C339.0%20L240.9%2C310.0%20L240.9%2C252.0%20L291.1%2C223.0%20L341.4%2C252.0%20Z%20M441.8%2C310.0%20L391.6%2C339.0%20L341.4%2C310.0%20L341.4%2C252.0%20L391.6%2C223.0%20L441.8%2C252.0%20Z%20M542.3%2C310.0%20L492.1%2C339.0%20L441.8%2C310.0%20L441.8%2C252.0%20L492.1%2C223.0%20L542.3%2C252.0%20Z%20M642.8%2C310.0%20L592.5%2C339.0%20L542.3%2C310.0%20L542.3%2C252.0%20L592.5%2C223.0%20L642.8%2C252.0%20Z%20M90.2%2C397.0%20L40.0%2C426.0%20L-10.2%2C397.0%20L-10.2%2C339.0%20L40.0%2C310.0%20L90.2%2C339.0%20Z%20M190.7%2C397.0%20L140.5%2C426.0%20L90.2%2C397.0%20L90.2%2C339.0%20L140.5%2C310.0%20L190.7%2C339.0%20Z%20M291.1%2C397.0%20L240.9%2C426.0%20L190.7%2C397.0%20L190.7%2C339.0%20L240.9%2C310.0%20L291.1%2C339.0%20Z%20M391.6%2C397.0%20L341.4%2C426.0%20L291.1%2C397.0%20L291.1%2C339.0%20L341.4%2C310.0%20L391.6%2C339.0%20Z%20M492.1%2C397.0%20L441.8%2C426.0%20L391.6%2C397.0%20L391.6%2C339.0%20L441.8%2C310.0%20L492.1%2C339.0%20Z%20M592.5%2C397.0%20L542.3%2C426.0%20L492.1%2C397.0%20L492.1%2C339.0%20L542.3%2C310.0%20L592.5%2C339.0%20Z%20M140.5%2C484.0%20L90.2%2C513.0%20L40.0%2C484.0%20L40.0%2C426.0%20L90.2%2C397.0%20L140.5%2C426.0%20Z%20M240.9%2C484.0%20L190.7%2C513.0%20L140.5%2C484.0%20L140.5%2C426.0%20L190.7%2C397.0%20L240.9%2C426.0%20Z%20M341.4%2C484.0%20L291.1%2C513.0%20L240.9%2C484.0%20L240.9%2C426.0%20L291.1%2C397.0%20L341.4%2C426.0%20Z%20M441.8%2C484.0%20L391.6%2C513.0%20L341.4%2C484.0%20L341.4%2C426.0%20L391.6%2C397.0%20L441.8%2C426.0%20Z%20M542.3%2C484.0%20L492.1%2C513.0%20L441.8%2C484.0%20L441.8%2C426.0%20L492.1%2C397.0%20L542.3%2C426.0%20Z%20M642.8%2C484.0%20L592.5%2C513.0%20L542.3%2C484.0%20L542.3%2C426.0%20L592.5%2C397.0%20L642.8%2C426.0%20Z%22%20fill%3D%22none%22%20stroke%3D%22%2322c55e%22%20stroke-width%3D%221.5%22/%3E%20%3C/svg%3E"); }
[data-theme="purple"] body::before { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20600%20600%22%3E%20%3Cpath%20d%3D%22M540.2%2C399.5%20L399.5%2C540.2%20L200.5%2C540.2%20L59.8%2C399.5%20L59.8%2C200.5%20L200.5%2C59.8%20L399.5%2C59.8%20L540.2%2C200.5%20Z%20M475.5%2C372.7%20L372.7%2C475.5%20L227.3%2C475.5%20L124.5%2C372.7%20L124.5%2C227.3%20L227.3%2C124.5%20L372.7%2C124.5%20L475.5%2C227.3%20Z%20M410.9%2C345.9%20L345.9%2C410.9%20L254.1%2C410.9%20L189.1%2C345.9%20L189.1%2C254.1%20L254.1%2C189.1%20L345.9%2C189.1%20L410.9%2C254.1%20Z%22%20fill%3D%22none%22%20stroke%3D%22%23a855f7%22%20stroke-width%3D%223%22/%3E%20%3Cpath%20d%3D%22M174.2%2C533.9%20L179.4%2C546.2%20L191.7%2C551.4%20L179.4%2C556.6%20L174.2%2C568.9%20L169.0%2C556.6%20L156.8%2C551.4%20L169.0%2C546.2%20Z%20M600.9%2C433.5%20L605.0%2C443.2%20L614.7%2C447.3%20L605.0%2C451.4%20L600.9%2C461.0%20L596.8%2C451.4%20L587.2%2C447.3%20L596.8%2C443.2%20Z%20M609.3%2C408.5%20L612.1%2C415.2%20L618.8%2C418.0%20L612.1%2C420.8%20L609.3%2C427.5%20L606.5%2C420.8%20L599.8%2C418.0%20L606.5%2C415.2%20Z%20M53.3%2C399.1%20L56.4%2C406.2%20L63.5%2C409.2%20L56.4%2C412.3%20L53.3%2C419.4%20L50.3%2C412.3%20L43.1%2C409.2%20L50.3%2C406.2%20Z%20M-34.3%2C461.0%20L-31.1%2C468.5%20L-23.7%2C471.6%20L-31.1%2C474.8%20L-34.3%2C482.2%20L-37.4%2C474.8%20L-44.9%2C471.6%20L-37.4%2C468.5%20Z%20M358.2%2C621.6%20L364.5%2C636.6%20L379.5%2C642.9%20L364.5%2C649.3%20L358.2%2C664.3%20L351.9%2C649.3%20L336.9%2C642.9%20L351.9%2C636.6%20Z%20M20.8%2C131.4%20L27.2%2C146.6%20L42.5%2C153.0%20L27.2%2C159.5%20L20.8%2C174.7%20L14.3%2C159.5%20L-0.9%2C153.0%20L14.3%2C146.6%20Z%20M664.0%2C396.9%20L667.8%2C405.9%20L676.8%2C409.7%20L667.8%2C413.5%20L664.0%2C422.5%20L660.2%2C413.5%20L651.3%2C409.7%20L660.2%2C405.9%20Z%20M470.5%2C504.7%20L474.3%2C513.8%20L483.5%2C517.7%20L474.3%2C521.5%20L470.5%2C530.7%20L466.6%2C521.5%20L457.5%2C517.7%20L466.6%2C513.8%20Z%20M415.2%2C22.4%20L420.1%2C34.1%20L431.7%2C39.0%20L420.1%2C43.9%20L415.2%2C55.5%20L410.2%2C43.9%20L398.6%2C39.0%20L410.2%2C34.1%20Z%20M99.4%2C44.7%20L104.2%2C56.1%20L115.5%2C60.9%20L104.2%2C65.6%20L99.4%2C77.0%20L94.6%2C65.6%20L83.3%2C60.9%20L94.6%2C56.1%20Z%22%20fill%3D%22%23a855f7%22%20stroke%3D%22none%22/%3E%20%3C/svg%3E"); }
[data-theme="orange"] body::before { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20600%20600%22%3E%20%3Cg%20stroke%3D%22%23f97316%22%20stroke-linecap%3D%22round%22%3E%20%3Cline%20x1%3D%22600%22%20y1%3D%22-20%22%20x2%3D%22456%22%20y2%3D%22360%22%20stroke-width%3D%2210.0%22/%3E%20%3Cline%20x1%3D%22553%22%20y1%3D%22-20%22%20x2%3D%22411%22%20y2%3D%22356%22%20stroke-width%3D%229.4%22/%3E%20%3Cline%20x1%3D%22506%22%20y1%3D%22-20%22%20x2%3D%22366%22%20y2%3D%22351%22%20stroke-width%3D%228.9%22/%3E%20%3Cline%20x1%3D%22459%22%20y1%3D%22-20%22%20x2%3D%22320%22%20y2%3D%22346%22%20stroke-width%3D%228.3%22/%3E%20%3Cline%20x1%3D%22412%22%20y1%3D%22-20%22%20x2%3D%22275%22%20y2%3D%22342%22%20stroke-width%3D%227.8%22/%3E%20%3Cline%20x1%3D%22365%22%20y1%3D%22-20%22%20x2%3D%22230%22%20y2%3D%22338%22%20stroke-width%3D%227.2%22/%3E%20%3Cline%20x1%3D%22318%22%20y1%3D%22-20%22%20x2%3D%22185%22%20y2%3D%22333%22%20stroke-width%3D%226.7%22/%3E%20%3Cline%20x1%3D%22271%22%20y1%3D%22-20%22%20x2%3D%22140%22%20y2%3D%22328%22%20stroke-width%3D%226.1%22/%3E%20%3Cline%20x1%3D%22224%22%20y1%3D%22-20%22%20x2%3D%2294%22%20y2%3D%22324%22%20stroke-width%3D%225.6%22/%3E%20%3Cline%20x1%3D%22177%22%20y1%3D%22-20%22%20x2%3D%2249%22%20y2%3D%22320%22%20stroke-width%3D%225.0%22/%3E%20%3Cline%20x1%3D%22130%22%20y1%3D%22-20%22%20x2%3D%224%22%20y2%3D%22315%22%20stroke-width%3D%224.5%22/%3E%20%3Cline%20x1%3D%2283%22%20y1%3D%22-20%22%20x2%3D%22-41%22%20y2%3D%22310%22%20stroke-width%3D%223.9%22/%3E%20%3Cline%20x1%3D%2236%22%20y1%3D%22-20%22%20x2%3D%22-86%22%20y2%3D%22306%22%20stroke-width%3D%223.4%22/%3E%20%3C/g%3E%20%3C/svg%3E"); }

/* ============================================================
   PULPIT — ekran startowy po zalogowaniu
   ============================================================ */
.dashboard-greeting {
    display: flex;
    align-items: center;
    gap: 18px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-hover) 100%);
    border: 1px solid var(--border-color-light);
    border-left: 3px solid var(--accent-blue);
    border-radius: 10px;
    padding: 22px 26px;
    margin-bottom: 22px;
}
.dashboard-greeting-icon {
    flex-shrink: 0;
    width: 52px; height: 52px;
    border-radius: 12px;
    background: var(--accent-blue-dim);
    color: var(--accent-blue);
    display: flex; align-items: center; justify-content: center;
}
.dashboard-greeting-text { flex: 1; min-width: 0; }
.dashboard-greeting-title { font-size: 21px; font-weight: 700; margin-bottom: 4px; letter-spacing: 0.2px; }
.dashboard-greeting-sub { font-size: 13px; color: var(--text-muted); }

.dashboard-download-pending {
    flex-shrink: 0;
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px dashed var(--border-color-light);
    color: var(--text-dim);
    font-size: 12.5px; font-weight: 600;
    white-space: nowrap;
    cursor: default;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color-light);
    border-left: 3px solid var(--border-color-light);
    border-radius: 10px;
    padding: 18px 20px;
    transition: border-left-color 0.2s;
}
.dashboard-card-red { border-left-color: var(--accent-red); }
.dashboard-card-blue { border-left-color: var(--accent-blue); }
.dashboard-card-yellow { border-left-color: var(--accent-yellow); }

.dashboard-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.dashboard-card-icon {
    flex-shrink: 0;
    width: 30px; height: 30px;
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
}
.dashboard-card-icon svg { width: 16px; height: 16px; }
.dashboard-card-red .dashboard-card-icon { background: var(--accent-red-dim); color: var(--accent-red); }
.dashboard-card-blue .dashboard-card-icon { background: var(--accent-blue-dim); color: var(--accent-blue); }
.dashboard-card-yellow .dashboard-card-icon { background: var(--accent-yellow-dim); color: var(--accent-yellow); }
.dashboard-card-title {
    font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-muted);
}

.dashboard-card-list { display: flex; flex-direction: column; gap: 2px; }
.dashboard-list-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 4px; border-bottom: 1px solid var(--border-color);
    cursor: pointer; transition: background 0.15s;
}
.dashboard-list-item:last-child { border-bottom: none; }
.dashboard-list-item:hover { background: var(--bg-card-hover); }
.dashboard-list-item-main { min-width: 0; }
.dashboard-list-item-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dashboard-list-item-sub { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.dashboard-list-item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.dashboard-list-item-time { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); white-space: nowrap; }

@media (max-width: 860px) {
    .dashboard-greeting { flex-wrap: wrap; }
    .dashboard-download-pending { margin-left: 70px; }
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* ======================================================================
   DASHBOARD REDESIGN — sidebar po prawej (szklany panel), hero Pulpitu
   ze zdjęciem w tle, pieczęć wychodząca za krawędź, menu konta "•••".
   Zbudowane od zera na wzór dostarczonego mockupu. Style poniżej
   PODMIENIAJĄ/ROZSZERZAJĄ reguły .sidebar/.sidebar-menu zdefiniowane
   wyżej w pliku (kaskada — te niżej wygrywają przy tej samej
   specyficzności), więc stara wersja sidebara nigdy się nie renderuje,
   ale nic wyżej nie zostało fizycznie usunięte.
   ====================================================================== */

/* Sidebar wędruje na prawą stronę przez flex order — bez ruszania
   kolejności include'ów w PHP (index.php/panel.php nadal najpierw
   includują sidebar.php, potem otwierają .main-container). */
.main-container { order: 1; }
.sidebar {
    order: 2;
    width: 280px;
    background: rgba(9, 13, 22, 0.7);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-right: none;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    position: relative;
    overflow: visible;
}
/* position:sticky z góry ustawia .sidebar jako context pozycjonowania
   (tak samo jak position:relative) — .mdt-seal-wrap i .mdt-version
   kotwiczą się więc poprawnie do NIEGO, nie do całej strony. */

.sidebar-header { border-bottom: none; padding: 22px 22px 18px; position: relative; z-index: 3; }

.sidebar-header-top { display: flex; align-items: flex-start; gap: 12px; }

.mdt-badge-icon {
    width: 40px; height: 40px; flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--border-color-light);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
}
.mdt-badge-icon svg { width: 19px; height: 19px; }

.mdt-title-block { flex: 1; min-width: 0; padding-top: 1px; }
.mdt-title-block h1 { font-size: 16.5px; font-weight: 700; letter-spacing: 0.3px; color: var(--text-main); }
.mdt-title-block .subtitle {
    display: block; margin-top: 2px;
    font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 1.4px;
    text-transform: uppercase; color: var(--text-dim);
}

/* ---------- Menu konta "•••" (druga próba — patrz komentarz w sidebar.php) ---------- */
.acct-menu { position: relative; flex-shrink: 0; margin-top: 3px; }
.acct-menu-trigger {
    width: 26px; height: 26px; border: none; background: transparent;
    color: var(--text-dim); border-radius: 6px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background-color 0.15s, color 0.15s;
}
.acct-menu-trigger svg { width: 16px; height: 16px; }
.acct-menu-trigger:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-main); }

.acct-menu-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0; width: 208px;
    background: var(--bg-card);
    border: 1px solid var(--border-color-light);
    border-radius: 10px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
    padding: 6px;
    z-index: 80;
    overflow: hidden;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
}
.acct-menu-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }

.acct-menu-user {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 8px 12px; margin-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}
.acct-menu-avatar {
    width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
    background: var(--accent-blue-dim); color: var(--accent-blue);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12.5px;
}
.acct-menu-name { font-size: 12.5px; font-weight: 600; color: var(--text-main); }
.acct-menu-role { font-size: 10.5px; color: var(--text-dim); }

.acct-menu-item {
    width: 100%; display: flex; align-items: center; gap: 9px;
    padding: 9px 8px; background: transparent; border: none; border-radius: 6px;
    color: var(--text-muted); font-size: 12.5px; font-family: var(--font-ui);
    cursor: pointer; text-align: left; transition: background-color 0.15s, color 0.15s;
}
.acct-menu-item svg { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.85; }
.acct-menu-item:hover { background: var(--bg-card-hover); color: var(--text-main); }
.acct-menu-item-danger:hover { color: var(--accent-red); }
.acct-menu-dropdown form { margin: 0; }

/* ---------- Blok OFFICER ---------- */
.mdt-officer {
    display: flex; align-items: center; gap: 10px;
    margin-top: 18px; padding-top: 16px;
    border-top: 1px solid var(--border-color);
}
.mdt-officer-icon {
    width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
    background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.mdt-officer-icon svg { width: 15px; height: 15px; }
.mdt-officer-name { font-size: 12.5px; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.mdt-officer-status { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-dim); margin-top: 2px; }
.mdt-officer-status span { color: var(--accent-blue); font-weight: 600; }

/* ---------- Nav — płaska lista, wielkie litery, wersja "GPS readout" ---------- */
.sidebar-menu { padding: 10px 14px; gap: 1px; position: relative; z-index: 3; }
.sidebar-menu li a {
    text-transform: uppercase; letter-spacing: 0.7px; font-size: 12px; font-weight: 600;
    padding: 11px 13px; position: relative;
}
.sidebar-menu li.active a {
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
}
.sidebar-menu li.active a::before {
    content: ''; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px;
    border-radius: 2px; background: var(--accent-blue);
    box-shadow: 0 0 12px 1px var(--accent-blue);
}

/* ---------- Pieczęć — wychodzi za dolno-prawą krawędź panelu ---------- */
.mdt-seal-wrap {
    position: absolute; right: -18px; bottom: -40px; width: 260px; height: 260px;
    color: rgba(197, 210, 230, 0.14);
    pointer-events: none; z-index: 1;
}
.mdt-seal { width: 100%; height: 100%; }

.mdt-version {
    position: absolute; right: 18px; bottom: 16px; z-index: 2;
    font-family: var(--font-mono); font-size: 9px; letter-spacing: 1px;
    text-transform: uppercase; color: var(--text-dim); text-align: right; line-height: 1.6;
    pointer-events: none;
}

/* Kółko Panelu Zarządu — na lewo, żeby nie wchodziło w pieczęć w
   prawym dolnym rogu nowego sidebara. */
.zarzad-fab { left: 22px; right: auto; }
@media (max-width: 860px) {
    .zarzad-fab { left: 14px; right: auto; }
}

/* ======================================================================
   HERO PULPITU — zdjęcie w tle, napisy dekoracyjne, dolny pasek.
   Ujemne marginesy równe paddingowi .content-area (26px 28px) — hero
   rozlewa się na pełną szerokość/wysokość swojego kontenera, a kolejne
   sekcje (powitanie + karty) wracają do normalnego paddingu automatycznie.
   ====================================================================== */
.hero-dashboard {
    position: relative;
    margin: -26px -28px 28px;
    min-height: 620px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(4, 6, 12, 0.5) 0%, rgba(4, 6, 12, 0.72) 45%, rgba(4, 6, 12, 0.94) 100%),
        url('../img/hero-bg.jpg');
    background-size: cover;
    background-position: left bottom;
    background-repeat: no-repeat;
    border-bottom: 1px solid var(--border-color);
}

.hero-corner { position: absolute; top: 24px; left: 28px; z-index: 2; }
.hero-corner-tick {
    width: 9px; height: 9px; border-top: 1px solid rgba(210, 220, 235, 0.4);
    border-left: 1px solid rgba(210, 220, 235, 0.4); margin-bottom: 6px;
}
.hero-corner-title {
    font-family: var(--font-mono); font-size: 12px; font-weight: 600;
    letter-spacing: 1.5px; text-transform: uppercase; color: rgba(226, 232, 245, 0.85);
}
.hero-corner-motto {
    font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 1px;
    text-transform: uppercase; color: rgba(148, 163, 184, 0.5); margin-top: 3px;
}
.hero-corner-line { width: 36px; height: 2px; background: var(--accent-blue); margin-top: 10px; opacity: 0.85; }

.hero-topcenter {
    position: absolute; top: 26px; left: 50%; transform: translateX(-50%); z-index: 2;
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 7px;
    text-transform: uppercase; color: rgba(180, 195, 218, 0.32); white-space: nowrap;
}

.hero-watermark {
    position: absolute; top: 6px; left: 54px; z-index: 1;
    font-family: var(--font-ui); font-weight: 800; font-size: 190px; line-height: 1;
    letter-spacing: 2px; color: rgba(255, 255, 255, 0.035); user-select: none; white-space: nowrap;
}

.hero-vinewood {
    position: absolute; top: 44%; right: 64px; z-index: 1;
    font-family: var(--font-mono); font-size: 13px; letter-spacing: 6px;
    text-transform: uppercase; color: rgba(180, 195, 218, 0.11);
}

.hero-bottombar {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    padding: 16px 28px;
    display: flex; align-items: center; justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.hero-bottombar-label { display: flex; align-items: center; gap: 9px; }
.hero-bottombar-line { width: 22px; height: 2px; background: var(--accent-blue); opacity: 0.8; }
.hero-bottombar-text {
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 2px;
    text-transform: uppercase; color: rgba(210, 220, 235, 0.55);
}
.hero-bottombar-coords { text-align: center; }
.hero-bottombar-tick { width: 26px; height: 2px; background: var(--accent-blue); margin: 0 auto 6px; opacity: 0.7; }
.hero-bottombar-coords-text {
    font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1.5px; color: rgba(180, 195, 218, 0.4);
}
.hero-bottombar-spacer { width: 130px; } /* balansuje układ (prawa kolumna zajęta przez wersję MDT w sidebarze) */

@media (max-width: 900px) {
    .hero-watermark { font-size: 110px; }
    .hero-topcenter, .hero-vinewood { display: none; }
    .hero-dashboard { min-height: 420px; }
}

/* ======================================================================
   SETTINGS TAB — motyw (tylko Zarząd — api/site_settings.php PUT
   wymaga requireZarzad) + skrót zmiany hasła (dostępny dla każdego).
   ====================================================================== */
.settings-block { max-width: 520px; margin-bottom: 34px; }
.settings-block-title { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.settings-block-desc { font-size: 12.5px; color: var(--text-dim); margin-bottom: 16px; }
.theme-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.theme-picker-swatch {
    border: 1px solid var(--border-color-light); border-radius: 10px; padding: 12px 10px;
    background: var(--bg-card); cursor: pointer; text-align: left;
    transition: border-color 0.15s, transform 0.1s;
}
.theme-picker-swatch:hover { transform: translateY(-2px); }
.theme-picker-swatch.active { border-color: var(--accent-blue); box-shadow: 0 0 0 1px var(--accent-blue); }
.theme-picker-dot { width: 18px; height: 18px; border-radius: 50%; margin-bottom: 8px; }
.theme-picker-label { font-size: 11.5px; font-weight: 600; }

/* ======================================================================
   PREFERENCJE OSOBISTE (zakładka Ustawienia) — wiersz etykieta+kontrolka,
   przełącznik segmentowy (gęstość tabel), toggle switch (dźwięk).
   ====================================================================== */
.settings-block-wide { max-width: 640px; }

.pref-row {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 14px 0; border-bottom: 1px solid var(--border-color);
}
.pref-row:last-child { border-bottom: none; padding-bottom: 0; }
.pref-row-label { font-size: 13px; font-weight: 600; color: var(--text-main); }
.pref-row-desc { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; max-width: 340px; }

.pref-segmented {
    display: inline-flex; background: var(--bg-main); border: 1px solid var(--border-color-light);
    border-radius: 8px; padding: 3px; flex-shrink: 0;
}
.pref-segmented-btn {
    padding: 6px 13px; border-radius: 6px; border: none; background: transparent;
    color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}
.pref-segmented-btn.active { background: var(--accent-blue); color: white; }

.pref-toggle { position: relative; display: inline-block; flex-shrink: 0; cursor: pointer; }
.pref-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.pref-toggle-track {
    display: block; width: 42px; height: 24px; border-radius: 12px;
    background: var(--bg-main); border: 1px solid var(--border-color-light);
    transition: background-color 0.15s, border-color 0.15s; position: relative;
}
.pref-toggle-thumb {
    position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
    background: var(--text-dim); transition: transform 0.15s, background-color 0.15s;
}
.pref-toggle input:checked + .pref-toggle-track { background: var(--accent-blue-dim); border-color: var(--accent-blue); }
.pref-toggle input:checked + .pref-toggle-track .pref-toggle-thumb { transform: translateX(18px); background: var(--accent-blue); }
.pref-toggle input:focus-visible + .pref-toggle-track { outline: 2px solid var(--accent-blue); outline-offset: 2px; }

/* ---------- Skróty klawiszowe (lista informacyjna) ---------- */
.shortcuts-grid { display: flex; flex-direction: column; gap: 10px; }
.shortcuts-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.shortcuts-key {
    display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px;
    padding: 0 7px; border-radius: 6px; background: var(--bg-main); border: 1px solid var(--border-color-light);
    font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; color: var(--text-main);
}
.shortcuts-then { color: var(--text-dim); font-size: 11px; }
.shortcuts-label { color: var(--text-muted); margin-left: 4px; }

/* Gęstość tabel kompaktowa — zmniejsza padding wierszy .data-table na
   CAŁEJ stronie, gdy <body> dostaje tę klasę z app.js po odczytaniu
   preferencji. Celowo tylko padding (nie font-size) — zagęszcza układ
   bez pogarszania czytelności tekstu. */
body.density-compact .data-table th,
body.density-compact .data-table td { padding: 7px 12px; }
body.density-compact .dashboard-card-list-item,
body.density-compact .radio-log { padding-top: 6px; padding-bottom: 6px; }

/* ======================================================================
   BANERY OGŁOSZEŃ ZARZĄDU (Pulpit) — 3 warianty wg severity, ten sam
   wizualny wzorzec co .login-error/.empty-state (lewy pasek koloru +
   przezroczyste tło koloru akcentu), tylko poziomy pasek zamiast karty.
   ====================================================================== */
.announcement-banner {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 13px 16px; border-radius: 10px; margin-bottom: 12px;
    border-left: 3px solid; font-size: 13px; line-height: 1.5;
}
.announcement-banner-icon { flex-shrink: 0; margin-top: 1px; }
.announcement-banner-icon svg { width: 18px; height: 18px; }
.announcement-banner-text { flex: 1; color: var(--text-main); }

.announcement-banner-info { background: var(--accent-blue-dim); border-color: var(--accent-blue); }
.announcement-banner-info .announcement-banner-icon { color: var(--accent-blue); }
.announcement-banner-warning { background: var(--accent-yellow-dim); border-color: var(--accent-yellow); }
.announcement-banner-warning .announcement-banner-icon { color: var(--accent-yellow); }
.announcement-banner-urgent { background: var(--accent-red-dim); border-color: var(--accent-red); }
.announcement-banner-urgent .announcement-banner-icon { color: var(--accent-red); }

/* ---------- Panel Zarządu: lista ogłoszeń w zakładce Ustawienia ---------- */
.announcement-admin-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 11px 0; border-bottom: 1px solid var(--border-color); font-size: 12.5px;
}
.announcement-admin-row:last-child { border-bottom: none; }
.announcement-admin-row.is-inactive { opacity: 0.5; }
.announcement-admin-meta { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
