/* ── neoDASH Theme System ──────────────────────────────────────────────────── */
/* CSS-Variablen statt !important-Flut in applyTheme() / applyAdminTheme()    */

/* ── CSS-Variablen: Default-Werte (Dark Mode) ─────────────────────────────── */
:root {
    /* Akzentfarben (per Palette überschreibbar) */
    --neo-accent:   #8b5cf6;
    --neo-glow:     #8b5cf620;
    --neo-dim:      #8b5cf615;
    --neo-gradient: linear-gradient(135deg, #8b5cf6, #a855f7);

    /* Scrollbar */
    --neo-scrollbar-track: #1e293b;
    --neo-scrollbar-thumb: #334155;
    --neo-scrollbar-hover: #475569;

    /* Semantische Hintergrund-Tokens */
    --neo-bg-body:     #0f172a;
    --neo-bg-nav:      rgba(15,23,42,0.95);
    --neo-bg-card:     rgba(30,41,59,0.5);
    --neo-bg-elevated: #1e293b;
    --neo-bg-input:    rgba(15,23,42,0.8);
    --neo-bg-surface:  rgba(30,41,59,0.6);
    --neo-bg-code:     #0f172a;
    --neo-bg-hover:    rgba(51,65,85,0.5);

    /* Semantische Border-Tokens */
    --neo-border:        rgba(51,65,85,0.4);
    --neo-border-subtle: rgba(51,65,85,0.2);
    --neo-border-strong: #334155;

    /* Semantische Text-Tokens */
    --neo-text-base:  #e2e8f0;
    --neo-text-sub:   #94a3b8;
    --neo-text-muted: #64748b;
    --neo-text-dim:   #475569;
}

/* ── CSS-Variablen: Light Mode ────────────────────────────────────────────── */
html.light {
    /* Scrollbar */
    --neo-scrollbar-track: #f1f5f9;
    --neo-scrollbar-thumb: #cbd5e1;
    --neo-scrollbar-hover: #94a3b8;

    /* Semantische Hintergrund-Tokens */
    --neo-bg-body:     #f1f5f9;
    --neo-bg-nav:      rgba(255,255,255,0.85);
    --neo-bg-card:     rgba(255,255,255,0.7);
    --neo-bg-elevated: #ffffff;
    --neo-bg-input:    #f8fafc;
    --neo-bg-surface:  #e2e8f0;
    --neo-bg-code:     #f8fafc;
    --neo-bg-hover:    rgba(226,232,240,0.8);

    /* Semantische Border-Tokens */
    --neo-border:        #e2e8f0;
    --neo-border-subtle: #f1f5f9;
    --neo-border-strong: #cbd5e1;

    /* Semantische Text-Tokens */
    --neo-text-base:  #1e293b;
    --neo-text-sub:   #64748b;
    --neo-text-muted: #94a3b8;
    --neo-text-dim:   #334155;
}

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--neo-scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--neo-scrollbar-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--neo-scrollbar-hover); }

/* ── Accent-Farben: Immer aktiv (Dark + Light), per Variable ──────────────── */
.widget-card { border-color: var(--neo-dim); }
.widget-card:hover { border-color: var(--neo-glow); box-shadow: 0 0 20px var(--neo-dim); }
nav { border-bottom-color: var(--neo-glow); }
#value-sys-cpu { background-image: var(--neo-gradient); -webkit-background-clip: text; background-clip: text; }
#value-uptime  { background-image: var(--neo-gradient); -webkit-background-clip: text; background-clip: text; }
/* Avatar-Ring nutzt den Theme-Gradient via JS (style attribute) — kein CSS-Override */
/* Status-Dot Glow: nur innerhalb Widget-Cards, NICHT global (verhindert Überschreiben roter Dots) */
.widget-card .animate-pulse { box-shadow: 0 0 6px var(--neo-accent); }

/* ── Light Mode: Body & Layout ────────────────────────────────────────────── */
html.light body                      { background-color: var(--neo-bg-body); color: var(--neo-text-base); }
html.light footer                    { border-top-color: var(--neo-border); color: var(--neo-text-muted); }
html.light #grid-loader              { background-color: rgba(255,255,255,0.3); border-color: var(--neo-border); }
html.light #dnd-saved-hint           { background-color: rgba(255,255,255,0.95); }

/* ── Light Mode: Navigation ───────────────────────────────────────────────── */
html.light nav                       { background-color: var(--neo-bg-nav); border-bottom-color: var(--neo-dim); }
html.light nav,
html.light nav *                     { color: var(--neo-text-dim); }
html.light nav .text-red-400         { color: #dc2626; }
html.light nav .bg-red-600\/20       { background-color: #fee2e2; }
html.light nav .border-red-500\/30   { border-color: #fca5a5; }

/* ── Light Mode: Dropdowns ────────────────────────────────────────────────── */
html.light #user-dropdown,
html.light #admin-dropdown           { background-color: var(--neo-bg-elevated); border-color: var(--neo-border); }
html.light #user-dropdown *,
html.light #admin-dropdown *         { color: var(--neo-text-dim); }
html.light #user-dropdown button:hover,
html.light #user-dropdown a:hover    { background-color: var(--neo-bg-body); }
html.light #admin-dropdown .bg-slate-900\/50 { background-color: var(--neo-bg-body); }
html.light #admin-menu-btn           { background-color: rgba(255,255,255,0.6); border-color: var(--neo-border); }

/* ── Light Mode: Widget Cards ─────────────────────────────────────────────── */
html.light .widget-card              { background-color: var(--neo-bg-card); border-color: var(--neo-dim); backdrop-filter: blur(12px); }
html.light .widget-card:hover        { border-color: var(--neo-glow); box-shadow: 0 4px 24px var(--neo-dim); }
html.light .widget-card h3           { color: var(--neo-text-base); }
html.light .widget-card .text-cyan-400   { color: #0891b2; }
/* card-interne Hintergründe: abweichend vom globalen Defaultwert */
html.light .widget-card .bg-slate-900,
html.light .widget-card .bg-slate-900\/30,
html.light .widget-card .bg-slate-900\/50,
html.light .widget-card .bg-slate-900\/60 { background-color: var(--neo-border); }
html.light .widget-card .bg-slate-800\/40,
html.light .widget-card .bg-slate-800\/60 { background-color: rgba(226,232,240,0.9); }
html.light .widget-card .bg-slate-900\/20,
html.light .widget-card .bg-slate-800\/20 { background-color: rgba(241,245,249,0.6); }

/* ── Light Mode: Globale Tailwind-Overrides (token-basiert) ─────────────── */
/* Text */
html.light .text-slate-100,
html.light .text-slate-200           { color: var(--neo-text-base); }
html.light .text-slate-300           { color: var(--neo-text-dim); }
html.light .text-slate-400           { color: var(--neo-text-sub); }
html.light .text-slate-500,
html.light .text-slate-600           { color: var(--neo-text-muted); }
/* Hintergründe (slate) */
html.light .bg-slate-950,
html.light .bg-slate-950\/80         { background-color: var(--neo-bg-input); }
html.light .bg-slate-900,
html.light .bg-slate-900\/50         { background-color: var(--neo-bg-body); }
html.light .bg-slate-900\/30         { background-color: var(--neo-border); }
html.light .bg-slate-900\/40         { background-color: var(--neo-bg-input); }
html.light .bg-slate-800\/10         { background-color: rgba(255,255,255,0.4); }
html.light .bg-slate-800\/20,
html.light .bg-slate-800\/30         { background-color: rgba(255,255,255,0.5); }
html.light .bg-slate-800\/40         { background-color: rgba(255,255,255,0.7); }
html.light .bg-slate-800\/50,
html.light .bg-slate-800\/60,
html.light .bg-slate-800             { background-color: var(--neo-border); }
html.light .bg-slate-700\/50,
html.light .bg-slate-700\/60,
html.light .bg-slate-700\/70         { background-color: rgba(241,245,249,0.8); }
html.light .bg-slate-700             { background-color: var(--neo-border-strong); }
/* Borders (slate) */
html.light .border-slate-700\/20,
html.light .border-slate-700\/30,
html.light .border-slate-700\/40,
html.light .border-slate-600\/40     { border-color: var(--neo-border); }
html.light .border-slate-700\/50,
html.light .border-slate-700,
html.light .border-slate-600,
html.light .border-slate-600\/50,
html.light .border-slate-800         { border-color: var(--neo-border-strong); }
html.light .border-b.border-slate-700\/50 { border-color: var(--neo-border); }
/* Akzent-Proxy */
html.light .text-blue-400            { color: var(--neo-accent); }
html.light .bg-blue-600\/20,
html.light .bg-blue-500\/50          { background-color: var(--neo-dim); }
html.light .border-blue-500\/30      { border-color: var(--neo-glow); }
/* Sonstiges */
html.light .bg-black\/50             { background-color: var(--neo-bg-body); }
html.light .divide-slate-700\/30 > :not(:last-child) { border-color: var(--neo-border); }

/* ── Light Mode: Inputs & Formulare ──────────────────────────────────────── */
html.light input,
html.light select                    { background-color: var(--neo-bg-input); border-color: var(--neo-border-strong); color: var(--neo-text-base); }
html.light input::placeholder        { color: var(--neo-text-muted); }
html.light input:disabled,
html.light select:disabled           { background-color: var(--neo-border); color: var(--neo-text-muted); cursor: not-allowed; }
html.light textarea                  { background-color: var(--neo-bg-input); border-color: var(--neo-border-strong); color: var(--neo-text-base); }

/* ── Light Mode: Buttons ──────────────────────────────────────────────────── */
html.light button.text-slate-400     { color: var(--neo-text-sub); }
html.light button.text-slate-400:hover { color: var(--neo-text-base); }
html.light button.text-white         { color: white; }  /* Gradient-Buttons behalten weißen Text */
html.light .adm-span-btn             { color: var(--neo-text-sub); border-color: var(--neo-border-strong); }
html.light .adm-span-btn:hover       { color: var(--neo-text-base); background-color: var(--neo-border); }
html.light .bg-slate-800\/30:hover   { background-color: var(--neo-bg-body); }
html.light .peer:checked + div       { background-color: var(--neo-accent); }

/* ── Light Mode: Feedback-Boxen (Admin + Dashboard) ─────────────────────── */
html.light .bg-green-900\/30         { background-color: #d1fae5; }
html.light .border-green-700\/50     { border-color: #6ee7b7; }
html.light .text-green-400           { color: #059669; }
html.light .bg-red-900\/30           { background-color: #fee2e2; }
html.light .border-red-700\/50       { border-color: #fca5a5; }
html.light .text-red-400             { color: #dc2626; }

/* ── Light Mode: System Tab Farb-Karten (Admin) ──────────────────────────── */
html.light .bg-violet-500\/20        { background-color: #ede9fe; }
html.light .border-violet-500\/30    { border-color: #c4b5fd; }
html.light .bg-emerald-500\/20       { background-color: #d1fae5; }
html.light .border-emerald-500\/30   { border-color: #6ee7b7; }
html.light .bg-amber-500\/20         { background-color: #fef3c7; }
html.light .border-amber-500\/30     { border-color: #fcd34d; }
html.light .bg-amber-500\/5          { background-color: #fffbeb; }
html.light .border-amber-500\/20     { border-color: #fde68a; }
html.light .bg-rose-500\/20          { background-color: #ffe4e6; }
html.light .border-rose-500\/30      { border-color: #fda4af; }

/* ── Light Mode: Profile Modal ────────────────────────────────────────────── */
html.light #profile-modal > div      { background-color: var(--neo-bg-elevated); border-color: var(--neo-border); }
html.light #profile-modal .text-white      { color: var(--neo-text-base); }
html.light #profile-modal .bg-slate-950\/70 { background-color: rgba(0,0,0,0.3); }
html.light #profile-modal .bg-slate-800\/30,
html.light #profile-modal .bg-slate-800\/60 { background-color: var(--neo-bg-body); }
html.light #profile-modal .bg-slate-800\/40 { background-color: rgba(241,245,249,0.7); }
html.light #profile-modal .bg-slate-800\/50 { background-color: var(--neo-dim); }
html.light #profile-modal .border-blue-500  { border-color: var(--neo-accent); }
html.light #profile-modal button.text-slate-400:hover { color: var(--neo-text-base); background-color: var(--neo-bg-body); }

/* ── Light Mode: Persönliche Alarme (Profil-Tab) ──────────────────────────── */
html.light #profile-tab-alerts input[type="number"] { background-color: var(--neo-bg-input); border-color: var(--neo-border-strong); color: var(--neo-text-base); }
html.light #profile-tab-alerts .bg-slate-800\/40   { background-color: rgba(241,245,249,0.7); }

/* ── Light Mode: Theme-Grid ───────────────────────────────────────────────── */
html.light #theme-grid .bg-slate-800\/30     { background-color: var(--neo-bg-body); }
html.light #theme-grid .bg-slate-800\/60     { background-color: var(--neo-border); }

/* ── Light Mode: Log-Modal (Logs & CONNS) ─────────────────────────────────── */
html.light #log-modal                         { background-color: rgba(0,0,0,0.25); }
html.light #log-modal > div                   { background-color: rgba(255,255,255,0.97); border-color: var(--neo-border); }
html.light #log-modal .bg-slate-900\/90       { background-color: rgba(255,255,255,0.95); }
html.light #log-modal pre                     { background-color: var(--neo-bg-code); border-color: var(--neo-border); color: var(--neo-text-dim); }
html.light #log-modal .bg-black\/50           { background-color: var(--neo-bg-code); color: var(--neo-text-dim); }

/* ── Light Mode: Edit-Toolbar (Layout-Modus) ──────────────────────────────── */
html.light #edit-toolbar                       { background-color: rgba(255,255,255,0.6); border-color: var(--neo-glow); }
html.light #edit-toolbar .text-blue-300,
html.light #edit-toolbar .text-blue-400\/70    { color: var(--neo-accent); }

/* ── Light Mode: Toast + Sonstiges ────────────────────────────────────────── */
html.light #toast-container .bg-slate-900\/95  { background-color: rgba(255,255,255,0.95); }
html.light .bg-slate-900\/30 .text-slate-500   { color: var(--neo-text-dim); }

/* ── Light Mode: Admin — Sonstige Panels ─────────────────────────────────── */
html.light #create-user-panel                  { background-color: var(--neo-bg-card); }
html.light .bg-amber-500\/5                    { background-color: #fffbeb; }
html.light .border-amber-500\/20               { border-color: #fde68a; }

/* ── Theme-aware Tab Indicator (ersetzt hardcodiertes text-blue-400/border-blue-500) */
.neo-tab-active {
    color: var(--neo-accent);
    border-bottom: 2px solid var(--neo-accent);
    margin-bottom: -1px;
    background-color: var(--neo-dim);
}
html.light .neo-tab-active { background-color: var(--neo-dim); }

/* ══════════════════════════════════════════════════════════════
   SEMANTISCHE KOMPONENTEN-KLASSEN
   Farbe kommt ausschließlich aus Tokens — Layout (rounded, p-*,
   gap-*, overflow-*) bleibt Tailwind-Sache im HTML.
   ══════════════════════════════════════════════════════════════ */

/* Karte / Panel */
.neo-card {
    background-color: var(--neo-bg-card);
    border-color: var(--neo-border);
}

/* Semi-transparente Innenfläche (z. B. Sektion innerhalb einer Card) */
.neo-card-surface {
    background-color: var(--neo-bg-surface);
    border-color: var(--neo-border-subtle);
}

/* Ghost-Button (sekundäre Aktionen, Filter, Toggle-Buttons) */
.neo-btn-ghost {
    background-color: var(--neo-bg-surface);
    border-color: var(--neo-border);
    transition: background-color 150ms ease, border-color 150ms ease;
}
.neo-btn-ghost:hover {
    background-color: var(--neo-bg-hover);
    border-color: var(--neo-border-strong);
}

/* Code-/Mono-Block (außerhalb benannter IDs wie #server-apt-log) */
.neo-code {
    background-color: var(--neo-bg-code);
    border: 1px solid var(--neo-border);
    color: var(--neo-text-base);
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* Tabellen-Container */
.neo-table-wrap {
    background-color: var(--neo-bg-card);
    border-color: var(--neo-border);
}

/* Kleines Inline-Input (nicht vom globalen html.light input abgedeckt) */
.neo-input-sm {
    background-color: var(--neo-bg-input);
    border: 1px solid var(--neo-border-strong);
    color: var(--neo-text-base);
}
.neo-input-sm::placeholder {
    color: var(--neo-text-muted);
}

/* ══════════════════════════════════════════════════════════════
   ADMIN SIDEBAR
   ══════════════════════════════════════════════════════════════ */

:root {
    --sidebar-w: 220px;
    --sidebar-w-collapsed: 56px;
    --topnav-h: 65px;
}

#admin-sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    min-height: calc(100vh - var(--topnav-h));
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(100, 116, 139, 0.10);
    border-top: 2px solid var(--neo-accent);
    transition: width 220ms ease, min-width 220ms ease, border-top-color 300ms ease;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: var(--topnav-h);
    max-height: calc(100vh - var(--topnav-h));
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--neo-glow) transparent;
}

#admin-sidebar.neo-collapsed {
    width: var(--sidebar-w-collapsed);
    min-width: var(--sidebar-w-collapsed);
}

/* ── Toggle ── */
.neo-sidebar-toggle-wrap {
    display: flex;
    justify-content: flex-end;
    padding: 10px 10px 4px;
    flex-shrink: 0;
}

#admin-sidebar.neo-collapsed .neo-sidebar-toggle-wrap {
    justify-content: center;
    padding: 10px 0 4px;
}

.neo-sidebar-toggle {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(100, 116, 139, 0.18);
    background: rgba(100, 116, 139, 0.07);
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 150ms ease;
    flex-shrink: 0;
}

.neo-sidebar-toggle:hover {
    background: var(--neo-glow);
    border-color: var(--neo-accent);
    color: var(--neo-accent);
}

/* ── Command Palette Button ── */
.neo-sidebar-search {
    padding: 4px 8px 8px;
    flex-shrink: 0;
}

.neo-sidebar-search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 9px;
    border-radius: 8px;
    border: 1px solid rgba(100, 116, 139, 0.14);
    background: rgba(100, 116, 139, 0.05);
    color: #475569;
    cursor: pointer;
    transition: all 150ms ease;
    overflow: hidden;
    white-space: nowrap;
}

.neo-sidebar-search-btn:hover {
    border-color: var(--neo-accent);
    background: var(--neo-glow);
    color: #94a3b8;
}

.neo-sidebar-kbd {
    margin-left: auto;
    font-size: 9px;
    font-family: monospace;
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid rgba(100, 116, 139, 0.22);
    background: rgba(100, 116, 139, 0.08);
    color: #475569;
    flex-shrink: 0;
    transition: opacity 150ms ease;
}

#admin-sidebar.neo-collapsed .neo-sidebar-search-btn {
    padding: 7px 0;
    justify-content: center;
    border-color: transparent;
    background: transparent;
    gap: 0;
}

#admin-sidebar.neo-collapsed .neo-sidebar-kbd {
    display: none;
}

/* ── Groups ── */
.neo-sidebar-group {
    flex-shrink: 0;
    padding-bottom: 4px;
}

.neo-sidebar-group + .neo-sidebar-group {
    border-top: 1px solid rgba(100, 116, 139, 0.07);
    margin-top: 2px;
    padding-top: 2px;
}

.neo-sidebar-group-header {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--neo-accent);
    opacity: 0.45;
    padding: 10px 16px 3px;
    white-space: nowrap;
    overflow: hidden;
    max-height: 30px;
    transition: max-height 180ms ease, opacity 180ms ease, padding 180ms ease;
}

#admin-sidebar.neo-collapsed .neo-sidebar-group-header {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* ── Items ── */
.neo-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 14px 9px 13px;
    border: none;
    border-left: 3px solid transparent;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
    text-align: left;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.neo-sidebar-item:hover {
    background: var(--neo-dim);
    color: #cbd5e1;
}

.neo-sidebar-item.neo-tab-active {
    border-left-color: var(--neo-accent) !important;
    border-bottom: none;
    margin-bottom: 0;
    background: var(--neo-glow);
    color: var(--neo-accent);
}

.neo-sidebar-item svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.neo-sidebar-label {
    font-size: 13px;
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 150ms ease;
}

#admin-sidebar.neo-collapsed .neo-sidebar-label {
    opacity: 0;
    max-width: 0;
    flex: none;
}

#admin-sidebar.neo-collapsed .neo-sidebar-item {
    padding: 10px 0;
    justify-content: center;
    border-left-color: transparent !important;
    gap: 0;
}

#admin-sidebar.neo-collapsed .neo-sidebar-item.neo-tab-active {
    background: var(--neo-glow);
    color: var(--neo-accent);
}

/* Active accent dot below icon when collapsed */
#admin-sidebar.neo-collapsed .neo-sidebar-item.neo-tab-active::before {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--neo-accent);
    box-shadow: 0 0 6px var(--neo-accent);
}

/* Tooltip on hover when collapsed */
#admin-sidebar.neo-collapsed .neo-sidebar-item:hover::after {
    content: attr(title);
    position: fixed;
    left: calc(var(--sidebar-w-collapsed) + 8px);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(100, 116, 139, 0.25);
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 8px;
    white-space: nowrap;
    z-index: 200;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

/* ── Sidebar Scrollbar ── */
#admin-sidebar::-webkit-scrollbar { width: 3px; }
#admin-sidebar::-webkit-scrollbar-track { background: transparent; }
#admin-sidebar::-webkit-scrollbar-thumb { background: var(--neo-glow); border-radius: 3px; }
#admin-sidebar::-webkit-scrollbar-thumb:hover { background: var(--neo-accent); }

/* ── Content Area ── */
#admin-content {
    flex: 1;
    min-width: 0;
    padding: 24px;
}

/* ── Sidebar Footer ── */
.neo-sidebar-footer {
    margin-top: auto;
    padding: 8px 8px 10px;
    border-top: 1px solid rgba(100, 116, 139, 0.10);
    flex-shrink: 0;
}

.neo-sidebar-theme-dots {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 2px;
    flex-wrap: wrap;
}

#admin-sidebar.neo-collapsed .neo-sidebar-theme-dots {
    justify-content: center;
    gap: 4px;
}

.neo-sidebar-theme-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    transition: border-color 150ms ease, transform 150ms ease;
    padding: 0;
}

.neo-sidebar-theme-dot.active {
    border-color: rgba(255, 255, 255, 0.75);
    transform: scale(1.25);
}

.neo-sidebar-theme-dot:hover:not(.active) {
    transform: scale(1.15);
}

.neo-sidebar-mode-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 2px 2px;
}

.neo-sidebar-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid rgba(100, 116, 139, 0.14);
    background: transparent;
    color: #475569;
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    transition: all 150ms ease;
    white-space: nowrap;
    overflow: hidden;
}

.neo-sidebar-mode-btn.active {
    background: var(--neo-glow);
    border-color: var(--neo-accent);
    color: var(--neo-accent);
}

.neo-sidebar-mode-btn:hover:not(.active) {
    background: rgba(100, 116, 139, 0.08);
    color: #94a3b8;
}

#admin-sidebar.neo-collapsed .neo-sidebar-mode-toggle {
    gap: 3px;
}

#admin-sidebar.neo-collapsed .neo-sidebar-mode-btn span {
    display: none;
}

#admin-sidebar.neo-collapsed .neo-sidebar-mode-btn {
    padding: 6px 0;
    flex: 1;
    justify-content: center;
}

/* ── Light Mode ── */
html.light #admin-sidebar {
    background: rgba(248, 250, 252, 0.92);
    border-right-color: rgba(148, 163, 184, 0.18);
}

html.light .neo-sidebar-toggle {
    border-color: #e2e8f0;
    background: rgba(241,245,249,0.6);
    color: #94a3b8;
}

html.light .neo-sidebar-search-btn {
    border-color: #e2e8f0;
    background: rgba(241,245,249,0.5);
    color: #94a3b8;
}

html.light .neo-sidebar-search-btn:hover {
    color: #334155;
}

html.light .neo-sidebar-kbd {
    border-color: #e2e8f0;
    color: #94a3b8;
}

html.light .neo-sidebar-item {
    color: #94a3b8;
}

html.light .neo-sidebar-item:hover {
    color: #334155;
}

html.light .neo-sidebar-item.neo-tab-active {
    color: var(--neo-accent);
}

html.light .neo-sidebar-group + .neo-sidebar-group {
    border-top-color: rgba(148, 163, 184, 0.15);
}

html.light #admin-sidebar.neo-collapsed .neo-sidebar-item:hover::after {
    background: rgba(255,255,255,0.97);
    border-color: #e2e8f0;
    color: #1e293b;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

html.light .neo-sidebar-footer {
    border-top-color: rgba(148, 163, 184, 0.18);
}

html.light .neo-sidebar-theme-dot.active {
    border-color: rgba(15, 23, 42, 0.55);
}

html.light .neo-sidebar-mode-btn {
    color: #94a3b8;
    border-color: #e2e8f0;
}

html.light .neo-sidebar-mode-btn:hover:not(.active) {
    background: rgba(148, 163, 184, 0.12);
    color: #475569;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION
   ══════════════════════════════════════════════════════════════ */

/* Hide desktop sidebar on mobile */
@media (max-width: 767px) {
    #admin-sidebar { display: none !important; }
    #admin-content { padding: 16px 16px calc(56px + env(safe-area-inset-bottom) + 16px) 16px; }
}

/* Bottom Nav: always fixed, hidden on desktop */
#mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 2px solid var(--neo-accent);
    z-index: 90;
    align-items: stretch;
    justify-content: space-around;
    transition: border-top-color 300ms ease;
}

@media (max-width: 767px) {
    #mobile-bottom-nav { display: flex; }
}

.neo-mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 2px;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    position: relative;
    transition: color 150ms ease;
    overflow: hidden;
}

.neo-mobile-nav-btn.active { color: var(--neo-accent); }

.neo-mobile-nav-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    pointer-events: none;
}

.neo-mobile-nav-label {
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1;
    pointer-events: none;
}

.neo-mobile-nav-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--neo-accent);
    box-shadow: 0 0 6px var(--neo-accent);
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 150ms ease;
}

.neo-mobile-nav-btn.active .neo-mobile-nav-dot { opacity: 1; }

/* Sheet backdrop */
#mobile-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 95;
    opacity: 0;
    pointer-events: none;
    transition: opacity 250ms ease;
}

#mobile-sheet-backdrop.neo-open {
    opacity: 1;
    pointer-events: auto;
}

/* Slide-up sheet */
#mobile-sheet {
    position: fixed;
    bottom: calc(56px + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(100, 116, 139, 0.20);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    z-index: 96;
    max-height: 65vh;
    overflow-y: auto;
    transform: translateY(calc(100% + 24px));
    visibility: hidden;
    transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0ms 280ms;
}

#mobile-sheet.neo-open {
    transform: translateY(0);
    visibility: visible;
    transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0ms 0ms;
}

.neo-mobile-sheet-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(100, 116, 139, 0.35);
    margin: 10px auto 0;
}

.neo-mobile-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 8px;
    border-bottom: 1px solid rgba(100, 116, 139, 0.10);
}

.neo-mobile-sheet-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(100, 116, 139, 0.18);
    background: rgba(100, 116, 139, 0.07);
    color: #64748b;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 150ms ease;
}

.neo-mobile-sheet-close:hover {
    background: var(--neo-glow);
    border-color: var(--neo-accent);
    color: var(--neo-accent);
}

.neo-mobile-sheet-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-left: 3px solid transparent;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.neo-mobile-sheet-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    pointer-events: none;
}

.neo-mobile-sheet-item:hover {
    background: var(--neo-dim);
    color: #e2e8f0;
}

.neo-mobile-sheet-item.neo-tab-active {
    border-left-color: var(--neo-accent) !important;
    background: var(--neo-glow);
    color: var(--neo-accent);
}

/* Light mode overrides */
html.light #mobile-bottom-nav {
    background: rgba(255, 255, 255, 0.95);
}

html.light .neo-mobile-nav-btn { color: var(--neo-text-muted); }
html.light .neo-mobile-nav-btn.active { color: var(--neo-accent); }

html.light #mobile-sheet-backdrop { background: rgba(0, 0, 0, 0.3); }

html.light #mobile-sheet {
    background: rgba(248, 250, 252, 0.98);
    border-color: rgba(148, 163, 184, 0.25);
}

html.light .neo-mobile-sheet-header {
    border-bottom-color: rgba(148, 163, 184, 0.18);
}

html.light .neo-mobile-sheet-item { color: var(--neo-text-sub); }
html.light .neo-mobile-sheet-item:hover { background: var(--neo-dim); color: var(--neo-text-base); }

/* ══════════════════════════════════════════════════════════════
   COMMAND PALETTE
   ══════════════════════════════════════════════════════════════ */

#cmd-palette-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
}

#cmd-palette-overlay.neo-open {
    opacity: 1;
    pointer-events: auto;
}

#cmd-palette {
    width: 100%;
    max-width: 560px;
    margin: 0 16px;
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(100, 116, 139, 0.25);
    border-top: 2px solid var(--neo-accent);
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.03);
    overflow: hidden;
    transform: scale(0.96) translateY(-8px);
    transition: transform 220ms cubic-bezier(0.32, 0.72, 0, 1);
}

#cmd-palette-overlay.neo-open #cmd-palette {
    transform: scale(1) translateY(0);
}

.neo-cmd-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(100, 116, 139, 0.12);
}

.neo-cmd-search-wrap svg {
    width: 18px;
    height: 18px;
    color: #475569;
    flex-shrink: 0;
}

#cmd-palette-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e2e8f0;
    font-size: 15px;
    font-weight: 500;
    caret-color: var(--neo-accent);
    min-width: 0;
}

#cmd-palette-input::placeholder { color: #475569; }

.neo-cmd-esc-badge {
    font-size: 10px;
    font-family: monospace;
    padding: 2px 6px;
    border-radius: 5px;
    border: 1px solid rgba(100, 116, 139, 0.22);
    background: rgba(100, 116, 139, 0.08);
    color: #475569;
    flex-shrink: 0;
}

#cmd-palette-results {
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--neo-glow) transparent;
}

#cmd-palette-results::-webkit-scrollbar { width: 3px; }
#cmd-palette-results::-webkit-scrollbar-track { background: transparent; }
#cmd-palette-results::-webkit-scrollbar-thumb { background: var(--neo-glow); border-radius: 3px; }
#cmd-palette-results::-webkit-scrollbar-thumb:hover { background: var(--neo-accent); }

.neo-cmd-section-label {
    padding: 8px 16px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--neo-accent);
    opacity: 0.5;
    white-space: nowrap;
}

.neo-cmd-empty {
    padding: 28px 16px;
    text-align: center;
    color: #475569;
    font-size: 13px;
    font-style: italic;
}

.neo-cmd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 14px;
    border: none;
    border-left: 3px solid transparent;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    text-align: left;
    transition: background 100ms ease, color 100ms ease, border-color 100ms ease;
}

.neo-cmd-item:hover,
.neo-cmd-item.neo-cmd-selected {
    background: var(--neo-glow);
    color: #e2e8f0;
    border-left-color: var(--neo-accent);
}

.neo-cmd-item.neo-cmd-item-current {
    color: var(--neo-accent);
    border-left-color: var(--neo-accent);
    background: var(--neo-glow);
}

.neo-cmd-item-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    opacity: 0.7;
}

.neo-cmd-item-icon svg { width: 16px; height: 16px; }

.neo-cmd-item-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.neo-cmd-item-label {
    font-size: 13px;
    font-weight: 600;
    color: inherit;
}

.neo-cmd-item-group {
    font-size: 11px;
    color: #475569;
}

.neo-cmd-item-current-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0,0,0,0.2);
    color: var(--neo-accent);
    border: 1px solid var(--neo-glow);
    flex-shrink: 0;
}

.neo-cmd-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 16px;
    border-top: 1px solid rgba(100, 116, 139, 0.10);
    font-size: 11px;
    color: #334155;
}

.neo-cmd-footer kbd {
    font-family: monospace;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid rgba(100, 116, 139, 0.22);
    background: rgba(100, 116, 139, 0.08);
    color: #475569;
    font-size: 10px;
    margin-right: 2px;
}

/* Light mode */
html.light #cmd-palette-overlay { background: rgba(0, 0, 0, 0.4); }

html.light #cmd-palette {
    background: rgba(248, 250, 252, 0.98);
    border-color: rgba(148, 163, 184, 0.30);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
}

html.light .neo-cmd-search-wrap { border-bottom-color: rgba(148, 163, 184, 0.20); }
html.light #cmd-palette-input { color: var(--neo-text-base); }
html.light #cmd-palette-input::placeholder { color: var(--neo-text-muted); }
html.light .neo-cmd-item { color: var(--neo-text-sub); }
html.light .neo-cmd-item:hover,
html.light .neo-cmd-item.neo-cmd-selected { background: var(--neo-dim); color: var(--neo-text-base); }
html.light .neo-cmd-item.neo-cmd-item-current { color: var(--neo-accent); background: var(--neo-glow); }
html.light .neo-cmd-item-group { color: var(--neo-text-muted); }
html.light .neo-cmd-footer { border-top-color: rgba(148, 163, 184, 0.18); color: var(--neo-text-muted); }
html.light .neo-cmd-footer kbd { color: var(--neo-text-muted); border-color: var(--neo-border); }

/* ── Theme-aware Range/Segment-Selektor (histSetRange) ──────────────────────── */
.neo-range-active {
    color: var(--neo-accent);
    background-color: var(--neo-dim);
}

/* ── Light Mode: Text-Selektion ─────────────────────────────────────────── */
html.light ::selection  { background-color: var(--neo-dim); color: var(--neo-text-base); }

/* ── Light Mode: Badge-Farben (Admin + Historie) ─────────────────────────── */
html.light .bg-violet-500\/15                  { background-color: #ede9fe; }
html.light .bg-cyan-500\/10                    { background-color: #ecfeff; }
html.light .bg-red-500\/10                     { background-color: #fff1f2; }
html.light .bg-amber-500\/10                   { background-color: #fffbeb; }
html.light .bg-indigo-500\/10                  { background-color: #eef2ff; }
html.light .bg-emerald-500\/5                  { background-color: #f0fdf4; }
html.light .text-cyan-400                      { color: #0891b2; }
html.light .text-amber-400                     { color: #d97706; }
html.light .text-red-400                       { color: #dc2626; }

/* ── Light Mode: Admin — Confirm-Modal ────────────────────────────────────── */
html.light #confirm-modal > div                { background-color: var(--neo-bg-elevated); border-color: var(--neo-border); }

/* ── Light Mode: Admin — Addon-Preview-Modal ─────────────────────────────── */
html.light #addon-preview-modal > div          { background-color: var(--neo-bg-elevated); border-color: var(--neo-border); }
html.light #addon-preview-iframe               { background-color: var(--neo-bg-input); }

/* ── Light Mode: Admin — Edit-User-Modal ────────────────────────────────── */
html.light #edit-user-modal > div              { background-color: rgba(0,0,0,0.25); }
html.light #edit-user-modal > div > div        { background-color: var(--neo-bg-elevated); border-color: var(--neo-border); }

/* ── Light Mode: Admin — Server-Tab (apt-log, sonstige divs) ─────────────── */
html.light #server-apt-log                     { background-color: var(--neo-bg-code); border-color: var(--neo-border); color: var(--neo-text-dim); }
html.light #server-apt-log .text-emerald-400   { color: #059669; }
html.light #server-apt-log .text-red-400       { color: #dc2626; }

/* ── Light Mode: Admin — Tab-Navigations-Bereich ─────────────────────────── */
html.light [id^="atab-"]                       { color: var(--neo-text-sub); }
html.light [id^="atab-"]:hover                 { color: var(--neo-text-base); }
html.light [id^="ptab-"]                       { color: var(--neo-text-sub); }
html.light [id^="ptab-"]:hover                 { color: var(--neo-text-base); }

/* ── Light Mode: Admin — Historie-Tab Card-Header ────────────────────────── */
html.light #hist-charts-grid .bg-slate-800\/60 { background-color: rgba(255,255,255,0.9); }
html.light #hist-charts-grid .border-b.border-slate-700\/30 { border-color: var(--neo-border-subtle); }

/* ── Light Mode: Admin — Validation Report (Addon) ───────────────────────── */
html.light .bg-green-500\/5                    { background-color: #f0fdf4; }
html.light .border-green-500\/30               { border-color: #6ee7b7; }
html.light .text-green-400                     { color: #059669; }
html.light .bg-yellow-500\/5                   { background-color: #fefce8; }
html.light .border-yellow-500\/30              { border-color: #fde047; }
html.light .text-yellow-400                    { color: #ca8a04; }

/* ── Admin — Permissions Panel Layout ───────────────────────────────────── */
@media (min-width: 768px) {
    #perm-panel-wrap { height: calc(100vh - 170px); min-height: 480px; }
    #perm-sidebar { max-height: unset; border-bottom: none; padding-bottom: 0; }
}
@media (max-width: 767px) {
    #perm-sidebar { max-height: 280px; overflow-y: auto; border-bottom: 1px solid rgba(100,116,139,0.25); padding-bottom: 12px; margin-bottom: 8px; }
    #perm-editor { padding-left: 0; }
}
