:root {
    --primary: #6366F1; /* Premium Indigo */
    --primary-rgb: 99, 102, 241;
    --primary-light: rgba(99, 102, 241, 0.1);
    --sidebar-bg: #0F172A;
    --main-bg: #F8FAFC;
    --text-dark: #0F172A;
    --text-gray: #64748B;
    --border-color: rgba(226, 232, 240, 0.8);
    --accent-green: #10B981;
    --accent-purple: #8B5CF6;
    --accent-orange: #F59E0B;
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.04);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
}

* { box-sizing: border-box; }

body {
    background-color: #F8FAFC;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.05) 0px, transparent 50%);
    color: var(--text-dark);
    font-family: 'Inter', system-ui, sans-serif;
    margin: 0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before, body::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    filter: blur(80px);
    z-index: -1;
    pointer-events: none;
}

body::before {
    top: -200px;
    left: -200px;
    animation: blobFloat 25s infinite alternate ease-in-out;
}

body::after {
    bottom: -200px;
    right: -200px;
    animation: blobFloat 30s infinite alternate-reverse ease-in-out;
}

@keyframes blobFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(100px, 100px) scale(1.1); }
    100% { transform: translate(-50px, 150px) scale(0.9); }
}

.auth-container {
    display: flex;
    min-height: 100vh;
    background: #FFFFFF;
}

.auth-container.centered {
    justify-content: center;
    align-items: center;
    background: #F8FAFC;
}

.auth-container.centered .auth-brand-side {
    display: none;
}

.auth-container.centered .auth-form-side {
    flex: none;
    width: 100%;
    max-width: 650px;
    background: transparent;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.auth-form-side {
    flex: 7;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 10%;
}

.auth-form-inner {
    width: 100%;
    max-width: 500px;
}

.auth-brand-side {
    flex: 5;
    background: linear-gradient(rgba(59, 82, 223, 0.85), rgba(59, 82, 223, 0.85)), url('/images/auth-hero.png');
    background-size: 100%;
    background-position: center;
    border-radius: 2rem;
    margin: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
    animation: zoomBackground 30s infinite alternate ease-in-out;
}

@keyframes zoomBackground {
    from { background-size: 100%; }
    to { background-size: 115%; }
}

.form-group {
    position: relative;
    margin-bottom: 1.25rem;
}

/* ─── MOBILE AUTH HEADER ────────────────────────────────────────────────── */
.auth-mobile-header {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.5rem 0 1.25rem; /* Drastically reduced top padding */
    margin-bottom: 1rem;
}

.auth-mobile-header img {
    height: 120px; /* Further enlarged */
    width: auto;
    margin-bottom: 0.75rem;
    mix-blend-mode: multiply;
}

.auth-mobile-header h1 {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #0F172A 0%, #4F46E5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    margin: 0 0 0.25rem;
    line-height: 1.2;
}

.auth-mobile-header p {
    font-size: 0.875rem;
    color: #94A3B8;
    font-weight: 500;
    margin: 0;
}

/* ─── FIELD ICONS ───────────────────────────────────────────────────────── */
.field-icon-wrap {
    position: relative;
}

.field-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #CBD5E1;
    pointer-events: none;
    z-index: 3;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

/* Shift label & text when icon is present */
.field-icon-wrap .form-input {
    padding-left: 2.875rem;
}

.field-icon-wrap .form-label {
    left: 2.75rem;
}

.field-icon-wrap .form-input:focus ~ .form-label,
.field-icon-wrap .form-input:not(:placeholder-shown) ~ .form-label {
    left: 0.8rem;
}

/* Icon turns brand-coloured on focus */
.field-icon-wrap:focus-within .field-icon {
    color: var(--primary);
}

.form-input {
    width: 100%;
    padding: 1.125rem;
    border: 2px solid #F1F5F9;
    border-radius: 1rem;
    font-size: 1rem;
    background: #FFFFFF;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1E293B;
}

.form-input[type="password"], 
.form-input[type="text"]#password {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    color: #0F172A;
    border-color: #E2E8F0;
    font-weight: 500;
    padding-right: 3.5rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.15);
}

.form-label {
    position: absolute;
    left: 1rem;
    top: 1.125rem;
    font-weight: 500;
    font-size: 1rem;
    color: #94A3B8;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
    padding: 0 0.5rem;
    background: transparent;
}

.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label {
    top: -0.65rem;
    left: 0.8rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    background: white; /* Important: covers the border */
}

.auth-button {
    width: 100%;
    padding: 1.25rem;
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    color: white;
    border: none;
    border-radius: 1.25rem;
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 15px 30px -8px rgba(99, 102, 241, 0.35);
}

.auth-button:hover {
    transform: translateY(-2px);
    opacity: 0.95;
    box-shadow: 0 8px 15px rgba(var(--primary-rgb), 0.2);
}

/* Split Screen Layout */
.split-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

@media (max-width: 640px) {
    .split-container {
        height: auto;
    }
    .form-pane {
        min-height: 100svh;
        justify-content: flex-start !important;
    }
}

/* Hero Pane & Alternating Gallery (3 Slides) */
.hero-pane {
    flex: 1.1;
    position: relative;
    overflow: hidden;
    background: #0F172A; /* Deep slate base */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 4rem;
    color: white;
}

.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    animation: heroGallery 18s infinite ease-in-out;
}

.hero-slide:nth-child(2) { animation-delay: 6s; }
.hero-slide:nth-child(3) { animation-delay: 12s; }

@keyframes heroGallery {
    0%, 5% { opacity: 0; transform: scale(1.1); }
    15%, 33.33% { opacity: 0.8; transform: scale(1); } /* Increased opacity for visibility */
    43.33%, 100% { opacity: 0; transform: scale(1.05); }
}

/* The Blue Overlay for Readability */
.hero-pane::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.4) 0%, rgba(15, 23, 42, 0.9) 100%);
    z-index: 2;
}

.hero-overlay {
    position: relative;
    z-index: 3;
    max-width: 520px;
}

.form-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem;
    background: #FFFFFF;
    overflow-y: auto;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 80%;
}

@media (max-width: 992px) {
    .hero-pane { display: none; }
    .form-pane { flex: 1; width: 100%; padding: 2.5rem 1.5rem; }
    .auth-form-wrapper { max-width: 100%; }
}

@media (max-width: 640px) {
    .form-pane {
        padding: 1.5rem 1.25rem 3rem;
        justify-content: flex-start;
    }
    .auth-form-wrapper {
        max-width: 100%;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
        margin-bottom: 0;
    }
    .auth-mobile-header {
        display: flex !important;
    }
    .auth-form-wrapper > h2 {
        font-size: 1.6rem !important;
    }

    /* ── Native-app feel overrides ── */
    body {
        background: #F4F6FB;
    }
    .form-pane {
        background: #F4F6FB !important;
    }
    .auth-form-wrapper {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.8);
        border-radius: 2.5rem;
        padding: 2rem 1.5rem 2.5rem;
        box-shadow: 0 30px 60px -12px rgba(99, 102, 241, 0.08),
                    0 18px 36px -18px rgba(0, 0, 0, 0.03);
        margin-bottom: 2rem;
        position: relative;
        overflow: hidden;
    }

    /* Modern top accent: multi-layered gradient */
    .auth-form-wrapper::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 5px;
        background: linear-gradient(90deg, #6366F1, #8B5CF6);
        z-index: 10;
    }

    /* Modern Card Pattern: Subtle geometric waves */
    .auth-form-wrapper::after {
        content: '';
        position: absolute;
        top: -20%;
        right: -10%;
        width: 300px;
        height: 300px;
        background: radial-gradient(circle, rgba(99, 102, 241, 0.03) 0%, transparent 70%);
        pointer-events: none;
        z-index: 0;
    }
    .form-input {
        padding: 1rem 1.125rem;
        font-size: 1rem;
        border-radius: 0.875rem;
        border-color: #E8EDF5;
        background: #F8FAFF;
        -webkit-tap-highlight-color: transparent;
    }
    .form-input:focus {
        background: #FFFFFF;
        box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
    }
    .form-label {
        font-size: 0.9375rem;
        top: 1rem;
    }
    .form-input:focus ~ .form-label,
    .form-input:not(:placeholder-shown) ~ .form-label {
        top: -0.625rem;
        font-size: 0.7rem;
    }
    .auth-button {
        padding: 1.125rem;
        border-radius: 1.25rem;
        font-size: 1rem;
        letter-spacing: 0.01em;
        box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.3);
    }
    .password-toggle {
        right: 1rem;
    }
    footer {
        display: none !important;
    }
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.form-row .form-group {
    flex: 1;
}

.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 2.5rem;
    padding: 3rem;
}

.password-toggle {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #94A3B8;
    z-index: 10;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--primary);
}

/* Premium Redesign Utilities */
.premium-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 0% 0%, rgba(var(--primary-rgb), 0.15) 0%, transparent 50%),
                radial-gradient(circle at 100% 100%, rgba(var(--primary-rgb), 0.1) 0%, transparent 50%),
                #FAFAFA;
    z-index: -1;
}

.bg-blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: rgba(var(--primary-rgb), 0.1);
    filter: blur(100px);
    border-radius: 50%;
    z-index: -1;
    animation: blobFloat 20s infinite alternate ease-in-out;
}

@keyframes blobFloat {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(100px, 50px) scale(1.1); }
}

.glass-card-premium {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 3rem;
    box-shadow: 0 40px 80px -15px rgba(0, 0, 0, 0.12),
                0 0 40px rgba(99, 102, 241, 0.05);
    padding: 3.5rem 3rem 3rem;
    width: 100%;
    max-width: 440px;
    margin: 2rem auto;
    position: relative;
    overflow: hidden;
}

.glass-card-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #6366F1 0%, #A855F7 100%);
    z-index: 5;
}

.logo-container {
    width: 80px;
    height: 80px;
    background: #FFFFFF;
    border-radius: 1.5rem;
    padding: 0.75rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -1.5rem auto 1.25rem; /* pull up slightly */
    border: 1px solid #F1F5F9;
}

.tenant-name {
    font-size: 1.75rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #0F172A;
    margin-bottom: 0.25rem;
    line-height: 1.1;
}

.tenant-subtitle {
    font-size: 0.875rem;
    color: #64748B;
    font-weight: 500;
    margin-bottom: 2.5rem;
}

/* ─── DASHBOARD LAYOUT ─────────────────────────────────────────────────── */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background: var(--main-bg);
}

.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2.5rem 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 40;
    flex-shrink: 0;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar .nav-link {
    color: var(--text-gray);
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
}

.sidebar .nav-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar .nav-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.3);
}

.sidebar .nav-section-title {
    color: #94A3B8;
    margin-top: 2.5rem;
}

.sidebar .logout-btn {
    background: #FFF1F2 !important;
    color: #E11D48 !important;
}

.sidebar .logout-btn:hover {
    background: #FFE4E6 !important;
    color: #BE123C !important;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-gray);
    text-decoration: none;
    font-weight: 600;
    border-radius: 0.75rem;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
}

.nav-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary);
    color: white;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1.5rem 1rem 0.75rem;
}

.main-content {
    flex: 1;
    padding: 2.5rem;
    min-width: 0; /* Important for table overflow */
}

/* ─── MOBILE RESPONSIVENESS UTILITIES ─── */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 0.75rem !important;
    }

    .main-content {
        padding: 0.75rem 0.25rem !important;
    }

    div[style*="grid-template-columns: repeat(5,"],
    div[style*="grid-template-columns: repeat(4,"],
    div[style*="grid-template-columns: repeat(3,"],
    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns: 1fr 380px"] {
        grid-template-columns: 1fr !important;
    }

    .top-bar {
        flex-wrap: wrap !important;
        gap: 0.75rem !important;
    }

    div[style*="max-width: 480px"],
    div[style*="max-width: 650px"],
    div[style*="max-width: 800px"],
    div[style*="max-width: 920px"],
    div[style*="max-width: 1200px"],
    div[style*="max-width: 1400px"] {
        width: 100% !important;
        margin: 0 auto !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        box-sizing: border-box !important;
    }
}

/* ─── RESPONSIVENESS ────────────────────────────────────────────────────── */
.lg-hidden { display: none !important; }

.grid-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.grid-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.dashboard-header {
    display: flex; 
    justify-content: space-between; 
    align-items: flex-end; 
    margin-bottom: 2.5rem;
}

@media (max-width: 1280px) {
    .grid-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: -320px;
        width: 280px !important;
        height: 100vh !important;
        z-index: 50 !important;
        transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
        box-shadow: 20px 0 50px rgba(15, 23, 42, 0.25) !important;
        background: #FFFFFF !important;
        overflow-y: auto !important;
    }

    .sidebar.active {
        left: 0 !important;
    }
}

@media (max-width: 768px) {
    .grid-stats {
        grid-template-columns: 1fr;
    }

    .grid-charts {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1.5rem;
    }

    .dashboard-header .btn-primary {
        width: 100%;
        justify-content: center;
    }
}

/* Impersonation Banner */
.impersonation-banner {
    background: linear-gradient(135deg, #4F46E5, #3B52DF);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
    border-radius: 0 0 1rem 1rem;
    margin: -2.5rem -2.5rem 1.5rem -2.5rem;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    gap: 1.5rem;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Top-bar Hamburger (Tablet Mode Only: 769px to 1024px)
   - Desktop (>1024px): Hidden (sidebar is static on left)
   - Tablet (769px-1024px): Visible (opens drawer sidebar)
   - Mobile (<=768px): Hidden (handled by bottom navigation Menu tab)
*/
.top-bar-hamburger {
    display: none !important;
}

@media (min-width: 769px) and (max-width: 1024px) {
    .top-bar-hamburger {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
}

.search-wrapper {
    position: relative;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-shrink: 0;
}

.header-divider {
    width: 1px;
    height: 32px;
    background: var(--border-color);
    margin: 0 0.5rem;
}

.user-dropdown {
    min-width: 200px;
    border-left: 1px solid var(--border-color);
    padding-left: 1.25rem;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-wrapper > svg {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #94A3B8;
    pointer-events: none;
    z-index: 2;
}

.search-input {
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    padding: 0.65rem 1rem 0.65rem 2.5rem !important;
    border-radius: 0.75rem;
    width: 320px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #0F172A;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.search-input:focus {
    background: #FFFFFF;
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.date-input {
    background: #F8FAFC;
    border: 1.5px solid var(--border-color);
    padding: 0.55rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.date-input:focus {
    border-color: var(--primary);
    background: #FFFFFF;
}

/* Mobile & Tablet Responsiveness Overrides */
@media (max-width: 1024px) {
    .main-content {
        padding: 1.5rem !important;
        overflow-x: hidden !important;
    }

    .impersonation-banner {
        margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    }

    .search-input {
        width: 240px;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        overflow-x: hidden !important;
    }

    .main-content {
        padding: 1rem 0.75rem !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .impersonation-banner {
        margin: -1rem -0.75rem 1.25rem -0.75rem !important;
        border-radius: 0 !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.8rem !important;
    }

    .top-bar {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        grid-template-areas:
            "left right"
            "search search" !important;
        gap: 0.75rem !important;
        margin-bottom: 1.25rem !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .top-bar-left {
        grid-area: left !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        min-width: 0 !important;
    }

    .top-bar-right {
        grid-area: right !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        flex-shrink: 0 !important;
        width: auto !important;
        margin-left: 0 !important;
        justify-content: flex-end !important;
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }

    .search-wrapper {
        grid-area: search !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .search-input {
        width: 100% !important;
        max-width: 100% !important;
        background: #FFFFFF !important;
        border: 1.5px solid #E2E8F0 !important;
        border-radius: 0.75rem !important;
        padding: 0.6rem 1rem 0.6rem 2.4rem !important;
        font-size: 0.85rem !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.02) !important;
    }

    .branch-select-container {
        flex: 1 !important;
        min-width: 0 !important;
        margin-left: 0 !important;
    }

    #branch-switch-select {
        width: 100% !important;
        font-size: 0.8rem !important;
        padding: 0.45rem 0.65rem !important;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
    }

    .header-divider {
        display: none !important;
    }

    .user-dropdown {
        min-width: auto !important;
        padding-left: 0 !important;
        border-left: none !important;
    }

    .user-info-text {
        display: none !important;
    }

    .search-dropdown-menu {
        min-width: 100% !important;
        max-width: 100% !important;
    }

    .branch-select-container {
        width: 100% !important;
        margin-left: 0 !important;
    }

    #branch-switch-select {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 0.825rem !important;
    }

    .header-divider {
        display: none !important;
    }

    .visits-header-container {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
        margin-bottom: 1.75rem !important;
    }

    .visits-header-container h1 {
        font-size: 1.75rem !important;
    }

    .btn-primary-action {
        width: 100% !important;
    }

    .mobile-tabs-scroll::-webkit-scrollbar {
        display: none;
    }

    .mobile-tabs-scroll {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .user-dropdown {
        min-width: auto !important;
        padding-left: 0 !important;
        border-left: none !important;
    }

    .user-info-text .greeting {
        display: none !important;
    }

    .user-info-text .user-name {
        font-size: 0.85rem !important;
        max-width: 110px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .table-container {
        padding: 1rem !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        border-radius: 1rem !important;
    }

    .table-container table {
        min-width: 580px !important;
    }

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

    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns: 1.2fr 1fr"],
    div[style*="grid-template-columns: 2fr 1fr"],
    div[style*="grid-template-columns: 1fr 380px"] {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* ─── UI COMPONENTS ────────────────────────────────────────────────────── */
.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1.75rem;
    border-radius: 1.5rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, transparent, rgba(99, 102, 241, 0.03));
    border-radius: 0 0 0 100%;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-gray);
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0.5rem 0 1rem;
}

.table-container {
    background: white;
    padding: 1.50rem;
    border-radius: 1.25rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    margin-top: 2rem;
}

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

th {
    text-align: left;
    padding: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1.25rem 1rem;
    font-size: 0.875rem;
    color: var(--text-dark);
    border-bottom: 1px solid var(--main-bg);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
}

/* ─── DROPDOWN SYSTEM ──────────────────────────────────────────────────── */
.user-dropdown {
    position: relative;
    cursor: pointer;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    transition: all 0.2s;
}

.user-trigger:hover {
    background: var(--primary-light);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 200px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    padding: 0.5rem;
    z-index: 50;
    transform-origin: top right;
}

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

.dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.dropdown-item i {
    font-size: 1.1rem;
}

/* ─── TOPBAR UX REDESIGN ───────────────────────────────────────────────── */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    background: white; /* fallback */
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 1.25rem;
    box-shadow: 0 4px 15px -10px rgba(0, 0, 0, 0.1);
}

.search-wrapper {
    position: relative;
    width: 420px;
}

.search-wrapper svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    width: 18px;
    height: 18px;
}

.search-input {
    padding-left: 2.75rem !important;
    width: 100% !important;
    background: #F1F5F9 !important;
    border: none !important;
}

.action-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    border-radius: 0.75rem;
    transition: all 0.2s;
    cursor: pointer;
    background: transparent;
}

.action-icon:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--primary-light);
}

.greeting {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-gray);
    white-space: nowrap;
}

/* ─── PREMIUM ALERTS ───────────────────────────────────────────────────── */
.alert-premium {
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid transparent;
}

.alert-premium-danger {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
    color: #B91C1C;
}

.alert-premium-success {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.2);
    color: #065F46;
}

/* ─── PREMIUM TOASTR ─────────────────────────────────────────────────── */
#toast-container { z-index: 999999 !important; }

#toast-container > .toast {
    background-image: none !important;
    background-repeat: no-repeat !important;
    padding: 1.25rem 1.5rem 1.25rem 1.5rem !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    opacity: 1 !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: #FFFFFF !important;
    width: auto !important;
    min-width: 320px !important;
    max-width: 450px !important;
}

#toast-container > .toast-success,
#toast-container > .toast-error,
#toast-container > .toast-info,
#toast-container > .toast-warning {
    background-image: none !important;
}

#toast-container > .toast-success {
    background: rgba(16, 185, 129, 0.98) !important;
}

#toast-container > .toast-error {
    background: rgba(225, 29, 72, 0.98) !important;
}

.toast-title { color: #FFFFFF !important; font-weight: 800 !important; font-size: 1rem !important; margin-bottom: 4px !important; }
.toast-message { color: #FFFFFF !important; font-weight: 500 !important; font-size: 0.9375rem !important; }

.toast-close-button { top: 1rem !important; right: 1rem !important; opacity: 0.7 !important; }

/* ─── Hiding standard success alerts to avoid double feedback ─── */
.alert-premium-success { display: none !important; }

.error-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.user-name {
    font-weight: 700;
    color: #0F172A;
    font-size: 1rem;
    white-space: nowrap;
}

/* ─── MOBILE BOTTOM NAVIGATION BAR ─── */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(226, 232, 240, 0.85);
        box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.08);
        z-index: 50;
        justify-content: space-around;
        align-items: center;
        padding: 0 0.25rem;
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
        flex: 1;
        height: 100%;
        color: #64748B;
        text-decoration: none;
        background: none;
        border: none;
        cursor: pointer;
        font-size: 0.68rem;
        font-weight: 700;
        transition: all 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .bottom-nav-item svg {
        width: 22px;
        height: 22px;
        stroke: currentColor;
        fill: none;
        stroke-width: 2.2;
        transition: all 0.2s ease;
    }

    .bottom-nav-item:active {
        transform: scale(0.92);
    }

    .bottom-nav-item.active {
        color: var(--primary) !important;
    }

    .bottom-nav-item.active svg {
        transform: translateY(-2px);
        stroke: var(--primary);
    }

    .main-content {
        padding-bottom: 5.5rem !important;
    }
}

/* ─── GLOBAL DATE INPUT STYLING ─────────────────────────────────────── */
input[type="date"],
input[type="date"].date-input {
    appearance: none;
    -webkit-appearance: none;
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 0.75rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0F172A;
    font-family: 'Inter', system-ui, sans-serif;
    outline: none;
    width: 100%;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="date"]:focus,
input[type="date"].date-input:focus {
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
    background: #fff;
}
input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.5;
    cursor: pointer;
    filter: invert(30%) sepia(60%) saturate(400%) hue-rotate(200deg);
}
input[type="date"]::-webkit-inner-spin-button { display: none; }
input[type="date"]::-webkit-clear-button { display: none; }

/* ─── VISIT CARD MOBILE PULL-TO-REVEAL ──────────────────────────────── */
@media (max-width: 767px) {
    .vj-cards { padding-bottom: 0.5rem; }
    .vj-card { animation: cardSlideIn 0.3s ease both; }
    @keyframes cardSlideIn {
        from { opacity: 0; transform: translateY(12px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .vj-card:nth-child(1) { animation-delay: 0.05s; }
    .vj-card:nth-child(2) { animation-delay: 0.10s; }
    .vj-card:nth-child(3) { animation-delay: 0.15s; }
    .vj-card:nth-child(4) { animation-delay: 0.20s; }
    .vj-card:nth-child(5) { animation-delay: 0.25s; }
}

/* ════════════════════════════════════════════════════════════
   Premium Pagination Component (.arc-pagination)
   ════════════════════════════════════════════════════════════ */
.arc-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.arc-pag-info {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.arc-pag-bold {
    font-weight: 800;
    color: #0F172A;
}

.arc-pag-per-page {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.75rem;
    padding-left: 0.75rem;
    border-left: 1.5px solid #E2E8F0;
}

.arc-pag-per-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748B;
}

.arc-pag-select {
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
    border: 1px solid #CBD5E1;
    background-color: #FFFFFF;
    color: #0F172A;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.arc-pag-select:focus,
.arc-pag-select:hover {
    border-color: #6366F1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.arc-pag-controls {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.arc-pag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.65rem;
    border-radius: 0.65rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.18s ease;
    user-select: none;
    border: 1.5px solid transparent;
}

/* Nav arrows (prev/next) */
.arc-pag-nav {
    background: #fff;
    color: #3B52DF;
    border-color: #E2E8F0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.arc-pag-nav:hover {
    background: #EEF2FF;
    border-color: #C7D2FE;
    color: #3B52DF;
    transform: scale(1.05);
}

/* Active page */
.arc-pag-active {
    background: linear-gradient(135deg, #3B52DF 0%, #6366F1 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(59, 82, 223, 0.28);
}

/* Inactive pages */
.arc-pag-page {
    background: #fff;
    color: #475569;
    border-color: #F1F5F9;
}
.arc-pag-page:hover {
    background: #F8FAFC;
    border-color: #E2E8F0;
    color: #0F172A;
}

/* Dots / ellipsis */
.arc-pag-dots {
    background: transparent;
    color: #94A3B8;
    border-color: transparent;
    letter-spacing: 0.05em;
    min-width: 32px;
}

/* Disabled arrows */
.arc-pag-disabled {
    background: #F8FAFC;
    color: #CBD5E1;
    border-color: #F1F5F9;
    cursor: not-allowed;
}

/* Mobile: stack info above controls */
@media (max-width: 767px) {
    .arc-pagination {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
    }
    .arc-pag-info {
        justify-content: center;
        font-size: 0.78rem;
    }
    .arc-pag-controls {
        justify-content: center;
    }
    .arc-pag-btn {
        min-width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
}

/* ════════════════════════════════════════════════════════════
   GLOBAL PREMIUM CARD HOVER SYSTEM
   ════════════════════════════════════════════════════════════ */
.card,
.stat-card,
.st-stat-card,
.cp-stat-card,
.sc-card,
.sc-cat-item,
.st-card,
.cp-card,
.vj-card,
.dashboard-card,
.summary-card-section,
.pos-card,
.billing-card,
.analytics-card,
.menu-card {
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.28s ease,
                background-color 0.28s ease !important;
    will-change: transform, box-shadow;
}

/* Hover State: Lift up 5px + Soft indigo glow shadow + Subtle border highlight */
.card:hover,
.stat-card:hover,
.st-stat-card:hover,
.cp-stat-card:hover,
.sc-card:hover,
.sc-cat-item:hover,
.st-card:hover,
.cp-card:hover,
.vj-card:hover,
.dashboard-card:hover,
.summary-card-section:hover,
.pos-card:hover,
.billing-card:hover,
.analytics-card:hover,
.menu-card:hover {
    transform: translateY(-5px) scale(1.008) !important;
    box-shadow: 0 16px 36px -8px rgba(59, 82, 223, 0.14), 
                0 4px 14px rgba(15, 23, 42, 0.04) !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
}

/* Inner Avatar & Icon micro-scaling on Card Hover */
.stat-card:hover .stat-icon,
.st-stat-card:hover .st-stat-icon,
.cp-stat-card:hover .cp-stat-icon,
.sc-cat-item:hover .sc-cat-avatar,
.sc-card:hover .sc-icon,
.st-card:hover .st-card-avatar,
.cp-card:hover .cp-avatar,
.vj-card:hover .vj-card-avatar {
    transform: scale(1.12) rotate(3deg);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Active / Touch feedback for clicks */
.card:active,
.stat-card:active,
.st-stat-card:active,
.cp-stat-card:active,
.sc-card:active,
.sc-cat-item:active,
.st-card:active,
.cp-card:active,
.vj-card:active,
.dashboard-card:active,
.summary-card-section:active,
.pos-card:active {
    transform: translateY(-1px) scale(0.99) !important;
    box-shadow: 0 6px 16px rgba(59, 82, 223, 0.1) !important;
}

