/* ==========================================================================
   IndiaLens Design System — Dark Glassmorphism Theme
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-dark: #090D16;
    --bg-card: rgba(15, 23, 42, 0.82);
    --bg-card-hover: rgba(26, 38, 66, 0.92);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-input: rgba(15, 23, 42, 0.85);

    --border-color: rgba(255, 255, 255, 0.12);
    --border-highlight: rgba(255, 255, 255, 0.22);
    --border-glow: rgba(56, 189, 248, 0.45);

    /* Text Colors */
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --text-dim: #64748B;

    /* Accent & Brand Colors */
    --brand-primary: #38BDF8;
    /* Cyan Glow */
    --brand-amber: #F59E0B;
    /* Saffron Gold */
    --brand-emerald: #10B981;
    /* Emerald Green */
    --brand-rose: #F43F5E;
    /* Crimson Rose */
    --brand-purple: #8B5CF6;
    /* Vivid Violet */

    /* Gradients */
    --gradient-brand: linear-gradient(135deg, #38BDF8 0%, #8B5CF6 100%);
    --gradient-amber: linear-gradient(135deg, #F59E0B 0%, #ED8936 100%);
    --gradient-glass: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    --gradient-card: linear-gradient(145deg, rgba(20, 31, 53, 0.88) 0%, rgba(10, 16, 30, 0.95) 100%);

    /* Shadows & Effects */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: inset 0 1px 1px rgba(255, 255, 255, 0.15), 0 12px 30px -5px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 30px rgba(56, 189, 248, 0.22);

    /* Typography */
    --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-numbers: 'Outfit', monospace;

    /* Layout */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Overrides */
body.light-theme {
    --bg-dark: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F1F5F9;
    --bg-glass: rgba(15, 23, 42, 0.04);
    --bg-input: #F1F5F9;

    --border-color: rgba(15, 23, 42, 0.12);
    --border-highlight: rgba(15, 23, 42, 0.22);
    --border-glow: rgba(14, 165, 233, 0.35);

    --text-main: #0F172A;
    --text-muted: #475569;
    --text-dim: #64748B;

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
    --shadow-modal: 0 20px 40px rgba(0, 0, 0, 0.15);
    --gradient-card: linear-gradient(145deg, #FFFFFF 0%, #F1F5F9 100%);

    background: linear-gradient(180deg, #F8FAFC 0%, #E2E8F0 100%) !important;
    color: #0F172A !important;
}

/* Light Theme Component Specific Overrides */
body.light-theme .card,
body.light-theme .kpi-card,
body.light-theme .map-card,
body.light-theme .trend-card,
body.light-theme .catalog-card,
body.light-theme .ai-card {
    background: #FFFFFF !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .kpi-card {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .kpi-label {
    color: #475569 !important;
}

body.light-theme .kpi-value {
    color: #0F172A !important;
}

body.light-theme .kpi-subtext {
    color: #64748B !important;
}

body.light-theme .ai-insight-box {
    background: rgba(245, 158, 11, 0.08) !important;
}

body.light-theme .chart-sub-box {
    background: #F8FAFC !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
}

body.light-theme .ai-highlight-card {
    background: #F8FAFC !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
}

body.light-theme .dataset-card {
    background: #F8FAFC !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
}

body.light-theme .dataset-card:hover {
    background: #FFFFFF !important;
    border-color: var(--brand-primary) !important;
}

body.light-theme .map-container {
    background: #E2E8F0 !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    background: linear-gradient(180deg, rgba(9, 13, 22, 0.80) 0%, rgba(9, 13, 22, 0.92) 100%),
        url('../images/bg_space.png') no-repeat center center fixed;
    background-size: cover;
}

/* Layout Wrappers */
.main-content {
    padding-top: 80px;
    padding-bottom: 60px;
}

.content-container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Header & Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 74px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-container {
    max-width: 1360px;
    margin: 0 auto;
    height: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    cursor: pointer;
}

.logo-emblem {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background-image: url('../images/logo_emblem.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
    border: 1px solid rgba(56, 189, 248, 0.25);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo-emblem:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.5);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.brand-title .highlight {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-tagline {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Nav Actions & Badges */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.api-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.api-status-badge:hover {
    border-color: var(--brand-primary);
    background: rgba(56, 189, 248, 0.1);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--brand-amber);
    box-shadow: 0 0 8px var(--brand-amber);
}

.api-status-badge.live-mode .status-dot {
    background-color: var(--brand-emerald);
    box-shadow: 0 0 8px var(--brand-emerald);
}

.key-icon {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-highlight);
}

.btn-primary {
    background: var(--gradient-brand);
    color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--bg-glass);
    border-color: var(--border-highlight);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* Hero Section */
.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 0 10px;
    gap: 24px;
}

.hero-header {
    max-width: 800px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
    margin-bottom: 12px;
}

.gradient-text {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Universal Search Component */
.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 820px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px 12px 8px 24px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.25);
}

.search-icon {
    font-size: 1.2rem;
    color: var(--brand-primary);
    margin-right: 14px;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--text-main);
}

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

.search-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--gradient-brand);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

/* Search Auto-suggestions */
.search-suggestions {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-modal);
    overflow: hidden;
    z-index: 100;
    display: none;
}

.search-suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.suggestion-item:last-child {
    border-bottom: none;
}

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

.suggestion-text {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 500;
}

.suggestion-text i {
    color: var(--brand-primary);
}

.suggestion-tag {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

/* Preset Search Pills */
.search-pills {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.pill-label {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 500;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.pill:hover,
.pill.active {
    color: var(--text-main);
    border-color: var(--brand-primary);
    background: rgba(56, 189, 248, 0.12);
}

/* Context & Filter Bar */
.context-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.region-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
}

.meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-left: 12px;
}

.category-filters {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--gradient-brand);
    color: #FFFFFF;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

/* Cards & Layout Containers */
.card {
    background: var(--gradient-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12), 0 14px 35px rgba(0, 0, 0, 0.5);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 20px 40px rgba(0, 0, 0, 0.65), 0 0 25px rgba(56, 189, 248, 0.12);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

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

.card-title h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.card-title .icon {
    font-size: 1.2rem;
    color: var(--brand-primary);
}

/* KPI Summary Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.kpi-card {
    position: relative;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-brand);
    opacity: 0.9;
}

.kpi-card:nth-child(1)::before {
    background: linear-gradient(90deg, #38BDF8, #8B5CF6);
}

.kpi-card:nth-child(2)::before {
    background: linear-gradient(90deg, #F43F5E, #FB7185);
}

.kpi-card:nth-child(3)::before {
    background: linear-gradient(90deg, #F59E0B, #FBBF24);
}

.kpi-card:nth-child(4)::before {
    background: linear-gradient(90deg, #10B981, #34D399);
}

.kpi-card:hover {
    transform: translateY(-5px);
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.18);
}

.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kpi-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.kpi-icon-wrapper.blue {
    background: rgba(56, 189, 248, 0.15);
    color: var(--brand-primary);
}

.kpi-icon-wrapper.rose {
    background: rgba(244, 63, 94, 0.15);
    color: var(--brand-rose);
}

.kpi-icon-wrapper.amber {
    background: rgba(245, 158, 11, 0.15);
    color: var(--brand-amber);
}

.kpi-icon-wrapper.emerald {
    background: rgba(16, 185, 129, 0.15);
    color: var(--brand-emerald);
}

.kpi-trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
}

.kpi-trend-badge.up {
    background: rgba(244, 63, 94, 0.15);
    color: var(--brand-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.kpi-trend-badge.down {
    background: rgba(16, 185, 129, 0.15);
    color: var(--brand-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.kpi-trend-badge.neutral {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
}

.kpi-label {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 500;
}

.kpi-value {
    font-family: var(--font-numbers);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

.kpi-subtext {
    font-size: 0.78rem;
    color: var(--text-dim);
}

/* Intelligence Layout (Map + AI) */
.intelligence-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .intelligence-layout {
        grid-template-columns: 1fr;
    }
}

/* Map Card */
.map-card {
    display: flex;
    flex-direction: column;
    min-height: 520px;
    background: linear-gradient(145deg, rgba(14, 165, 233, 0.06) 0%, rgba(10, 16, 30, 0.95) 100%);
    border: 1px solid rgba(56, 189, 248, 0.25);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15), 0 14px 35px rgba(0, 0, 0, 0.55), 0 0 20px rgba(56, 189, 248, 0.08);
}

.map-card:hover {
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 20px 40px rgba(0, 0, 0, 0.65), 0 0 30px rgba(56, 189, 248, 0.2);
}

.trend-card {
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.06) 0%, rgba(10, 16, 30, 0.95) 100%);
    border: 1px solid rgba(139, 92, 246, 0.25);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15), 0 14px 35px rgba(0, 0, 0, 0.55), 0 0 20px rgba(139, 92, 246, 0.08);
}

.trend-card:hover {
    border-color: rgba(139, 92, 246, 0.55);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 20px 40px rgba(0, 0, 0, 0.65), 0 0 30px rgba(139, 92, 246, 0.2);
}

.catalog-card {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.06) 0%, rgba(10, 16, 30, 0.95) 100%);
    border: 1px solid rgba(16, 185, 129, 0.25);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15), 0 14px 35px rgba(0, 0, 0, 0.55), 0 0 20px rgba(16, 185, 129, 0.08);
}

.catalog-card:hover {
    border-color: rgba(16, 185, 129, 0.55);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 20px 40px rgba(0, 0, 0, 0.65), 0 0 30px rgba(16, 185, 129, 0.2);
}

.map-select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
}

.map-container {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 380px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #0B1120;
}

.map-overlay-loader {
    position: absolute;
    inset: 0;
    background: rgba(11, 17, 32, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 500;
    color: var(--brand-primary);
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(56, 189, 248, 0.2);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.map-legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.legend-bar {
    flex: 1;
    height: 8px;
    margin: 0 16px;
    border-radius: 4px;
    background: linear-gradient(90deg, #10B981 0%, #F59E0B 50%, #F43F5E 100%);
}

.legend-values {
    display: flex;
    gap: 16px;
}

/* AI Insights Panel */
.ai-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.08) 0%, rgba(13, 20, 36, 0.95) 100%);
    border: 1px solid rgba(245, 158, 11, 0.28);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15), 0 14px 35px rgba(0, 0, 0, 0.55), 0 0 20px rgba(245, 158, 11, 0.08);
}

.ai-card:hover {
    border-color: rgba(245, 158, 11, 0.55);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 20px 40px rgba(0, 0, 0, 0.65), 0 0 30px rgba(245, 158, 11, 0.22);
}

.ai-sparkle-badge {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--gradient-amber);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.ai-confidence-badge {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--brand-emerald);
    background: rgba(16, 185, 129, 0.12);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.ai-content-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 16px 0;
}

.ai-insight-box {
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid var(--brand-amber);
    padding: 16px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.ai-insight-box p {
    font-size: 0.98rem;
    line-height: 1.6;
    color: var(--text-main);
}

.ai-highlights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ai-highlight-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-highlight-card .title {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.ai-highlight-card .val {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.ai-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-dim);
}

.ai-attribution {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Trend Analytics & Chart Grid */
.chart-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.timeframe-toggle {
    display: flex;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    padding: 3px;
    border-radius: 8px;
}

.time-btn {
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.time-btn.active {
    background: var(--brand-primary);
    color: #FFFFFF;
}

.chart-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 20px;
    margin-top: 16px;
}

.chart-sub-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.chart-box-header h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.chart-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

@media (max-width: 900px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }
}

.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

/* ==========================================================================
   3D Sector Breakdown Visualizer Styles
   ========================================================================== */

.chart-sub-box-3d {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.06) 0%, rgba(10, 16, 30, 0.95) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15), 0 14px 35px rgba(0, 0, 0, 0.55), 0 0 24px rgba(16, 185, 129, 0.08);
    position: relative;
    transition: var(--transition);
}

.chart-sub-box-3d:hover {
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 20px 42px rgba(0, 0, 0, 0.65), 0 0 35px rgba(16, 185, 129, 0.2);
}

.chart-box-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-3d {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    background: linear-gradient(135deg, #10B981, #0EA5E9);
    color: #FFFFFF;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
    vertical-align: middle;
}

.icon-3d-pulse {
    animation: float3dCube 3s ease-in-out infinite alternate;
}

@keyframes float3dCube {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    100% {
        transform: translateY(-3px) rotate(8deg);
    }
}

.controls-3d-group {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.25);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.controls-3d-group.viewport-toolbar {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(10, 16, 30, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.btn-3d-ctrl {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 7px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-body);
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-3d-ctrl:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.btn-3d-ctrl.active {
    background: rgba(16, 185, 129, 0.18);
    color: #34D399;
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.btn-3d-ctrl i {
    font-size: 0.8rem;
}

.chart-container-3d {
    position: relative;
    width: 100%;
    height: 310px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: radial-gradient(circle at 50% 40%, rgba(16, 185, 129, 0.08) 0%, rgba(8, 14, 28, 0.95) 75%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    cursor: grab;
}

.chart-container-3d:active {
    cursor: grabbing;
}

.chart-container-3d canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* 3D Glassmorphic Floating Tooltip */
.sector-3d-tooltip {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -120%) scale(0.92);
    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 ease;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.65), 0 0 24px rgba(56, 189, 248, 0.25);
    z-index: 100;
    min-width: 150px;
}

.sector-3d-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -120%) scale(1);
}

.sector-3d-tooltip-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #38BDF8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.sector-3d-tooltip-value {
    font-family: var(--font-numbers);
    font-size: 1.4rem;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.1;
}

.sector-3d-tooltip-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Dynamic 3D Interactive Legend */
.sector-3d-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.sec-3d-legend-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    transition: all 0.25 ease;
}

.sec-3d-legend-item:hover,
.sec-3d-legend-item.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(56, 189, 248, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.sec-3d-legend-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.sec-3d-legend-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
}

.sec-3d-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px currentColor;
}

.sec-3d-legend-val {
    font-family: var(--font-numbers);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
}

.sec-3d-progress-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.sec-3d-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Overrides for 3D Sector Visualizer */
body.light-theme .chart-sub-box-3d {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.08) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
}

body.light-theme .chart-container-3d {
    background: radial-gradient(circle at 50% 40%, rgba(16, 185, 129, 0.06) 0%, rgba(241, 245, 249, 0.95) 75%);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .controls-3d-group {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .btn-3d-ctrl {
    color: #475569;
}

body.light-theme .btn-3d-ctrl:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #0F172A;
}

body.light-theme .sector-3d-tooltip {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(2, 132, 199, 0.4);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.15), 0 0 20px rgba(2, 132, 199, 0.15);
}

body.light-theme .sector-3d-tooltip-value {
    color: #0F172A;
}

body.light-theme .sec-3d-legend-item {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .sec-3d-legend-item:hover,
body.light-theme .sec-3d-legend-item.active {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(2, 132, 199, 0.5);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* Related Government Datasets Catalog */
.catalog-badge {
    font-size: 0.8rem;
    color: var(--brand-primary);
    background: rgba(56, 189, 248, 0.1);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.dataset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 18px;
}

.dataset-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    transition: var(--transition);
}

.dataset-card:hover {
    border-color: var(--brand-primary);
    background: rgba(255, 255, 255, 0.05);
}

.dataset-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.dataset-title {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.4;
}

.format-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.15);
    color: var(--brand-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.dataset-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dataset-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.dataset-actions {
    display: flex;
    gap: 8px;
}

/* Modal styling */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    padding: 24px;
    box-shadow: var(--shadow-modal);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

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

.modal-title h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-icon {
    color: var(--brand-amber);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 14px 0;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.input-with-icon {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 14px;
}

.input-with-icon i {
    color: var(--text-dim);
    margin-right: 10px;
}

.input-with-icon input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 0;
    color: var(--text-main);
    outline: none;
    font-family: var(--font-body);
}

.input-help {
    font-size: 0.78rem;
    color: var(--text-dim);
}

.input-help a {
    color: var(--brand-primary);
    text-decoration: none;
}

.modal-info-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    color: var(--brand-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 40px 0;
}

.footer-container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-left p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-dim);
}

.footer-right a {
    color: var(--brand-primary);
    text-decoration: none;
}

/* ==========================================================================
   Map HUD & District Labels Enhancements
   ========================================================================== */

.map-hud-overlay {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 270px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: var(--shadow-md);
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

/* Map Controls Header & Tile Switcher */
.map-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.map-tile-switcher {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 2px;
    border-radius: 8px;
}

.tile-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.tile-btn.active,
.tile-btn:hover {
    background: var(--brand-primary);
    color: #FFFFFF;
}

/* Animated District Radar Beacons */
.district-beacon-wrapper {
    background: transparent !important;
    border: none !important;
}

.beacon-pin {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.beacon-pulse {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid;
    animation: beaconPulse 1.8s infinite ease-out;
    opacity: 0;
}

@keyframes beaconPulse {
    0% {
        transform: scale(0.3);
        opacity: 0.9;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* ==========================================================================
   Live Resource Explorer Modal & Table Styles
   ========================================================================== */

.explorer-modal {
    max-width: 960px;
    width: 90%;
    background: var(--bg-card);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    overflow: hidden;
}

.explorer-query-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.preset-pills-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.preset-pills-bar .lbl {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.preset-pills-bar .pill-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.preset-pills-bar .pill-btn:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.explorer-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.table-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.table-search {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-search input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    color: var(--text-main);
    font-size: 0.82rem;
}

.explorer-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 420px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-body);
}

.explorer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    text-align: left;
}

.explorer-table th,
.explorer-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.explorer-table th {
    background: rgba(15, 23, 42, 0.95);
    color: var(--brand-primary);
    font-family: var(--font-heading);
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 10;
}

.explorer-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
    gap: 12px;
}

.icon-large {
    font-size: 2.2rem;
    color: var(--brand-primary);
}


.hud-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.hud-icon {
    color: var(--brand-primary);
    font-size: 1rem;
}

.hud-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hud-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.hud-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hud-stat .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.hud-stat .val {
    font-family: var(--font-numbers);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.hud-footer {
    font-size: 0.72rem;
    color: var(--brand-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 4px;
}

/* Map District Labels */
.district-map-label {
    background: transparent !important;
    border: none !important;
}

.district-map-label span {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 800;
    color: #FFFFFF;
    background: rgba(11, 17, 32, 0.85);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.2px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    user-select: none;
}

body.light-theme .district-map-label span {
    color: #0F172A;
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(15, 23, 42, 0.18);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    text-shadow: none;
}

.map-tooltip-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: var(--font-heading);
    color: #FFFFFF;
    font-size: 0.85rem;
}

.map-tooltip-card strong {
    font-size: 0.95rem;
    color: var(--brand-primary);
}

.tooltip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Threat Matrix & Hazard Engine Slide-Out Drawer
   ========================================================================== */

.threat-counter-badge {
    background: var(--brand-rose);
    color: #FFFFFF;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.5);
    margin-left: 4px;
}

.text-rose {
    color: var(--brand-rose) !important;
}

.icon-rose {
    color: var(--brand-rose);
    font-size: 1.4rem;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(9, 13, 22, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.threat-drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 440px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-highlight);
    box-shadow: var(--shadow-modal);
    z-index: 1250;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.threat-drawer.active {
    right: 0;
}

.drawer-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.drawer-title h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.drawer-subtitle {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.drawer-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    transition: var(--transition);
}

.drawer-close:hover {
    color: var(--text-main);
}

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

.threat-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    transition: var(--transition);
}

.alert-card.CRITICAL {
    border-color: rgba(244, 63, 94, 0.5);
    background: rgba(244, 63, 94, 0.08);
}

.alert-card.WARNING {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.06);
}

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

.alert-severity-badge {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.alert-severity-badge.CRITICAL {
    background: var(--brand-rose);
    color: #FFFFFF;
}

.alert-severity-badge.WARNING {
    background: var(--brand-amber);
    color: #0F172A;
}

.alert-card-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-main);
}

.alert-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.alert-recommendation {
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.4;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 6px;
    margin-top: 2px;
}

.config-section {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.threshold-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.control-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.val-badge {
    font-family: var(--font-numbers);
    color: var(--brand-primary);
    font-weight: 700;
}

.threshold-control input[type="range"] {
    width: 100%;
    accent-color: var(--brand-primary);
    cursor: pointer;
}

/* ==========================================================================
   Dual-Region Benchmarking Suite Styles
   ========================================================================== */

.compare-modal {
    max-width: 1060px;
    width: 92vw;
    max-height: 88vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
}

.compare-modal .modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

.compare-modal .modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(88vh - 75px);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.compare-selectors-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.selector-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.selector-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.compare-select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-highlight);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 600;
    outline: none;
    transition: var(--transition);
}

.compare-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
}

.vs-emblem {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: #FFFFFF;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
    margin-top: 18px;
}

.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 840px) {
    .compare-grid {
        grid-template-columns: 1fr;
    }
}

.compare-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.compare-card h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.compare-kpis-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.compare-kpi-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.compare-kpi-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
}

.compare-kpi-vals {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-numbers);
    font-size: 0.9rem;
}

.val-a {
    color: var(--brand-primary);
    font-weight: 700;
}

.val-b {
    color: var(--brand-amber);
    font-weight: 700;
}

.delta-badge {
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
}

.delta-badge.higher {
    background: rgba(244, 63, 94, 0.15);
    color: var(--brand-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.delta-badge.lower {
    background: rgba(16, 185, 129, 0.15);
    color: var(--brand-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.radar-container {
    position: relative;
    width: 100%;
    height: 280px;
}

.ai-contrast-container {
    background: var(--bg-card);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.ai-contrast-header {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--text-main);
    margin-bottom: 8px;
}

.ai-contrast-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 768px) {
    .ai-contrast-grid {
        grid-template-columns: 1fr;
    }
}

.contrast-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 14px;
}

.contrast-card.region-a {
    border-left: 3px solid var(--brand-primary);
}

.contrast-card.region-b {
    border-left: 3px solid var(--brand-amber);
}

.contrast-card h4 {
    font-size: 0.92rem;
    margin-bottom: 10px;
}

.contrast-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ==========================================================================
   Comprehensive Responsive System (Mobile 320px to 4K 3840px)
   ========================================================================== */

/* --- 1. Ultra-Wide & 4K Displays (1800px – 3840px+) --- */
@media (min-width: 1800px) {

    .content-container,
    .nav-container,
    .footer-container {
        max-width: 1720px;
    }

    .hero-title {
        font-size: 3.4rem;
    }

    .map-container {
        min-height: 560px;
    }

    .chart-container {
        height: 360px;
    }
}

@media (min-width: 2560px) {

    .content-container,
    .nav-container,
    .footer-container {
        max-width: 2280px;
    }

    .hero-title {
        font-size: 4.2rem;
    }

    .hero-subtitle {
        font-size: 1.4rem;
    }

    .kpi-value {
        font-size: 2.8rem;
    }

    .map-container {
        min-height: 680px;
    }

    .chart-container {
        height: 440px;
    }

    .radar-container {
        height: 380px;
    }
}

@media (min-width: 3200px) {

    .content-container,
    .nav-container,
    .footer-container {
        max-width: 2800px;
    }

    .hero-title {
        font-size: 5rem;
    }
}

/* --- 2. Laptops & Mid-Desktops (1025px – 1440px) --- */
@media (max-width: 1360px) {

    .content-container,
    .nav-container,
    .footer-container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* --- 3. Tablets & Small Laptops (769px – 1024px) --- */
@media (max-width: 1024px) {
    .brand-tagline {
        display: none;
    }

    .hero-title {
        font-size: 2.3rem;
    }

    .intelligence-layout {
        grid-template-columns: 1fr;
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }

    .dataset-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .map-card {
        min-height: 480px;
    }
}

/* --- 4. Mobile Landscapes & Mid Tablets (641px – 768px) --- */
@media (max-width: 768px) {
    .navbar {
        height: 68px;
    }

    .main-wrapper {
        padding-top: 76px;
    }

    .nav-actions .btn-text-label {
        display: none;
    }

    .nav-actions .btn-ghost {
        padding: 8px 12px;
    }

    .status-text {
        display: none;
    }

    .api-status-badge {
        padding: 8px 10px;
    }

    .hero-title {
        font-size: 2.0rem;
    }

    .search-box {
        padding: 6px 10px 6px 16px;
    }

    .context-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .category-filters {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
        white-space: nowrap;
    }

    .category-filters::-webkit-scrollbar {
        height: 3px;
    }

    .category-filters::-webkit-scrollbar-thumb {
        background: var(--brand-primary);
        border-radius: 3px;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .ai-highlights-grid {
        grid-template-columns: 1fr;
    }

    .compare-grid {
        grid-template-columns: 1fr;
    }

    .ai-contrast-grid {
        grid-template-columns: 1fr;
    }
}

/* --- 5. Mobile Portrait Phones (320px – 640px) --- */
@media (max-width: 640px) {
    .navbar {
        height: 64px;
    }

    .nav-container {
        padding: 0 12px;
    }

    .brand-title {
        font-size: 1.15rem;
    }

    .logo-emblem {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }

    .logo-icon {
        font-size: 16px;
    }

    .nav-actions {
        gap: 6px;
    }

    .btn-ghost {
        padding: 6px 8px;
        font-size: 0.8rem;
    }

    .btn-icon {
        width: 36px;
        height: 36px;
    }

    .hero-section {
        padding: 16px 0 6px;
        gap: 16px;
    }

    .hero-title {
        font-size: 1.65rem;
        letter-spacing: -0.5px;
    }

    .hero-subtitle {
        font-size: 0.92rem;
    }

    .search-box {
        padding: 4px 6px 4px 12px;
    }

    .search-box input {
        font-size: 0.9rem;
    }

    .search-btn span {
        display: none;
    }

    .search-btn {
        padding: 10px 14px;
    }

    .search-pills {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 4px;
        flex-wrap: nowrap;
        width: 100%;
    }

    .pill {
        white-space: nowrap;
    }

    .region-title {
        font-size: 1.3rem;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .kpi-card {
        padding: 14px;
        gap: 8px;
    }

    .kpi-icon-wrapper {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }

    .kpi-value {
        font-size: 1.5rem;
    }

    .kpi-label {
        font-size: 0.78rem;
    }

    .map-card {
        min-height: 420px;
        padding: 14px;
    }

    .map-container {
        min-height: 320px;
    }

    .map-hud-overlay {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        margin-bottom: 10px;
    }

    .hud-body {
        grid-template-columns: repeat(3, 1fr);
    }

    .threat-drawer {
        width: 100%;
        right: -100%;
    }

    .compare-modal,
    .explorer-modal {
        width: 96vw;
        max-height: 92vh;
        border-radius: var(--radius-md);
    }

    .compare-selectors-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .vs-emblem {
        margin: 0 auto;
    }

    .compare-kpi-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .compare-kpi-vals {
        width: 100%;
        justify-content: space-between;
    }

    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-right {
        align-items: center;
    }
}

/* --- 6. Ultra-Small Phones (320px – 380px) --- */
@media (max-width: 380px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .brand-title {
        font-size: 1rem;
    }

    .hero-title {
        font-size: 1.45rem;
    }
}