/* ═══════════════════════════════════════════════════════════
   EU ATC DISRUPTION MONITOR v0.4 — Sidebars + stacked maps
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg:           #f0f2f5;
    --bg-card:      #ffffff;
    --bg-header:    #1b2538;
    --bg-header-2:  #243046;

    --border:       #e2e6ec;
    --border-hover: #cdd3dc;

    --text:         #1e293b;
    --text-secondary: #64748b;
    --text-muted:   #94a3b8;
    --text-inverse: #ffffff;

    --red:          #ef4444;
    --red-bg:       #fef2f2;
    --red-border:   #fecaca;
    --orange:       #f59e0b;
    --orange-bg:    #fffbeb;
    --orange-border:#fde68a;
    --green:        #10b981;
    --green-bg:     #ecfdf5;
    --green-border: #a7f3d0;
    --blue:         #3b82f6;
    --blue-bg:      #eff6ff;
    --blue-border:  #bfdbfe;
    --purple:       #8b5cf6;
    --purple-bg:    #f5f3ff;
    --purple-border:#ddd6fe;
    --cyan:         #06b6d4;

    --font:        'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:   'IBM Plex Mono', 'SF Mono', monospace;

    --radius:      10px;
    --radius-sm:   6px;
    --shadow:      0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:   0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg:   0 8px 24px rgba(0,0,0,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

::selection { background: var(--blue); color: #fff; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }


/* ═══════════════════ HEADER ═══════════════════ */

#header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 56px;
    background: var(--bg-header);
    color: var(--text-inverse);
    flex-shrink: 0;
    z-index: 1000;
}

.header-left { display: flex; align-items: center; }

.logo { display: flex; align-items: center; gap: 10px; }
.logo-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: opacity 0.15s;
}
.logo-link:hover {
    opacity: 0.85;
}
.logo-svg { width: 28px; height: 28px; color: var(--cyan); }
.logo-emoji { font-size: 1.6rem; line-height: 1; }
.logo-text { display: flex; flex-direction: column; }
.logo-title { font-size: 1.35rem; font-weight: 700; letter-spacing: 0.3px; line-height: 1.2; }
.logo-sub { font-size: 0.85rem; color: rgba(255,255,255,0.5); font-weight: 400; }

.header-center { display: flex; align-items: center; }

.kpi-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-header-2);
    padding: 6px 20px;
    border-radius: 8px;
}
.kpi { display: flex; flex-direction: column; align-items: center; }
.kpi-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.45);
    font-weight: 500;
}
.kpi-value {
    font-size: 0.92rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: #fff;
}
.kpi-value.kpi-ok      { color: var(--green); }
.kpi-value.kpi-warning { color: var(--orange); }
.kpi-value.kpi-danger  { color: var(--red); }
.kpi-divider { width: 1px; height: 28px; background: rgba(255,255,255,0.1); }

.kpi-net-wrap { position: relative; cursor: help; }
.kpi-tooltip {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 420px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    padding: 14px 16px;
    z-index: 900;
    text-align: left;
    color: var(--text);
    font-size: 0.82rem;
    line-height: 1.6;
}
.kpi-tooltip::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
}
.kpi-tooltip strong { display: block; margin-bottom: 8px; font-size: 0.88rem; }
.kpi-tooltip ul { list-style: none; margin: 0; padding: 0; }
.kpi-tooltip li { margin-bottom: 8px; display: flex; align-items: baseline; gap: 8px; }
.kpi-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    top: 1px;
}
.dot-critical { background: var(--red); }
.dot-warning  { background: var(--orange); }
.dot-ok       { background: var(--green); }
.kpi-net-wrap:hover .kpi-tooltip { display: block; }

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

.utc-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-header-2);
    padding: 4px 16px;
    border-radius: 8px;
}
.utc-label { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 2px; color: rgba(255,255,255,0.4); }
.utc-time {
    font-size: 1.15rem;
    font-weight: 600;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: var(--cyan);
}
.last-refresh {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.3px;
}


/* ═══════════════════ RESET LAYOUT BUTTON ═══════════════════ */

.reset-layout-btn,
.contact-btn {
    font-family: var(--font);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    min-width: 80px;
}

.reset-layout-btn {
    border: 1px solid rgba(255,255,255,0.15);
    background: var(--bg-header-2);
    color: rgba(255,255,255,0.6);
}
.reset-layout-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}


/* ═══════════════════ CONTACT BUTTON + MODAL ═══════════════════ */

.contact-btn {
    border: 1px solid var(--cyan);
    background: rgba(6, 182, 212, 0.15);
    color: var(--cyan);
}
.contact-btn:hover {
    background: var(--cyan);
    color: var(--bg-header);
    border-color: var(--cyan);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.2s;
}
.modal-overlay.hidden { display: none; }

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 0.95rem; font-weight: 600; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.15s;
}
.modal-close:hover { color: var(--text); }

.contact-form { padding: 18px; display: flex; flex-direction: column; gap: 14px; }

.form-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.form-input {
    font-family: var(--font);
    font-size: 0.82rem;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--blue); }
.form-textarea { resize: vertical; min-height: 80px; }

.form-submit {
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--blue);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}
.form-submit:hover { background: #2563eb; }


/* ═══════════════════ NEWS TICKER ═══════════════════ */

#ticker {
    display: flex;
    align-items: center;
    height: 32px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    overflow: hidden;
    flex-shrink: 0;
}

.ticker-label {
    flex-shrink: 0;
    padding: 0 14px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #fff;
    background: var(--red);
    height: 100%;
    display: flex;
    align-items: center;
    z-index: 2;
}

.ticker-track {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    mask-image: linear-gradient(to right, transparent 0%, black 2%, black 98%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 2%, black 98%, transparent 100%);
}

.ticker-content {
    display: flex;
    align-items: center;
    gap: 0;
    white-space: nowrap;
    animation: tickerScroll var(--ticker-duration, 60s) linear infinite;
    padding-left: 12px;
}

.ticker-content:hover {
    animation-play-state: paused;
}

@keyframes tickerScroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 24px;
    font-size: 0.72rem;
    color: #cbd5e1;
    font-family: var(--font);
}

.ticker-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ticker-dot.td-high   { background: var(--red); }
.ticker-dot.td-medium { background: var(--orange); }
.ticker-dot.td-low    { background: var(--green); }

.ticker-sep {
    color: #475569;
    font-size: 0.6rem;
    padding: 0 4px;
}

.ticker-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 6px;
    flex-shrink: 0;
    height: 100%;
    border-right: 1px solid #334155;
}
.ticker-btn {
    width: 24px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 3px;
    background: transparent;
    color: #94a3b8;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}
.ticker-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
#ticker-close:hover { background: rgba(239,68,68,0.25); color: #fca5a5; }
#ticker.paused .ticker-content { animation-play-state: paused; }
#ticker.hidden-ticker { display: none !important; }


/* ═══════════════════ MAIN 3-COLUMN GRID ═══════════════════ */

#main {
    flex: 1;
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    gap: 12px;
    padding: 12px;
    min-height: 0;
}

/* ─── Sidebars ─── */

#sidebar-left,
#sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow-y: auto;
    align-items: stretch;
}

/* ─── Center: two maps stacked ─── */

#center-maps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}


/* ═══════════════════ CARDS ═══════════════════ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 0 1 auto;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.card-head h2 { font-size: 0.82rem; font-weight: 600; color: var(--text); }

.card-head-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Drag handle */
.drag-handle { cursor: grab; }
.drag-handle:active { cursor: grabbing; }

.grip-icon {
    font-size: 0.9rem;
    color: var(--text-muted);
    opacity: 0.4;
    transition: opacity 0.2s;
    cursor: grab;
    user-select: none;
    line-height: 1;
}
.card:hover .grip-icon { opacity: 0.8; }
.grip-icon:active { cursor: grabbing; }

/* Widget collapse / close buttons */
.widget-btn {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.widget-btn:hover { background: #e2e8f0; color: var(--text); }
.widget-btn-close:hover { background: #fee2e2; color: var(--red); }

.widget-btn-collapse::after {
    content: "\25B2";
    font-size: 0.55rem;
    transition: transform 0.2s;
}
.widget.collapsed .widget-btn-collapse::after {
    transform: rotate(180deg);
}

.widget.collapsed .card-body,
.widget.collapsed .card-sub-bar,
.widget.collapsed .map-wrap {
    display: none;
}
.widget.collapsed .card-head {
    border-bottom: none;
}

.widget.hidden-widget {
    display: none !important;
}

/* Sortable ghost / drag states */
.sortable-ghost {
    opacity: 0.3;
    border: 2px dashed var(--blue) !important;
    border-radius: var(--radius);
}
.sortable-chosen {
    box-shadow: var(--shadow-lg) !important;
    z-index: 999;
}
.sortable-drag {
    opacity: 0.9 !important;
    transform: rotate(1deg);
    box-shadow: 0 12px 36px rgba(0,0,0,0.2) !important;
}

.widget-zone {
    min-height: 60px;
}
.widget-zone.sortable-over {
    background: rgba(59,130,246,0.04);
    border-radius: var(--radius);
}

.card-sub-bar {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.archive-link {
    font-size: 0.75rem;
    color: var(--blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}
.archive-link:hover { color: var(--text); }

.card-body {
    flex: 0 1 auto;
    overflow-y: auto;
    padding: 8px;
    min-height: 0;
}


/* ─── Map cards ─── */

.map-card { flex: 0 0 auto; display: flex; flex-direction: column; }

.map-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
}

#map, #nop-map {
    width: 100%;
    height: 100%;
    background: #e0e5ec;
}


/* ═══════════════════ BADGES / INDICATORS ═══════════════════ */

.badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg);
    color: var(--text-secondary);
    font-family: var(--font-mono);
}
.badge-red    { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.badge-orange { background: var(--orange-bg); color: var(--orange); border: 1px solid var(--orange-border); }
.badge-green  { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.badge-blue   { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-border); }

.live-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--green);
}
.live-dot {
    width: 6px; height: 6px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.85); }
}


/* ═══════════════════ OPEN NOP LINK ═══════════════════ */

.open-link {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--blue);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--blue-border);
    background: var(--blue-bg);
    transition: all 0.15s;
}
.open-link:hover { background: var(--blue); color: #fff; border-color: var(--blue); }


/* ═══════════════════ MAP CONTROLS ═══════════════════ */

#map-controls { display: flex; gap: 3px; }

.map-btn {
    font-family: var(--font);
    font-size: 0.65rem;
    font-weight: 500;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.map-btn:hover { background: var(--bg-card); color: var(--text); border-color: var(--border-hover); }
.map-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }


/* ═══════════════════ MAP LEGENDS ═══════════════════ */

#map-legend {
    position: absolute;
    bottom: 12px; left: 12px;
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(8px);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 800;
    font-size: 0.68rem;
}
.legend-title { font-weight: 600; font-size: 0.7rem; margin-bottom: 4px; color: var(--text); }
.legend-row { display: flex; align-items: center; gap: 6px; padding: 1px 0; color: var(--text-secondary); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-red    { background: var(--red); }
.dot-orange { background: var(--orange); }
.dot-green  { background: var(--green); }
.dot-blue   { background: var(--blue); }
.dot-purple { background: var(--purple); }

.nop-overlay {
    position: absolute;
    bottom: 12px; left: 12px;
    z-index: 800;
}
.nop-legend {
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(8px);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-size: 0.68rem;
}
.nop-legend-title { font-weight: 600; margin-bottom: 6px; color: var(--text); font-size: 0.72rem; }
.nop-legend-row { display: flex; align-items: center; gap: 6px; padding: 2px 0; color: var(--text-secondary); }
.nop-swatch { width: 14px; height: 10px; border-radius: 2px; flex-shrink: 0; }


/* ═══════════════════ NOP TACTICAL UPDATE ═══════════════════ */

.nop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    margin-bottom: 6px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}
.nop-header:hover { background: var(--border); }

.nop-timestamp {
    font-size: 0.65rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.nop-source-inline {
    font-size: 0.6rem;
    font-style: italic;
    color: var(--text-muted);
}

.nop-section-heading {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    margin: 8px 0 4px 2px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.nop-card {
    padding: 8px 10px;
    border-left: 3px solid var(--border);
    margin-bottom: 4px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--bg);
    cursor: pointer;
    transition: all 0.15s;
}
.nop-card:hover { background: var(--border); }
.nop-card.nop-sev-high   { border-left-color: var(--red); background: var(--red-bg); }
.nop-card.nop-sev-medium { border-left-color: var(--orange); background: var(--orange-bg); }
.nop-card.nop-sev-low    { border-left-color: var(--blue); background: var(--blue-bg); }

.nop-card-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nop-flag {
    width: 18px;
    height: 14px;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
}

.nop-card-detail {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Keep sev-tag for other widgets */
.sev-tag {
    font-size: 0.58rem; font-weight: 700; letter-spacing: 0.5px;
    padding: 1px 6px; border-radius: 3px;
    text-transform: uppercase; font-family: var(--font-mono);
}
.sev-tag.tag-ALARM   { background: var(--red); color: #fff; }
.sev-tag.tag-WARNING { background: var(--orange); color: #fff; }
.sev-tag.tag-INFO    { background: var(--blue); color: #fff; }


/* ═══════════════════ STRIKE ITEMS ═══════════════════ */

.strike-item {
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--border);
    background: var(--bg);
    transition: background 0.15s;
}
.strike-item:hover { background: var(--border); }
.strike-item.imp-high   { border-left-color: var(--red); background: var(--red-bg); }
.strike-item.imp-medium { border-left-color: var(--orange); background: var(--orange-bg); }
.strike-item.imp-low    { border-left-color: var(--blue); background: var(--blue-bg); }

.strike-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.strike-country { font-weight: 600; font-size: 0.82rem; display: flex; align-items: center; gap: 6px; }
.strike-country img { width: 18px; height: 14px; border-radius: 2px; object-fit: cover; }
.strike-status-tag {
    font-size: 0.58rem; font-weight: 700; letter-spacing: 0.5px;
    padding: 2px 7px; border-radius: 3px; font-family: var(--font-mono);
}
.strike-status-tag.st-CONFIRMED { background: var(--red); color: #fff; }
.strike-status-tag.st-ONGOING   { background: var(--orange); color: #fff; }
.strike-status-tag.st-ANNOUNCED { background: var(--orange-bg); color: var(--orange); border: 1px solid var(--orange-border); }
.strike-status-tag.st-POSSIBLE  { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-border); }

.strike-meta { font-size: 0.68rem; color: var(--text-muted); margin-bottom: 3px; }
.strike-detail { font-size: 0.72rem; color: var(--text-secondary); line-height: 1.4; }


/* ═══════════════════ AIRPORT ITEMS ═══════════════════ */

.apt-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; margin-bottom: 4px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    transition: background 0.15s;
}
.apt-item:hover { background: var(--border); }

.apt-code {
    font-size: 1rem; font-weight: 700; font-family: var(--font-mono);
    width: 38px; text-align: center; flex-shrink: 0;
}
.apt-code.level-high   { color: var(--red); }
.apt-code.level-medium { color: var(--orange); }
.apt-code.level-low    { color: var(--green); }

.apt-info { flex: 1; min-width: 0; }
.apt-name {
    font-size: 0.75rem; font-weight: 500; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.apt-stats { display: flex; gap: 8px; font-size: 0.65rem; color: var(--text-muted); font-family: var(--font-mono); }

.apt-bar-wrap { width: 54px; flex-shrink: 0; }
.apt-bar-bg { width: 100%; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.apt-bar { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.apt-bar.level-high   { background: var(--red); }
.apt-bar.level-medium { background: var(--orange); }
.apt-bar.level-low    { background: var(--green); }

.apt-score {
    font-size: 0.82rem; font-weight: 700; font-family: var(--font-mono);
    width: 30px; text-align: right; flex-shrink: 0;
}
.apt-score.level-high   { color: var(--red); }
.apt-score.level-medium { color: var(--orange); }
.apt-score.level-low    { color: var(--green); }


/* ═══════════════════ WEATHER ITEMS ═══════════════════ */

.wx-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 8px 10px; margin-bottom: 4px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    transition: background 0.15s;
}
.wx-item:hover { background: var(--border); }

.wx-icon {
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0;
}
.wx-icon.wx-high   { background: var(--red-bg); }
.wx-icon.wx-medium { background: var(--orange-bg); }

.wx-body { flex: 1; min-width: 0; }
.wx-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.wx-icao { font-weight: 700; font-size: 0.78rem; font-family: var(--font-mono); }
.wx-type-tag {
    font-size: 0.58rem; font-weight: 600; padding: 1px 5px;
    border-radius: 3px; font-family: var(--font-mono);
}
.wx-type-tag.wt-high   { background: var(--red-bg); color: var(--red); }
.wx-type-tag.wt-medium { background: var(--orange-bg); color: var(--orange); }

.wx-detail { font-size: 0.7rem; color: var(--text-secondary); line-height: 1.4; }
.wx-valid { font-size: 0.62rem; color: var(--text-muted); margin-top: 2px; }


/* ═══════════════════ NEWS ITEMS ═══════════════════ */

.news-item {
    padding: 8px 10px; margin-bottom: 4px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border-left: 3px solid var(--border);
    transition: background 0.15s;
}
.news-item:hover { background: var(--border); }
.news-item.cat-STRIKE     { border-left-color: var(--red); }
.news-item.cat-DISRUPTION { border-left-color: var(--orange); }
.news-item.cat-SAFETY     { border-left-color: var(--purple); }
.news-item.cat-AIRSPACE   { border-left-color: var(--blue); }
.news-item.cat-EVENT      { border-left-color: var(--cyan); }

.news-top { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.news-source { font-size: 0.62rem; font-weight: 600; color: var(--blue); text-transform: uppercase; letter-spacing: 0.5px; }
.news-cat {
    font-size: 0.55rem; font-weight: 600; padding: 1px 5px;
    border-radius: 3px; background: var(--border); color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.news-time { font-size: 0.62rem; color: var(--text-muted); margin-left: auto; font-family: var(--font-mono); }
.news-title { font-size: 0.78rem; font-weight: 600; color: var(--text); line-height: 1.3; margin-bottom: 2px; }
.news-summary { font-size: 0.7rem; color: var(--text-secondary); line-height: 1.4; }


/* ═══════════════════ LEAFLET POPUP OVERRIDES ═══════════════════ */

.leaflet-popup-content-wrapper {
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-lg) !important;
    font-family: var(--font) !important;
    padding: 0 !important;
}
.leaflet-popup-content {
    margin: 0 !important; font-size: 0.78rem !important;
    line-height: 1.5 !important; min-width: 200px !important;
}
.popup-card { padding: 12px 14px; }
.popup-title { font-weight: 700; font-size: 0.88rem; margin-bottom: 4px; }
.popup-subtitle { font-size: 0.7rem; color: var(--text-muted); font-family: var(--font-mono); margin-bottom: 8px; }
.popup-row { display: flex; justify-content: space-between; padding: 2px 0; font-size: 0.75rem; }
.popup-row-label { color: var(--text-secondary); }
.popup-row-value { font-weight: 600; font-family: var(--font-mono); }
.popup-row-value.val-red    { color: var(--red); }
.popup-row-value.val-orange { color: var(--orange); }
.popup-row-value.val-green  { color: var(--green); }
.popup-tag {
    display: inline-block; font-size: 0.6rem; font-weight: 700;
    padding: 2px 6px; border-radius: 3px; margin-top: 4px; font-family: var(--font-mono);
}
.popup-tag.pt-high   { background: var(--red-bg); color: var(--red); }
.popup-tag.pt-medium { background: var(--orange-bg); color: var(--orange); }
.popup-tag.pt-low    { background: var(--green-bg); color: var(--green); }


/* ═══════════════════ TWITTER EMBED ═══════════════════ */

.twitter-embed-body {
    padding: 0 !important;
    max-height: 500px;
    overflow-y: auto;
}

/* ═══════════════════ LIVESTREAMS ═══════════════════ */

.livestream-body { padding: 6px !important; display: flex; flex-direction: column; gap: 6px; }
.stream-row { position: relative; }
.stream-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}
.stream-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
}
.stream-frame {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 6px;
}

/* ═══════════════════ FOOTER ═══════════════════ */

#footer {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; padding: 8px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    font-size: 0.68rem; color: var(--text-muted);
    flex-shrink: 0;
}
.dot-sep { color: var(--border); }
.status-ok { color: var(--green); font-weight: 500; }


/* ═══════════════════ EXPANDABLE ITEMS ═══════════════════ */

.expandable {
    cursor: pointer;
    position: relative;
}

.expand-chevron {
    display: inline-block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-left: auto;
    position: relative;
    transition: transform 0.25s ease;
}
.expand-chevron::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    border-right: 1.5px solid var(--text-muted);
    border-bottom: 1.5px solid var(--text-muted);
    transform: translate(-50%, -65%) rotate(45deg);
    transition: transform 0.25s ease, border-color 0.15s;
}
.expandable:hover .expand-chevron::before {
    border-color: var(--text-secondary);
}
.expandable.expanded .expand-chevron {
    transform: rotate(180deg);
}

.expandable-body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease, margin 0.25s ease;
    margin-top: 0;
}
.expandable.expanded .expandable-body {
    max-height: 500px;
    opacity: 1;
    margin-top: 6px;
}

/* Strike expanded */
.strike-item.expandable { cursor: pointer; }
.strike-item .strike-header { display: flex; align-items: center; gap: 4px; }
.strike-item .strike-header-content { flex: 1; min-width: 0; }

/* Weather expanded */
.wx-item.expandable { cursor: pointer; flex-wrap: wrap; }
.wx-item .wx-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.wx-item .expandable-body {
    width: 100%;
    flex-basis: 100%;
    padding-left: 42px; /* align with wx-body: 32px icon + 10px gap */
    box-sizing: border-box;
}

/* News expanded */
.news-item.expandable { cursor: pointer; }
.news-item .news-header { display: flex; align-items: center; gap: 4px; }
.news-item .news-header-content { flex: 1; min-width: 0; }

/* Airport expanded */
.apt-item.expandable { flex-wrap: wrap; cursor: pointer; }
.apt-item .apt-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.apt-item .expandable-body { width: 100%; padding-left: 48px; }
.apt-expanded-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    font-size: 0.68rem;
}
.apt-expanded-stats .apt-stat-label { color: var(--text-muted); }
.apt-expanded-stats .apt-stat-value {
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text);
    text-align: right;
}

/* Ticker popup */
.ticker-item.clickable {
    cursor: pointer;
    border-radius: 3px;
    padding: 2px 24px;
    transition: background 0.15s;
}
.ticker-item.clickable:hover {
    background: rgba(255,255,255,0.08);
}

.ticker-popup {
    position: fixed;
    top: 88px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 14px 18px;
    max-width: 480px;
    width: 90vw;
    z-index: 9000;
    animation: fadeIn 0.2s ease;
}
.ticker-popup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.ticker-popup-severity {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 3px;
    font-family: var(--font-mono);
    text-transform: uppercase;
}
.ticker-popup-severity.tps-high   { background: var(--red); color: #fff; }
.ticker-popup-severity.tps-medium { background: var(--orange); color: #fff; }
.ticker-popup-severity.tps-low    { background: var(--green); color: #fff; }
.ticker-popup-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.ticker-popup-close:hover { color: var(--text); }
.ticker-popup-text {
    font-size: 0.82rem;
    color: var(--text);
    line-height: 1.5;
}
.ticker-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 8999;
}

.clickable-item {
    cursor: pointer;
}


/* ═══════════════════ ANIMATIONS ═══════════════════ */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card { animation: fadeIn 0.3s ease both; }
#sidebar-left .card:nth-child(1)  { animation-delay: 0.05s; }
#sidebar-left .card:nth-child(2)  { animation-delay: 0.10s; }
#center-maps .card:nth-child(1)   { animation-delay: 0.07s; }
#center-maps .card:nth-child(2)   { animation-delay: 0.14s; }
#sidebar-right .card:nth-child(1) { animation-delay: 0.08s; }
#sidebar-right .card:nth-child(2) { animation-delay: 0.13s; }
#sidebar-right .card:nth-child(3) { animation-delay: 0.18s; }


/* ═══════════════════ NEWS SHOW MORE ═══════════════════ */

.news-show-more {
    display: block;
    width: 100%;
    padding: 0.55rem 0;
    margin-top: 0.25rem;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.news-show-more:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #94a3b8;
}

/* ═══════════════════ RESPONSIVE ═══════════════════ */

@media (max-width: 1200px) {
    #main { grid-template-columns: 280px 1fr 280px; }
}

@media (max-width: 900px) {
    #main {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    #center-maps { order: -1; }
    .map-wrap { aspect-ratio: 4 / 3; }
}

@media (max-width: 600px) {
    .kpi-row { display: none; }
}
