/* ========================================================================
   AIRWATCH COMMAND — Global Air Pollution Monitor
   Professional-Grade Dashboard Stylesheet
   ======================================================================== */

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

:root {
    /* Core Palette */
    --bg-primary: #0a0e17;
    --bg-secondary: #0d1320;
    --bg-panel: #111827;
    --bg-panel-alt: #0f1629;
    --bg-hover: #1a2338;

    /* Borders */
    --border-primary: #1e2d4a;
    --border-glow: #00e5ff22;
    --border-active: #00e5ff;

    /* Text */
    --text-primary: #e0e6ed;
    --text-secondary: #7a8ba5;
    --text-muted: #4a5a72;
    --text-bright: #ffffff;

    /* Accent Colors */
    --cyan: #00e5ff;
    --cyan-dim: #00e5ff88;
    --cyan-bg: #00e5ff11;
    --green: #00e676;
    --green-dim: #00e67688;
    --yellow: #ffc107;
    --yellow-dim: #ffc10788;
    --orange: #ff9800;
    --orange-dim: #ff980088;
    --red: #ff1744;
    --red-dim: #ff174488;
    --purple: #d500f9;
    --blue: #2979ff;

    /* AQI Scale Colors */
    --aqi-good: #00e676;
    --aqi-moderate: #ffc107;
    --aqi-unhealthy-sensitive: #ff9800;
    --aqi-unhealthy: #ff5722;
    --aqi-very-unhealthy: #d500f9;
    --aqi-hazardous: #b71c1c;

    /* Spacing */
    --gap-xs: 2px;
    --gap-sm: 4px;
    --gap-md: 8px;
    --gap-lg: 12px;
    --gap-xl: 16px;

    /* Typography */
    --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', 'Consolas', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;

    --radius: 4px;
    --radius-lg: 6px;
}

html {
    font-size: 12px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-mono);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-primary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan-dim); }

/* --- TOP BAR --- */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-wrap: wrap;
}

.top-bar__left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: 2px;
    white-space: nowrap;
}

.top-bar__nav {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
}

.nav-tab {
    background: transparent;
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    padding: 5px 14px;
    font-family: var(--font-mono);
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
}

.nav-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-tab.active {
    background: var(--cyan);
    color: var(--bg-primary);
    border-color: var(--cyan);
    font-weight: 700;
}

.top-bar__right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.sweep-timer {
    font-size: 10px;
    color: var(--text-secondary);
}

.timestamp {
    font-size: 10px;
    color: var(--text-secondary);
}

.sources-badge {
    font-size: 10px;
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
    padding: 2px 8px;
    border-radius: var(--radius);
}

.delta-badge {
    font-size: 10px;
    color: var(--yellow);
    border: 1px solid var(--yellow-dim);
    padding: 2px 8px;
    border-radius: var(--radius);
}

.alert-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--radius);
    letter-spacing: 1px;
}

.alert-badge--high {
    background: var(--red);
    color: white;
    animation: pulse-alert 2s infinite;
}

.alert-badge--moderate {
    background: var(--orange);
    color: white;
}

@keyframes pulse-alert {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* --- BADGES --- */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 9px;
    padding: 2px 8px;
    border-radius: var(--radius);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.badge--danger {
    background: #ff174422;
    color: var(--red);
    border: 1px solid var(--red-dim);
}

.badge--mixed {
    background: #ffc10722;
    color: var(--yellow);
    border: 1px solid var(--yellow-dim);
}

.badge--hot {
    background: #ff980022;
    color: var(--orange);
    border: 1px solid var(--orange-dim);
}

.badge--worldview {
    background: var(--cyan-bg);
    color: var(--cyan);
    border: 1px solid var(--cyan-dim);
}

.pulse-badge {
    animation: pulse-text 2s infinite;
}

@keyframes pulse-text {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* --- DASHBOARD GRID --- */
.dashboard {
    display: grid;
    grid-template-columns: 240px 1fr 300px;
    gap: 1px;
    background: var(--border-primary);
    height: calc(100vh - 42px);
    overflow: hidden;
}

.col-left, .col-right {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border-primary);
    overflow-y: auto;
}

.col-center {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border-primary);
    overflow: hidden;
}

/* --- PANELS --- */
.panel {
    background: var(--bg-panel);
    padding: 10px 12px;
    position: relative;
}

.panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-primary);
}

.panel__header h2 {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.live-dot {
    font-size: 9px;
    color: var(--green);
    font-weight: 700;
    letter-spacing: 1px;
}

.live-dot::before {
    content: '●';
    margin-right: 4px;
    animation: pulse-text 1.5s infinite;
}

/* --- SENSOR GRID --- */
.sensor-grid {
    flex: 0 0 auto;
}

.sensor-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sensor-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
}

.sensor-item:hover {
    background: var(--bg-hover);
}

.sensor-item__left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sensor-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sensor-item__name {
    font-size: 11px;
    color: var(--text-primary);
    font-weight: 500;
}

.sensor-item__sub {
    font-size: 9px;
    color: var(--text-muted);
    display: block;
}

.sensor-item__count {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-bright);
    min-width: 36px;
    text-align: right;
}

/* --- POLLUTION WATCH --- */
.pollution-watch {
    flex: 0 0 auto;
}

.watch-subtitle {
    font-size: 9px;
    color: var(--green);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.watch-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.watch-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: 10px;
    border-bottom: 1px solid #1a2338;
}

.watch-item__name {
    color: var(--text-primary);
}

.watch-item__value {
    font-weight: 700;
    font-family: var(--font-mono);
}

/* --- TAB GROUP --- */
.tab-group {
    display: flex;
    gap: 2px;
}

.mini-tab {
    font-family: var(--font-mono);
    font-size: 9px;
    padding: 2px 8px;
    background: transparent;
    border: 1px solid var(--border-primary);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.15s;
    letter-spacing: 0.5px;
}

.mini-tab.active {
    background: var(--cyan-bg);
    border-color: var(--cyan-dim);
    color: var(--cyan);
}

.mini-tab:hover {
    color: var(--text-primary);
}

/* --- RISK GAUGES --- */
.risk-gauges {
    flex: 1 1 auto;
}

.stress-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--red);
    letter-spacing: 1px;
}

.gauge-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gauge-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: 10px;
    border-bottom: 1px solid #1a2338;
}

.gauge-item__name {
    color: var(--text-secondary);
}

.gauge-item__value {
    font-weight: 700;
    font-family: var(--font-mono);
    min-width: 60px;
    text-align: right;
}

/* --- MAP --- */
.map-panel {
    flex: 1 1 60%;
    position: relative;
    padding: 0;
    min-height: 300px;
}

#map {
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
}

.leaflet-container {
    background: var(--bg-primary) !important;
    font-family: var(--font-mono) !important;
}

.leaflet-tile-pane {
    filter: saturate(0.35) brightness(0.65) contrast(1.1);
}

.leaflet-control-zoom {
    display: none !important;
}

.leaflet-control-attribution {
    background: var(--bg-panel) !important;
    color: var(--text-muted) !important;
    font-size: 8px !important;
    border: none !important;
}

.leaflet-control-attribution a {
    color: var(--text-muted) !important;
}

.map-controls {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.map-btn {
    width: 28px;
    height: 28px;
    background: var(--bg-panel);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all 0.15s;
    font-family: var(--font-sans);
}

.map-btn:hover {
    background: var(--bg-hover);
    border-color: var(--cyan-dim);
}

.map-overlay-top-right {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 500;
    display: flex;
    gap: 8px;
}

.map-mode, .map-hint {
    font-size: 9px;
    color: var(--text-muted);
    background: var(--bg-panel);
    border: 1px solid var(--border-primary);
    padding: 4px 8px;
    border-radius: var(--radius);
}

.map-legend {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    display: flex;
    gap: 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-primary);
    padding: 6px 14px;
    border-radius: var(--radius);
    flex-wrap: wrap;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot--air { background: var(--cyan); box-shadow: 0 0 6px var(--cyan-dim); }
.dot--pm25 { background: var(--red); box-shadow: 0 0 6px var(--red-dim); }
.dot--pm10 { background: var(--orange); box-shadow: 0 0 6px var(--orange-dim); }
.dot--ozone { background: var(--purple); box-shadow: 0 0 6px #d500f988; }
.dot--no2 { background: var(--yellow); box-shadow: 0 0 6px var(--yellow-dim); }
.dot--so2 { background: var(--green); box-shadow: 0 0 6px var(--green-dim); }
.dot--co { background: var(--blue); box-shadow: 0 0 6px #2979ff88; }
.dot--health { background: #ff1744; box-shadow: 0 0 6px var(--red-dim); }

/* Map Markers */
.pollution-marker {
    border-radius: 50%;
    border: 2px solid rgba(0, 229, 255, 0.6);
    background: rgba(0, 229, 255, 0.25);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
    transition: transform 0.2s;
}

.pollution-marker:hover {
    transform: scale(1.3);
}

.pollution-marker--good {
    border-color: rgba(0, 230, 118, 0.7);
    background: rgba(0, 230, 118, 0.25);
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.3);
}

.pollution-marker--moderate {
    border-color: rgba(255, 193, 7, 0.7);
    background: rgba(255, 193, 7, 0.25);
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.3);
}

.pollution-marker--unhealthy-sensitive {
    border-color: rgba(255, 152, 0, 0.7);
    background: rgba(255, 152, 0, 0.25);
    box-shadow: 0 0 12px rgba(255, 152, 0, 0.4);
}

.pollution-marker--unhealthy {
    border-color: rgba(255, 87, 34, 0.7);
    background: rgba(255, 87, 34, 0.3);
    box-shadow: 0 0 14px rgba(255, 87, 34, 0.4);
}

.pollution-marker--very-unhealthy {
    border-color: rgba(213, 0, 249, 0.7);
    background: rgba(213, 0, 249, 0.3);
    box-shadow: 0 0 16px rgba(213, 0, 249, 0.4);
}

.pollution-marker--hazardous {
    border-color: rgba(183, 28, 28, 0.8);
    background: rgba(183, 28, 28, 0.35);
    box-shadow: 0 0 18px rgba(183, 28, 28, 0.5);
    animation: pulse-hazardous 1.5s infinite;
}

@keyframes pulse-hazardous {
    0%, 100% { box-shadow: 0 0 18px rgba(183, 28, 28, 0.5); }
    50% { box-shadow: 0 0 28px rgba(183, 28, 28, 0.8); }
}

/* Map Popup */
.leaflet-popup-content-wrapper {
    background: var(--bg-panel) !important;
    border: 1px solid var(--border-primary) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-mono) !important;
}

.leaflet-popup-tip {
    background: var(--bg-panel) !important;
    border: 1px solid var(--border-primary) !important;
}

.leaflet-popup-content {
    margin: 10px 14px !important;
    font-size: 10px !important;
    line-height: 1.6 !important;
}

.popup-city {
    font-size: 12px;
    font-weight: 700;
    color: var(--cyan);
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.popup-aqi {
    font-size: 20px;
    font-weight: 800;
    margin: 4px 0;
}

.popup-detail {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    border-bottom: 1px solid var(--border-primary);
}

.popup-detail:last-child {
    border-bottom: none;
}

/* --- CENTER BOTTOM --- */
.center-bottom {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    background: var(--border-primary);
    max-height: 42%;
    overflow: hidden;
}

.center-bottom .panel {
    overflow-y: auto;
}

/* --- TICKER --- */
.ticker-feed {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.ticker-item {
    padding: 6px 0;
    border-bottom: 1px solid var(--border-primary);
    font-size: 10px;
    line-height: 1.4;
}

.ticker-item__source {
    display: inline-block;
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: 700;
    margin-bottom: 3px;
    letter-spacing: 0.5px;
}

.ticker-item__time {
    font-size: 8px;
    color: var(--text-muted);
    margin-left: 4px;
}

.ticker-item__text {
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}

.item-count {
    font-size: 9px;
    color: var(--text-muted);
}

/* --- SWEEP DELTA --- */
.sweep-stats {
    font-size: 10px;
}

.sweep-row {
    display: flex;
    gap: 10px;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.sweep-feed {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 180px;
    overflow-y: auto;
}

.sweep-item {
    font-size: 9px;
    padding: 3px 0;
    border-bottom: 1px solid #1a2338;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sweep-item__tag {
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: 700;
}

/* --- POLLUTANT LEVELS --- */
.levels-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.level-section {
    margin-bottom: 4px;
}

.level-section__title {
    font-size: 8px;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.level-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.level-card {
    background: var(--bg-panel-alt);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius);
    padding: 6px 8px;
    text-align: center;
}

.level-card__label {
    font-size: 8px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.level-card__value {
    font-size: 16px;
    font-weight: 800;
    margin: 2px 0;
}

.level-card__unit {
    font-size: 8px;
    color: var(--text-muted);
}

.level-card__change {
    font-size: 9px;
    margin-top: 2px;
}

.change--up { color: var(--red); }
.change--down { color: var(--green); }
.change--flat { color: var(--text-muted); }

/* Sparkline container */
.level-card__spark {
    height: 20px;
    margin-top: 3px;
}

.level-card__spark canvas {
    width: 100% !important;
    height: 20px !important;
}

/* --- HEALTH IMPACT --- */
.health-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.health-card {
    background: var(--bg-panel-alt);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius);
    padding: 8px;
    border-left: 3px solid var(--cyan);
}

.health-card__title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.health-card__tags {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.health-tag {
    font-size: 8px;
    padding: 1px 5px;
    border-radius: 2px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.health-card__body {
    font-size: 9px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.health-card__risk {
    font-size: 9px;
    margin-top: 4px;
    padding: 3px 6px;
    background: #ff174411;
    border-radius: var(--radius);
    color: var(--orange);
    line-height: 1.4;
}

/* --- SIGNAL CORE --- */
.signal-core, .signal-core-bottom {
    flex: 0 0 auto;
}

.signal-metrics {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.signal-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #1a2338;
}

.signal-metric__name {
    font-size: 10px;
    color: var(--text-secondary);
}

.signal-metric__value {
    font-size: 11px;
    font-weight: 700;
    min-width: 40px;
    text-align: right;
    padding: 1px 6px;
    border-radius: var(--radius);
}

/* --- CROSS-SOURCE SIGNALS --- */
.signals-panel {
    flex: 1 1 auto;
    overflow-y: auto;
}

.signals-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 460px);
    overflow-y: auto;
}

.signal-card {
    border-left: 3px solid var(--cyan);
    padding: 6px 8px;
    background: var(--bg-panel-alt);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.signal-card__number {
    font-size: 9px;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.signal-card__text {
    font-size: 10px;
    color: var(--text-primary);
    line-height: 1.4;
}

.signal-card--warning {
    border-left-color: var(--orange);
}

.signal-card--warning .signal-card__number {
    color: var(--orange);
}

.signal-card--critical {
    border-left-color: var(--red);
}

.signal-card--critical .signal-card__number {
    color: var(--red);
}

.signal-card--info {
    border-left-color: var(--blue);
}

.signal-card--info .signal-card__number {
    color: var(--blue);
}

/* --- ALERT STREAM --- */
.alert-stream {
    flex: 1 1 auto;
    overflow-y: auto;
}

.urgent-count {
    font-size: 10px;
    font-weight: 700;
    color: var(--red);
    background: #ff174422;
    padding: 2px 8px;
    border-radius: var(--radius);
}

.stream-feed {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.stream-item {
    padding: 6px 8px;
    background: var(--bg-panel-alt);
    border-radius: var(--radius);
    border: 1px solid var(--border-primary);
}

.stream-item__header {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.stream-tag {
    font-size: 8px;
    padding: 1px 5px;
    border-radius: 2px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.stream-tag--source {
    background: #00e5ff22;
    color: var(--cyan);
    border: 1px solid var(--cyan-dim);
}

.stream-tag--time {
    background: transparent;
    color: var(--text-muted);
}

.stream-tag--breaking {
    background: #ff174433;
    color: var(--red);
    border: 1px solid var(--red-dim);
}

.stream-tag--warning {
    background: #ff980033;
    color: var(--orange);
    border: 1px solid var(--orange-dim);
}

.stream-tag--category {
    background: #d500f922;
    color: var(--purple);
    border: 1px solid #d500f944;
}

.stream-item__text {
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.stream-item--breaking {
    border-color: var(--red-dim);
    background: #ff174408;
}

/* --- SOURCE TAGS --- */
.source-tag {
    font-size: 8px;
    padding: 1px 5px;
    border-radius: 2px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.source-tag--epa { background: #2979ff33; color: var(--blue); }
.source-tag--who { background: #00e67633; color: var(--green); }
.source-tag--aqicn { background: #00e5ff33; color: var(--cyan); }
.source-tag--sat { background: #d500f933; color: var(--purple); }
.source-tag--gov { background: #ffc10733; color: var(--yellow); }
.source-tag--alert { background: #ff174433; color: var(--red); }
.source-tag--sensor { background: #ff980033; color: var(--orange); }

/* --- AQI COLOR UTILITIES --- */
.aqi-good { color: var(--aqi-good); }
.aqi-moderate { color: var(--aqi-moderate); }
.aqi-usg { color: var(--aqi-unhealthy-sensitive); }
.aqi-unhealthy { color: var(--aqi-unhealthy); }
.aqi-very-unhealthy { color: var(--aqi-very-unhealthy); }
.aqi-hazardous { color: var(--aqi-hazardous); }

.bg-aqi-good { background: var(--aqi-good); color: #000; }
.bg-aqi-moderate { background: var(--aqi-moderate); color: #000; }
.bg-aqi-usg { background: var(--aqi-unhealthy-sensitive); color: #000; }
.bg-aqi-unhealthy { background: var(--aqi-unhealthy); color: #fff; }
.bg-aqi-very-unhealthy { background: var(--aqi-very-unhealthy); color: #fff; }
.bg-aqi-hazardous { background: var(--aqi-hazardous); color: #fff; }

/* --- BAR VISUALIZATION --- */
.bar-mini {
    height: 3px;
    background: var(--border-primary);
    border-radius: 2px;
    margin-top: 2px;
    overflow: hidden;
}

.bar-mini__fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}

/* --- ANIMATIONS --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in {
    animation: slideInRight 0.4s ease-out;
}

/* --- RESPONSIVE --- */
@media (max-width: 1400px) {
    .dashboard {
        grid-template-columns: 220px 1fr 260px;
    }
}

@media (max-width: 1200px) {
    .dashboard {
        grid-template-columns: 200px 1fr 240px;
    }
    .center-bottom {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1000px) {
    .dashboard {
        grid-template-columns: 1fr;
        height: auto;
    }
    .col-left, .col-right {
        overflow: visible;
    }
    .center-bottom {
        grid-template-columns: 1fr 1fr;
    }
    .top-bar__nav {
        order: 3;
        width: 100%;
    }
    .map-panel {
        min-height: 400px;
    }
}

@media (max-width: 640px) {
    .center-bottom {
        grid-template-columns: 1fr;
    }
    .map-legend {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* --- GLOW EFFECTS --- */
.glow-cyan {
    text-shadow: 0 0 8px var(--cyan-dim);
}

.glow-red {
    text-shadow: 0 0 8px var(--red-dim);
}

.border-glow {
    box-shadow: 0 0 12px var(--border-glow);
}

/* --- SCANLINE OVERLAY --- */
.map-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 229, 255, 0.008) 2px,
        rgba(0, 229, 255, 0.008) 4px
    );
    z-index: 450;
}
