/* ═══════════════════════════════════════════════════════════
   GLD Process — Industrial Precision Design System
   Dark navy backgrounds, cyan accent, glass cards
   Inter + JetBrains Mono fonts
   ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════════════ */
:root {
    /* Backgrounds */
    --bg-root: #0a0f1a;
    --bg-surface: #0d1220;
    --bg-elevated: #111827;
    --bg-card: rgba(255,255,255,0.025);
    --bg-card-hover: rgba(255,255,255,0.04);
    --bg-input: rgba(255,255,255,0.04);
    --bg-glass: rgba(255,255,255,0.03);
    --bg-glass-strong: rgba(255,255,255,0.06);

    /* Borders */
    --border: rgba(255,255,255,0.06);
    --border-subtle: rgba(255,255,255,0.04);
    --border-strong: rgba(255,255,255,0.10);

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-disabled: #334155;

    /* Accent Colors */
    --cyan: #06b6d4;
    --cyan-dim: rgba(6,182,212,0.15);
    --cyan-glow: rgba(6,182,212,0.25);
    --emerald: #10b981;
    --emerald-dim: rgba(16,185,129,0.15);
    --red: #ef4444;
    --red-dim: rgba(239,68,68,0.12);
    --amber: #f59e0b;
    --amber-dim: rgba(245,158,11,0.12);
    --purple: #a855f7;
    --purple-dim: rgba(168,85,247,0.12);
    --green: #22c55e;
    --orange: #f97316;

    /* Spacing & Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Layout */
    --navbar-height: 52px;
    --toolbar-height: 44px;
    --sidebar-width: 360px;
}

/* ═══════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background: var(--bg-root);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Subtle grid pattern on body */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(255,255,255,0.015) 1px, transparent 0);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* Push page content below fixed navbar */
body:has(#gld-navbar) {
    padding-top: var(--navbar-height);
}

/* Hidden file inputs */
#fileInput, #folderInput { display: none; }

/* Utility */
.hidden { display: none; }

/* ═══════════════════════════════════════════════════
   NAVBAR (#gld-navbar — single row, injected by nav.js)
   ═══════════════════════════════════════════════════ */
#gld-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 4px;
    flex-wrap: nowrap;
    background: rgba(10,15,26,0.85);
    backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 8px;
    flex-shrink: 0;
}
.nav-brand-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 20px rgba(6,182,212,0.3);
}
.nav-brand-icon svg { width: 18px; height: 18px; fill: none; stroke: white; stroke-width: 2; }
.nav-brand-text {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}
.nav-brand-version {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-glass);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: -4px;
}

/* Legacy nav-logo support */
.nav-logo {
    height: 22px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}
.nav-link {
    padding: 6px 12px;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    position: relative;
}
.nav-link:hover {
    color: var(--text-secondary);
    background: var(--bg-glass);
}
.nav-link--active {
    color: var(--text-primary);
    background: var(--bg-glass-strong);
}
.nav-link--active::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 2px;
    background: var(--cyan);
    border-radius: 1px;
}

.nav-spacer { flex: 1; }

/* Nav user area */
.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}
.nav-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan-dim), var(--purple-dim));
    border: 1px solid var(--border-strong);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: var(--cyan);
}
.nav-username {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}
.nav-logout {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    margin-left: 8px;
}
.nav-logout:hover {
    border-color: var(--red);
    color: var(--red);
    background: var(--red-dim);
}

/* User dropdown trigger */
.nav-user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.nav-user-trigger:hover {
    background: var(--bg-glass);
    border-color: var(--border);
}
.nav-user-trigger .nav-chevron {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

/* Dropdown menu */
.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 0;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03);
    z-index: 300;
    animation: dropIn 0.2s ease;
    overflow: hidden;
}
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.nav-dropdown.open { display: block; }
.nav-drop-header {
    padding: 16px 18px 14px;
    background: linear-gradient(180deg, rgba(6,182,212,0.06) 0%, transparent 100%);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}
.nav-drop-header::before {
    content: '';
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan-dim), rgba(168,85,247,0.12));
    border: 1px solid var(--border-strong);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.nav-drop-info { display: flex; flex-direction: column; }
.nav-drop-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.nav-drop-role {
    font-size: 11px;
    font-weight: 600;
    color: var(--cyan);
    letter-spacing: 0.02em;
}
.nav-drop-body {
    padding: 6px;
}
.nav-drop-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    text-align: left;
    text-decoration: none;
}
.nav-drop-item:hover {
    background: var(--bg-glass-strong);
    color: var(--text-primary);
}
.nav-drop-item--danger {
    color: var(--text-muted);
}
.nav-drop-item--danger:hover {
    background: var(--red-dim);
    color: var(--red);
}
.nav-drop-sep {
    height: 1px;
    background: var(--border);
    margin: 2px 6px;
}

/* ═══════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════ */

/* Login body (standalone login pages) */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: auto;
}

.login-card {
    width: 400px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    padding: 48px 40px 40px;
    position: relative;
    z-index: 1;
    box-shadow: 0 24px 80px rgba(0,0,0,0.4), 0 0 60px rgba(6,182,212,0.08);
}
.login-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(6,182,212,0.15) 0%, transparent 40%);
    z-index: -1;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    padding: 1px;
}

.login-logo-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 8px;
}
.login-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 30px rgba(6,182,212,0.3);
}
.login-icon svg { width: 24px; height: 24px; fill: none; stroke: white; stroke-width: 2; }

/* Legacy login elements */
.login-logo {
    height: 40px;
    object-fit: contain;
    margin-bottom: 8px;
}
.login-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.login-subtitle {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 32px;
}
.login-tagline {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.login-footer-logo {
    font-size: 11px;
    color: var(--text-disabled);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
}

.register-subtitle {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}
.register-link {
    display: inline-block;
    margin-top: 16px;
    font-size: 13px;
    color: var(--cyan);
    text-decoration: none;
}
.register-link:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════
   FORM ELEMENTS (shared: login, settings, report)
   ═══════════════════════════════════════════════════ */
.form-field {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}
.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
    outline: none;
}
.form-input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(6,182,212,0.15);
}
.form-input::placeholder { color: var(--text-disabled); }
.form-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-error {
    margin-top: 12px;
    font-size: 13px;
    color: var(--red);
    text-align: left;
}
.form-success {
    margin-top: 12px;
    font-size: 13px;
    color: var(--green);
    text-align: left;
}
.form-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: left;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
    box-shadow: 0 4px 16px rgba(6,182,212,0.25);
}
.btn-primary:hover {
    box-shadow: 0 6px 24px rgba(6,182,212,0.35);
    transform: translateY(-1px);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Checkbox */
input[type="checkbox"] {
    accent-color: var(--cyan);
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════
   PROCESSING PAGE — TOOLBAR
   ═══════════════════════════════════════════════════ */
/* Toolbar: initially fixed in navbar area, then children moved into #gld-navbar via JS */
#toolbar {
    position: fixed;
    top: 0;
    left: 300px;
    right: 200px;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 101;
}

.tb-group {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.tb-btn {
    width: 32px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}
.tb-btn:hover {
    background: var(--cyan-dim);
    color: var(--cyan);
}
.tb-select {
    padding: 4px 14px;
    min-width: 60px;
    background: transparent;
    border: none;
    color: var(--cyan);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    appearance: none;
    text-align: center;
}

.tb-divider {
    width: 1px;
    height: 24px;
    background: var(--border-strong);
    margin: 0 4px;
}

.tb-action {
    display: flex; align-items: center; gap: 4px;
    padding: 4px 10px;
    background: var(--cyan-dim);
    border: 1px solid rgba(6,182,212,0.25);
    border-radius: var(--radius-md);
    color: var(--cyan);
    font-size: 11px; font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s;
    font-family: inherit;
}
.tb-action:hover {
    background: var(--cyan-glow);
    border-color: rgba(6,182,212,0.4);
}
.tb-action--green {
    background: var(--emerald-dim);
    border-color: rgba(16,185,129,0.25);
    color: var(--emerald);
}
.tb-action--green:hover {
    background: rgba(16,185,129,0.25);
    border-color: rgba(16,185,129,0.4);
}

.tb-badge {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 11px;
    color: var(--text-secondary);
}
.tb-badge strong {
    color: var(--cyan);
    font-family: 'JetBrains Mono', monospace;
}

.tb-status-pill {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
}
.tb-status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}
.tb-status-dot--running {
    background: var(--emerald);
    box-shadow: 0 0 8px var(--emerald);
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.tb-status-text {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.tb-spacer { flex: 1; }

.tb-export {
    padding: 5px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'JetBrains Mono', monospace;
}
.tb-export:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    background: var(--cyan-dim);
}

/* Auto-quant toggle */
.tb-badge { white-space: nowrap; flex-shrink: 0; }
.tb-file-badge { flex-shrink: 1; min-width: 0; overflow: hidden; }
.tb-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-export { flex-shrink: 0; }
.tb-status-pill { flex-shrink: 0; }
.tb-divider { flex-shrink: 0; }
.tb-group { flex-shrink: 0; }
.tb-toggle {
    display: flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; user-select: none;
}
.tb-toggle input { display: none; }
.tb-toggle-slider {
    width: 32px; height: 18px; background: rgba(255,255,255,0.1); border-radius: 9px;
    position: relative; transition: background 0.2s; border: 1px solid rgba(255,255,255,0.08);
}
.tb-toggle-slider::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px;
    background: #64748b; border-radius: 50%; transition: all 0.2s;
}
.tb-toggle input:checked + .tb-toggle-slider { background: rgba(34,197,94,0.25); border-color: rgba(34,197,94,0.4); }
.tb-toggle input:checked + .tb-toggle-slider::after { left: 16px; background: #22c55e; }
.tb-toggle-label { font-size: 11px; color: #64748b; font-weight: 600; }
.tb-toggle input:checked ~ .tb-toggle-label { color: #22c55e; }

/* Time display */
.tb-time-display {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.tb-time-sel {
    display: flex; align-items: center;
}
.tb-time-sel select {
    padding: 4px 8px;
    background: var(--bg-glass);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--cyan);
    font-family: monospace; font-size: 11px; font-weight: 600;
    cursor: pointer;
    appearance: none; -webkit-appearance: none;
}
.tb-time-sel select:focus { outline: none; border-color: var(--cyan); }

/* File badge */
.tb-file-badge {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 6px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
}
.tb-file-icon { font-size: 11px; color: var(--text-secondary); }
.tb-file-name { font-size: 10px; font-family: monospace; color: var(--text-primary); }

/* ═══════════════════════════════════════════════════
   PROCESSING PAGE — MAIN LAYOUT
   ═══════════════════════════════════════════════════ */
.proc-main {
    display: flex;
    flex: 1;
    min-height: 0;
    position: relative;
}

#main {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* ═══════════════════════════════════════════════════
   CHARTS AREA
   ═══════════════════════════════════════════════════ */
.charts-area,
#chartsArea {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
}

.chart-card {
    flex: 1;
    min-height: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s;
    display: flex;
    flex-direction: column;
}
.chart-card:hover { border-color: var(--border-strong); }
.chart-card.hidden { display: none; }
.chart-card--primary {
    border-color: rgba(6,182,212,0.15);
    box-shadow: 0 0 30px rgba(6,182,212,0.06);
}

.chart-header {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 2;
    pointer-events: none;
}
.chart-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.chart-label span {
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 6px;
}
.chart-controls {
    display: flex;
    gap: 3px;
    pointer-events: all;
}
.chart-ctrl-btn {
    width: 24px; height: 24px;
    border-radius: 5px;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    transition: all 0.15s;
}
.chart-ctrl-btn:hover {
    background: var(--cyan-dim);
    color: var(--cyan);
    border-color: rgba(6,182,212,0.3);
}

.chart-wrap { width: 100%; height: 100%; }

/* uPlot overrides */
.uplot { width: 100% !important; }
.u-wrap { width: 100% !important; }
.u-legend { display: none !important; }
.u-cursor-x { border-color: var(--cyan) !important; }

/* ═══════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════ */
.proc-sidebar,
#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    border-left: 1px solid var(--border);
    background: var(--bg-glass);
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 10px;
    overflow-y: auto;
    flex-shrink: 0;
}

/* Sidebar cards */
.sb-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 14px;
    transition: border-color 0.2s;
}
.sb-card:hover { border-color: var(--border); }

.sb-card-header {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-align: center;
}
/* ── Concentration card ── */
.sb-metrics-grid {
    display: flex;
    gap: 10px;
    align-items: center;
}
.sb-conc-row {
    display: flex; gap: 10px; align-items: stretch;
}
.sb-colorbar {
    display: flex;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
}
.sb-color-chip {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sb-swatch {
    width: 22px;
    min-height: 12px;
    border-radius: 3px;
    align-self: stretch;
}
.sb-swatch-label {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    min-width: 28px;
}

.sb-values {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.sb-val-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
}
.sb-val-row--highlight {
    background: var(--red-dim);
    border-color: rgba(239,68,68,0.2);
}
.sb-val-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}
.sb-val-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}
.sb-val-value--red {
    color: var(--red);
    font-size: 15px;
    text-shadow: 0 0 12px rgba(239,68,68,0.4);
}

/* ── Leaks card ── */
.sb-leaks-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.sb-leak-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}
.sb-leak-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    font-weight: 700;
}
.sb-leak-badge--red {
    background: var(--red-dim);
    border: 1px solid rgba(239,68,68,0.25);
    color: var(--red);
}
.sb-leak-badge--cyan {
    background: var(--cyan-dim);
    border: 1px solid rgba(6,182,212,0.25);
    color: var(--cyan);
}
.sb-leak-sep {
    width: 1px;
    height: 24px;
    background: var(--border-strong);
}
.sb-leak-arrows {
    display: flex;
    flex-direction: column;
}
.sb-leak-arr {
    width: 22px; height: 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 8px;
    transition: all 0.15s;
}
.sb-leak-arr:first-child { border-radius: 4px 4px 0 0; }
.sb-leak-arr:last-child { border-radius: 0 0 4px 4px; border-top: none; }
.sb-leak-arr:hover { background: var(--cyan-dim); color: var(--cyan); }

.sb-leaks-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
}
.sb-icon-btn {
    flex: 1;
    height: 32px;
    padding: 0 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.15s;
}
.sb-icon-btn:hover { background: var(--cyan-dim); color: var(--cyan); border-color: rgba(6,182,212,0.3); }
.sb-icon-btn--danger { border-color: rgba(239,68,68,0.2); color: var(--red); }
.sb-icon-btn--danger:hover { background: var(--red-dim); }

#leakLineChart {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

/* ── Distance + Average ── */
.sb-dist-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}
.sb-dist-group {
    text-align: center;
}
.sb-dist-label2 {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.sb-dist-input {
    width: 64px;
    padding: 4px 6px;
    background: var(--bg-glass);
    border: 1px solid var(--cyan);
    border-radius: var(--radius-sm);
    color: var(--cyan);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
}
.sb-dist-input::-webkit-inner-spin-button,
.sb-dist-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.sb-dist-input:focus { border-color: var(--green); box-shadow: 0 0 6px rgba(6,182,212,0.3); }
.sb-dist-arrows {
    display: flex;
    flex-direction: column;
}
.sb-dist-arr {
    width: 20px; height: 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 8px;
    transition: all 0.15s;
}
.sb-dist-arr:first-child { border-radius: 4px 4px 0 0; }
.sb-dist-arr:last-child { border-radius: 0 0 4px 4px; border-top: none; }
.sb-dist-arr:hover { background: var(--cyan-dim); color: var(--cyan); }
.sb-avg-btn {
    padding: 10px 20px;
    background: var(--cyan-dim);
    border: 1px solid rgba(6,182,212,0.3);
    border-radius: var(--radius-md);
    color: var(--cyan);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.sb-avg-btn:hover { background: var(--cyan-glow); }

/* ── Action buttons grid ── */
.sb-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.sb-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.15s;
    font-family: inherit;
}
.sb-action-btn:hover { filter: brightness(1.2); }

.sb-action-btn--default {
    background: var(--bg-glass);
    border-color: var(--border);
    color: var(--text-secondary);
}
.sb-action-btn--primary {
    background: var(--cyan-dim);
    border-color: rgba(6,182,212,0.35);
    color: var(--cyan);
}
.sb-action-btn--success {
    background: var(--emerald-dim);
    border-color: rgba(16,185,129,0.3);
    color: var(--emerald);
}
.sb-action-btn--warning {
    background: var(--amber-dim);
    border-color: rgba(245,158,11,0.3);
    color: var(--amber);
}
.sb-action-btn--ghost {
    background: transparent;
    border-color: var(--border-subtle);
    color: var(--text-disabled);
}

#timeline {
    flex: 1; height: 4px;
    -webkit-appearance: none; appearance: none;
    background: rgba(255,255,255,0.08);
    border-radius: 2px; outline: none; cursor: pointer;
}
#timeline::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px; height: 12px;
    background: var(--cyan);
    border-radius: 50%; cursor: pointer;
}

/* ═══════════════════════════════════════════════════
   BOTTOM PANEL (legacy — JS toggles it)
   ═══════════════════════════════════════════════════ */
#bottomPanel {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 0;
    background: var(--bg-root);
    border-top: 1px solid var(--border);
    transition: height 0.3s ease;
    z-index: 10;
    display: flex; flex-direction: column;
}
#bottomPanel.open { height: 40vh; }

.bottom-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    flex-shrink: 0;
}
.bottom-tab {
    padding: 7px 18px;
    background: none; border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    cursor: pointer; font-size: 13px; font-weight: 500;
    font-family: inherit;
    transition: all 0.15s;
}
.bottom-tab:hover { color: var(--text-primary); }
.bottom-tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }

.bottom-tab-close {
    margin-left: auto;
    padding: 7px 14px;
    background: none; border: none;
    color: var(--text-muted);
    cursor: pointer; font-size: 18px;
}
.bottom-tab-close:hover { color: var(--text-primary); }

.bottom-content {
    flex: 1; overflow: auto; display: none;
}
.bottom-content.active { display: block; }

/* ═══════════════════════════════════════════════════
   OVERLAY PAGES (Detection Table, Map)
   ═══════════════════════════════════════════════════ */
.overlay-page {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(10,15,26,0.92);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    animation: overlayIn 0.25s ease;
}
@keyframes overlayIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.overlay-header {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.overlay-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.overlay-close {
    margin-left: auto;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.15s;
}
.overlay-close:hover {
    background: var(--red-dim);
    border-color: rgba(239,68,68,0.3);
    color: var(--red);
}
.overlay-tabs {
    display: flex;
    gap: 4px;
}
.overlay-tab {
    padding: 6px 16px;
    background: none; border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    cursor: pointer; font-size: 13px; font-weight: 500;
    font-family: inherit;
    transition: all 0.15s;
}
.overlay-tab:hover { color: var(--text-primary); }
.overlay-tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }
.overlay-body {
    flex: 1;
    overflow: auto;
    padding: 0;
    position: relative;
}
.overlay-content { display: none; height: 100%; width: 100%; }
.overlay-content.active { display: block; }
#tab-map { position: relative; }
#tab-map #mapContainer { position: absolute; inset: 0; }

/* ═══════════════════════════════════════════════════
   DETECTION TABLE (.det-table AND #detectionTable)
   ═══════════════════════════════════════════════════ */
.det-table,
#detectionTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.det-table thead,
#detectionTable thead {
    position: sticky;
    top: 0;
    z-index: 1;
}
.det-table th,
#detectionTable th {
    padding: 8px 14px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}
.det-table td,
#detectionTable td {
    padding: 8px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
}
.det-table tr:hover td,
#detectionTable tbody tr:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}
.det-table tr.row--selected td,
#detectionTable tbody tr.selected {
    background: var(--cyan-dim);
}
/* Confidence badge */
.conf-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    font-family: monospace;
    white-space: nowrap;
    cursor: default;
}

/* Delete leak button in table */
.del-leak-btn {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.25);
    color: var(--red);
    width: 24px; height: 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.del-leak-btn:hover {
    background: rgba(239,68,68,0.25);
    border-color: rgba(239,68,68,0.5);
}

/* Map */
#mapContainer { height: 100%; width: 100%; }

/* ═══════════════════════════════════════════════════
   DASHBOARD PAGE
   ═══════════════════════════════════════════════════ */
.dash-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px;
}
.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.dash-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.dash-title-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}
.dash-action-row {
    display: flex;
    gap: 8px;
}

/* Stat cards */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}
.dash-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.stat-card {
    flex: 1;
    min-width: 160px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.stat-card:hover { border-color: var(--border); }
.stat-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    background: radial-gradient(circle, var(--stat-glow, rgba(6,182,212,0.08)) 0%, transparent 70%);
}
.stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.stat-value {
    font-size: 28px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 6px;
}
.stat-value--cyan { color: var(--cyan); text-shadow: 0 0 20px rgba(6,182,212,0.3); }
.stat-value--emerald { color: var(--emerald); }
.stat-unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 4px;
}

/* Session table */
.dash-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.session-table {
    width: 100%;
    border-collapse: collapse;
}
.session-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--bg-glass);
}
.session-table td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
}
.session-table tr:hover td {
    background: var(--bg-glass);
}
.session-table tr.row--selected td {
    background: var(--cyan-dim);
}
.session-table tbody tr:last-child td { border-bottom: none; }

.session-id {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--text-primary);
}
.device-badge {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: var(--cyan-dim);
    color: var(--cyan);
    border: 1px solid rgba(6,182,212,0.15);
}
.leak-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}
.leak-count-badge--danger { background: var(--red-dim); color: var(--red); }
.leak-count-badge--zero { background: var(--bg-glass); color: var(--text-muted); }

/* Table action buttons */
.tbl-btn {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.tbl-btn:hover { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-dim); }
.tbl-btn--danger:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }

.dash-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}
.dash-empty-link {
    display: inline-block;
    margin-top: 12px;
    color: var(--cyan);
    text-decoration: none;
    font-size: 13px;
}
.dash-empty-link:hover { text-decoration: underline; }

.dash-action-btn {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--bg-glass);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.dash-action-btn:hover {
    background: rgba(6,182,212,0.12);
    border-color: rgba(6,182,212,0.3);
    color: var(--cyan);
}
.dash-action-btn--danger:hover {
    background: rgba(239,68,68,0.12);
    border-color: rgba(239,68,68,0.3);
    color: var(--red);
}

.dash-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

/* Generate Report / accent button */
.btn-accent {
    padding: 8px 20px;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 2px 12px rgba(6,182,212,0.25);
    transition: all 0.2s;
}
.btn-accent:hover { box-shadow: 0 4px 20px rgba(6,182,212,0.35); transform: translateY(-1px); }
.btn-accent:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
    padding: 8px 20px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--text-muted); color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════
   REPORT PAGE
   ═══════════════════════════════════════════════════ */
.report-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px;
}
.report-container {
    max-width: 800px;
    margin: 0 auto;
}
.report-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}
.report-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.report-section {
    margin-bottom: 28px;
}
.report-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.report-row {
    display: flex;
    gap: 14px;
    margin-bottom: 12px;
}
.report-field {
    flex: 1;
}
.report-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 5px;
}
.report-field input,
.report-field textarea,
.report-field select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}
.report-field input:focus,
.report-field textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(6,182,212,0.1);
}
.report-field textarea { height: 80px; resize: vertical; }
.report-hint {
    font-size: 11px;
    color: var(--text-disabled);
    margin-top: 3px;
}

/* Session chips */
.session-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}
.session-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 12px;
}
.session-chip-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.session-chip-id {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--text-primary);
}
.session-chip-info {
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════
   SETTINGS PAGE
   ═══════════════════════════════════════════════════ */
.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px;
    max-width: 700px;
}
.settings-section {
    margin-bottom: 32px;
}
.settings-section h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}
.settings-section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}
.settings-section-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.user-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
}
.user-list-name {
    font-size: 14px;
    font-weight: 500;
}
.user-list-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--cyan-dim);
    color: var(--cyan);
    margin-left: 8px;
}
.user-list-date {
    font-size: 12px;
    color: var(--text-muted);
}

/* Settings tabs */
.settings-tab {
    padding: 10px 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    margin-bottom: -1px;
}
.settings-tab:hover { color: var(--text-secondary); }
.settings-tab--active {
    color: var(--cyan);
    border-bottom-color: var(--cyan);
}

/* ═══════════════════════════════════════════════════
   AUTHENTICATED PAGE SHELL
   ═══════════════════════════════════════════════════ */
.page-shell {
    padding-top: var(--navbar-height);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.page-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--navbar-height));
    font-size: 14px;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════
   LOADING OVERLAY
   ═══════════════════════════════════════════════════ */
#loadingOverlay {
    position: fixed; inset: 0;
    background: rgba(10,15,26,0.88);
    backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center;
    z-index: 100; flex-direction: column; gap: 14px;
    color: var(--text-secondary);
}
#loadingOverlay.visible { display: flex; }

/* Report loading state */
.loading { display: none; text-align: center; padding: 40px; color: var(--text-secondary); }
.loading.visible { display: block; }

.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════ */
.gld-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    animation: gld-toast-in 0.3s ease, gld-toast-out 0.3s ease 3.7s forwards;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    max-width: 400px;
}
.gld-toast-success {
    background: #16a34a;
}
.gld-toast-error {
    background: #dc2626;
}
@keyframes gld-toast-in {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes gld-toast-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ═══════════════════════════════════════════════════
   BUTTON SPINNER
   ═══════════════════════════════════════════════════ */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════
   SAVE BUTTON ENABLED STATE
   ═══════════════════════════════════════════════════ */
#btnSave:not(:disabled) {
    background: rgba(6,182,212,0.1);
    border-color: rgba(6,182,212,0.25);
    color: var(--cyan);
    font-weight: 600;
}
#btnSave:not(:disabled):hover {
    background: rgba(6,182,212,0.2);
    border-color: rgba(6,182,212,0.4);
}
#btnSave:not([disabled]) {
    opacity: 1 !important;
    cursor: pointer !important;
}

/* ═══════════════════════════════════════════════════
   GLOW UTILITIES
   ═══════════════════════════════════════════════════ */
.glow-cyan { box-shadow: 0 0 20px rgba(6,182,212,0.15); }
.glow-red  { box-shadow: 0 0 20px rgba(239,68,68,0.25); }

/* ═══════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-disabled); }
