/* ================================================
   ATFM System — Operations-Grade UI
   Phase 1: ISA-101 / EUROCONTROL / FAA ATFM Standard
   Palette: Aviation dark · Aviation blue · Amber UTC
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ---- Design Tokens ---- */
:root {
    --bg-base:       #0e1117;
    --bg-surface:    #161c27;
    --bg-surface-2:  #1a2235;
    --bg-surface-3:  #1e2a3e;
    --border:        #252f3f;
    --border-strong: #2d3f5a;

    --text-primary:   #e6eaf2;
    --text-secondary: #8899aa;
    --text-muted:     #4a6080;

    --blue:      #0a84ff;
    --blue-dim:  rgba(10,132,255,0.15);
    --green:     #1eb87a;
    --green-dim: rgba(30,184,122,0.15);
    --amber:     #f5a623;
    --amber-dim: rgba(245,166,35,0.15);
    --red:       #e63946;
    --red-dim:   rgba(230,57,70,0.15);
    --cyan:      #4a9eff;
    --cyan-dim:  rgba(74,158,255,0.15);

    --strip-h: 28px;
    --sidebar-w: 240px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* ================================================
   DAY (LIGHT) THEME — overrides dark tokens
   ================================================ */
[data-theme="light"] {
    --bg-base:       #f0f4f8;
    --bg-surface:    #ffffff;
    --bg-surface-2:  #f5f7fa;
    --bg-surface-3:  #eaeff5;
    --border:        #d1dae4;
    --border-strong: #b0bec8;

    --text-primary:   #1a2332;
    --text-secondary: #3d5166;
    --text-muted:     #7a90a4;

    --blue-dim:  rgba(10,132,255,0.10);
    --green-dim: rgba(30,184,122,0.10);
    --amber-dim: rgba(245,166,35,0.10);
    --red-dim:   rgba(230,57,70,0.10);
    --cyan-dim:  rgba(74,158,255,0.10);
}

/* Light-mode surface overrides for elements that hardcode dark colours */
[data-theme="light"] body                 { background: var(--bg-base); }
[data-theme="light"] .status-strip        { background: #1a2332; }
[data-theme="light"] .sidebar             { background: #1e2a3e; border-right-color: #2d3f5a; }
[data-theme="light"] .sidebar-section-label,
[data-theme="light"] .sidebar-nav a       { color: #c8d6e5; }
[data-theme="light"] .sidebar-nav a:hover,
[data-theme="light"] .sidebar-nav a.active{ background: rgba(10,132,255,0.15); color: #fff; }
[data-theme="light"] .topbar              { background: #ffffff; border-bottom-color: var(--border); }
[data-theme="light"] .topbar-title        { color: var(--text-primary); }
[data-theme="light"] .stat-card           { background: var(--bg-surface); border-color: var(--border); }
[data-theme="light"] .stat-label          { color: var(--text-muted); }
[data-theme="light"] .stat-value          { color: var(--text-primary); }
[data-theme="light"] .card                { background: var(--bg-surface); border-color: var(--border); }
[data-theme="light"] .flights-table thead th { background: var(--bg-surface-2); color: var(--text-secondary); border-color: var(--border); }
[data-theme="light"] .flights-table tbody tr:hover { background: var(--bg-surface-2) !important; }
[data-theme="light"] .flights-table td    { border-color: var(--border); color: var(--text-primary); }
[data-theme="light"] .filter-search       { background: var(--bg-surface); color: var(--text-primary); border-color: var(--border); }
[data-theme="light"] .form-select,
[data-theme="light"] .form-control        { background: var(--bg-surface); color: var(--text-primary); border-color: var(--border); }
[data-theme="light"] .alert-card          { background: var(--bg-surface); }
[data-theme="light"] .bell-dropdown       { background: var(--bg-surface); border-color: var(--border); }
[data-theme="light"] .map-panel           { background: rgba(255,255,255,0.92) !important; border-color: var(--border) !important; }
[data-theme="light"] .map-panel *         { color: var(--text-primary) !important; }
[data-theme="light"] #atfm-map            { background: #e8ecf0; }

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    margin: 0;
    min-height: 100vh;
}

/* ================================================
   ACCESSIBILITY
   ================================================ */
.skip-link {
    position: absolute;
    top: -40px; left: 16px;
    background: var(--blue);
    color: #fff;
    padding: 8px 14px;
    border-radius: 0 0 8px 8px;
    font-size: 13px; font-weight: 600;
    text-decoration: none;
    z-index: 9999;
    transition: top 0.15s;
}
.skip-link:focus { top: 0; }

*:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

/* ================================================
   STATUS STRIP  (fixed full-width bar at top)
   ================================================ */
.status-strip {
    position: sticky;
    top: 0;
    left: 0; right: 0;
    height: var(--strip-h);
    background: #080e16;
    border-bottom: 1px solid #1a2338;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.strip-left {
    display: flex; align-items: center; gap: 7px;
    color: var(--text-muted);
}
.strip-left i { font-size: 11px; color: var(--blue); }

.strip-center {
    display: flex; align-items: center; gap: 8px;
    color: var(--text-secondary);
}

.strip-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.strip-dot-normal   { background: var(--green); box-shadow: 0 0 7px rgba(30,184,122,0.7); }
.strip-dot-degraded { background: var(--amber); box-shadow: 0 0 7px rgba(245,166,35,0.7); }
.strip-dot-critical { background: var(--red);   box-shadow: 0 0 7px rgba(230,57,70,0.7);  }

.strip-right {
    display: flex; align-items: center; gap: 6px;
    color: var(--amber);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 500;
}
.strip-right i { font-size: 11px; opacity: 0.55; }

/* ================================================
   SIDEBAR
   ================================================ */
.sidebar {
    position: fixed;
    top: var(--strip-h);
    left: 0;
    width: var(--sidebar-w);
    height: calc(100vh - var(--strip-h));
    background: linear-gradient(180deg, #0d1520 0%, #111d30 100%);
    border-right: 1px solid #1a2338;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand .brand-icon {
    font-size: 22px;
    color: var(--blue);
    display: block;
    margin-bottom: 9px;
}

.sidebar-brand .brand-name {
    font-size: 16px;
    font-weight: 800;
    color: #f0f4ff;
    letter-spacing: -0.3px;
}

.sidebar-brand .brand-sub {
    font-size: 9.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 3px;
}

.sidebar-section {
    padding: 16px 12px 4px;
}

.sidebar-section-label {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 8px;
    margin-bottom: 6px;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li { margin-bottom: 2px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: #6b85a8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.05);
    color: #adc0d8;
    border-left-color: rgba(10,132,255,0.3);
}

.sidebar-nav a.active {
    background: rgba(10,132,255,0.12);
    color: #6ab8ff;
    border-left-color: var(--blue);
    font-weight: 600;
}

.sidebar-nav .nav-icon {
    font-size: 14px;
    width: 17px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-user {
    margin-top: auto;
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0a4a8a, #0a84ff);
    border: 2px solid rgba(10,132,255,0.35);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 800; color: #fff;
    flex-shrink: 0;
}

.user-info { min-width: 0; }

.user-name {
    font-size: 12.5px; font-weight: 600; color: #d0ddf0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.user-role {
    font-size: 10px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 1px;
}

/* ================================================
   MAIN CONTENT
   ================================================ */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #111827;
    border-bottom: 1px solid #1a2e47;
    padding: 12px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: var(--strip-h);
    z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }

.topbar-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-primary);
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

/* Hamburger (mobile only) */
.hamburger-btn {
    display: none;
    background: none; border: none;
    color: var(--text-secondary);
    font-size: 17px;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 6px;
    line-height: 1;
}
.hamburger-btn:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
}

.logout-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 13px; border-radius: var(--radius-sm);
    background: var(--red-dim);
    color: var(--red);
    font-size: 12px; font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(230,57,70,0.25);
    transition: all 0.15s;
}

.logout-btn:hover {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

.page-body { padding: 26px; flex: 1; }

/* ================================================
   FLASH MESSAGES
   ================================================ */
.flash-wrap { margin-bottom: 20px; }

.flash-wrap .alert {
    border-radius: var(--radius-md);
    font-size: 13px; font-weight: 500;
    padding: 11px 16px;
    border: 1px solid;
}

.alert-success { background: var(--green-dim); color: var(--green); border-color: rgba(30,184,122,0.3); }
.alert-danger  { background: var(--red-dim);   color: var(--red);   border-color: rgba(230,57,70,0.3); }
.alert-info    { background: var(--cyan-dim);  color: var(--cyan);  border-color: rgba(74,158,255,0.3); }
.alert-warning { background: var(--amber-dim); color: var(--amber); border-color: rgba(245,166,35,0.3); }

/* ================================================
   PAGE HEADER
   ================================================ */
.page-header { margin-bottom: 22px; }

.page-header h2 {
    font-size: 21px; font-weight: 800;
    color: var(--text-primary); margin: 0 0 4px;
    letter-spacing: -0.3px;
}

.page-header p { font-size: 13px; color: var(--text-secondary); margin: 0; }

/* ================================================
   FILTER BAR
   ================================================ */
.filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    margin-bottom: 22px;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.filter-label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
}
.filter-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 32px 7px 11px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-base) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230a84ff' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 9px center;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    min-width: 180px;
    transition: border-color .15s;
    font-family: 'Inter', sans-serif;
}
.filter-select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-dim);
}
.filter-select option { background: #1a2235; }
.filter-clear {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--red);
    text-decoration: none;
    background: var(--red-dim);
    border: 1px solid rgba(230,57,70,0.25);
    border-radius: var(--radius-sm);
    padding: 6px 13px;
    transition: background .15s;
    white-space: nowrap;
}
.filter-clear:hover { background: rgba(230,57,70,0.25); }

.filter-active-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.filter-pill {
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--blue);
    background: var(--blue-dim);
    border: 1px solid rgba(10,132,255,0.3);
    border-radius: 20px;
    padding: 3px 11px;
}

/* ================================================
   STAT CARDS  — ISA-101 ops-room instrument style
   Dark surface + left-border accent, no gradient fill
   ================================================ */
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--radius-md);
    padding: 18px 20px 16px;
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: default;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.25);
}
.stat-total    { border-left-color: var(--blue); }
.stat-departed { border-left-color: var(--green); }
.stat-planned  { border-left-color: var(--cyan); }
.stat-delayed  { border-left-color: var(--amber); }
.stat-cancelled{ border-left-color: var(--red); }
.stat-otp      { border-left-color: #9d7fe8; }

.stat-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}
.stat-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
}
.stat-icon-wrap {
    font-size: 16px;
    color: var(--text-muted);
    opacity: 0.7;
}
.stat-value {
    font-size: 38px;
    font-weight: 900;
    line-height: 1;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums;
    font-family: 'IBM Plex Mono', 'Inter', monospace;
    letter-spacing: -1px;
}
.stat-total     .stat-value { color: #6ab8ff; }
.stat-departed  .stat-value { color: #3dd68c; }
.stat-planned   .stat-value { color: #7ec8ff; }
.stat-delayed   .stat-value { color: #f7bc56; }
.stat-cancelled .stat-value { color: #f2606b; }
.stat-otp       .stat-value { font-size: 30px; }

.stat-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* ================================================
   CARDS
   ================================================ */
.atfm-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.atfm-card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}

.card-title-text {
    font-size: 13.5px; font-weight: 700;
    color: var(--text-primary);
    display: flex; align-items: center; gap: 8px;
    margin: 0;
}

.card-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--blue);
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(10,132,255,0.5);
}

.card-badge {
    font-size: 10.5px; font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-base);
    border: 1px solid var(--border);
    padding: 2px 9px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.atfm-card-footer {
    padding: 10px 18px;
    border-top: 1px solid var(--border);
    background: var(--bg-base);
    font-size: 12px;
    color: var(--text-muted);
}

/* ================================================
   TABLE
   ================================================ */
.atfm-table-wrap { overflow-x: auto; }

.atfm-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.atfm-table thead th {
    background: var(--bg-base);
    color: #6b7f95;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.atfm-table tbody tr { transition: background 0.1s; }
.atfm-table tbody tr:hover { background: var(--bg-surface-2); }

.atfm-table tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid #1a2235;
    color: #b8c8dc;
    vertical-align: middle;
}

.atfm-table tbody tr:last-child td { border-bottom: none; }

.flight-no {
    font-weight: 700; color: var(--text-primary);
    font-size: 12.5px; letter-spacing: 0.5px;
    font-family: 'IBM Plex Mono', monospace;
}

.code-text {
    font-weight: 700; color: var(--text-primary); font-size: 13px;
}

.sub-text {
    font-size: 12px; color: var(--text-muted); margin-top: 2px;
}

.time-text {
    font-size: 12.5px;
    color: var(--text-secondary);
    font-family: 'IBM Plex Mono', monospace;
    font-variant-numeric: tabular-nums;
}

/* ================================================
   STATUS BADGES
   ================================================ */
.s-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 10.5px; font-weight: 700;
    letter-spacing: 0.3px; white-space: nowrap;
    border: 1px solid;
}

.s-badge::before {
    content: ''; width: 5px; height: 5px;
    border-radius: 50%; background: currentColor; opacity: 0.7;
}

.s-departed  { background: var(--green-dim); color: var(--green); border-color: rgba(30,184,122,0.3); }
.s-delayed   { background: var(--amber-dim); color: var(--amber); border-color: rgba(245,166,35,0.3); }
.s-cancelled { background: var(--red-dim);   color: var(--red);   border-color: rgba(230,57,70,0.3); }
.s-planned   { background: var(--cyan-dim);  color: var(--cyan);  border-color: rgba(74,158,255,0.3); }
.s-other     { background: var(--bg-surface-2); color: var(--text-secondary); border-color: var(--border); }

.a-insert { background: var(--green-dim); color: var(--green); border: 1px solid rgba(30,184,122,0.3); }
.a-update { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(245,166,35,0.3); }
.a-delete { background: var(--red-dim);   color: var(--red);   border: 1px solid rgba(230,57,70,0.3); }

.tbl-badge {
    background: var(--bg-surface-2);
    color: var(--text-secondary);
    font-size: 11px; font-weight: 600;
    padding: 3px 9px; border-radius: 6px;
    border: 1px solid var(--border);
    font-family: 'IBM Plex Mono', monospace;
}

/* ================================================
   BUTTONS
   ================================================ */
.btn-atfm-primary {
    background: var(--blue);
    color: #fff; border: none;
    border-radius: var(--radius-sm); padding: 10px 20px;
    font-size: 13.5px; font-weight: 700;
    cursor: pointer; transition: all 0.15s;
    display: inline-flex; align-items: center; gap: 8px;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
}
.btn-atfm-primary:hover {
    background: #338cf5;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(10,132,255,0.35);
    color: #fff;
}

.btn-edit {
    background: var(--blue-dim);
    color: var(--cyan);
    border: 1px solid rgba(10,132,255,0.25);
    border-radius: 7px; padding: 5px 12px;
    font-size: 12px; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}
.btn-edit:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

.btn-cancel {
    background: var(--bg-surface-2);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 9px 16px;
    font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: 'Inter', sans-serif;
}
.btn-cancel:hover { background: var(--bg-surface-3); }

/* ================================================
   FORMS
   ================================================ */
.f-label {
    font-size: 12px; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 6px; display: block;
}

.f-input, .f-select {
    width: 100%; padding: 9px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px; font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: var(--bg-base);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none; appearance: none;
}

.f-input::placeholder { color: var(--text-muted); }

.f-input:focus, .f-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-dim);
}

.f-select option { background: #1a2235; }

/* ================================================
   LOGIN PAGE
   ================================================ */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #060c16 0%, #0d1a35 50%, #060c16 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; position: relative; overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 20% 60%, rgba(10,132,255,0.15) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 20%, rgba(10,84,180,0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 90%, rgba(30,184,122,0.06) 0%, transparent 40%);
}

/* Grid overlay for ops-room feel */
.login-page::after {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(10,132,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(10,132,255,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
}

.login-card {
    background: rgba(22,28,39,0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(10,132,255,0.18);
    border-radius: 20px;
    padding: 44px 40px;
    width: 100%; max-width: 410px;
    position: relative; z-index: 1;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(10,132,255,0.08);
}

.login-logo { text-align: center; margin-bottom: 32px; }

.login-logo .logo-icon {
    font-size: 40px; color: var(--blue);
    display: block; margin-bottom: 14px;
    filter: drop-shadow(0 0 16px rgba(10,132,255,0.5));
}

.login-logo .logo-name {
    font-size: 22px; font-weight: 800; color: #f0f4ff;
    letter-spacing: -0.5px;
}

.login-logo .logo-sub {
    font-size: 10.5px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 2.5px;
    margin-top: 5px;
}

.login-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(10,132,255,0.25), transparent);
    margin: 22px 0;
}

.login-card .f-label { color: var(--text-secondary); }

.login-card .f-input {
    background: rgba(14,17,23,0.7);
    border-color: rgba(10,132,255,0.18);
    color: #f0f4ff;
}

.login-card .f-input::placeholder { color: var(--text-muted); }

.login-card .f-input:focus {
    border-color: var(--blue);
    background: rgba(10,132,255,0.08);
    box-shadow: 0 0 0 3px rgba(10,132,255,0.18);
}

.login-submit {
    width: 100%; padding: 12px;
    background: var(--blue);
    color: #fff; border: none; border-radius: var(--radius-sm);
    font-size: 14.5px; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.3px; margin-top: 6px;
}

.login-submit:hover {
    background: #338cf5;
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(10,132,255,0.45);
}

.login-foot {
    text-align: center; margin-top: 22px;
    font-size: 11.5px; color: var(--text-muted);
}

/* ================================================
   UPLOAD
   ================================================ */
.upload-zone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg); padding: 44px 24px;
    text-align: center;
    background: var(--bg-base);
    transition: all 0.2s; position: relative;
}

.upload-zone:hover {
    border-color: var(--blue);
    background: rgba(10,132,255,0.05);
}

.upload-zone .uz-icon {
    font-size: 40px; margin-bottom: 12px; display: block;
    color: var(--text-muted);
}

.upload-zone input[type="file"] {
    position: absolute; inset: 0;
    opacity: 0; cursor: pointer;
    width: 100%; height: 100%;
}

/* ================================================
   ROLE PILLS
   ================================================ */
.role-pill {
    padding: 3px 10px; border-radius: 20px;
    font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    border: 1px solid;
}

.rp-admin    { background: rgba(109,40,217,0.18); color: #a78bfa; border-color: rgba(109,40,217,0.3); }
.rp-airline  { background: rgba(10,132,255,0.15); color: #60a5fa; border-color: rgba(10,132,255,0.3); }
.rp-atc      { background: rgba(190,24,93,0.15);  color: #f472b6; border-color: rgba(190,24,93,0.3); }
.rp-airport  { background: rgba(245,166,35,0.15); color: #fbbf24; border-color: rgba(245,166,35,0.3); }
.rp-ai       { background: rgba(30,184,122,0.15); color: #34d399; border-color: rgba(30,184,122,0.3); }
.rp-observer { background: rgba(71,85,105,0.15);  color: #94a3b8; border-color: rgba(71,85,105,0.3); }

/* ================================================
   MODAL  (Bootstrap overrides for dark theme)
   ================================================ */
.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    color: var(--text-primary);
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.modal-header {
    background: #111c2e;
    border-bottom: 1px solid var(--border);
    border-radius: 18px 18px 0 0;
    padding: 16px 20px;
}
.modal-title { color: var(--text-primary); font-weight: 700; font-size: 15px; }
.modal-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-base);
    padding: 12px 20px;
}
.btn-close { filter: invert(1) brightness(0.7); }

/* ================================================
   FLIGHT TABLE — ROW HIGHLIGHTING (ISA-101)
   Only delayed/cancelled rows get colour treatment;
   normal state rows remain at background colour
   ================================================ */
tr.row-delayed   { background-color: rgba(245,166,35,0.06) !important; }
tr.row-cancelled { background-color: rgba(230,57,70,0.07)  !important; }
tr.row-delayed:hover   { background-color: rgba(245,166,35,0.12) !important; }
tr.row-cancelled:hover { background-color: rgba(230,57,70,0.13)  !important; }

/* ================================================
   DELAY BADGE
   ================================================ */
.delay-badge {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11px; font-weight: 700;
    font-family: 'IBM Plex Mono', monospace;
    padding: 2px 8px; border-radius: 6px;
    border: 1px solid; white-space: nowrap;
}
.delay-ok      { color: var(--green); background: var(--green-dim); border-color: rgba(30,184,122,0.3); }
.delay-caution { color: var(--amber); background: var(--amber-dim); border-color: rgba(245,166,35,0.3); }
.delay-warn    { color: var(--red);   background: var(--red-dim);   border-color: rgba(230,57,70,0.3); }

/* ================================================
   SORTABLE COLUMN HEADERS
   ================================================ */
th.th-sort {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color 0.12s;
}
th.th-sort:hover { color: var(--text-primary); }
th.th-sort[aria-sort="ascending"],
th.th-sort[aria-sort="descending"] { color: var(--blue); }

.sort-icon {
    margin-left: 5px; font-size: 8px; opacity: 0.35;
    vertical-align: middle; transition: opacity 0.12s;
}
th.th-sort:hover .sort-icon,
th.th-sort[aria-sort="ascending"]  .sort-icon,
th.th-sort[aria-sort="descending"] .sort-icon { opacity: 1; }

/* ================================================
   FILTER SEARCH INPUT
   ================================================ */
.filter-search-wrap {
    display: flex; flex-direction: column; gap: 4px;
    position: relative;
}
.filter-search-icon {
    position: absolute; bottom: 9px; left: 10px;
    color: var(--text-muted); font-size: 11.5px;
    pointer-events: none;
}
.filter-search {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 11px 7px 30px;
    font-size: 12.5px; font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-base);
    font-family: 'Inter', sans-serif;
    min-width: 190px;
    transition: border-color .15s;
}
.filter-search::placeholder { color: var(--text-muted); }
.filter-search:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-dim);
}

/* ================================================
   PAGINATION
   ================================================ */
.pagination-bar {
    display: flex; align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    background: var(--bg-base);
}
.pag-info {
    font-size: 12px; color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
}
.pag-controls { display: flex; align-items: center; gap: 6px; }
.pag-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 7px;
    background: var(--bg-surface-2);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px; text-decoration: none;
    transition: all 0.15s;
}
.pag-btn:hover:not(.pag-disabled) {
    background: var(--blue); color: #fff; border-color: var(--blue);
}
.pag-disabled { opacity: 0.3; pointer-events: none; cursor: default; }
.pag-current {
    font-size: 12px; font-weight: 600;
    color: var(--text-secondary);
    font-family: 'IBM Plex Mono', monospace;
    padding: 0 10px; white-space: nowrap;
}

/* ================================================
   OTP GAUGE
   ================================================ */
.otp-gauge-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 20px 10px;
}
.otp-gauge-wrap canvas {
    max-width: 220px;
}
.otp-center-label {
    position: absolute;
    bottom: 42px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
}
.otp-pct {
    font-size: 30px;
    font-weight: 900;
    font-family: 'IBM Plex Mono', monospace;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    display: block;
}
.otp-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    display: block;
    margin-top: 3px;
}
.otp-bands {
    display: flex;
    justify-content: space-around;
    width: 100%;
    padding: 10px 16px 14px;
    border-top: 1px solid var(--border);
    gap: 4px;
}
.otp-band {
    flex: 1;
    text-align: center;
    padding: 7px 4px;
    border-radius: 8px;
    border: 1px solid;
}
.otp-band-label {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: block;
}
.otp-band-range {
    font-size: 11px;
    font-weight: 600;
    font-family: 'IBM Plex Mono', monospace;
    display: block;
    margin-top: 2px;
}
.otp-green  { background: var(--green-dim);  color: var(--green);  border-color: rgba(30,184,122,0.25); }
.otp-amber  { background: var(--amber-dim);  color: var(--amber);  border-color: rgba(245,166,35,0.25); }
.otp-red    { background: var(--red-dim);    color: var(--red);    border-color: rgba(230,57,70,0.25); }

/* ================================================
   AUDIT LOG AVATAR
   ================================================ */
.audit-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0a4a8a, #0a84ff);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800; color: #fff;
    flex-shrink: 0;
    border: 1px solid rgba(10,132,255,0.3);
}

/* ================================================
   EMPTY STATE
   ================================================ */
.empty-state {
    text-align: center; padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state i { font-size: 36px; margin-bottom: 12px; display: block; opacity: 0.4; }
.empty-state p { font-size: 13.5px; margin: 0; }

/* ================================================
   MAP PAGE  (Phase 4)
   ================================================ */

/*
   Actual topbar height = 12px top-pad + 36px content (bell-btn) + 12px bot-pad = 60px.
   Stored as a token so the map calc and critical-banner top both use the same value.
*/
:root { --topbar-h: 60px; }

/*
   The map page zeroes page-body padding via an inline <style> in map.html.
   .map-fullscreen therefore uses margin:0 and fills the remaining viewport.
*/
.map-fullscreen {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--strip-h) - var(--topbar-h));
    overflow: hidden;
}

#atfm-map {
    width: 100%;
    height: 100%;
    background: #080e16;
}

/* Override Leaflet popup for dark theme */
.leaflet-popup-content-wrapper {
    background: #161c27 !important;
    border: 1px solid #252f3f !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
    color: #e6eaf2 !important;
    padding: 0 !important;
}
.leaflet-popup-tip { background: #161c27 !important; }
.leaflet-popup-content { margin: 0 !important; min-width: 220px; }
.leaflet-container a.leaflet-popup-close-button {
    color: #8899aa !important;
    top: 10px !important; right: 12px !important;
    font-size: 18px !important;
}
.leaflet-container a.leaflet-popup-close-button:hover { color: #e6eaf2 !important; }

/* Dark attribution */
.leaflet-control-attribution {
    background: rgba(8,14,22,0.75) !important;
    color: #4a6080 !important;
    font-size: 10px !important;
}
.leaflet-control-attribution a { color: #6b7f95 !important; }

/* Dark zoom controls */
.leaflet-control-zoom a {
    background: #161c27 !important;
    border-color: #252f3f !important;
    color: #8899aa !important;
}
.leaflet-control-zoom a:hover {
    background: #1a2235 !important;
    color: #e6eaf2 !important;
}

/* Floating map panels */
.map-panel {
    position: absolute;
    z-index: 1000;
    background: rgba(14, 17, 23, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid #252f3f;
    border-radius: 14px;
    padding: 14px 16px;
    pointer-events: all;
}

/* Layer toggle panel — top right */
.map-layers-panel {
    top: 16px; right: 16px;
    min-width: 200px;
}
.map-panel-title {
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    color: #4a6080; margin-bottom: 12px;
    display: flex; align-items: center; gap: 6px;
}
.layer-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 8px; cursor: pointer;
    padding: 5px 8px; border-radius: 8px;
    transition: background 0.12s;
}
.layer-row:hover { background: rgba(255,255,255,0.05); }
.layer-row:last-child { margin-bottom: 0; }
.layer-check {
    display: flex; align-items: center; gap: 8px;
    font-size: 12.5px; font-weight: 600; color: #b8c8dc;
    flex: 1;
}
.layer-dot {
    width: 10px; height: 10px; border-radius: 50%;
    flex-shrink: 0;
}
.layer-count {
    font-size: 11px; font-weight: 700;
    font-family: 'IBM Plex Mono', monospace;
    color: #4a6080; background: #1a2235;
    border: 1px solid #252f3f;
    padding: 1px 7px; border-radius: 10px;
}
.layer-toggle {
    appearance: none; -webkit-appearance: none;
    width: 34px; height: 18px;
    background: #252f3f; border-radius: 9px;
    cursor: pointer; position: relative;
    transition: background 0.2s; flex-shrink: 0;
    border: none; outline: none;
}
.layer-toggle::after {
    content: ''; position: absolute;
    top: 3px; left: 3px;
    width: 12px; height: 12px;
    border-radius: 50%; background: #4a6080;
    transition: transform 0.2s, background 0.2s;
}
.layer-toggle:checked { background: #0a84ff; }
.layer-toggle:checked::after { transform: translateX(16px); background: #fff; }

/* Stats pill — top left */
.map-stats-panel {
    top: 16px; left: 16px;
    display: flex; flex-direction: column; gap: 4px;
    min-width: 160px;
}
.map-brand {
    font-size: 12px; font-weight: 800; color: #e6eaf2;
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 6px;
}
.map-brand i { color: #0a84ff; font-size: 14px; }
.map-stat-row {
    display: flex; align-items: center; gap: 6px;
    font-size: 11.5px; color: #8899aa;
}
.map-stat-dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}

/* Popup content styles */
.map-popup {
    padding: 14px 16px;
}
.map-popup-callsign {
    font-size: 15px; font-weight: 800;
    font-family: 'IBM Plex Mono', monospace;
    color: #e6eaf2; margin-bottom: 8px;
    display: flex; align-items: center; gap: 8px;
}
.map-popup-row {
    display: flex; justify-content: space-between;
    align-items: center; gap: 12px;
    font-size: 12px; color: #8899aa;
    padding: 3px 0;
    border-bottom: 1px solid #1e2a3a;
}
.map-popup-row:last-child { border-bottom: none; padding-bottom: 0; }
.map-popup-val {
    font-weight: 600; color: #c0cce0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11.5px;
}

/* Airport tooltip */
.leaflet-tooltip {
    background: rgba(14,17,23,0.9) !important;
    border: 1px solid #252f3f !important;
    border-radius: 6px !important;
    color: #e6eaf2 !important;
    font-family: 'IBM Plex Mono', monospace !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
    padding: 4px 8px !important;
}
.leaflet-tooltip::before { display: none !important; }

/* ================================================
   PHASE 5 — ALERTS & NOTIFICATIONS
   ================================================ */

/* ── Page header row ── */
.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}
.page-title i { color: var(--blue); margin-right: 8px; }
.page-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}
.btn-primary-atfm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity .15s;
}
.btn-primary-atfm:hover { opacity: .85; color: #fff; }

/* ── Severity filter tabs ── */
.alert-filter-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.alert-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}
.alert-tab:hover { color: var(--text-primary); background: var(--bg-surface-2); }
.alert-tab-active {
    background: var(--blue-dim);
    border-color: var(--blue);
    color: var(--blue);
}
.alert-tab-critical.alert-tab-active { background: var(--red-dim); border-color: var(--red); color: var(--red); }
.alert-tab-caution.alert-tab-active  { background: var(--amber-dim); border-color: var(--amber); color: var(--amber); }
.alert-tab-advisory.alert-tab-active { background: var(--cyan-dim); border-color: var(--cyan); color: var(--cyan); }
.alert-tab-count {
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 10px;
}

/* ── Alert card list ── */
.alert-list { display: flex; flex-direction: column; gap: 12px; }

.alert-card {
    display: flex;
    gap: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color .15s;
}
.alert-card:hover { border-color: var(--border-strong); }
.alert-dismissed { opacity: .55; }

/* Left accent bar + icon */
.alert-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    font-size: 18px;
}
.alert-sev-critical .alert-card-icon { background: rgba(230,57,70,0.12); color: var(--red); border-right: 3px solid var(--red); }
.alert-sev-caution  .alert-card-icon { background: rgba(245,166,35,0.10); color: var(--amber); border-right: 3px solid var(--amber); }
.alert-sev-advisory .alert-card-icon { background: rgba(74,158,255,0.10); color: var(--cyan); border-right: 3px solid var(--cyan); }

.alert-card-body { flex: 1; padding: 14px 16px; min-width: 0; }

.alert-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.alert-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Severity pill */
.alert-severity-pill {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    padding: 2px 8px;
    border-radius: 10px;
    font-family: 'IBM Plex Mono', monospace;
}
.pill-critical { background: var(--red-dim);   color: var(--red);   border: 1px solid rgba(230,57,70,.4); }
.pill-caution  { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(245,166,35,.4); }
.pill-advisory { background: var(--cyan-dim);  color: var(--cyan);  border: 1px solid rgba(74,158,255,.4); }

.alert-category {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: .05em;
    text-transform: uppercase;
}
.alert-dismissed-tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--green);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.alert-card-actions { display: flex; gap: 6px; }
.alert-action-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: color .15s, border-color .15s, background .15s;
}
.alert-dismiss-btn:hover    { color: var(--amber); border-color: var(--amber); background: var(--amber-dim); }
.alert-deactivate-btn:hover { color: var(--red);   border-color: var(--red);   background: var(--red-dim); }

.alert-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.alert-card-body-text {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
}
.alert-card-footer {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
}
.alert-card-footer span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ── Empty state ── */
.alerts-empty {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
}
.alerts-empty i { font-size: 48px; color: var(--green); margin-bottom: 16px; display: block; }
.alerts-empty-title { font-size: 18px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.alerts-empty-sub   { font-size: 13px; }

/* ── CRITICAL banner (base.html) ── */
.critical-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(230,57,70,0.12);
    border-bottom: 1px solid rgba(230,57,70,0.35);
    color: #f5c6cb;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 24px;
    position: sticky;
    top: calc(var(--strip-h) + var(--topbar-h, 52px));
    z-index: 900;
}
.critical-banner i { color: var(--red); font-size: 14px; }
.critical-more {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}
.critical-link {
    color: var(--red);
    text-decoration: none;
    font-size: 12px;
    margin-left: 8px;
}
.critical-link:hover { text-decoration: underline; }
.critical-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
    margin-left: 4px;
    transition: color .15s;
}
.critical-dismiss:hover { color: var(--red); }

/* ── Day/Night toggle button ── */
.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: color .15s, border-color .15s, background .15s;
}
.theme-toggle-btn:hover {
    color: var(--amber);
    border-color: var(--amber);
    background: var(--amber-dim);
}
[data-theme="light"] .theme-toggle-btn:hover {
    color: var(--blue);
    border-color: var(--blue);
    background: var(--blue-dim);
}

/* ── Bell icon in topbar ── */
.bell-wrap { position: relative; }
.bell-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 15px;
    position: relative;
    transition: color .15s, border-color .15s, background .15s;
}
.bell-btn:hover { color: var(--text-primary); border-color: var(--border-strong); background: var(--bg-surface-2); }
.bell-badge {
    position: absolute;
    top: -5px; right: -5px;
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    font-family: 'IBM Plex Mono', monospace;
    min-width: 16px; height: 16px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px;
    border: 2px solid var(--bg-base);
    pointer-events: none;
}
.bell-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 1100;
    overflow: hidden;
}
.bell-dropdown-open { display: block; }
.bell-dd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.bell-dd-viewall {
    font-size: 11px;
    color: var(--blue);
    text-decoration: none;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}
.bell-dd-viewall:hover { text-decoration: underline; }
.bell-dd-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px;
    font-size: 12.5px;
    color: var(--text-muted);
}
.bell-dd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 12.5px;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: background .12s;
}
.bell-dd-item:last-child { border-bottom: none; }
.bell-dd-item:hover { background: var(--bg-surface-2); color: var(--text-primary); }
.bell-sev-critical { color: var(--red); }

/* ── Sidebar alert badge ── */
.nav-badge {
    margin-left: auto;
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    font-family: 'IBM Plex Mono', monospace;
    min-width: 18px; height: 18px;
    border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 4px;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        top: 0;
        height: 100vh;
        z-index: 1050;
    }
    .sidebar.sidebar-open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .page-body { padding: 16px; }
    .hamburger-btn { display: flex; }
    .status-strip { display: none; }
    .topbar { top: 0; }
}
