/* ==========================================================================
   AquaG — Operational Urban Flood GIS Command Center (SIH26085)
   Premium SCADA & Operational Command Center UI Design System
   ========================================================================== */

:root {
  --bg-main: #060a12;
  --bg-workspace: #080d19;
  --bg-glass: rgba(10, 17, 30, 0.85);
  --bg-glass-solid: #0a111e;
  --bg-card: rgba(15, 25, 45, 0.7);
  
  --border-glass: rgba(56, 189, 248, 0.16);
  --border-glass-light: rgba(255, 255, 255, 0.1);
  --border-cyan: rgba(6, 182, 212, 0.4);

  --accent-cyan: #06b6d4;
  --accent-cyan-light: #38bdf8;
  --accent-cyan-bright: #00f3ff;
  --accent-blue: #3b82f6;
  --accent-purple: #a855f7;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Severity & Risk Colors */
  --severity-low: #10b981;
  --severity-low-bg: rgba(16, 185, 129, 0.16);
  --severity-low-border: rgba(16, 185, 129, 0.4);

  --severity-medium: #eab308;
  --severity-medium-bg: rgba(234, 179, 8, 0.16);
  --severity-medium-border: rgba(234, 179, 8, 0.4);

  --severity-high: #f97316;
  --severity-high-bg: rgba(249, 115, 22, 0.16);
  --severity-high-border: rgba(249, 115, 22, 0.4);

  --severity-critical: #ef4444;
  --severity-critical-bg: rgba(239, 68, 68, 0.16);
  --severity-critical-border: rgba(239, 68, 68, 0.4);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-lg: 10px;
  --radius-md: 6px;
  --radius-sm: 4px;
}

/* Dual Theme System Variables with True Glassmorphism */
body.theme-bright {
  --bg-main: #dbeaf7;
  --bg-workspace: #cee2f2;
  --bg-glass: rgba(222, 239, 254, 0.82);
  --bg-glass-solid: #d4eafc;
  --bg-card: rgba(216, 237, 254, 0.72);
  --border-glass: rgba(147, 197, 253, 0.75);
  --border-glass-light: rgba(191, 219, 254, 0.85);
  --border-cyan: #38bdf8;
  --shadow-glass: rgba(10, 60, 110, 0.12);
  --specular-glass: rgba(255, 255, 255, 0.85);
  --blur-glass: blur(18px) saturate(190%);
  --text-main: #07223d;
  --text-muted: #143d63;
  --text-dim: #326491;
  --accent-cyan-bright: #0284c7;
  --accent-cyan: #0284c7;
  --accent-cyan-light: #0369a1;
  transition: background-color 0.2s ease, color 0.2s ease;
}

body.theme-dark {
  --bg-main: #060a12;
  --bg-workspace: #080d19;
  --bg-glass: rgba(10, 17, 30, 0.85);
  --bg-glass-solid: #0a111e;
  --bg-card: rgba(15, 25, 45, 0.7);
  --border-glass: rgba(56, 189, 248, 0.16);
  --border-glass-light: rgba(255, 255, 255, 0.1);
  --border-cyan: rgba(6, 182, 212, 0.4);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-cyan-bright: #00f3ff;
  --accent-cyan: #06b6d4;
  --accent-cyan-light: #38bdf8;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Basemap Subdued Darkening for Dark Command Center Mode */
body.theme-dark .leaflet-tile-container img {
  filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
  transition: filter 0.2s ease;
}

body.theme-bright .leaflet-tile-container img {
  filter: none;
  transition: filter 0.2s ease;
}

/* Dual Theme Toggle Controls */
.theme-switcher-toggle {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass-light);
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
}

body.theme-bright .theme-switcher-toggle {
  background: rgba(226, 232, 240, 0.9);
  border-color: #cbd5e1;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  color: var(--text-main);
}

.theme-toggle-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

body.theme-bright .theme-toggle-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

/* ==========================================================================
   Awesome Aquatic Bluish Bright Mode Styling (Cool Marine Glassmorphism)
   ========================================================================== */

/* 1. Top Command Navigation Bar */
body.theme-bright .command-nav {
  background: rgba(220, 238, 254, 0.78);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1.5px solid rgba(147, 197, 253, 0.75);
  box-shadow: 0 8px 30px rgba(10, 60, 110, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

body.theme-bright .app-name {
  color: #07223d;
}

body.theme-bright .brand-icon {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.4);
  border-color: rgba(2, 132, 199, 0.35);
}

body.theme-bright .sih-badge {
  background: rgba(212, 234, 252, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #0284c7;
  border-color: rgba(147, 197, 253, 0.8);
}

body.theme-bright .nav-modules {
  background: rgba(198, 226, 252, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(147, 197, 253, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.theme-bright .nav-module-btn {
  color: #0c3866;
  font-weight: 700;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body.theme-bright .nav-module-btn:hover {
  color: #034575;
  background: rgba(202, 228, 252, 0.85);
  border-color: rgba(147, 197, 253, 0.7);
  transform: translateY(-1px);
}

body.theme-bright #nav-btn-scada:hover {
  color: #0284c7;
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.45);
}

body.theme-bright #nav-btn-alerts:hover {
  color: #059669;
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.45);
}

body.theme-bright #nav-btn-analytics:hover {
  color: #7e22ce;
  background: rgba(168, 85, 247, 0.14);
  border-color: rgba(168, 85, 247, 0.45);
}

body.theme-bright #nav-btn-rainfall:hover {
  color: #0284c7;
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(14, 165, 233, 0.45);
}

/* Base Active Nav Button (Internal UI HUD Glassmorphism) */
body.theme-bright .nav-module-btn.active {
  background: linear-gradient(135deg, rgba(8, 28, 58, 0.94) 0%, rgba(14, 38, 76, 0.90) 100%);
  backdrop-filter: blur(14px) saturate(190%);
  -webkit-backdrop-filter: blur(14px) saturate(190%);
  color: #ffffff;
  border: 1.5px solid rgba(56, 189, 248, 0.65);
  box-shadow: 0 4px 14px rgba(6, 22, 48, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  font-weight: 800;
}

/* 1. GIS Map Tab Active */
body.theme-bright #nav-btn-gis.active {
  background: linear-gradient(135deg, rgba(10, 37, 68, 0.94) 0%, rgba(18, 56, 102, 0.90) 100%);
  backdrop-filter: blur(14px) saturate(190%);
  -webkit-backdrop-filter: blur(14px) saturate(190%);
  border: 1.5px solid rgba(56, 189, 248, 0.65);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(10, 37, 68, 0.32), 0 0 10px rgba(56, 189, 248, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
body.theme-bright #nav-btn-gis.active svg {
  stroke: #38bdf8;
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.7));
}

/* 2. Drainage & SCADA Tab Active (Matches Dark Bluish SCADA Telemetry Portion) */
body.theme-bright #nav-btn-scada.active {
  background: linear-gradient(135deg, rgba(8, 28, 58, 0.94) 0%, rgba(14, 38, 76, 0.90) 100%);
  backdrop-filter: blur(14px) saturate(190%);
  -webkit-backdrop-filter: blur(14px) saturate(190%);
  border: 1.5px solid rgba(56, 189, 248, 0.7);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(6, 22, 48, 0.35), 0 0 12px rgba(56, 189, 248, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
body.theme-bright #nav-btn-scada.active svg {
  stroke: #38bdf8;
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.75));
}

/* 3. Alerts & Triage Tab Active (Matches Alerts Internal UI) */
body.theme-bright #nav-btn-alerts.active {
  background: linear-gradient(135deg, rgba(10, 32, 54, 0.94) 0%, rgba(12, 44, 72, 0.90) 100%);
  backdrop-filter: blur(14px) saturate(190%);
  -webkit-backdrop-filter: blur(14px) saturate(190%);
  border: 1.5px solid rgba(16, 185, 129, 0.75);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(6, 22, 48, 0.35), 0 0 12px rgba(16, 185, 129, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
body.theme-bright #nav-btn-alerts.active svg {
  stroke: #34d399;
  filter: drop-shadow(0 0 4px rgba(52, 211, 153, 0.75));
}

/* 4. Hydro Analytics Tab Active (Matches Purplish Exposure & Analytics Portion) */
body.theme-bright #nav-btn-analytics.active {
  background: linear-gradient(135deg, rgba(38, 14, 66, 0.94) 0%, rgba(58, 24, 98, 0.90) 100%);
  backdrop-filter: blur(14px) saturate(190%);
  -webkit-backdrop-filter: blur(14px) saturate(190%);
  border: 1.5px solid rgba(168, 85, 247, 0.75);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(58, 24, 98, 0.35), 0 0 12px rgba(168, 85, 247, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
body.theme-bright #nav-btn-analytics.active svg {
  stroke: #c084fc;
  filter: drop-shadow(0 0 4px rgba(192, 132, 252, 0.8));
}

/* 5. Rainfall Dynamics Tab Active (Bright Mode) */
body.theme-bright #nav-btn-rainfall.active {
  background: linear-gradient(135deg, rgba(8, 38, 72, 0.94) 0%, rgba(12, 58, 108, 0.90) 100%);
  backdrop-filter: blur(14px) saturate(190%);
  -webkit-backdrop-filter: blur(14px) saturate(190%);
  border: 1.5px solid rgba(14, 165, 233, 0.75);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(8, 38, 72, 0.35), 0 0 12px rgba(14, 165, 233, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
body.theme-bright #nav-btn-rainfall.active svg {
  stroke: #38bdf8;
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.8));
}

body.theme-bright .telemetry-item {
  background: rgba(212, 234, 252, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(147, 197, 253, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.theme-bright .t-label {
  color: #326491;
  font-weight: 700;
}

body.theme-bright .t-val {
  color: #07223d;
  font-weight: 800;
}

body.theme-bright .telemetry-status {
  background: rgba(209, 250, 229, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-color: #6ee7b7;
  color: #065f46;
  font-weight: 700;
}

body.theme-bright .telemetry-status.live {
  color: #047857;
}

/* 2. Map Floating Panels with Glassmorphism */
body.theme-bright .glass-panel {
  background: rgba(220, 238, 254, 0.8);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1.5px solid rgba(147, 197, 253, 0.75);
  box-shadow: 0 12px 36px rgba(10, 60, 110, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

/* Active Layers Floating Panel */
body.theme-bright .active-layers-panel {
  background: rgba(220, 238, 254, 0.8);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1.5px solid rgba(147, 197, 253, 0.75);
  box-shadow: 0 12px 36px rgba(10, 60, 110, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

body.theme-bright .panel-tag {
  color: #0284c7;
  border-bottom-color: rgba(191, 219, 254, 0.8);
}

body.theme-bright .group-title {
  color: #326491;
  font-weight: 800;
}

body.theme-bright .layer-name {
  color: #07223d;
  font-weight: 600;
}

body.theme-bright .custom-checkbox {
  color: #07223d;
}

body.theme-bright .checkmark {
  background: rgba(212, 234, 252, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1.5px solid rgba(147, 197, 253, 0.8);
}

body.theme-bright .custom-checkbox input:checked + .checkmark {
  background: #0284c7;
  border-color: #0284c7;
  box-shadow: 0 0 8px rgba(2, 132, 199, 0.5);
}

body.theme-bright .custom-checkbox input:checked + .checkmark::after {
  color: #ffffff;
}

/* Map Legend Floating Panel */
body.theme-bright .map-legend-panel {
  background: rgba(220, 238, 254, 0.8);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1.5px solid rgba(147, 197, 253, 0.75);
  box-shadow: 0 12px 36px rgba(10, 60, 110, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

body.theme-bright .legend-header {
  color: #07223d;
  font-weight: 800;
}

body.theme-bright .quick-filter-btn {
  background: rgba(212, 234, 252, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(147, 197, 253, 0.75);
  color: #072e54;
  font-weight: 700;
}

body.theme-bright .quick-filter-btn:hover {
  background: rgba(194, 226, 250, 0.85);
  color: #034575;
}

body.theme-bright .quick-filter-btn.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

body.theme-bright .legend-label {
  color: #07223d;
  font-weight: 700;
}

body.theme-bright .legend-sub {
  color: #326491;
}

body.theme-bright .legend-context-section,
body.theme-bright .legend-footer {
  border-top-color: rgba(191, 219, 254, 0.8);
  color: #326491;
}

body.theme-bright .legend-drain-title { color: #0284c7; font-weight: 700; }
body.theme-bright .legend-drain-swatch { background: #0284c7; box-shadow: 0 0 6px rgba(2, 132, 199, 0.4); }
body.theme-bright .legend-drain-label { color: #07223d; font-weight: 700; }
body.theme-bright .legend-p-title { color: #7e22ce; font-weight: 700; }
body.theme-bright .legend-p1-label { color: #6b21a8; font-weight: 800; }
body.theme-bright .legend-p2-label { color: #7e22ce; font-weight: 800; }
body.theme-bright .legend-p3-label { color: #4338ca; font-weight: 800; }

/* Point GIS Inspection Card */
body.theme-bright .inspector-overlay-card {
  background: rgba(220, 238, 254, 0.84);
  backdrop-filter: blur(22px) saturate(190%);
  -webkit-backdrop-filter: blur(22px) saturate(190%);
  border: 1.5px solid rgba(56, 189, 248, 0.85);
  box-shadow: 0 14px 40px rgba(10, 60, 110, 0.18), 0 0 24px rgba(56, 189, 248, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.theme-bright .card-title-bar {
  color: #0284c7;
  border-bottom-color: rgba(191, 219, 254, 0.8);
}

body.theme-bright .close-card-btn {
  color: #326491;
}

body.theme-bright .close-card-btn:hover {
  color: #07223d;
}

body.theme-bright .insp-lbl {
  color: #143d63;
  font-weight: 700;
}

body.theme-bright .insp-val {
  color: #07223d;
  font-weight: 800;
}

body.theme-bright .insp-val.highlight {
  color: #0284c7;
  font-weight: 800;
}

body.theme-bright .insp-basis-tag {
  color: #326491;
  border-top: 1px dashed rgba(191, 219, 254, 0.8);
}

body.theme-bright .insp-basis-tag strong {
  color: #0284c7;
}

/* Bottom Nowcast Timeline Bar */
body.theme-bright .timeline-bar-container {
  background: rgba(218, 236, 254, 0.82);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1.5px solid rgba(147, 197, 253, 0.75);
  box-shadow: 0 10px 30px rgba(9, 35, 62, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

body.theme-bright .timeline-play-btn {
  background: #0284c7;
  color: #ffffff;
}

body.theme-bright .timeline-play-btn:hover {
  background: #0369a1;
}

body.theme-bright .timeline-label {
  color: #07223d;
  font-weight: 800;
}

body.theme-bright .time-step-btn {
  background: rgba(212, 234, 252, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(147, 197, 253, 0.75);
  color: #072e54;
  font-weight: 700;
}

body.theme-bright .time-step-btn:hover {
  background: rgba(194, 226, 250, 0.85);
  border-color: #60a5fa;
  color: #034575;
}

body.theme-bright .time-step-btn.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.45);
}

body.theme-bright .step-dot {
  background: #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.8);
}

/* 3. Right Situation Command Sidebar & Tabs */
body.theme-bright .sidebar-tabs-header {
  background: rgba(204, 229, 253, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(147, 197, 253, 0.75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.theme-bright .side-tab-btn {
  color: #0c3866;
  font-weight: 700;
}

body.theme-bright .side-tab-btn:hover {
  color: #034575;
}

body.theme-bright .side-tab-btn.active {
  background: rgba(216, 236, 253, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #0284c7;
  border: 1.5px solid #60a5fa;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-weight: 800;
}

body.theme-bright .side-tab-btn[data-tab="tab-routing"].active {
  background: rgba(243, 232, 255, 0.92);
  color: #7e22ce;
  border-color: #c084fc;
  box-shadow: 0 2px 8px rgba(126, 34, 206, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
body.theme-bright .side-tab-btn[data-tab="tab-routing"].active svg {
  stroke: #9333ea;
}

body.theme-bright .side-tab-btn[data-tab="tab-alerts"].active {
  background: rgba(236, 253, 245, 0.92);
  color: #047857;
  border-color: #34d399;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
body.theme-bright .side-tab-btn[data-tab="tab-alerts"].active svg {
  stroke: #10b981;
}

body.theme-bright .side-tab-btn[data-tab="tab-rainfall"].active {
  background: rgba(224, 242, 254, 0.92);
  color: #0284c7;
  border-color: #38bdf8;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
body.theme-bright .side-tab-btn[data-tab="tab-rainfall"].active svg {
  stroke: #0284c7;
}

body.theme-bright .sidebar-tab-content {
  background: rgba(222, 239, 254, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1.5px solid rgba(147, 197, 253, 0.75);
  box-shadow: 0 16px 40px rgba(9, 35, 62, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.theme-bright .section-title-box h3 {
  color: #07223d;
  font-weight: 800;
}

body.theme-bright .sub-title-text {
  color: #326491;
}

/* SCADA Operational Header & Metrics (First Image Portion: Dark Bluish Theme) */
body.theme-bright .scada-header-card {
  background: linear-gradient(135deg, rgba(8, 28, 58, 0.90) 0%, rgba(14, 38, 76, 0.86) 100%);
  backdrop-filter: blur(18px) saturate(190%);
  -webkit-backdrop-filter: blur(18px) saturate(190%);
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(6, 22, 48, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

body.theme-bright .scada-title-row strong {
  color: #38bdf8;
}

body.theme-bright .scada-title {
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

body.theme-bright .scada-timestep-pill {
  background: rgba(30, 64, 175, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(96, 165, 250, 0.6);
  color: #bfdbfe;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(10, 35, 75, 0.25);
}

body.theme-bright .scada-subtext {
  color: #93c5fd;
  font-weight: 600;
  letter-spacing: 0.05em;
}

body.theme-bright .scada-metrics-grid .scada-metric-card,
body.theme-bright .scada-metric-card {
  background: linear-gradient(135deg, rgba(10, 30, 62, 0.88) 0%, rgba(16, 44, 86, 0.84) 100%);
  backdrop-filter: blur(16px) saturate(190%);
  -webkit-backdrop-filter: blur(16px) saturate(190%);
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 4px 16px rgba(6, 22, 48, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

body.theme-bright .scada-metric-card:hover {
  border-color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(6, 22, 48, 0.32), 0 0 12px rgba(56, 189, 248, 0.3);
}

body.theme-bright .scada-metric-card .m-label {
  color: #93c5fd;
  font-weight: 700;
  letter-spacing: 0.05em;
}

body.theme-bright .scada-metric-card .m-sub {
  color: #7dd3fc;
  font-weight: 600;
}

body.theme-bright .scada-metric-card .m-value {
  color: #ffffff;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

/* Active Situation Alerts Banner & Box (Enhanced Vivid Glassmorphism) */
body.theme-bright .scada-alerts-summary-box {
  background: rgba(215, 238, 250, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid #38bdf8;
  border-radius: 6px;
  padding: 8px 10px;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.theme-bright .scada-alerts-summary-box .box-header {
  color: #035388;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body.theme-bright #scada-alerts-badge,
body.theme-bright .scada-alerts-summary-box .ver-tag {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.64rem;
  padding: 2px 8px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
  letter-spacing: 0.08em;
  border: 1px solid rgba(255, 255, 255, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.theme-bright .scada-alerts-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

body.theme-bright .alert-item-mini {
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 4px rgba(9, 35, 62, 0.06);
}

body.theme-bright .alert-item-mini.ok {
  background: rgba(236, 253, 245, 0.9);
  border: 1.5px solid #6ee7b7;
  color: #047857;
}

body.theme-bright .alert-item-mini.warn {
  background: rgba(255, 251, 235, 0.9);
  border: 1.5px solid #fcd34d;
  color: #b45309;
}

body.theme-bright .alert-item-mini.crit {
  background: rgba(254, 242, 242, 0.9);
  border: 1.5px solid #fca5a5;
  color: #b91c1c;
}

/* Population Response Priority Box (Second Image Portion: Vivid Purplish Glassmorphism) */
body.theme-bright .scada-response-priority-box {
  background: linear-gradient(135deg, rgba(246, 240, 255, 0.88) 0%, rgba(238, 228, 254, 0.82) 100%);
  backdrop-filter: blur(14px) saturate(190%);
  -webkit-backdrop-filter: blur(14px) saturate(190%);
  border: 1.5px solid rgba(168, 85, 247, 0.55);
  box-shadow: 0 4px 18px rgba(126, 34, 206, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.theme-bright .scada-response-priority-box .box-header span:first-child {
  color: #581c87;
  font-weight: 800;
  letter-spacing: 0.05em;
}

body.theme-bright .scada-response-priority-box .ver-tag {
  background: linear-gradient(135deg, #7e22ce 0%, #a855f7 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.35);
}

body.theme-bright .p-count-pill.p1 {
  background: linear-gradient(135deg, rgba(126, 34, 206, 0.16) 0%, rgba(168, 85, 247, 0.22) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid #a855f7;
  color: #6b21a8;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(126, 34, 206, 0.15);
}
body.theme-bright .p-count-pill.p1 strong {
  color: #4c1d95;
  font-weight: 900;
}

body.theme-bright .p-count-pill.p2 {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.13) 0%, rgba(192, 132, 252, 0.18) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid #c084fc;
  color: #7e22ce;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(147, 51, 234, 0.12);
}
body.theme-bright .p-count-pill.p2 strong {
  color: #581c87;
  font-weight: 900;
}

body.theme-bright .p-count-pill.p3 {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(165, 180, 252, 0.18) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid #818cf8;
  color: #4338ca;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}
body.theme-bright .p-count-pill.p3 strong {
  color: #312e81;
  font-weight: 900;
}

/* Top Priority Corridor Card */
body.theme-bright .top-priority-card {
  background: linear-gradient(135deg, rgba(246, 240, 255, 0.92) 0%, rgba(238, 228, 254, 0.88) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(168, 85, 247, 0.65);
  box-shadow: 0 4px 16px rgba(126, 34, 206, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.theme-bright .top-p-header .lbl {
  color: #7e22ce;
  font-weight: 800;
}

body.theme-bright .top-p-title {
  color: #3b0764;
  font-weight: 800;
}

body.theme-bright .top-p-details {
  color: #6b21a8;
}

body.theme-bright .top-p-row strong {
  color: #3b0764;
}

body.theme-bright .btn-focus-top-p {
  background: linear-gradient(135deg, #7e22ce 0%, #a855f7 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 10px rgba(126, 34, 206, 0.4);
}

body.theme-bright .btn-focus-top-p:hover {
  background: linear-gradient(135deg, #6b21a8 0%, #9333ea 100%);
  box-shadow: 0 4px 16px rgba(126, 34, 206, 0.6);
}

/* Scenario Presets */
body.theme-bright .box-label {
  color: #0c3866;
  font-weight: 800;
}

body.theme-bright .preset-btn-4 {
  background: rgba(212, 234, 252, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(147, 197, 253, 0.75);
  color: #072e54;
  font-weight: 700;
}

body.theme-bright .preset-btn-4:hover {
  background: rgba(194, 226, 250, 0.85);
  border-color: #60a5fa;
  color: #034575;
}

body.theme-bright .preset-btn-4.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.4);
}

/* Inputs, Accordion & Sliders */
body.theme-bright .sim-inputs-details {
  background: rgba(212, 234, 252, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(147, 197, 253, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

body.theme-bright .sim-inputs-summary {
  color: #0284c7;
  font-weight: 800;
}

body.theme-bright .sim-summary-hint {
  color: #326491;
}

body.theme-bright .group-header {
  color: #0284c7;
  border-bottom-color: rgba(191, 219, 254, 0.8);
  font-weight: 800;
}

body.theme-bright .field-item label {
  color: #143d63;
  font-weight: 700;
}

body.theme-bright input[type="text"],
body.theme-bright input[type="number"],
body.theme-bright select {
  background: rgba(220, 237, 253, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(147, 197, 253, 0.8);
  color: #07223d;
  font-weight: 600;
}

body.theme-bright input[type="text"]:focus,
body.theme-bright input[type="number"]:focus,
body.theme-bright select:focus {
  background: rgba(210, 232, 252, 0.9);
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
  outline: none;
}

body.theme-bright input[type="range"] {
  background: rgba(186, 222, 252, 0.85);
}

body.theme-bright .pick-map-btn {
  background: rgba(212, 234, 252, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(147, 197, 253, 0.75);
  color: #072e54;
  font-weight: 700;
}

body.theme-bright .pick-map-btn:hover {
  background: rgba(194, 226, 250, 0.85);
  border-color: #60a5fa;
  color: #034575;
}

body.theme-bright .cmd-secondary-btn {
  background: rgba(212, 234, 252, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(147, 197, 253, 0.75);
  color: #072e54;
  font-weight: 700;
}

body.theme-bright .cmd-secondary-btn:hover {
  background: rgba(194, 226, 250, 0.85);
  border-color: #60a5fa;
  color: #034575;
}

/* Current Simulated Scenario Card */
body.theme-bright .scenario-summary-card {
  background: rgba(212, 234, 252, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(125, 211, 252, 0.8);
  box-shadow: 0 2px 8px rgba(10, 60, 110, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

body.theme-bright .sim-card-header {
  color: #0369a1;
  font-weight: 800;
}

body.theme-bright .sim-metrics-row {
  color: #07223d;
}

body.theme-bright .sim-metrics-row span b {
  color: #326491;
}

body.theme-bright .sim-card-note {
  color: #326491;
  border-top-color: rgba(147, 197, 253, 0.75);
}

/* Outcome Panels & Logs */
body.theme-bright .outcome-card {
  background: rgba(220, 240, 254, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(147, 197, 253, 0.75);
  box-shadow: 0 3px 12px rgba(10, 60, 110, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

body.theme-bright .header-lbl {
  color: #143d63;
  font-weight: 800;
}

body.theme-bright .p-name {
  color: #326491;
}

body.theme-bright .p-track {
  background: rgba(186, 222, 252, 0.8);
}

body.theme-bright .p-num {
  color: #07223d;
}

body.theme-bright .score-pill {
  background: rgba(212, 234, 252, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #07223d;
  border: 1px solid rgba(147, 197, 253, 0.75);
  font-weight: 700;
}

body.theme-bright .act-desc {
  color: #143d63;
}

body.theme-bright .log-item-row {
  background: rgba(212, 234, 252, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(168, 212, 250, 0.75);
}

body.theme-bright .log-item-name {
  color: #07223d;
  font-weight: 700;
}

body.theme-bright .m-box {
  background: rgba(208, 231, 252, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(147, 197, 253, 0.7);
}

body.theme-bright .m-lbl {
  color: #326491;
  font-weight: 700;
}

body.theme-bright .m-val {
  color: #0284c7;
  font-weight: 800;
}

body.theme-bright .spatial-basis-footer {
  color: #326491;
  border-top-color: rgba(191, 219, 254, 0.8);
}

/* Alerts & Incidents Tab */
body.theme-bright .alerts-meta-bar {
  background: rgba(212, 234, 252, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-color: rgba(147, 197, 253, 0.75);
}

body.theme-bright .basis-pill {
  color: #326491;
}

body.theme-bright .alert-card {
  background: rgba(220, 240, 254, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(147, 197, 253, 0.75);
  box-shadow: 0 3px 12px rgba(10, 60, 110, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.theme-bright .alert-card-title {
  color: #07223d;
  font-weight: 800;
}

body.theme-bright .alert-card-loc {
  color: #326491;
}

body.theme-bright .alert-detail-row {
  color: #143d63;
}

body.theme-bright .alert-detail-row strong {
  color: #07223d;
}

body.theme-bright .inc-id {
  color: #07223d;
  font-weight: 800;
}

body.theme-bright .inc-row {
  color: #143d63;
}

body.theme-bright .inc-row span {
  color: #326491;
}

body.theme-bright .inc-row strong {
  color: #07223d;
}

body.theme-bright .inc-action-box {
  background: rgba(212, 234, 252, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(147, 197, 253, 0.75);
  color: #07223d;
}

body.theme-bright .locate-inc-btn {
  border-color: #0284c7;
  color: #0284c7;
  font-weight: 700;
}

body.theme-bright .locate-inc-btn:hover {
  background: #0284c7;
  color: #ffffff;
}

body.theme-bright .alert-empty-msg {
  background: rgba(212, 234, 252, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(147, 197, 253, 0.75);
  color: #326491;
}

/* 4. Command Center Footer */
body.theme-bright .command-footer {
  background: rgba(216, 235, 253, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1.5px solid rgba(147, 197, 253, 0.75);
  color: #143d63;
  box-shadow: 0 -2px 14px rgba(9, 35, 62, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

body.theme-bright .footer-modules span {
  color: #143d63;
}

body.theme-bright .footer-modules strong {
  color: #07223d;
}

body.theme-bright .footer-disclaimer-text {
  color: #326491;
}

/* 5. Leaflet Popups in Bright Mode */
body.theme-bright .dark-leaflet-popup .leaflet-popup-content-wrapper {
  background: rgba(226, 242, 255, 0.85) !important;
  backdrop-filter: blur(16px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(190%) !important;
  color: #07223d !important;
  border: 1.5px solid rgba(56, 189, 248, 0.85) !important;
  box-shadow: 0 12px 36px rgba(9, 35, 62, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

body.theme-bright .dark-leaflet-popup .leaflet-popup-tip {
  background: rgba(208, 231, 252, 0.9) !important;
  border-color: #38bdf8 !important;
}

body.theme-bright .dark-leaflet-popup .wl-popup-title,
body.theme-bright .dark-leaflet-popup .infra-popup-title,
body.theme-bright .dark-leaflet-popup .drain-popup-title {
  color: #0284c7 !important;
  border-bottom: 1px solid rgba(191, 219, 254, 0.8) !important;
}

body.theme-bright .dark-leaflet-popup .wl-popup-row span,
body.theme-bright .dark-leaflet-popup .infra-popup-row,
body.theme-bright .dark-leaflet-popup .drain-popup-row {
  color: #143d63 !important;
}

body.theme-bright .dark-leaflet-popup .wl-popup-row strong,
body.theme-bright .dark-leaflet-popup .infra-popup-row strong,
body.theme-bright .dark-leaflet-popup .drain-popup-row strong {
  color: #07223d !important;
}

body.theme-bright .dark-leaflet-popup .wl-popup-footer {
  color: #326491 !important;
  border-top: 1px solid rgba(191, 219, 254, 0.8) !important;
}

/* Leaflet Zoom Controls */
body.theme-bright .leaflet-control-zoom a {
  background: rgba(212, 234, 252, 0.8) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  color: #07223d !important;
  border-color: rgba(147, 197, 253, 0.8) !important;
  box-shadow: 0 2px 6px rgba(9, 35, 62, 0.12) !important;
}

body.theme-bright .leaflet-control-zoom a:hover {
  background: rgba(194, 226, 250, 0.9) !important;
  color: #0284c7 !important;
}

body.theme-bright .leaflet-control-attribution {
  background: rgba(222, 239, 254, 0.85) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  color: #326491 !important;
}

/* 6. SCADA Operational Modal */
body.theme-bright .scada-modal {
  background: rgba(9, 35, 62, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.theme-bright .modal-content,
body.theme-bright .pump-modal-card {
  background: linear-gradient(145deg, rgba(8, 26, 56, 0.97) 0%, rgba(14, 38, 78, 0.95) 100%);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1.5px solid rgba(56, 189, 248, 0.65);
  box-shadow: 0 24px 64px rgba(6, 22, 48, 0.55), 0 0 28px rgba(56, 189, 248, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

body.theme-bright .modal-header,
body.theme-bright .pump-modal-header {
  border-bottom: 1.5px solid rgba(56, 189, 248, 0.25);
  background: rgba(6, 20, 44, 0.7);
}

body.theme-bright .modal-header h3,
body.theme-bright .pump-modal-title {
  color: #ffffff;
}

body.theme-bright .layer-item-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body.theme-bright .layer-registry-btn {
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid rgba(2, 132, 199, 0.45);
  color: #0284c7;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.15s ease;
}

body.theme-bright .layer-registry-btn:hover {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(2, 132, 199, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
}
::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.25);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

body, html {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.55), inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
}

#app-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
}

/* --------------------------------------------------------------------------
   1. TOP COMMAND NAVIGATION BAR
   -------------------------------------------------------------------------- */
.command-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  margin: 8px 8px 0 8px;
  z-index: 2000;
  border-radius: var(--radius-md);
  border-color: rgba(56, 189, 248, 0.2);
  background: linear-gradient(180deg, rgba(14, 23, 42, 0.9) 0%, rgba(10, 17, 30, 0.85) 100%);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  color: white;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.app-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sih-badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid var(--border-cyan);
  color: var(--accent-cyan-bright);
  letter-spacing: 0.05em;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.2);
}

.gis-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--severity-low);
  box-shadow: 0 0 8px var(--severity-low);
}

.live-dot.pulse {
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.nav-modules {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(4, 8, 16, 0.5);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass-light);
}

.nav-module-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.2s ease,
              transform 0.15s ease;
}

.nav-module-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.nav-module-btn:active {
  transform: scale(0.97);
}

.nav-module-btn.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.35) 0%, rgba(3, 105, 161, 0.45) 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), 0 0 12px rgba(56, 189, 248, 0.35);
  border: 1.5px solid rgba(56, 189, 248, 0.55);
}

#nav-btn-scada.active {
  background: linear-gradient(135deg, rgba(8, 28, 58, 0.8) 0%, rgba(14, 48, 90, 0.8) 100%);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), 0 0 12px rgba(56, 189, 248, 0.35);
}

#nav-btn-alerts.active {
  background: linear-gradient(135deg, rgba(6, 44, 34, 0.8) 0%, rgba(10, 60, 48, 0.8) 100%);
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), 0 0 12px rgba(16, 185, 129, 0.35);
}

#nav-btn-analytics.active {
  background: linear-gradient(135deg, rgba(38, 14, 66, 0.8) 0%, rgba(58, 24, 98, 0.8) 100%);
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), 0 0 12px rgba(168, 85, 247, 0.35);
}

#nav-btn-rainfall.active {
  background: linear-gradient(135deg, rgba(3, 105, 161, 0.8) 0%, rgba(2, 132, 199, 0.8) 100%);
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), 0 0 14px rgba(56, 189, 248, 0.45);
}
#nav-btn-rainfall.active svg {
  stroke: #38bdf8;
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.85));
}

.nav-module-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.nav-status-telemetry {
  display: flex;
  align-items: center;
  gap: 8px;
}

.telemetry-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.telemetry-pill.online {
  background: var(--severity-low-bg);
  color: var(--severity-low);
  border: 1px solid var(--severity-low-border);
}
.telemetry-pill.online .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--severity-low);
  box-shadow: 0 0 8px var(--severity-low);
  animation: pulse-glow 2s infinite;
}

.telemetry-pill.offline {
  background: var(--severity-critical-bg);
  color: var(--severity-critical);
  border: 1px solid var(--severity-critical-border);
}
.telemetry-pill.offline .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--severity-critical);
  box-shadow: 0 0 8px var(--severity-critical);
}

.telemetry-pill.connecting {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.telemetry-pill.connecting .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: pulse-glow 1s infinite;
}

.telemetry-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 4px 9px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.t-label { color: var(--text-dim); }
.t-val { color: var(--text-main); font-weight: 600; }

/* --------------------------------------------------------------------------
   2. MAIN WORKSPACE GRID & HERO MAP
   -------------------------------------------------------------------------- */
.workspace-grid {
  display: flex;
  flex: 1;
  position: relative;
  overflow: hidden;
  padding: 8px;
  gap: 8px;
}

#map-workspace {
  flex: 1;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.22);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
}

#map {
  width: 100%;
  height: 100%;
  background: var(--bg-workspace);
  transform: translateZ(0);
  will-change: transform;
}

.leaflet-container {
  font-family: inherit;
}

canvas.leaflet-zoom-animated {
  transform: translateZ(0);
  will-change: transform;
}

/* Dark Styling for Leaflet Map Zoom Controls */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5) !important;
}

.leaflet-control-zoom a {
  background: rgba(10, 17, 30, 0.9) !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease !important;
}

.leaflet-control-zoom a:hover {
  background: rgba(6, 182, 212, 0.3) !important;
  color: #00f3ff !important;
  border-color: rgba(6, 182, 212, 0.5) !important;
}

/* Floating Active Layers Panel */
.active-layers-panel {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1000;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 230px;
  background: rgba(8, 14, 26, 0.9);
}

.panel-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-cyan-bright);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  padding-bottom: 6px;
}

.layer-group-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.group-title {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 2px;
}

.layer-item { display: flex; align-items: center; }

.layer-item.layer-item-flex,
.layer-item-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.layer-registry-btn {
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #60a5fa;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.2;
  transition: all 0.15s ease;
}

.layer-registry-btn:hover {
  background: rgba(59, 130, 246, 0.45);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.layer-registry-btn:focus {
  outline: none;
}

.layer-registry-btn:active {
  transform: scale(0.95);
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}
.custom-checkbox input { display: none; }

.checkmark {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--border-glass-light);
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.custom-checkbox input:checked + .checkmark {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan-light);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

.custom-checkbox input:checked + .checkmark::after {
  content: '✓';
  font-size: 10px;
  color: #000;
  font-weight: 900;
}

.layer-name {
  font-weight: 500;
  color: var(--text-main);
}

/* Map Legend */
.map-legend-panel {
  position: absolute;
  bottom: 60px;
  left: 14px;
  z-index: 1000;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 250px;
  background: rgba(8, 14, 26, 0.9);
}

.legend-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.legend-header {
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.legend-quick-filters {
  display: flex;
  gap: 3px;
}

.quick-filter-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass-light);
  color: var(--text-dim);
  font-size: 0.58rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-filter-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.quick-filter-btn.active {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.5);
  color: #60a5fa;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.3);
}

.legend-items { display: flex; flex-direction: column; gap: 5px; }

.legend-row { display: flex; align-items: center; gap: 8px; font-size: 0.72rem; }
.legend-row.normal-row { padding-left: 20px; }

.legend-toggle-row {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s ease;
}

.legend-toggle-row:hover {
  opacity: 0.9;
}

.legend-checkbox {
  accent-color: #3b82f6;
  width: 13px;
  height: 13px;
  cursor: pointer;
  flex-shrink: 0;
}

.legend-color { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }
.legend-color.normal-road-swatch {
  background: transparent;
  border: 1.5px dashed #64748b;
}

.legend-text-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.legend-label {
  font-weight: 700;
  font-size: 0.70rem;
  color: var(--text-main);
  letter-spacing: 0.04em;
}

.legend-sub {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.legend-context-section {
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 6px;
  margin-top: 4px;
}

.legend-footer {
  font-size: 0.62rem;
  color: var(--text-dim);
  border-top: 1px dashed var(--border-glass-light);
  padding-top: 4px;
  margin-top: 2px;
}

.legend-drain-title { color: #00f3ff; }
.legend-drain-swatch { background: #00f3ff; box-shadow: 0 0 6px #00f3ff; }
.legend-drain-label { color: #00f3ff; }
.legend-p-title { color: #c084fc; }
.legend-p1-label { color: #c084fc; }
.legend-p2-label { color: #e9d5ff; }
.legend-p3-label { color: #a5b4fc; }

/* Map Inspector Overlay Card */
.inspector-overlay-card {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1000;
  width: 320px;
  min-width: 320px;
  max-width: 320px;
  box-sizing: border-box;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(8, 14, 26, 0.94);
  border: 1.5px solid rgba(6, 182, 212, 0.45);
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(6, 182, 212, 0.25);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.22s ease,
              box-shadow 0.22s ease,
              border-color 0.22s ease;
}

.inspector-overlay-card.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.card-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--accent-cyan-bright);
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  padding-bottom: 5px;
}

.close-card-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.close-card-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.inspector-body { display: flex; flex-direction: column; gap: 6px; }

.insp-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 0.73rem;
  min-height: 1.35rem;
}

.insp-lbl {
  color: var(--text-dim);
  flex-shrink: 0;
}

.insp-val {
  color: var(--text-main);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
  max-width: 65%;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.18s ease;
}

.inspector-overlay-card.is-updating .insp-val {
  opacity: 0.45;
  filter: blur(0.35px);
}

.insp-val.highlight { color: var(--accent-cyan-bright); font-family: var(--font-mono); }

.insp-basis-tag {
  font-size: 0.66rem;
  color: var(--text-dim);
  border-top: 1px dashed var(--border-glass-light);
  padding-top: 5px;
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* Map Reticle Pulse Marker */
.inspection-pulse-pin {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.reticle-core {
  width: 9px;
  height: 9px;
  background: #00f3ff;
  border: 1.5px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 10px #00f3ff, 0 0 20px #00f3ff;
  z-index: 2;
}

.reticle-ring {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 1.5px solid #00f3ff;
  border-radius: 50%;
  animation: inspectionPulseRing 1.8s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
  pointer-events: none;
}

@keyframes inspectionPulseRing {
  0% {
    transform: scale(0.35);
    opacity: 1;
  }
  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

/* Bottom Nowcast Timeline Bar */
.timeline-bar-container {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px;
  border-radius: 30px;
  background: rgba(8, 14, 26, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 15px rgba(6, 182, 212, 0.15);
}

.timeline-play-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.45);
  transition: all 0.2s ease;
}

.timeline-play-btn:hover {
  background: linear-gradient(135deg, #0369a1, #38bdf8);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.65);
}

.timeline-play-btn.playing {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  border-color: #fde68a;
  color: #000;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.55);
}

.timeline-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent-cyan-bright);
  letter-spacing: 0.08em;
}

.timeline-steps { display: flex; align-items: center; gap: 6px; }

.time-step-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 11px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass-light);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.2s ease;
}

.time-step-btn:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
  color: white;
}

.time-step-btn.active {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: white;
  border-color: var(--accent-cyan-bright);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.65);
}

.step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan-bright);
  box-shadow: 0 0 6px var(--accent-cyan-bright);
}

/* --------------------------------------------------------------------------
   3. RIGHT FLOOD SITUATION COMMAND SIDEBAR & SIMULATOR
   -------------------------------------------------------------------------- */
.command-sidebar {
  width: 365px;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  transition: width 0.2s ease;
}

/* SCADA Operational Header & Telemetry Grid */
.scada-header-card {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12) 0%, rgba(10, 17, 30, 0.8) 100%);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.scada-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scada-title {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.scada-timestep-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #60a5fa;
}

.scada-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scada-subtext {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.scada-status-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.scada-status-badge.normal { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.4); }
.scada-status-badge.watch { background: rgba(234, 179, 8, 0.2); color: #eab308; border: 1px solid rgba(234, 179, 8, 0.4); }
.scada-status-badge.high { background: rgba(249, 115, 22, 0.2); color: #f97316; border: 1px solid rgba(249, 115, 22, 0.4); }
.scada-status-badge.critical { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.4); }

/* SCADA Metrics Grid */
.scada-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.scada-metric-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-glass-light);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scada-metric-card .m-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.scada-metric-card .m-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-cyan-bright);
}

.scada-metric-card .m-sub {
  font-size: 0.58rem;
  color: var(--text-muted);
}

/* SCADA Mini Alerts Summary Box */
.scada-alerts-summary-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass-light);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scada-alerts-summary-box .box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.63rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.scada-alerts-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 80px;
  overflow-y: auto;
  font-size: 0.68rem;
}

.alert-item-mini {
  padding: 3px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.alert-item-mini.ok { color: var(--severity-low); }
.alert-item-mini.warn { color: var(--severity-medium); }
.alert-item-mini.crit { color: var(--severity-critical); }

/* Simulation Details Summary Accordion */
.sim-inputs-details {
  border: 1px solid var(--border-glass-light);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.25);
  margin-top: 4px;
}

.sim-inputs-summary {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-cyan);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.sim-summary-hint {
  font-size: 0.62rem;
  color: var(--text-dim);
  font-weight: 400;
}

.sidebar-tabs-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  gap: 4px;
  border-radius: var(--radius-md);
  background: rgba(6, 12, 22, 0.9);
}

.side-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s ease;
}

.side-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.side-tab-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #1d4ed8 100%);
  color: white;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.45);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.side-tab-btn[data-tab="tab-rainfall"].active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: white;
  border: 1px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}

.sidebar-tab-content {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 14px;
  overflow-y: auto;
  gap: 12px;
  border-radius: var(--radius-md);
  background: rgba(8, 14, 26, 0.9);
  scroll-behavior: smooth;
}

.sidebar-tab-content.active {
  display: flex;
  animation: tabContentSmoothIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tabContentSmoothIn {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-title-box h3 { font-size: 1rem; font-weight: 700; color: #fff; }
.sub-title-text { font-size: 0.72rem; color: var(--text-muted); }

/* 4 Preset Buttons: NORMAL, MODERATE, HEAVY, EXTREME */
.scenario-presets-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.box-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.preset-btn-group-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 4px;
}

.preset-btn-4 {
  padding: 6px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-mono);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass-light);
  color: var(--text-main);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.preset-btn-4:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
}

.preset-btn-4.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: var(--accent-cyan-bright);
  color: white;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

/* Predict Form Grid */
.predict-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}

.group-header {
  grid-column: span 2;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
  border-bottom: 1px solid var(--border-glass-light);
  padding-bottom: 2px;
}

.field-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.field-item.full-width { grid-column: span 2; }
.field-item label { font-size: 0.68rem; color: var(--text-muted); }

.field-item input, .field-item select {
  width: 100%;
  padding: 5px 8px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-glass-light);
  border-radius: var(--radius-sm);
  color: white;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  outline: none;
  transition: border-color 0.15s;
}

.field-item input:focus, .field-item select:focus {
  border-color: var(--accent-cyan-bright);
  box-shadow: 0 0 6px rgba(0, 243, 255, 0.25);
}

.form-submit-row, .route-submit-row {
  grid-column: span 2;
  margin-top: 6px;
}

.route-submit-row { display: flex; gap: 8px; }

.cmd-primary-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  transition: all 0.2s ease;
}
.cmd-primary-btn:hover {
  background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%);
  box-shadow: 0 4px 16px rgba(29, 78, 216, 0.6);
}

.cmd-secondary-btn {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass-light);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s;
}
.cmd-secondary-btn:hover { background: rgba(255, 255, 255, 0.15); }

.coord-input-group {
  grid-column: span 2;
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.coord-input-group .field-item { flex: 1; }

.pick-map-btn {
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass-light);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.7rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.pick-map-btn:hover { background: var(--accent-blue); }

/* Scenario Summary Card */
.scenario-summary-card {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sim-card-header {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-cyan-bright);
  text-transform: uppercase;
}

.sim-metrics-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-main);
  font-family: var(--font-mono);
}
.sim-metrics-row span b { color: var(--text-dim); }

.sim-card-note {
  font-size: 0.65rem;
  color: var(--text-dim);
  border-top: 1px dashed rgba(6, 182, 212, 0.25);
  padding-top: 4px;
}

/* Outcome Panels */
.results-display-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.outcome-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-glass-light);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.outcome-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.ver-tag {
  font-size: 0.62rem;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.ver-tag.ok { background: var(--severity-low-bg); color: var(--severity-low); }

.severity-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sev-badge {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sev-badge.low { background: var(--severity-low-bg); color: var(--severity-low); border: 1px solid var(--severity-low-border); }
.sev-badge.medium { background: var(--severity-medium-bg); color: var(--severity-medium); border: 1px solid var(--severity-medium-border); }
.sev-badge.high { background: var(--severity-high-bg); color: var(--severity-high); border: 1px solid var(--severity-high-border); }

.prob-distribution {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.prob-row { display: flex; align-items: center; gap: 6px; font-size: 0.68rem; }
.p-name { width: 45px; color: var(--text-dim); }

.p-track {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.p-bar { height: 100%; transition: width 0.4s ease; }
.p-bar.low { background: var(--severity-low); }
.p-bar.medium { background: var(--severity-medium); }
.p-bar.high { background: var(--severity-high); }

.p-num { width: 30px; text-align: right; font-family: var(--font-mono); color: var(--text-main); }

.score-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.act-level {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.05em;

  &.normal { color: var(--severity-low); }
  &.monitor { color: var(--accent-cyan); }
  &.high-priority { color: var(--severity-medium); }
  &.immediate-action { color: var(--severity-high); }
}

.act-desc { font-size: 0.75rem; color: var(--text-main); margin-top: 2px; }

/* Scenario Log List */
.scenario-log-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 120px;
  overflow-y: auto;
}

.log-empty-msg { font-size: 0.7rem; color: var(--text-dim); font-style: italic; }

.log-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
  font-size: 0.7rem;
}

.log-item-name { font-weight: 600; color: var(--text-main); }
.log-item-sev { font-weight: 700; }
.log-item-sev.low { color: var(--severity-low); }
.log-item-sev.medium { color: var(--severity-medium); }
.log-item-sev.high { color: var(--severity-high); }

.metrics-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.m-box {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.03);
  padding: 5px 7px;
  border-radius: 4px;
}

.m-lbl { font-size: 0.65rem; color: var(--text-dim); }
.m-val { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; color: var(--accent-cyan-bright); }

.spatial-basis-footer {
  font-size: 0.68rem;
  color: var(--text-dim);
  border-top: 1px dashed var(--border-glass-light);
  padding-top: 4px;
}

/* Command Center Footer */
.command-footer {
  margin: 0 8px 8px 8px;
  padding: 6px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  color: var(--text-dim);
  border-radius: var(--radius-md);
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(8, 14, 26, 0.85);
}

.footer-disclaimer-text { color: var(--text-dim); font-size: 0.66rem; }

/* Utilities */
.hidden { display: none !important; }
.flex-1 { flex: 1; }

.btn-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   5. LEAFLET WATERLOGGING POPUP STYLING
   -------------------------------------------------------------------------- */
.dark-leaflet-popup .leaflet-popup-content-wrapper {
  background: rgba(8, 14, 26, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #f8fafc;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  padding: 4px;
}

.dark-leaflet-popup .leaflet-popup-tip {
  background: rgba(8, 14, 26, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.waterlogging-popup {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 210px;
  font-family: var(--font-sans);
  padding: 4px;
}

.wl-popup-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan-bright);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
  margin-bottom: 2px;
  font-family: var(--font-mono);
}

.wl-popup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: #94a3b8;
}

.wl-popup-row span { color: #94a3b8; }
.wl-popup-row strong { color: #f8fafc; font-weight: 600; }

.wl-popup-row .sev-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

.wl-popup-row .sev-tag.low { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.wl-popup-row .sev-tag.medium { background: rgba(234, 179, 8, 0.2); color: #eab308; }
.wl-popup-row .sev-tag.high { background: rgba(249, 115, 22, 0.2); color: #f97316; }

.wl-popup-footer {
  font-size: 0.62rem;
  color: #64748b;
  font-style: italic;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 4px;
  margin-top: 4px;
}

/* Infrastructure & Drainage Popups */
.infra-popup, .drain-popup {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
  font-family: var(--font-sans);
  padding: 4px;
}

.infra-popup-title, .drain-popup-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan-bright);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
  margin-bottom: 2px;
}

.infra-popup-row, .drain-popup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: #94a3b8;
}

.infra-popup-row strong, .drain-popup-row strong {
  color: #f8fafc;
  font-weight: 600;
}

.infra-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}
.infra-badge.critical { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.4); }
.infra-badge.normal { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }

/* Alerts & Triage Panel Styles */
.alerts-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass-light);
}

.basis-pill {
  font-size: 0.65rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.alerts-list-scroll {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  padding-right: 2px;
}

.alert-empty-msg {
  padding: 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
}

.alert-card {
  background: rgba(8, 14, 26, 0.92);
  border: 1px solid var(--border-glass-light);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.alert-card:hover {
  border-color: var(--accent-cyan-bright);
  box-shadow: 0 0 14px rgba(0, 243, 255, 0.25);
  transform: translateY(-1px);
}

.alert-card.priority-critical { border-left: 4px solid #a855f7; }
.alert-card.priority-high { border-left: 4px solid #ef4444; }
.alert-card.priority-medium { border-left: 4px solid #eab308; }
.alert-card.priority-low { border-left: 4px solid #3b82f6; }

.alert-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inc-id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.inc-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.inc-badge.critical { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.5); }
.inc-badge.high { background: var(--severity-critical-bg); color: var(--severity-critical); border: 1px solid var(--severity-critical-border); }
.inc-badge.medium { background: var(--severity-medium-bg); color: var(--severity-medium); border: 1px solid var(--severity-medium-border); }
.inc-badge.low { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.5); }

.alert-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.inc-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.inc-row span { color: var(--text-dim); }
.inc-row strong { color: var(--text-main); }

.inc-action-box {
  font-size: 0.72rem;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  padding: 6px;
  margin-top: 4px;
  line-height: 1.3;
}

.alert-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-dim);
  border-top: 1px dashed var(--border-glass-light);
  padding-top: 6px;
  margin-top: 2px;
}

.locate-inc-btn {
  background: transparent;
  border: 1px solid var(--border-cyan);
  color: var(--accent-cyan-bright);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.locate-inc-btn:hover {
  background: var(--accent-cyan);
  color: #000;
}

/* --------------------------------------------------------------------------
   6. PUMP STATIONS IN-APP MODAL STYLING (COMMAND CENTER HUD)
   -------------------------------------------------------------------------- */
.pump-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 12, 28, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeInOverlay 0.2s ease-out;
}

.pump-modal-card {
  width: 660px;
  max-width: 95vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(8, 26, 56, 0.96) 0%, rgba(12, 36, 76, 0.94) 100%);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  box-shadow: 0 24px 64px rgba(4, 16, 36, 0.65), 0 0 28px rgba(56, 189, 248, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  overflow: hidden;
  animation: scaleInModal 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pump-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1.5px solid rgba(56, 189, 248, 0.25);
  background: rgba(6, 20, 44, 0.65);
}

.pump-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pump-icon-chip {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.3) 0%, rgba(6, 182, 212, 0.2) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.pump-title-text-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal-main-title {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.modal-sub-title {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #93c5fd;
}

.api-endpoint-badge {
  font-size: 0.64rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  letter-spacing: 0.06em;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

.close-card-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #93c5fd;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.close-card-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
}

.pump-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  overflow-y: auto;
}

/* 1. Telemetry Summary Grid (4 HUD Blocks) */
.pump-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.pump-telemetry-tile {
  background: linear-gradient(135deg, rgba(10, 30, 62, 0.9) 0%, rgba(16, 44, 86, 0.85) 100%);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 3px 10px rgba(6, 22, 48, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.tile-lbl {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #93c5fd;
}

.tile-val {
  font-size: 0.92rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.tile-val.val-emerald { color: #34d399; }
.tile-val.val-live { color: #38bdf8; display: flex; align-items: center; gap: 5px; }
.tile-val.val-cyan { color: #67e8f9; }

.tile-sub {
  font-size: 0.58rem;
  font-weight: 600;
  color: #7dd3fc;
  letter-spacing: 0.04em;
}

/* 2. Controls & Search Filter Bar */
.pump-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pump-search-input-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 22, 48, 0.85);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 6px;
  padding: 6px 10px;
  color: #93c5fd;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.pump-search-input-box:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}
.pump-search-input-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.74rem;
}
.pump-search-input-box input::placeholder {
  color: rgba(147, 197, 253, 0.6);
}

.pump-quick-filters {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pump-filter-pill {
  background: rgba(15, 34, 70, 0.8);
  border: 1.5px solid rgba(56, 189, 248, 0.25);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.66rem;
  font-weight: 700;
  color: #93c5fd;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-mono);
}
.pump-filter-pill:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #ffffff;
}
.pump-filter-pill.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}
.pump-filter-pill.crit-filter.active {
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
  border-color: #f87171;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}
.pump-filter-pill.warn-filter.active {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
  border-color: #fbbf24;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.35);
}

/* 3. Pump Stations List */
.pump-stations-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 4px;
}

.pump-empty-search {
  padding: 16px;
  text-align: center;
  color: #93c5fd;
  font-size: 0.74rem;
  background: rgba(10, 28, 58, 0.5);
  border: 1px dashed rgba(56, 189, 248, 0.3);
  border-radius: 6px;
}

.pump-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(10, 28, 58, 0.88) 0%, rgba(14, 38, 76, 0.84) 100%);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.pump-item-row:hover {
  background: linear-gradient(135deg, rgba(14, 42, 86, 0.96) 0%, rgba(18, 52, 106, 0.92) 100%);
  border-color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(6, 22, 48, 0.4), 0 0 10px rgba(56, 189, 248, 0.25);
}
.pump-item-row.crit {
  border-left: 4px solid #ef4444;
}
.pump-item-row.warn {
  border-left: 4px solid #f59e0b;
}
.pump-item-row.normal {
  border-left: 4px solid #38bdf8;
}

.pump-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.pump-num-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #7dd3fc;
  min-width: 24px;
}

.pump-code-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  letter-spacing: 0.05em;
}

.pump-station-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.pump-station-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.pump-station-meta {
  font-size: 0.64rem;
  color: #93c5fd;
}
.pump-station-meta strong {
  color: #bfdbfe;
}

.pump-item-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pump-meter-track {
  width: 70px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.pump-meter-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.pump-load-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  min-width: 72px;
  text-align: center;
  letter-spacing: 0.04em;
}
.pump-load-pill.normal {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
}
.pump-load-pill.warn {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}
.pump-load-pill.crit {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #f87171;
}

/* 4. Footer Note */
.pump-notice-footer {
  padding-top: 10px;
  border-top: 1.5px solid rgba(56, 189, 248, 0.2);
  color: #93c5fd;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-hint {
  color: #93c5fd;
}

/* Animations */
@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleInModal {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* --------------------------------------------------------------------------
   7. CRITICAL INFRASTRUCTURE MAP ICONS
   -------------------------------------------------------------------------- */
.infra-div-icon {
  background: transparent;
  border: none;
}

.infra-map-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  transition: transform 0.2s ease;
}

.infra-map-badge:hover {
  transform: scale(1.25);
  z-index: 1000;
}

.infra-map-badge.hospital { background: rgba(239, 68, 68, 0.9); border-color: #fca5a5; }
.infra-map-badge.police { background: rgba(59, 130, 246, 0.9); border-color: #93c5fd; }
.infra-map-badge.emergency { background: rgba(245, 158, 11, 0.9); border-color: #fde68a; }
.infra-map-badge.metro { background: rgba(168, 85, 247, 0.9); border-color: #e9d5ff; }
.infra-map-badge.railway { background: rgba(124, 58, 237, 0.9); border-color: #ddd6fe; }
.infra-map-badge.school { background: rgba(16, 185, 129, 0.9); border-color: #a7f3d0; }
.infra-map-badge.other { background: rgba(148, 163, 184, 0.9); border-color: #cbd5e1; }

.infra-map-badge.is-critical {
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 15px currentColor;
  transform: scale(1.1);
}

/* --------------------------------------------------------------------------
   8. POPULATION RESPONSE PRIORITY STYLING
   -------------------------------------------------------------------------- */
.scada-response-priority-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 6px;
  padding: 8px;
  margin-top: 6px;
  margin-bottom: 6px;
}

.priority-counts-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 6px;
}

.p-count-pill {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.p-count-pill.p1 {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(168, 85, 247, 0.5);
  color: #c084fc;
}

.p-count-pill.p2 {
  background: rgba(192, 132, 252, 0.12);
  border-color: rgba(192, 132, 252, 0.35);
  color: #e9d5ff;
}

.p-count-pill.p3 {
  background: rgba(129, 140, 248, 0.12);
  border-color: rgba(129, 140, 248, 0.35);
  color: #a5b4fc;
}

.top-priority-card {
  background: rgba(30, 27, 75, 0.45);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 5px;
  padding: 8px;
  margin-top: 6px;
}

.top-p-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.top-p-header .lbl {
  font-size: 0.68rem;
  color: #c084fc;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.top-p-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 6px;
  word-break: break-word;
}

.top-p-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.72rem;
  color: #94a3b8;
  margin-bottom: 8px;
}

.top-p-row {
  display: flex;
  justify-content: space-between;
}

.top-p-row strong {
  color: #e2e8f0;
}

.btn-focus-top-p {
  width: 100%;
  padding: 5px 8px;
  background: linear-gradient(135deg, #7e22ce 0%, #a855f7 100%);
  border: none;
  border-radius: 4px;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(168, 85, 247, 0.35);
}

.btn-focus-top-p:hover {
  background: linear-gradient(135deg, #6b21a8 0%, #9333ea 100%);
  box-shadow: 0 3px 10px rgba(168, 85, 247, 0.55);
}

/* Map Priority Badges (P1 / P2 / P3 Markers) */
.priority-badge-div {
  background: transparent;
  border: none;
}

.priority-badge-marker {
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.priority-badge-marker.p1 {
  background: linear-gradient(135deg, #7e22ce, #a855f7);
  border-color: #f0abfc;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.8);
}

.priority-badge-marker.p2 {
  background: linear-gradient(135deg, #9333ea, #c084fc);
  border-color: #e9d5ff;
}

.priority-badge-marker.p3 {
  background: linear-gradient(135deg, #4f46e5, #818cf8);
  border-color: #c7d2fe;
}

/* ==========================================================================
   Pump Station Markers (Matching Image 3 exact appearance)
   ========================================================================== */

.pump-station-leaflet-marker {
  background: transparent !important;
  border: none !important;
}

.pump-station-marker-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  cursor: pointer;
  user-select: none;
}

.pump-station-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #0f172a;
  border: 2px solid #0284c7;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  position: relative;
  z-index: 2;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pump-station-pill:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7);
}

.pump-dot-container {
  position: relative;
  width: 8px;
  height: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pump-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0284c7;
  position: relative;
  z-index: 2;
}

/* Radar Ping Halo Animation matching Image 3 */
.pump-ping-ring {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(239, 68, 68, 0.75);
  background: rgba(239, 68, 68, 0.12);
  pointer-events: none;
  animation: pump-radar-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

@keyframes pump-radar-ping {
  0% {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0.95;
  }
  65% {
    transform: translate(-50%, -50%) scale(2.0);
    opacity: 0.45;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.8);
    opacity: 0;
  }
}

.pump-station-text {
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.2px;
}

/* ==========================================================================
   Smart Routing Alternate Corridors & Congestion Bypasses
   ========================================================================== */

.route-badge-divicon {
  background: transparent !important;
  border: none !important;
}

.route-map-badge {
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.route-map-badge:hover {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8);
}

.route-map-badge.safe {
  border: 2px solid #10b981;
  color: #a7f3d0;
}

.route-map-badge.detour {
  border: 2px solid #06b6d4;
  color: #bae6fd;
}

.route-map-badge.avoid {
  border: 2px solid #ef4444;
  color: #fecaca;
  background: rgba(30, 10, 15, 0.94);
}

/* ==========================================================================
   RAINFALL DYNAMICS & OPENWEATHERMAP API COMMAND SUITE
   ========================================================================== */

#tab-rainfall {
  flex-direction: column;
  gap: 12px;
}

#tab-rainfall:not(.active) {
  display: none !important;
}

#tab-rainfall.active {
  display: flex !important;
  animation: tabContentSmoothIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.rainfall-header-card {
  border-left: 3px solid #0284c7;
}
/* Metrics Grid */
.rainfall-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.rainfall-kpi-featured {
  grid-column: span 2;
  border-color: rgba(56, 189, 248, 0.4);
  background: linear-gradient(135deg, rgba(8, 28, 58, 0.5) 0%, rgba(14, 42, 80, 0.4) 100%);
}

.kpi-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.kpi-val-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.intensity-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tag-low {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.tag-med {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.5);
}

.tag-high {
  background: rgba(249, 115, 22, 0.2);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.5);
}

.tag-crit {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.6);
  animation: pulse-glow 1.5s infinite;
}

/* Alert Box */
.rainfall-alert-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.rainfall-alert-box.alert-normal {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
}

.rainfall-alert-box.alert-moderate {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.45);
  color: #fde047;
}

.rainfall-alert-box.alert-heavy {
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.55);
  color: #fed7aa;
}

.rainfall-alert-box.alert-critical {
  background: rgba(239, 68, 68, 0.2);
  border: 1.5px solid rgba(239, 68, 68, 0.7);
  color: #fca5a5;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.3);
}

.alert-icon-wrap {
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.alert-desc {
  font-size: 0.70rem;
  line-height: 1.35;
  opacity: 0.9;
}

/* Reticle / Location Card */
.rainfall-location-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-glass-light);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.loc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.loc-card-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.04em;
}

.coord-pill {
  font-size: 0.65rem;
  font-weight: 700;
  color: #bae6fd;
  background: rgba(2, 132, 199, 0.25);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
}

.loc-card-help {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0;
}

.loc-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.68rem;
}

/* Sync Container */
.rainfall-sync-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-full-width {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 0.80rem;
  font-weight: 800;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.7);
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-full-width:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.btn-full-width:active {
  transform: scale(0.98);
}

.sync-status-caption {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
}

/* Forecast Section */
.forecast-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.forecast-header {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.forecast-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.forecast-pill-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass-light);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}

.forecast-pill-card .f-time {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 600;
}

.forecast-pill-card .f-rain {
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
}

.forecast-pill-card .f-trend {
  font-size: 0.60rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}

.trend-rising {
  background: rgba(249, 115, 22, 0.2);
  color: #fb923c;
}

.trend-steady {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

.trend-easing {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

/* Bright Theme Overrides for Rainfall Dynamics */
body.theme-bright .weather-api-drawer,
body.theme-bright .rainfall-location-card,
body.theme-bright .forecast-pill-card {
  background: rgba(212, 234, 252, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(147, 197, 253, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.theme-bright .owm-input {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(147, 197, 253, 0.85);
  color: #07223d;
}

body.theme-bright .owm-key-btn-secondary {
  background: rgba(255, 255, 255, 0.7);
  color: #326491;
  border-color: rgba(147, 197, 253, 0.8);
}

body.theme-bright .rainfall-kpi-featured {
  background: linear-gradient(135deg, rgba(200, 228, 255, 0.8) 0%, rgba(220, 240, 255, 0.8) 100%);
  border-color: rgba(56, 189, 248, 0.7);
}

body.theme-bright .forecast-pill-card .f-rain {
  color: #07223d;
}

body.theme-bright .coord-pill {
  background: rgba(186, 222, 252, 0.9);
  color: #07223d;
  border-color: rgba(56, 189, 248, 0.7);
}

body.theme-bright .loc-card-help,
body.theme-bright .sync-status-caption,
body.theme-bright .weather-api-caption {
  color: #326491;
}

/* Radar Heatmap Leaflet Overlay */
.radar-cell-pulse {
  animation: radar-pulse 3s infinite ease-in-out;
  cursor: pointer !important;
  transition: stroke-width 0.2s ease, fill-opacity 0.2s ease;
}

.radar-cell-pulse:hover {
  stroke-width: 3.5px !important;
  fill-opacity: 0.45 !important;
  stroke: #ffedd5 !important;
}

@keyframes radar-pulse {
  0% { opacity: 0.35; transform: scale(0.98); }
  50% { opacity: 0.65; transform: scale(1.02); }
  100% { opacity: 0.35; transform: scale(0.98); }
}

/* Radar Basin Region Text Label (Suppressed - Region names only show on click popup) */
.radar-basin-label {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.radar-basin-label::before,
.radar-basin-label-inner,
.radar-basin-title,
.radar-basin-sub {
  display: none !important;
}

/* --------------------------------------------------------------------------
   RADAR BASIN CLICK POPUP (MATCHES FIRST IMAGE STYLE)
   -------------------------------------------------------------------------- */
.radar-leaflet-popup .leaflet-popup-content-wrapper {
  background: rgba(15, 23, 42, 0.90) !important;
  border: 1px solid rgba(249, 115, 22, 0.6) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 12px rgba(249, 115, 22, 0.3) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  color: #ffedd5 !important;
  padding: 2px !important;
}

.radar-leaflet-popup .leaflet-popup-content {
  margin: 8px 12px !important;
  line-height: 1.4 !important;
}

.radar-leaflet-popup .leaflet-popup-tip {
  background: rgba(15, 23, 42, 0.95) !important;
  border: 1px solid rgba(249, 115, 22, 0.6) !important;
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.3) !important;
}

.radar-leaflet-popup .leaflet-popup-close-button {
  color: #fb923c !important;
  padding: 4px 6px 0 0 !important;
  font-size: 16px !important;
}

.radar-leaflet-popup .leaflet-popup-close-button:hover {
  color: #ffedd5 !important;
}

.radar-popup-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
  min-width: 170px;
  max-width: 250px;
}

.radar-popup-title {
  color: #ffedd5;
  font-family: var(--font-mono, monospace, ui-monospace);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  white-space: normal;
  line-height: 1.35;
}

.radar-popup-sub {
  color: #fb923c;
  font-family: var(--font-mono, monospace, ui-monospace);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-shadow: 0 0 8px rgba(249, 115, 22, 0.4);
}

.radar-popup-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-mono, monospace, ui-monospace);
  font-size: 9.5px;
  color: #94a3b8;
  margin-top: 3px;
  padding-top: 5px;
  border-top: 1px solid rgba(249, 115, 22, 0.25);
  width: 100%;
}

.radar-popup-meta .meta-dot {
  color: rgba(249, 115, 22, 0.6);
}

.radar-popup-sync-btn {
  margin-top: 6px;
  width: 100%;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.22), rgba(234, 88, 12, 0.38));
  border: 1px solid rgba(249, 115, 22, 0.55);
  border-radius: 6px;
  color: #ffedd5;
  font-family: var(--font-mono, monospace, ui-monospace);
  font-size: 10px;
  font-weight: 700;
  padding: 5px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.radar-popup-sync-btn:hover {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.45), rgba(234, 88, 12, 0.6));
  border-color: #f97316;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.5);
  transform: translateY(-1px);
}

.radar-sync-pill-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  width: 100%;
  margin-top: 5px;
}

.radar-sync-pill {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 4px;
  color: #94a3b8;
  font-family: var(--font-mono, monospace, ui-monospace);
  font-size: 8px;
  font-weight: 700;
  padding: 3px 0;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.radar-sync-pill:hover {
  border-color: #f97316;
  color: #ffedd5;
  background: rgba(249, 115, 22, 0.25);
}

.radar-sync-pill.active-target {
  border-color: #38bdf8;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.2);
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.3);
}

/* Bright mode adaptations */
body.theme-bright .radar-leaflet-popup .leaflet-popup-content-wrapper {
  background: rgba(248, 250, 252, 0.96) !important;
  border: 1px solid rgba(234, 88, 12, 0.7) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18), 0 0 12px rgba(249, 115, 22, 0.2) !important;
  color: #0f172a !important;
}

body.theme-bright .radar-leaflet-popup .leaflet-popup-tip {
  background: rgba(248, 250, 252, 0.98) !important;
  border: 1px solid rgba(234, 88, 12, 0.7) !important;
}

body.theme-bright .radar-popup-title {
  color: #0f172a !important;
  text-shadow: none !important;
}

body.theme-bright .radar-popup-sub {
  color: #ea580c !important;
}

body.theme-bright .radar-popup-sync-btn {
  background: rgba(234, 88, 12, 0.12) !important;
  border-color: rgba(234, 88, 12, 0.6) !important;
  color: #c2410c !important;
}



