/* ── Section 1: Content Protection ── */
/* Disable text selection across entire page */
        * {
            -webkit-user-select: none !important;
            -moz-user-select: none !important;
            -ms-user-select: none !important;
            user-select: none !important;
            -webkit-touch-callout: none !important;
        }

        /* Disable drag on images and links */
        img,
        a {
            -webkit-user-drag: none !important;
            -khtml-user-drag: none !important;
            -moz-user-drag: none !important;
            -o-user-drag: none !important;
            user-drag: none !important;
            pointer-events: none !important;
        }

        /* Allow pointer events on interactive elements only */
        button,
        input,
        select,
        textarea,
        [role="button"],
        .main-tab,
        .sub-tab,
        .time-filter-btn,
        .control-btn,
        .export-report-btn,
        .print-modal-close,
        .print-option-btn,
        #dept-report-panel,
        #dept-report-panel *,
        #dept-report-select,
        .filter-btn,
        .legend-btn,
        .map-controls,
        .leaflet-container,
        .leaflet-container *,
        .print-modal-overlay,
        .print-modal-overlay *,
        #dept-detail-modal,
        #dept-detail-modal *,
        .dwbu-chip,
        [id$="-search"],
        [id$="-sort"],
        [id$="-reset"],
        .leaflet-popup-content img,
        .leaflet-popup-content a,
        .data-table img,
        #photo-lightbox img,
        #photo-lightbox-error a,
        #draw-panel,
        #draw-panel *,
        .map-export-overlay,
        .map-export-overlay *,
        .map-export-btn,
        .map-bottom-filters,
        .map-bottom-filters *,
        .mbf-dropdown-wrap,
        .mbf-dropdown-wrap *,
        .mbf-panel,
        .mbf-panel * {
            pointer-events: auto !important;
        }

        /* Nainital boundary tooltip */
        .nainital-boundary-tooltip {
            background: rgba(10, 15, 30, 0.88) !important;
            border: 1px solid rgba(14, 165, 233, 0.4) !important;
            border-radius: 6px !important;
            padding: 4px 10px !important;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
            pointer-events: none;
        }

        .nainital-boundary-tooltip::before {
            display: none !important;
        }

        /* Screenshot overlay — invisible canvas on top to break screenshot tools */
        #_protection_overlay {
            display: none;
        }

/* ================================================================ */

/* ── Section 2: Core Styles ── */
:root {
            --primary-dark: #0a0f1e;
            --secondary-dark: #151b2e;
            --card-bg: #1a2235;
            --elevated-bg: #202940;
            --accent-blue: #0ea5e9;
            --accent-green: #10b981;
            --accent-orange: #f59e0b;
            --accent-red: #ef4444;
            --accent-purple: #8b5cf6;
            --text-primary: #f1f5f9;
            --text-secondary: #94a3b8;
            --text-muted: #64748b;
            --border-color: rgba(148, 163, 184, 0.1);
            --success: #22c55e;
            --warning: #eab308;
            --danger: #dc2626;
        }

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

        body {
            font-family: 'IBM Plex Sans', sans-serif;
            background: var(--primary-dark);
            color: var(--text-primary);
            line-height: 1.6;
            overflow-x: hidden;
        }

        /* Subtle Background — static, no fixed compositing cost */
        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background:
                radial-gradient(circle at 20% 30%, rgba(14, 165, 233, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
            z-index: 0;
            pointer-events: none;
            will-change: auto;
        }

        /* Header */
        .header {
            position: sticky;
            top: 0;
            z-index: 1000;
            background: rgba(10, 15, 30, 0.98);
            border-bottom: 1px solid var(--border-color);
            box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
        }

        .header-container {
            max-width: 1920px;
            margin: 0 auto;
            padding: 1rem 2.5rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .logo-section {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .logo {
            width: 48px;
            height: 48px;
            background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'JetBrains Mono', monospace;
            font-weight: 700;
            font-size: 1.2rem;
            color: white;
            box-shadow: 0 8px 24px rgba(14, 165, 233, 0.3);
        }

        .logo-text h1 {
            font-family: 'Playfair Display', serif;
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .logo-text p {
            font-size: 0.7rem;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.15em;
        }

        .sync-badge {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            padding: 0.6rem 1.2rem;
            background: rgba(16, 185, 129, 0.1);
            border: 1px solid rgba(16, 185, 129, 0.3);
            border-radius: 8px;
            font-size: 0.85rem;
            color: var(--accent-green);
            font-weight: 600;
        }

        .export-report-btn {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            padding: 0.6rem 1.4rem;
            background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
            border: none;
            border-radius: 8px;
            font-size: 0.85rem;
            color: white;
            font-weight: 700;
            cursor: pointer;
            transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
            box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
            font-family: 'IBM Plex Sans', sans-serif;
        }

        .export-report-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
            background: linear-gradient(135deg, #38bdf8, #a78bfa);
        }

        .export-report-btn:active {
            transform: translateY(0);
        }

        /* Print Modal */
        .print-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.75);
            z-index: 9999;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(8px);
        }

        .print-modal-overlay.active {
            display: flex;
        }

        .print-modal {
            background: var(--secondary-dark);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            padding: 2.5rem;
            max-width: 520px;
            width: 90%;
            box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
        }

        .print-modal h2 {
            font-family: 'Playfair Display', serif;
            font-size: 1.6rem;
            color: var(--text-primary);
            margin-bottom: 0.5rem;
        }

        .print-modal p {
            color: var(--text-secondary);
            font-size: 0.9rem;
            margin-bottom: 1.5rem;
        }

        .print-options {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            margin-bottom: 1.5rem;
        }

        .print-option-btn {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1rem 1.2rem;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            cursor: pointer;
            transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
            text-align: left;
            font-family: 'IBM Plex Sans', sans-serif;
            color: var(--text-primary);
            width: 100%;
        }

        .print-option-btn:hover {
            border-color: var(--accent-blue);
            background: rgba(14, 165, 233, 0.08);
            transform: translateX(4px);
        }

        .print-option-icon {
            font-size: 1.8rem;
            flex-shrink: 0;
        }

        .print-option-title {
            font-weight: 700;
            font-size: 0.95rem;
            margin-bottom: 0.2rem;
        }

        .print-option-desc {
            font-size: 0.78rem;
            color: var(--text-muted);
        }

        .print-modal-close {
            width: 100%;
            padding: 0.75rem;
            background: var(--elevated-bg);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            color: var(--text-secondary);
            cursor: pointer;
            font-family: 'IBM Plex Sans', sans-serif;
            font-size: 0.9rem;
            transition: background-color 0.2s ease, color 0.2s ease;
        }

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

        /* Print-specific styles */
        @media print {
            body {
                background: white !important;
                color: black !important;
            }

            .header,
            .main-tabs,
            .sub-nav {
                display: none !important;
            }

            .print-modal-overlay,
            .overall-gis-overlay {
                display: none !important;
            }

            .tab-content {
                display: block !important;
                page-break-before: always;
            }

            .sub-content {
                display: block !important;
            }

            .export-report-btn {
                display: none !important;
            }

            .chart-card,
            .projects-table-container,
            .map-section,
            .budget-overview {
                break-inside: avoid;
            }

            .data-table {
                font-size: 0.7rem;
            }

            .data-table th,
            .data-table td {
                padding: 0.4rem 0.6rem;
            }

            #print-report-area {
                display: block !important;
            }
        }

        .sync-dot {
            width: 8px;
            height: 8px;
            background: var(--accent-green);
            border-radius: 50%;
            animation: pulse 2s ease-in-out infinite;
            will-change: opacity;
        }

        @keyframes pulse {

            0%,
            100% {
                opacity: 1;
            }

            50% {
                opacity: 0.5;
            }
        }

        /* Main Navigation Tabs */
        .main-tabs {
            background: var(--secondary-dark);
            border-bottom: 1px solid var(--border-color);
            position: sticky;
            top: 65px;
            z-index: 999;
        }

        .main-tabs-container {
            max-width: 1920px;
            margin: 0 auto;
            padding: 0 2.5rem;
            display: flex;
            gap: 2rem;
        }

        .main-tab {
            padding: 1.25rem 2rem;
            background: transparent;
            border: none;
            color: var(--text-secondary);
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            position: relative;
            transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
            border-bottom: 3px solid transparent;
        }

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

        .main-tab.active {
            color: var(--accent-blue);
            border-bottom-color: var(--accent-blue);
        }

        /* Sub Navigation */
        .sub-nav {
            background: var(--card-bg);
            border-bottom: 1px solid var(--border-color);
            position: sticky;
            top: 115px;
            z-index: 998;
        }

        .sub-nav-container {
            max-width: 1920px;
            margin: 0 auto;
            padding: 0 2.5rem;
            display: flex;
            gap: 1.5rem;
            overflow-x: auto;
        }

        .sub-tab {
            padding: 1rem 1.5rem;
            background: transparent;
            border: none;
            color: var(--text-secondary);
            font-size: 0.85rem;
            font-weight: 500;
            cursor: pointer;
            position: relative;
            transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
            white-space: nowrap;
        }

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

        .sub-tab.active {
            color: var(--accent-blue);
            background: rgba(14, 165, 233, 0.1);
        }

        /* Container */
        .container {
            max-width: 1920px;
            margin: 0 auto;
            padding: 2.5rem;
            position: relative;
            z-index: 1;
        }

        /* ── Uniform 2rem gap between every direct section block ── */
        .sub-content>* {
            margin-bottom: 2rem;
        }

        .sub-content>*:last-child {
            margin-bottom: 0;
        }

        /* Reset any inline margin-top overrides on fund-type cards */
        .chart-card[style*="margin-top"] {
            margin-top: 0 !important;
        }

        /* Tab Content */
        .tab-content {
            display: none;
            contain: layout style;
        }

        .tab-content.active {
            display: block;
            animation: fadeIn 0.3s ease-out;
        }

        .sub-content {
            display: none;
            contain: layout style;
        }

        .sub-content.active {
            display: block;
            animation: fadeIn 0.3s ease-out;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        /* Budget Overview Cards */
        .budget-overview {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2.5rem;
        }

        .budget-card {
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 2rem;
            position: relative;
            overflow: hidden;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            will-change: transform;
        }

        .budget-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 4px;
            height: 100%;
            background: var(--accent-blue);
        }

        .budget-card.district::before {
            background: var(--accent-blue);
        }

        .budget-card.state::before {
            background: var(--accent-green);
        }

        .budget-card.central::before {
            background: var(--accent-orange);
        }

        .budget-card.total::before {
            background: var(--accent-purple);
        }

        .budget-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
        }

        .budget-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 1.5rem;
        }

        .budget-label {
            font-size: 0.8rem;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.1em;
            font-weight: 600;
        }

        .budget-icon {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.3rem;
        }

        .budget-amount {
            font-family: 'JetBrains Mono', monospace;
            font-size: 2rem;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 0.5rem;
        }

        .budget-details {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1rem;
            margin-top: 1.5rem;
            padding-top: 1.5rem;
            border-top: 1px solid var(--border-color);
        }

        .budget-detail {
            display: flex;
            flex-direction: column;
        }

        .budget-detail-label {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-bottom: 0.25rem;
        }

        .budget-detail-value {
            font-family: 'JetBrains Mono', monospace;
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .budget-progress {
            margin-top: 1rem;
        }

        .progress-label {
            display: flex;
            justify-content: space-between;
            font-size: 0.75rem;
            color: var(--text-secondary);
            margin-bottom: 0.5rem;
        }

        .progress-bar {
            width: 100%;
            height: 8px;
            background: var(--elevated-bg);
            border-radius: 4px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
            border-radius: 4px;
            transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
        }

        /* Time Period Filter */
        .time-filter {
            display: flex;
            gap: 1rem;
            margin-bottom: 2rem;
            background: var(--card-bg);
            padding: 1rem;
            border-radius: 10px;
            border: 1px solid var(--border-color);
        }

        .time-filter-btn {
            padding: 0.6rem 1.2rem;
            background: transparent;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            color: var(--text-secondary);
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
        }

        .time-filter-btn:hover {
            border-color: var(--accent-blue);
            color: var(--accent-blue);
        }

        .time-filter-btn.active {
            background: var(--accent-blue);
            border-color: var(--accent-blue);
            color: white;
        }

        /* OpenStreetMap Container */
        .map-section {
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 2rem;
            margin-bottom: 2.5rem;
        }

        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
        }

        .section-title {
            font-family: 'Playfair Display', serif;
            font-size: 1.8rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .map-controls {
            display: flex;
            gap: 1rem;
        }

        .control-btn {
            padding: 0.6rem 1.2rem;
            background: var(--elevated-bg);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            color: var(--text-secondary);
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
        }

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

        /* Map Legend */
        .map-legend {
            background: var(--elevated-bg);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
        }

        .legend-title {
            font-weight: 700;
            font-size: 1rem;
            color: var(--text-primary);
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .legend-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem;
            background: var(--card-bg);
            border-radius: 6px;
            transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
        }

        .legend-item:hover {
            background: var(--elevated-bg);
            transform: translateX(4px);
        }

        .legend-marker {
            width: 16px;
            height: 16px;
            border-radius: 50%;
            border: 2px solid #fff;
            flex-shrink: 0;
        }

        .legend-marker.completed {
            background: #22c55e;
        }

        .legend-marker.ongoing {
            background: #eab308;
        }

        .legend-marker.delayed {
            background: #dc2626;
        }

        .legend-marker.planned {
            background: #64748b;
        }

        .legend-marker.duplicate {
            background: #ef4444;
            border-style: dashed;
        }

        .legend-label {
            flex: 1;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .legend-name {
            font-size: 0.85rem;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .legend-count {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.9rem;
            font-weight: 700;
            color: var(--text-primary);
            background: var(--primary-dark);
            padding: 0.25rem 0.6rem;
            border-radius: 4px;
        }

        #district-map,
        #state-map,
        #central-map,
        #otherfund-map {
            width: 100%;
            height: 600px;
            border-radius: 10px;
            border: 1px solid var(--border-color);
        }

        /* Map Overlay Controls */
        .map-north-arrow {
            position: absolute;
            top: 250px;
            right: 10px;
            width: 36px;
            height: 36px;
            background: var(--card-bg);
            border: 2px solid var(--border-color);
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
            z-index: 1000;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
            cursor: default;
            font-weight: bold;
            color: var(--text-primary);
        }


        .map-satellite-btn {
            position: absolute;
            bottom: 68px;
            right: 10px;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 0.5rem 0.75rem;
            z-index: 1001;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
            font-size: 0.72rem;
            color: var(--text-secondary);
            font-family: 'JetBrains Mono', monospace;
            cursor: pointer;
            transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
            font-weight: 600;
            white-space: nowrap;
        }

        .map-satellite-btn:hover {
            background: var(--elevated-bg);
            border-color: var(--accent-blue);
            color: var(--accent-blue);
        }

        .map-satellite-btn.satellite-active {
            background: rgba(14, 165, 233, 0.15);
            border-color: var(--accent-blue);
            color: var(--accent-blue);
        }

        .map-scale-control {
            position: absolute;
            bottom: 30px;
            right: 10px;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 0.5rem 0.75rem;
            z-index: 1000;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
            font-size: 0.75rem;
            color: var(--text-secondary);
            font-family: 'JetBrains Mono', monospace;
        }

        .map-fullscreen-btn {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 36px;
            height: 36px;
            background: var(--card-bg);
            border: 2px solid var(--border-color);
            border-radius: 4px;
            padding: 0;
            z-index: 1000;
            cursor: pointer;
            font-size: 1.1rem;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
            transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-primary);
        }

        .map-fullscreen-btn:hover {
            background: var(--elevated-bg);
            border-color: var(--accent-blue);
        }

        .map-overlay-controls {
            position: absolute;
            top: 10px;
            left: 10px;
            display: flex;
            gap: 0.5rem;
            z-index: 1000;
            flex-wrap: wrap;
            max-width: calc(100% - 140px);
        }

        .map-overlay-controls .control-btn {
            background: var(--card-bg);
            border: 2px solid var(--border-color);
            border-radius: 6px;
            padding: 0.5rem 0.9rem;
            color: var(--text-primary);
            cursor: pointer;
            font-size: 0.75rem;
            font-weight: 600;
            transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
            white-space: nowrap;
        }

        .map-overlay-controls .control-btn:hover {
            background: var(--elevated-bg);
            border-color: var(--accent-blue);
            transform: translateY(-2px);
        }

        .map-status-overlay {
            position: absolute;
            top: 60px;
            left: 10px;
            display: flex;
            gap: 0.5rem;
            z-index: 1000;
            flex-wrap: wrap;
            max-width: calc(100% - 140px);
        }

        .map-status-card {
            background: var(--card-bg);
            border: 2px solid;
            border-radius: 6px;
            padding: 0.5rem 0.75rem;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-width: 90px;
            cursor: pointer;
            transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        }

        .map-status-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        }

        .map-status-card.completed {
            border-color: var(--success);
        }

        .map-status-card.ongoing {
            border-color: var(--warning);
        }

        .map-status-card.delayed {
            border-color: var(--danger);
        }

        .map-status-card.planned {
            border-color: var(--text-muted);
        }

        .map-status-card.duplications {
            border-color: #f97316;
        }

        .map-status-count {
            font-size: 1.4rem;
            font-weight: 700;
            font-family: 'JetBrains Mono', monospace;
            line-height: 1;
        }

        .map-status-card.completed .map-status-count {
            color: var(--success);
        }

        .map-status-card.ongoing .map-status-count {
            color: var(--warning);
        }

        .map-status-card.delayed .map-status-count {
            color: var(--danger);
        }

        .map-status-card.planned .map-status-count {
            color: var(--text-muted);
        }

        .map-status-card.duplications .map-status-count {
            color: #f97316;
        }

        .map-status-label {
            font-size: 0.65rem;
            color: var(--text-secondary);
            margin-top: 0.25rem;
            white-space: nowrap;
        }

        .map-duplication-panel {
            position: absolute;
            top: 10px;
            right: 56px;
            width: 350px;
            max-height: calc(100vh - 40px);
            background: var(--card-bg);
            border: 2px solid #ef4444;
            border-radius: 10px;
            z-index: 1001;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
            display: none;
            flex-direction: column;
            overflow: hidden;
        }

        .map-duplication-panel.expanded {
            display: flex;
            animation: slideInRight 0.3s ease-out;
        }

        .map-duplication-panel.closing {
            animation: slideOutRight 0.3s ease-out;
        }

        @keyframes slideInRight {
            from {
                transform: translateX(100%);
                opacity: 0;
            }

            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        @keyframes slideOutRight {
            from {
                transform: translateX(0);
                opacity: 1;
            }

            to {
                transform: translateX(100%);
                opacity: 0;
            }
        }

        .map-dup-header {
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.05));
            border-bottom: 1px solid rgba(239, 68, 68, 0.3);
            padding: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            cursor: pointer;
        }

        .map-dup-icon {
            font-size: 1.2rem;
            color: #ef4444;
        }

        .map-dup-title {
            flex: 1;
            font-size: 0.9rem;
            font-weight: 700;
            color: #ef4444;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .map-dup-toggle {
            font-size: 1.2rem;
            color: var(--text-secondary);
            transition: transform 0.3s ease;
        }

        .map-dup-content {
            flex: 1;
            overflow-y: auto;
            padding: 1rem;
        }

        .map-dup-item {
            background: var(--elevated-bg);
            border: 1px solid rgba(239, 68, 68, 0.2);
            border-radius: 8px;
            padding: 0.75rem;
            margin-bottom: 0.75rem;
            font-size: 0.8rem;
        }

        .map-dup-item:last-child {
            margin-bottom: 0;
        }

        .map-dup-dept {
            font-weight: 700;
            color: #ef4444;
            margin-bottom: 0.25rem;
        }

        .map-dup-projects {
            color: var(--text-secondary);
            font-size: 0.75rem;
            line-height: 1.4;
        }

        .map-dup-toggle-btn {
            position: absolute;
            top: 56px;
            right: 10px;
            width: 36px;
            height: 36px;
            background: var(--card-bg);
            border: 2px solid #ef4444;
            border-radius: 4px;
            padding: 0;
            z-index: 1000;
            cursor: pointer;
            font-size: 1.1rem;
            box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
            transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
            color: #ef4444;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .map-dup-toggle-btn:hover {
            background: var(--elevated-bg);
            border-color: #ef4444;
        }

        .map-dup-toggle-btn.has-duplications {
            animation: pulse-red 2s infinite;
        }

        @keyframes pulse-red {

            0%,
            100% {
                box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
            }

            50% {
                box-shadow: 0 4px 16px rgba(239, 68, 68, 0.6);
            }
        }

        /* Leaflet zoom controls repositioning and dark theme */
        .leaflet-top.leaflet-right {
            top: 56px;
            right: 10px;
        }

        /* Overall map specific positioning (no fullscreen button) */
        #overall-map-container .map-north-arrow {
            top: 10px;
        }

        #overall-map-container .leaflet-top.leaflet-right {
            top: 56px;
        }

        /* Budget tabs positioning (no fullscreen button) */
        #district-map-container .map-north-arrow,
        #state-map-container .map-north-arrow,
        #central-map-container .map-north-arrow,
        #otherfund-map-container .map-north-arrow {
            top: 10px;
        }

        #district-map-container .map-dup-toggle-btn,
        #state-map-container .map-dup-toggle-btn,
        #central-map-container .map-dup-toggle-btn,
        #otherfund-map-container .map-dup-toggle-btn {
            top: 56px;
        }

        #district-map-container .leaflet-top.leaflet-right,
        #state-map-container .leaflet-top.leaflet-right,
        #central-map-container .leaflet-top.leaflet-right,
        #otherfund-map-container .leaflet-top.leaflet-right {
            top: 102px;
        }

        /* Dark theme for Leaflet zoom controls */
        .leaflet-control-zoom {
            border: none !important;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
        }

        .leaflet-control-zoom a {
            background-color: var(--card-bg) !important;
            color: var(--text-primary) !important;
            border: 2px solid var(--border-color) !important;
            width: 36px !important;
            height: 36px !important;
            line-height: 32px !important;
            font-size: 20px !important;
            font-weight: bold !important;
        }

        .leaflet-control-zoom a:hover {
            background-color: var(--elevated-bg) !important;
            border-color: var(--accent-blue) !important;
        }

        .leaflet-control-zoom-in {
            border-radius: 4px 4px 0 0 !important;
        }

        .leaflet-control-zoom-out {
            border-radius: 0 0 4px 4px !important;
        }

        /* Fullscreen mode adjustments - CRITICAL FIX for legend visibility */
        /* Using ::backdrop and direct element selectors for maximum compatibility */

        /* Department Legend in Fullscreen - Multiple selector approaches */
        *:fullscreen .tab-dept-legend,
        *:fullscreen .dept-legend,
        div:fullscreen .tab-dept-legend,
        div:fullscreen .dept-legend,
        :fullscreen .tab-dept-legend,
        :fullscreen .dept-legend,
        :-webkit-full-screen .tab-dept-legend,
        :-webkit-full-screen .dept-legend,
        :-moz-full-screen .tab-dept-legend,
        :-moz-full-screen .dept-legend,
        :-ms-fullscreen .tab-dept-legend,
        :-ms-fullscreen .dept-legend {
            display: flex !important;
            visibility: visible !important;
            opacity: 1 !important;
            z-index: 2147483647 !important;
            position: absolute !important;
        }

        /* Specific map container fullscreen selectors */
        #district-map-container:fullscreen .tab-dept-legend,
        #state-map-container:fullscreen .tab-dept-legend,
        #central-map-container:fullscreen .tab-dept-legend,
        #otherfund-map-container:fullscreen .tab-dept-legend,
        #district-map-container:-webkit-full-screen .tab-dept-legend,
        #state-map-container:-webkit-full-screen .tab-dept-legend,
        #central-map-container:-webkit-full-screen .tab-dept-legend,
        #otherfund-map-container:-webkit-full-screen .tab-dept-legend,
        #district-map-container:-moz-full-screen .tab-dept-legend,
        #state-map-container:-moz-full-screen .tab-dept-legend,
        #central-map-container:-moz-full-screen .tab-dept-legend,
        #otherfund-map-container:-moz-full-screen .tab-dept-legend {
            display: flex !important;
            visibility: visible !important;
            opacity: 1 !important;
            z-index: 2147483647 !important;
            position: absolute !important;
            bottom: 20px !important;
            left: 20px !important;
        }

        /* All other controls in fullscreen */
        *:fullscreen .map-overlay-controls,
        *:fullscreen .map-status-overlay,
        *:fullscreen .map-north-arrow,
        *:fullscreen .map-scale-control,
        *:fullscreen .map-fullscreen-btn,
        *:fullscreen .map-dup-toggle-btn,
        *:fullscreen .map-duplication-panel,
        *:fullscreen .leaflet-control-zoom,
        :fullscreen .map-overlay-controls,
        :fullscreen .map-status-overlay,
        :fullscreen .map-north-arrow,
        :fullscreen .map-scale-control,
        :fullscreen .map-fullscreen-btn,
        :fullscreen .map-dup-toggle-btn,
        :fullscreen .map-duplication-panel,
        :fullscreen .leaflet-control-zoom,
        :-webkit-full-screen .map-overlay-controls,
        :-webkit-full-screen .map-status-overlay,
        :-webkit-full-screen .map-north-arrow,
        :-webkit-full-screen .map-scale-control,
        :-webkit-full-screen .map-fullscreen-btn,
        :-webkit-full-screen .map-dup-toggle-btn,
        :-webkit-full-screen .map-duplication-panel,
        :-webkit-full-screen .leaflet-control-zoom,
        :-moz-full-screen .map-overlay-controls,
        :-moz-full-screen .map-status-overlay,
        :-moz-full-screen .map-north-arrow,
        :-moz-full-screen .map-scale-control,
        :-moz-full-screen .map-fullscreen-btn,
        :-moz-full-screen .map-dup-toggle-btn,
        :-moz-full-screen .map-duplication-panel,
        :-moz-full-screen .leaflet-control-zoom {
            z-index: 2147483647 !important;
            visibility: visible !important;
            opacity: 1 !important;
        }

        /* Ensure leaflet map base is lower z-index in fullscreen */
        *:fullscreen .leaflet-container,
        :fullscreen .leaflet-container,
        :-webkit-full-screen .leaflet-container,
        :-moz-full-screen .leaflet-container {
            z-index: 0 !important;
        }

        /* Ensure the fullscreen container has proper stacking context */
        *:fullscreen,
        :fullscreen,
        :-webkit-full-screen,
        :-moz-full-screen {
            background: var(--primary-dark) !important;
        }

        /* Leaflet popup customization */
        .leaflet-popup-content-wrapper {
            background: #1a2235 !important;
            color: var(--text-primary) !important;
            border: 1px solid rgba(14, 165, 233, 0.35) !important;
            border-radius: 14px !important;
            box-shadow: 0 16px 48px rgba(0, 0, 0, 0.75) !important;
            overflow: hidden !important;
            padding: 0 !important;
        }

        .leaflet-popup-content {
            margin: 0 !important;
            width: 310px !important;
            font-family: 'IBM Plex Sans', sans-serif;
        }

        .leaflet-popup-tip {
            background: #1a2235 !important;
        }

        .leaflet-popup-close-button {
            color: #fff !important;
            top: 7px !important;
            right: 9px !important;
            font-size: 18px !important;
            font-weight: 700 !important;
            z-index: 10 !important;
            background: rgba(14, 165, 233, 0.25) !important;
            border-radius: 50% !important;
            width: 22px !important;
            height: 22px !important;
            line-height: 22px !important;
            text-align: center !important;
        }

        /* Popup layout */
        .popup-body {
            padding: 14px 16px 14px;
        }

        .popup-title {
            font-weight: 700;
            font-size: 1.02rem;
            color: #38bdf8;
            margin-bottom: 12px;
            padding-right: 22px;
            line-height: 1.35;
        }

        .popup-info {
            display: grid;
            grid-template-columns: auto 1fr;
            gap: 7px 14px;
            font-size: 0.83rem;
            align-items: start;
        }

        .popup-label {
            color: #64748b;
            font-weight: 600;
            white-space: nowrap;
        }

        .popup-value {
            color: var(--text-primary);
            font-weight: 500;
        }

        /* Photo section */
        .popup-photo-section {
            margin-top: 14px;
            border-top: 1px solid rgba(148, 163, 184, 0.14);
        }

        .popup-photo-section-label {
            font-size: 0.68rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            color: #64748b;
            padding: 9px 16px 7px;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .popup-photo-strip {
            width: 100%;
            height: 180px;
            object-fit: cover;
            display: block;
            cursor: zoom-in;
            transition: opacity 0.2s ease;
        }

        .popup-photo-strip:hover {
            opacity: 0.88;
        }

        .popup-photo-error {
            display: none;
            padding: 10px 16px;
            font-size: 11px;
            color: #ef4444;
            background: rgba(239, 68, 68, 0.06);
            border-top: 1px solid rgba(239, 68, 68, 0.15);
            text-align: center;
        }

        /* ── Photo Lightbox ── */
        #photo-lightbox {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.92);
            z-index: 99999;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(6px);
            cursor: zoom-out;
        }

        #photo-lightbox.active {
            display: flex;
        }

        #photo-lightbox img {
            max-width: 92vw;
            max-height: 88vh;
            border-radius: 10px;
            box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
            cursor: default;
            object-fit: contain;
        }

        #photo-lightbox-close {
            position: absolute;
            top: 18px;
            right: 22px;
            color: #fff;
            font-size: 2rem;
            font-weight: 700;
            cursor: pointer;
            background: rgba(255, 255, 255, 0.12);
            border: none;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
            transition: background 0.2s;
        }

        #photo-lightbox-close:hover {
            background: rgba(255, 255, 255, 0.25);
        }

        #photo-lightbox-caption {
            position: absolute;
            bottom: 24px;
            left: 50%;
            transform: translateX(-50%);
            color: rgba(255, 255, 255, 0.7);
            font-size: 0.82rem;
            font-family: 'IBM Plex Sans', sans-serif;
            text-align: center;
            pointer-events: none;
        }

        /* ── Draw-to-Sheet Panel ── */
        .draw-panel {
            position: absolute;
            bottom: 36px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 1200;
            background: var(--card-bg);
            border: 1px solid rgba(14, 165, 233, 0.35);
            border-radius: 12px;
            padding: 14px 18px;
            width: 340px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
            display: none;
            flex-direction: column;
            gap: 10px;
            font-size: 0.82rem;
        }

        .draw-panel.visible {
            display: flex;
        }

        .draw-panel-title {
            font-weight: 700;
            color: var(--accent-blue);
            font-size: 0.9rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .draw-panel input,
        .draw-panel select {
            width: 100%;
            background: var(--elevated-bg);
            border: 1px solid rgba(148, 163, 184, 0.2);
            border-radius: 7px;
            color: var(--text-primary);
            padding: 7px 10px;
            font-size: 0.82rem;
            font-family: 'IBM Plex Sans', sans-serif;
            outline: none;
        }

        .draw-panel input:focus,
        .draw-panel select:focus {
            border-color: var(--accent-blue);
        }

        .draw-panel label {
            color: var(--text-muted);
            font-size: 0.75rem;
            font-weight: 600;
            margin-bottom: 2px;
            display: block;
        }

        .draw-panel-row {
            display: flex;
            gap: 8px;
        }

        .draw-panel-row>div {
            flex: 1;
        }

        .draw-wkt-box {
            background: rgba(14, 165, 233, 0.06);
            border: 1px solid rgba(14, 165, 233, 0.2);
            border-radius: 7px;
            padding: 6px 10px;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.7rem;
            color: var(--accent-blue);
            word-break: break-all;
            max-height: 60px;
            overflow-y: auto;
        }

        .draw-submit-btn {
            background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
            color: white;
            border: none;
            border-radius: 8px;
            padding: 9px 0;
            font-weight: 700;
            font-size: 0.82rem;
            cursor: pointer;
            width: 100%;
            letter-spacing: 0.04em;
        }

        .draw-submit-btn:hover {
            opacity: 0.9;
        }

        .draw-submit-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .draw-cancel-btn {
            background: transparent;
            color: var(--text-muted);
            border: 1px solid rgba(148, 163, 184, 0.2);
            border-radius: 8px;
            padding: 7px 0;
            font-size: 0.8rem;
            cursor: pointer;
            width: 100%;
        }

        .draw-status {
            font-size: 0.75rem;
            text-align: center;
            min-height: 16px;
        }

        .draw-status.ok {
            color: var(--accent-green);
        }

        .draw-status.err {
            color: var(--accent-red);
        }

        /* Draw toolbar styling */
        .leaflet-draw-toolbar a {
            background-color: var(--card-bg) !important;
            color: var(--text-primary) !important;
        }

        .draw-control-btn {
            background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(14, 165, 233, 0.15));
            border: 1px solid rgba(139, 92, 246, 0.4);
            color: #a78bfa;
        }

        .draw-control-btn:hover {
            border-color: #a78bfa;
            color: white;
        }

        .draw-control-btn.active-draw {
            background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(14, 165, 233, 0.3));
            color: white;
            border-color: #a78bfa;
        }

        /* Projects Table */
        .projects-table-container {
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 2rem;
            margin-bottom: 2.5rem;
            overflow-x: auto;
        }

        .data-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
        }

        .data-table thead {
            background: var(--elevated-bg);
        }

        .data-table th {
            padding: 1rem 1.5rem;
            text-align: left;
            font-size: 0.75rem;
            font-weight: 700;
            color: var(--accent-blue);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            border-bottom: 2px solid var(--accent-blue);
            white-space: nowrap;
        }

        .data-table tbody tr {
            background: var(--card-bg);
            transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
            border-bottom: 1px solid var(--border-color);
        }

        .data-table tbody tr:hover {
            background: var(--elevated-bg);
            transform: translateX(4px);
        }

        .data-table td {
            padding: 1rem 1.5rem;
            font-size: 0.85rem;
            color: var(--text-secondary);
        }

        .project-name {
            font-weight: 600;
            color: var(--text-primary);
        }

        .status-badge {
            display: inline-block;
            padding: 0.4rem 0.9rem;
            border-radius: 20px;
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .status-completed {
            background: rgba(34, 197, 94, 0.2);
            color: var(--success);
            border: 1px solid var(--success);
        }

        .status-ongoing {
            background: rgba(234, 179, 8, 0.2);
            color: var(--warning);
            border: 1px solid var(--warning);
        }

        .status-delayed {
            background: rgba(220, 38, 38, 0.2);
            color: var(--danger);
            border: 1px solid var(--danger);
        }

        .status-planned {
            background: rgba(148, 163, 184, 0.2);
            color: var(--text-muted);
            border: 1px solid var(--text-muted);
        }

        /* Department Progress */
        .dept-progress-list {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        .dept-item {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

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

        .dept-name {
            font-weight: 600;
            color: var(--text-primary);
            font-size: 0.9rem;
        }

        .dept-percentage {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 700;
            color: var(--accent-blue);
            font-size: 1rem;
        }

        .dept-meta {
            display: flex;
            gap: 1.5rem;
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        /* Chart Container */
        .chart-card {
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 2rem;
            margin-bottom: 2rem;
        }

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

        /* Infographic Cards for Budget Analysis */
        .infographic-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .info-card {
            background: linear-gradient(135deg, var(--card-bg), var(--elevated-bg));
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 2rem;
            position: relative;
            overflow: hidden;
        }

        .info-card::before {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 100px;
            height: 100px;
            background: radial-gradient(circle, rgba(14, 165, 233, 0.1), transparent);
            border-radius: 50%;
        }

        .info-icon {
            font-size: 2.5rem;
            margin-bottom: 1rem;
        }

        .info-value {
            font-family: 'JetBrains Mono', monospace;
            font-size: 2.5rem;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 0.5rem;
        }

        .info-label {
            font-size: 0.9rem;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .info-trend {
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.85rem;
        }

        .trend-up {
            color: var(--success);
        }

        .trend-down {
            color: var(--danger);
        }

        /* Loading State */
        .loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 3rem;
            color: var(--text-secondary);
            gap: 1rem;
        }

        .spinner {
            width: 40px;
            height: 40px;
            border: 4px solid var(--elevated-bg);
            border-top-color: var(--accent-blue);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

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

        /* Duplication Alert */
        .duplication-alert {
            background: rgba(239, 68, 68, 0.1);
            border: 1px solid var(--accent-red);
            border-radius: 8px;
            padding: 1rem;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .alert-icon {
            font-size: 1.5rem;
        }

        .alert-content {
            flex: 1;
        }

        .alert-title {
            font-weight: 700;
            color: var(--accent-red);
            margin-bottom: 0.25rem;
        }

        .alert-message {
            font-size: 0.85rem;
            color: var(--text-secondary);
        }

        /* Report Section */
        .report-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
            gap: 2rem;
            margin-top: 2rem;
        }

        .report-section {
            background: var(--elevated-bg);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            padding: 1.5rem;
        }

        .report-section h4 {
            color: var(--accent-blue);
            margin-bottom: 1rem;
            font-size: 1.1rem;
        }

        .report-item {
            display: flex;
            justify-content: space-between;
            padding: 0.75rem 0;
            border-bottom: 1px solid var(--border-color);
        }

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

        /* Overall GIS Map Overlay */
        .overall-gis-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: var(--primary-dark);
            z-index: 1100;
            flex-direction: column;
        }

        .overall-gis-overlay.active {
            display: flex;
        }

        .overall-gis-header {
            background: rgba(10, 15, 30, 0.98);
            border-bottom: 1px solid var(--border-color);
            padding: 0.75rem 2rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-shrink: 0;
            gap: 1rem;
            flex-wrap: wrap;
        }

        /* Stat blocks row */
        .overall-stat-blocks {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 1rem;
            padding: 1.5rem 2rem;
            flex-shrink: 0;
            background: var(--primary-dark);
            border-bottom: 1px solid var(--border-color);
            position: relative;
            z-index: 1200;
        }

        .overall-stat-block {
            padding: 1.5rem;
            text-align: center;
            border-radius: 10px;
            background: var(--card-bg);
            position: relative;
            transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
        }

        .overall-stat-block:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

        .overall-stat-block.completed {
            border: 2px solid var(--success);
        }

        .overall-stat-block.ongoing {
            border: 2px solid var(--warning);
        }

        .overall-stat-block.delayed {
            border: 2px solid var(--danger);
        }

        .overall-stat-block.planned {
            border: 2px solid var(--text-muted);
        }

        .overall-stat-block.duplicate {
            border: 2px solid #f97316;
        }

        .overall-stat-block.source-district {
            display: none;
        }

        .overall-stat-block.source-state {
            display: none;
        }

        .overall-stat-block.source-central {
            display: none;
        }

        .overall-stat-block.source-otherfund {
            display: none;
        }

        .osb-count {
            font-family: 'JetBrains Mono', monospace;
            font-size: 3rem;
            font-weight: 700;
            line-height: 1;
            margin-bottom: 0.5rem;
        }

        .overall-stat-block.completed .osb-count {
            color: var(--success);
        }

        .overall-stat-block.ongoing .osb-count {
            color: var(--warning);
        }

        .overall-stat-block.delayed .osb-count {
            color: var(--danger);
        }

        .overall-stat-block.planned .osb-count {
            color: var(--text-muted);
        }

        .overall-stat-block.duplicate .osb-count {
            color: #f97316;
        }

        .osb-label {
            font-size: 0.85rem;
            color: var(--text-secondary);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .osb-dot {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            margin: 0 auto 0.3rem;
            border: 2px solid rgba(255, 255, 255, 0.3);
        }

        .overall-gis-title {
            font-family: 'Playfair Display', serif;
            font-size: 1.3rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .overall-gis-body {
            flex: 1;
            display: flex;
            overflow: hidden;
        }

        #overall-map-container {
            flex: 1;
            height: 100%;
        }

        .overall-gis-sidebar {
            width: 340px;
            background: var(--card-bg);
            border-left: 1px solid var(--border-color);
            overflow-y: auto;
            flex-shrink: 0;
            padding: 1.25rem;
        }

        .overall-gis-sidebar h4 {
            font-size: 0.85rem;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: var(--accent-blue);
            margin-bottom: 1rem;
            font-weight: 700;
        }

        .map-legend {
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            padding: 1rem;
            position: absolute;
            bottom: 20px;
            left: 20px;
            z-index: 1000;
            min-width: 180px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

        .map-legend h4 {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: var(--text-primary);
            margin-bottom: 0.75rem;
            font-weight: 700;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            margin-bottom: 0.5rem;
            font-size: 0.75rem;
        }

        .legend-item:last-child {
            margin-bottom: 0;
        }

        .legend-marker {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .legend-marker.completed {
            background: var(--success);
        }

        .legend-marker.ongoing {
            background: var(--warning);
        }

        .legend-marker.delayed {
            background: var(--danger);
        }

        .legend-marker.planned {
            background: var(--text-muted);
        }

        .legend-label {
            color: var(--text-secondary);
        }

        /* Department Legend for Overall GIS Map */
        .dept-legend {
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            padding: 1rem;
            position: absolute;
            bottom: 20px;
            left: 20px;
            z-index: 1000;
            min-width: 210px;
            max-width: 260px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
            display: flex;
            flex-direction: column;
            max-height: min(380px, 45vh);
        }

        .dept-legend h4 {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: var(--text-primary);
            margin-bottom: 0.75rem;
            font-weight: 700;
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 0.5rem;
            flex-shrink: 0;
        }

        #dept-legend-list {
            overflow-y: auto;
            flex: 1;
            padding-right: 6px;
            scrollbar-width: thin;
            scrollbar-color: rgba(148, 163, 184, 0.5) rgba(148, 163, 184, 0.1);
            overscroll-behavior: contain;
        }

        #dept-legend-list::-webkit-scrollbar {
            width: 6px;
        }

        #dept-legend-list::-webkit-scrollbar-track {
            background: rgba(148, 163, 184, 0.1);
            border-radius: 4px;
        }

        #dept-legend-list::-webkit-scrollbar-thumb {
            background: rgba(148, 163, 184, 0.5);
            border-radius: 4px;
        }

        #dept-legend-list::-webkit-scrollbar-thumb:hover {
            background: rgba(148, 163, 184, 0.7);
        }

        .dept-legend-item {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            margin-bottom: 0.4rem;
            font-size: 0.7rem;
            cursor: pointer;
            padding: 0.3rem 0.4rem;
            border-radius: 4px;
            transition: background 0.15s ease;
            user-select: none;
        }

        .dept-legend-item:hover {
            background: rgba(148, 163, 184, 0.1);
        }

        .dept-legend-item.hidden-layer {
            opacity: 0.4;
        }

        .dept-legend-item:last-child {
            margin-bottom: 0;
        }

        .dept-master-eye {
            float: right;
            cursor: pointer;
            font-size: 1rem;
            opacity: 0.7;
            transition: opacity 0.2s, transform 0.15s;
            user-select: none;
        }

        .dept-master-eye:hover {
            opacity: 1;
            transform: scale(1.15);
        }

        .dept-master-eye.all-hidden {
            opacity: 0.4;
        }

        .dept-marker {
            width: 13px;
            height: 13px;
            border-radius: 50%;
            flex-shrink: 0;
            border: 2.5px solid var(--dept-color, #94a3b8);
            background: color-mix(in srgb, var(--dept-color, #94a3b8) 20%, transparent);
            box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
        }

        .dept-label {
            color: var(--text-secondary);
            font-weight: 500;
            flex: 1;
        }

        .dept-count {
            margin-left: auto;
            color: var(--text-primary);
            font-weight: 700;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.75rem;
        }

        .dept-eye-icon {
            font-size: 0.65rem;
            color: var(--text-muted);
            flex-shrink: 0;
        }

        .dup-alert-item {
            background: rgba(239, 68, 68, 0.08);
            border: 1px solid rgba(239, 68, 68, 0.3);
            border-radius: 8px;
            padding: 0.9rem;
            margin-bottom: 0.75rem;
            font-size: 0.8rem;
        }

        .dup-alert-item .dup-dept {
            font-weight: 700;
            color: #ef4444;
            margin-bottom: 0.4rem;
            font-size: 0.85rem;
        }

        .dup-alert-item .dup-projects {
            color: var(--text-secondary);
            line-height: 1.5;
        }

        .dup-alert-item .dup-sources {
            margin-top: 0.4rem;
            display: flex;
            gap: 0.4rem;
            flex-wrap: wrap;
        }

        .source-badge {
            padding: 0.2rem 0.5rem;
            border-radius: 4px;
            font-size: 0.7rem;
            font-weight: 700;
        }

        .source-badge.district {
            background: rgba(14, 165, 233, 0.2);
            color: #0ea5e9;
        }

        .source-badge.state {
            background: rgba(16, 185, 129, 0.2);
            color: #10b981;
        }

        .source-badge.central {
            background: rgba(245, 158, 11, 0.2);
            color: #f59e0b;
        }

        .source-badge.otherfund {
            background: rgba(139, 92, 246, 0.2);
            color: #8b5cf6;
        }

        .filter-group {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
            margin-bottom: 1rem;
        }

        .filter-chip {
            padding: 0.35rem 0.75rem;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 600;
            cursor: pointer;
            border: 1px solid var(--border-color);
            background: var(--elevated-bg);
            color: var(--text-secondary);
            transition: background-color 0.2s ease, color 0.2s ease;
        }

        .filter-chip:hover,
        .filter-chip.active {
            border-color: var(--accent-blue);
            color: var(--accent-blue);
            background: rgba(14, 165, 233, 0.1);
        }

        .filter-chip.district.active {
            border-color: #0ea5e9;
            color: #0ea5e9;
            background: rgba(14, 165, 233, 0.1);
        }

        .filter-chip.state.active {
            border-color: #10b981;
            color: #10b981;
            background: rgba(16, 185, 129, 0.1);
        }

        .filter-chip.central.active {
            border-color: #f59e0b;
            color: #f59e0b;
            background: rgba(245, 158, 11, 0.1);
        }

        .filter-chip.otherfund.active {
            border-color: #8b5cf6;
            color: #8b5cf6;
            background: rgba(139, 92, 246, 0.1);
        }

        /* Highlight pulse ring animation */
        .highlight-pulse-ring {
            animation: hlPulse 1s ease-in-out infinite alternate;
        }

        @keyframes hlPulse {
            from {
                opacity: 0.95;
                stroke-width: 3px;
            }

            to {
                opacity: 0.3;
                stroke-width: 1px;
            }
        }

        .no-dup-msg {
            color: var(--text-muted);
            font-size: 0.85rem;
            text-align: center;
            padding: 2rem 1rem;
        }

        /* ── Block / Tehsil filter bar — floats at bottom-centre of each GIS map ── */
        .map-bottom-filters {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            flex-wrap: nowrap;
            padding: 0.5rem 1rem;
            background: rgba(10, 15, 30, 0.93);
            border: 1px solid rgba(14, 165, 233, 0.28);
            border-radius: 10px;
            /* Pull bar up so it sits on top of the map */
            position: relative;
            margin-top: -52px;
            /* pull over the map */
            margin-left: auto;
            margin-right: auto;
            width: max-content;
            max-width: calc(100% - 40px);
            z-index: 1001;
            backdrop-filter: blur(10px);
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
            pointer-events: auto;
        }

        .map-bottom-filters .mbf-label {
            font-size: 0.7rem;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.12em;
            flex-shrink: 0;
        }

        .mbf-dropdown-wrap {
            position: relative;
        }

        .mbf-dropdown-btn {
            display: flex;
            align-items: center;
            gap: 0.45rem;
            padding: 0.35rem 0.8rem;
            background: var(--elevated-bg);
            border: 1px solid rgba(14, 165, 233, 0.25);
            border-radius: 7px;
            color: var(--text-secondary);
            font-size: 0.78rem;
            font-weight: 600;
            cursor: pointer;
            font-family: 'IBM Plex Sans', sans-serif;
            min-width: 120px;
            transition: border-color 0.2s, background 0.2s;
        }

        .mbf-dropdown-btn:hover,
        .mbf-dropdown-btn.open {
            border-color: var(--accent-blue);
            background: rgba(14, 165, 233, 0.08);
            color: var(--text-primary);
        }

        .mbf-dropdown-btn .mbf-arrow {
            margin-left: auto;
            font-size: 0.6rem;
            transition: transform 0.2s;
        }

        .mbf-dropdown-btn.open .mbf-arrow {
            transform: rotate(180deg);
        }

        .mbf-active-badge {
            background: var(--accent-blue);
            color: white;
            font-size: 0.62rem;
            font-weight: 700;
            border-radius: 99px;
            padding: 0 5px;
            min-width: 16px;
            text-align: center;
            line-height: 16px;
        }

        .mbf-panel {
            display: none;
            position: absolute;
            bottom: calc(100% + 6px);
            left: 0;
            background: rgba(15, 20, 40, 0.98);
            border: 1px solid rgba(14, 165, 233, 0.25);
            border-radius: 10px;
            padding: 0.55rem 0;
            min-width: 200px;
            max-height: 260px;
            overflow-y: auto;
            z-index: 9000;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(10px);
        }

        /* Variant that opens downward instead of upward */
        .mbf-panel-down {
            bottom: auto;
            top: calc(100% + 6px);
        }

        .mbf-panel.open {
            display: block;
        }

        .mbf-panel-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.3rem 0.75rem 0.45rem;
            border-bottom: 1px solid rgba(148, 163, 184, 0.1);
            margin-bottom: 0.2rem;
        }

        .mbf-panel-header span {
            font-size: 0.68rem;
            color: var(--text-muted);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.1em;
        }

        .mbf-clear-btn {
            font-size: 0.67rem;
            color: var(--accent-blue);
            cursor: pointer;
            background: none;
            border: none;
            font-family: inherit;
            padding: 0;
        }

        .mbf-check-item {
            display: flex;
            align-items: center;
            gap: 0.55rem;
            padding: 0.38rem 0.75rem;
            cursor: pointer;
            font-size: 0.78rem;
            color: var(--text-secondary);
            transition: background 0.15s;
        }

        .mbf-check-item:hover {
            background: rgba(14, 165, 233, 0.08);
            color: var(--text-primary);
        }

        .mbf-check-item input[type="checkbox"] {
            width: 14px;
            height: 14px;
            accent-color: var(--accent-blue);
            cursor: pointer;
            pointer-events: auto !important;
            flex-shrink: 0;
        }

        .mbf-no-data {
            font-size: 0.73rem;
            color: var(--text-muted);
            padding: 0.5rem 0.75rem;
            font-style: italic;
        }

        .mbf-reset-btn {
            padding: 0.32rem 0.7rem;
            background: rgba(239, 68, 68, 0.12);
            border: 1px solid rgba(239, 68, 68, 0.3);
            border-radius: 6px;
            color: #ef4444;
            font-size: 0.73rem;
            font-weight: 700;
            cursor: pointer;
            font-family: 'IBM Plex Sans', sans-serif;
            transition: background 0.2s;
            margin-left: auto;
        }

        .mbf-reset-btn:hover {
            background: rgba(239, 68, 68, 0.22);
        }

        /* ── Export map block/tehsil filter (inside step 1.5) ── */
        .mex-bt-filter-wrap {
            margin-top: 0.9rem;
            padding: 0.8rem;
            background: rgba(14, 165, 233, 0.05);
            border: 1px solid rgba(14, 165, 233, 0.15);
            border-radius: 9px;
        }

        .mex-bt-filter-title {
            font-size: 0.72rem;
            font-weight: 700;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.1em;
            margin-bottom: 0.6rem;
        }

        .mex-bt-row {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        /* Per-tab GIS map filter row and department legend */
        .tab-map-filters {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            flex-wrap: wrap;
            margin-bottom: 1rem;
            padding: 0.6rem 0.9rem;
            background: var(--elevated-bg);
            border: 1px solid var(--border-color);
            border-radius: 8px;
        }

        .tab-map-filters .filter-label {
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.1em;
            margin-right: 0.25rem;
        }

        /* Per-tab dept legend panel positioned over map */
        .tab-dept-legend {
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            padding: 0.9rem;
            position: absolute;
            bottom: 20px;
            left: 20px;
            right: auto;
            z-index: 1000;
            min-width: 190px;
            max-width: 240px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
            display: flex;
            flex-direction: column;
            max-height: min(350px, 45vh);
        }

        .tab-dept-legend h4 {
            font-size: 0.72rem;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: var(--text-primary);
            margin-bottom: 0.6rem;
            font-weight: 700;
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 0.4rem;
            flex-shrink: 0;
        }

        .tab-dept-legend-list {
            overflow-y: auto;
            flex: 1;
            padding-right: 2px;
            scrollbar-width: thin;
            scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
            overscroll-behavior: contain;
        }

        .tab-dept-legend-list::-webkit-scrollbar {
            width: 4px;
        }

        .tab-dept-legend-list::-webkit-scrollbar-track {
            background: transparent;
        }

        .tab-dept-legend-list::-webkit-scrollbar-thumb {
            background: rgba(148, 163, 184, 0.3);
            border-radius: 4px;
        }

        /* map wrapper needed for absolute positioning */
        .tab-map-wrapper {
            position: relative;
        }

        /* map-bottom-filters is relatively-positioned and pulled up over map via negative margin-top */

        /* Responsive */
        @media (max-width: 1400px) {
            .budget-overview {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        /* Overall Overview Tab */
        #alloverall-tab .budget-overview {
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        }

        /* Clickable stat blocks hover effect */
        .overall-stat-block[onclick]:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
        }

        .overall-stat-block.filter-active {
            box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3) inset;
        }

        /* Fade inactive stat block when filtered */
        .overall-stat-block.filtered-out {
            opacity: 0.4;
        }

        @media (max-width: 768px) {
            .header-container {
                flex-direction: column;
                gap: 1rem;
            }

            .main-tabs-container,
            .sub-nav-container {
                overflow-x: auto;
            }

            .budget-overview {
                grid-template-columns: 1fr;
            }

            .container {
                padding: 1.5rem;
            }

            .map-controls {
                flex-wrap: wrap;
            }
        }

        /* ===== OPTIMIZED REPORT PANEL ===== */
        .rp-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1.75rem;
            flex-wrap: wrap;
            gap: 0.75rem;
        }

        .rp-title {
            font-family: 'Playfair Display', serif;
            font-size: 1.6rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .rp-timestamp {
            font-size: 0.78rem;
            color: var(--text-muted);
            font-family: 'JetBrains Mono', monospace;
        }

        /* KPI row */
        .rp-kpi-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: 1rem;
            margin-bottom: 2rem;
        }

        .rp-kpi {
            background: var(--elevated-bg);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            padding: 1.25rem 1.5rem;
            position: relative;
            overflow: hidden;
        }

        .rp-kpi::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 3px;
            height: 100%;
            background: var(--kpi-color, var(--accent-blue));
        }

        .rp-kpi-value {
            font-family: 'JetBrains Mono', monospace;
            font-size: 1.7rem;
            font-weight: 700;
            color: var(--kpi-color, var(--accent-blue));
            line-height: 1.1;
            margin-bottom: 0.3rem;
        }

        .rp-kpi-label {
            font-size: 0.72rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            font-weight: 600;
        }

        /* Status pills row */
        .rp-status-row {
            display: flex;
            gap: 0.75rem;
            margin-bottom: 2rem;
            flex-wrap: wrap;
        }

        .rp-status-pill {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.55rem 1.1rem;
            border-radius: 24px;
            border: 1px solid;
            font-size: 0.82rem;
            font-weight: 700;
        }

        .rp-status-pill .rp-pill-count {
            font-family: 'JetBrains Mono', monospace;
            font-size: 1rem;
        }

        /* Section heading */
        .rp-section-title {
            font-size: 0.78rem;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            font-weight: 900 !important;
            color: var(--text-primary);
            margin-bottom: 0.9rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid var(--border-color);
        }

        /* Department table */
        .rp-dept-grid {
            display: flex;
            flex-direction: column;
            gap: 0.6rem;
            margin-bottom: 2rem;
        }

        .rp-dept-row {
            display: grid;
            grid-template-columns: 1fr 80px 80px 90px 80px;
            align-items: center;
            gap: 1rem;
            background: var(--elevated-bg);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 0.8rem 1.2rem;
            transition: background 0.2s ease;
        }

        .rp-dept-row:hover {
            background: var(--card-bg);
        }

        .rp-dept-name {
            font-weight: 600;
            font-size: 0.88rem;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .rp-dept-meta {
            font-size: 0.75rem;
            color: var(--text-muted);
            font-family: 'JetBrains Mono', monospace;
            text-align: right;
        }

        .rp-dept-bar-wrap {
            display: flex;
            align-items: center;
            gap: 0.6rem;
        }

        .rp-dept-bar {
            flex: 1;
            height: 6px;
            background: var(--card-bg);
            border-radius: 3px;
            overflow: hidden;
            min-width: 40px;
        }

        .rp-dept-bar-fill {
            height: 100%;
            border-radius: 3px;
            transition: width 1s ease;
        }

        .rp-dept-pct {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.78rem;
            font-weight: 700;
            min-width: 36px;
            text-align: right;
        }

        .rp-dept-header-row {
            display: grid;
            grid-template-columns: 1fr 80px 80px 90px 80px;
            gap: 1rem;
            padding: 0.4rem 1.2rem;
            font-size: 0.68rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-muted);
            font-weight: 700;
        }

        /* Utilization donut — textual ring display */
        .rp-util-ring {
            display: flex;
            align-items: center;
            gap: 1.5rem;
            background: var(--elevated-bg);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            padding: 1.25rem 1.5rem;
            margin-bottom: 2rem;
        }

        .rp-util-ring-bar {
            flex: 1;
            height: 12px;
            background: var(--card-bg);
            border-radius: 6px;
            overflow: hidden;
        }

        .rp-util-ring-fill {
            height: 100%;
            border-radius: 6px;
            background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
            transition: width 1.2s ease;
        }

        .rp-util-pct {
            font-family: 'JetBrains Mono', monospace;
            font-size: 1.4rem;
            font-weight: 700;
            color: var(--accent-blue);
            min-width: 60px;
            text-align: right;
        }

        /* Top/bottom performers */
        .rp-perf-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1.25rem;
            margin-bottom: 2rem;
        }

        @media (max-width: 700px) {
            .rp-perf-grid {
                grid-template-columns: 1fr;
            }
        }

        .rp-perf-card {
            background: var(--elevated-bg);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            padding: 1.2rem 1.4rem;
        }

        .rp-perf-card-title {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            font-weight: 700;
            margin-bottom: 1rem;
        }

        .rp-perf-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.5rem 0;
            border-bottom: 1px solid var(--border-color);
        }

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

        .rp-perf-rank {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.7rem;
            font-weight: 700;
            color: var(--text-muted);
            min-width: 18px;
        }

        .rp-perf-dept {
            flex: 1;
            font-size: 0.82rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .rp-perf-pct {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.85rem;
            font-weight: 700;
        }

        /* Footer */
        .rp-footer {
            margin-top: 1.5rem;
            padding-top: 1rem;
            border-top: 1px solid var(--border-color);
            font-size: 0.75rem;
            color: var(--text-muted);
            display: flex;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

/* ================================================================ */

/* ── Section 3: Component Styles ── */
/* ─── LIGHT MODE ─── */
        body.light-mode {
            --primary-dark: #f0f4f8;
            --secondary-dark: #e2e8f0;
            --card-bg: #ffffff;
            --elevated-bg: #f8fafc;
            --text-primary: #0f172a;
            --text-secondary: #475569;
            --text-muted: #94a3b8;
            --border-color: rgba(15, 23, 42, 0.12);
        }

        body.light-mode .header {
            background: rgba(240, 244, 248, 0.98) !important;
        }

        body.light-mode .main-tabs {
            background: var(--secondary-dark);
        }

        body.light-mode .sub-nav {
            background: var(--card-bg);
        }

        body.light-mode body::before {
            display: none;
        }

        body.light-mode .logo-text h1 {
            color: #0f172a;
        }

        body.light-mode .sync-badge {
            background: rgba(16, 185, 129, 0.08);
            color: #059669;
            border-color: rgba(16, 185, 129, 0.3);
        }

        body.light-mode .data-table thead {
            background: #f1f5f9;
        }

        body.light-mode .data-table th {
            color: #0ea5e9;
            border-bottom-color: #0ea5e9;
        }

        body.light-mode .data-table tbody tr {
            background: #fff;
        }

        body.light-mode .data-table tbody tr:hover {
            background: #f1f5f9;
        }

        body.light-mode .data-table td {
            color: #475569;
        }

        body.light-mode .budget-card,
        body.light-mode .chart-card,
        body.light-mode .projects-table-container,
        body.light-mode .map-section {
            background: #fff;
        }

        /* ── Fix 4: Overall GIS Dashboard in light mode ── */
        body.light-mode .overall-gis-overlay {
            background: var(--primary-dark);
        }

        /* ── Map Export Modal — light mode fixes ──
           These elements use hardcoded rgba(10,15,30,…) values that bypass
           the CSS variable system and stay dark even in light mode.        */
        body.light-mode .mex-map-layout {
            background: #dde3ec;
        }

        body.light-mode .mex-tpl-thumb {
            background: rgba(226, 232, 240, 0.85);
        }

        body.light-mode .mex-title-bar {
            background: rgba(255, 255, 255, 0.95);
            border-bottom-color: rgba(14, 165, 233, 0.3);
        }

        body.light-mode .mex-legend-box {
            background: rgba(255, 255, 255, 0.95);
            border-color: rgba(100, 116, 139, 0.3);
        }

        body.light-mode .mex-legend-item {
            color: #475569;
        }

        body.light-mode .mex-scale-bar {
            background: rgba(255, 255, 255, 0.92);
            border-color: rgba(100, 116, 139, 0.4);
            color: #334155;
        }

        body.light-mode .scale-bar-seg:nth-child(odd) {
            background: rgba(71, 85, 105, 0.45);
        }

        body.light-mode .mex-credits {
            background: rgba(255, 255, 255, 0.92);
            border-color: rgba(100, 116, 139, 0.3);
            color: #64748b;
        }

        /* Inset box uses an inline style, so !important is required */
        body.light-mode #mex-inset-box {
            background: rgba(255, 255, 255, 0.92) !important;
            border-color: rgba(100, 116, 139, 0.35) !important;
        }

        /* North arrow SVG circle background */
        body.light-mode #mex-north-arrow svg circle:first-child {
            fill: rgba(255, 255, 255, 0.92);
            stroke: rgba(100, 116, 139, 0.4);
        }

        /* ══════════════════════════════════════════════════════════
           FIX 4 — Uniform light mode across ALL fund tabs
           Covers: map filter bars, dropdowns, panels, status cards,
           duplication panels, Leaflet controls, dept legends, etc.
        ══════════════════════════════════════════════════════════ */

        /* Map bottom filter bar */
        body.light-mode .map-bottom-filters {
            background: rgba(240, 244, 248, 0.97) !important;
            border-color: rgba(14, 165, 233, 0.28) !important;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10) !important;
        }

        body.light-mode .mbf-label {
            color: #64748b !important;
        }

        /* Block / Tehsil dropdown buttons */
        body.light-mode .mbf-dropdown-btn {
            background: #ffffff !important;
            border-color: rgba(14, 165, 233, 0.28) !important;
            color: #334155 !important;
        }

        body.light-mode .mbf-dropdown-btn:hover,
        body.light-mode .mbf-dropdown-btn.open {
            background: rgba(14, 165, 233, 0.07) !important;
            border-color: var(--accent-blue) !important;
            color: #0f172a !important;
        }

        /* Dropdown panels */
        body.light-mode .mbf-panel {
            background: rgba(248, 250, 252, 0.99) !important;
            border-color: rgba(14, 165, 233, 0.22) !important;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
        }

        body.light-mode .mbf-panel-header {
            border-bottom-color: rgba(15, 23, 42, 0.08) !important;
        }

        body.light-mode .mbf-panel-header span {
            color: #64748b !important;
        }

        body.light-mode .mbf-check-item {
            color: #475569 !important;
        }

        body.light-mode .mbf-check-item:hover {
            background: rgba(14, 165, 233, 0.07) !important;
            color: #0f172a !important;
        }

        /* Map overlay control buttons (Reset View, Fit All, Draw, etc.) */
        body.light-mode .map-overlay-controls .control-btn {
            background: rgba(255, 255, 255, 0.96) !important;
            border-color: rgba(15, 23, 42, 0.14) !important;
            color: #334155 !important;
        }

        body.light-mode .map-overlay-controls .control-btn:hover {
            background: #0ea5e9 !important;
            color: #ffffff !important;
            border-color: #0ea5e9 !important;
        }

        /* Fullscreen, north arrow, scale, satellite buttons */
        body.light-mode .map-fullscreen-btn,
        body.light-mode .map-north-arrow,
        body.light-mode .map-scale-control {
            background: rgba(255, 255, 255, 0.96) !important;
            border-color: rgba(15, 23, 42, 0.14) !important;
            color: #334155 !important;
        }

        body.light-mode .map-satellite-btn {
            background: rgba(255, 255, 255, 0.96) !important;
            border-color: rgba(15, 23, 42, 0.14) !important;
            color: #334155 !important;
        }

        body.light-mode .map-satellite-btn:hover {
            background: #f1f5f9 !important;
            border-color: #0ea5e9 !important;
            color: #0369a1 !important;
        }

        body.light-mode .map-satellite-btn.satellite-active {
            background: rgba(14, 165, 233, 0.10) !important;
            border-color: #0ea5e9 !important;
            color: #0369a1 !important;
        }

        /* Map status overlay cards */
        body.light-mode .map-status-card {
            background: #ffffff !important;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10) !important;
        }

        body.light-mode .map-status-count {
            color: #0f172a !important;
            font-weight: 700 !important;
        }

        body.light-mode .map-status-label {
            color: #475569 !important;
        }

        /* Duplication toggle button */
        body.light-mode .map-dup-toggle-btn {
            background: rgba(255, 255, 255, 0.96) !important;
            box-shadow: 0 2px 8px rgba(239, 68, 68, 0.18) !important;
        }

        /* Duplication panel */
        body.light-mode .map-duplication-panel {
            background: #ffffff !important;
            border-color: rgba(239, 68, 68, 0.25) !important;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
        }

        body.light-mode .map-dup-header {
            border-bottom-color: rgba(239, 68, 68, 0.15) !important;
        }

        body.light-mode .map-dup-content {
            background: #ffffff !important;
        }

        body.light-mode .map-dup-item {
            background: rgba(239, 68, 68, 0.04) !important;
            border-color: rgba(239, 68, 68, 0.15) !important;
        }

        body.light-mode .map-dup-projects {
            color: #475569 !important;
        }

        /* Leaflet zoom controls */
        body.light-mode .leaflet-control-zoom a {
            background-color: #ffffff !important;
            color: #334155 !important;
            border-color: rgba(15, 23, 42, 0.14) !important;
        }

        body.light-mode .leaflet-control-zoom a:hover {
            background-color: #f1f5f9 !important;
            border-color: #0ea5e9 !important;
            color: #0ea5e9 !important;
        }

        /* Per-tab department legend */
        body.light-mode .tab-dept-legend {
            background: rgba(255, 255, 255, 0.97) !important;
            border-color: rgba(15, 23, 42, 0.10) !important;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10) !important;
        }

        body.light-mode .tab-dept-legend h4 {
            color: #0f172a !important;
            border-bottom-color: rgba(15, 23, 42, 0.08) !important;
        }

        body.light-mode .tab-dept-legend-list .dept-legend-item {
            color: #475569 !important;
        }

        /* Overall GIS dept legend */
        body.light-mode .dept-legend {
            background: rgba(255, 255, 255, 0.97) !important;
            border-color: rgba(15, 23, 42, 0.10) !important;
        }

        body.light-mode .dept-legend h4 {
            color: #0f172a !important;
            border-bottom-color: rgba(15, 23, 42, 0.08) !important;
        }

        body.light-mode .dept-label {
            color: #475569 !important;
        }

        body.light-mode .dept-count {
            color: #0f172a !important;
        }

        /* Leaflet popup — already handled above, ensure popup tip matches */
        body.light-mode .leaflet-popup-content-wrapper {
            background: #ffffff !important;
        }

        /* Map measure / annotation overlays */
        body.light-mode .map-measure-info {
            background: rgba(248, 250, 252, 0.96) !important;
            border-color: var(--accent-blue) !important;
            color: #0f172a !important;
        }

        /* Nainital boundary tooltip */
        body.light-mode .nainital-boundary-tooltip {
            background: rgba(248, 250, 252, 0.95) !important;
            border-color: rgba(14, 165, 233, 0.35) !important;
        }

        body.light-mode .nainital-boundary-tooltip span {
            color: #0f172a !important;
        }

        /* Draw panel (shared) */
        body.light-mode #draw-panel {
            background: #ffffff !important;
            border-color: rgba(14, 165, 233, 0.4) !important;
            color: #0f172a !important;
        }

        /* ── END FIX 4 ── */

        body.light-mode .overall-gis-header {
            background: rgba(240, 244, 248, 0.98) !important;
            border-bottom-color: var(--border-color);
        }

        body.light-mode .overall-gis-title {
            color: var(--text-primary);
        }

        body.light-mode .overall-stat-blocks {
            background: var(--primary-dark);
        }

        body.light-mode .overall-stat-block {
            background: var(--card-bg);
        }

        body.light-mode .osb-label {
            color: var(--text-secondary);
        }

        body.light-mode .osb-dot {
            border-color: rgba(15, 23, 42, 0.15);
        }

        body.light-mode .overall-gis-sidebar {
            background: var(--card-bg);
            border-left-color: var(--border-color);
        }

        /* ── Fix 3: Report sub-tab in light mode ── */
        body.light-mode .rp-section-title {
            color: var(--text-primary);
            text-shadow: none;
        }

        body.light-mode .rp-kpi {
            background: var(--elevated-bg);
        }

        body.light-mode .rp-dept-row {
            background: var(--elevated-bg);
        }

        body.light-mode .rp-dept-row:hover {
            background: var(--card-bg);
        }

        body.light-mode .rp-util-ring {
            background: var(--elevated-bg);
        }

        body.light-mode .rp-perf-card {
            background: var(--elevated-bg);
        }

        body.light-mode .ddm-stat-card {
            background: var(--elevated-bg) !important;
            border-color: var(--border-color) !important;
        }

        body.light-mode .ddm-project-card {
            background: var(--elevated-bg) !important;
            border-color: var(--border-color) !important;
        }

        body.light-mode #dept-detail-box {
            background: var(--card-bg) !important;
            border-color: var(--border-color) !important;
        }

        /* Draw panel light mode */
        body.light-mode #draw-panel {
            background: var(--card-bg) !important;
            border-color: rgba(14, 165, 233, 0.4) !important;
            color: var(--text-primary) !important;
        }

        body.light-mode #draw-dept,
        body.light-mode #draw-type,
        body.light-mode #draw-name {
            background: var(--elevated-bg) !important;
            border-color: var(--border-color) !important;
            color: var(--text-primary) !important;
        }

        body.light-mode #draw-panel label {
            color: var(--text-muted) !important;
        }

        /* ── Light mode popup — light theme; inline dept/status colors preserved ── */
        body.light-mode .leaflet-popup-content-wrapper {
            background: #ffffff !important;
            color: #1e293b !important;
            border: 1px solid rgba(14, 165, 233, 0.45) !important;
            border-radius: 14px !important;
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18) !important;
            overflow: hidden !important;
            padding: 0 !important;
        }

        body.light-mode .leaflet-popup-content {
            color: #1e293b !important;
        }

        body.light-mode .leaflet-popup-tip {
            background: #ffffff !important;
        }

        body.light-mode .leaflet-popup-close-button {
            color: #1e293b !important;
            background: rgba(14, 165, 233, 0.15) !important;
            border-radius: 50% !important;
        }

        body.light-mode .popup-body {
            background: #ffffff !important;
        }

        body.light-mode .popup-title {
            color: #0369a1 !important;
        }

        body.light-mode .popup-label {
            color: #64748b !important;
        }

        /* No !important here — lets inline style="color:${deptColor/statusColor}" win */
        body.light-mode .popup-value {
            color: #1e293b;
        }

        body.light-mode .popup-info {
            background: #ffffff !important;
        }

        body.light-mode .popup-photo-section {
            border-top-color: rgba(0, 0, 0, 0.08) !important;
            background: #f8fafc !important;
        }

        body.light-mode .popup-photo-section-label {
            color: #64748b !important;
            background: #f8fafc !important;
        }

        /* ─── GLOBAL SEARCH ─── */

        /* ─── NOTIFICATION BELL ─── */
        .notif-btn {
            position: relative;
            background: var(--elevated-bg);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 1.1rem;
            transition: all 0.2s ease;
        }

        .notif-btn:hover {
            border-color: var(--accent-blue);
            background: rgba(14, 165, 233, 0.08);
        }

        .notif-badge {
            position: absolute;
            top: -4px;
            right: -4px;
            background: var(--accent-red);
            color: white;
            border-radius: 50%;
            width: 18px;
            height: 18px;
            font-size: 0.65rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'JetBrains Mono', monospace;
            border: 2px solid var(--primary-dark);
            animation: notif-pulse 2s ease infinite;
        }

        @keyframes notif-pulse {

            0%,
            100% {
                box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4)
            }

            50% {
                box-shadow: 0 0 0 6px rgba(239, 68, 68, 0)
            }
        }

        .notif-panel {
            position: absolute;
            top: calc(100% + 10px);
            right: 0;
            width: 380px;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            z-index: 9999;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
            display: none;
        }

        .notif-panel.open {
            display: block;
            animation: fadeIn 0.2s ease;
        }

        .notif-panel-header {
            padding: 1rem 1.25rem;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .notif-panel-title {
            font-weight: 700;
            font-size: 0.95rem;
            color: var(--text-primary);
        }

        .notif-item {
            padding: 0.85rem 1.25rem;
            border-bottom: 1px solid var(--border-color);
            cursor: pointer;
            transition: background 0.15s;
        }

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

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

        .notif-item-title {
            font-size: 0.83rem;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 2px;
        }

        .notif-item-desc {
            font-size: 0.75rem;
            color: var(--text-secondary);
        }

        .notif-item-time {
            font-size: 0.68rem;
            color: var(--text-muted);
            margin-top: 4px;
            font-family: 'JetBrains Mono', monospace;
        }

        .notif-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--accent-red);
            flex-shrink: 0;
            margin-top: 4px;
        }

        .notif-empty {
            padding: 2rem;
            text-align: center;
            color: var(--text-muted);
            font-size: 0.85rem;
        }

        .notif-wrap {
            position: relative;
        }

        /* ─── THEME TOGGLE ─── */
        .theme-toggle-btn {
            background: var(--elevated-bg);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 1.1rem;
            transition: all 0.2s ease;
        }

        .theme-toggle-btn:hover {
            border-color: var(--accent-blue);
            background: rgba(14, 165, 233, 0.08);
        }

        /* ─── MAP EXPORT BUTTON ─── */
        .map-export-btn {
            background: var(--elevated-bg);
            border: 1px solid rgba(16, 185, 129, 0.35);
            border-radius: 8px;
            height: 40px;
            padding: 0 0.85rem;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 0.78rem;
            font-weight: 700;
            color: var(--accent-green);
            gap: 0.35rem;
            font-family: 'IBM Plex Sans', sans-serif;
            transition: all 0.2s ease;
            white-space: nowrap;
        }

        .map-export-btn:hover {
            border-color: var(--accent-green);
            background: rgba(16, 185, 129, 0.1);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
        }

        /* ─── MAP EXPORT WIZARD MODAL ─── */
        .map-export-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.82);
            z-index: 10500;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(10px);
        }

        .map-export-overlay.active {
            display: flex;
        }

        .map-export-modal {
            background: var(--secondary-dark);
            border: 1px solid var(--border-color);
            border-radius: 18px;
            width: 96vw;
            max-width: 1140px;
            height: 90vh;
            max-height: 90vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7);
        }

        .map-export-header {
            padding: 1.4rem 2rem;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: var(--card-bg);
            flex-shrink: 0;
        }

        .map-export-header h2 {
            font-family: 'Playfair Display', serif;
            font-size: 1.4rem;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 0.6rem;
        }

        .map-export-close {
            background: none;
            border: none;
            color: var(--text-muted);
            font-size: 1.2rem;
            cursor: pointer;
            width: 34px;
            height: 34px;
            border-radius: 7px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }

        .map-export-close:hover {
            background: var(--elevated-bg);
            color: var(--text-primary);
        }

        /* Stepper */
        .mex-stepper {
            display: flex;
            align-items: center;
            gap: 0;
            padding: 1.1rem 2rem;
            border-bottom: 1px solid var(--border-color);
            flex-shrink: 0;
            background: var(--primary-dark);
        }

        .mex-step {
            display: flex;
            align-items: center;
            gap: 0.55rem;
            font-size: 0.78rem;
            font-weight: 600;
            color: var(--text-muted);
            flex: 1;
            position: relative;
            justify-content: center;
        }

        .mex-step:not(:last-child)::after {
            content: '';
            position: absolute;
            left: 65%;
            right: -35%;
            top: 50%;
            height: 1px;
            background: var(--border-color);
            z-index: 0;
        }

        .mex-step-num {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            border: 2px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75rem;
            font-weight: 700;
            font-family: 'JetBrains Mono', monospace;
            transition: all 0.3s;
            background: var(--primary-dark);
            flex-shrink: 0;
        }

        .mex-step.active .mex-step-num {
            background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
            border-color: #0ea5e9;
            color: white;
        }

        .mex-step.done .mex-step-num {
            background: var(--accent-green);
            border-color: var(--accent-green);
            color: white;
        }

        .mex-step.active {
            color: var(--accent-blue);
        }

        .mex-step.done {
            color: var(--accent-green);
        }

        /* Body layout */
        .map-export-body {
            display: flex;
            flex: 1;
            overflow: hidden;
        }

        .mex-sidebar {
            width: 320px;
            flex-shrink: 0;
            border-right: 1px solid var(--border-color);
            overflow-y: auto;
            padding: 1.5rem;
            background: var(--card-bg);
        }

        .mex-preview-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            background: var(--primary-dark);
        }

        /* Sidebar steps */
        .mex-step-panel {
            display: none;
        }

        .mex-step-panel.active {
            display: block;
        }

        .mex-section-title {
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            color: var(--accent-blue);
            font-weight: 700;
            margin-bottom: 0.85rem;
        }

        .mex-fund-card {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.9rem 1rem;
            background: var(--elevated-bg);
            border: 2px solid var(--border-color);
            border-radius: 10px;
            cursor: pointer;
            margin-bottom: 0.6rem;
            transition: all 0.2s;
        }

        .mex-fund-card:hover {
            border-color: var(--accent-blue);
            background: rgba(14, 165, 233, 0.07);
        }

        .mex-fund-card.selected {
            border-color: var(--accent-blue);
            background: rgba(14, 165, 233, 0.12);
        }

        .mex-fund-dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .mex-fund-name {
            font-weight: 700;
            font-size: 0.88rem;
            color: var(--text-primary);
        }

        .mex-fund-count {
            font-size: 0.73rem;
            color: var(--text-muted);
            margin-top: 1px;
        }

        .mex-dept-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.5rem;
            margin-bottom: 1rem;
        }

        .mex-dept-chip {
            padding: 0.5rem 0.65rem;
            border-radius: 8px;
            border: 2px solid var(--border-color);
            background: var(--elevated-bg);
            cursor: pointer;
            font-size: 0.77rem;
            font-weight: 600;
            color: var(--text-secondary);
            transition: all 0.2s;
            text-align: center;
            display: flex;
            align-items: center;
            gap: 0.35rem;
        }

        .mex-dept-chip:hover {
            border-color: var(--accent-blue);
            color: var(--text-primary);
        }

        .mex-dept-chip.selected {
            border-color: var(--accent-blue);
            background: rgba(14, 165, 233, 0.12);
            color: var(--text-primary);
        }

        .mex-dept-chip span.dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        /* Map elements checkboxes */
        .mex-element-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.65rem 0.85rem;
            border-radius: 8px;
            background: var(--elevated-bg);
            margin-bottom: 0.45rem;
            cursor: pointer;
            border: 1px solid transparent;
            transition: all 0.2s;
        }

        .mex-element-row:hover {
            border-color: var(--border-color);
            background: var(--card-bg);
        }

        .mex-element-row.checked {
            border-color: rgba(14, 165, 233, 0.3);
            background: rgba(14, 165, 233, 0.06);
        }

        .mex-element-label {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            font-size: 0.83rem;
            color: var(--text-primary);
            font-weight: 500;
        }

        .mex-toggle {
            width: 34px;
            height: 18px;
            border-radius: 9px;
            background: var(--border-color);
            position: relative;
            transition: background 0.2s;
            flex-shrink: 0;
        }

        .mex-toggle::after {
            content: '';
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: white;
            position: absolute;
            top: 2px;
            left: 2px;
            transition: transform 0.2s;
        }

        .mex-element-row.checked .mex-toggle {
            background: var(--accent-blue);
        }

        .mex-element-row.checked .mex-toggle::after {
            transform: translateX(16px);
        }

        /* Input fields */
        .mex-input {
            width: 100%;
            background: var(--elevated-bg);
            border: 1px solid var(--border-color);
            border-radius: 7px;
            color: var(--text-primary);
            padding: 0.55rem 0.75rem;
            font-size: 0.82rem;
            font-family: 'IBM Plex Sans', sans-serif;
            outline: none;
            transition: border-color 0.2s;
            margin-bottom: 0.75rem;
        }

        .mex-input:focus {
            border-color: var(--accent-blue);
        }

        .mex-label {
            font-size: 0.72rem;
            color: var(--text-secondary);
            margin-bottom: 0.25rem;
            font-weight: 600;
        }

        /* Footer */
        .map-export-footer {
            padding: 1rem 2rem;
            border-top: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: var(--card-bg);
            flex-shrink: 0;
            gap: 1rem;
        }

        .mex-btn {
            padding: 0.65rem 1.4rem;
            border-radius: 8px;
            border: none;
            font-size: 0.85rem;
            font-weight: 700;
            cursor: pointer;
            font-family: 'IBM Plex Sans', sans-serif;
            transition: all 0.2s;
        }

        .mex-btn-ghost {
            background: var(--elevated-bg);
            border: 1px solid var(--border-color);
            color: var(--text-secondary);
        }

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

        .mex-btn-primary {
            background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
            color: white;
            box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
        }

        .mex-btn-primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
        }

        .mex-btn-primary:disabled {
            opacity: 0.4;
            cursor: not-allowed;
            transform: none;
        }

        .mex-btn-export {
            background: linear-gradient(135deg, #10b981, #0ea5e9);
            color: white;
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }

        .mex-btn-export:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
        }

        /* Base Layer Cards */
        .mex-baselayer-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.55rem;
            margin-bottom: 0.5rem;
        }

        .mex-baselayer-card {
            border-radius: 10px;
            border: 2px solid var(--border-color);
            background: var(--elevated-bg);
            cursor: pointer;
            transition: all 0.2s;
            overflow: hidden;
            position: relative;
        }

        .mex-baselayer-card:hover {
            border-color: var(--accent-blue);
            transform: translateY(-1px);
            box-shadow: 0 4px 14px rgba(14, 165, 233, 0.2);
        }

        .mex-baselayer-card.selected {
            border-color: var(--accent-blue);
            background: rgba(14, 165, 233, 0.08);
        }

        .mex-baselayer-card.selected::after {
            content: '✓';
            position: absolute;
            top: 6px;
            right: 7px;
            width: 18px;
            height: 18px;
            background: var(--accent-blue);
            border-radius: 50%;
            font-size: 0.6rem;
            color: white;
            font-weight: 700;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 18px;
            text-align: center;
        }

        .mex-baselayer-thumb {
            width: 100%;
            height: 52px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.6rem;
        }

        .mex-baselayer-label {
            padding: 5px 8px;
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--text-primary);
            line-height: 1.3;
            border-top: 1px solid var(--border-color);
        }

        .mex-baselayer-sub {
            font-size: 0.62rem;
            color: var(--text-muted);
            font-weight: 400;
        }

        /* Layout Template Cards */
        .mex-tpl-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.55rem;
            margin-bottom: 1rem;
        }

        .mex-tpl-card {
            border-radius: 10px;
            border: 2px solid var(--border-color);
            background: var(--elevated-bg);
            cursor: pointer;
            transition: all 0.2s;
            overflow: hidden;
            position: relative;
        }

        .mex-tpl-card:hover {
            border-color: var(--accent-blue);
            transform: translateY(-1px);
            box-shadow: 0 4px 14px rgba(14, 165, 233, 0.2);
        }

        .mex-tpl-card.selected {
            border-color: var(--accent-blue);
            background: rgba(14, 165, 233, 0.08);
        }

        .mex-tpl-card.selected::after {
            content: '✓';
            position: absolute;
            top: 6px;
            right: 7px;
            width: 18px;
            height: 18px;
            background: var(--accent-blue);
            border-radius: 50%;
            font-size: 0.6rem;
            color: white;
            font-weight: 700;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 18px;
            text-align: center;
        }

        .mex-tpl-thumb {
            width: 100%;
            height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 6px 10px;
            background: rgba(10, 15, 30, 0.4);
        }

        .mex-tpl-inner {
            position: relative;
            border: 1px solid rgba(14, 165, 233, 0.35);
            border-radius: 3px;
            background: rgba(14, 165, 233, 0.07);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .mex-tpl-inner.land {
            width: 72px;
            height: 46px;
        }

        .mex-tpl-inner.port {
            width: 40px;
            height: 55px;
        }

        .mex-tpl-inner.wide {
            width: 80px;
            height: 45px;
        }

        .mex-tpl-header {
            height: 7px;
            background: rgba(14, 165, 233, 0.5);
            flex-shrink: 0;
        }

        .mex-tpl-body {
            flex: 1;
            display: flex;
            flex-direction: row;
            gap: 2px;
            padding: 3px;
        }

        .mex-tpl-map {
            flex: 1;
            background: rgba(16, 185, 129, 0.3);
            border-radius: 2px;
        }

        .mex-tpl-sidebar {
            width: 12px;
            background: rgba(139, 92, 246, 0.3);
            border-radius: 2px;
            flex-shrink: 0;
        }

        .mex-tpl-footer {
            height: 5px;
            background: rgba(148, 163, 184, 0.2);
            flex-shrink: 0;
        }

        .mex-tpl-label {
            padding: 5px 8px;
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--text-primary);
            line-height: 1.3;
            border-top: 1px solid var(--border-color);
        }

        .mex-tpl-sub {
            font-size: 0.62rem;
            color: var(--text-muted);
            font-weight: 400;
        }

        /* Preview map container */
        .mex-preview-wrapper {
            flex: 1;
            position: relative;
            overflow: hidden;
        }

        #mex-preview-map {
            width: 100%;
            height: 100%;
        }

        .mex-preview-placeholder {
            position: absolute;
            inset: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            gap: 0.75rem;
        }

        .mex-preview-placeholder svg {
            opacity: 0.3;
        }

        /* Layout canvas overlays on the preview map */
        .mex-map-layout {
            position: relative;
            flex: 1;
            overflow: hidden;
            background: #1a2235;
        }

        #mex-layout-map {
            width: 100%;
            height: 100%;
        }

        /* Layout elements overlay */
        .mex-layout-overlay {
            position: absolute;
            inset: 0;
            pointer-events: none;
            z-index: 900;
        }

        .mex-north-arrow {
            position: absolute;
            top: 14px;
            right: 14px;
            width: 46px;
            height: 46px;
            background: rgba(10, 15, 30, 0.88);
            border: 1.5px solid rgba(148, 163, 184, 0.25);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.4rem;
        }

        .mex-scale-bar {
            position: absolute;
            bottom: 44px;
            left: 14px;
            background: rgba(10, 15, 30, 0.88);
            border: 1.5px solid rgba(148, 163, 184, 0.25);
            border-radius: 6px;
            padding: 4px 10px;
            font-size: 0.68rem;
            font-family: 'JetBrains Mono', monospace;
            color: var(--text-primary);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
        }

        .scale-bar-line {
            width: 80px;
            height: 6px;
            border: 1.5px solid rgba(148, 163, 184, 0.6);
            border-top: none;
            display: flex;
        }

        .scale-bar-seg {
            flex: 1;
            border-right: 1.5px solid rgba(148, 163, 184, 0.6);
        }

        .scale-bar-seg:nth-child(odd) {
            background: rgba(148, 163, 184, 0.5);
        }

        .mex-credits {
            position: absolute;
            bottom: 8px;
            left: 14px;
            background: rgba(10, 15, 30, 0.88);
            border: 1.5px solid rgba(148, 163, 184, 0.2);
            border-radius: 5px;
            padding: 3px 8px;
            font-size: 0.62rem;
            color: var(--text-muted);
            font-family: 'JetBrains Mono', monospace;
        }

        .mex-grid-overlay {
            position: absolute;
            inset: 0;
            background-image:
                linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
                linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
            background-size: 80px 80px;
        }

        .mex-legend-box {
            position: absolute;
            top: 56px;
            right: 14px;
            background: rgba(10, 15, 30, 0.92);
            border: 1.5px solid rgba(148, 163, 184, 0.25);
            border-radius: 8px;
            padding: 12px 16px;
            min-width: 190px;
            max-width: 240px;
            max-height: calc(100% - 120px);
            overflow-y: auto;
        }

        .mex-legend-title {
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: var(--accent-blue);
            margin-bottom: 10px;
        }

        .mex-legend-item {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 6px;
            font-size: 0.78rem;
            color: var(--text-secondary);
        }

        .mex-legend-dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .mex-title-bar {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            background: rgba(10, 15, 30, 0.94);
            border-bottom: 1.5px solid rgba(14, 165, 233, 0.25);
            padding: 8px 14px;
            display: flex;
            align-items: baseline;
            gap: 0.6rem;
            z-index: 901;
        }

        .mex-title-main {
            font-family: 'Playfair Display', serif;
            font-size: 1rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .mex-title-sub {
            font-size: 0.72rem;
            color: var(--accent-blue);
            font-weight: 600;
        }

        .mex-title-date {
            font-size: 0.65rem;
            color: var(--text-muted);
            font-family: 'JetBrains Mono', monospace;
            margin-left: auto;
        }

        .mex-map-noinit {
            position: absolute;
            inset: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            font-size: 0.85rem;
            gap: 0.5rem;
            background: var(--primary-dark);
        }

        /* Paper size selector */
        .mex-paper-row {
            display: flex;
            gap: 0.4rem;
            flex-wrap: wrap;
            margin-bottom: 0.75rem;
        }

        .mex-paper-chip {
            padding: 0.3rem 0.7rem;
            border-radius: 6px;
            border: 1.5px solid var(--border-color);
            background: var(--elevated-bg);
            font-size: 0.72rem;
            font-weight: 700;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.2s;
        }

        .mex-paper-chip.selected {
            border-color: var(--accent-blue);
            color: var(--accent-blue);
            background: rgba(14, 165, 233, 0.1);
        }

        /* Orientation selector */
        .mex-orient-row {
            display: flex;
            gap: 0.4rem;
            margin-bottom: 1rem;
        }

        .mex-orient-btn {
            flex: 1;
            padding: 0.45rem;
            border-radius: 7px;
            border: 1.5px solid var(--border-color);
            background: var(--elevated-bg);
            font-size: 0.75rem;
            font-weight: 700;
            color: var(--text-muted);
            cursor: pointer;
            text-align: center;
            transition: all 0.2s;
        }

        .mex-orient-btn.selected {
            border-color: var(--accent-blue);
            color: var(--accent-blue);
            background: rgba(14, 165, 233, 0.1);
        }

        /* Step progress indicator */
        .mex-step-info {
            font-size: 0.72rem;
            color: var(--text-muted);
            flex: 1;
        }

        /* ─── KEYBOARD SHORTCUT HINT ─── */
        .shortcut-badge {
            font-size: 0.6rem;
            font-family: 'JetBrains Mono', monospace;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 3px;
            padding: 1px 4px;
            color: var(--text-muted);
            margin-left: 4px;
            vertical-align: middle;
        }

        /* ─── ONBOARDING TOUR ─── */
        .tour-overlay {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 100000;
            pointer-events: none;
        }

        .tour-overlay.active {
            display: block;
        }

        .tour-backdrop {
            position: absolute;
            inset: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(2px);
        }

        .tour-tooltip {
            position: absolute;
            background: var(--card-bg);
            border: 1px solid rgba(14, 165, 233, 0.5);
            border-radius: 14px;
            padding: 1.5rem;
            width: 320px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
            pointer-events: all;
            z-index: 100001;
        }

        .tour-step-label {
            font-size: 0.65rem;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: var(--accent-blue);
            font-weight: 700;
            margin-bottom: 0.5rem;
        }

        .tour-step-title {
            font-family: 'Playfair Display', serif;
            font-size: 1.2rem;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 0.5rem;
        }

        .tour-step-desc {
            font-size: 0.85rem;
            color: var(--text-secondary);
            line-height: 1.6;
            margin-bottom: 1.25rem;
        }

        .tour-nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .tour-progress {
            display: flex;
            gap: 4px;
        }

        .tour-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--border-color);
            transition: background 0.2s;
        }

        .tour-dot.active {
            background: var(--accent-blue);
        }

        .tour-btn {
            padding: 0.5rem 1rem;
            border-radius: 6px;
            font-size: 0.82rem;
            font-weight: 700;
            cursor: pointer;
            border: none;
            font-family: 'IBM Plex Sans', sans-serif;
        }

        .tour-btn-prev {
            background: var(--elevated-bg);
            color: var(--text-secondary);
        }

        .tour-btn-next {
            background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
            color: white;
        }

        .tour-btn-skip {
            background: none;
            border: none;
            color: var(--text-muted);
            font-size: 0.75rem;
            cursor: pointer;
            text-decoration: underline;
            font-family: 'IBM Plex Sans', sans-serif;
        }

        .tour-highlight {
            position: absolute;
            border: 2px solid var(--accent-blue);
            border-radius: 8px;
            box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.6);
            pointer-events: none;
            z-index: 100000;
            transition: all 0.3s ease;
        }

        /* ─── ACTIVITY LOG ─── */
        .activity-panel {
            position: fixed;
            right: -400px;
            top: 0;
            bottom: 0;
            width: 380px;
            background: var(--card-bg);
            border-left: 1px solid var(--border-color);
            z-index: 9000;
            display: flex;
            flex-direction: column;
            transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
        }

        .activity-panel.open {
            right: 0;
        }

        .activity-panel-header {
            padding: 1.25rem 1.5rem;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
            background: var(--elevated-bg);
        }

        .activity-panel-title {
            font-weight: 700;
            font-size: 1rem;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .activity-panel-close {
            background: none;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 1.2rem;
        }

        .activity-list {
            flex: 1;
            overflow-y: auto;
            padding: 1rem;
        }

        .activity-item {
            display: flex;
            gap: 0.75rem;
            padding: 0.75rem 0;
            border-bottom: 1px solid var(--border-color);
        }

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

        .activity-icon {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.85rem;
            flex-shrink: 0;
        }

        .activity-content {
            flex: 1;
        }

        .activity-text {
            font-size: 0.82rem;
            color: var(--text-primary);
            line-height: 1.4;
        }

        .activity-time {
            font-size: 0.68rem;
            color: var(--text-muted);
            margin-top: 2px;
            font-family: 'JetBrains Mono', monospace;
        }

        /* ─── FAVORITES / BOOKMARKS ─── */
        .fav-btn {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 1rem;
            color: var(--text-muted);
            transition: all 0.2s ease;
            padding: 2px 4px;
        }

        .fav-btn.starred {
            color: #f59e0b;
        }

        .fav-btn:hover {
            transform: scale(1.2);
        }

        .favorites-panel {
            display: none;
            position: fixed;
            right: 1.5rem;
            top: 80px;
            width: 320px;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            z-index: 9999;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
            max-height: 500px;
            overflow-y: auto;
        }

        .favorites-panel.open {
            display: block;
            animation: fadeIn 0.2s ease;
        }

        /* ─── SESSION TIMEOUT ─── */
        .session-timeout-bar {
            display: none;
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: rgba(239, 68, 68, 0.95);
            color: white;
            padding: 0.75rem 2rem;
            z-index: 99999;
            align-items: center;
            justify-content: space-between;
            font-size: 0.9rem;
            font-weight: 600;
            backdrop-filter: blur(8px);
        }

        .session-timeout-bar.visible {
            display: flex;
            animation: slideUp 0.3s ease;
        }

        @keyframes slideUp {
            from {
                transform: translateY(100%)
            }

            to {
                transform: translateY(0)
            }
        }

        /* ─── OFFLINE INDICATOR ─── */
        .offline-banner {
            display: none;
            position: fixed;
            top: 65px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(239, 68, 68, 0.95);
            color: white;
            padding: 0.5rem 1.5rem;
            border-radius: 0 0 10px 10px;
            font-size: 0.82rem;
            font-weight: 700;
            z-index: 9999;
            align-items: center;
            gap: 0.5rem;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
        }

        .offline-banner.visible {
            display: flex;
            animation: fadeIn 0.3s ease;
        }

        /* ─── MAP: COORDINATE DISPLAY ─── */
        /* ─── MAP: DISTANCE MEASURE ─── */
        .map-measure-info {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(10, 15, 30, 0.92);
            border: 1px solid var(--accent-blue);
            border-radius: 10px;
            padding: 0.75rem 1.25rem;
            font-size: 0.82rem;
            color: var(--text-primary);
            z-index: 1002;
            text-align: center;
            pointer-events: none;
            display: none;
            backdrop-filter: blur(8px);
        }

        .map-measure-info.visible {
            display: block;
        }

        /* ─── MAP: ANNOTATION ─── */
        .map-annotation-popup {
            position: absolute;
            z-index: 1100;
            background: var(--card-bg);
            border: 1px solid rgba(14, 165, 233, 0.5);
            border-radius: 10px;
            padding: 1rem;
            width: 260px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
            display: none;
        }

        .map-annotation-popup.open {
            display: block;
        }

        /* ─── DATE RANGE PICKER ─── */
        .date-range-wrap {
            display: flex;
            gap: 0.5rem;
            align-items: center;
            padding: 0.6rem 1rem;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            font-size: 0.82rem;
            color: var(--text-secondary);
        }

        .date-range-input {
            background: var(--elevated-bg);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            color: var(--text-primary);
            padding: 0.35rem 0.6rem;
            font-size: 0.8rem;
            font-family: 'IBM Plex Sans', sans-serif;
            outline: none;
            cursor: pointer;
        }

        .date-range-input:focus {
            border-color: var(--accent-blue);
        }

        /* ─── SAVED FILTER PRESETS ─── */
        .preset-panel {
            background: var(--elevated-bg);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 0.75rem 1rem;
            margin-bottom: 1rem;
            display: flex;
            gap: 0.5rem;
            align-items: center;
            flex-wrap: wrap;
        }

        .preset-chip {
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 20px;
            padding: 3px 12px;
            font-size: 0.75rem;
            font-weight: 600;
            cursor: pointer;
            color: var(--text-secondary);
            transition: all 0.18s ease;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .preset-chip:hover {
            border-color: var(--accent-blue);
            color: var(--accent-blue);
        }

        .preset-chip.active {
            background: rgba(14, 165, 233, 0.15);
            border-color: var(--accent-blue);
            color: var(--accent-blue);
        }

        .preset-save-btn {
            background: rgba(16, 185, 129, 0.1);
            border: 1px solid rgba(16, 185, 129, 0.35);
            border-radius: 20px;
            padding: 3px 12px;
            font-size: 0.75rem;
            font-weight: 700;
            cursor: pointer;
            color: var(--accent-green);
            transition: all 0.18s ease;
        }

        .preset-save-btn:hover {
            background: rgba(16, 185, 129, 0.2);
        }

        /* ─── COLUMN VISIBILITY ─── */
        .col-toggle-panel {
            position: absolute;
            top: 100%;
            right: 0;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            z-index: 999;
            min-width: 200px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
            display: none;
        }

        .col-toggle-panel.open {
            display: block;
            animation: fadeIn 0.15s ease;
        }

        .col-toggle-header {
            padding: 0.6rem 1rem;
            border-bottom: 1px solid var(--border-color);
            font-size: 0.72rem;
            text-transform: uppercase;
            font-weight: 700;
            color: var(--accent-blue);
            letter-spacing: 0.08em;
        }

        .col-toggle-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            cursor: pointer;
            font-size: 0.8rem;
            color: var(--text-secondary);
            border-bottom: 1px solid var(--border-color);
            transition: background 0.15s;
        }

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

        .col-toggle-item:hover {
            background: var(--elevated-bg);
        }

        .col-toggle-item input[type=checkbox] {
            accent-color: var(--accent-blue);
            cursor: pointer;
        }

        /* ─── REPORT SHARE ─── */
        .share-modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.75);
            z-index: 9999;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(8px);
        }

        .share-modal-overlay.active {
            display: flex;
        }

        .share-modal {
            background: var(--secondary-dark);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            padding: 2rem;
            max-width: 480px;
            width: 90%;
            box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
        }

        .share-modal h3 {
            font-family: 'Playfair Display', serif;
            font-size: 1.4rem;
            margin-bottom: 1.25rem;
        }

        .share-option {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1rem;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            cursor: pointer;
            margin-bottom: 0.75rem;
            transition: all 0.2s ease;
        }

        .share-option:hover {
            border-color: var(--accent-blue);
            transform: translateX(4px);
        }

        .share-link-box {
            background: var(--elevated-bg);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 0.75rem 1rem;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.78rem;
            color: var(--text-secondary);
            word-break: break-all;
            margin-bottom: 1rem;
        }

        /* ─── DRAG-AND-DROP CARDS ─── */
        .draggable-card {
            cursor: grab;
        }

        .draggable-card:active {
            cursor: grabbing;
        }

        .draggable-card.dragging {
            opacity: 0.5;
            border: 2px dashed var(--accent-blue);
        }

        .drag-over {
            border: 2px dashed var(--accent-green) !important;
        }

        /* ─── HELP/SHORTCUTS MODAL ─── */
        .help-modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.75);
            z-index: 9999;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(8px);
        }

        .help-modal-overlay.active {
            display: flex;
        }

        .help-modal {
            background: var(--secondary-dark);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            padding: 2rem;
            max-width: 560px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
        }

        .shortcut-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.6rem 0;
            border-bottom: 1px solid var(--border-color);
        }

        .shortcut-row:last-child {
            border-bottom: none;
        }

        .shortcut-key {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.8rem;
            background: var(--elevated-bg);
            border: 1px solid var(--border-color);
            border-radius: 4px;
            padding: 2px 8px;
            color: var(--accent-blue);
        }

        .shortcut-desc {
            font-size: 0.85rem;
            color: var(--text-secondary);
        }

        /* ─── MOBILE RESPONSIVE ENHANCEMENTS ─── */
        @media (max-width: 768px) {
            .notif-panel {
                width: 320px;
                right: -80px;
            }

            .header-actions {
                flex-wrap: wrap;
                gap: 0.5rem !important;
            }

            .header-actions .export-report-btn span.btn-label {
                display: none;
            }
        }

        /* ─── GENERAL TWEAKS ─── */
        .tooltip-hint {
            position: relative;
        }

        .tooltip-hint::after {
            content: attr(data-tooltip);
            position: absolute;
            bottom: -32px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 0, 0, 0.85);
            color: white;
            padding: 4px 10px;
            border-radius: 6px;
            font-size: 0.72rem;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease;
            z-index: 9999;
        }

        .tooltip-hint:hover::after {
            opacity: 1;
        }

        /* map annotation icon */
        .map-note-icon {
            font-size: 1.4rem;
            cursor: pointer;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
            transition: transform 0.15s;
        }

        .map-note-icon:hover {
            transform: scale(1.2);
        }

        /* ─── LOGIN SYSTEM ─── */
        .login-btn {
            background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(14, 165, 233, 0.25));
            border: 1.5px solid rgba(139, 92, 246, 0.4);
            color: #c4b5fd;
            font-weight: 700;
            font-size: 0.82rem;
            padding: 0.5rem 1.1rem;
            border-radius: 10px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.4rem;
            transition: all 0.25s ease;
            font-family: 'IBM Plex Sans', sans-serif;
        }

        .login-btn:hover {
            background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(14, 165, 233, 0.4));
            border-color: rgba(139, 92, 246, 0.7);
            transform: translateY(-1px);
            box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
        }

        .login-modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.8);
            z-index: 99999;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(12px);
        }

        .login-modal-overlay.active {
            display: flex;
            animation: fadeIn 0.25s ease;
        }

        .login-modal {
            background: var(--secondary-dark);
            border: 1px solid var(--border-color);
            border-radius: 20px;
            padding: 2.5rem;
            max-width: 520px;
            width: 92%;
            box-shadow: 0 32px 100px rgba(0, 0, 0, 0.7);
        }

        .login-modal h2 {
            font-family: 'Playfair Display', serif;
            font-size: 1.6rem;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 0.5rem;
        }

        .login-modal .login-subtitle {
            font-size: 0.85rem;
            color: var(--text-muted);
            margin-bottom: 1.5rem;
        }

        .login-type-cards {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .login-type-card {
            background: var(--card-bg);
            border: 2px solid var(--border-color);
            border-radius: 14px;
            padding: 1.5rem;
            text-align: center;
            cursor: pointer;
            transition: all 0.25s ease;
        }

        .login-type-card:hover {
            border-color: rgba(14, 165, 233, 0.5);
            transform: translateY(-3px);
            box-shadow: 0 8px 30px rgba(14, 165, 233, 0.15);
        }

        .login-type-card.selected {
            border-color: #8b5cf6;
            background: rgba(139, 92, 246, 0.08);
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
        }

        .login-type-card .ltc-icon {
            font-size: 2.2rem;
            margin-bottom: 0.5rem;
        }

        .login-type-card .ltc-title {
            font-weight: 700;
            font-size: 0.95rem;
            color: var(--text-primary);
            margin-bottom: 0.25rem;
        }

        .login-type-card .ltc-desc {
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        .login-form {
            display: none;
        }

        .login-form.active {
            display: block;
            animation: fadeIn 0.3s ease;
        }

        .login-form label {
            display: block;
            font-size: 0.78rem;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin-bottom: 0.4rem;
        }

        .login-form select,
        .login-form input[type="password"] {
            width: 100%;
            background: var(--elevated-bg);
            border: 1.5px solid var(--border-color);
            border-radius: 10px;
            padding: 0.7rem 1rem;
            font-size: 0.9rem;
            color: var(--text-primary);
            outline: none;
            font-family: 'IBM Plex Sans', sans-serif;
            margin-bottom: 1rem;
            transition: border-color 0.2s ease;
        }

        .login-form select:focus,
        .login-form input[type="password"]:focus {
            border-color: rgba(139, 92, 246, 0.6);
        }

        .login-submit-btn {
            width: 100%;
            padding: 0.8rem;
            background: linear-gradient(135deg, #8b5cf6, #0ea5e9);
            color: white;
            border: none;
            border-radius: 10px;
            font-size: 0.95rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.25s ease;
            font-family: 'IBM Plex Sans', sans-serif;
        }

        .login-submit-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 24px rgba(139, 92, 246, 0.4);
        }

        .login-error {
            background: rgba(239, 68, 68, 0.12);
            border: 1px solid rgba(239, 68, 68, 0.3);
            color: #f87171;
            border-radius: 8px;
            padding: 0.6rem 1rem;
            font-size: 0.82rem;
            font-weight: 600;
            margin-bottom: 1rem;
            display: none;
        }

        .login-error.visible {
            display: block;
            animation: fadeIn 0.2s ease;
        }

        .login-success {
            background: rgba(34, 197, 94, 0.12);
            border: 1px solid rgba(34, 197, 94, 0.3);
            color: #4ade80;
            border-radius: 8px;
            padding: 0.6rem 1rem;
            font-size: 0.82rem;
            font-weight: 600;
            margin-bottom: 1rem;
            display: none;
        }

        .login-success.visible {
            display: block;
            animation: fadeIn 0.2s ease;
        }

        .session-bar {
            display: none;
            align-items: center;
            gap: 0.5rem;
            background: rgba(139, 92, 246, 0.12);
            border: 1px solid rgba(139, 92, 246, 0.3);
            border-radius: 10px;
            padding: 0.35rem 0.85rem;
            font-size: 0.78rem;
            color: #c4b5fd;
            font-weight: 600;
        }

        .session-bar.active {
            display: flex;
        }

        .session-bar .logout-btn {
            background: rgba(239, 68, 68, 0.15);
            border: 1px solid rgba(239, 68, 68, 0.3);
            color: #f87171;
            border-radius: 6px;
            padding: 2px 8px;
            font-size: 0.7rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .session-bar .logout-btn:hover {
            background: rgba(239, 68, 68, 0.3);
        }

        /* ─── ADMIN / DEPT PANELS ─── */
        .auth-panel-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(5, 10, 20, 0.92);
            z-index: 50000;
            overflow-y: auto;
            backdrop-filter: blur(6px);
        }

        .auth-panel-overlay.active {
            display: block;
            animation: fadeIn 0.3s ease;
        }

        .auth-panel {
            max-width: 1200px;
            margin: 1.5rem auto;
            padding: 2rem;
        }

        .auth-panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 2rem;
            padding-bottom: 1.5rem;
            border-bottom: 1px solid var(--border-color);
        }

        .auth-panel-header h2 {
            font-family: 'Playfair Display', serif;
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .auth-panel-close {
            background: rgba(148, 163, 184, 0.1);
            border: 1px solid rgba(148, 163, 184, 0.2);
            color: #94a3b8;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            font-size: 1.1rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }

        .auth-panel-close:hover {
            background: rgba(148, 163, 184, 0.25);
        }

        .de-form-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
        }

        .de-form-grid.three-col {
            grid-template-columns: 1fr 1fr 1fr;
        }

        .de-field {
            display: flex;
            flex-direction: column;
            gap: 0.3rem;
        }

        .de-field.full-width {
            grid-column: 1 / -1;
        }

        .de-field label {
            font-size: 0.72rem;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }

        .de-field input,
        .de-field select,
        .de-field textarea {
            background: var(--elevated-bg);
            border: 1.5px solid var(--border-color);
            border-radius: 8px;
            padding: 0.6rem 0.85rem;
            font-size: 0.88rem;
            color: var(--text-primary);
            outline: none;
            font-family: 'IBM Plex Sans', sans-serif;
            transition: border-color 0.2s ease;
        }

        .de-field input:focus,
        .de-field select:focus,
        .de-field textarea:focus {
            border-color: rgba(14, 165, 233, 0.5);
        }

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

        .de-submit-btn {
            padding: 0.85rem 2.5rem;
            background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
            color: white;
            border: none;
            border-radius: 10px;
            font-size: 1rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.25s ease;
            font-family: 'IBM Plex Sans', sans-serif;
        }

        .de-submit-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 24px rgba(14, 165, 233, 0.4);
        }

        .de-submit-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
        }

        .admin-card {
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 14px;
            padding: 1.5rem;
        }

        .admin-card h3 {
            font-family: 'Playfair Display', serif;
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 1rem;
        }

        /* ─── UPDATE HISTORY / AUDIT TRAIL ─── */
        .uh-section-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1.25rem;
            flex-wrap: wrap;
            gap: 0.75rem;
        }

        .uh-filter-bar {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
            align-items: center;
        }

        .uh-filter-select {
            background: var(--elevated-bg);
            border: 1px solid var(--border-color);
            border-radius: 7px;
            color: var(--text-secondary);
            font-size: 0.78rem;
            font-family: 'IBM Plex Sans', sans-serif;
            padding: 0.4rem 0.75rem;
            outline: none;
            cursor: pointer;
            transition: border-color 0.2s;
        }

        .uh-filter-select:focus {
            border-color: rgba(14, 165, 233, 0.5);
        }

        .uh-clear-btn {
            background: rgba(239, 68, 68, 0.1);
            border: 1px solid rgba(239, 68, 68, 0.25);
            border-radius: 7px;
            color: #ef4444;
            font-size: 0.75rem;
            font-family: 'IBM Plex Sans', sans-serif;
            padding: 0.4rem 0.85rem;
            cursor: pointer;
            font-weight: 600;
            transition: background 0.2s;
        }

        .uh-clear-btn:hover {
            background: rgba(239, 68, 68, 0.2);
        }

        .uh-empty-state {
            text-align: center;
            padding: 2.5rem 1rem;
            color: var(--text-muted);
        }

        .uh-empty-icon {
            font-size: 2.5rem;
            margin-bottom: 0.6rem;
        }

        .uh-empty-title {
            font-size: 0.95rem;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 0.3rem;
        }

        .uh-empty-desc {
            font-size: 0.8rem;
        }

        /* Timeline */
        .uh-timeline {
            display: flex;
            flex-direction: column;
            gap: 0;
            position: relative;
        }

        .uh-timeline::before {
            content: '';
            position: absolute;
            left: 19px;
            top: 8px;
            bottom: 8px;
            width: 2px;
            background: linear-gradient(180deg, rgba(14, 165, 233, 0.4) 0%, rgba(139, 92, 246, 0.2) 100%);
            border-radius: 2px;
        }

        .uh-entry {
            display: flex;
            gap: 1rem;
            padding: 0.9rem 0.5rem 1.2rem 0.5rem;
            position: relative;
            border-bottom: 1px solid var(--border-color);
            transition: background 0.2s;
        }

        .uh-entry:last-child {
            border-bottom: none;
        }

        .uh-entry:hover {
            background: rgba(14, 165, 233, 0.03);
            border-radius: 10px;
        }

        .uh-dot {
            flex-shrink: 0;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
            border: 2px solid var(--card-bg);
            margin-top: 3px;
            box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
            z-index: 1;
        }

        .uh-body {
            flex: 1;
            min-width: 0;
        }

        .uh-meta {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            flex-wrap: wrap;
            margin-bottom: 0.55rem;
        }

        .uh-dept-badge {
            background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(139, 92, 246, 0.15));
            border: 1px solid rgba(14, 165, 233, 0.25);
            border-radius: 20px;
            padding: 0.2rem 0.7rem;
            font-size: 0.72rem;
            font-weight: 700;
            color: #7dd3fc;
            letter-spacing: 0.02em;
        }

        .uh-project-name {
            font-size: 0.88rem;
            font-weight: 700;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 280px;
        }

        .uh-timestamp {
            font-size: 0.72rem;
            color: var(--text-muted);
            font-family: 'JetBrains Mono', monospace;
            margin-left: auto;
            white-space: nowrap;
        }

        .uh-changes {
            display: flex;
            flex-direction: column;
            gap: 0.3rem;
        }

        .uh-change-row {
            display: flex;
            align-items: baseline;
            gap: 0.5rem;
            font-size: 0.8rem;
            flex-wrap: wrap;
        }

        .uh-field-label {
            font-size: 0.68rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--text-muted);
            white-space: nowrap;
            min-width: 80px;
        }

        .uh-old-val {
            color: #f87171;
            background: rgba(239, 68, 68, 0.08);
            border-radius: 4px;
            padding: 0.1rem 0.45rem;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.75rem;
            text-decoration: line-through;
            max-width: 180px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .uh-arrow {
            color: var(--text-muted);
            font-size: 0.7rem;
        }

        .uh-new-val {
            color: #4ade80;
            background: rgba(34, 197, 94, 0.08);
            border-radius: 4px;
            padding: 0.1rem 0.45rem;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.75rem;
            max-width: 180px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .uh-no-change-note {
            font-size: 0.78rem;
            color: var(--text-muted);
            font-style: italic;
        }

        .uh-fund-tag {
            font-size: 0.65rem;
            padding: 0.15rem 0.5rem;
            border-radius: 4px;
            font-weight: 700;
            letter-spacing: 0.04em;
        }

        .uh-fund-district {
            background: rgba(14, 165, 233, 0.15);
            color: #38bdf8;
        }

        .uh-fund-state {
            background: rgba(16, 185, 129, 0.15);
            color: #34d399;
        }

        .uh-fund-central {
            background: rgba(245, 158, 11, 0.15);
            color: #fbbf24;
        }

        .uh-fund-other {
            background: rgba(139, 92, 246, 0.15);
            color: #a78bfa;
        }

        .uh-pagination {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-top: 1rem;
            padding-top: 0.75rem;
            border-top: 1px solid var(--border-color);
        }

        .uh-page-info {
            font-size: 0.78rem;
            color: var(--text-muted);
        }

        .uh-page-btns {
            display: flex;
            gap: 0.4rem;
        }

        .uh-page-btn {
            background: var(--elevated-bg);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            color: var(--text-secondary);
            font-size: 0.78rem;
            font-family: 'IBM Plex Sans', sans-serif;
            padding: 0.3rem 0.7rem;
            cursor: pointer;
            transition: border-color 0.2s, color 0.2s;
        }

        .uh-page-btn:hover:not(:disabled) {
            border-color: var(--accent-blue);
            color: var(--accent-blue);
        }

        .uh-page-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .uh-summary-strip {
            display: flex;
            gap: 0.75rem;
            flex-wrap: wrap;
            margin-bottom: 1.25rem;
        }

        .uh-stat-pill {
            background: var(--elevated-bg);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 0.4rem 0.85rem;
            font-size: 0.78rem;
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }

        .uh-stat-pill strong {
            color: var(--text-primary);
            font-size: 0.9rem;
        }

        .dept-password-table {
            width: 100%;
            border-collapse: collapse;
        }

        .dept-password-table th,
        .dept-password-table td {
            padding: 0.6rem 1rem;
            text-align: left;
            border-bottom: 1px solid var(--border-color);
            font-size: 0.85rem;
        }

        .dept-password-table th {
            font-size: 0.72rem;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }

        .dept-password-table td {
            color: var(--text-secondary);
        }

        .pwd-reveal-btn {
            background: rgba(14, 165, 233, 0.12);
            border: 1px solid rgba(14, 165, 233, 0.3);
            color: #38bdf8;
            border-radius: 6px;
            padding: 2px 10px;
            font-size: 0.72rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .pwd-reveal-btn:hover {
            background: rgba(14, 165, 233, 0.25);
        }

        /* ─── DATA ENTRY MAP ─── */
        #de-map {
            background: var(--primary-dark);
        }

        #de-map .leaflet-control-draw a {
            background-color: var(--card-bg) !important;
            color: var(--text-primary) !important;
            border: 1px solid var(--border-color) !important;
        }

        #de-map .leaflet-draw-toolbar a {
            background-color: var(--card-bg) !important;
        }

        .de-auto-field {
            background: var(--elevated-bg);
            border: 1.5px solid var(--border-color);
            border-radius: 8px;
            padding: 0.6rem 0.85rem;
            font-size: 0.88rem;
            font-family: 'JetBrains Mono', monospace;
            font-weight: 700;
        }

        .status-badge {
            display: inline-block;
            padding: 3px 12px;
            border-radius: 20px;
            font-size: 0.72rem;
            font-weight: 700;
            letter-spacing: 0.06em;
        }

        .status-badge.status-planned {
            background: rgba(100, 116, 139, 0.15);
            color: #94a3b8;
            border: 1px solid rgba(100, 116, 139, 0.3);
        }

        .status-badge.status-ongoing {
            background: rgba(234, 179, 8, 0.15);
            color: #eab308;
            border: 1px solid rgba(234, 179, 8, 0.3);
        }

        .status-badge.status-completed {
            background: rgba(34, 197, 94, 0.15);
            color: #22c55e;
            border: 1px solid rgba(34, 197, 94, 0.3);
        }

        .status-badge.status-delayed {
            background: rgba(239, 68, 68, 0.15);
            color: #ef4444;
            border: 1px solid rgba(239, 68, 68, 0.3);
        }

/* ================================================================ */

/* ── Section 4: Print & GIS Overlay Styles ── */
/* ── Print preview overlay ── */
        #gis-print-preview {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 100000;
            background: #0f1523;
            flex-direction: column;
            font-family: 'IBM Plex Sans', sans-serif;
        }

        #gis-print-preview.active {
            display: flex;
        }

        .gpp-page {
            flex: 1;
            display: flex;
            flex-direction: column;
            padding: 10px;
            min-height: 0;
        }

        .gpp-neatline {
            flex: 1;
            display: flex;
            flex-direction: column;
            border: 3px solid #2d3a52;
            background: #1a2235;
            min-height: 0;
            overflow: hidden;
        }

        /* Title block */
        #gis-pp-titleblock {
            background: linear-gradient(135deg, #0f1523 0%, #1a2235 100%);
            border-bottom: 2px solid rgba(14, 165, 233, 0.35);
            padding: 8px 16px 7px;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .gpp-title-left {
            flex: 1;
        }

        .gpp-title-main {
            font-family: 'Playfair Display', serif;
            font-size: 15pt;
            font-weight: 800;
            color: #f1f5f9;
            line-height: 1.1;
        }

        .gpp-title-sub {
            font-size: 8.5pt;
            color: #0ea5e9;
            font-weight: 600;
            margin-top: 2px;
        }

        .gpp-title-meta {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 3px;
            flex-shrink: 0;
        }

        .gpp-date,
        .gpp-scale {
            font-size: 7pt;
            color: #64748b;
            font-family: 'JetBrains Mono', monospace;
        }

        .gpp-stats {
            font-size: 7pt;
            color: #94a3b8;
        }

        /* Map row */
        #gis-pp-maprow {
            flex: 1;
            display: flex;
            overflow: hidden;
            min-height: 0;
        }

        #gis-pp-maparea {
            flex: 1;
            position: relative;
            overflow: hidden;
            min-height: 0;
        }

        #gis-pp-map {
            position: absolute;
            inset: 0;
        }

        /* Overlays */
        #gis-pp-grid {
            position: absolute;
            inset: 0;
            pointer-events: none;
            z-index: 900;
            background-image:
                linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
                linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
            background-size: 80px 80px;
        }

        #gis-pp-scalebar {
            position: absolute;
            bottom: 36px;
            left: 14px;
            z-index: 900;
            pointer-events: none;
            background: rgba(10, 15, 30, 0.9);
            border: 1.5px solid rgba(148, 163, 184, 0.3);
            border-radius: 5px;
            padding: 4px 10px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
        }

        .gpp-scale-line {
            width: 90px;
            height: 7px;
            border: 1.5px solid rgba(148, 163, 184, 0.7);
            border-top: none;
            display: flex;
        }

        .gpp-scale-seg {
            flex: 1;
            border-right: 1.5px solid rgba(148, 163, 184, 0.7);
        }

        .gpp-scale-seg:nth-child(odd) {
            background: rgba(200, 210, 220, 0.6);
        }

        .gpp-scale-seg:nth-child(even) {
            background: rgba(10, 15, 30, 0.3);
        }

        .gpp-scale-txt {
            font-size: 6.5pt;
            color: #f1f5f9;
            font-family: 'JetBrains Mono', monospace;
            margin-top: 1px;
        }

        #gis-pp-creditsbar {
            position: absolute;
            bottom: 8px;
            left: 14px;
            z-index: 900;
            pointer-events: none;
            background: rgba(10, 15, 30, 0.88);
            border: 1px solid rgba(148, 163, 184, 0.15);
            border-radius: 4px;
            padding: 3px 7px;
            font-size: 6pt;
            color: #64748b;
            font-family: 'JetBrains Mono', monospace;
        }

        /* Right panel — wider for more legend content */
        #gis-pp-rightpanel {
            width: 300px;
            flex-shrink: 0;
            background: #0f1523;
            border-left: 1.5px solid #2d3a52;
            display: flex;
            flex-direction: column;
            padding: 10px 10px;
            gap: 10px;
            overflow-y: auto;
            overflow-x: hidden;
        }

        /* Legend — fills the right panel */
        #gis-pp-legend {
            flex: 1;
            overflow-y: auto;
            min-height: 0;
        }

        .gpp-leg-title {
            font-size: 8pt;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: #0ea5e9;
            margin-bottom: 6px;
            padding-bottom: 4px;
            border-bottom: 1px solid rgba(14, 165, 233, 0.2);
        }

        .leg-sec {
            font-size: 6.5pt;
            color: rgba(148, 163, 184, 0.6);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin: 5px 0 3px;
        }

        .leg-item {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-bottom: 4px;
            font-size: 7.5pt;
            color: #94a3b8;
        }

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

        /* North arrow — absolute overlay on map, top-right */
        #gis-pp-north {
            display: flex;
            justify-content: center;
            position: absolute;
            top: 14px;
            right: 14px;
            z-index: 910;
            pointer-events: none;
        }

        /* Inset — absolute overlay on map, bottom-right */
        #gis-pp-inset {
            position: absolute;
            bottom: 14px;
            right: 14px;
            z-index: 910;
            pointer-events: none;
            width: 130px;
        }

        .gpp-inset-label {
            font-size: 6.5pt;
            color: #94a3b8;
            text-align: center;
            margin-bottom: 3px;
            font-family: 'JetBrains Mono', monospace;
        }

        #gis-pp-insetmap {
            width: 100%;
            height: 90px;
            border: 1.5px solid rgba(148, 163, 184, 0.35);
            border-radius: 4px;
            overflow: hidden;
            background: #1a2235;
        }

        /* Feature project-name labels on the print map */
        .gpp-feature-label {
            background: rgba(10, 15, 30, 0.82) !important;
            border: 1px solid rgba(14, 165, 233, 0.35) !important;
            border-radius: 4px !important;
            padding: 2px 6px !important;
            font-family: 'IBM Plex Sans', sans-serif !important;
            font-size: 6.5pt !important;
            font-weight: 600 !important;
            color: #e2e8f0 !important;
            white-space: nowrap !important;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55) !important;
            pointer-events: none !important;
            max-width: 140px !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
        }

        .gpp-feature-label::before {
            border-color: transparent rgba(14, 165, 233, 0.35) transparent transparent !important;
        }

        /* Bottom bar */
        #gis-pp-bottombar {
            background: #0f1523;
            border-top: 1.5px solid #2d3a52;
            padding: 4px 14px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 6pt;
            color: #475569;
            font-family: 'JetBrains Mono', monospace;
            flex-shrink: 0;
        }

        /* Toolbar */
        #gis-pp-toolbar {
            position: fixed;
            bottom: 22px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 100001;
            background: rgba(10, 15, 30, 0.95);
            border: 1px solid rgba(14, 165, 233, 0.3);
            border-radius: 14px;
            padding: 12px 22px;
            display: flex;
            align-items: center;
            gap: 12px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(8px);
        }

        #gis-pp-toolbar button {
            border: none;
            border-radius: 10px;
            padding: 10px 24px;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            font-family: 'IBM Plex Sans', sans-serif;
        }

        #gis-pp-btn-print {
            background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
            color: #fff;
            box-shadow: 0 4px 18px rgba(14, 165, 233, 0.45);
        }

        #gis-pp-btn-close {
            background: rgba(30, 40, 60, 0.9);
            color: #94a3b8;
            border: 1px solid rgba(148, 163, 184, 0.2) !important;
        }

        #gis-pp-status {
            font-size: 11px;
            color: #f59e0b;
        }

        /* ── @media print — show ONLY the overlay ── */
        @media print {
            body>*:not(#gis-print-preview) {
                display: none !important;
            }

            #gis-print-preview {
                display: flex !important;
                position: static !important;
                height: 100vh !important;
            }

            #gis-pp-toolbar {
                display: none !important;
            }

            * {
                -webkit-print-color-adjust: exact !important;
                print-color-adjust: exact !important;
            }
        }