/* Ensure Inputs and Selects stay solid & highly readable */
        input,
        select,
        textarea {
            background: #ffffff !important;
            border: 1px solid #e2e8f0 !important;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
            color: #1e293b !important;
            transition: all 0.2s ease-in-out !important;
        }

        input:focus,
        select:focus,
        textarea:focus {
            background: #ffffff !important;
            border-color: var(--brand-color, #0F2942) !important;
            box-shadow: 0 0 0 3px var(--brand-ring, rgba(15, 41, 66, 0.1)) !important;
            outline: none !important;
        }

        #login-form input,
        #login-form select {
            background: #ffffff !important;
            border: 1px solid #e2e8f0 !important;
            color: #0f172a !important;
            border-radius: 8px !important;
            height: 48px !important;
            padding-top: 0 !important;
            padding-bottom: 0 !important;
            padding-left: 2.75rem !important;
            padding-right: 2.5rem !important;
        }
        #login-form input:focus,
        #login-form select:focus {
            background: #ffffff !important;
            border-color: #0F2942 !important;
            box-shadow: 0 0 0 3px rgba(15, 41, 66, 0.1) !important;
        }
        #login-form select option {
            background-color: #ffffff !important;
            color: #1e293b !important;
        }
        #login-form input[type="checkbox"] {
            background: #ffffff !important;
            border: 1px solid #cbd5e1 !important;
            border-radius: 0.25rem !important;
            width: 1rem !important;
            height: 1rem !important;
            padding: 0 !important;
        }

        @keyframes float {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-12px); }
        }




        /* White Buttons */
        button.bg-white {
            background: #ffffff !important;
        }

        /* Clean Minimalist Background */
        body {
            -webkit-tap-highlight-color: transparent;
            background-color: #f1f5f9;
        }

        /* Modern Enterprise Solid Cards */
        @keyframes shimmer {
            100% { transform: translateX(150%); }
        }

        .glass {
            background: #ffffff !important;
            border: 1px solid #e2e8f0 !important;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1) !important;
        }

        /* Dark Modern Sidebar */
        .glass-dark,
        #desktop-sidebar {
            background: #0f172a !important;
            border-right: 1px solid #1e293b !important;
            box-shadow: 4px 0 24px rgba(0, 0, 0, 0.05) !important;
            transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
        }

        /* Mobile Bottom Nav & Header */
        #mobile-bottom-nav,
        header.glass {
            background: #ffffff !important;
            border-top: 1px solid #e2e8f0 !important;
            box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05) !important;
        }

        /* Scrollbar */
        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }

        ::-webkit-scrollbar-track {
            background: transparent;
        }

        ::-webkit-scrollbar-thumb {
            background: rgba(203, 213, 225, 0.8);
            border-radius: 10px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: rgba(148, 163, 184, 0.8);
        }

        .no-scrollbar::-webkit-scrollbar {
            display: none;
        }

        .no-scrollbar {
            -ms-overflow-style: none;
            scrollbar-width: none;
        }

        /* Performance-optimized Scrolling & Hardware Acceleration */
        html,
        body {
            scroll-behavior: smooth;
        }
        
        #view-port,
        .overflow-y-auto,
        .overflow-x-auto {
            -webkit-overflow-scrolling: touch;
            will-change: scroll-position;
            transform: translateZ(0);
            backface-visibility: hidden;
            perspective: 1000px;
        }

        /* Prevent layout thrashing on sticky columns/headers during scroll */
        .sticky,
        [class*="sticky"] {
            will-change: transform;
            transform: translateZ(0);
        }

        /* Premium Tab & View Switch Animations */
        .fade-in {
            animation: premiumFadeIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
            will-change: opacity, transform, filter;
        }

        @keyframes premiumFadeIn {
            from {
                opacity: 0;
                transform: translateY(16px) scale(0.98);
                filter: blur(10px);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
                filter: blur(0);
            }
        }

        /* Liquid Glow Removed for Solid Theme */

        .btn-liquid {
            position: relative;
            z-index: 1;
            overflow: hidden;
            background: linear-gradient(135deg, #0F2942, #1e3a5f);
            transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
        }

        .btn-liquid::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: all 0.6s;
            z-index: -1;
        }

        .btn-liquid:hover::before {
            left: 100%;
        }

        .btn-liquid:hover {
            box-shadow: 0 10px 20px rgba(15, 41, 66, 0.2);
            transform: translateY(-2px);
        }

        /* Enhanced Smooth State Transitions for Interactive Elements */
        button,
        select,
        input,
        .transition-all,
        .transition-colors {
            transition-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !important;
            transition-duration: 0.35s !important;
        }

        /* Mobile specific utilities */
        .pb-safe {
            padding-bottom: env(safe-area-inset-bottom, 20px);
        }

        /* Hide arrows in number inputs */
        input[type=number]::-webkit-inner-spin-button,
        input[type=number]::-webkit-outer-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        /* Pro-Level Theme Loader */
        .theme-loader {
            width: 60px;
            aspect-ratio: 1;
            border-radius: 50%;
            border: 5px solid rgba(15, 41, 66, 0.08);
            /* Soft ACI Blue Base */
            border-right-color: #0F2942;
            /* ACI Blue */
            border-top-color: #F4A915;
            /* ACI Gold Accent */
            animation: l2 1s infinite linear;
        }

        @keyframes l2 {
            to {
                transform: rotate(1turn)
            }
        }

        /* Leaflet Custom Map Overrides */
        .leaflet-tooltip.custom-leaflet-tooltip {
            background: transparent;
            border: none;
            box-shadow: none;
            padding: 0;
        }

        .leaflet-tooltip.custom-leaflet-tooltip::before {
            display: none !important;
            /* Hide default leaflet triangle */
        }

        .leaflet-container {
            font-family: 'Inter', sans-serif !important;
            background: #f1f5f9 !important;
            z-index: 10 !important;
        }

        .leaflet-control-attribution {
            display: none !important;
            /* Keep it ultra minimal */
        }

        /* Liquid Glass Design System */
        .liquid-glass-blur {
            backdrop-filter: blur(25px) saturate(200%);
            -webkit-backdrop-filter: blur(25px) saturate(200%);
            background: rgba(255, 255, 255, 0.4);
            border: 1px solid rgba(255, 255, 255, 0.4);
        }

        .liquid-container {
            position: absolute;
            inset: 0;
            overflow: hidden;
            z-index: -1;
            pointer-events: none;
            filter: blur(40px);
        }

        .liquid-blob {
            position: absolute;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--blob-color-1, #0F2942), var(--blob-color-2, #F4A915));
            animation: fluidMotion 15s infinite alternate ease-in-out;
            opacity: 0.5;
            mix-blend-mode: soft-light;
        }

        .liquid-blob:nth-child(2) {
            animation-duration: 25s;
            animation-delay: -5s;
            background: linear-gradient(225deg, #6366f1, #06b6d4);
            opacity: 0.4;
        }

        .liquid-blob:nth-child(3) {
            animation-duration: 20s;
            animation-delay: -10s;
            background: linear-gradient(45deg, #f43f5e, #fb923c);
            opacity: 0.3;
        }

        @keyframes fluidMotion {
            0% {
                transform: translate(-15%, -15%) scale(1) rotate(0deg);
                border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
            }

            33% {
                transform: translate(25%, 35%) scale(1.3) rotate(120deg);
                border-radius: 60% 40% 30% 70% / 50% 60% 50% 40%;
            }

            66% {
                transform: translate(-10%, 55%) scale(0.9) rotate(240deg);
                border-radius: 30% 70% 50% 50% / 60% 30% 70% 40%;
            }

            100% {
                transform: translate(15%, -10%) scale(1.15) rotate(360deg);
                border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
            }
        }

        .liquid-surface {
            background: radial-gradient(circle at 50% 50%, #f8fafc 0%, #f1f5f9 100%);
            position: fixed;
            inset: 0;
            z-index: -2;
        }

        .mesh-gradient-sidebar {
            background: radial-gradient(at 0% 0%, rgba(15, 41, 66, 0.4) 0px, transparent 50%),
                radial-gradient(at 100% 0%, rgba(244, 169, 21, 0.1) 0px, transparent 50%),
                radial-gradient(at 100% 100%, rgba(15, 41, 66, 0.4) 0px, transparent 50%),
                radial-gradient(at 0% 100%, rgba(244, 169, 21, 0.1) 0px, transparent 50%);
        }

        .glass-shine {
            position: relative;
            overflow: hidden;
        }

        .glass-shine::after {
            content: '';
            position: absolute;
            top: -150%;
            left: -150%;
            width: 300%;
            height: 300%;
            background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
            transform: rotate(45deg);
            animation: shine 6s infinite;
            pointer-events: none;
        }

        @keyframes shine {
            0% {
                transform: translateX(-100%) rotate(45deg);
            }

            20%,
            100% {
                transform: translateX(100%) rotate(45deg);
            }
        }

        .liquid-text {
            background: linear-gradient(90deg, #1e293b, #0F2942, #F4A915, #0F2942, #1e293b);
            background-size: 200% auto;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: liquidTextFlow 8s linear infinite;
            filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.05));
        }

        @keyframes liquidTextFlow {
            0% {
                background-position: 0% center;
            }

            100% {
                background-position: 200% center;
            }
        }

        @keyframes brandInactivePulse {
            0%, 100% { opacity: 0.45; transform: scale(0.98); }
            50% { opacity: 0.8; transform: scale(1.02); }
        }

        @keyframes brandActiveGlow {
            0%, 100% { box-shadow: 0 4px 6px -1px rgba(255, 255, 255, 0.12), 0 2px 4px -1px rgba(255, 255, 255, 0.08), 0 0 4px rgba(255, 255, 255, 0.15); transform: scale(1.05); }
            50% { box-shadow: 0 10px 15px -3px rgba(255, 255, 255, 0.25), 0 4px 6px -2px rgba(255, 255, 255, 0.12), 0 0 10px rgba(255, 255, 255, 0.4); transform: scale(1.08); }
        }

        /* Mobile Specific Premium Enhancements */
        @media (max-width: 640px) {
            #view-port {
                padding: 12px !important;
                padding-bottom: 80px !important;
            }

            .glass {
                border-radius: 1.25rem !important;
                padding: 1.25rem !important;
            }

            .kpi-grid {
                grid-template-columns: 1fr 1fr !important;
                gap: 8px !important;
            }

            .mobile-hide {
                display: none !important;
            }

            #app-header {
                padding-top: calc(env(safe-area-inset-top, 0px) + 8px) !important;
                padding-bottom: 12px !important;
                margin: 0px !important;
                border-radius: 0px !important;
                background: rgba(255, 255, 255, 0.85) !important;
                backdrop-filter: blur(20px) saturate(190%) !important;
                -webkit-backdrop-filter: blur(20px) saturate(190%) !important;
                border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
                border-top: none !important;
                border-left: none !important;
                border-right: none !important;
                position: sticky !important;
                top: 0px !important;
                z-index: 40 !important;
                box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01), 0 2px 4px -1px rgba(0, 0, 0, 0.01) !important;
                transition: background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), backdrop-filter 0.4s cubic-bezier(0.16, 1, 0.3, 1), padding-top 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
            }

            #sidebar-header {
                padding-top: calc(env(safe-area-inset-top, 0px) + 16px) !important;
            }
        }



        .nav-tab-active {
            color: #0F2942;
            position: relative;
        }

        .nav-tab-active::after {
            content: '';
            position: absolute;
            bottom: -2px;
            left: 50%;
            transform: translateX(-50%);
            width: 4px;
            height: 4px;
            background: #F4A915;
            border-radius: full;
            box-shadow: 0 0 10px #F4A915;
        }

        /* Premium Territory Pulse Table Enhancements */
        .pulse-tr-premium {
            transition: all 0.2s ease-in-out !important;
        }
        .pulse-tr-premium:hover {
            position: absolute;
            inset: 0;
            overflow: hidden;
            z-index: -1;
            pointer-events: none;
            filter: blur(40px);
        }

        .liquid-blob {
            position: absolute;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--blob-color-1, #0F2942), var(--blob-color-2, #F4A915));
            animation: fluidMotion 15s infinite alternate ease-in-out;
            opacity: 0.5;
            mix-blend-mode: soft-light;
        }

        .liquid-blob:nth-child(2) {
            animation-duration: 25s;
            animation-delay: -5s;
            background: linear-gradient(225deg, #6366f1, #06b6d4);
            opacity: 0.4;
        }

        .liquid-blob:nth-child(3) {
            animation-duration: 20s;
            animation-delay: -10s;
            background: linear-gradient(45deg, #f43f5e, #fb923c);
            opacity: 0.3;
        }

        @keyframes fluidMotion {
            0% {
                transform: translate(-15%, -15%) scale(1) rotate(0deg);
                border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
            }

            33% {
                transform: translate(25%, 35%) scale(1.3) rotate(120deg);
                border-radius: 60% 40% 30% 70% / 50% 60% 50% 40%;
            }

            66% {
                transform: translate(-10%, 55%) scale(0.9) rotate(240deg);
                border-radius: 30% 70% 50% 50% / 60% 30% 70% 40%;
            }

            100% {
                transform: translate(15%, -10%) scale(1.15) rotate(360deg);
                border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
            }
        }

        .liquid-surface {
            background: radial-gradient(circle at 50% 50%, #f8fafc 0%, #f1f5f9 100%);
            position: fixed;
            inset: 0;
            z-index: -2;
        }

        .mesh-gradient-sidebar {
            background: radial-gradient(at 0% 0%, rgba(15, 41, 66, 0.4) 0px, transparent 50%),
                radial-gradient(at 100% 0%, rgba(244, 169, 21, 0.1) 0px, transparent 50%),
                radial-gradient(at 100% 100%, rgba(15, 41, 66, 0.4) 0px, transparent 50%),
                radial-gradient(at 0% 100%, rgba(244, 169, 21, 0.1) 0px, transparent 50%);
        }

        .glass-shine {
            position: relative;
            overflow: hidden;
        }

        .glass-shine::after {
            content: '';
            position: absolute;
            top: -150%;
            left: -150%;
            width: 300%;
            height: 300%;
            background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
            transform: rotate(45deg);
            animation: shine 6s infinite;
            pointer-events: none;
        }

        @keyframes shine {
            0% {
                transform: translateX(-100%) rotate(45deg);
            }

            20%,
            100% {
                transform: translateX(100%) rotate(45deg);
            }
        }

        .liquid-text {
            background: linear-gradient(90deg, #1e293b, #0F2942, #F4A915, #0F2942, #1e293b);
            background-size: 200% auto;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: liquidTextFlow 8s linear infinite;
            filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.05));
        }

        @keyframes liquidTextFlow {
            0% {
                background-position: 0% center;
            }

            100% {
                background-position: 200% center;
            }
        }

        @keyframes brandInactivePulse {
            0%, 100% { opacity: 0.45; transform: scale(0.98); }
            50% { opacity: 0.8; transform: scale(1.02); }
        }

        @keyframes brandActiveGlow {
            0%, 100% { box-shadow: 0 4px 6px -1px rgba(255, 255, 255, 0.12), 0 2px 4px -1px rgba(255, 255, 255, 0.08), 0 0 4px rgba(255, 255, 255, 0.15); transform: scale(1.05); }
            50% { box-shadow: 0 10px 15px -3px rgba(255, 255, 255, 0.25), 0 4px 6px -2px rgba(255, 255, 255, 0.12), 0 0 10px rgba(255, 255, 255, 0.4); transform: scale(1.08); }
        }

        /* Mobile Specific Premium Enhancements */
        @media (max-width: 640px) {
            #view-port {
                padding: 12px !important;
                padding-bottom: 80px !important;
            }

            .glass {
                border-radius: 1.25rem !important;
                padding: 1.25rem !important;
            }

            .kpi-grid {
                grid-template-columns: 1fr 1fr !important;
                gap: 8px !important;
            }

            .mobile-hide {
                display: none !important;
            }

            #app-header {
                padding-top: calc(env(safe-area-inset-top, 0px) + 8px) !important;
                padding-bottom: 12px !important;
                margin: 0px !important;
                border-radius: 0px !important;
                background: rgba(255, 255, 255, 0.85) !important;
                backdrop-filter: blur(20px) saturate(190%) !important;
                -webkit-backdrop-filter: blur(20px) saturate(190%) !important;
                border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
                border-top: none !important;
                border-left: none !important;
                border-right: none !important;
                position: sticky !important;
                top: 0px !important;
                z-index: 40 !important;
                box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01), 0 2px 4px -1px rgba(0, 0, 0, 0.01) !important;
                transition: background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), backdrop-filter 0.4s cubic-bezier(0.16, 1, 0.3, 1), padding-top 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
            }

            #sidebar-header {
                padding-top: calc(env(safe-area-inset-top, 0px) + 16px) !important;
            }
        }



        .nav-tab-active {
            color: #0F2942;
            position: relative;
        }

        .nav-tab-active::after {
            content: '';
            position: absolute;
            bottom: -2px;
            left: 50%;
            transform: translateX(-50%);
            width: 4px;
            height: 4px;
            background: #F4A915;
            border-radius: full;
            box-shadow: 0 0 10px #F4A915;
        }

        /* Premium Territory Pulse Table Enhancements */
        .pulse-tr-premium {
            transition: all 0.2s ease-in-out !important;
        }
        .pulse-tr-premium:hover {
            background-color: rgba(99, 102, 241, 0.03) !important;
        }
        .pulse-tr-premium:hover td.sticky-left {
            background-color: #f8fafc !important;
        }
        .pulse-badge-amber {
            background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(217, 119, 6, 0.12) 100%);
            border: 1px solid rgba(245, 158, 11, 0.2);
        }


        /* Glassmorphism Conversion for Admin Panels */
        body.aurora-active {
            background-color: #f1f5f9; /* Slate 100 base */
            background-image: 
                radial-gradient(at 0% 0%, rgba(244, 169, 21, 0.03) 0, transparent 50%), 
                radial-gradient(at 50% 0%, rgba(99, 102, 241, 0.03) 0, transparent 50%), 
                radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.03) 0, transparent 50%);
        }

        body.aurora-active .bg-white {
            background: rgba(255, 255, 255, 0.65) !important;
            backdrop-filter: blur(20px) saturate(190%) !important;
            -webkit-backdrop-filter: blur(20px) saturate(190%) !important;
            border-color: rgba(255, 255, 255, 0.45) !important;
            box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.04), 0 1px 1px 0 rgba(255, 255, 255, 0.5) inset !important;
        }

        body.aurora-active select,
        body.aurora-active input,
        body.aurora-active textarea {
            background-color: rgba(255, 255, 255, 0.90) !important;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
        }

        /* Fix table header sticky cells when glass is active */
        body.aurora-active td.sticky-left,
        body.aurora-active th.sticky-left {
            background-color: rgba(248, 250, 252, 0.85) !important;
            backdrop-filter: blur(8px) !important;
        }

        /* Compact Premium Table Styling for Territory Pulse & AM Sync */
        body.aurora-active table th,
        body.aurora-active table td {
            padding-top: 0.22rem !important; /* Extremely compact rows */
            padding-bottom: 0.22rem !important;
            line-height: 1.15 !important;
            font-size: 10px !important; /* Slightly smaller text for premium clean look */
        }

        body.aurora-active table thead tr:first-child th {
            padding-top: 0.35rem !important;
            padding-bottom: 0.35rem !important;
            font-size: 9px !important;
        }

        body.aurora-active table td div.flex {
            gap: 0.3rem !important;
        }

        body.aurora-active table span.rounded-lg {
            padding: 0.1rem 0.3rem !important;
            font-size: 9px !important;
        }

        /* Hover animation glow for rows */
        body.aurora-active tbody tr {
            transition: all 0.15s ease-in-out !important;
        }

        body.aurora-active tbody tr:hover {
            background-color: rgba(99, 102, 241, 0.05) !important;
        }

        body.aurora-active tbody tr:hover td.sticky-left {
            background-color: rgba(241, 245, 249, 0.95) !important;
        }



/* Force Leaflet container to be transparent so SVG vector map is never hidden */
#real-bd-map, .leaflet-container, .leaflet-pane {
    background: transparent !important;
    background-color: transparent !important;
}
