/* ==========================================================================
   ALERT INDIA · DEFENSE & CRISIS INTELLIGENCE DESIGN SYSTEM
   Principles: Tactical clarity, modern geometric typography, dual-mode theming.
   ========================================================================== */

:root,
html[data-theme="dark"],
body[data-theme="dark"] {
    /* Tactical Midnight Obsidian (Default Dark Theme) */
    --bg-canvas: #09090d;
    --bg-surface: #0f0f14;
    --bg-card: #15151c;
    --bg-card-hover: #1c1c26;
    --bg-input: #121218;
    --bg-pill: #1a1a24;
    --bg-elevated: #20202b;
    
    /* Fine Hairline Borders */
    --border-subtle: #23232f;
    --border-medium: #303040;
    --border-strong: #46465c;

    /* Typographic Hierarchy */
    --text-pure: #ffffff;
    --text-primary: #f4f4f8;
    --text-secondary: #a2a2b6;
    --text-tertiary: #6f6f84;
    --text-muted: #525266;

    /* Status Accents (Vibrant Tactical Neon on Dark) */
    --color-critical: #ff4757;
    --color-critical-bg: rgba(255, 71, 87, 0.12);
    --color-severe: #ff7f50;
    --color-severe-bg: rgba(255, 127, 80, 0.12);
    --color-moderate: #eccc68;
    --color-moderate-bg: rgba(236, 204, 104, 0.12);
    --color-minor: #2ed573;
    --color-minor-bg: rgba(46, 213, 115, 0.12);

    --color-ongoing: #38bdf8;
    --color-ongoing-bg: rgba(56, 189, 248, 0.12);
    --color-monitoring: #a855f7;
    --color-monitoring-bg: rgba(168, 85, 247, 0.12);
    --color-resolved: #71717a;

    --brand-accent: #38bdf8;
    --brand-glow: rgba(56, 189, 248, 0.28);

    /* Shadows & Elevation */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.65);
    --panel-backdrop: rgba(15, 15, 20, 0.88);
    --scrollbar-thumb: #282836;
    --scrollbar-hover: #3d3d52;
}

html[data-theme="light"],
body[data-theme="light"] {
    /* Executive Slate / Pure Daylight Theme */
    --bg-canvas: #f8fafc;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-input: #f8fafc;
    --bg-pill: #f1f5f9;
    --bg-elevated: #ffffff;
    
    /* Fine Hairline Borders */
    --border-subtle: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-strong: #94a3b8;

    /* Typographic Hierarchy (Slate Scale) */
    --text-pure: #0f172a;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;

    /* Status Accents (High Contrast on Light) */
    --color-critical: #dc2626;
    --color-critical-bg: rgba(220, 38, 38, 0.08);
    --color-severe: #ea580c;
    --color-severe-bg: rgba(234, 88, 12, 0.08);
    --color-moderate: #ca8a04;
    --color-moderate-bg: rgba(202, 138, 4, 0.08);
    --color-minor: #059669;
    --color-minor-bg: rgba(5, 150, 105, 0.08);

    --color-ongoing: #0284c7;
    --color-ongoing-bg: rgba(2, 132, 199, 0.08);
    --color-monitoring: #7c3aed;
    --color-monitoring-bg: rgba(124, 58, 237, 0.08);
    --color-resolved: #64748b;

    --brand-accent: #0284c7;
    --brand-glow: rgba(2, 132, 199, 0.16);

    /* Shadows & Elevation */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 14px 28px -4px rgba(15, 23, 42, 0.12);
    --panel-backdrop: rgba(255, 255, 255, 0.92);
    --scrollbar-thumb: #cbd5e1;
    --scrollbar-hover: #94a3b8;
}

:root {
    /* Universal Geometry & Fonts */
    --font-display: 'Outfit', -apple-system, sans-serif;
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --nav-height: 56px;
    --sidebar-width: 410px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;
    --transition-theme: background-color 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s ease, color 0.2s ease, box-shadow 0.22s ease;
}

/* ==========================================================================
   Reset & Core
   ========================================================================== */

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

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Subtle Scrollbar */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-hover);
}

/* ==========================================================================
   Header Navbar
   ========================================================================== */

.navbar {
    height: var(--nav-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    z-index: 1000;
    transition: var(--transition-theme);
}

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

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
}

.logo-mark-wrap {
    position: relative;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-svg {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 8px var(--brand-glow));
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-logo:hover .brand-svg {
    transform: scale(1.08);
}

.logo-core-pulse {
    animation: beaconPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes beaconPulse {
    0%, 100% { opacity: 1; transform-origin: 16px 16px; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.8); }
}

.brand-text-block {
    display: flex;
    flex-direction: column;
    gap: 1.5px;
}

.brand-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.05em;
    color: var(--text-pure);
    text-transform: uppercase;
}

.logo-text strong {
    font-weight: 800;
    color: var(--brand-accent);
}

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 2.5px 7px;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.15);
}

.live-pulse-dot {
    width: 5.5px;
    height: 5.5px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
    animation: liveDotPulse 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes liveDotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.45); opacity: 0.4; }
}

.brand-sub {
    font-size: 10.5px;
    color: var(--text-tertiary);
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

/* Nav Center: Metrics Pill */
.nav-center {
    display: flex;
    align-items: center;
}

.metrics-pill {
    height: 34px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 0 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-theme);
}

.metrics-pill strong {
    color: var(--text-pure);
    font-weight: 700;
    font-family: var(--font-display);
    font-size: 13px;
}

.metric-sep {
    color: var(--border-medium);
}

.status-dot {
    display: inline-block;
    width: 6.5px;
    height: 6.5px;
    border-radius: 50%;
    margin-right: 4px;
}

.status-dot.blue { background: var(--color-ongoing); box-shadow: 0 0 6px rgba(56, 189, 248, 0.6); }
.status-dot.red  { background: var(--color-critical); box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }

/* Update Schedule Status Pill (Nav Center) */
.update-schedule-pill {
    height: 34px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 0 12px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    margin-left: 8px;
    transition: var(--transition-theme);
}

.update-schedule-pill .schedule-icon {
    font-size: 11.5px;
    color: var(--brand-accent);
}

.update-schedule-pill strong {
    color: var(--text-pure);
    font-weight: 600;
}

/* Sidebar Cadence Banner (Mobile & Compact View) */
.sidebar-cadence-banner {
    display: none;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: var(--text-tertiary);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    margin-bottom: 12px;
    line-height: 1.3;
}

.sidebar-cadence-banner i {
    font-size: 11px;
    color: var(--brand-accent);
}

@media (max-width: 992px) {
    .update-schedule-pill {
        display: none;
    }
    .sidebar-cadence-banner {
        display: flex;
    }
}

/* Nav Actions: Perfectly Consistent Height, Radius & Styling */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0 12px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.nav-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-medium);
    color: var(--text-pure);
    box-shadow: var(--shadow-md);
}

.nav-btn:active {
    transform: translateY(1px);
}

.theme-toggle-btn {
    position: relative;
    overflow: hidden;
}

.theme-icon {
    font-size: 12px;
    color: var(--brand-accent);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle-btn:hover .theme-icon {
    transform: rotate(20deg) scale(1.15);
}

.theme-label {
    font-size: 11.5px;
    font-weight: 600;
}

/* ==========================================================================
   Application Layout
   ========================================================================== */

.app-layout {
    height: calc(100vh - var(--nav-height));
    display: flex;
    position: relative;
    overflow: hidden;
}

/* ==========================================================================
   Sidebar: Clean Filter Controls & Event List
   ========================================================================== */

.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 500;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.sidebar-pinned-top {
    padding: 14px 16px 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 2;
}

.sidebar-scroll-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding: 12px 16px 32px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Custom Tactical Scrollbar */
.sidebar-scroll-body::-webkit-scrollbar {
    width: 5px;
}
.sidebar-scroll-body::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-scroll-body::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 10px;
}
.sidebar-scroll-body::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
}

.national-feed-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* Minimal Search Field */
.search-field {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-tertiary);
    font-size: 12px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 32px 8px 32px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 12.5px;
    outline: none;
    transition: border-color 0.15s ease;
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-input:focus {
    border-color: var(--border-strong);
}

.search-clear {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 12px;
    display: none;
}

.search-clear:hover {
    color: var(--text-primary);
}

/* GPS Detection Button */
.btn-detect-gps {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--brand-accent);
    padding: 0 10px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s ease;
}

.btn-detect-gps:hover {
    background: var(--bg-hover);
    border-color: var(--brand-accent);
    color: var(--text-pure);
}

/* Primary Mode Switcher: My Situation vs National Feed */
.view-mode-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-canvas);
    padding: 3px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    margin-bottom: 10px;
}

.view-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-tertiary);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.view-tab-btn i {
    font-size: 12px;
    transition: transform 0.15s ease;
}

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

.view-tab-btn.active {
    background: var(--bg-card);
    color: var(--brand-accent);
    box-shadow: var(--shadow-sm);
    border-color: var(--border-medium);
}

.view-tab-btn.active i {
    color: var(--brand-accent);
}

/* Hyper-Local Situational Intelligence Briefing Card */
.situation-briefing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.25s ease-out;
}

.situation-briefing-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Offline Storm Mode Banner */
.offline-storm-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 6px;
    padding: 6px 9px;
    margin-bottom: 9px;
    font-size: 11px;
    color: #f59e0b;
}

.offline-storm-banner i {
    font-size: 13px;
    flex-shrink: 0;
}

.offline-storm-banner .offline-text {
    line-height: 1.3;
}

.offline-storm-banner strong {
    font-weight: 700;
    letter-spacing: 0.3px;
}

.situation-header {
    padding-left: 8px;
    margin-bottom: 10px;
}

.situation-loc-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.situation-loc-name {
    font-size: 13.5px;
    color: var(--text-primary);
}

.situation-loc-name strong {
    color: var(--text-pure);
    font-weight: 700;
}



.situation-threat-pill {
    font-size: 9.5px;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
}

.situation-quick-metrics {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: var(--text-secondary);
}

.situation-quick-metrics i {
    color: var(--brand-accent);
    margin-right: 2px;
}



/* Radius Selector Row */
.situation-radius-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
    margin-bottom: 8px;
    border-bottom: 1px dashed var(--border-subtle);
}

.radius-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-tertiary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.radius-pills {
    display: flex;
    gap: 5px;
}

.radius-pill {
    padding: 2px 8px;
    background: var(--bg-pill);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 10.5px;
    font-family: var(--font-mono);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.radius-pill:hover {
    color: var(--text-pure);
    border-color: var(--border-medium);
}

.radius-pill.active {
    background: var(--brand-accent);
    color: #000;
    border-color: var(--brand-accent);
    font-weight: 700;
    box-shadow: 0 0 8px var(--brand-glow);
}

.situation-block {
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid var(--border-subtle);
}

.situation-block-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-tertiary);
    letter-spacing: 0.6px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.situation-block-title i {
    margin-right: 4px;
}

.situation-badge-accent {
    color: #60a5fa;
    font-weight: 600;
    text-transform: none;
    font-size: 9.5px;
}

.situation-bullet {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--text-secondary);
    margin-bottom: 3px;
}

.situation-bullet i {
    margin-top: 3px;
    flex-shrink: 0;
}

.situation-forecast-text {
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--text-secondary);
}

/* Hourly Sparkline & Precipitation Timeline */
.hourly-timeline-container {
    margin-top: 8px;
    padding-top: 4px;
}

.hourly-timeline-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 64px;
    padding: 4px 6px 2px 6px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
}

.timeline-slot {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    cursor: default;
    position: relative;
}

.timeline-bar-value {
    font-size: 8px;
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    line-height: 1;
    margin-bottom: 2px;
    height: 9px;
}

.timeline-bar-track {
    width: 100%;
    max-width: 16px;
    height: 36px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px 3px 0 0;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.timeline-bar-fill {
    width: 100%;
    border-radius: 2px 2px 0 0;
    transition: height 0.3s ease;
}

.timeline-slot-time {
    font-size: 8.5px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-top: 3px;
    white-space: nowrap;
}

.situation-action-block {
    background: rgba(56, 189, 248, 0.05);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 6px;
    padding: 8px;
    margin-top: 9px;
}

.situation-action-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 11px;
    line-height: 1.35;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.situation-action-item i {
    margin-top: 2.5px;
    flex-shrink: 0;
}

/* Direct 1-Click SOS Emergency Calling Hotlines */
.situation-block.emergency-section {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.22);
    border-radius: 6px;
    padding: 8px;
    margin-top: 10px;
}

.situation-sos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 6px;
    margin-top: 6px;
}

.sos-call-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    padding: 6px 9px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.18s ease;
}

.sos-call-btn i {
    font-size: 14px;
    color: #ef4444;
    flex-shrink: 0;
}

.sos-call-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.sos-call-text strong {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.sos-call-num {
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 700;
    color: #ef4444;
}

.sos-call-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.sos-call-btn.primary {
    border-color: rgba(239, 68, 68, 0.4);
}

.situation-footer-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.btn-focus-situation {
    background: transparent;
    border: 1px solid var(--border-medium);
    color: var(--brand-accent);
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-focus-situation:hover {
    background: var(--brand-accent);
    color: #fff;
    border-color: var(--brand-accent);
}

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

.filter-mini-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 2px;
}

.filter-mini-header i {
    font-size: 10px;
    margin-right: 3px;
}

/* Minimal Filter Tabs */
.filter-tabs {
    display: flex;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 2px;
    gap: 2px;
}

.time-tabs .time-tab-btn {
    font-size: 11px;
    padding: 4px 0;
}

.time-tabs .time-tab-btn.active {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.15);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 11.5px;
    font-weight: 500;
    padding: 5px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.tab-btn:hover {
    color: var(--text-secondary);
}

.tab-btn.active {
    background: var(--bg-card);
    color: var(--text-pure);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Category Filter Bar */
.categories-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 2px 0;
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-tertiary);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: all 0.15s ease;
}

.cat-pill:hover {
    border-color: var(--border-medium);
    color: var(--text-secondary);
}

.cat-pill.active {
    background: var(--bg-card);
    border-color: var(--border-strong);
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.cat-pill-all {
    font-weight: 600;
}

.cat-pill-icon {
    font-size: 11.5px;
    line-height: 1;
}

/* Dropdown Selectors Row */
.selectors-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.select-wrap {
    position: relative;
}

.minimal-select {
    width: 100%;
    appearance: none;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 7px 26px 7px 10px;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 12px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.minimal-select:focus {
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.caret {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 9px;
    color: var(--text-tertiary);
    pointer-events: none;
}

/* Feed Subhead */
.feed-subhead {
    padding: 10px 2px 4px 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subhead-title {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.subhead-count {
    font-size: 11.5px;
    font-family: var(--font-mono);
    color: var(--text-tertiary);
}

/* Event Cards Scroll Feed */
.events-scroll {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
}

/* Minimal Event Card */
.event-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
}

.event-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-medium);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.event-item.selected {
    border-color: var(--brand-accent);
    background: var(--bg-card-hover);
    box-shadow: 0 0 0 1px var(--brand-accent), var(--shadow-md);
}

.event-top-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}

.event-category-name {
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.event-time {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-tertiary);
}

.event-headline {
    font-family: var(--font-sans);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.42;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.event-bottom-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--text-secondary);
}

.event-district-name {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-tertiary);
    font-size: 11.5px;
}

.event-tags {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Minimalist Badges & Pills */
.subtle-badge {
    font-size: 10.5px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    text-transform: capitalize;
}

.subtle-badge.critical { background: var(--color-critical-bg); color: var(--color-critical); }
.subtle-badge.severe   { background: var(--color-severe-bg); color: var(--color-severe); }
.subtle-badge.moderate { background: var(--color-moderate-bg); color: var(--color-moderate); }
.subtle-badge.minor    { background: var(--color-minor-bg); color: var(--color-minor); }

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-tertiary);
}

.status-indicator.ongoing { color: var(--color-ongoing); }

/* Empty state */
.empty-feed {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 12.5px;
}

/* ==========================================================================
   Map Viewport & Leaflet Styling
   ========================================================================== */

.map-view {
    flex: 1;
    height: 100%;
    position: relative;
    background: var(--bg-canvas);
}

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

/* Minimalist tile toning scoped to themes */
.map-theme-dark-canvas .leaflet-tile-pane {
    filter: brightness(0.9) contrast(1.15) saturate(0.85);
}
.map-theme-satellite .leaflet-tile-pane {
    filter: contrast(1.05) saturate(1.1);
}
.map-theme-streets .leaflet-tile-pane {
    filter: saturate(0.9);
}
.map-theme-light-canvas .leaflet-tile-pane {
    filter: contrast(1.02);
}
.map-theme-terrain .leaflet-tile-pane {
    filter: saturate(0.95);
}

/* Clean Zoom Control */
.leaflet-control-zoom {
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-sm) !important;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.leaflet-control-zoom a {
    background: var(--bg-surface) !important;
    color: var(--text-secondary) !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    width: 30px !important;
    height: 30px !important;
    line-height: 28px !important;
    font-size: 14px !important;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.leaflet-control-zoom a:hover {
    background: var(--bg-card) !important;
    color: var(--text-pure) !important;
}

/* Minimal District Tooltip */
.district-tooltip {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-medium) !important;
    color: var(--text-primary) !important;
    border-radius: 4px !important;
    font-family: var(--font-sans) !important;
    font-size: 11.5px !important;
    font-weight: 500 !important;
    padding: 3px 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.district-tooltip::before {
    display: none;
}

/* Minimal Popup */
.leaflet-popup-content-wrapper {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-medium) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow-lg) !important;
}

.leaflet-popup-tip {
    background: var(--bg-surface) !important;
}

.leaflet-popup-content {
    margin: 14px 16px !important;
}

/* Close button styling */
.leaflet-container a.leaflet-popup-close-button {
    color: var(--text-tertiary) !important;
    top: 8px !important;
    right: 8px !important;
    padding: 0 !important;
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    transition: all 0.15s ease !important;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: var(--text-pure) !important;
    background: var(--bg-card-hover) !important;
}

/* Explicit Light Theme Leaflet Overrides */
html[data-theme="light"] .leaflet-popup-content-wrapper,
html[data-theme="light"] .leaflet-popup-tip {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
    box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .popup-title {
    color: #0f172a !important;
}

html[data-theme="light"] .popup-location {
    color: #64748b !important;
}

html[data-theme="light"] .popup-action-btn {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .popup-action-btn:hover {
    background: #e2e8f0 !important;
    border-color: #94a3b8 !important;
}

.mini-popup-content {
    font-family: var(--font-sans);
    min-width: 220px;
}

.popup-category {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.popup-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-pure);
    margin-bottom: 6px;
    line-height: 1.35;
}

.popup-location {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.popup-action-btn {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    font-size: 11.5px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.popup-action-btn:hover {
    background: var(--border-medium);
    color: var(--text-pure);
}

/* Minimal Cluster */
.minimal-cluster {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    color: var(--text-pure);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.15s ease;
}

.minimal-cluster:hover {
    transform: scale(1.08);
}

/* Disaster Vector Icon Map Pin Marker */
.disaster-pin-marker {
    background: transparent !important;
    border: none !important;
}

.disaster-pin-wrapper {
    position: relative;
    width: 30px;
    height: 35px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.disaster-pin-wrapper:hover {
    transform: scale(1.22) translateY(-3px);
    z-index: 1000 !important;
}

.disaster-pin-body {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--pin-border, #38bdf8);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.24), 0 1px 3px rgba(0, 0, 0, 0.12);
    font-size: 13px;
    line-height: 1;
    z-index: 2;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

[data-theme="dark"] .disaster-pin-body {
    background: #18181b;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.65);
}

/* Downward indicator pointer */
.disaster-pin-tip {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--pin-border, #38bdf8);
    margin-top: -1.5px;
    z-index: 1;
    transition: border-top-color 0.2s ease;
}

/* Pulsing radar ring for Ongoing and Critical crisis events */
.disaster-pin-pulse {
    position: absolute;
    top: 3px;
    left: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--pin-border, #ef4444);
    opacity: 0.8;
    pointer-events: none;
    animation: disaster-pin-ping 2.2s infinite cubic-bezier(0, 0.2, 0.8, 1);
    z-index: 0;
}

@keyframes disaster-pin-ping {
    0% { transform: scale(0.7); opacity: 0.9; }
    70% { transform: scale(1.9); opacity: 0; }
    100% { transform: scale(1.9); opacity: 0; }
}

/* Selected Pin highlight */
.disaster-pin-wrapper.selected .disaster-pin-body {
    transform: scale(1.15);
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px var(--pin-border, #38bdf8);
}

[data-theme="dark"] .disaster-pin-wrapper.selected .disaster-pin-body {
    box-shadow: 0 0 0 3px #18181b, 0 0 0 6px var(--pin-border, #38bdf8);
}

/* ==========================================================================
   Slide-Over Detail Sheet
   ========================================================================== */

.detail-sheet {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-subtle);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 900;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.detail-sheet.active {
    transform: translateX(0);
}

.sheet-header {
    height: var(--nav-height);
    padding: 0 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sheet-category-badge {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sheet-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sheet-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s ease;
}

.sheet-btn:hover {
    background: var(--bg-card);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sheet-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-pure);
    line-height: 1.4;
    letter-spacing: -0.01em;
}

/* Minimal Info List */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.info-label {
    color: var(--text-tertiary);
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
    font-family: var(--font-mono);
    font-size: 11.5px;
}

.sheet-narrative {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.sheet-source {
    font-size: 11.5px;
    color: var(--text-tertiary);
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.sheet-footer-btn {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.sheet-footer-btn:hover {
    background: var(--border-medium);
    color: var(--text-pure);
}

/* ==========================================================================
   Admin Console Styles (Minimalist)
   ========================================================================== */

.admin-body {
    overflow-y: auto !important;
}

.admin-container {
    max-width: 1280px;
    margin: 28px auto;
    padding: 0 28px;
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
}

.admin-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 22px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-pure);
    margin-bottom: 18px;
}

.form-group {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.form-input, .form-select, .form-textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 12.5px;
    outline: none;
    transition: border-color 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--border-strong);
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
}

.btn-primary {
    flex: 1;
    background: var(--text-pure);
    color: var(--bg-canvas);
    border: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-secondary:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.minimal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.minimal-table th {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.minimal-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.minimal-table tr:hover td {
    background: var(--bg-card);
    color: var(--text-primary);
}

.row-action-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px 6px;
    font-size: 12px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.row-action-btn:hover {
    color: var(--text-pure);
}

.row-action-btn.delete:hover {
    color: var(--color-critical);
}

/* ==========================================================================
   Mobile Backdrop & Touch Drawer Components
   ========================================================================== */

/* Mobile Backdrop Scrim */
.mobile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 750;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* Touch Drawer Handle & Drag Area */
.drawer-drag-area {
    display: none;
    width: 100%;
    height: 24px;
    align-items: center;
    justify-content: center;
    cursor: grab;
    touch-action: none;
    user-select: none;
    padding-top: 6px;
    flex-shrink: 0;
}

.drawer-drag-pill {
    width: 38px;
    height: 4.5px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 9999px;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.drawer-drag-area:active .drawer-drag-pill {
    background: rgba(255, 255, 255, 0.55);
    transform: scaleX(1.1);
}

.drawer-mobile-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 6px 18px 12px 18px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.drawer-mobile-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-pure);
}

.drawer-count-badge {
    background: #27272a;
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 12px;
}

.drawer-close-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.drawer-close-btn:hover {
    background: var(--border-medium);
    color: var(--text-pure);
}

/* Mobile Drawer Floating Toggle Button */
.mobile-drawer-toggle {
    display: none;
    position: absolute;
    bottom: max(20px, calc(16px + env(safe-area-inset-bottom)));
    left: 50%;
    transform: translateX(-50%);
    z-index: 700;
    background: var(--panel-backdrop);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border-medium);
    border-radius: 9999px;
    padding: 9px 18px 9px 14px;
    color: var(--text-pure);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--brand-glow);
    cursor: pointer;
    align-items: center;
    gap: 9px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    touch-action: manipulation;
}

.mobile-drawer-toggle:active {
    transform: translateX(-50%) scale(0.96);
}

.mobile-toggle-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--brand-glow);
    color: var(--brand-accent);
    font-size: 11px;
}

.mobile-toggle-badge {
    background: var(--brand-accent);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 9999px;
    font-family: var(--font-mono);
}

/* ==========================================================================
   Floating Map Appearance & Layer Controls
   ========================================================================== */

.map-floating-controls {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 500;
    font-family: var(--font-sans);
}

.map-control-btn {
    background: var(--panel-backdrop);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 7px 13px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition-theme);
}

.map-control-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-strong);
    color: var(--text-pure);
}

.map-layers-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 285px;
    background: var(--panel-backdrop);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 14px;
    z-index: 501;
    color: var(--text-primary);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
}

.map-layers-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.panel-title {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.panel-close-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 12px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.panel-close-btn:hover {
    color: var(--text-pure);
}

.panel-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.panel-section-title {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.basemap-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.basemap-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.basemap-option:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-medium);
}

.basemap-option.active {
    background: var(--bg-card-hover);
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 1px var(--brand-accent);
}

.basemap-badge {
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
}

.basemap-meta {
    display: flex;
    flex-direction: column;
}

.basemap-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.basemap-sub {
    font-size: 10px;
    color: var(--text-tertiary);
}

.panel-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 10px 0;
}

.toggle-option-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.toggle-info {
    display: flex;
    flex-direction: column;
}

.toggle-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-caption {
    font-size: 10px;
    color: var(--text-tertiary);
}

/* Minimal Switch Toggle */
.switch-control {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.switch-control input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-strong);
    border-radius: 20px;
    transition: background-color 0.2s ease;
}

.switch-track::before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
}

.switch-control input:checked + .switch-track {
    background-color: var(--brand-accent);
}

.switch-control input:checked + .switch-track::before {
    transform: translateX(14px);
}

.color-mode-pills {
    display: flex;
    gap: 6px;
}

.color-pill {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 6px 0;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.color-pill:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.color-pill.active {
    background: var(--bg-card-hover);
    border-color: var(--brand-accent);
    color: var(--text-pure);
    box-shadow: 0 0 0 1px var(--brand-accent);
}

/* ==========================================================================
   Slide-Over Detail Sheet (Desktop & Tablet)
   ========================================================================== */

.detail-sheet {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 440px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-subtle);
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.5);
    z-index: 950;
    transform: translateX(105%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

[data-theme="light"] .detail-sheet {
    box-shadow: -10px 0 35px rgba(15, 23, 42, 0.12);
}

.detail-sheet.active {
    transform: translateX(0);
}

.sheet-header {
    height: var(--nav-height);
    padding: 0 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sheet-category-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.sheet-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sheet-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s ease;
}

.sheet-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-medium);
    color: var(--text-pure);
}

.sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sheet-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    color: var(--text-pure);
    line-height: 1.35;
    letter-spacing: -0.01em;
}

/* Info List */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
}

.info-label {
    color: var(--text-tertiary);
    font-weight: 500;
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
    font-family: var(--font-mono);
    font-size: 12px;
}

.sheet-narrative {
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-secondary);
}

.sheet-source {
    font-size: 11.5px;
    color: var(--text-tertiary);
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.sheet-footer-btn {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.sheet-footer-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--brand-accent);
    color: var(--text-pure);
}

/* ==========================================================================
   Responsive & Mobile Polish
   ========================================================================== */

@media (max-width: 900px) {
    .brand-sub,
    .nav-caption {
        display: none;
    }
    :root {
        --sidebar-width: 340px;
    }
}

@media (max-width: 768px) {
    /* Navbar compact optimization */
    .navbar {
        padding: 0 12px;
        height: 52px;
    }

    .brand-sub {
        display: none;
    }

    .brand-title-row .logo-text {
        font-size: 14.5px;
    }

    .metrics-pill {
        height: 32px;
        padding: 0 9px;
        font-size: 11px;
        gap: 6px;
    }

    .metric-label {
        display: none;
    }

    .metric-sep {
        margin: 0 1px;
    }

    .nav-actions {
        gap: 6px;
    }

    .nav-btn {
        height: 32px;
        padding: 0 8px;
        min-height: 32px;
    }

    .nav-btn span {
        display: none; /* Icon-only on mobile navbar to save critical horizontal space */
    }

    .nav-btn i {
        margin: 0;
        font-size: 13px;
    }

    /* App Layout */
    .app-layout {
        height: calc(100vh - 50px);
        height: calc(100dvh - 50px);
    }

    /* Mobile Backdrop */
    .mobile-backdrop {
        display: block;
    }

    /* Floating drawer toggle button */
    .mobile-drawer-toggle {
        display: inline-flex;
    }

    /* Touch handles & mobile title bars */
    .drawer-drag-area {
        display: flex;
    }

    .drawer-mobile-bar {
        display: flex;
    }

    /* Sidebar transforms into Modern Bottom Sheet Touch Drawer */
    .sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        max-width: 100%;
        height: 84vh;
        max-height: calc(100dvh - 46px);
        background: var(--bg-surface);
        border-top: 1px solid var(--border-medium);
        border-right: none;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.7);
        transform: translateY(102%);
        transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 850;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .sidebar.show {
        transform: translateY(0);
    }

    /* Hide floating toggle pill when drawer is open */
    .sidebar.show ~ .mobile-drawer-toggle,
    body.drawer-open .mobile-drawer-toggle {
        opacity: 0;
        pointer-events: none;
        transform: translateX(-50%) translateY(24px);
    }

    .sidebar-pinned-top {
        padding: 8px 14px 10px 14px;
        gap: 8px;
    }

    .sidebar-scroll-body {
        padding: 10px 14px max(36px, env(safe-area-inset-bottom, 36px)) 14px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
    }

    /* Touch friendly sizes & Safari iOS zoom prevention (minimum 16px for input) */
    .search-input {
        font-size: 16px !important;
        padding: 9px 34px 9px 34px;
    }

    .minimal-select {
        font-size: 14px;
        padding: 8px 28px 8px 10px;
        min-height: 38px;
    }

    .tab-btn {
        padding: 7px 10px;
        font-size: 12px;
        min-height: 34px;
    }

    .cat-pill {
        padding: 6px 13px;
        font-size: 12px;
        min-height: 32px;
    }

    .event-item {
        padding: 12px 16px;
    }

    /* Detail Sheet as Mobile Bottom Sheet */
    .detail-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        max-width: 100%;
        height: 86vh;
        max-height: calc(100dvh - 46px);
        background: var(--bg-surface);
        border-top: 1px solid var(--border-medium);
        border-left: none;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.7);
        transform: translateY(102%);
        transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 900;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .detail-sheet.active {
        transform: translateY(0);
    }

    .detail-sheet .sheet-header {
        padding: 6px 18px 10px 18px;
    }

    .detail-sheet .sheet-body {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        padding: 14px 18px max(34px, env(safe-area-inset-bottom, 34px)) 18px;
    }

    .sheet-footer-btn {
        padding: 12px 16px;
        font-size: 13px;
    }

    /* Floating Map Appearance Controls */
    .map-floating-controls {
        top: 10px;
        right: 10px;
    }

    .map-control-btn {
        padding: 7px 11px;
        font-size: 11.5px;
        min-height: 36px;
    }

    .map-control-btn .control-label {
        display: none;
    }

    .map-layers-panel {
        width: min(290px, calc(100vw - 20px));
        right: 0;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }

    /* Leaflet zoom controls positioning */
    .leaflet-top.leaflet-left {
        top: 10px;
        left: 10px;
    }

    .admin-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .metrics-pill .metric-item:not(.critical):not(:first-child) {
        display: none;
    }

    .time-tabs .time-tab-btn {
        padding: 5px 6px;
        font-size: 10.5px;
    }
}

/* Vibrant Vector Category Icon Badges */
.cat-vector-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 11px;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.cat-pill .cat-vector-badge {
    width: 20px;
    height: 20px;
    font-size: 10.5px;
    border-radius: 50%;
    margin-right: -1px;
}

.event-category-name .cat-vector-badge {
    width: 24px;
    height: 24px;
    font-size: 11.5px;
    border-radius: 6px;
}

.sheet-category-badge .cat-vector-badge {
    width: 26px;
    height: 26px;
    font-size: 12.5px;
    border-radius: 7px;
}

