:root {
    --status-available: #36ff32ff;
    --status-booked: #ff301dff;
    --status-reserved: rgba(255, 235, 56, 1);
    --bg-dark: #050608;
    --glass-bg: rgba(10, 11, 14, 0.85);
    --glass-border: rgba(255, 255, 255, 0.05);
    --accent: #00ff88;
    --accent-glow: rgba(0, 255, 136, 0.3);
    --premium-border: rgba(0, 255, 136, 0.1);
    --shadow-lg: 0 50px 100px rgba(0, 0, 0, 0.9);
    --nav-h: 80px;
    --font-heading: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

body.admin-body {
    background: var(--bg-dark);
    color: #eee;
    font-family: 'Inter', system-ui, sans-serif;
    margin: 0;
    overflow: hidden;
    overflow-x: hidden;
    height: 100vh;
    height: 100dvh;
    max-width: 100vw;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
}

.plots-list::-webkit-scrollbar {
    width: 4px;
}

.plots-list::-webkit-scrollbar-track {
    background: transparent;
}

.plots-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.plots-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

@keyframes fadeInBrand {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.brand-name {
    animation: fadeInBrand 0.8s ease-out forwards;
}

@keyframes profileSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Navigation --- */
.admin-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5rem;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.brand-name {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    color: white;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    display: none;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

.exit-btn {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s;
}

.exit-btn:hover {
    background: white;
    color: black;
    border-color: white;
}

/* --- Layout --- */
.admin-layout {
    display: flex;
    height: 100vh;
    padding-top: var(--nav-h);
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

#svgViewport {
    flex: 1;
    position: relative;
    background: radial-gradient(circle at center, #1a1a20 0%, #0a0a0c 100%);
    overflow: hidden;
    cursor: grab;
    min-height: 0;
}

#svgViewport.is-panning {
    cursor: grabbing;
}

#svgViewport.is-panning svg {
    pointer-events: none !important;
}

#svgPanLayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#svgPanLayer svg {
    display: block;
    width: 100% !important;
    height: 100% !important;
    shape-rendering: geometricPrecision;
}

#svgPanLayer svg path,
#svgPanLayer svg text {
    shape-rendering: geometricPrecision;
}

#svgPanLayer svg path {
    vector-effect: non-scaling-stroke;
}

/* --- Sidebar --- */
.admin-sidebar {
    width: var(--sidebar-width, 360px);
    min-width: 280px;
    max-width: 600px;
    background: rgba(10, 10, 12, 0.8);
    backdrop-filter: blur(30px);
    border-left: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 1100;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), width 0.05s linear;
    position: relative;
}

.sidebar-header {
    padding: 0.75rem 1rem 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-top-title {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: white;
    opacity: 0.25;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.stats-row {
    display: flex;
    gap: 12px;
    margin-bottom: 1rem;
}

/* Stats row (kept for layout spacing in sidebar-header) */
.stats-row {
    display: flex;
    gap: 12px;
    margin-bottom: 1rem;
}

/* --- Navigation Profile Pill --- */
.admin-user-profile-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    padding-left: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-user-profile-nav:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.admin-user-profile-nav .user-avatar-small {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.admin-user-profile-nav.mobile-expanded .user-avatar-small {
    animation: profileSpin 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.user-info-compact {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    object-fit: cover;
}

.user-name-small {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-btn-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 23, 0, 0.1);
    border: none;
    color: #ff301dff;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn-compact:hover {
    background: #ff301dff;
    color: white;
    transform: scale(1.1);
}

.logout-btn-compact .material-symbols-rounded {
    font-size: 18px;
}

/* Sidebar Resizer */
.sidebar-resizer {
    width: 6px;
    cursor: col-resize;
    position: relative;
    z-index: 1200;
    margin-right: -3px;
    margin-left: -3px;
    transition: background 0.2s;
}

.sidebar-resizer::after {
    content: '';
    position: absolute;
    top: 0; left: 50%; bottom: 0;
    width: 2px;
    transform: translateX(-50%);
    background: transparent;
    transition: all 0.3s;
}

.sidebar-resizer:hover::after,
.sidebar-resizer.dragging::after {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    width: 4px;
}

.user-email {
    display: none;
}

/* Sidebar Search */
.search-container {
    position: relative;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

#plotSearch {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 12px 12px 40px;
    color: white;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s;
}

#plotSearch:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--status-available);
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.2);
}

.search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.search-clear:hover {
    color: white;
}

.search-clear .material-symbols-rounded {
    font-size: 18px;
}

.plots-list {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: grid;
    gap: 12px;
    content-visibility: auto;
}

.plot-item {
    padding: 1.25rem;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.plot-item:hover {
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.05);
}

.plot-item.selected {
    border-color: #fff !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Sidebar Color Styles */
.plot-item.available {
    background: rgba(46, 204, 113, 0.1);
    border-left: 4px solid var(--status-available);
    color: var(--status-available);
}

.plot-item.booked {
    background: rgba(231, 76, 60, 0.1);
    border-left: 4px solid var(--status-booked);
    color: var(--status-booked);
}

.plot-item.reserved {
    background: rgba(241, 196, 15, 0.1);
    border-left: 4px solid var(--status-reserved);
    color: var(--status-reserved);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.status-dot.available {
    background: var(--status-available);
}

.status-dot.booked {
    background: var(--status-booked);
}

.status-dot.reserved {
    background: var(--status-reserved);
}

/* Radial Status Picker — appears around selected plot */
.status-picker {
    position: fixed;
    top: 0; left: 0;
    width: 0; height: 0;
    background: none;
    border: none;
    backdrop-filter: none;
    padding: 0;
    opacity: 0;
    z-index: 9999;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.status-picker.active {
    opacity: 1;
    pointer-events: auto;
}

/* Hide the plot-id label inside the radial picker */
.picker-id { display: none; }

/* Actions container — just passes through, buttons are positioned individually */
.picker-actions { display: contents; }

/* Each button is an independent tiny pill */
.picker-btn {
    position: fixed;
    background: rgba(10, 10, 15, 0.92);
    border: 1.5px dashed rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 24px;
    padding: 6px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    transition: all 0.15s ease;
    transform: translate(-50%, -50%) scale(0.85);
    white-space: nowrap;
    z-index: 9999;
    pointer-events: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}
.picker-btn .material-symbols-rounded {
    font-size: 16px;
}
.picker-btn .btn-lbl {
    font-size: 0.75rem;
}
.status-picker.active .picker-btn {
    transform: translate(-50%, -50%) scale(1);
}

.picker-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.5);
}

.picker-btn.active#btn-available {
    background: var(--status-available);
    color: #000;
    border-color: var(--status-available);
    border-style: solid;
}
.picker-btn.active#btn-reserved {
    background: var(--status-reserved);
    color: #000;
    border-color: var(--status-reserved);
    border-style: solid;
}
.picker-btn.active#btn-booked {
    background: var(--status-booked);
    color: #fff;
    border-color: var(--status-booked);
    border-style: solid;
}

/* SVG dashed-line overlay connecting plot center to each button */
#pickerLines {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 9998;
}

/* Map Toolbar */
.map-toolbar {
    position: absolute;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px;
    border-radius: 16px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tool-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: white;
    color: black;
    transform: scale(1.1);
}

.tool-btn:active {
    transform: scale(0.95);
}

.tool-btn .material-symbols-rounded {
    font-size: 20px;
}

/* Skeletons */
.plot-skeleton {
    height: 60px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 25%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0.02) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 18px;
    margin-bottom: 12px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Nav Action Buttons */
.nav-right {
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-action-btn {
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
}

.nav-action-btn .material-symbols-rounded {
    font-size: 18px;
}

.view-site-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.view-site-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.logout-btn {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.logout-btn:hover {
    background: rgba(231, 76, 60, 0.25);
}

/* --- Loader --- */
.loader-view {
    position: fixed;
    inset: 0;
    background: #0d0d0f;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: Inter;
}

/* --- Toast Notifications --- */
.admin-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 9999;
    pointer-events: none;
    white-space: normal;
    text-align: center;
    max-width: 90vw;
    width: max-content;
    backdrop-filter: blur(20px);
}

.admin-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.admin-toast--success {
    background: rgba(6, 255, 0, 0.15);
    border: 1px solid rgba(6, 255, 0, 0.3);
    color: #36ff32ff;
}

.admin-toast--error {
    background: rgba(255, 23, 0, 0.15);
    border: 1px solid rgba(255, 23, 0, 0.3);
    color: #FF6B6B;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .menu-toggle {
        display: flex;
    }

    .admin-sidebar {
        position: fixed;
        top: var(--nav-h);
        right: 0;
        bottom: 0;
        transform: translateX(100%);
        width: 320px;
    }

    .admin-sidebar.active {
        transform: translateX(0);
        box-shadow: -10px 0 50px rgba(0, 0, 0, 0.5);
    }

    /* Compact Navbar on Tablet/Mobile */
    .admin-nav {
        padding: 0 2rem;
    }

    .nav-left {
        gap: 1rem;
    }

    .nav-btn-text {
        display: none;
    }

    .nav-action-btn {
        padding: 8px;
        width: 44px;
        height: 44px;
        justify-content: center;
        box-sizing: border-box;
        gap: 0;
    }

    .nav-right {
        gap: 10px;
    }

    /* Action bar on tablet */
    .admin-action-bar {
        bottom: auto;
        top: calc(var(--nav-h) + 12px);
        right: 1.5rem;
    }


    .admin-user-profile-nav {
        cursor: pointer;
        padding: 4px; /* Uniform padding for circular look */
        overflow: hidden;
        min-width: 42px;
        max-width: 42px; /* Fully collapsed state */
        height: 42px;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        transition: max-width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), 
                    background 0.3s,
                    box-shadow 0.3s;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    }

    .admin-user-profile-nav.mobile-expanded {
        max-width: 240px; /* Fully expanded state */
        padding-left: 12px;
        padding-right: 12px;
        border-radius: 50px;
    }

    /* Avatar centering when collapsed */
    .user-info-compact {
        flex: 1;
        min-width: 0;
        justify-content: flex-start;
        gap: 12px;
    }

    .admin-user-profile-nav .user-avatar-small {
        flex-shrink: 0;
        width: 32px;
        height: 32px;
    }

    .admin-user-profile-nav .user-name-small {
        opacity: 0;
        transform: translateX(-10px);
        transition: opacity 0.4s ease, transform 0.4s ease;
        pointer-events: none;
        white-space: nowrap;
    }

    .admin-user-profile-nav.mobile-expanded .user-name-small {
        opacity: 1;
        transform: translateX(0);
        pointer-events: auto;
    }

    .admin-user-profile-nav .logout-btn-compact {
        opacity: 0;
        transform: scale(0.5);
        transition: all 0.4s ease 0.1s;
        margin-left: auto;
    }

    .admin-user-profile-nav.mobile-expanded .logout-btn-compact {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 640px) {
    .admin-nav {
        padding: 0 0.75rem;
    }

    .nav-left {
        gap: 0.5rem;
    }

    .nav-right {
        gap: 6px;
    }

    .brand-name {
        font-size: 1rem;
    }

    .nav-action-btn {
        min-width: 38px;
        width: 38px;
        height: 38px;
        padding: 6px;
    }
    .nav-action-btn .material-symbols-rounded {
        font-size: 16px;
    }

    .admin-user-profile-nav {
        min-width: 36px;
        max-width: 36px;
        height: 36px;
    }
    .admin-user-profile-nav .user-avatar-small {
        width: 26px;
        height: 26px;
    }

    .login-card {
        padding: 2rem 1.5rem;
        border-radius: 24px;
    }
    .login-card .brand-title {
        font-size: 1.4rem;
    }

    /* Action bar on mobile */
    .admin-action-bar {
        background: rgba(15, 15, 20, 0.9);
        backdrop-filter: blur(20px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        bottom: 120px;
        /* Above status picker */
        top: auto;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        flex-direction: row;
        border-radius: 20px;
        padding: 10px;
        width: max-content;
        gap: 15px;
    }

    .admin-action-bar .action-btn {
        width: auto;
        height: auto;
        border-radius: 12px;
        padding: 8px 16px;
        justify-content: center;
        box-shadow: none;
    }

    .admin-action-bar .action-btn .btn-lbl {
        display: block;
    }

    .admin-action-bar .btn-undo {
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: none;
    }
}

/* --- Login Screen (Cinematic Phase 3 - Luxury) --- */
.login-view {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #0a0c10 0%, #050608 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 20px;
    overflow: hidden;
    perspective: 1000px;
}

.login-bg-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 255, 136, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.5;
    animation: drift 60s linear infinite;
}

@keyframes drift {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 500px 500px;
    }
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 4rem 3rem;
    border-radius: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.8),
        inset 0 0 40px rgba(255, 255, 255, 0.02);
    animation: luxuryArrival 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes luxuryArrival {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
        filter: blur(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.security-indicator {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--accent);
    opacity: 0.6;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
    animation: dotPulse 2s infinite;
}

@keyframes dotPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.8);
    }
}

.login-logo {
    width: 60px;
    height: auto;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 15px rgba(0, 255, 136, 0.3));
}

.brand-title {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    color: #fff;
    background: linear-gradient(to bottom, #fff 40%, #888 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.admin-label {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    color: var(--accent);
    opacity: 0.9;
    margin-bottom: 3rem;
    text-transform: uppercase;
}

.input-container {
    width: 100%;
    position: relative;
    margin-bottom: 2rem;
}

.input-shimmer {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    pointer-events: none;
    opacity: 0;
    border: 1px solid var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    transition: opacity 0.3s;
}

.login-input:focus~.input-shimmer {
    opacity: 1;
}

.login-input {
    width: 100%;
    box-sizing: border-box;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    letter-spacing: 0.4em;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.login-input::placeholder {
    letter-spacing: 0.1em;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    opacity: 0.3;
    text-transform: uppercase;
}

.login-btn {
    width: 100%;
    padding: 1.25rem;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
    overflow: hidden;
}

.login-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.login-btn:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    background: var(--accent);
}

.login-btn:hover::before {
    transform: translateX(100%);
}

.login-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.login-footer {
    margin-top: 2.5rem;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* --- Nav Action Bar (Save/Undo) --- */
.action-btn {
    position: relative;
}

.action-undo {
    background: rgba(255,255,255,0.05);
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
}
.action-undo:hover {
    background: rgba(255,255,255,0.15);
}

.action-save {
    background: var(--status-available);
    color: #000;
    border: none;
    box-shadow: 0 0 15px rgba(6, 255, 0, 0.2);
    min-width: 100px;
}

.action-save:hover {
    background: #00ff66;
    box-shadow: 0 0 25px rgba(6, 255, 0, 0.4);
}

.action-save.state-idle {
    opacity: 0.5;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4);
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.action-save.saving {
    background: #444;
    color: #888;
    pointer-events: none;
}

.action-save.saving::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid #888;
    border-top-color: white;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
    margin-left: 10px;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

.action-save.success {
    background: var(--accent);
    color: #000;
}

.action-save.success .nav-btn-text {
    display: none;
}

.action-save.success .save-status-icon {
    display: block !important;
}

@media (max-width: 768px) {
    .map-toolbar {
        bottom: 190px; /* Safely above the status picker */
        right: 15px;
    }

    .admin-action-bar {
        bottom: 100px;
        padding: 8px;
        gap: 8px;
    }
    .admin-action-bar .action-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}

.unsaved-badge {
    position: absolute; top: -5px; right: -5px;
    background: var(--status-booked);
    color: white; border-radius: 50%;
    width: 20px; height: 20px; font-size: 0.65rem;
    font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 10px rgba(255, 23, 0, 0.5);
    border: 2px solid var(--bg-dark);
}

/* --- Admin Login → Dashboard Transition Overlay --- */
.admin-transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: radial-gradient(circle at center, #0d0e12 0%, #050608 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.admin-transition-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.admin-transition-overlay.exiting {
    opacity: 0;
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: transitionFadeIn 0.5s 0.2s ease both;
}

@keyframes transitionFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.transition-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: transitionSpin 0.8s linear infinite;
}

@keyframes transitionSpin {
    to { transform: rotate(360deg); }
}

.transition-text {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: white;
    text-transform: uppercase;
}

.transition-subtext {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.06em;
    font-weight: 500;
}

/* =============================================
   MOBILE PERFORMANCE OVERRIDES
   Applied when body.is-mobile class is set by JS.
   ============================================= */

/* 1. Kill backdrop-filter blur on mobile (extremely GPU-heavy on SVG-heavy pages) */
body.is-mobile .glass,
body.is-mobile .login-card,
body.is-mobile .status-picker,
body.is-mobile .map-toolbar,
body.is-mobile .admin-nav,
body.is-mobile .admin-sidebar,
body.is-mobile .admin-toast,
body.is-mobile .metrics-card,
body.is-mobile .admin-transition-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* 2. Remove CSS transitions from SVG elements (per-element GPU compositing) */
body.is-mobile #svgPanLayer svg path,
body.is-mobile #svgPanLayer svg [data-plot-id],
body.is-mobile #svgPanLayer svg .admin-plot {
    transition: none !important;
}

/* 3. Simplify pan layer 3D rendering */
body.is-mobile #svgPanLayer {
    perspective: none;
    transform-style: flat;
    backface-visibility: visible;
}

/* 4. Downgrade SVG shape rendering on mobile — crispEdges is faster */
body.is-mobile #svgPanLayer svg,
body.is-mobile #svgPanLayer svg path,
body.is-mobile #svgPanLayer svg text {
    shape-rendering: crispEdges;
}

/* 5. Remove hover transform effects on mobile (causes repaints) */
body.is-mobile .plot-item:hover {
    transform: none;
}
body.is-mobile .picker-btn:hover {
    transform: none;
}
body.is-mobile .tool-btn:hover {
    transform: none;
}
body.is-mobile .nav-action-btn:hover {
    transform: none;
}
body.is-mobile .exit-btn:hover {
    transform: none;
}
body.is-mobile .admin-user-profile-nav:hover {
    transform: none;
}


/* 6. Disable animations that run continuously */
body.is-mobile .active-progress-line,
body.is-mobile .pulse-dot,
body.is-mobile .audit-unread-dot.visible,
body.is-mobile .login-bg-overlay {
    animation: none !important;
}

/* 7. Reduce box-shadow complexity */
body.is-mobile .status-picker {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
body.is-mobile .login-card {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
}

/* 8. Disable login background drift animation */
body.is-mobile .login-bg-overlay {
    animation: none;
    opacity: 0.2;
}

/* 9. Disable shimmer on skeleton loaders */
body.is-mobile .plot-skeleton {
    animation: none;
    background: rgba(255, 255, 255, 0.03);
}

/* 10. Remove transition overlay animations */
body.is-mobile .transition-content {
    animation: none;
}
body.is-mobile .transition-spinner {
    animation: none;
    border-color: rgba(255, 255, 255, 0.08);
    border-top-color: var(--accent);
}


/* --- Extra-Small Screens (<=480px) --- */
@media (max-width: 480px) {
    .admin-nav {
        padding: 0 0.5rem;
    }
    .nav-right {
        gap: 4px;
    }
    .nav-action-btn {
        min-width: 34px;
        width: 34px;
        height: 34px;
        padding: 4px;
    }
    .nav-action-btn .material-symbols-rounded {
        font-size: 15px;
    }
    .admin-user-profile-nav {
        min-width: 32px;
        max-width: 32px;
        height: 32px;
    }
    .admin-user-profile-nav .user-avatar-small {
        width: 22px;
        height: 22px;
    }
    .admin-user-profile-nav.mobile-expanded {
        max-width: 180px;
    }

    /* Login card */
    .login-card {
        padding: 1.5rem 1rem;
        border-radius: 20px;
    }
    .login-card .brand-title {
        font-size: 1.2rem;
    }
    .login-card .security-indicator {
        top: 1rem;
        right: 1rem;
    }
    .login-card .login-logo {
        width: 44px;
    }

    .admin-sidebar {
        width: min(300px, 100vw) !important;
    }

    .sidebar-header {
        padding: 0.5rem 0.75rem;
    }

    .search-container {
        margin-top: 0.25rem;
    }
    #plotSearch {
        padding: 8px 8px 8px 32px;
        font-size: 0.8rem;
    }
    .search-icon {
        font-size: 16px;
        left: 8px;
    }

    .plots-list {
        padding: 1rem;
        gap: 8px;
    }
    .plot-item {
        padding: 0.75rem 0.75rem;
        border-radius: 12px;
        gap: 10px;
    }
    .plot-item .status-dot {
        width: 10px;
        height: 10px;
    }

    .map-toolbar {
        bottom: 170px;
        right: 10px;
        padding: 6px;
    }
    .tool-btn {
        width: 36px;
        height: 36px;
    }
    .tool-btn .material-symbols-rounded {
        font-size: 17px;
    }
}

/* --- Ultra-Small Screens (<=360px) --- */
@media (max-width: 360px) {
    .admin-nav {
        padding: 0 0.35rem;
    }
    .brand-name {
        font-size: 0.85rem;
    }
    .nav-right {
        gap: 3px;
    }
    .nav-action-btn {
        min-width: 30px;
        width: 30px;
        height: 30px;
        padding: 4px;
    }
    .nav-action-btn .material-symbols-rounded {
        font-size: 13px;
    }
    .admin-user-profile-nav {
        min-width: 28px;
        max-width: 28px;
        height: 28px;
    }
    .admin-user-profile-nav .user-avatar-small {
        width: 20px;
        height: 20px;
    }

    .login-card {
        padding: 1.25rem 0.75rem;
        border-radius: 16px;
    }
    .login-card .brand-title {
        font-size: 1rem;
    }
    .login-card .login-logo {
        width: 36px;
    }
    .login-card .security-indicator {
        top: 0.75rem;
        right: 0.75rem;
    }

    .admin-sidebar {
        width: 100vw !important;
    }

    .plots-list {
        padding: 0.75rem;
        gap: 6px;
    }
    .plot-item {
        padding: 0.6rem 0.6rem;
        border-radius: 10px;
        gap: 8px;
        font-size: 0.8rem;
    }
    .plot-item .status-dot {
        width: 8px;
        height: 8px;
    }

    .map-toolbar {
        right: 6px;
        padding: 5px;
        gap: 6px;
    }
    .tool-btn {
        width: 32px;
        height: 32px;
    }
    .tool-btn .material-symbols-rounded {
        font-size: 15px;
    }

    .admin-action-bar {
        padding: 6px;
        gap: 6px;
    }

    .audit-log-trigger {
        font-size: 0.7rem;
        padding: 6px 8px;
    }
}

/* --- Premium Google Login Button --- */
.google-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    padding: 0 24px;
    height: 48px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s, transform 0.1s, box-shadow 0.3s;
    outline: none;
    box-sizing: border-box;
    width: 100%;
    max-width: 280px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.google-login-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.15);
    transform: translateY(-2px);
}
.google-login-btn:active {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(0);
}
.google-icon {
    display: block;
    flex-shrink: 0;
}

.switch-account-link {
    color: var(--accent);
    font-size: 0.85rem;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s, text-shadow 0.2s;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.02em;
}
.switch-account-link:hover {
    opacity: 1;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
}

/* --- Analytics Sidebar Link --- */
.analytics-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(100% - 2rem);
    margin: 0 1rem 0.75rem;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.25s ease;
    box-sizing: border-box;
    text-decoration: none;
}
.analytics-sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
}
.analytics-sidebar-link .material-symbols-rounded {
    font-size: 18px;
}

/* Analytics Sidebar Link — special accent color */
.analytics-sidebar-link {
    background: rgba(0, 255, 136, 0.05);
    border-color: rgba(0, 255, 136, 0.12);
    color: var(--accent);
}
.analytics-sidebar-link:hover {
    background: rgba(0, 255, 136, 0.12);
    border-color: rgba(0, 255, 136, 0.3);
    color: var(--accent);
}
.analytics-sidebar-link .material-symbols-rounded {
    color: var(--accent);
}

.audit-trigger-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.audit-log-label {
    flex-shrink: 0;
}



/* =============================================
   WORLD-CLASS ANALYTICS DASHBOARD
   ============================================= */

/* ─── Design Tokens ─── */
:root {
    --analytics-card-bg: rgba(14, 16, 22, 0.7);
    --analytics-card-border: rgba(255, 255, 255, 0.05);
    --analytics-card-hover: rgba(24, 28, 36, 0.85);
    --analytics-text-muted: rgba(255, 255, 255, 0.3);
    --analytics-text-secondary: rgba(255, 255, 255, 0.55);
    --analytics-accent-glow: rgba(0, 255, 136, 0.08);
    --analytics-radius: 20px;
    --analytics-radius-sm: 12px;
}

body.analytics-body {
    background: var(--bg-dark);
    color: #eee;
    font-family: 'Inter', system-ui, sans-serif;
    margin: 0;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 100vw;
    position: relative;
}

/* Ambient grid background */
.analytics-ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.7;
}

.analytics-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
    box-sizing: border-box;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: calc(var(--nav-h) + 1.5rem);
}

/* ─── Premium Nav ─── */
.analytics-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
    background: rgba(5, 6, 8, 0.82);
    backdrop-filter: blur(28px) saturate(140%);
    -webkit-backdrop-filter: blur(28px) saturate(140%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.analytics-nav .nav-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.analytics-nav .nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-back-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(-2px);
}
.nav-back-btn .material-symbols-rounded {
    font-size: 20px;
}

.analytics-nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.analytics-nav-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.12), rgba(0, 255, 136, 0.04));
    border: 1px solid rgba(0, 255, 136, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}
.analytics-nav-icon svg {
    width: 16px;
    height: 16px;
}

.analytics-nav-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: white;
}

/* Live badge */
.analytics-live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 50px;
    background: rgba(0, 255, 136, 0.06);
    border: 1px solid rgba(0, 255, 136, 0.12);
}
.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    animation: livePulse 2s infinite;
}
@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}
.live-text {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Refresh button in nav */
.analytics-refresh-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
}
.analytics-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}
.analytics-refresh-btn.spinning .material-symbols-rounded {
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.analytics-refresh-btn .material-symbols-rounded {
    font-size: 20px;
}

/* ───────────────────────────────────────────────
   HERO SECTION
   ─────────────────────────────────────────────── */

.analytics-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 2rem 2rem 1.5rem;
    background: linear-gradient(135deg, 
        rgba(14, 16, 22, 0.8) 0%,
        rgba(14, 16, 22, 0.4) 100%);
    border: 1px solid var(--analytics-card-border);
    border-radius: 24px;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    animation: heroEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes heroEntrance {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Subtle gradient glow behind hero */
.analytics-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(0, 255, 136, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.analytics-hero-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.analytics-hero-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--analytics-text-secondary);
}

.analytics-hero-value {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.hero-number {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: white;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s;
}

.hero-unit {
    font-size: 1rem;
    font-weight: 500;
    color: var(--analytics-text-secondary);
    letter-spacing: 0.02em;
}

.analytics-hero-trend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.trend-indicator {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.trend-indicator.trend-up {
    background: rgba(0, 255, 136, 0.1);
    color: var(--accent);
}
.trend-indicator .material-symbols-rounded {
    font-size: 14px;
}

.trend-text {
    font-size: 0.75rem;
    color: var(--analytics-text-secondary);
    font-weight: 500;
}

/* Hero side stats */
.analytics-hero-side {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 16px;
}

.hero-side-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-end;
}

.hero-side-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--analytics-text-muted);
}

.hero-side-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: white;
    font-variant-numeric: tabular-nums;
}

/* ───────────────────────────────────────────────
   KPI CARDS
   ─────────────────────────────────────────────── */

.analytics-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    position: relative;
    padding: 1.5rem;
    border-radius: var(--analytics-radius);
    background: var(--analytics-card-bg);
    border: 1px solid var(--analytics-card-border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    animation: kpiSlideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: var(--card-delay, 0s);
}

@keyframes kpiSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.kpi-card:hover {
    background: var(--analytics-card-hover);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.kpi-card-glow {
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, var(--kpi-color, var(--accent)) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    filter: blur(40px);
}
.kpi-card:hover .kpi-card-glow {
    opacity: 0.08;
}

.kpi-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--kpi-color, var(--accent));
}
.kpi-icon-wrap .material-symbols-rounded {
    font-size: 18px;
}

.kpi-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 900;
    color: white;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s;
}

.kpi-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--analytics-text-secondary);
    letter-spacing: 0.02em;
}

.kpi-sparkline {
    height: 24px;
    margin-top: auto;
    opacity: 0.35;
}

.sparkline-svg {
    width: 100%;
    height: 100%;
}

.sparkline-path {
    fill: none;
    stroke: var(--kpi-color, var(--accent));
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 4px var(--kpi-color, transparent));
}

.sparkline-fill {
    fill: var(--kpi-color, var(--accent));
    opacity: 0.08;
}

/* ───────────────────────────────────────────────
   CHARTS SECTION
   ─────────────────────────────────────────────── */

.analytics-charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.analytics-chart-card {
    padding: 1.5rem;
    border-radius: var(--analytics-radius);
    background: var(--analytics-card-bg);
    border: 1px solid var(--analytics-card-border);
    animation: cardEntrance 0.7s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.chart-card-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}
.chart-card-title .material-symbols-rounded {
    font-size: 18px;
    color: var(--accent);
    opacity: 0.8;
}

.chart-card-badge {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--analytics-text-muted);
    padding: 4px 10px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

/* ─────────────── Doughnut ─────────────── */

.chart-card-body {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.chart-doughnut-area {
    display: flex;
    align-items: center;
    justify-content: center;
}

.doughnut-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
    flex-shrink: 0;
}

.doughnut-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.doughnut-svg .doughnut-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.03);
    stroke-width: 10;
}

.doughnut-segment {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dasharray 1.2s cubic-bezier(0.16, 1, 0.3, 1),
                stroke-dashoffset 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.doughnut-sold {
    stroke: var(--status-booked);
    filter: drop-shadow(0 0 6px rgba(255, 48, 29, 0.3));
}
.doughnut-reserved {
    stroke: var(--status-reserved);
    filter: drop-shadow(0 0 6px rgba(255, 235, 56, 0.2));
}
.doughnut-available {
    stroke: var(--status-available);
    filter: drop-shadow(0 0 6px rgba(54, 255, 50, 0.2));
}

.doughnut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.doughnut-center-pct {
    font-size: 1.75rem;
    font-weight: 900;
    color: white;
    line-height: 1;
    letter-spacing: -0.02em;
    transition: opacity 0.5s ease;
}

.doughnut-center-label {
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--analytics-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 4px;
}

/* ─── Doughnut Legend ─── */
.chart-legend-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chart-legend-area .legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
}

.chart-legend-area .legend-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.chart-legend-area .legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px currentColor;
}

.chart-legend-area .legend-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--analytics-text-secondary);
    flex: 1;
}

.chart-legend-area .legend-value {
    font-size: 0.9rem;
    font-weight: 800;
    color: white;
    font-variant-numeric: tabular-nums;
}

.chart-legend-area .legend-pct {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--analytics-text-muted);
    min-width: 36px;
    text-align: right;
}

/* ─── Progress Bars ─── */

.chart-bars-body {
    flex-direction: column;
    gap: 1rem;
    padding-top: 0.5rem;
}

.progress-bar-item {
    width: 100%;
    animation: barItemIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: var(--bar-delay, 0s);
}

@keyframes barItemIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.progress-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.progress-bar-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--analytics-text-secondary);
}

.progress-bar-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar-value {
    font-size: 0.9rem;
    font-weight: 800;
    color: white;
    font-variant-numeric: tabular-nums;
}

.progress-bar-pct {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--analytics-text-muted);
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
}

.progress-bar-track {
    width: 100%;
    height: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    background: var(--bar-color, var(--accent));
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    width: 0%;
    position: relative;
    box-shadow: 0 0 12px var(--bar-color, transparent);
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
    border-radius: 10px;
}

/* ───────────────────────────────────────────────
   TIMELINE
   ─────────────────────────────────────────────── */

.analytics-timeline-section {
    padding: 1.5rem;
    border-radius: var(--analytics-radius);
    background: var(--analytics-card-bg);
    border: 1px solid var(--analytics-card-border);
    animation: cardEntrance 0.7s 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.timeline-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.timeline-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}
.timeline-section-title .material-symbols-rounded {
    font-size: 18px;
    color: var(--accent);
    opacity: 0.8;
}

.timeline-entry-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--analytics-text-muted);
    padding: 4px 12px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.timeline-section-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.timeline-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}
.timeline-action-btn .material-symbols-rounded {
    font-size: 16px;
    color: var(--accent);
}
.timeline-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.timeline-action-btn:active {
    transform: translateY(0);
}

.timeline-list {
    max-height: 500px;
    overflow-y: auto;
}
.timeline-list::-webkit-scrollbar {
    width: 4px;
}
.timeline-list::-webkit-scrollbar-track {
    background: transparent;
}
.timeline-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

/* Loading */
.timeline-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 3rem 0;
    color: var(--analytics-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.timeline-pulse {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    animation: livePulse 1.5s infinite;
}

.timeline-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 3rem 0;
    color: var(--analytics-text-muted);
}
.timeline-empty .material-symbols-rounded {
    font-size: 40px;
    opacity: 0.3;
}
.timeline-empty p {
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
}

/* Groups */
.timeline-groups {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.timeline-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 0.5rem;
}

.timeline-group-date {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.timeline-group-count {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--analytics-text-muted);
    margin-left: auto;
}

.timeline-group-entries {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Entry */
.timeline-entry {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--analytics-radius-sm);
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateY(6px);
}
.timeline-entry.animate-in {
    animation: entrySlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: var(--entry-delay, 0s);
}

@keyframes entrySlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-entry:hover {
    background: rgba(255, 255, 255, 0.02);
}

.timeline-entry-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
    position: relative;
}
.timeline-entry-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all 0.3s;
}
.timeline-entry:hover .timeline-entry-dot::after {
    inset: -5px;
}

.timeline-entry-dot.available {
    background: var(--status-available);
    box-shadow: 0 0 8px rgba(54, 255, 50, 0.3);
}
.timeline-entry-dot.available::after {
    border-color: rgba(54, 255, 50, 0.15);
}
.timeline-entry-dot.booked,
.timeline-entry-dot.sold {
    background: var(--status-booked);
    box-shadow: 0 0 8px rgba(255, 48, 29, 0.3);
}
.timeline-entry-dot.booked::after,
.timeline-entry-dot.sold::after {
    border-color: rgba(255, 48, 29, 0.15);
}
.timeline-entry-dot.reserved {
    background: var(--status-reserved);
    box-shadow: 0 0 8px rgba(255, 235, 56, 0.2);
}
.timeline-entry-dot.reserved::after {
    border-color: rgba(255, 235, 56, 0.15);
}

.timeline-entry-body {
    flex: 1;
    min-width: 0;
}

.timeline-entry-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.timeline-entry-plot {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.01em;
}

.timeline-entry-action {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
}

.status-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.2s;
}
.status-chip.available {
    background: rgba(54, 255, 50, 0.12);
    color: var(--status-available);
}
.status-chip.booked,
.status-chip.sold {
    background: rgba(255, 48, 29, 0.12);
    color: var(--status-booked);
}
.status-chip.reserved {
    background: rgba(255, 235, 56, 0.12);
    color: var(--status-reserved);
}

.entry-arrow {
    font-size: 14px !important;
    color: var(--analytics-text-muted);
    opacity: 0.5;
}

.timeline-entry-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 4px;
    font-size: 0.65rem;
    color: var(--analytics-text-muted);
}

.timeline-entry-admin {
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 500;
}
.timeline-entry-admin .material-symbols-rounded {
    font-size: 12px;
    opacity: 0.6;
}

.timeline-entry-time {
    display: flex;
    align-items: center;
    gap: 3px;
}
.timeline-entry-time .material-symbols-rounded {
    font-size: 12px;
    opacity: 0.6;
}

.retry-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
}
.retry-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ───────────────────────────────────────────────
   RESPONSIVE
   ─────────────────────────────────────────────── */

@media (max-width: 992px) {
    .analytics-container {
        padding: 0 1.25rem 3rem;
        padding-top: calc(var(--nav-h) + 1rem);
    }

    .analytics-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.5rem;
    }

    .analytics-hero-side {
        width: 100%;
        justify-content: space-around;
    }

    .hero-number {
        font-size: 2.5rem;
    }

    .analytics-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .analytics-charts-section {
        grid-template-columns: 1fr;
    }

    .chart-card-body {
        flex-direction: column;
        gap: 1.25rem;
    }

    .doughnut-wrapper {
        width: 140px;
        height: 140px;
    }

    .chart-legend-area {
        width: 100%;
    }
    .chart-legend-area .legend-item {
        padding: 8px 10px;
    }

    .analytics-nav {
        padding: 0 1.25rem;
    }
    .analytics-nav-title {
        font-size: 1rem;
    }
    .live-text {
        display: none;
    }

    .admin-user-profile-nav {
        min-width: 36px;
        max-width: 36px;
        height: 36px;
    }
    .admin-user-profile-nav .user-avatar-small {
        width: 26px;
        height: 26px;
    }

}

@media (max-width: 640px) {
    .analytics-container {
        padding: 0 0.75rem 2rem;
        padding-top: calc(var(--nav-h) + 0.75rem);
    }

    .analytics-nav {
        padding: 0 0.75rem;
    }
    .analytics-nav-title {
        display: none;
    }
    .nav-back-btn {
        width: 36px;
        height: 36px;
    }
    .analytics-refresh-btn {
        width: 36px;
        height: 36px;
    }

    .analytics-hero {
        padding: 1.25rem;
        border-radius: 18px;
    }
    .hero-number {
        font-size: 2rem;
    }
    .analytics-hero-side {
        padding: 0.5rem 0.75rem;
        gap: 0.75rem;
    }
    .hero-side-value {
        font-size: 1rem;
    }

    .analytics-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .kpi-card {
        padding: 1rem;
    }
    .kpi-value {
        font-size: 1.35rem;
    }
    .kpi-sparkline {
        height: 18px;
    }

    .analytics-chart-card {
        padding: 1rem;
        border-radius: 16px;
    }

    .doughnut-wrapper {
        width: 120px;
        height: 120px;
    }
    .doughnut-center-pct {
        font-size: 1.4rem;
    }

    .analytics-timeline-section {
        padding: 1rem;
        border-radius: 16px;
    }

    .timeline-group-header {
        font-size: 0.7rem;
    }
    .timeline-entry {
        padding: 8px 8px;
    }
    .timeline-entry-plot {
        font-size: 0.8rem;
    }
    .timeline-entry-meta {
        font-size: 0.6rem;
    }
}

@media (max-width: 480px) {
    .analytics-kpi-grid {
        gap: 0.5rem;
    }
    .kpi-card {
        padding: 0.75rem;
        border-radius: 14px;
    }
    .kpi-value {
        font-size: 1.15rem;
    }
    .kpi-label {
        font-size: 0.65rem;
    }
    .kpi-icon-wrap {
        width: 28px;
        height: 28px;
    }
    .kpi-icon-wrap .material-symbols-rounded {
        font-size: 15px;
    }
    .kpi-sparkline {
        display: none;
    }

    .hero-number {
        font-size: 1.7rem;
    }
    .hero-unit {
        font-size: 0.85rem;
    }

    .chart-card-header {
        margin-bottom: 0.75rem;
    }
    .chart-card-title {
        font-size: 0.75rem;
    }

    .doughnut-wrapper {
        width: 100px;
        height: 100px;
    }
    .doughnut-center-pct {
        font-size: 1.2rem;
    }
    .doughnut-center-label {
        font-size: 0.5rem;
    }

    .progress-bar-item {
        --bar-delay: 0s !important;
    }

    .timeline-entry-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .timeline-entry-meta {
        flex-direction: column;
        gap: 2px;
        align-items: flex-start;
    }
}