*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    /* Light Mode Variables */
    --primary: #4F46E5;
    --primary-rgb: 79, 70, 229;
    --primary-dark: #4338ca;
    --secondary: #10B981;
    --accent: #F59E0B;
    --danger: #EF4444;
    --dark: #111827;
    --light: #F3F4F6;
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    --bg-body: #f0f2f5;
    --bg-card: #FFFFFF;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --bg-overdue: #FEE2E2;
    --text-overdue: #991B1B;

    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    /* Deep Context Neon Theme */
    --primary: #00f3ff;
    /* Bright Cyan Neon */
    --primary-rgb: 0, 243, 255;
    --primary-dark: #00bcd4;

    /* Gradient Accents for that "Premium" feel */
    --gradient-primary: linear-gradient(135deg, #00f3ff 0%, #0066ff 100%);
    --gradient-glow: 0 0 15px rgba(0, 243, 255, 0.3);

    --secondary: #39ff14;
    /* Neon Green */
    --accent: #ff00ff;
    /* Neon Magenta */
    --danger: #ff3333;

    /* Void Black Backgrounds */
    --dark: #050505;
    --bg-body: #050505;
    --bg-card: #0a0a12;
    /* Slightly lighter for cards */

    /* Text Colors */
    --white: #FFFFFF;
    --text-main: #FFFFFF;
    --text-muted: #94a3b8;

    /* Dark Grays for Borders/Separators */
    --gray-50: #0a0a0f;
    --gray-100: #11111a;
    --gray-200: #1e1e2d;
    --gray-300: #2d2d3f;
    --gray-400: #4b5563;
    --gray-500: #6b7280;
    --gray-600: #9ca3af;
    --gray-700: #d1d5db;
    --gray-800: #f3f4f6;
    --gray-900: #ffffff;

    --border-color: rgba(255, 255, 255, 0.1);
    --bg-overdue: rgba(239, 68, 68, 0.2);
    --text-overdue: #FEE2E2;

    /* Glass Effect for Dark Mode */
    --glass-bg: rgba(10, 10, 18, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2.5rem;
}

.logo i {
    font-size: 1.75rem;
    background: var(--gradient-primary, none);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: var(--gradient-primary, currentColor);
    /* For standard mode fallback */
    color: var(--primary);
}

/* Override text fill for fallback if gradient not set */
:root:not([data-theme="dark"]) .logo i {
    -webkit-text-fill-color: initial;
    color: var(--primary);
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--gray-100);
    /* In dark mode this is dark */
    color: var(--primary);
    box-shadow: var(--gradient-glow, none);
}

.nav-item i {
    font-size: 1.25rem;
}

.user-profile {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.user-info {
    flex: 1;
}

.user-info .name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.user-info .role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.logout-btn {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    color: var(--danger);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-body);
}

.top-bar {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-main);
}

.actions {
    display: flex;
    gap: 1rem;
}

.icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.icon-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--gradient-glow, none);
}

.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem 2rem 2rem;
    min-width: 0;
}

/* Cards & Dashboard */
.stats-grid,
.stats-mobile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--gradient-glow, var(--shadow-lg));
}

/* ─────────────────────────────────────────────────────────
   Stat Card Color Variants — semantic gradient backgrounds
   All colored variants force white text for readability
───────────────────────────────────────────────────────── */

/* Primary / Indigo — Totals & Overall Counts */
.stat-card-primary {
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.30);
    color: white;
}
.stat-card-primary .stat-title,
.stat-card-primary .stat-title-custom,
.stat-card-primary .stat-value,
.stat-card-primary .stat-label,
.stat-card-primary .stat-label-custom,
.stat-card-primary div { color: white !important; opacity: 1; }
.stat-card-primary:hover { border-color: transparent; box-shadow: 0 12px 32px rgba(99, 102, 241, 0.45); }

/* Success / Emerald — Positive outcomes, completions */
.stat-card-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.30);
    color: white;
}
.stat-card-success .stat-title,
.stat-card-success .stat-title-custom,
.stat-card-success .stat-value,
.stat-card-success .stat-label,
.stat-card-success .stat-label-custom,
.stat-card-success div { color: white !important; opacity: 1; }
.stat-card-success:hover { border-color: transparent; box-shadow: 0 12px 32px rgba(16, 185, 129, 0.45); }

/* Danger / Red — Overdue, dumped, cancelled, lost */
.stat-card-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.30);
    color: white;
}
.stat-card-danger .stat-title,
.stat-card-danger .stat-title-custom,
.stat-card-danger .stat-value,
.stat-card-danger .stat-label,
.stat-card-danger .stat-label-custom,
.stat-card-danger div { color: white !important; opacity: 1; }
.stat-card-danger:hover { border-color: transparent; box-shadow: 0 12px 32px rgba(239, 68, 68, 0.45); }

/* Warning / Amber — Pending actions, docs, follow-ups due */
.stat-card-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.30);
    color: white;
}
.stat-card-warning .stat-title,
.stat-card-warning .stat-title-custom,
.stat-card-warning .stat-value,
.stat-card-warning .stat-label,
.stat-card-warning .stat-label-custom,
.stat-card-warning div { color: white !important; opacity: 1; }
.stat-card-warning:hover { border-color: transparent; box-shadow: 0 12px 32px rgba(245, 158, 11, 0.45); }

/* Hot / Orange-Red — Hot leads, high-urgency items */
.stat-card-hot {
    background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.30);
    color: white;
}
.stat-card-hot .stat-title,
.stat-card-hot .stat-title-custom,
.stat-card-hot .stat-value,
.stat-card-hot .stat-label,
.stat-card-hot .stat-label-custom,
.stat-card-hot div { color: white !important; opacity: 1; }
.stat-card-hot:hover { border-color: transparent; box-shadow: 0 12px 32px rgba(249, 115, 22, 0.45); }

/* Warm / Gold-Amber — Warm leads, revisits, this-month */
.stat-card-warm {
    background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.30);
    color: white;
}
.stat-card-warm .stat-title,
.stat-card-warm .stat-title-custom,
.stat-card-warm .stat-value,
.stat-card-warm .stat-label,
.stat-card-warm .stat-label-custom,
.stat-card-warm div { color: white !important; opacity: 1; }
.stat-card-warm:hover { border-color: transparent; box-shadow: 0 12px 32px rgba(251, 191, 36, 0.45); }

/* Cold / Sky-Blue — Cold leads, fresh visits, site visits */
.stat-card-cold {
    background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 100%);
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(96, 165, 250, 0.30);
    color: white;
}
.stat-card-cold .stat-title,
.stat-card-cold .stat-title-custom,
.stat-card-cold .stat-value,
.stat-card-cold .stat-label,
.stat-card-cold .stat-label-custom,
.stat-card-cold div { color: white !important; opacity: 1; }
.stat-card-cold:hover { border-color: transparent; box-shadow: 0 12px 32px rgba(96, 165, 250, 0.45); }

/* Teal / Cyan — Rates, percentages, performance metrics */
.stat-card-teal {
    background: linear-gradient(135deg, #14B8A6 0%, #0D9488 100%);
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(20, 184, 166, 0.30);
    color: white;
}
.stat-card-teal .stat-title,
.stat-card-teal .stat-title-custom,
.stat-card-teal .stat-value,
.stat-card-teal .stat-label,
.stat-card-teal .stat-label-custom,
.stat-card-teal div { color: white !important; opacity: 1; }
.stat-card-teal:hover { border-color: transparent; box-shadow: 0 12px 32px rgba(20, 184, 166, 0.45); }

/* Purple / Violet — Special KPIs, CP visits, referrals */
.stat-card-purple {
    background: linear-gradient(135deg, #A855F7 0%, #9333EA 100%);
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.30);
    color: white;
}
.stat-card-purple .stat-title,
.stat-card-purple .stat-title-custom,
.stat-card-purple .stat-value,
.stat-card-purple .stat-label,
.stat-card-purple .stat-label-custom,
.stat-card-purple div { color: white !important; opacity: 1; }
.stat-card-purple:hover { border-color: transparent; box-shadow: 0 12px 32px rgba(168, 85, 247, 0.45); }

/* Mono — fallback neutral with indigo accent (ensures no colorless cards) */
.stat-card-mono {
    background: linear-gradient(135deg, #334155 0%, #1E293B 100%);
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(51, 65, 85, 0.25);
    color: white;
}
.stat-card-mono .stat-title,
.stat-card-mono .stat-title-custom,
.stat-card-mono .stat-value,
.stat-card-mono .stat-label,
.stat-card-mono .stat-label-custom,
.stat-card-mono div { color: white !important; opacity: 1; }
.stat-card-mono:hover { border-color: transparent; box-shadow: 0 12px 32px rgba(51, 65, 85, 0.40); }

.stat-title {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    color: var(--text-muted);
}

/* Table Styles */
.table-container {
    background: var(--bg-card);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

.table-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem 1.5rem;
    background-color: var(--gray-100);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.9rem;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: var(--gray-50);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-new {
    background: #DBEAFE;
    color: #1E40AF;
}

.status-contacted {
    background: #FEF3C7;
    color: #92400E;
}

.status-interested {
    background: #E0E7FF;
    color: #4338CA;
}

.status-site_visit {
    background: #FECACA;
    color: #B91C1C;
}

.status-negotiation {
    background: #FED7AA;
    color: #C2410C;
}

.status-booked,
.status-confirmed {
    background: #D1FAE5;
    color: #065F46;
}

.status-pending {
    background: #FEF3C7;
    color: #92400E;
}

.status-cancelled,
.status-lost {
    background: #FEE2E2;
    color: #991B1B;
}

/* Forms */
.form-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 768px) {
    .form-card {
        padding: 1.25rem;
        border-radius: 0.75rem;
        box-shadow: none;
        border: none;
    }
}

.form-group {
    margin-bottom: 1.5rem;
    width: 100%;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-800);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    border-radius: 0.5rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}


/* Overlay to ensure background isn't too overpowering */
.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 5, 10, 0.4);
    z-index: -1;
}

.login-card {
    background: rgba(15, 20, 30, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 1.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
}

.login-title {
    text-align: center;
    margin-bottom: 2rem;
    color: #FFFFFF;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Search & Filter Bar */
.search-filter-bar {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-100);
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-group {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1.25rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.filter-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    background: var(--white);
    transition: border-color 0.2s;
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-group {
        flex-direction: column;
    }

    .filter-select {
        width: 100%;
    }
}

.status-site_visit {
    background: #FECACA;
    color: #B91C1C;
}

.status-negotiation {
    background: #FED7AA;
    color: #C2410C;
}

.status-booked,
.status-confirmed {
    background: #D1FAE5;
    color: #065F46;
}

.status-pending {
    background: #FEF3C7;
    color: #92400E;
}

.status-cancelled,
.status-lost {
    background: #FEE2E2;
    color: #991B1B;
}

/* Forms */
.form-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-800);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 1.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--dark);
    font-size: 2rem;
}

/* Search & Filter Bar */
.search-filter-bar {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-100);
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-group {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1.25rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.filter-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    background: var(--white);
    transition: border-color 0.2s;
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-group {
        flex-direction: column;
    }

    .filter-select {
        width: 100%;
    }

    .filter-actions {
        flex-direction: column;
    }

    .filter-actions .btn {
        width: 100%;
    }
}

/* Date Range Filter Styles */
.date-range-dropdown {
    position: relative;
    display: inline-block;
}

.date-range-btn {
    background: var(--white);
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    min-width: 220px;
    justify-content: space-between;
}

.date-range-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.date-range-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    min-width: 240px;
    display: none;
    overflow: hidden;
    pointer-events: auto;
}

.date-range-menu.show {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.range-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: var(--gray-800);
    font-size: 0.9rem;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--gray-100);
    pointer-events: auto;
    user-select: none;
}

.range-option:last-child {
    border-bottom: none;
}

.range-option:hover {
    background-color: var(--gray-100);
    color: var(--primary);
}

.range-option.active {
    background-color: var(--primary);
    color: var(--white);
}

.custom-range-inputs {
    padding: 1rem;
    background-color: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.custom-range-inputs .input-group {
    margin-bottom: 0.75rem;
}

.custom-range-inputs label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.range-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.range-actions .btn {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.85rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

/* User Status Indicator */
.user-status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.user-status-indicator:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

.status-dot.status-available {
    background: #4caf50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}

.status-dot.status-idle {
    background: #ff9800;
    box-shadow: 0 0 8px rgba(255, 152, 0, 0.5);
}

.status-dot.status-offline {
    background: #f44336;
    box-shadow: 0 0 8px rgba(244, 67, 54, 0.5);
    animation: none;
}

.status-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-600);
}

@keyframes statusPulse {

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

    50% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}

/* ==========================================================================
   Mobile / PWA Native App Experience
   ========================================================================== */

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ── Bottom Navigation Bar ──────────────────────────────────────── */
.mobile-bottom-nav {
    display: none; /* hidden on desktop */
}

@media (max-width: 768px) {

    /* ── Layout ── */
    .app-container {
        flex-direction: column;
        height: 100dvh; /* dynamic viewport (handles iOS bar) */
    }

    /* Sidebar: still exists as a full-screen drawer (accessible via logo tap) */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 50;
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 4px 0 24px rgba(0,0,0,0.25);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        display: flex;
        flex-direction: column;
        height: 100dvh;
        overflow: hidden;
    }

    /* ── Top App Bar ── */
    .top-bar {
        padding: 0.75rem 1rem;
        padding-top: calc(0.75rem + env(safe-area-inset-top));
        position: sticky;
        top: 0;
        z-index: 30;
        background: var(--glass-bg, rgba(255,255,255,0.85));
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 1px 8px rgba(0,0,0,0.08);
    }

    /* Hide hamburger — bottom nav replaces it */
    #mobileMenuBtn {
        display: none !important;
    }

    .page-title {
        font-size: 1.15rem;
        font-weight: 700;
        letter-spacing: -0.3px;
    }

    .actions {
        gap: 0.4rem;
    }

    /* Hide status text on mobile — just show dot */
    .user-status-indicator .status-text {
        display: none;
    }

    .user-status-indicator {
        padding: 0.4rem 0.6rem;
        min-width: 0;
    }

    /* Icon buttons: slightly larger tap target */
    .icon-btn {
        width: 38px;
        height: 38px;
    }

    /* ── Content Area ── */
    .content-area {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 1rem 0.9rem;
        /* Add bottom padding so content isn't hidden behind the tab bar */
        padding-bottom: calc(72px + env(safe-area-inset-bottom));
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    /* ── Stat Cards: horizontal scroll strip ── */
    [style*="grid-template-columns: repeat(auto-fit"] {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        gap: 0.85rem !important;
        padding-bottom: 0.5rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    [style*="grid-template-columns: repeat(auto-fit"] .stat-card,
    .stat-card {
        min-width: 160px !important;
        flex-shrink: 0;
        scroll-snap-align: start;
    }

    /* ── Tables: horizontal scroll ── */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 0.875rem;
    }

    table {
        min-width: 520px;
    }

    th, td {
        padding: 0.65rem 0.9rem;
        font-size: 0.82rem;
    }

    /* ── Forms ── */
    .form-card {
        padding: 1.25rem;
        border-radius: 0.875rem;
    }

    .filter-group {
        flex-direction: column;
    }

    .filter-select, .search-input {
        width: 100%;
        min-width: 0;
    }

    .filter-actions {
        flex-direction: column;
    }

    .filter-actions .btn {
        width: 100%;
    }

    /* Date Range Picker */
    .date-range-btn {
        width: 100%;
        min-width: 0;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        margin: 1rem auto;
    }

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

    /* ── Bottom Navigation Bar ── */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 45;
        background: var(--glass-bg, rgba(255,255,255,0.92));
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
        padding-bottom: env(safe-area-inset-bottom);
        justify-content: space-around;
        align-items: stretch;
        height: calc(60px + env(safe-area-inset-bottom));
    }

    [data-theme="dark"] .mobile-bottom-nav {
        background: rgba(10,10,18,0.92);
    }

    .mob-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        gap: 3px;
        padding: 0.5rem 0.25rem;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 0.65rem;
        font-weight: 500;
        letter-spacing: 0.2px;
        position: relative;
        transition: color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
        border: none;
        background: none;
        min-width: 0;
    }

    .mob-nav-item i {
        font-size: 1.45rem;
        line-height: 1;
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s;
    }

    .mob-nav-item span {
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 60px;
    }

    /* Active state */
    .mob-nav-item.mob-active {
        color: var(--primary);
    }

    .mob-nav-item.mob-active i {
        transform: translateY(-2px) scale(1.1);
    }

    /* Active indicator pill above the icon */
    .mob-nav-item.mob-active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 32px;
        height: 3px;
        border-radius: 0 0 3px 3px;
        background: var(--primary);
        animation: mobNavSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    @keyframes mobNavSlideIn {
        from { width: 0; opacity: 0; }
        to   { width: 32px; opacity: 1; }
    }

    /* Tap ripple effect */
    .mob-nav-item:active i {
        transform: scale(0.88);
        transition: transform 0.1s;
    }
}

/* Dark mode bottom nav adjustments */
@media (max-width: 768px) {
    [data-theme="dark"] .top-bar {
        background: rgba(10,10,18,0.88);
        border-bottom-color: rgba(255,255,255,0.08);
    }
}


/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Base Mobile Styles */
@media (max-width: 768px) {
    /* Layout Adjustments */
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 50;
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        width: 100%;
        margin-left: 0;
    }

    /* Top Bar & Header */
    .top-bar {
        padding: 1rem;
        position: sticky;
        top: 0;
        z-index: 30;
        background: var(--bg-body); /* Ensure background is opaque */
    }

    #mobileMenuBtn {
        display: flex !important; /* Force show on mobile */
        margin-right: 0.5rem;
        font-size: 1.25rem;
        background: transparent;
        border: none;
        color: var(--text-main);
    }

    .page-title {
        font-size: 1.25rem;
    }

    .actions {
        gap: 0.5rem;
    }

    .user-status-indicator .status-text {
        display: none; /* Hide text to save space */
    }

    /* Content Area */
    .content-area {
        padding: 1rem;
        overflow-x: hidden;
    }

    /* Dashboard Grids */
    .stats-grid {
        grid-template-columns: 1fr; /* Stack cards */
        gap: 1rem;
    }

    /* Forms */
    .form-card {
        padding: 1.5rem;
    }

    .filter-group {
        flex-direction: column;
    }

    .filter-select, .search-input {
        width: 100%;
        min-width: 0;
    }

    /* Tables - Horizontal Scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px; /* Force scroll for small tables */
    }

    th, td {
        padding: 0.75rem 1rem;
    }

    /* Date Range Picker */
    .date-range-btn {
        width: 100%;
        min-width: 0;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        margin: 1rem auto;
    }

    /* Hide complex elements on super small screens if needed */
    .hide-on-mobile {
        display: none !important;
    }
}

/* ==========================================================================
   Mobile Card List — Tables → Native Cards
   ========================================================================== */

/* ── Desktop: show tables, hide cards ── */
.mobile-card-list { display: none; }

@media (max-width: 768px) {
    /* Hide the desktop table container */
    .table-container,
    div[style*="overflow-x: auto"] > table {
        display: none !important;
    }
    /* Also hide the wrapping overflow div on booking_list */
    div[style*="overflow-x: auto"] { display: none !important; }

    /* Show the card list */
    .mobile-card-list {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0 0 0.5rem;
    }
}

/* ── Card base (Boxy Premium) ── */
.lead-card {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: var(--bg-card);
    border-radius: 1.25rem;
    padding: 0;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    position: relative;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.lead-card:active {
    transform: scale(0.98);
    background: var(--gray-50);
}

/* ── Left Indicator/Avatar ── */
.lead-card-left {
    width: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
}

.avatar-circle {
    width: 42px;
    height: 42px;
    border-radius: 10px; /* Modern boxy corners */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* 10-colour palette cycling a–j then repeating */
.avatar-a, .avatar-k, .avatar-u { background: linear-gradient(135deg, #6366F1, #4F46E5); }
.avatar-b, .avatar-l, .avatar-v { background: linear-gradient(135deg, #EC4899, #DB2777); }
.avatar-c, .avatar-m, .avatar-w { background: linear-gradient(135deg, #F59E0B, #D97706); }
.avatar-d, .avatar-n, .avatar-x { background: linear-gradient(135deg, #10B981, #059669); }
.avatar-e, .avatar-o, .avatar-y { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.avatar-f, .avatar-p, .avatar-z { background: linear-gradient(135deg, #EF4444, #DC2626); }
.avatar-g, .avatar-q           { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
.avatar-h, .avatar-r           { background: linear-gradient(135deg, #06B6D4, #0891B2); }
.avatar-i, .avatar-s           { background: linear-gradient(135deg, #F97316, #EA580C); }
.avatar-j, .avatar-t           { background: linear-gradient(135deg, #14B8A6, #0D9488); }

/* Fallback for numbers / unknown */
.avatar-circle:not([class*="avatar-"]):not([class*="avatar-a"]) {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
}

/* ── Card body ── */
.lead-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    position: relative;
}

.lead-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.lead-card-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--dark);
    line-height: 1.2;
}

.lead-card-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.lead-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lead-card-meta i {
    font-size: 0.9rem;
    color: var(--primary);
    opacity: 0.7;
}

.badge-outline {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    border: 1px solid currentColor;
    font-weight: 600;
    text-transform: uppercase;
}

.lead-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border-color);
}

.lead-assignee {
    font-size: 0.75rem;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: #f8fafc;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}

/* ── Actions (Right Side) ── */
.lead-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.call-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.call-btn:active {
    background: #10B981;
    color: #fff;
    transform: scale(0.9);
}

.lead-card-chevron {
    font-size: 1.25rem;
    color: var(--gray-300);
}

/* ── Empty state ── */
.mobile-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    gap: 0.75rem;
}

.mobile-empty-state i {
    font-size: 3rem;
    opacity: 0.3;
}

.mobile-empty-state p {
    font-size: 0.95rem;
    margin: 0;
}

/* ── Wrap card list in a rounded container matching table-container ── */
@media (max-width: 768px) {
    .mobile-card-list {
        background: var(--bg-card);
        border-radius: 1rem;
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        overflow: hidden;
        margin-bottom: 1.5rem;
    }
}

/* Dark mode avatar tweaks */
[data-theme="dark"] .lead-card:active {
    background: var(--gray-100);
}

/* ==========================================================================
   Mobile Stat Cards — 2-Column Grid (reference: Available Units style)
   Only targets grids that CONTAIN .stat-card children — nothing else.
   ========================================================================== */

@media (max-width: 768px) {

    /* ── Cancel the horizontal-scroll strip ONLY for stat-card grids ── */
    /* Using :has() so we don't accidentally touch project/unit grids   */
    .stats-grid:not(.project-list-pwa),
    div:not(.booking-detail-grid):has(> .stat-card) {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
        overflow: visible !important;
        padding-bottom: 0 !important;
        scroll-snap-type: none !important;
        flex-direction: unset !important;
        flex: unset !important;
        margin-bottom: 1.25rem !important;
    }

    /* ── Compact card matching the reference image ── */
    .stat-card {
        min-width: 0 !important;
        flex-shrink: unset !important;
        scroll-snap-align: none !important;
        flex: unset !important;
        padding: 1rem 0.875rem !important;
        border-radius: 16px !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.10) !important;
        gap: 0.35rem !important;
    }

    /* Shrink the label/emoji line */
    .stat-card .stat-title,
    .stat-card [style*="font-size: 0.85rem"] {
        font-size: 0.72rem !important;
        margin-bottom: 0.2rem !important;
    }

    /* Big number */
    .stat-card .stat-value,
    .stat-card [style*="font-size: 2.5rem"],
    .stat-card [style*="font-size: 2rem"] {
        font-size: 1.9rem !important;
        line-height: 1.1 !important;
        font-weight: 800 !important;
    }

    /* Subtitle */
    .stat-card .stat-label,
    .stat-card [style*="font-size: 0.75rem"],
    .stat-card [style*="margin-top: 0.5rem"] {
        font-size: 0.68rem !important;
        margin-top: 0.15rem !important;
        opacity: 0.85 !important;
    }

    /* Tap press */
    .stat-card:active {
        transform: scale(0.96) !important;
        transition: transform 0.1s ease !important;
    }

    /* Remove hover lift on touch */
    .stat-card:hover {
        transform: none !important;
    }
}

/* Extra-small phones (<380px) */
@media (max-width: 380px) {
    .stats-grid:not(.project-list-pwa),
    div:not(.booking-detail-grid):has(> .stat-card) {
        gap: 0.55rem !important;
    }

    .stat-card {
        padding: 0.8rem 0.7rem !important;
        border-radius: 14px !important;
    }

    .stat-card .stat-value,
    .stat-card [style*="font-size: 2.5rem"],
    .stat-card [style*="font-size: 2rem"] {
        font-size: 1.65rem !important;
    }
}

/* ==========================================================================
   PWA ONLY Refinements (Mobile Screen Width Overrides)
   ========================================================================== */
@media (max-width: 768px) {
    /* Establish Global Top-Down Priority for Mobile */
    .sidebar {
        z-index: 9999 !important; /* Always on top */
    }

    .sidebar-overlay {
        z-index: 9998 !important; /* Overlay just below sidebar */
    }

    .main-content {
        position: relative !important;
        z-index: 1 !important; /* Main content area (including top-bar) below navigation */
    }

    .top-bar {
        padding: 0.5rem 1rem !important; 
        padding-top: calc(0.5rem + env(safe-area-inset-top)) !important;
        background: var(--bg-body);
        position: sticky;
        top: 0;
        z-index: 1 !important;
    }

    /* Recover space and fix cut-off content at the bottom */
    .content-area {
        padding: 0 1rem 100px !important; /* Large bottom padding for PWA bottom nav */
        padding-bottom: calc(100px + env(safe-area-inset-bottom)) !important;
    }

    /* Fix Analytics card layout for mobile (2 columns) */
    .stats-mobile-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
        gap: 0.75rem !important;
    }

    .stat-card {
        padding: 1.25rem !important;
        min-height: auto !important;
        overflow: visible !important; /* Fix button clipping */
    }

    /* Flow the booking details vertically */
    .booking-detail-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }

    .booking-detail-grid > div {
        width: 100% !important;
        max-width: 100% !important;
    }

    .form-card {
        padding: 1.25rem !important;
        overflow: visible !important; /* Fix button clipping */
    }

    .btn-block {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }

    /* ── PWA Module Fixes (Aggressive Enforcement) ── */
    
    /* Force 1-column stacking for ALL problematic screens */
    .booking-detail-grid,
    .stats-grid:not(.project-list-pwa),
    .grid-split-pwa,
    .booking-detail-grid [style*="display: grid"] {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    /* ── Inventory: Project Boxes (PWA Only) ── */
    .pwa-hide { display: none !important; }
    
    .project-list-pwa {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
        overflow: visible !important;
    }

    .project-list-pwa .stat-card {
        min-height: 190px !important; /* Increased to fit the vertical stack */
        padding: 0.75rem !important;
        justify-content: space-between !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .project-list-pwa h3 {
        font-size: 0.9rem !important; /* Optimized for boxes */
        margin-bottom: 0.25rem !important;
        line-height: 1.2 !important;
    }

    /* Stack 3 buttons vertically (one-below-another) with same size */
    .card-actions-pwa {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.35rem !important;
        margin-top: 0.5rem !important;
        padding: 0 0.4rem !important; /* Breathe within card borders */
    }

    .card-actions-pwa .btn {
        width: 100% !important;
        padding: 0.35rem !important; /* Much tighter buttons */
        font-size: 0.725rem !important; /* Sleeker text */
        justify-content: center !important;
        border-radius: 6px !important;
    }

    /* ── Global PWA Dashboard: Symmetrical Boxes (PWA Only) ── */
    .unit-stats-pwa {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.6rem !important;
        margin-bottom: 2rem !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .unit-stats-pwa .stat-card {
        min-width: 0 !important; /* Prevents card from expanding grid */
        padding: 1rem 0.75rem !important;
        border-radius: 12px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }

    .unit-stats-pwa .stat-value {
        font-size: 1.5rem !important; /* Scales down text to fit box */
        line-height: 1.1 !important;
    }

    .unit-stats-pwa .stat-title {
        font-size: 0.75rem !important;
        margin-bottom: 0.25rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* ── Lead Cards: Premium Boxy Style (PWA Only) ── */
    .mobile-card-list {
        display: block !important;
        padding: 0.5rem 0 !important;
    }

    .lead-card {
        background: var(--bg-card) !important;
        border-radius: 1rem !important;
        padding: 1rem !important;
        margin-bottom: 0.75rem !important;
        box-shadow: var(--shadow-sm) !important;
        border: 1px solid var(--border-color) !important;
        display: flex !important;
        align-items: center !important;
        gap: 1rem !important;
        position: relative !important;
        transition: all 0.2s ease !important;
    }

    .lead-card:active {
        transform: scale(0.98) !important;
        background: var(--gray-50) !important;
    }

    .avatar-circle {
        width: 48px !important;
        height: 48px !important;
        border-radius: 12px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-weight: 700 !important;
        font-size: 1rem !important;
        color: white !important;
        flex-shrink: 0 !important;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
    }

    .lead-card-body { 
        flex: 1 !important; 
        min-width: 0 !important;
    }
    
    .lead-card-header { 
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }

    .lead-card-name { 
        font-weight: 700 !important; 
        font-size: 1rem !important; 
        color: var(--text-main) !important;
    }

    .lead-card-meta { 
        font-size: 0.75rem !important; 
        color: var(--text-muted) !important; 
        display: flex !important; 
        gap: 0.75rem !important; 
        margin-top: 0.25rem !important; 
        flex-wrap: wrap !important;
    }
    
    .lead-card-footer { 
        margin-top: 0.4rem !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .lead-card-actions {
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }
    
    .call-btn {
        background: rgba(16, 185, 129, 0.1) !important;
        color: #10B981 !important;
        width: 36px !important;
        height: 36px !important;
        border-radius: 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 1.1rem !important;
        box-shadow: none !important;
    }

    .lead-card-chevron {
        color: var(--gray-300) !important;
        font-size: 1.25rem !important;
    }

    /* ── PWA Header (Mobile Only) ── */
    .pwa-header {
        display: flex !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1001 !important;
        background: var(--white) !important;
        padding: 0.75rem 1rem !important;
        align-items: center !important;
        gap: 0.75rem !important;
        border-bottom: 1px solid var(--border-color) !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important;
        margin: -1rem -1rem 1.5rem -1rem !important;
        min-height: 60px !important;
    }

    /* Hide standard desktop containers in PWA view to fix empty boxes */
    .table-container,
    .table-header,
    .top-bar-desktop {
        display: none !important;
    }


    .main-content {
        padding-top: 0 !important;
    }

    .content-area {
        padding: 1rem !important;
    }
}

/* ==========================================================================
   PostSales Dashboard Desktop - Premium "Tiny Cubes" Redesign
   ========================================================================== */
/* ==========================================================================
   Unified CRM Dashboard Desktop - Premium "Wide Rectangle" System
   ========================================================================== */
@media (min-width: 769px) {
    /* Main Grid for Analytics */
    .unit-stats-pwa.postsales-stats-pwa,
    .unit-stats-pwa.sales-stats-pwa,
    .unit-stats-pwa.gre-stats-pwa,
    .unit-stats-pwa.cp-stats-pwa {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
        gap: 1.25rem !important;
        margin-bottom: 2.5rem !important;
        width: 100% !important;
    }

    /* Unified Premium Card Design */
    .unit-stats-pwa.postsales-stats-pwa .stat-card,
    .unit-stats-pwa.sales-stats-pwa .stat-card,
    .unit-stats-pwa.gre-stats-pwa .stat-card,
    .unit-stats-pwa.cp-stats-pwa .stat-card {
        aspect-ratio: 1.8 / 1;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: flex-start !important;
        text-align: left !important;
        padding: 1rem 1.75rem !important;
        border-radius: 20px !important;
        transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
        border: 1px solid rgba(255,255,255,0.15) !important;
        box-shadow: 0 10px 25px rgba(0,0,0,0.08) !important;
        position: relative !important;
        overflow: hidden !important;
    }

    /* Glass effect overlay */
    .unit-stats-pwa.postsales-stats-pwa .stat-card::before,
    .unit-stats-pwa.sales-stats-pwa .stat-card::before,
    .unit-stats-pwa.gre-stats-pwa .stat-card::before,
    .unit-stats-pwa.cp-stats-pwa .stat-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
        pointer-events: none;
    }

    /* Hover Interaction */
    .unit-stats-pwa.postsales-stats-pwa .stat-card:hover,
    .unit-stats-pwa.sales-stats-pwa .stat-card:hover,
    .unit-stats-pwa.gre-stats-pwa .stat-card:hover,
    .unit-stats-pwa.cp-stats-pwa .stat-card:hover {
        transform: translateY(-8px) scale(1.03) !important;
        box-shadow: 0 20px 40px rgba(0,0,0,0.15) !important;
        filter: brightness(1.05);
        z-index: 10;
    }

    /* Stat Value Styling */
    .unit-stats-pwa.postsales-stats-pwa .stat-card .stat-value,
    .unit-stats-pwa.sales-stats-pwa .stat-card .stat-value,
    .unit-stats-pwa.gre-stats-pwa .stat-card .stat-value,
    .unit-stats-pwa.cp-stats-pwa .stat-card .stat-value {
        font-size: 2.75rem !important;
        font-weight: 800 !important;
        margin: 0.25rem 0 !important;
        letter-spacing: -1px;
    }

    /* Custom Title & Label Classes for cleaner templates */
    .unit-stats-pwa.postsales-stats-pwa .stat-card .stat-title-custom,
    .unit-stats-pwa.sales-stats-pwa .stat-card .stat-title-custom,
    .unit-stats-pwa.gre-stats-pwa .stat-card .stat-title-custom,
    .unit-stats-pwa.cp-stats-pwa .stat-card .stat-title-custom {
        font-size: 1.15rem !important;
        font-weight: 700 !important;
        opacity: 0.95;
        margin-bottom: 0.5rem !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0.5rem !important;
    }

    .unit-stats-pwa.postsales-stats-pwa .stat-card .stat-label-custom,
    .unit-stats-pwa.sales-stats-pwa .stat-card .stat-label-custom,
    .unit-stats-pwa.gre-stats-pwa .stat-card .stat-label-custom,
    .unit-stats-pwa.cp-stats-pwa .stat-card .stat-label-custom {
        font-size: 0.95rem !important;
        font-weight: 600 !important;
        opacity: 0.85;
        margin-top: 0.5rem !important;
    }

    /* Dashboard Tables Grid Layout (Sales) */
    .dashboard-tables-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }

    .dashboard-tables-grid .table-container {
        margin-bottom: 0 !important;
        height: 100% !important;
    }

    .dashboard-tables-grid .table-header {
        padding: 1.25rem 1.5rem !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
}

/* ==========================================================================
   Premium Monochrome Analytics Theme
   ========================================================================== */
/* ==========================================================================
   Premium Monochrome Analytics Theme
   ========================================================================== */
.stat-card-mono {
    background: linear-gradient(135deg, #475569 0%, #1e293b 100%) !important;
    color: white !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08) !important;
}

.stat-card-mono .stat-title-custom,
.stat-card-mono .stat-value,
.stat-card-mono .stat-label-custom {
    color: white !important;
}

.stat-card-mono .stat-title-custom {
    opacity: 0.95 !important;
}

.stat-card-mono .stat-label-custom {
    opacity: 0.85 !important;
}

/* Color-coded High-Signal Exceptions (HUD Style) - Restored Vibrant Colors */
.stat-card-hot { background: linear-gradient(135deg, #ef4444 0%, #991b1b 100%) !important; color: white !important; border-color: #ef4444 !important; }
.stat-card-warm { background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%) !important; color: white !important; border-color: #f59e0b !important; }
.stat-card-cold { background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%) !important; color: white !important; border-color: #3b82f6 !important; }
.stat-card-success { background: linear-gradient(135deg, #10b981 0%, #065f46 100%) !important; color: white !important; border-color: #10b981 !important; }
.stat-card-warning { background: linear-gradient(135deg, #f97316 0%, #c2410c 100%) !important; color: white !important; border-color: #f97316 !important; }
.stat-card-danger { background: linear-gradient(135deg, #dc2626 0%, #7f1d1d 100%) !important; color: white !important; border-color: #dc2626 !important; }
.stat-card-purple { background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%) !important; color: white !important; border-color: #a855f7 !important; }
.stat-card-teal { background: linear-gradient(135deg, #0d9488 0%, #115e59 100%) !important; color: white !important; border-color: #0d9488 !important; }
.stat-card-primary { background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%) !important; color: white !important; border-color: #6366f1 !important; }

.stat-card-hot *, .stat-card-warm *, .stat-card-cold *, .stat-card-success *, .stat-card-warning *, .stat-card-danger *, .stat-card-purple *, .stat-card-teal *, .stat-card-primary *, .stat-card-mono * {
    color: white !important;
}

/* Dark Mode support for Monochrome cards */
[data-theme="dark"] .stat-card-mono {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%) !important;
    color: #F1F5F9 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .stat-card-mono .stat-title-custom,
[data-theme="dark"] .stat-card-mono .stat-value,
[data-theme="dark"] .stat-card-mono .stat-label-custom {
    color: #F1F5F9 !important;
}

/* Dark Mode support for Exceptions */
[data-theme="dark"] .stat-card-hot { background: linear-gradient(135deg, #440C0C 0%, #2D0808 100%) !important; color: #FECACA !important; border-color: #7F1D1D !important; }
[data-theme="dark"] .stat-card-warm { background: linear-gradient(135deg, #431407 0%, #2D0D05 100%) !important; color: #FED7AA !important; border-color: #7C2D12 !important; }
[data-theme="dark"] .stat-card-cold { background: linear-gradient(135deg, #172554 0%, #1e3a8a 100%) !important; color: #DBEAFE !important; border-color: #1e40af !important; }
[data-theme="dark"] .stat-card-success { background: linear-gradient(135deg, #052E16 0%, #064E3B 100%) !important; color: #D1FAE5 !important; border-color: #065F46 !important; }
[data-theme="dark"] .stat-card-warning { background: linear-gradient(135deg, #451A03 0%, #78350F 100%) !important; color: #FEF3C7 !important; border-color: #92400E !important; }
[data-theme="dark"] .stat-card-danger { background: linear-gradient(135deg, #450A0A 0%, #7F1D1D 100%) !important; color: #FEE2E2 !important; border-color: #991B1B !important; }
[data-theme="dark"] .stat-card-purple { background: linear-gradient(135deg, #3B0764 0%, #2E0854 100%) !important; color: #F3E8FF !important; border-color: #581C87 !important; }
[data-theme="dark"] .stat-card-teal { background: linear-gradient(135deg, #042F2E 0%, #115E59 100%) !important; color: #CCFBF1 !important; border-color: #115E59 !important; }
[data-theme="dark"] .stat-card-primary { background: linear-gradient(135deg, #1E1B4B 0%, #312E81 100%) !important; color: #E0E7FF !important; border-color: #312E81 !important; }

/* Hover Animation Enhancement */
.stat-card:hover {
    transform: translateY(-8px) scale(1.03) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    z-index: 10;
}

[data-theme="dark"] .stat-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5) !important;
}


/* Call Selection Modal */
.call-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.call-modal.active {
    opacity: 1;
    visibility: visible;
}

.call-modal-content {
    background: var(--bg-card);
    width: 90%;
    max-width: 400px;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.call-modal.active .call-modal-content {
    transform: translateY(0) scale(1);
}

.call-modal-header {
    margin-bottom: 1.5rem;
}

.call-modal-icon {
    width: 64px;
    height: 64px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

.call-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.call-modal-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.call-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.call-action-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    background: var(--gray-50);
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.call-action-btn:hover {
    background: var(--gray-100);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.call-action-btn i {
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.btn-manual-call i {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.btn-ai-call i {
    background: rgba(79, 70, 229, 0.1);
    color: #4F46E5;
}

.call-action-info {
    flex: 1;
}

.call-action-title {
    font-weight: 600;
    color: var(--text-main);
    display: block;
}

.call-action-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.call-modal-close {
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    background: none;
    border: none;
}

.call-modal-close:hover {
    color: var(--text-main);
    text-decoration: underline;
}

/* Dashboard Date Filters */
.admin-date-selector {
    background: var(--bg-card);
    padding: 6px;
    border-radius: 14px;
    display: flex;
    padding: 4px;
    gap: 4px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .admin-date-selector {
    background: var(--gray-50);
    border-color: var(--gray-200);
}

.admin-date-selector:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(var(--primary-rgb), 0.4);
}

.admin-date-btn {
    text-decoration: none !important;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    white-space: nowrap;
}

.admin-date-btn:hover {
    color: var(--primary);
    background: var(--gray-50);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .admin-date-btn:hover {
    background: var(--gray-100);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.admin-date-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}

.admin-date-btn i {
    font-size: 1.1rem;
    margin-right: 4px;
}

/* Custom button tweaks */
button.admin-date-btn {
    outline: none;
}

/* -- Mobile Optimization (Presales Dashboard) -- */
@media (max-width: 768px) {
    .dash-welcome {
        padding: 20px 16px 12px;
    }
    .dash-welcome-label {
        font-size: 12px;
        color: var(--text-muted);
        font-weight: 500;
        margin-bottom: 2px;
    }
    .dash-welcome-name {
        font-size: 20px;
        font-weight: 800;
        color: var(--dark);
        letter-spacing: -.3px;
    }
    
    .dash-stats {
        padding: 0 16px 16px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .stat-chip {
        background: var(--bg-card);
        border-radius: 12px;
        padding: 12px;
        box-shadow: var(--shadow-sm);
        display: flex;
        flex-direction: column;
        border: 1px solid var(--border-color);
        transition: transform 0.2s;
        position: relative;
        overflow: hidden;
    }
    
    .stat-chip:active {
        transform: scale(0.97);
    }
    
    .stat-chip-label {
        font-size: 10px;
        color: var(--text-muted);
        font-weight: 700;
        text-transform: uppercase;
        margin-bottom: 4px;
        letter-spacing: 0.5px;
    }
    
    .stat-chip-val {
        font-size: 18px;
        font-weight: 800;
        color: var(--dark);
    }
    
    .stat-chip-icon {
        position: absolute;
        right: -5px;
        bottom: -5px;
        opacity: 0.08;
        font-size: 2.5rem;
        transform: rotate(-15deg);
    }

    /* Compact Cards for mobile list */
    .mobile-lead-card {
        background: var(--bg-card);
        border-radius: 12px;
        padding: 12px;
        margin-bottom: 12px;
        border: 1px solid var(--border-color);
        display: flex;
        flex-direction: column;
        gap: 8px;
        box-shadow: var(--shadow-sm);
    }
    
    .mlc-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
    }
    
    .mlc-name {
        font-weight: 700;
        font-size: 15px;
        color: var(--dark);
    }
    
    .mlc-project {
        font-size: 12px;
        color: var(--text-muted);
        margin-top: 2px;
    }
    
    .mlc-temp {
        font-size: 10px;
        font-weight: 700;
        padding: 2px 8px;
        border-radius: 20px;
        text-transform: uppercase;
    }
    
    .mlc-temp.hot { background: #FEE2E2; color: #EF4444; }
    .mlc-temp.warm { background: #FEF3C7; color: #F59E0B; }
    .mlc-temp.cold { background: #E0E7FF; color: #4F46E5; }
    
    .mlc-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        font-size: 11px;
        color: var(--text-muted);
        margin: 4px 0;
    }
    
    .mlc-meta span {
        display: flex;
        align-items: center;
        gap: 4px;
    }
    
    .mlc-actions {
        display: flex;
        gap: 8px;
        margin-top: 4px;
        padding-top: 8px;
        border-top: 1px solid var(--border-color);
    }
    
    .mlc-btn {
        flex: 1;
        padding: 8px;
        border-radius: 8px;
        font-size: 12px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        border: none;
        cursor: pointer;
        text-decoration: none;
        transition: opacity 0.2s;
    }
    
    .mlc-btn:active { opacity: 0.8; }
    
    .mlc-btn-call {
        background: #10B981;
        color: white !important;
    }
    
    .mlc-btn-view {
        background: var(--primary);
        color: white !important;
    }

    /* Section Headers */
    .mobile-section-header {
        padding: 0 16px 12px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-section-header h2 {
        font-size: 16px;
        font-weight: 700;
        color: var(--dark);
        margin: 0;
    }
    
    .mobile-section-header a {
        font-size: 12px;
        font-weight: 600;
        color: var(--primary);
        text-decoration: none;
    }
}

/* Refined Date Bar */
@media (max-width: 768px) {
    .dash-date-bar {
        margin: 0 16px 14px;
        background: var(--bg-card);
        border-radius: 12px;
        border: 1px solid var(--border-color);
        display: flex;
        gap: 2px;
        padding: 4px;
        box-shadow: var(--shadow-sm);
    }
    .dash-date-btn {
        flex: 1;
        padding: 8px 0;
        font-size: 11px;
        font-weight: 700;
        border: none;
        background: transparent;
        border-radius: 8px;
        color: var(--text-muted);
        cursor: pointer;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    .dash-date-btn.active {
        background: var(--primary);
        color: white;
        box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
    }
}

/* ==========================================================================
   Booking Details Desktop Layout and Responsive Grid
   ========================================================================== */
@media (min-width: 992px) {
    .booking-detail-grid {
        display: grid !important;
        grid-template-columns: 1.4fr 1fr !important;
        gap: 2rem !important;
        align-items: start !important;
        width: 100% !important;
    }
}

@media (max-width: 991px) and (min-width: 769px) {
    .booking-detail-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
        width: 100% !important;
    }
}

/* Restrict right column contents from causing overflow */
.booking-detail-grid > div {
    min-width: 0 !important;
}

/* Premium scrollbar behavior for responsive tables inside cards */
.booking-detail-grid .stat-card div[style*="overflow-x: auto"]::-webkit-scrollbar {
    height: 6px;
}
.booking-detail-grid .stat-card div[style*="overflow-x: auto"]::-webkit-scrollbar-track {
    background: transparent;
}
.booking-detail-grid .stat-card div[style*="overflow-x: auto"]::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}
[data-theme="dark"] .booking-detail-grid .stat-card div[style*="overflow-x: auto"]::-webkit-scrollbar-thumb {
    background: var(--gray-600);
}

/* ── Autocomplete Search Suggestions Dropdown (Light/Dark Theme Compliant) ── */
.suggestions-dropdown-custom {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 2px solid var(--primary);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-height: 500px;
    overflow-y: auto;
    z-index: 9999;
    margin-top: 4px;
}
.suggestions-dropdown-custom .suggestion-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    background: transparent;
}
.suggestions-dropdown-custom .suggestion-item:hover {
    background: var(--gray-100) !important;
}
.suggestions-dropdown-custom .suggestion-item:last-child {
    border-bottom: none;
}
.suggestions-dropdown-custom .suggestion-name {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}
.suggestions-dropdown-custom .suggestion-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}
.suggestions-dropdown-custom .suggestion-assigned {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ── Theme-Compliant Dashboard Notice & Status Boxes ── */
.notice-box-warning {
    background: #FFFBEB;
    border: 1px solid #FCD34D;
    color: #92400E;
}
.notice-box-warning h3 { color: #B45309 !important; }
.notice-box-warning p, .notice-box-warning strong, .notice-box-warning label { color: #78350F !important; }
.notice-box-warning .warning-icon-wrapper { background: #FEF3C7; color: #D97706; }

[data-theme="dark"] .notice-box-warning {
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #FCD34D !important;
}
[data-theme="dark"] .notice-box-warning h3 { color: #FBBF24 !important; }
[data-theme="dark"] .notice-box-warning p, 
[data-theme="dark"] .notice-box-warning strong,
[data-theme="dark"] .notice-box-warning label { color: #FDE68A !important; }
[data-theme="dark"] .notice-box-warning .warning-icon-wrapper { background: rgba(245, 158, 11, 0.2) !important; color: #FBBF24 !important; }

.notice-box-success {
    background: #F0FDF4;
    border: 1px solid #86EFAC;
    color: #166534;
}
.notice-box-success h3 { color: #166534 !important; }
.notice-box-success h4 { color: #15803d !important; }
.notice-box-success strong { color: #14532d !important; }
.notice-box-success span, .notice-box-success div { color: #166534 !important; }

[data-theme="dark"] .notice-box-success {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #A7F3D0 !important;
}
[data-theme="dark"] .notice-box-success h3 { color: #34D399 !important; }
[data-theme="dark"] .notice-box-success h4 { color: #6EE7B7 !important; }
[data-theme="dark"] .notice-box-success strong { color: #A7F3D0 !important; }
[data-theme="dark"] .notice-box-success span, 
[data-theme="dark"] .notice-box-success div,
[data-theme="dark"] .notice-box-success label { color: #D1FAE5 !important; }

.notice-box-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}
.notice-box-info h3 { color: #1e40af !important; }
.notice-box-info p, .notice-box-info strong { color: #1e3a8a !important; }

[data-theme="dark"] .notice-box-info {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #BFDBFE !important;
}
[data-theme="dark"] .notice-box-info h3 { color: #60A5FA !important; }
[data-theme="dark"] .notice-box-info p, 
[data-theme="dark"] .notice-box-info strong,
[data-theme="dark"] .notice-box-info label { color: #93C5FD !important; }

.notice-box-danger {
    background: #FEE2E2;
    border: 1px solid #FCA5A5;
    color: #991B1B;
}
.notice-box-danger h3 { color: #991B1B !important; }
.notice-box-danger p, .notice-box-danger strong, .notice-box-danger label { color: #7F1D1D !important; }

[data-theme="dark"] .notice-box-danger {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #FCA5A5 !important;
}
[data-theme="dark"] .notice-box-danger h3 { color: #F87171 !important; }
[data-theme="dark"] .notice-box-danger p, 
[data-theme="dark"] .notice-box-danger strong,
[data-theme="dark"] .notice-box-danger label { color: #FCA5A5 !important; }

.otp-verification-box {
    background: var(--bg-card);
    border: 2px solid var(--primary);
    color: var(--text-main);
}
.otp-verification-box h3 {
    color: var(--text-main) !important;
}
.otp-verification-box p {
    color: var(--text-muted) !important;
}
[data-theme="dark"] .otp-verification-box {
    background: #0a0a12 !important;
    border-color: var(--primary) !important;
    box-shadow: var(--shadow-lg) !important;
}

