        :root {
            --bg-gradient: radial-gradient(circle at top right, #1a1a2e, #0e0e17);
            --panel-bg: rgba(22, 22, 37, 0.65);
            --panel-border: rgba(255, 255, 255, 0.07);
            --text-primary: #f3f4f6;
            --text-secondary: #9ca3af;
            --primary-accent: #06b6d4;
            /* Cyan */
            --primary-glow: rgba(6, 182, 212, 0.15);
            --hmo-accent: #f59e0b;
            /* Amber */
            --hmo-glow: rgba(245, 158, 11, 0.15);
            --pending-accent: #f97316;
            /* Orange */
            --pending-glow: rgba(249, 115, 22, 0.15);
            --registered-accent: #c084fc;
            /* Lavender */
            --registered-glow: rgba(168, 85, 247, 0.15);
            --success-accent: #10b981;
            /* Emerald */
            --success-glow: rgba(16, 189, 129, 0.15);
            --danger-accent: #ef4444;
            /* Red */
            --danger-glow: rgba(239, 68, 68, 0.15);
            --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
            --glass-blur: blur(12px);
        }

        /* ===== LIGHT MODE ===== */
        body.light-mode {
            --bg-gradient: radial-gradient(circle at top right, #e8edf5, #f4f6fb);
            --panel-bg: rgba(255, 255, 255, 0.80);
            --panel-border: rgba(0, 0, 0, 0.09);
            --text-primary: #111827;
            --text-secondary: #4b5563;
            --primary-accent: #0891b2;
            /* Deep Cyan */
            --primary-glow: rgba(8, 145, 178, 0.10);
            --hmo-accent: #d97706;
            /* Dark Amber */
            --hmo-glow: rgba(217, 119, 6, 0.10);
            --pending-accent: #ea580c;
            /* Dark Orange */
            --pending-glow: rgba(234, 88, 12, 0.10);
            --registered-accent: #7c3aed;
            /* Vibrant Purple */
            --registered-glow: rgba(124, 58, 237, 0.10);
            --success-accent: #059669;
            /* Dark Emerald */
            --success-glow: rgba(5, 150, 105, 0.10);
            --danger-accent: #dc2626;
            /* Darker Red */
            --danger-glow: rgba(220, 38, 38, 0.10);
            --card-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.10);
        }

        body.light-mode .glass-panel {
            background: rgba(255, 255, 255, 0.82);
            border-color: rgba(0, 0, 0, 0.08);
            box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
        }

        body.light-mode .search-input,
        body.light-mode .filter-select {
            background: rgba(0, 0, 0, 0.05);
            color: var(--text-primary);
            border-color: rgba(0, 0, 0, 0.12);
        }

        body.light-mode .filter-select option {
            background: #ffffff;
            color: #111827;
        }

        body.light-mode .app-card {
            background: rgba(255, 255, 255, 0.75);
            border-color: rgba(0, 0, 0, 0.07);
        }

        body.light-mode .app-card:hover {
            background: rgba(255, 255, 255, 0.95);
        }

        body.light-mode .toggle-btn {
            background: rgba(0, 0, 0, 0.05);
            border-color: rgba(0, 0, 0, 0.1);
            color: var(--text-primary);
        }

        body.light-mode .toggle-btn:hover {
            background: rgba(6, 182, 212, 0.1);
        }

        body.light-mode .stat-val {
            color: var(--text-primary);
        }

        body.light-mode header {
            background: rgba(255, 255, 255, 0.88);
        }

        body.light-mode h1 {
            background: linear-gradient(135deg, #111827 0%, #0891b2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        body.light-mode .header-icon-btn {
            background: rgba(0, 0, 0, 0.05);
            border-color: rgba(0, 0, 0, 0.1);
            color: var(--text-primary);
        }

        body.light-mode .header-icon-btn:hover {
            background: rgba(0, 0, 0, 0.1);
            border-color: rgba(0, 0, 0, 0.2);
            color: var(--primary-accent);
        }

        body.light-mode .analytics-card {
            background: rgba(255, 255, 255, 0.7) !important;
        }

        body.light-mode {
            scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
        }

        /* Detail Drawer Light Mode overrides and theme-aware classes */
        body.light-mode .detail-drawer {
            background: rgba(255, 255, 255, 0.95);
            border-left-color: rgba(0, 0, 0, 0.08);
            box-shadow: -10px 0 35px rgba(0, 0, 0, 0.05);
        }

        body.light-mode .drawer-header {
            border-bottom-color: rgba(0, 0, 0, 0.08);
        }

        body.light-mode .drawer-section-title {
            border-bottom-color: rgba(0, 0, 0, 0.06);
        }

        body.light-mode .drawer-grid-item {
            background: rgba(0, 0, 0, 0.02);
            border-color: rgba(0, 0, 0, 0.06);
        }

        body.light-mode .doc-item-row {
            background: rgba(0, 0, 0, 0.02);
            border-color: rgba(0, 0, 0, 0.05);
        }

        body.light-mode .doc-item-row:hover {
            background: rgba(0, 0, 0, 0.04);
            border-color: rgba(0, 0, 0, 0.08);
        }

        body.light-mode .doc-date {
            color: rgba(0, 0, 0, 0.4);
        }

        body.light-mode .proposal-detail-box {
            background: rgba(0, 0, 0, 0.03);
            border-color: rgba(0, 0, 0, 0.07);
            color: var(--text-primary);
        }

        body.light-mode .drawer-control-btn {
            background: rgba(0, 0, 0, 0.04);
            border-color: rgba(0, 0, 0, 0.08);
            color: var(--text-secondary);
        }

        body.light-mode .drawer-control-btn:hover {
            background: rgba(0, 0, 0, 0.08);
            border-color: rgba(0, 0, 0, 0.15);
            color: var(--text-primary);
        }

        body.light-mode .drawer-close-btn {
            background: rgba(0, 0, 0, 0.04);
            border-color: rgba(0, 0, 0, 0.08);
            color: var(--text-secondary);
        }

        body.light-mode .drawer-close-btn:hover {
            background: rgba(239, 68, 68, 0.12);
            border-color: var(--danger-accent);
            color: var(--danger-accent);
        }

        body.light-mode .drawer-hmo-normal-row {
            background: rgba(0, 0, 0, 0.02);
            border-color: rgba(0, 0, 0, 0.06);
        }

        /* Theme-aware drawer container classes */
        .drawer-kpi-card {
            padding: 0.75rem;
            border-radius: 6px;
            display: flex;
            flex-direction: column;
            gap: 0.15rem;
            background: rgba(0, 0, 0, 0.15);
            border: 1px solid rgba(255, 255, 255, 0.05);
        }

        body.light-mode .drawer-kpi-card {
            background: rgba(0, 0, 0, 0.03);
            border-color: rgba(0, 0, 0, 0.06);
        }

        .drawer-insight-box {
            font-size: 0.75rem;
            line-height: 1.4;
            color: var(--text-secondary);
            background: rgba(0, 0, 0, 0.1);
            padding: 0.6rem;
            border-radius: 6px;
            border-left: 2px solid var(--danger-accent);
        }

        body.light-mode .drawer-insight-box {
            background: rgba(0, 0, 0, 0.03);
        }

        .drawer-correlation-box {
            font-size: 0.75rem;
            line-height: 1.4;
            color: var(--text-secondary);
            background: rgba(168, 85, 247, 0.04);
            border: 1px solid rgba(168, 85, 247, 0.1);
            padding: 0.6rem;
            border-radius: 6px;
        }

        body.light-mode .drawer-correlation-box {
            background: rgba(124, 58, 237, 0.03);
            border-color: rgba(124, 58, 237, 0.1);
        }

        .drawer-breakdown-box {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            background: rgba(0, 0, 0, 0.15);
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: 6px;
            padding: 0.6rem;
        }

        body.light-mode .drawer-breakdown-box {
            background: rgba(0, 0, 0, 0.03);
            border-color: rgba(0, 0, 0, 0.06);
        }

        .drawer-progress-bg {
            height: 4px;
            border-radius: 2px;
            background: rgba(255, 255, 255, 0.05);
            width: 100%;
            position: relative;
        }

        body.light-mode .drawer-progress-bg {
            background: rgba(0, 0, 0, 0.06);
        }

        .drawer-control-btn {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: var(--text-secondary);
            border-radius: 50%;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
            flex-shrink: 0;
        }

        .drawer-control-btn:hover {
            background: rgba(255, 255, 255, 0.12);
            border-color: rgba(255, 255, 255, 0.25);
            color: var(--text-primary);
        }

        .drawer-hmo-normal-row {
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: 6px;
            padding: 0.5rem 0.75rem;
            width: 100%;
        }

        .drawer-proposal-text {
            background: rgba(0, 0, 0, 0.15);
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: 6px;
            padding: 0.75rem 1rem;
            font-size: 0.8rem;
            line-height: 1.45;
            color: var(--text-primary);
            white-space: pre-line;
            word-break: break-word;
        }

        body.light-mode .drawer-proposal-text {
            background: rgba(0, 0, 0, 0.03);
            border-color: rgba(0, 0, 0, 0.07);
        }

        .drawer-action-btn {
            margin: 0;
            padding: 0.5rem 1rem;
            font-size: 0.8rem;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: var(--text-primary);
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.3rem;
            transition: all 0.2s ease;
            text-decoration: none;
        }

        .drawer-action-btn:hover {
            background: rgba(255, 255, 255, 0.12);
            border-color: rgba(255, 255, 255, 0.2);
            color: var(--primary-accent);
        }

        body.light-mode .drawer-action-btn {
            background: rgba(0, 0, 0, 0.04);
            border-color: rgba(0, 0, 0, 0.08);
            color: var(--text-primary);
        }

        body.light-mode .drawer-action-btn:hover {
            background: rgba(0, 0, 0, 0.08);
            border-color: rgba(0, 0, 0, 0.15);
            color: var(--primary-accent);
        }

        /* Leaflet Map Popup Light Mode Contrast Overrides */
        body.light-mode .leaflet-popup-content-wrapper {
            background: rgba(255, 255, 255, 0.98) !important;
            border-color: rgba(0, 0, 0, 0.12) !important;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
            color: var(--text-primary) !important;
        }

        body.light-mode .leaflet-popup-tip {
            background: rgba(255, 255, 255, 0.98) !important;
            border-left: 1px solid rgba(0, 0, 0, 0.12) !important;
            border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;
        }

        body.light-mode .leaflet-tooltip.ward-tooltip {
            background: rgba(255, 255, 255, 0.98) !important;
            border-color: rgba(0, 0, 0, 0.12) !important;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
            color: var(--text-primary) !important;
        }

        body.light-mode .leaflet-tooltip-left.ward-tooltip::before {
            border-left-color: rgba(255, 255, 255, 0.98) !important;
        }

        body.light-mode .leaflet-tooltip-right.ward-tooltip::before {
            border-right-color: rgba(255, 255, 255, 0.98) !important;
        }

        body.light-mode .map-popup-loc {
            color: var(--text-primary) !important;
        }

        body.light-mode .map-popup-prop {
            border-top-color: rgba(0, 0, 0, 0.08) !important;
            color: var(--text-secondary) !important;
            background: rgba(0, 0, 0, 0.02) !important;
            border-color: rgba(0, 0, 0, 0.06) !important;
        }

        body.light-mode .map-popup-prop b {
            color: var(--text-primary) !important;
        }

        body.light-mode .popup-actions-row {
            border-top-color: rgba(0, 0, 0, 0.08) !important;
        }

        body.light-mode .gmaps-link {
            background: rgba(8, 145, 178, 0.06) !important;
            border-color: rgba(8, 145, 178, 0.2) !important;
            color: var(--primary-accent) !important;
        }

        body.light-mode .gmaps-link:hover {
            background: var(--primary-accent) !important;
            color: #ffffff !important;
            border-color: var(--primary-accent) !important;
        }

        body.light-mode .details-link {
            background: rgba(124, 58, 237, 0.06) !important;
            border-color: rgba(124, 58, 237, 0.2) !important;
            color: var(--registered-accent) !important;
        }

        body.light-mode .details-link:hover {
            background: var(--registered-accent) !important;
            color: #ffffff !important;
            border-color: var(--registered-accent) !important;
        }

        body.light-mode .correct-link {
            background: rgba(0, 0, 0, 0.04) !important;
            border-color: rgba(0, 0, 0, 0.08) !important;
            color: var(--text-secondary) !important;
        }

        body.light-mode .correct-link:hover {
            background: rgba(8, 145, 178, 0.08) !important;
            border-color: var(--primary-accent) !important;
            color: var(--primary-accent) !important;
        }

        body.light-mode .correct-form-container {
            background: rgba(0, 0, 0, 0.02) !important;
            border-color: rgba(0, 0, 0, 0.06) !important;
        }

        body.light-mode .correct-input {
            background: rgba(255, 255, 255, 0.95) !important;
            border-color: rgba(0, 0, 0, 0.12) !important;
            color: var(--text-primary) !important;
        }

        body.light-mode .correct-form-hint {
            color: var(--text-secondary) !important;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            scrollbar-width: thin;
            scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
        }

        html,
        body {
            height: 100vh;
            overflow: hidden;
        }

        body {
            font-family: 'Inter', sans-serif;
            background: var(--bg-gradient);
            color: var(--text-primary);
            display: flex;
            flex-direction: column;
        }

        /* Scrollbar styling */
        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }

        ::-webkit-scrollbar-track {
            background: transparent;
        }

        ::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.15);
            border-radius: 4px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        /* Glassmorphism panel base */
        .glass-panel {
            background: var(--panel-bg);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid var(--panel-border);
            border-radius: 16px;
            box-shadow: var(--card-shadow);
        }

        /* Top Navbar */
        header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1.25rem 2rem;
            margin: 1rem 1.5rem 0.5rem 1.5rem;
        }

        .header-title-container {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .pulse-dot {
            width: 10px;
            height: 10px;
            background-color: var(--success-accent);
            border-radius: 50%;
            box-shadow: 0 0 0 0 var(--success-glow);
            animation: pulse 1.8s infinite;
        }

        @keyframes pulse {
            0% {
                transform: scale(0.95);
                box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
            }

            70% {
                transform: scale(1);
                box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
            }

            100% {
                transform: scale(0.95);
                box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
            }
        }

        h1 {
            font-size: 1.25rem;
            font-weight: 700;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            background: linear-gradient(135deg, #ffffff 0%, #a5f3fc 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .header-controls {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .header-icon-btn {
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.15);
            color: var(--text-primary);
            padding: 0.6rem 0.8rem;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.35rem;
            transition: all 0.2s ease;
            box-shadow: none;
            margin: 0;
        }

        .header-icon-btn:hover {
            background: rgba(255, 255, 255, 0.15);
            border-color: rgba(255, 255, 255, 0.3);
            color: var(--primary-accent);
        }

        .sync-btn {
            background: linear-gradient(135deg, var(--primary-accent) 0%, #0891b2 100%);
            color: #ffffff;
            border: none;
            padding: 0.6rem 1.25rem;
            font-size: 0.85rem;
            font-weight: 600;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            transition: all 0.3s ease;
            box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
        }

        .sync-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 16px rgba(6, 182, 212, 0.45);
            filter: brightness(1.1);
        }

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

        .sync-btn:disabled {
            background: #4b5563;
            box-shadow: none;
            cursor: not-allowed;
            transform: none;
        }

        .sync-time-badge {
            font-size: 0.75rem;
            color: var(--text-secondary);
            background: rgba(255, 255, 255, 0.05);
            padding: 0.4rem 0.75rem;
            border-radius: 6px;
            border: 1px solid rgba(255, 255, 255, 0.05);
        }

        /* Stats Row */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: 1rem;
            margin: 0.5rem 1.5rem;
        }

        .stat-card {
            padding: 1.25rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            position: relative;
            overflow: hidden;
            transition: transform 0.2s ease;
        }

        .stat-card:hover {
            transform: translateY(-2px);
        }

        .stat-info {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
        }

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

        .stat-val {
            font-size: 1.75rem;
            font-weight: 700;
        }

        .stat-icon {
            font-size: 1.8rem;
            opacity: 0.85;
            padding: 0.75rem;
            border-radius: 12px;
        }

        /* Individual Card Colors */
        .card-total {
            border-left: 4px solid var(--primary-accent);
        }

        .card-total .stat-val {
            color: var(--primary-accent);
        }

        .card-total .stat-icon {
            background: var(--primary-glow);
            color: var(--primary-accent);
        }

        .card-hmo {
            border-left: 4px solid var(--hmo-accent);
        }

        .card-hmo .stat-val {
            color: var(--hmo-accent);
        }

        .card-hmo .stat-icon {
            background: var(--hmo-glow);
            color: var(--hmo-accent);
        }

        .card-pending-hmo {
            border-left: 4px solid var(--pending-accent);
        }

        .card-pending-hmo .stat-val {
            color: var(--pending-accent);
        }

        .card-pending-hmo .stat-icon {
            background: var(--pending-glow);
            color: var(--pending-accent);
        }

        .card-registered-hmo {
            border-left: 4px solid var(--registered-accent);
        }

        .card-registered-hmo .stat-val {
            color: var(--registered-accent);
        }

        .card-registered-hmo .stat-icon {
            background: var(--registered-glow);
            color: var(--registered-accent);
        }

        .card-resolved {
            border-left: 4px solid var(--success-accent);
        }

        .card-resolved .stat-val {
            color: var(--success-accent);
        }

        .card-resolved .stat-icon {
            background: var(--success-glow);
            color: var(--success-accent);
        }

        .card-unresolved {
            border-left: 4px solid var(--danger-accent);
        }

        .card-unresolved .stat-val {
            color: var(--danger-accent);
        }

        .card-unresolved .stat-icon {
            background: var(--danger-glow);
            color: var(--danger-accent);
        }

        /* Main Workspace */
        .workspace {
            display: grid;
            grid-template-columns: 420px 1fr;
            gap: 1rem;
            margin: 0.5rem 1.5rem 1.5rem 1.5rem;
            flex-grow: 1;
            min-height: 0;
            /* Important for flex child scroll */
        }

        /* Slide-out Details Drawer */
        .detail-drawer {
            position: fixed;
            top: 0;
            right: -480px;
            /* Hidden initially */
            width: 450px;
            height: 100%;
            background: rgba(18, 18, 18, 0.85);
            backdrop-filter: blur(25px);
            -webkit-backdrop-filter: blur(25px);
            border-left: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: -10px 0 35px rgba(0, 0, 0, 0.6);
            z-index: 2000;
            transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            display: flex;
            flex-direction: column;
            padding: 1.5rem;
            color: var(--text-primary);
        }

        .detail-drawer.open {
            right: 0;
        }

        .drawer-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            padding-bottom: 0.75rem;
            margin-bottom: 1rem;
        }

        .drawer-title {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--primary-accent);
            display: flex;
            align-items: center;
            gap: 0.5rem;
            min-width: 0;
        }

        .drawer-close-btn {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: var(--text-secondary);
            border-radius: 50%;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
            flex-shrink: 0;
        }

        .drawer-close-btn:hover {
            background: rgba(239, 68, 68, 0.2);
            border-color: var(--danger-accent);
            color: var(--danger-accent);
            transform: scale(1.05);
        }

        .drawer-body {
            flex-grow: 1;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 1.25rem;
            padding-right: 0.25rem;
            padding-bottom: 0.5rem;
        }

        .drawer-section-title {
            font-size: 0.8rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--text-secondary);
            margin-bottom: 0.5rem;
            display: flex;
            align-items: center;
            gap: 0.4rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            padding-bottom: 0.25rem;
        }

        .drawer-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.75rem;
        }

        .drawer-grid-item {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: 6px;
            padding: 0.5rem 0.75rem;
            display: flex;
            flex-direction: column;
            gap: 0.15rem;
        }

        .drawer-grid-label {
            font-size: 0.65rem;
            color: var(--text-secondary);
            font-weight: 600;
        }

        .drawer-grid-val {
            font-size: 0.8rem;
            font-weight: 700;
            color: var(--text-primary);
            word-break: break-word;
        }

        .hmo-alert-box {
            background: rgba(245, 158, 11, 0.1);
            border: 1px solid rgba(245, 158, 11, 0.25);
            border-left: 4px solid var(--hmo-accent);
            border-radius: 6px;
            padding: 0.75rem 1rem;
            display: flex;
            flex-direction: column;
            gap: 0.3rem;
            margin-bottom: 0.25rem;
        }

        .hmo-alert-title {
            font-size: 0.8rem;
            font-weight: 700;
            color: var(--hmo-accent);
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }

        .hmo-alert-reason {
            font-size: 0.7rem;
            color: var(--text-primary);
            line-height: 1.3;
        }

        .proposal-detail-box {
            background: rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: 6px;
            padding: 0.8rem 1rem;
            font-size: 0.85rem;
            line-height: 1.45;
            color: var(--text-primary);
            white-space: pre-line;
            max-height: 200px;
            overflow-y: auto;
        }

        .loading-enricher {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.75rem;
            color: var(--hmo-accent);
            font-weight: 600;
            background: rgba(245, 158, 11, 0.06);
            border: 1px dashed rgba(245, 158, 11, 0.2);
            border-radius: 6px;
            padding: 0.5rem 0.75rem;
        }

        .loading-spinner-small {
            border: 2px solid rgba(245, 158, 11, 0.2);
            border-top: 2px solid var(--hmo-accent);
            border-radius: 50%;
            width: 12px;
            height: 12px;
            animation: spin 1s linear infinite;
        }

        /* Documents List inside Drawer */
        .drawer-docs-list {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .doc-item-row {
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid rgba(255, 255, 255, 0.04);
            border-radius: 6px;
            padding: 0.6rem 0.8rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            transition: all 0.2s ease;
        }

        .doc-item-row:hover {
            background: rgba(255, 255, 255, 0.05);
            border-color: rgba(255, 255, 255, 0.08);
        }

        .doc-info-col {
            display: flex;
            flex-direction: column;
            gap: 0.15rem;
            min-width: 0;
            flex-grow: 1;
        }

        .doc-name {
            font-size: 0.75rem;
            font-weight: 700;
            color: var(--primary-accent);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .doc-desc {
            font-size: 0.68rem;
            color: var(--text-secondary);
            line-height: 1.2;
            word-break: break-word;
        }

        .doc-date {
            font-size: 0.6rem;
            color: rgba(255, 255, 255, 0.3);
            font-weight: 500;
        }

        .doc-download-btn {
            background: rgba(14, 165, 233, 0.1);
            border: 1px solid rgba(14, 165, 233, 0.2);
            color: var(--primary-accent);
            border-radius: 4px;
            padding: 0.3rem 0.5rem;
            font-size: 0.7rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.3rem;
            cursor: pointer;
            transition: all 0.2s ease;
            text-decoration: none;
            flex-shrink: 0;
        }

        .doc-download-btn:hover {
            background: var(--primary-accent);
            color: #ffffff;
            box-shadow: 0 0 8px rgba(14, 165, 233, 0.4);
        }

        /* Sidebar Control Panel */
        .sidebar {
            display: flex;
            flex-direction: column;
            gap: 1rem;
            min-height: 0;
        }

        .search-filter-panel {
            padding: 1.25rem;
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .search-box-wrapper {
            position: relative;
        }

        .search-box-wrapper i {
            position: absolute;
            left: 1rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        .search-input {
            width: 100%;
            background: rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.1);
            padding: 0.75rem 1rem 0.75rem 2.5rem;
            border-radius: 8px;
            color: var(--text-primary);
            font-family: inherit;
            font-size: 0.85rem;
            outline: none;
            transition: all 0.3s ease;
        }

        .search-input:focus {
            border-color: var(--primary-accent);
            box-shadow: 0 0 8px var(--primary-glow);
            background: rgba(0, 0, 0, 0.35);
        }

        .filter-sort-controls {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        .toggle-btn {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: var(--text-primary);
            padding: 0.6rem 1rem;
            border-radius: 8px;
            font-size: 0.85rem;
            font-weight: 500;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            transition: all 0.2s ease;
            width: 100%;
        }

        .toggle-btn:hover {
            background: rgba(255, 255, 255, 0.08);
            border-color: rgba(255, 255, 255, 0.2);
        }

        .toggle-btn.active {
            background: rgba(245, 158, 11, 0.15);
            border-color: var(--hmo-accent);
            color: var(--hmo-accent);
            box-shadow: 0 0 10px rgba(245, 158, 11, 0.1);
        }

        .toggle-btn#hmo-register-toggle.active {
            background: rgba(168, 85, 247, 0.15);
            border-color: #c084fc;
            color: #c084fc;
            box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
        }

        .sort-group {
            display: flex;
            gap: 0.5rem;
        }

        .sort-btn {
            flex: 1;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: var(--text-secondary);
            padding: 0.5rem;
            border-radius: 8px;
            font-size: 0.8rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            text-align: center;
        }

        .sort-btn:hover {
            background: rgba(255, 255, 255, 0.08);
            color: var(--text-primary);
        }

        .sort-btn.active {
            background: rgba(6, 182, 212, 0.12);
            border-color: var(--primary-accent);
            color: var(--primary-accent);
        }

        /* List Panel */
        .list-panel {
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            min-height: 0;
            /* Key for internal list scrolling */
            padding: 1.25rem;
        }

        .list-header {
            font-size: 0.8rem;
            font-weight: 600;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 0.75rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .app-count-badge {
            background: rgba(255, 255, 255, 0.08);
            padding: 0.15rem 0.5rem;
            border-radius: 12px;
            font-size: 0.7rem;
            color: var(--text-primary);
        }

        .list-container {
            position: relative;
            overflow-y: auto;
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            padding-right: 0.25rem;
        }

        /* Card list item */
        .app-card {
            background: rgba(0, 0, 0, 0.18);
            border: 1px solid rgba(255, 255, 255, 0.04);
            border-radius: 10px;
            padding: 1rem;
            cursor: pointer;
            transition: all 0.25s ease;
            position: relative;
        }

        .app-card:hover {
            background: rgba(255, 255, 255, 0.03);
            border-color: rgba(255, 255, 255, 0.12);
            transform: translateX(2px);
        }

        .app-card.active {
            background: rgba(6, 182, 212, 0.06);
            border-color: var(--primary-accent);
            box-shadow: 0 0 12px rgba(6, 182, 212, 0.05);
        }

        .app-card.is-hmo-card {
            border-left: 3px solid var(--hmo-accent);
        }

        .app-card.is-hmo-card.active {
            border-left: 3px solid var(--hmo-accent);
            background: rgba(245, 158, 11, 0.04);
            border-color: rgba(245, 158, 11, 0.5) rgba(245, 158, 11, 0.5) rgba(245, 158, 11, 0.5) var(--hmo-accent);
        }

        .card-top {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 0.4rem;
        }

        .ref-num {
            font-size: 0.8rem;
            font-weight: 700;
            color: var(--primary-accent);
        }

        .is-hmo-card .ref-num {
            color: var(--hmo-accent);
        }

        .date-badge {
            font-size: 0.7rem;
            color: var(--text-secondary);
            background: rgba(255, 255, 255, 0.05);
            padding: 0.15rem 0.4rem;
            border-radius: 4px;
        }

        .loc-text {
            font-size: 0.8rem;
            font-weight: 600;
            margin-bottom: 0.4rem;
            color: #ffffff;
            line-height: 1.3;
        }

        .proposal-text {
            font-size: 0.72rem;
            color: var(--text-secondary);
            line-height: 1.4;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            margin-bottom: 0.5rem;
        }

        .card-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 0.25rem;
        }

        .status-badge {
            font-size: 0.7rem;
            font-weight: 600;
            padding: 0.15rem 0.5rem;
            border-radius: 6px;
            text-transform: uppercase;
        }

        .status-undecided {
            background: rgba(156, 163, 175, 0.15);
            color: #9ca3af;
            border: 1px solid rgba(156, 163, 175, 0.3);
        }

        .status-approval {
            background: var(--success-glow);
            color: var(--success-accent);
            border: 1px solid rgba(16, 185, 129, 0.3);
        }

        .status-refusal {
            background: var(--danger-glow);
            color: var(--danger-accent);
            border: 1px solid rgba(239, 68, 68, 0.3);
        }

        .coord-indicator {
            font-size: 0.7rem;
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }

        .coord-yes {
            color: var(--success-accent);
        }

        .coord-no {
            color: var(--danger-accent);
        }

        .coord-unresolvable {
            color: #7b7f87;
        }

        /* Map Panel */
        .map-panel {
            display: flex;
            flex-direction: column;
            min-height: 0;
            padding: 1.25rem;
        }

        #map {
            flex-grow: 1;
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            background: #111116;
            z-index: 1;
        }

        /* Popup styling inside leaflet */
        .leaflet-popup-content-wrapper {
            background: rgba(18, 18, 30, 0.95) !important;
            backdrop-filter: blur(12px);
            border: 1px solid rgba(255, 255, 255, 0.15);
            color: var(--text-primary) !important;
            border-radius: 12px !important;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
            font-family: 'Inter', sans-serif !important;
        }

        .leaflet-popup-tip {
            background: rgba(18, 18, 30, 0.95) !important;
            border-left: 1px solid rgba(255, 255, 255, 0.15);
            border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        }

        .leaflet-tooltip.ward-tooltip {
            background: rgba(18, 18, 30, 0.95) !important;
            backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.15) !important;
            color: var(--text-primary) !important;
            border-radius: 8px !important;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
            font-family: 'Inter', sans-serif !important;
            padding: 0.5rem 0.75rem !important;
        }

        .leaflet-tooltip-left.ward-tooltip::before {
            border-left-color: rgba(18, 18, 30, 0.95) !important;
        }

        .leaflet-tooltip-right.ward-tooltip::before {
            border-right-color: rgba(18, 18, 30, 0.95) !important;
        }

        .map-popup-container {
            display: flex;
            flex-direction: column;
            gap: 0.4rem;
            min-width: 220px;
            max-width: 280px;
            padding: 0.1rem;
        }

        .map-popup-ref {
            font-size: 0.8rem;
            font-weight: 700;
            color: var(--primary-accent);
        }

        .map-popup-hmo-badge {
            background: rgba(245, 158, 11, 0.2);
            color: var(--hmo-accent);
            border: 1px solid var(--hmo-accent);
            font-size: 0.65rem;
            font-weight: 700;
            padding: 0.05rem 0.3rem;
            border-radius: 4px;
            width: fit-content;
            margin-bottom: 0.2rem;
            text-transform: uppercase;
        }

        .map-popup-loc {
            font-size: 0.8rem;
            font-weight: 600;
            color: #ffffff;
        }

        .map-popup-prop {
            font-size: 0.72rem;
            color: var(--text-secondary);
            line-height: 1.3;
            max-height: 80px;
            overflow-y: auto;
            border-top: 1px solid rgba(255, 255, 255, 0.06);
            padding-top: 0.4rem;
            margin-top: 0.2rem;
        }

        .map-popup-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.65rem;
            color: var(--text-secondary);
            margin-top: 0.2rem;
        }

        /* Scrape Progress Toast (persistent, locks UI) */
        .scrape-toast {
            position: fixed;
            bottom: 24px;
            right: 24px;
            background: rgba(12, 12, 22, 0.97);
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
            border: 1px solid var(--primary-accent);
            box-shadow: 0 8px 30px rgba(6, 182, 212, 0.25), 0 2px 8px rgba(0, 0, 0, 0.6);
            color: #ffffff;
            padding: 1rem 1.4rem;
            border-radius: 14px;
            z-index: 10001;
            display: flex;
            align-items: center;
            gap: 0.9rem;
            transform: translateY(150%);
            opacity: 0;
            pointer-events: none;
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            min-width: 280px;
            max-width: 380px;
        }

        .scrape-toast.show {
            transform: translateY(0);
            opacity: 1;
        }

        .scrape-toast-spinner {
            width: 20px;
            height: 20px;
            border: 2.5px solid rgba(6, 182, 212, 0.2);
            border-top-color: var(--primary-accent);
            border-radius: 50%;
            animation: spin 0.85s infinite linear;
            flex-shrink: 0;
        }

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

            100% {
                transform: rotate(360deg);
            }
        }

        .scrape-toast-body {
            display: flex;
            flex-direction: column;
            gap: 0.2rem;
            flex: 1;
        }

        .scrape-toast-title {
            font-weight: 700;
            font-size: 0.85rem;
            color: var(--primary-accent);
            letter-spacing: 0.02em;
        }

        .scrape-toast-msg {
            font-size: 0.75rem;
            color: var(--text-secondary);
            line-height: 1.4;
        }

        /* Dim/lock the main content while scrape toast is active */
        body.scrape-locked main,
        body.scrape-locked .top-bar,
        body.scrape-locked .sidebar {
            pointer-events: none;
            opacity: 0.45;
            transition: opacity 0.3s ease;
        }

        .gmaps-link {
            font-size: 0.7rem;
            color: var(--primary-accent);
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 0.25rem;
            background: rgba(6, 182, 212, 0.08);
            padding: 0.25rem 0.5rem;
            border-radius: 6px;
            border: 1px solid rgba(6, 182, 212, 0.2);
            transition: all 0.2s ease;
            width: fit-content;
        }

        .gmaps-link:hover {
            background: rgba(6, 182, 212, 0.15);
            border-color: var(--primary-accent);
            color: #ffffff;
            transform: translateY(-1px);
        }

        .gmaps-link:active {
            transform: translateY(0);
        }

        .details-link {
            font-size: 0.7rem;
            color: #c084fc;
            /* Light purple */
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 0.25rem;
            background: rgba(168, 85, 247, 0.08);
            padding: 0.25rem 0.5rem;
            border-radius: 6px;
            border: 1px solid rgba(168, 85, 247, 0.2);
            transition: all 0.2s ease;
            width: fit-content;
        }

        .details-link:hover {
            background: rgba(168, 85, 247, 0.15);
            border-color: #c084fc;
            color: #ffffff;
            transform: translateY(-1px);
        }

        .details-link:active {
            transform: translateY(0);
        }


        /* Floating Glassmorphic Toast Notification */
        .toast-notification {
            position: fixed;
            bottom: 24px;
            right: 24px;
            background: rgba(18, 18, 30, 0.95);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid var(--success-accent);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
            color: #ffffff;
            padding: 1rem 1.5rem;
            border-radius: 12px;
            z-index: 10000;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            transform: translateY(150%);
            opacity: 0;
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            max-width: 350px;
        }

        .toast-notification.show {
            transform: translateY(0);
            opacity: 1;
        }

        .toast-icon {
            color: var(--success-accent);
            font-size: 1.25rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .toast-content {
            display: flex;
            flex-direction: column;
            gap: 0.15rem;
        }

        .toast-title {
            font-weight: 600;
            font-size: 0.85rem;
        }

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

        /* Pin Manual Correction styles */
        .popup-actions-row {
            margin-top: 0.6rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 0.5rem;
            border-top: 1px solid rgba(255, 255, 255, 0.06);
            padding-top: 0.6rem;
        }

        .correct-link {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: var(--text-secondary);
            font-size: 0.7rem;
            font-weight: 600;
            padding: 0.3rem 0.6rem;
            border-radius: 6px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            transition: all 0.2s ease;
        }

        .correct-link:hover {
            background: rgba(6, 182, 212, 0.15);
            border-color: var(--primary-accent);
            color: #ffffff;
        }

        .correct-form-container {
            margin-top: 0.5rem;
            padding: 0.5rem;
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            display: flex;
            flex-direction: column;
            gap: 0.4rem;
        }

        .correct-form-title {
            font-size: 0.65rem;
            font-weight: 600;
            color: var(--text-secondary);
        }

        .correct-input-group {
            display: flex;
            gap: 0.25rem;
        }

        .correct-input {
            flex-grow: 1;
            background: rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 4px;
            color: #ffffff;
            padding: 0.25rem 0.4rem;
            font-size: 0.7rem;
            font-family: inherit;
        }

        .correct-input:focus {
            outline: none;
            border-color: var(--primary-accent);
        }

        .correct-submit-btn {
            background: var(--primary-accent);
            border: none;
            color: #ffffff;
            padding: 0.25rem 0.6rem;
            font-size: 0.7rem;
            font-weight: 600;
            border-radius: 4px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s ease;
        }

        .correct-submit-btn:hover {
            filter: brightness(1.15);
        }

        .correct-form-hint {
            font-size: 0.6rem;
            transition: all 0.2s;
        }

        .modal-select:focus,
        .modal-input:focus {
            border-color: var(--primary-accent);
            box-shadow: 0 0 8px var(--primary-glow);
        }

        .modal-footer {
            display: flex;
            justify-content: flex-end;
            gap: 0.75rem;
            border-top: 1px solid rgba(255, 255, 255, 0.06);
            padding-top: 0.75rem;
            margin-top: 0.25rem;
        }

        .modal-btn {
            padding: 0.5rem 1rem;
            font-size: 0.8rem;
            font-weight: 600;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
            border: none;
        }

        .modal-cancel-btn {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: var(--text-primary);
        }

        .modal-cancel-btn:hover {
            background: rgba(255, 255, 255, 0.08);
        }

        .modal-save-btn {
            background: linear-gradient(135deg, var(--primary-accent) 0%, #0891b2 100%);
            color: #ffffff;
            box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
        }

        .modal-save-btn:hover {
            filter: brightness(1.1);
            box-shadow: 0 4px 16px rgba(6, 182, 212, 0.35);
        }

        /* Analytics tabs & layout */
        .map-tab {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.08);
            color: var(--text-secondary);
            padding: 0.4rem 0.8rem;
            font-size: 0.8rem;
            font-weight: 600;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 0.35rem;
        }

        .map-tab:hover {
            background: rgba(255, 255, 255, 0.06);
            color: var(--text-primary);
        }

        .map-tab.active {
            background: rgba(6, 182, 212, 0.12);
            border-color: var(--primary-accent);
            color: var(--primary-accent);
        }

        .street-insight-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid rgba(255, 255, 255, 0.04);
            border-radius: 6px;
            padding: 0.4rem 0.6rem;
            transition: background 0.2s;
        }

        .street-insight-row:hover {
            background: rgba(255, 255, 255, 0.04);
        }

        .analytics-grid-section {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1rem;
        }

        @media (max-width: 1024px) {
            .analytics-grid-section {
                grid-template-columns: 1fr !important;
            }
        }

        .analytics-kpi-grid {
            grid-column: 1 / -1;
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 0.75rem;
            margin-bottom: 0.5rem;
        }

        @media (max-width: 1023px) {
            .analytics-kpi-grid {
                grid-template-columns: repeat(2, 1fr) !important;
            }
        }

        @media (max-width: 480px) {
            .analytics-kpi-grid {
                grid-template-columns: 1fr !important;
            }
        }

        /* ==========================================================================
           10. Beautiful Glassmorphic Scraper Settings Modal Styles
           ========================================================================== */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(10, 10, 15, 0.7);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            z-index: 9999;
            display: none;
            /* Controlled via JS flex toggle */
            align-items: center;
            justify-content: center;
            padding: 1.5rem;
        }

        .modal-overlay.active {
            display: flex !important;
        }

        .modal-content {
            width: 100%;
            max-width: 440px;
            background: rgba(22, 22, 37, 0.95);
            border: 1px solid rgba(255, 255, 255, 0.15);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
            padding: 1.5rem;
            display: flex;
            flex-direction: column;
            gap: 1.25rem;
            position: relative;
            transform: scale(0.95);
            animation: modalScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        }

        @keyframes modalScaleIn {
            to {
                transform: scale(1);
            }
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            padding-bottom: 0.75rem;
        }

        .modal-header h3 {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--primary-accent);
            margin: 0;
        }

        .close-modal-btn {
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 1.5rem;
            cursor: pointer;
            line-height: 1;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: color 0.2s;
        }

        .close-modal-btn:hover {
            color: var(--danger-accent);
        }

        .modal-body {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .form-group {
            display: flex;
            flex-direction: column;
            gap: 0.4rem;
        }

        .form-group label {
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--text-secondary);
        }

        .modal-select,
        .modal-input {
            width: 100%;
            box-sizing: border-box;
            background: rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            color: var(--text-primary);
            padding: 0.6rem 0.8rem;
            font-family: inherit;
            font-size: 0.85rem;
            outline: none;
            transition: all 0.2s;
        }

        /* ==========================================================================
           11. Premium Mobile Responsive Breakpoints
           ========================================================================== */
        @media (max-width: 1023px) {

            html,
            body {
                height: 100%;
                overflow-y: auto;
            }

            body {
                overflow-x: hidden;
            }

            .workspace {
                display: flex;
                flex-direction: column;
                height: auto;
                min-height: calc(100vh - 240px);
                margin: 0.5rem;
                gap: 1rem;
            }

            .map-panel {
                height: 480px;
                min-height: 400px;
                flex-shrink: 0;
            }

            .sidebar {
                height: auto;
                flex-grow: 1;
            }

            .list-panel {
                height: 500px;
                min-height: 400px;
            }

            /* Responsive Has selector when Analytics active to hide list */
            .workspace:has(#analytics-view-container:not([style*="display: none"])) .sidebar {
                display: none !important;
            }

            .workspace:has(#analytics-view-container:not([style*="display: none"])) .map-panel {
                height: auto !important;
                min-height: calc(100vh - 200px) !important;
            }

            #analytics-view-container {
                grid-template-columns: 1fr !important;
                /* Single column layout for charts on tablet/mobile */
                gap: 1rem !important;
            }
        }

        @media (max-width: 767px) {
            header {
                padding: 1.25rem !important;
                margin: 0.5rem 0.5rem 1.25rem 0.5rem !important;
                flex-direction: column !important;
                align-items: stretch !important;
                gap: 1rem !important;
            }

            .header-controls {
                flex-direction: row !important;
                justify-content: space-between !important;
                align-items: center !important;
                width: 100% !important;
                gap: 0.5rem !important;
                flex-wrap: wrap !important;
            }

            .sync-time-badge {
                font-size: 0.7rem !important;
                padding: 0.35rem 0.6rem !important;
            }

            .sync-btn {
                padding: 0.5rem 0.8rem !important;
                font-size: 0.8rem !important;
            }

            h1 {
                font-size: 1rem !important;
                text-align: center !important;
            }

            /* Stats Grid horizontal carousel */
            .stats-grid {
                display: flex !important;
                flex-shrink: 0 !important;
                min-height: min-content !important;
                overflow-x: auto !important;
                scroll-snap-type: x mandatory !important;
                gap: 0.75rem !important;
                margin: 0.5rem 0.5rem 1rem 0.5rem !important;
                padding: 0.5rem 0.25rem 1rem 0.25rem !important;
                scrollbar-width: none !important;
            }

            .stats-grid::-webkit-scrollbar {
                display: none !important;
            }

            .stats-grid .stat-card {
                flex: 0 0 85vw !important;
                max-width: 380px !important;
                scroll-snap-align: start !important;
                padding: 1rem 1.25rem !important;
                border-radius: 12px !important;
            }

            .stats-grid .stat-val {
                font-size: 1.6rem !important;
            }

            .stats-grid .stat-label {
                font-size: 0.85rem !important;
                white-space: normal !important;
                overflow: visible !important;
            }

            .stats-grid .stat-icon {
                font-size: 1.1rem !important;
                padding: 0.35rem !important;
                border-radius: 8px !important;
            }

            /* Full screen details sheet modal */
            .detail-drawer {
                width: 100% !important;
                right: -100% !important;
                border-left: none !important;
                border-radius: 0 !important;
                padding: 1rem !important;
            }

            .detail-drawer.open {
                right: 0 !important;
            }

            .modal-content {
                max-width: 95% !important;
                padding: 1.25rem !important;
            }
        }

        /* Toast Notifications */
        #toast-container {
            position: fixed;
            bottom: 20px;
            right: 20px;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: none;
        }

        .toast {
            background: var(--panel-bg);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid var(--primary-accent);
            border-left: 4px solid var(--primary-accent);
            border-radius: 8px;
            padding: 12px 20px;
            color: var(--text-primary);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
            font-size: 0.9rem;
            animation: slideInRight 0.3s ease forwards, fadeOut 0.5s ease 4.5s forwards;
            max-width: 300px;
        }

        .toast.success {
            border-color: var(--success-accent);
        }

        .toast.hmo {
            border-color: var(--hmo-accent);
        }

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

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

        @keyframes fadeOut {
            from {
                opacity: 1;
            }

            to {
                opacity: 0;
            }
        }

        /* Advanced Filters */
        .advanced-filters {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-bottom: 10px;
            width: 100%;
        }

        .filter-select {
            background: rgba(0, 0, 0, 0.3);
            border: 1px solid var(--panel-border);
            color: var(--text-primary);
            padding: 8px 12px;
            border-radius: 8px;
            font-family: 'Inter', sans-serif;
            flex: 1;
            min-width: 0;
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
            outline: none;
        }

        .filter-select option {
            background: var(--panel-bg);
            color: var(--text-primary);
        }

        /* ==========================================================================
           11. Animated Time Travel Slider Panel Styles (Option 2)
           ========================================================================== */
        #map-time-slider-panel {
            position: absolute;
            bottom: 25px;
            left: 50%;
            transform: translateX(-50%);
            width: 90%;
            max-width: 580px;
            background: rgba(17, 24, 39, 0.85);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-bottom: 2px solid var(--primary-accent);
            border-radius: 12px;
            padding: 0.8rem 1.2rem;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            gap: 0.6rem;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .time-controls-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.8rem;
            width: 100%;
        }

        .time-control-btn {
            background: rgba(14, 165, 233, 0.15);
            border: 1px solid rgba(14, 165, 233, 0.3);
            color: var(--primary-accent);
            border-radius: 50%;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s;
            outline: none;
            flex-shrink: 0;
        }

        .time-control-btn:hover {
            background: var(--primary-accent);
            color: #fff;
            box-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
        }

        .time-control-btn:active {
            transform: scale(0.92);
        }

        .time-speed-dropdown {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: var(--text-primary);
            font-size: 0.72rem;
            padding: 0.2rem 0.4rem;
            border-radius: 6px;
            cursor: pointer;
            outline: none;
        }

        .time-date-display {
            font-family: 'Outfit', sans-serif;
            font-size: 0.95rem;
            font-weight: 700;
            color: var(--text-primary);
            text-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
            flex-grow: 1;
            text-align: center;
        }

        .time-stats-badge {
            background: rgba(168, 85, 247, 0.12);
            border: 1px solid rgba(168, 85, 247, 0.25);
            color: #c084fc;
            font-size: 0.7rem;
            font-weight: 700;
            padding: 0.2rem 0.6rem;
            border-radius: 6px;
            display: flex;
            align-items: center;
            gap: 0.3rem;
            white-space: nowrap;
        }

        .time-slider-row {
            width: 100%;
            display: flex;
            align-items: center;
        }

        /* Custom range styling for time travel range input */
        #time-travel-slider {
            -webkit-appearance: none;
            appearance: none;
            background: rgba(255, 255, 255, 0.1);
            height: 6px;
            border-radius: 3px;
            outline: none;
            transition: background 0.3s;
        }

        #time-travel-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: var(--primary-accent);
            box-shadow: 0 0 10px var(--primary-accent);
            cursor: pointer;
            transition: transform 0.1s;
        }

        #time-travel-slider::-webkit-slider-thumb:hover {
            transform: scale(1.2);
        }

        /* HMO Birth Pulse visual effect on Leaflet */
        @keyframes hmo-birth-pulse {
            0% {
                box-shadow: 0 0 0 0px rgba(245, 158, 11, 0.7);
            }

            70% {
                box-shadow: 0 0 0 12px rgba(245, 158, 11, 0);
            }

            100% {
                box-shadow: 0 0 0 0px rgba(245, 158, 11, 0);
            }
        }

        .birth-pulsing-marker {
            animation: hmo-birth-pulse 1.8s cubic-bezier(0.16, 1, 0.3, 1) infinite;
            border-radius: 50%;
        }

        /* Premium Glowing Marker Clusters */
        .marker-cluster-small {
            background-color: rgba(6, 182, 212, 0.2) !important;
        }

        .marker-cluster-small div {
            background-color: rgba(6, 182, 212, 0.65) !important;
            color: #fff !important;
            font-weight: 700 !important;
            font-family: 'Inter', sans-serif !important;
            box-shadow: 0 0 10px rgba(6, 182, 212, 0.4) !important;
        }

        .marker-cluster-medium {
            background-color: rgba(245, 158, 11, 0.2) !important;
        }

        .marker-cluster-medium div {
            background-color: rgba(245, 158, 11, 0.65) !important;
            color: #fff !important;
            font-weight: 700 !important;
            font-family: 'Inter', sans-serif !important;
            box-shadow: 0 0 10px rgba(245, 158, 11, 0.4) !important;
        }

        .marker-cluster-large {
            background-color: rgba(239, 68, 68, 0.2) !important;
        }

        .marker-cluster-large div {
            background-color: rgba(239, 68, 68, 0.65) !important;
            color: #fff !important;
            font-weight: 700 !important;
            font-family: 'Inter', sans-serif !important;
            box-shadow: 0 0 10px rgba(239, 68, 68, 0.4) !important;
        }

        .marker-cluster-hmo-register {
            background-color: rgba(168, 85, 247, 0.2) !important;
        }

        .marker-cluster-hmo-register div {
            background-color: rgba(168, 85, 247, 0.65) !important;
            color: #fff !important;
            font-weight: 700 !important;
            font-family: 'Inter', sans-serif !important;
            box-shadow: 0 0 10px rgba(168, 85, 247, 0.4) !important;
        }

        .marker-cluster {
            background-clip: padding-box;
            border-radius: 20px;
        }

        .marker-cluster div {
            width: 30px;
            height: 30px;
            margin-left: 5px;
            margin-top: 5px;
            text-align: center;
            border-radius: 15px;
            align-content: center;
        }

        /* Light Mode Specific Accent Overrides for Marker Clusters */
        body.light-mode .marker-cluster-small {
            background-color: rgba(8, 145, 178, 0.15) !important;
        }

        body.light-mode .marker-cluster-small div {
            background-color: rgba(8, 145, 178, 0.8) !important;
        }

        body.light-mode .marker-cluster-medium {
            background-color: rgba(217, 119, 6, 0.15) !important;
        }

        body.light-mode .marker-cluster-medium div {
            background-color: rgba(217, 119, 6, 0.8) !important;
        }

        body.light-mode .marker-cluster-large {
            background-color: rgba(220, 38, 38, 0.15) !important;
        }

        body.light-mode .marker-cluster-large div {
            background-color: rgba(220, 38, 38, 0.8) !important;
        }

        body.light-mode .marker-cluster-hmo-register {
            background-color: rgba(124, 58, 237, 0.15) !important;
        }

        body.light-mode .marker-cluster-hmo-register div {
            background-color: rgba(124, 58, 237, 0.8) !important;
        }
