/* ============================================================
   CRYSTAL DROP AURA — ADMIN PANEL
   Mobile-First · Handcrafted · Corporate Professional
   Inspired by: Stripe, Razorpay, Shopify
   ============================================================ */


/* ================================================================
   1. DESIGN TOKENS
   ================================================================ */
:root {
    /* ─── Brand Palette ─── */
    --brand-50:  #eef2ff;
    --brand-100: #e0e7ff;
    --brand-200: #c7d2fe;
    --brand-400: #818cf8;
    --brand-500: #4f6ef7;
    --brand-600: #4338ca;
    --brand-700: #3730a3;
    --brand-900: #1e1b4b;

    /* ─── Neutrals (Slate) ─── */
    --n-0:   #ffffff;
    --n-25:  #fcfcfd;
    --n-50:  #f8fafc;
    --n-100: #f1f5f9;
    --n-150: #eaeff5;
    --n-200: #e2e8f0;
    --n-300: #cbd5e1;
    --n-400: #94a3b8;
    --n-500: #64748b;
    --n-600: #475569;
    --n-700: #334155;
    --n-800: #1e293b;
    --n-900: #0f172a;
    --n-950: #0a1628;

    /* ─── Semantic Colors ─── */
    --success-50:  #ecfdf5;
    --success-100: #d1fae5;
    --success-500: #10b981;
    --success-600: #059669;

    --warning-50:  #fffbeb;
    --warning-100: #fef3c7;
    --warning-500: #f59e0b;
    --warning-600: #d97706;

    --danger-50:  #fef2f2;
    --danger-100: #fee2e2;
    --danger-500: #ef4444;
    --danger-600: #dc2626;

    --info-50:  #eff6ff;
    --info-100: #dbeafe;
    --info-500: #3b82f6;

    --purple-50:  #f5f3ff;
    --purple-500: #8b5cf6;

    --amber-50:  #fffbeb;
    --amber-500: #f59e0b;

    --rose-50:  #fff1f2;
    --rose-500: #f43f5e;

    --teal-50:  #f0fdfa;
    --teal-500: #14b8a6;

    /* ─── Typography ─── */
    --ff: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --fs-2xs: 0.6875rem;   /* 11px */
    --fs-xs:  0.75rem;     /* 12px */
    --fs-sm:  0.8125rem;   /* 13px */
    --fs-base: 0.875rem;   /* 14px */
    --fs-md:  0.9375rem;   /* 15px */
    --fs-lg:  1.0625rem;   /* 17px */
    --fs-xl:  1.25rem;     /* 20px */
    --fs-2xl: 1.5rem;      /* 24px */
    --fs-3xl: 1.875rem;    /* 30px */

    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semi:   600;
    --fw-bold:   700;
    --fw-extra:  800;

    /* ─── Spacing Scale ─── */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;
    --sp-12: 48px;
    --sp-16: 64px;

    /* ─── Radii ─── */
    --r-xs: 4px;
    --r-sm: 6px;
    --r-md: 8px;
    --r-lg: 12px;
    --r-xl: 16px;
    --r-2xl: 20px;
    --r-full: 9999px;

    /* ─── Shadows ─── */
    --sh-xs:  0 1px 2px rgba(0,0,0,0.04);
    --sh-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --sh-md:  0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
    --sh-lg:  0 10px 15px -3px rgba(0,0,0,0.06), 0 4px 6px -4px rgba(0,0,0,0.04);
    --sh-xl:  0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --sh-inner: inset 0 2px 4px 0 rgba(0,0,0,0.04);

    /* ─── Motion ─── */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --dur-fast: 0.15s;
    --dur-base: 0.25s;
    --dur-slow: 0.4s;

    /* ─── Layout ─── */
    --sidebar-w: 250px;
    --header-h: 56px;
    --bottom-nav-h: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}


/* ================================================================
   2. GLOBAL RESET
   ================================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: var(--ff);
    font-size: var(--fs-base);
    line-height: 1.55;
    color: var(--n-800);
    background: var(--n-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior-y: none;
}

a { color: var(--brand-500); text-decoration: none; }
button { cursor: pointer; font: inherit; border: none; background: none; color: inherit; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; display: block; }
input, select, textarea { font: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--n-300); border-radius: 4px; }

/* Selection */
::selection { background: var(--brand-100); color: var(--brand-700); }


/* ================================================================
   3. UTILITY CLASSES
   ================================================================ */
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mt-2 { margin-top: var(--sp-2); }
.text-muted { color: var(--n-500); }
.text-danger { color: var(--danger-500); }
.max-w-lg { max-width: 600px; }
.flex-1 { flex: 1; }

.bg-blue-subtle   { background: var(--brand-50);  color: var(--brand-500); }
.bg-green-subtle  { background: var(--success-50); color: var(--success-500); }
.bg-amber-subtle  { background: var(--amber-50);  color: var(--amber-500); }
.bg-purple-subtle { background: var(--purple-50); color: var(--purple-500); }
.bg-rose-subtle   { background: var(--rose-50);   color: var(--rose-500); }
.bg-teal-subtle   { background: var(--teal-50);   color: var(--teal-500); }


/* ================================================================
   4. BUTTONS
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 10px 18px;
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    border-radius: var(--r-md);
    border: 1px solid transparent;
    transition: all var(--dur-fast) ease;
    white-space: nowrap;
    min-height: 44px; /* touch-friendly */
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0;
    transition: opacity var(--dur-fast);
    pointer-events: none;
}

.btn:active::after {
    opacity: 0.08;
}

.btn-primary {
    background: var(--brand-500);
    color: #fff;
    box-shadow: var(--sh-xs), 0 1px 0 rgba(0,0,0,0.08);
}
.btn-primary:hover { background: var(--brand-600); }
.btn-primary:active { background: var(--brand-700); transform: scale(0.98); }

.btn-secondary {
    background: var(--n-0);
    color: var(--n-700);
    border-color: var(--n-200);
    box-shadow: var(--sh-xs);
}
.btn-secondary:hover { background: var(--n-50); border-color: var(--n-300); }
.btn-secondary:active { background: var(--n-100); transform: scale(0.98); }

.btn-danger {
    background: var(--danger-500);
    color: #fff;
}
.btn-danger:hover { background: var(--danger-600); }

.btn-ghost {
    background: transparent;
    color: var(--n-500);
}
.btn-ghost:hover { background: var(--n-100); color: var(--n-700); }

.btn-sm {
    padding: 6px 12px;
    font-size: var(--fs-sm);
    min-height: 36px;
}

.btn-lg {
    padding: 14px 24px;
    font-size: var(--fs-md);
    min-height: 48px;
    font-weight: var(--fw-semi);
}

.btn-block { width: 100%; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-height: 40px;
    border-radius: var(--r-md);
    color: var(--n-500);
    transition: all var(--dur-fast);
    -webkit-tap-highlight-color: transparent;
}
.btn-icon:hover { background: var(--n-100); color: var(--n-700); }
.btn-icon:active { background: var(--n-200); transform: scale(0.92); }

.btn-group {
    display: flex;
    gap: var(--sp-3);
    flex-wrap: wrap;
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ================================================================
   5. FORM INPUTS
   ================================================================ */
.field {
    margin-bottom: var(--sp-4);
}
.field label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--n-600);
    margin-bottom: var(--sp-1);
}

.text-input, .select-input {
    width: 100%;
    padding: 11px 14px;
    font-size: 16px; /* prevents zoom on iOS */
    color: var(--n-800);
    background: var(--n-0);
    border: 1px solid var(--n-200);
    border-radius: var(--r-md);
    transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
    min-height: 46px;
    -webkit-appearance: none;
    appearance: none;
}

.text-input:focus, .select-input:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px var(--brand-50);
}

.text-input::placeholder {
    color: var(--n-400);
}

textarea.text-input {
    resize: vertical;
    min-height: 90px;
    line-height: 1.5;
}

.select-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.field-input-wrap {
    position: relative;
}
.field-addon {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--n-400);
    background: none;
    border: none;
    cursor: pointer;
}

.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-4);
}

.field-row-2 {
    display: flex;
    gap: var(--sp-3);
}
.field-row-2 > .field { flex: 1; }

/* Search field */
.search-field {
    position: relative;
    width: 100%;
}
.search-field svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--n-400);
    pointer-events: none;
}
.search-field input {
    width: 100%;
    padding: 11px 14px 11px 42px;
    font-size: 16px;
    color: var(--n-800);
    background: var(--n-0);
    border: 1px solid var(--n-200);
    border-radius: var(--r-md);
    min-height: 46px;
    -webkit-appearance: none;
    transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.search-field input:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px var(--brand-50);
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-flex;
    width: 44px;
    height: 26px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
    position: absolute;
    inset: 0;
    background: var(--n-300);
    border-radius: var(--r-full);
    transition: background var(--dur-fast);
}
.toggle-track::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--n-0);
    border-radius: 50%;
    box-shadow: var(--sh-sm);
    transition: transform var(--dur-base) var(--ease-out);
}
.toggle input:checked + .toggle-track {
    background: var(--brand-500);
}
.toggle input:checked + .toggle-track::before {
    transform: translateX(18px);
}

/* Star Picker */
.star-picker {
    display: flex;
    gap: 4px;
}
.sp-star {
    font-size: 24px;
    cursor: pointer;
    color: var(--n-300);
    transition: color var(--dur-fast), transform var(--dur-fast);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    padding: 4px;
}
.sp-star.active { color: var(--warning-500); }
.sp-star:active { transform: scale(1.3); }


/* ================================================================
   6. LUXURY MOBILE-FIRST LOGIN PORTAL
   ================================================================ */
.login-screen {
    position: fixed;
    inset: 0;
    background: #060b14;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: var(--sp-4);
    overflow-y: auto;
}

/* Ambient Glowing Mesh Background */
.login-mesh-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.lmesh-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}
.lmesh-orb-1 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.28) 0%, transparent 70%);
    top: -60px;
    left: -40px;
    animation: orbFloat1 8s ease-in-out infinite alternate;
}
.lmesh-orb-2 {
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
    bottom: -80px;
    right: -50px;
    animation: orbFloat2 9s ease-in-out infinite alternate;
}
.lmesh-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 32px 32px;
}
@keyframes orbFloat1 {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(40px, 30px) scale(1.1); }
}
@keyframes orbFloat2 {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(-30px, -40px) scale(1.08); }
}

/* Luxe Card */
.login-card-luxe {
    position: relative;
    width: 100%;
    max-width: 390px;
    padding: 28px 24px 24px;
    background: rgba(13, 22, 38, 0.82);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-top: 1px solid rgba(0, 210, 255, 0.45);
    border-radius: 28px;
    box-shadow: 
        0 25px 60px -10px rgba(0, 0, 0, 0.75),
        0 0 40px -5px rgba(0, 210, 255, 0.2);
    animation: cardEnter 0.5s var(--ease-out);
    margin: auto;
}

.login-card-luxe.shake {
    animation: luxeShake 0.45s ease;
    border-color: rgba(239, 68, 68, 0.6) !important;
    box-shadow: 0 0 35px rgba(239, 68, 68, 0.35) !important;
}

@keyframes luxeShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

/* Vault Top Tag */
.login-vault-header {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}
.lvh-shield {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.lvh-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

/* Brand Identity */
.login-brand-luxe {
    text-align: center;
    margin-bottom: 20px;
}
.login-logo-halo {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.15) 0%, rgba(79, 110, 247, 0.08) 100%);
    border: 1px solid rgba(0, 210, 255, 0.3);
    border-radius: 20px;
    margin-bottom: 12px;
    box-shadow: 0 0 25px rgba(0, 210, 255, 0.25);
}
.login-svg-drop {
    filter: drop-shadow(0 4px 16px rgba(0, 210, 255, 0.5));
    animation: dropPulse 3s ease-in-out infinite alternate;
}
@keyframes dropPulse {
    from { transform: scale(0.96); }
    to { transform: scale(1.04); }
}

.admin-drop-shine-beam {
    animation: adminShineSweep 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes adminShineSweep {
    0% { transform: translateX(-80px) translateY(-30px); opacity: 0; }
    12% { opacity: 1; }
    60% { transform: translateX(80px) translateY(30px); opacity: 1; }
    70%, 100% { transform: translateX(80px) translateY(30px); opacity: 0; }
}

.admin-drop-sparkle {
    transform-origin: 12px 18px;
    animation: adminSparkleFlash 2.4s ease-in-out infinite;
}
@keyframes adminSparkleFlash {
    0%, 20% { transform: scale(0) rotate(0deg); opacity: 0; }
    35% { transform: scale(1.4) rotate(45deg); opacity: 1; }
    52% { transform: scale(0.9) rotate(90deg); opacity: 0.85; }
    68%, 100% { transform: scale(0) rotate(140deg); opacity: 0; }
}
.login-title-luxe {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}
.text-cyan-gradient {
    background: linear-gradient(135deg, #00d2ff 0%, #4f6ef7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.login-sub-luxe {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 3px;
}

/* Visual PIN Display Boxes */
.pin-display-wrap {
    text-align: center;
    margin-bottom: 16px;
}
.pin-digit-boxes {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}
.pin-box {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.pin-box.active {
    border-color: #00d2ff;
    box-shadow: 0 0 16px rgba(0, 210, 255, 0.35);
    background: rgba(0, 210, 255, 0.06);
    transform: scale(1.04);
}
.pin-dot {
    width: 0px;
    height: 0px;
    border-radius: 50%;
    background: #00d2ff;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 12px #00d2ff;
}
.pin-box.filled {
    border-color: rgba(0, 210, 255, 0.5);
    background: rgba(0, 210, 255, 0.08);
}
.pin-box.filled .pin-dot {
    width: 14px;
    height: 14px;
}
.pin-input-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}
.pin-hidden-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

/* Error Alert */
.login-alert-luxe {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 12px;
}
.login-alert-luxe.show { display: flex; }

/* Tactile Phone Keypad */
.phone-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin-bottom: 18px;
}
.pk-btn {
    height: 52px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.pk-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}
.pk-btn:active {
    background: rgba(0, 210, 255, 0.25);
    border-color: #00d2ff;
    transform: scale(0.94);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
}
.pk-btn-fn {
    font-size: 13px;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}
.pk-fn-top {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.1;
    color: #00d2ff;
}
.pk-fn-sub {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 1px;
}

/* Submit Button */
.login-btn-luxe {
    background: linear-gradient(135deg, #00d2ff 0%, #4f6ef7 100%) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    min-height: 48px !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 24px -4px rgba(0, 210, 255, 0.4) !important;
    transition: all 0.2s ease !important;
}
.login-btn-luxe:hover {
    box-shadow: 0 12px 30px -4px rgba(0, 210, 255, 0.6) !important;
    transform: translateY(-2px);
}
.login-btn-luxe:active {
    transform: scale(0.98);
}

/* Footer Link */
.login-footer-connect {
    text-align: center;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.lfc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #94a3b8;
    transition: color 0.2s ease;
}
.lfc-link:hover {
    color: #00d2ff;
}

/* Header Website Connect Items */
.sync-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    padding: 5px 10px;
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
}
.header-site-btn, .header-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
@media (max-width: 640px) {
    .sync-badge-pill { display: none; }
    .header-site-btn span { display: none; }
}

/* ─── Modal XL (Preview Website) ─── */
.modal-sheet.modal-xl {
    max-width: 900px;
    width: 95%;
}


/* ================================================================
   7. APP SHELL LAYOUT
   ================================================================ */
.app-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}


/* ================================================================
   8. SIDEBAR (Desktop & Tablet)
   ================================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--n-900);
    color: var(--n-300);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform var(--dur-slow) var(--ease-out);
}

.sidebar-top {
    height: var(--header-h);
    display: flex;
    align-items: center;
    padding: 0 var(--sp-5);
    border-bottom: 1px solid var(--n-700);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}
.sidebar-brand span {
    font-size: var(--fs-md);
    font-weight: var(--fw-semi);
    color: var(--n-0);
    letter-spacing: -0.01em;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-4) var(--sp-3);
}

.nav-group {
    margin-bottom: var(--sp-6);
}
.nav-group-label {
    font-size: var(--fs-2xs);
    font-weight: var(--fw-semi);
    color: var(--n-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0 var(--sp-3);
    margin-bottom: var(--sp-2);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    width: 100%;
    padding: 9px var(--sp-3);
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    color: var(--n-400);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all var(--dur-fast);
    margin-bottom: 2px;
    text-align: left;
    position: relative;
    min-height: 40px;
}
.nav-link svg { opacity: 0.65; flex-shrink: 0; }
.nav-link:hover { background: rgba(255,255,255,0.06); color: var(--n-200); }
.nav-link:hover svg { opacity: 0.85; }

.nav-link.active {
    background: var(--brand-500);
    color: #fff;
}
.nav-link.active svg { opacity: 1; stroke: #fff; }

.nav-badge {
    margin-left: auto;
    font-size: var(--fs-2xs);
    font-weight: var(--fw-semi);
    background: var(--danger-500);
    color: #fff;
    padding: 1px 7px;
    border-radius: var(--r-full);
    line-height: 1.4;
}

.sidebar-bottom {
    padding: var(--sp-3);
    border-top: 1px solid var(--n-700);
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
}
.sidebar-link-ext, .sidebar-logout {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--fs-sm);
    color: var(--n-400);
    border-radius: var(--r-sm);
    transition: all var(--dur-fast);
    text-align: left;
    width: 100%;
}
.sidebar-link-ext:hover, .sidebar-logout:hover { background: rgba(255,255,255,0.06); color: var(--n-200); }
.sidebar-logout { color: var(--danger-500); }
.sidebar-logout:hover { background: rgba(239,68,68,0.08); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.5);
    z-index: 199;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }


/* ================================================================
   9. MAIN AREA
   ================================================================ */
.main-area {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ─── Top Header ─── */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-h);
    background: rgba(248,250,252,0.88);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--n-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--sp-6);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}
.header-menu { display: none; }
.header-title {
    font-size: var(--fs-lg);
    font-weight: var(--fw-semi);
    color: var(--n-900);
    letter-spacing: -0.02em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
}

.header-status {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-1) var(--sp-3);
    background: var(--success-50);
    border: 1px solid var(--success-100);
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    color: var(--success-600);
}
.status-dot {
    width: 7px;
    height: 7px;
    background: var(--success-500);
    border-radius: 50%;
    animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.header-avatar {
    width: 34px;
    height: 34px;
    background: var(--brand-500);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
}


/* ─── Content Scroll ─── */
.content-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}


/* ================================================================
   10. PAGES
   ================================================================ */
.page {
    display: none;
    padding: var(--sp-6);
    animation: pageIn 0.3s var(--ease-out);
}
.page.active { display: block; }

@keyframes pageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-intro {
    margin-bottom: var(--sp-6);
}
.page-heading {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-extra);
    color: var(--n-900);
    letter-spacing: -0.03em;
    line-height: 1.2;
}
.page-sub {
    font-size: var(--fs-base);
    color: var(--n-500);
    margin-top: var(--sp-1);
}


/* ================================================================
   11. DASHBOARD — METRIC CARDS
   ================================================================ */
.metric-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-3);
    margin-bottom: var(--sp-6);
}

.metric-card {
    background: var(--n-0);
    border: 1px solid var(--n-200);
    border-radius: var(--r-lg);
    padding: var(--sp-4);
    box-shadow: var(--sh-xs);
    transition: box-shadow var(--dur-fast), transform var(--dur-fast);
}
.metric-card:active {
    transform: scale(0.98);
}

.metric-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-2);
}
.metric-label {
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    color: var(--n-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.metric-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
}
.metric-icon-blue   { background: var(--brand-50); color: var(--brand-500); }
.metric-icon-green  { background: var(--success-50); color: var(--success-500); }
.metric-icon-amber  { background: var(--amber-50); color: var(--amber-500); }
.metric-icon-purple { background: var(--purple-50); color: var(--purple-500); }

.metric-value {
    font-size: var(--fs-3xl);
    font-weight: var(--fw-extra);
    color: var(--n-900);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: var(--sp-2);
    font-variant-numeric: tabular-nums;
}

.metric-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
}
.metric-change.positive { color: var(--success-600); }
.metric-change.neutral  { color: var(--n-500); }


/* ================================================================
   12. DASHBOARD — QUICK ACTIONS
   ================================================================ */
.section-block {
    margin-bottom: var(--sp-6);
}
.section-title {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    color: var(--n-600);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--sp-3);
}

.qa-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-3);
}

.qa-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-4) var(--sp-2);
    background: var(--n-0);
    border: 1px solid var(--n-200);
    border-radius: var(--r-lg);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    color: var(--n-600);
    transition: all var(--dur-fast);
    min-height: 80px;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}
.qa-item:active { transform: scale(0.95); background: var(--n-50); }

.qa-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qa-label {
    line-height: 1.2;
}


/* ================================================================
   13. DASHBOARD — ACTIVITY FEED
   ================================================================ */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--n-200);
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--n-200);
}

.act-item {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--n-0);
}
.act-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}
.act-icon.blue   { background: var(--info-50);    color: var(--info-500); }
.act-icon.green  { background: var(--success-50); color: var(--success-500); }
.act-icon.amber  { background: var(--warning-50); color: var(--warning-500); }

.act-body { flex: 1; min-width: 0; }
.act-text {
    font-size: var(--fs-sm);
    color: var(--n-700);
    line-height: 1.4;
}
.act-text strong { font-weight: var(--fw-semi); color: var(--n-900); }
.act-time {
    font-size: var(--fs-2xs);
    color: var(--n-400);
    margin-top: 2px;
}


/* ================================================================
   14. DASHBOARD — MINI CHART
   ================================================================ */
.mini-chart-wrap {
    background: var(--n-0);
    border: 1px solid var(--n-200);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
}

.mini-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 120px;
    gap: var(--sp-2);
}

.mc-bar {
    flex: 1;
    height: var(--h);
    background: var(--brand-500);
    border-radius: var(--r-xs) var(--r-xs) 0 0;
    position: relative;
    min-height: 4px;
    transition: opacity var(--dur-fast);
    animation: barGrow 0.6s var(--ease-out) backwards;
}
.mc-bar:nth-child(1) { animation-delay: 0.05s; }
.mc-bar:nth-child(2) { animation-delay: 0.1s; }
.mc-bar:nth-child(3) { animation-delay: 0.15s; }
.mc-bar:nth-child(4) { animation-delay: 0.2s; }
.mc-bar:nth-child(5) { animation-delay: 0.25s; }
.mc-bar:nth-child(6) { animation-delay: 0.3s; }
.mc-bar:nth-child(7) { animation-delay: 0.35s; }

@keyframes barGrow {
    from { height: 0; }
}

.mc-bar::after {
    content: attr(data-day);
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--fs-2xs);
    color: var(--n-400);
    white-space: nowrap;
}
.mc-bar:active { opacity: 0.7; }


/* ================================================================
   15. ORDERS — CARD LIST (Mobile-first)
   ================================================================ */
.toolbar-wrap {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}
.toolbar-row {
    display: flex;
    gap: var(--sp-3);
}
.toolbar-row .select-input { flex: 1; }

.orders-card-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.order-card {
    background: var(--n-0);
    border: 1px solid var(--n-200);
    border-radius: var(--r-lg);
    padding: var(--sp-4);
    transition: box-shadow var(--dur-fast);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.order-card:active { background: var(--n-50); }

.oc-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--sp-2);
}
.oc-name { font-weight: var(--fw-semi); color: var(--n-900); }
.oc-date { font-size: var(--fs-xs); color: var(--n-400); }

.oc-mid {
    display: flex;
    gap: var(--sp-4);
    margin-bottom: var(--sp-3);
    font-size: var(--fs-sm);
    color: var(--n-500);
}

.oc-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    border-radius: var(--r-full);
    text-transform: capitalize;
}
.badge-new       { background: var(--info-50);    color: #1d4ed8; }
.badge-contacted { background: var(--warning-50); color: var(--warning-600); }
.badge-confirmed { background: var(--success-50); color: var(--success-600); }
.badge-delivered { background: var(--n-100);      color: var(--n-600); }

.oc-actions {
    display: flex;
    gap: var(--sp-1);
}

.empty-state {
    display: none;
    text-align: center;
    padding: var(--sp-12) var(--sp-6);
}
.empty-state.show { display: block; }
.empty-icon { color: var(--n-300); margin-bottom: var(--sp-4); }
.empty-state h4 { font-size: var(--fs-md); color: var(--n-700); margin-bottom: var(--sp-1); }
.empty-state p { font-size: var(--fs-sm); color: var(--n-500); }


/* ================================================================
   16. PRODUCTS
   ================================================================ */
.product-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

.prod-card {
    background: var(--n-0);
    border: 1px solid var(--n-200);
    border-radius: var(--r-lg);
    overflow: hidden;
}

.pc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-3) var(--sp-4);
    background: var(--n-25);
    border-bottom: 1px solid var(--n-200);
}
.pc-badge {
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    color: var(--brand-500);
    background: var(--brand-50);
    padding: 3px 10px;
    border-radius: var(--r-full);
}

.pc-body { padding: var(--sp-4); }
.pc-footer {
    padding: var(--sp-3) var(--sp-4);
    border-top: 1px solid var(--n-200);
}


/* ================================================================
   17. DELIVERY ZONES
   ================================================================ */
.panel {
    background: var(--n-0);
    border: 1px solid var(--n-200);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    margin-bottom: var(--sp-4);
}

.add-bar {
    display: flex;
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
}
.add-bar .text-input { flex: 1; }

.city-grid {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    margin-bottom: var(--sp-5);
}

.city-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-3) var(--sp-4);
    background: var(--n-25);
    border: 1px solid var(--n-150);
    border-radius: var(--r-md);
    min-height: 50px;
    transition: border-color var(--dur-fast);
}
.city-row.active { border-color: var(--success-500); background: var(--success-50); }

.cr-left {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}
.cr-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--n-300);
    flex-shrink: 0;
}
.city-row.active .cr-dot {
    background: var(--success-500);
    box-shadow: 0 0 0 3px var(--success-100);
}
.cr-name {
    font-weight: var(--fw-medium);
    color: var(--n-800);
}

.cr-right {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.city-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-6);
    padding: var(--sp-4);
    background: var(--n-50);
    border-radius: var(--r-md);
}
.cs-item { text-align: center; }
.cs-num {
    display: block;
    font-size: var(--fs-2xl);
    font-weight: var(--fw-extra);
    color: var(--brand-500);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.cs-label {
    font-size: var(--fs-xs);
    color: var(--n-500);
    margin-top: 4px;
}
.cs-divider {
    width: 1px;
    height: 40px;
    background: var(--n-200);
}


/* ================================================================
   18. REVIEWS
   ================================================================ */
.review-grid {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

.rev-card {
    background: var(--n-0);
    border: 1px solid var(--n-200);
    border-radius: var(--r-lg);
    padding: var(--sp-4);
}

.rev-top {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-3);
}
.rev-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--brand-500);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--fw-semi);
    font-size: var(--fs-sm);
    flex-shrink: 0;
}
.rev-info { flex: 1; min-width: 0; }
.rev-name { font-weight: var(--fw-semi); color: var(--n-900); font-size: var(--fs-base); }
.rev-role { font-size: var(--fs-xs); color: var(--n-500); }

.rev-stars {
    color: var(--warning-500);
    font-size: var(--fs-sm);
    letter-spacing: 2px;
    margin-bottom: var(--sp-2);
}
.rev-text {
    font-size: var(--fs-sm);
    color: var(--n-600);
    line-height: 1.6;
    margin-bottom: var(--sp-3);
}
.rev-actions {
    display: flex;
    gap: var(--sp-2);
    justify-content: flex-end;
}


/* ================================================================
   19. FAQ
   ================================================================ */
.faq-items {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.faq-card {
    background: var(--n-0);
    border: 1px solid var(--n-200);
    border-radius: var(--r-lg);
    padding: var(--sp-4);
}
.faq-q {
    font-weight: var(--fw-semi);
    color: var(--n-900);
    font-size: var(--fs-base);
    margin-bottom: var(--sp-2);
    line-height: 1.4;
}
.faq-a {
    font-size: var(--fs-sm);
    color: var(--n-500);
    line-height: 1.5;
    margin-bottom: var(--sp-3);
}
.faq-actions {
    display: flex;
    gap: var(--sp-2);
    justify-content: flex-end;
}


/* ================================================================
   20. BANNER / ANNOUNCEMENT
   ================================================================ */
.banner-preview {
    padding: var(--sp-3) var(--sp-4);
    background: var(--brand-500);
    color: #fff;
    text-align: center;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    border-radius: var(--r-md);
    margin-bottom: var(--sp-5);
}

.theme-swatches {
    display: flex;
    gap: var(--sp-3);
}
.swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform var(--dur-fast), border-color var(--dur-fast);
    -webkit-tap-highlight-color: transparent;
}
.swatch.active { border-color: var(--n-900); transform: scale(1.15); }
.swatch:active { transform: scale(0.9); }


/* ================================================================
   21. HERO EDITOR
   ================================================================ */
.divider {
    border: none;
    border-top: 1px solid var(--n-200);
    margin: var(--sp-5) 0;
}

.sub-title {
    font-size: var(--fs-base);
    font-weight: var(--fw-semi);
    color: var(--n-800);
    margin-bottom: var(--sp-3);
}

.stats-editor {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}
.se-row {
    display: grid;
    grid-template-columns: 70px 60px 1fr;
    gap: var(--sp-2);
}

.panel-footer {
    margin-top: var(--sp-5);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--n-200);
}


/* ================================================================
   22. ANALYTICS
   ================================================================ */
.analytics-cards {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

.chart-wrap {
    height: 200px;
    position: relative;
}
.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 100%;
    gap: var(--sp-2);
    padding-bottom: 28px;
}
.bc-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    gap: var(--sp-2);
}
.bc-bar {
    width: 100%;
    height: var(--h);
    background: var(--brand-500);
    border-radius: var(--r-xs) var(--r-xs) 0 0;
    min-height: 4px;
    transition: opacity var(--dur-fast);
}
.bc-bar:active { opacity: 0.7; }
.bc-col span {
    font-size: var(--fs-2xs);
    color: var(--n-400);
}

.location-bars, .interest-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.loc-row, .interest-row {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}
.loc-name { width: 70px; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--n-700); }
.loc-track, .int-bar-track {
    flex: 1;
    height: 6px;
    background: var(--n-100);
    border-radius: 3px;
    overflow: hidden;
}
.loc-fill {
    height: 100%;
    background: var(--brand-500);
    border-radius: 3px;
    transition: width 0.8s var(--ease-out);
}
.loc-val { font-size: var(--fs-sm); font-weight: var(--fw-semi); color: var(--n-500); width: 28px; text-align: right; }

.int-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.int-name { width: 60px; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--n-700); }
.int-bar-fill { height: 100%; border-radius: 3px; }
.int-pct { font-size: var(--fs-sm); font-weight: var(--fw-semi); color: var(--n-500); width: 36px; text-align: right; }


/* ================================================================
   23. SETTINGS
   ================================================================ */
.settings-panels {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}


/* ================================================================
   24. MODALS (Mobile Bottom Sheet Style)
   ================================================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 500;
    padding: 0;
}
.modal-backdrop.show {
    display: flex;
}

.modal-sheet {
    width: 100%;
    max-width: 500px;
    max-height: 92vh;
    background: var(--n-0);
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    display: flex;
    flex-direction: column;
    animation: sheetUp 0.35s var(--ease-out);
    overflow: hidden;
}

@keyframes sheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-handle {
    width: 36px;
    height: 4px;
    background: var(--n-300);
    border-radius: 2px;
    margin: var(--sp-3) auto var(--sp-1);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-3) var(--sp-5);
    border-bottom: 1px solid var(--n-200);
}
.modal-head h3 {
    font-size: var(--fs-lg);
    font-weight: var(--fw-semi);
    color: var(--n-900);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-5);
    -webkit-overflow-scrolling: touch;
}

.modal-foot {
    display: flex;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-5);
    padding-bottom: calc(var(--sp-4) + var(--safe-bottom));
    border-top: 1px solid var(--n-200);
    background: var(--n-25);
}


/* ================================================================
   25. TOAST NOTIFICATIONS
   ================================================================ */
.toast-stack {
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
    width: calc(100% - 32px);
    max-width: 360px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--n-900);
    color: var(--n-0);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-xl);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    width: 100%;
    pointer-events: auto;
    animation: toastIn 0.35s var(--ease-out);
}
.toast.success .t-icon { color: var(--success-500); }
.toast.error   .t-icon { color: var(--danger-500); }
.toast.warning .t-icon { color: var(--warning-500); }
.toast.info    .t-icon { color: var(--info-500); }

.toast.out { animation: toastOut 0.25s ease forwards; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(16px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateY(-8px) scale(0.95); }
}


/* ================================================================
   26. MOBILE BOTTOM NAVIGATION
   ================================================================ */
.bottom-nav {
    display: none; /* Shown via media query */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-h);
    padding-bottom: var(--safe-bottom);
    background: var(--n-0);
    border-top: 1px solid var(--n-200);
    z-index: 100;
    justify-content: space-around;
    align-items: center;
}

.bn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: var(--sp-2);
    min-width: 60px;
    color: var(--n-400);
    font-size: 10px;
    font-weight: var(--fw-medium);
    transition: color var(--dur-fast);
    -webkit-tap-highlight-color: transparent;
    position: relative;
}
.bn-item svg { transition: transform var(--dur-fast); }
.bn-item:active svg { transform: scale(0.85); }
.bn-item.active { color: var(--brand-500); }

.bn-badge {
    position: absolute;
    top: 2px;
    right: 10px;
    font-size: 9px;
    font-weight: var(--fw-bold);
    background: var(--danger-500);
    color: #fff;
    padding: 0 5px;
    border-radius: var(--r-full);
    min-width: 16px;
    text-align: center;
    line-height: 16px;
}


/* ================================================================
   27. RESPONSIVE — MOBILE FIRST
   ================================================================ */

/* ─── Up to 640px (Phone) ─── */
@media (max-width: 640px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }

    .main-area {
        margin-left: 0;
        padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom));
    }

    /* Top Header — Mobile Clean & Spacious */
    .app-header {
        height: 54px;
        padding: 0 12px;
    }
    .header-left {
        gap: 8px;
        flex: 1;
        min-width: 0;
    }
    .header-menu { display: flex; }
    .header-title {
        font-size: 15px;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .header-subtitle {
        display: none !important;
    }
    .header-right {
        gap: 6px;
    }
    .sync-badge-pill {
        display: none !important;
    }
    .header-preview-btn {
        display: none !important;
    }
    .header-site-btn {
        padding: 6px 8px;
        min-height: 34px;
        font-size: 12px;
    }
    .header-site-btn span {
        display: none !important;
    }
    .header-avatar {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }
    .header-logout-mobile {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border-radius: 8px;
        background: rgba(239, 68, 68, 0.1);
        color: var(--danger-500);
    }

    /* Content & Typography */
    .page { padding: 12px; }
    .page-intro {
        margin-bottom: 10px;
    }
    .intro-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .page-heading {
        font-size: 18px !important;
        margin-bottom: 2px;
    }
    .page-sub {
        display: none !important;
    }
    .intro-time-badge {
        font-size: 10px;
        padding: 2px 7px;
    }

    .content-scroll {
        padding-bottom: var(--sp-4);
    }

    /* Metric Cards 2x2 Grid Compact */
    .metric-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 12px;
    }
    .metric-card {
        padding: 10px 10px 8px;
        border-radius: 12px;
    }
    .metric-top {
        margin-bottom: 4px;
    }
    .metric-label {
        font-size: 9px !important;
        letter-spacing: 0.02em;
    }
    .metric-icon-wrap {
        width: 26px;
        height: 26px;
    }
    .metric-icon-wrap svg {
        width: 14px;
        height: 14px;
    }
    .metric-value {
        font-size: 18px !important;
        line-height: 1.2;
        margin-bottom: 2px;
    }
    .metric-change {
        font-size: 9px !important;
    }

    /* Plant Purity Banner Compact */
    .plant-status-banner {
        padding: 10px 12px;
        border-radius: 12px;
        margin-bottom: 12px;
    }
    .psb-title {
        font-size: 12px;
    }
    .psb-desc {
        display: none !important;
    }
    .psb-stats {
        margin-top: 6px;
        gap: 4px;
        flex-wrap: wrap;
    }
    .psb-chip {
        font-size: 10px;
        padding: 2px 6px;
    }

    /* Quick Actions */
    .qa-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .qa-item { padding: 8px 4px; min-height: 60px; border-radius: 10px; }
    .qa-icon { width: 32px; height: 32px; }
    .qa-label { font-size: 11px; }

    /* Fleet Cards */
    .fleet-card {
        padding: 12px;
        border-radius: 12px;
    }
    .fc-title {
        font-size: 13px;
    }
    .fc-driver {
        font-size: 11px;
    }
    .fc-actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    /* Financials & Billing Cards */
    .fin-metrics-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    .fin-card {
        padding: 10px !important;
        border-radius: 12px !important;
    }
    .fin-label {
        font-size: 10px !important;
    }
    .fin-val {
        font-size: 18px !important;
    }
    .fin-sub {
        font-size: 9px !important;
    }

    /* Bottom Navigation Bar */
    .bottom-nav {
        display: flex;
        height: 56px;
        padding: 4px 4px calc(4px + var(--safe-bottom));
    }
    .bn-item {
        font-size: 10px;
        gap: 2px;
    }
    .bn-item svg {
        width: 18px;
        height: 18px;
    }

    .se-row {
        grid-template-columns: 60px 50px 1fr;
    }

    .field-row-2 {
        flex-direction: column;
        gap: 0;
    }

    .toolbar-row {
        flex-direction: column;
    }

    .modal-sheet {
        max-height: 90vh;
        border-radius: var(--r-xl) var(--r-xl) 0 0;
    }

    .toast-stack {
        bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 8px);
    }
}


/* ─── 641px to 1024px (Tablet) ─── */
@media (min-width: 641px) and (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }

    .main-area {
        margin-left: 0;
    }

    .header-menu { display: flex; }
    .bottom-nav { display: none; }

    .page { padding: var(--sp-6); }

    .metric-row {
        grid-template-columns: repeat(4, 1fr);
    }

    .qa-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .review-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .analytics-cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .settings-panels {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .product-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-sheet {
        max-width: 500px;
        border-radius: var(--r-xl);
        margin-bottom: var(--sp-5);
    }
    .modal-backdrop {
        align-items: center;
    }
}


/* ─── 1025px+ (Desktop) ─── */
@media (min-width: 1025px) {
    .sidebar {
        transform: translateX(0);
    }

    .main-area {
        margin-left: var(--sidebar-w);
    }

    .header-menu { display: none; }
    .bottom-nav { display: none; }

    .page {
        padding: var(--sp-8);
        max-width: 1100px;
    }

    .metric-row {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--sp-4);
    }
    .metric-value { font-size: var(--fs-3xl); }

    .qa-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: var(--sp-4);
    }

    .review-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .product-list {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .analytics-cards {
        display: grid;
        grid-template-columns: 2fr 1fr;
    }

    .settings-panels {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-backdrop {
        align-items: center;
    }
    .modal-sheet {
        border-radius: var(--r-xl);
    }

    .toast-stack {
        bottom: 24px;
        left: auto;
        right: 24px;
        transform: none;
    }
}


/* ================================================================
   13. ENTERPRISE SUITE: SUBSCRIPTIONS, QC, FLEET, INVENTORY, FINANCIALS
   ================================================================ */

/* ─── DYNAMIC COLOR THEME ACCENTS ─── */
[data-admin-theme="emerald"] {
    --brand-50:  #ecfdf5;
    --brand-100: #d1fae5;
    --brand-200: #a7f3d0;
    --brand-400: #34d399;
    --brand-500: #10b981;
    --brand-600: #059669;
    --brand-700: #047857;
    --brand-900: #064e3b;
}

[data-admin-theme="violet"] {
    --brand-50:  #f5f3ff;
    --brand-100: #ede9fe;
    --brand-200: #ddd6fe;
    --brand-400: #a78bfa;
    --brand-500: #8b5cf6;
    --brand-600: #7c3aed;
    --brand-700: #6d28d9;
    --brand-900: #4c1d95;
}

[data-admin-theme="amber"] {
    --brand-50:  #fffbeb;
    --brand-100: #fef3c7;
    --brand-200: #fde68a;
    --brand-400: #fbbf24;
    --brand-500: #f59e0b;
    --brand-600: #d97706;
    --brand-700: #b45309;
    --brand-900: #78350f;
}

[data-admin-theme="cyber"] {
    --brand-50:  #ecfeff;
    --brand-100: #cffafe;
    --brand-200: #a5f3fc;
    --brand-400: #22d3ee;
    --brand-500: #06b6d4;
    --brand-600: #0891b2;
    --brand-700: #0e7490;
    --brand-900: #164e63;
}

/* ─── VIBRANT METRIC CARD GLOWS ─── */
.card-glow-blue {
    border-left: 4px solid #4f6ef7;
    transition: transform var(--t-normal), box-shadow var(--t-normal), border-color var(--t-normal);
}
.card-glow-blue:hover {
    box-shadow: 0 10px 24px -5px rgba(79, 110, 247, 0.25);
    transform: translateY(-2px);
    cursor: pointer;
}

.card-glow-cyan {
    border-left: 4px solid #00d2ff;
    transition: transform var(--t-normal), box-shadow var(--t-normal);
}
.card-glow-cyan:hover {
    box-shadow: 0 10px 24px -5px rgba(0, 210, 255, 0.25);
    transform: translateY(-2px);
    cursor: pointer;
}

.card-glow-green {
    border-left: 4px solid #10b981;
    transition: transform var(--t-normal), box-shadow var(--t-normal);
}
.card-glow-green:hover {
    box-shadow: 0 10px 24px -5px rgba(16, 185, 129, 0.25);
    transform: translateY(-2px);
    cursor: pointer;
}

.card-glow-purple {
    border-left: 4px solid #8b5cf6;
    transition: transform var(--t-normal), box-shadow var(--t-normal);
}
.card-glow-purple:hover {
    box-shadow: 0 10px 24px -5px rgba(139, 92, 246, 0.25);
    transform: translateY(-2px);
    cursor: pointer;
}

.metric-icon-cyan {
    background: #ecfeff;
    color: #06b6d4;
}

.text-cyan { color: #0891b2 !important; }
.text-emerald { color: #059669 !important; }
.text-purple { color: #7c3aed !important; }
.text-amber { color: #d97706 !important; }

.bg-cyan { background: #06b6d4 !important; }
.bg-emerald { background: #10b981 !important; }
.bg-purple { background: #8b5cf6 !important; }
.bg-amber { background: #f59e0b !important; }

.bg-cyan-subtle { background: #ecfeff; color: #0891b2; }
.bg-green-subtle { background: #ecfdf5; color: #059669; }
.bg-purple-subtle { background: #f5f3ff; color: #7c3aed; }
.bg-amber-subtle { background: #fffbeb; color: #d97706; }
.bg-blue-subtle { background: #eff6ff; color: #2563eb; }
.bg-rose-subtle { background: #fff1f2; color: #e11d48; }

.badge-cyan { background: #ecfeff; color: #0891b2; }
.badge-green { background: #ecfdf5; color: #059669; }
.badge-purple { background: #f5f3ff; color: #7c3aed; }
.badge-amber { background: #fffbeb; color: #d97706; }

.unit-sub {
    font-size: var(--fs-sm);
    color: var(--n-500);
    font-weight: var(--fw-medium);
}

.badge-pill-inline {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--r-full);
    font-size: var(--fs-2xs);
    font-weight: var(--fw-semi);
}

/* ─── HEADER & INTRO ENHANCEMENTS ─── */
.header-subtitle {
    font-size: var(--fs-2xs);
    color: var(--n-500);
    margin-top: 1px;
}
.quick-plant-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    background: var(--n-100);
    padding: 6px 12px;
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
    color: var(--n-700);
}
.intro-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--sp-4);
    flex-wrap: wrap;
}
.intro-time-badge {
    background: var(--brand-50);
    color: var(--brand-600);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    padding: 6px 12px;
    border-radius: var(--r-full);
    border: 1px solid var(--brand-200);
}

/* ─── PLANT LIVE STATUS BANNER ─── */
.plant-status-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #0a1628 0%, #1e293b 100%);
    border-radius: var(--r-lg);
    padding: var(--sp-5) var(--sp-6);
    color: var(--n-0);
    box-shadow: 0 8px 20px rgba(10, 22, 40, 0.15);
    flex-wrap: wrap;
    gap: var(--sp-4);
}
.psb-left {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
}
.psb-pulse {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: psbPulse 1.8s infinite;
}
@keyframes psbPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.psb-title {
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    color: #ffffff;
    margin-bottom: 2px;
}
.psb-desc {
    font-size: var(--fs-xs);
    color: #94a3b8;
}
.psb-stats {
    display: flex;
    gap: var(--sp-3);
    flex-wrap: wrap;
}
.psb-chip {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 12px;
    border-radius: var(--r-md);
    font-size: var(--fs-xs);
    display: flex;
    align-items: center;
    gap: 6px;
}
.psb-k { color: #94a3b8; }

/* ─── DUAL COLUMN DASHBOARD ─── */
.dash-two-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-5);
}
@media (min-width: 900px) {
    .dash-two-col {
        grid-template-columns: 1fr 1fr;
    }
}
.dash-route-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    margin-top: var(--sp-3);
}
.droute-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-3);
    background: var(--n-50);
    border: 1px solid var(--n-200);
    border-radius: var(--r-md);
}
.droute-left {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}
.droute-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--r-md);
    background: #ecfeff;
    color: #0891b2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.droute-title {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    color: var(--n-800);
}
.droute-sub {
    font-size: var(--fs-xs);
    color: var(--n-500);
}

/* ─── SUBSCRIPTIONS MODULE ─── */
.sub-metrics-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-3);
}
@media (min-width: 768px) {
    .sub-metrics-row {
        grid-template-columns: repeat(4, 1fr);
    }
}
.sm-card {
    background: var(--n-0);
    border: 1px solid var(--n-200);
    border-radius: var(--r-lg);
    padding: var(--sp-4);
    box-shadow: var(--sh-sm);
}
.sm-label {
    font-size: var(--fs-xs);
    color: var(--n-500);
    font-weight: var(--fw-medium);
    display: block;
    margin-bottom: 4px;
}
.sm-val {
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
}

.subs-grid-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-4);
}
@media (min-width: 768px) {
    .subs-grid-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}
.sub-item-card {
    background: var(--n-0);
    border: 1px solid var(--n-200);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    box-shadow: var(--sh-sm);
    transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.sub-item-card:hover {
    box-shadow: var(--sh-md);
    border-color: var(--brand-300, #a5b4fc);
}
.sic-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--sp-3);
}
.sic-name {
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    color: var(--n-900);
}
.sic-phone {
    font-size: var(--fs-xs);
    color: var(--n-500);
}
.sic-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: var(--sp-4);
    padding: var(--sp-3);
    background: var(--n-50);
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
}
.sic-row {
    display: flex;
    justify-content: space-between;
    color: var(--n-700);
}
.sic-row strong { color: var(--n-900); }
.sic-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-2);
}

/* ─── QUALITY CONTROL (QC) GAUGES ─── */
.qc-gauges-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-4);
}
@media (min-width: 900px) {
    .qc-gauges-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
.qc-gauge-card {
    background: var(--n-0);
    border: 1px solid var(--n-200);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    box-shadow: var(--sh-sm);
}
.qc-gauge-card.border-cyan { border-top: 4px solid #06b6d4; }
.qc-gauge-card.border-green { border-top: 4px solid #10b981; }
.qc-gauge-card.border-purple { border-top: 4px solid #8b5cf6; }
.qc-gauge-card.border-emerald { border-top: 4px solid #059669; }

.qg-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--fs-xs);
    color: var(--n-500);
    font-weight: var(--fw-semi);
    margin-bottom: var(--sp-2);
}
.qg-val {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-extra);
    letter-spacing: -0.02em;
    margin-bottom: var(--sp-3);
}
.qg-unit {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--n-500);
}
.qg-bar-track {
    width: 100%;
    height: 8px;
    background: var(--n-150);
    border-radius: var(--r-full);
    overflow: hidden;
    margin-bottom: var(--sp-2);
}
.qg-bar-fill {
    height: 100%;
    border-radius: var(--r-full);
    transition: width 0.6s ease;
}
.qg-meta {
    font-size: var(--fs-2xs);
    color: var(--n-500);
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
    text-align: left;
}
.table-wrap th {
    padding: var(--sp-3) var(--sp-4);
    background: var(--n-50);
    color: var(--n-600);
    font-weight: var(--fw-semi);
    border-bottom: 1px solid var(--n-200);
}
.table-wrap td {
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--n-150);
    color: var(--n-800);
}
.table-wrap tr:hover td {
    background: var(--n-25);
}

/* ─── BOTTLE STOCK & INVENTORY ─── */
.jar-ecosystem-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-4);
}
@media (min-width: 900px) {
    .jar-ecosystem-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
.jec-card {
    background: var(--n-0);
    border: 1px solid var(--n-200);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    box-shadow: var(--sh-sm);
}
.jec-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.jec-label {
    font-size: var(--fs-xs);
    color: var(--n-500);
    font-weight: var(--fw-medium);
}
.jec-value {
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
    margin: 2px 0;
}
.jec-meta {
    font-size: var(--fs-2xs);
    color: var(--n-400);
}

.stock-item-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}
.sil-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-3);
    background: var(--n-50);
    border: 1px solid var(--n-200);
    border-radius: var(--r-md);
}
.sil-info h4 {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    color: var(--n-900);
}
.sil-info p {
    font-size: var(--fs-xs);
    color: var(--n-500);
}
.sil-count {
    text-align: right;
}
.sil-num {
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    color: var(--n-900);
}

.consumable-bars {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}
.cbar-row .cbar-label {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-xs);
    color: var(--n-700);
    margin-bottom: 6px;
}
.cbar-row .cbar-track {
    width: 100%;
    height: 8px;
    background: var(--n-150);
    border-radius: var(--r-full);
    overflow: hidden;
}
.cbar-row .cbar-fill {
    height: 100%;
    border-radius: var(--r-full);
}

/* ─── FLEET & ROUTE DISPATCH ─── */
.fleet-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-5);
}
@media (min-width: 768px) {
    .fleet-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.fleet-card {
    background: var(--n-0);
    border: 1px solid var(--n-200);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    box-shadow: var(--sh-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--sp-4);
}
.fc-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.fc-title {
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    color: var(--n-900);
}
.fc-driver {
    font-size: var(--fs-sm);
    color: var(--n-600);
    margin-top: 2px;
}
.fc-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-3);
    background: var(--n-50);
    padding: var(--sp-3);
    border-radius: var(--r-md);
}
.fcd-item .fcd-k {
    font-size: var(--fs-2xs);
    color: var(--n-500);
}
.fcd-item .fcd-v {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    color: var(--n-900);
}
.fc-actions {
    display: flex;
    gap: var(--sp-2);
    align-items: center;
}

/* ─── FINANCIAL LEDGER & INVOICES ─── */
.fin-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-4);
}
@media (min-width: 900px) {
    .fin-metrics-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
.fin-card {
    background: var(--n-0);
    border: 1px solid var(--n-200);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    box-shadow: var(--sh-sm);
}
.fin-label {
    font-size: var(--fs-xs);
    color: var(--n-500);
    font-weight: var(--fw-medium);
}
.fin-val {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-extra);
    margin: 4px 0;
}
.fin-sub {
    font-size: var(--fs-2xs);
    color: var(--n-500);
}

.invoice-box {
    background: #ffffff;
    padding: var(--sp-6);
    border: 1px solid var(--n-200);
    border-radius: var(--r-lg);
    color: #1e293b;
    box-shadow: var(--sh-sm);
    position: relative;
    overflow: hidden;
}
.invoice-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 6px;
    background: linear-gradient(90deg, #00d2ff, #4f6ef7);
}
.ib-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--sp-4);
}
.ib-brand {
    font-size: var(--fs-xl);
    font-weight: var(--fw-extra);
    color: #0a1628;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ib-sub {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    color: #4f6ef7;
}
.ib-addr {
    font-size: var(--fs-xs);
    color: #64748b;
    margin-top: 4px;
}
.ib-inv-num {
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    color: #0a1628;
}
.ib-date {
    font-size: var(--fs-xs);
    color: #64748b;
    margin-bottom: 8px;
}
.inv-table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
}
.inv-table th, .inv-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--n-200);
    text-align: left;
    font-size: var(--fs-sm);
}
.inv-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: var(--fw-semi);
}
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--n-200);
    border-radius: var(--r-md);
    margin-bottom: var(--sp-4);
}
.ib-totals {
    margin-left: auto;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: var(--sp-4);
    padding-top: var(--sp-3);
    border-top: 1px solid var(--n-200);
}
.ib-total-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-sm);
}
.ib-grand {
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    padding-top: 6px;
    border-top: 2px solid var(--n-900);
}

/* ─── THEME PALETTES SELECTOR ─── */
.theme-palettes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-3);
}
@media (min-width: 600px) {
    .theme-palettes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (min-width: 900px) {
    .theme-palettes-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
.theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3);
    background: var(--n-50);
    border: 2px solid var(--n-200);
    border-radius: var(--r-lg);
    cursor: pointer;
    transition: all var(--t-fast);
}
.theme-btn:hover {
    border-color: var(--brand-400);
    transform: translateY(-2px);
}
.theme-btn.active {
    border-color: var(--brand-500);
    background: var(--brand-50);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.2);
}
.tb-preview {
    width: 100%;
    height: 36px;
    border-radius: var(--r-md);
}
.tb-name {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    color: var(--n-800);
    text-align: center;
}

/* ─── PRINT INVOICE ─── */
@media print {
    @page {
        margin: 0; /* This removes browser headers and footers */
    }
    body * {
        visibility: hidden;
    }
    #invoicePrintArea, #invoicePrintArea * {
        visibility: visible;
    }
    #invoicePrintArea {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 20mm; /* Add margin inside the content instead */
        box-shadow: none;
        border: none;
    }
    .invoice-box {
        box-shadow: none;
        border: none;
    }
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
