/* ==========================================================================
   Gold Jewellery Shop ERP - Luxury Design System
   Imperial Gold Jewellers • Enterprise Jewellery ERP System
   Palette: Regal 24K Gold, Obsidian Slate, Imperial Warm Ivory, Emerald, Ruby
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. COLOR PALETTES & DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root, [data-theme="dark"] {
    /* Brand Gold */
    --gold-primary: #E5C158;
    --gold-hover: #F3D368;
    --gold-dark: #D4AF37;
    --gold-deep: #A67C1E;
    --gold-light: rgba(229, 193, 88, 0.12);
    --gold-border: rgba(229, 193, 88, 0.28);
    --gold-glow: 0 0 20px rgba(229, 193, 88, 0.25);
    --gold-gradient: linear-gradient(135deg, #F3D368 0%, #D4AF37 50%, #A67C1E 100%);
    --gold-gradient-shimmer: linear-gradient(90deg, #996515 0%, #F5DC88 25%, #E5C158 50%, #996515 75%, #F5DC88 100%);

    /* Backgrounds & Surfaces */
    --bg-page: #090C12;
    --bg-card: #111622;
    --bg-surface: #171F30;
    --bg-alt: #1D263B;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(229, 193, 88, 0.4);
    --border-focus: #E5C158;

    /* Typography */
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-inverse: #090C12;
    --heading-color: #FFFFFF;

    /* Form Controls */
    --input-bg: #141B28;
    --input-border: rgba(255, 255, 255, 0.14);
    --input-text: #F8FAFC;
    --input-placeholder: #64748B;
    --input-focus-border: #E5C158;
    --input-focus-ring: rgba(229, 193, 88, 0.22);

    /* Status Colors */
    --red-alert: #F87171;
    --red-hover: #EF4444;
    --red-light: rgba(248, 113, 113, 0.14);
    --red-border: rgba(248, 113, 113, 0.35);

    --success: #34D399;
    --success-hover: #10B981;
    --success-light: rgba(52, 211, 153, 0.14);
    --success-border: rgba(52, 211, 153, 0.35);

    --warning: #FBBF24;
    --warning-light: rgba(251, 191, 36, 0.14);
    --warning-border: rgba(251, 191, 36, 0.35);

    --info: #60A5FA;
    --info-light: rgba(96, 165, 250, 0.14);
    --info-border: rgba(96, 165, 250, 0.35);

    /* Dark Mode Utility Aliases */
    --dark-primary: #090C12;
    --dark-secondary: #111622;
    --dark-muted: #8B949E;
    --dark-surface: #171F30;

    /* Shadows & Elevation */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.65);
    --shadow-gold: 0 4px 20px rgba(229, 193, 88, 0.2);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 9999px;

    /* Fonts */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="light"], html[data-theme="light"], body[data-theme="light"] {
    /* Brand Gold */
    --gold-primary: #B8860B;
    --gold-hover: #996515;
    --gold-dark: #7A5208;
    --gold-deep: #5E3D02;
    --gold-light: #FBF6E7;
    --gold-border: rgba(184, 134, 11, 0.3);
    --gold-glow: 0 0 20px rgba(184, 134, 11, 0.18);
    --gold-gradient: linear-gradient(135deg, #E5C158 0%, #B8860B 60%, #7A5208 100%);
    --gold-gradient-shimmer: linear-gradient(90deg, #996515 0%, #F5DC88 25%, #B8860B 50%, #996515 75%, #F5DC88 100%);

    /* Backgrounds & Surfaces */
    --bg-page: #F7F5EE;
    --bg-card: #FFFFFF;
    --bg-surface: #FAF8F2;
    --bg-alt: #F0EBE0;
    --border-color: #E2DBD0;
    --border-hover: #B8860B;
    --border-focus: #B8860B;

    /* Typography */
    --text-primary: #18181B;
    --text-secondary: #4B5563;
    --text-muted: #6B7280;
    --text-inverse: #FFFFFF;
    --heading-color: #111827;

    /* Form Controls */
    --input-bg: #FFFFFF;
    --input-border: #D1C7B7;
    --input-text: #18181B;
    --input-placeholder: #9CA3AF;
    --input-focus-border: #B8860B;
    --input-focus-ring: rgba(184, 134, 11, 0.2);

    /* Status Colors */
    --red-alert: #DC2626;
    --red-hover: #B91C1C;
    --red-light: #FEF2F2;
    --red-border: #FCA5A5;

    --success: #059669;
    --success-hover: #047857;
    --success-light: #ECFDF5;
    --success-border: #A7F3D0;

    --warning: #D97706;
    --warning-light: #FFFBEB;
    --warning-border: #FDE68A;

    --info: #2563EB;
    --info-light: #EFF6FF;
    --info-border: #BFDBFE;

    /* Dark Mode Utility Aliases (Light mode equivalents) */
    --dark-primary: #1F242E;
    --dark-secondary: #2C3340;
    --dark-muted: #64748B;
    --dark-surface: #F1EFE9;

    /* Shadows & Elevation */
    --shadow-sm: 0 1px 3px rgba(23, 23, 23, 0.05);
    --shadow-md: 0 4px 14px rgba(23, 23, 23, 0.08);
    --shadow-lg: 0 12px 30px rgba(23, 23, 23, 0.12);
    --shadow-gold: 0 4px 18px rgba(184, 134, 11, 0.15);
}

/* --------------------------------------------------------------------------
   2. GLOBAL RESETS & BASE STYLES
   -------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--heading-color);
    font-weight: 700;
    line-height: 1.25;
}

h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }

a {
    color: var(--gold-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--gold-hover);
}

/* Text helpers */
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold-primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--red-alert); }

/* --------------------------------------------------------------------------
   3. APP SHELL & SIDEBAR NAVIGATION
   -------------------------------------------------------------------------- */
#app-root {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar (Desktop) */
.sidebar {
    width: 256px;
    background: #090C12;
    color: #F8FAFC;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid rgba(229, 193, 88, 0.15);
    z-index: 100;
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    transition: width 0.25s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-top-fixed {
    flex-shrink: 0;
    background: #090C12;
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header {
    padding: 16px 16px 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-title {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #FFFFFF;
    line-height: 1.2;
    font-family: var(--font-heading);
}

.brand-subtitle {
    font-size: 11px;
    color: var(--gold-primary);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Sidebar User Panel (Fixed at top under brand header) */
.sidebar-user-panel {
    padding: 12px 14px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-logout-btn {
    width: 100%;
    color: #94A3B8;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: var(--radius-md);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.4);
    color: #F87171;
}



.sidebar-menu {
    list-style: none;
    padding: 12px 10px;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(229, 193, 88, 0.2) transparent;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(229, 193, 88, 0.2);
    border-radius: 4px;
}

.menu-item {
    margin-bottom: 5px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: #94A3B8;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: 1px solid transparent;
}

.menu-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #F8FAFC;
    transform: translateX(3px);
}

.menu-link.active {
    background: var(--gold-gradient);
    color: #090C12;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(229, 193, 88, 0.35);
    border-color: rgba(255, 255, 255, 0.2);
}

.menu-icon {
    font-size: 17px;
    width: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}



.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--gold-gradient);
    color: #090C12;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(229, 193, 88, 0.35);
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    color: #FFFFFF;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-role-tag {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--gold-primary);
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   4. TOP NAVBAR & HEADER COMPONENTS
   -------------------------------------------------------------------------- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-x: hidden;
}

.top-navbar {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.header-left-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Brand Header Badge */
.brand-header-badge,
.ttw-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: linear-gradient(135deg, rgba(229, 193, 88, 0.12) 0%, rgba(229, 193, 88, 0.04) 100%);
    border: 1px solid var(--gold-border);
    padding: 5px 13px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.25s ease;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.brand-header-badge:hover,
.ttw-header-badge:hover {
    border-color: var(--gold-primary);
    box-shadow: var(--gold-glow);
    transform: translateY(-1px);
}

.brand-header-logo,
.ttw-header-logo {
    width: 26px;
    height: 26px;
    object-fit: cover;
    border-radius: 50%;
    border: 1.5px solid var(--gold-primary);
    filter: drop-shadow(0 2px 4px rgba(229, 193, 88, 0.35));
}

.brand-header-text,
.ttw-header-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-header-title,
.ttw-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: 0.5px;
    color: var(--heading-color);
}

.brand-header-sub,
.ttw-sub {
    font-size: 9.5px;
    color: var(--gold-primary);
    font-weight: 700;
    letter-spacing: 0.75px;
}

/* Live Bullion Rates Ticker */
.gold-rates-ticker {
    display: flex;
    align-items: center;
    gap: 14px;
    background-color: var(--gold-light);
    border: 1px solid var(--gold-border);
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.gold-rates-ticker::-webkit-scrollbar {
    display: none;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.ticker-label {
    color: var(--gold-dark);
    font-weight: 600;
    font-size: 11.5px;
}

.ticker-value {
    color: var(--heading-color);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.ticker-divider {
    color: var(--gold-border);
    opacity: 0.6;
}

/* Topbar Actions Area */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Topbar Role Switcher */
.topbar-role-selector {
    display: flex;
    align-items: center;
    gap: 6px;
}

.role-selector-label {
    font-size: 11.5px;
    color: var(--text-secondary);
    font-weight: 600;
}

.role-select-dropdown {
    width: auto;
    font-size: 11.5px;
    padding: 5px 8px;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

/* Theme Toggle Button */
.btn-theme-toggle {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.btn-theme-toggle:hover {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
    transform: rotate(20deg) scale(1.05);
    box-shadow: var(--shadow-sm);
}

/* Mobile Hamburger Button */
.mobile-hamburger-btn {
    display: none;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.mobile-hamburger-btn:hover {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}

.mobile-drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* --------------------------------------------------------------------------
   5. LUXURY ANIMATED LOADERS (Top Bar, Badge & Gyroscope Centerpiece)
   -------------------------------------------------------------------------- */
/* Top Liquid Metallic Gold Bar */
#global-loader-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3.5px;
    width: 0%;
    background: var(--gold-gradient-shimmer);
    background-size: 200% 100%;
    animation: goldShimmer 2s infinite linear;
    z-index: 10000;
    box-shadow: 0 0 12px rgba(229, 193, 88, 0.9), 0 0 6px rgba(245, 220, 136, 0.7);
    transition: width 0.25s ease-out, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

#global-loader-bar.active {
    opacity: 1;
}

@keyframes goldShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Topbar Mini Loader Badge */
.loader-badge-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gold-primary);
    background: var(--gold-light);
    border: 1px solid var(--gold-border);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.25s ease;
    pointer-events: none;
}

.loader-badge-indicator.active {
    opacity: 1;
    transform: translateY(0);
}

.loader-badge-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid var(--gold-border);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: spinRing 0.75s infinite linear;
}

@keyframes spinRing {
    to { transform: rotate(360deg); }
}

/* Fullscreen / High-End Animated Luxury Gyroscope Loader Overlay */
.luxury-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 12, 18, 0.82);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
    pointer-events: none;
}

[data-theme="light"] .luxury-loader-overlay {
    background: rgba(247, 245, 238, 0.85);
}

.luxury-loader-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.luxury-loader-card {
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), var(--gold-glow);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 380px;
    position: relative;
    overflow: hidden;
    animation: loaderCardPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes loaderCardPop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.luxury-loader-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold-gradient-shimmer);
    background-size: 200% 100%;
    animation: goldShimmer 2s infinite linear;
}

/* Multi-Ring Rotating Gyroscope Spinner */
.luxury-gem-spinner {
    position: relative;
    width: 84px;
    height: 84px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
}

.ring-outer {
    width: 80px;
    height: 80px;
    border-top-color: var(--gold-primary);
    border-right-color: rgba(229, 193, 88, 0.4);
    animation: spinClockwise 1.8s infinite cubic-bezier(0.5, 0.1, 0.5, 0.9);
}

.ring-middle {
    width: 60px;
    height: 60px;
    border-bottom-color: #F5DC88;
    border-left-color: rgba(245, 220, 136, 0.3);
    animation: spinCounterClockwise 1.3s infinite cubic-bezier(0.5, 0.1, 0.5, 0.9);
}

.ring-inner {
    width: 42px;
    height: 42px;
    border-top-color: var(--gold-hover);
    border-left-color: rgba(229, 193, 88, 0.5);
    animation: spinClockwise 0.9s infinite linear;
}

.spinner-center-icon {
    font-size: 24px;
    animation: crownPulse 2s infinite ease-in-out;
    filter: drop-shadow(0 2px 8px rgba(229, 193, 88, 0.5));
}

.spinner-sparkle {
    position: absolute;
    font-size: 13px;
    color: #FDFBF7;
    text-shadow: 0 0 6px #F5DC88, 0 0 12px var(--gold-primary);
    animation: sparkleGlow 1.6s infinite ease-in-out;
}

.sparkle-1 { top: -4px; left: 34px; animation-delay: 0s; }
.sparkle-2 { bottom: -4px; left: 34px; animation-delay: 0.8s; }
.sparkle-3 { top: 34px; left: -4px; animation-delay: 0.4s; }
.sparkle-4 { top: 34px; right: -4px; animation-delay: 1.2s; }

@keyframes spinClockwise {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spinCounterClockwise {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

@keyframes crownPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 2px 8px rgba(229, 193, 88, 0.4)); }
    50% { transform: scale(1.18); filter: drop-shadow(0 4px 16px rgba(229, 193, 88, 0.8)); }
}

@keyframes sparkleGlow {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.3); }
}

.luxury-loader-brand {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: var(--heading-color);
    margin-bottom: 2px;
}

.luxury-loader-sub {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: var(--gold-primary);
    margin-bottom: 16px;
}

.luxury-loader-bar-wrap {
    width: 100%;
    height: 4px;
    background: var(--bg-surface);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

.luxury-loader-bar-fill {
    width: 45%;
    height: 100%;
    background: var(--gold-gradient-shimmer);
    background-size: 200% 100%;
    border-radius: var(--radius-pill);
    animation: loaderBarMove 1.5s infinite ease-in-out, goldShimmer 2s infinite linear;
}

@keyframes loaderBarMove {
    0% { transform: translateX(-100%); width: 30%; }
    50% { width: 70%; }
    100% { transform: translateX(350%); width: 30%; }
}

.luxury-loader-msg {
    font-size: 12.5px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   6. PAGE CONTAINERS, HEADERS & GRID
   -------------------------------------------------------------------------- */
.page-container {
    padding: 24px 28px;
    flex: 1;
    max-width: 1480px;
    width: 100%;
    margin: 0 auto;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 14px;
}

.page-title {
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--heading-color);
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 3px;
}

/* Cards & Grid Systems */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.metric-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md), var(--gold-glow);
    border-color: var(--gold-border);
}

.metric-card.alert-card {
    border-left: 4px solid var(--red-alert);
}

.metric-card.gold-card {
    border-left: 4px solid var(--gold-primary);
}

.metric-card.success-card {
    border-left: 4px solid var(--success);
}

.metric-label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-value {
    font-size: 25px;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--heading-color);
    margin: 8px 0 4px;
    letter-spacing: -0.3px;
    font-variant-numeric: tabular-nums;
}

.metric-value.red {
    color: var(--red-alert);
}

.metric-value.gold {
    color: var(--gold-primary);
}

.metric-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* Content Box / Panels */
.content-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--heading-color);
}

.card-body {
    padding: 20px;
}

/* --------------------------------------------------------------------------
   7. TABS NAVIGATION & PILLS
   -------------------------------------------------------------------------- */
.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    gap: 6px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}

.tab-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 9px 18px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.tab-btn:hover {
    color: var(--heading-color);
    background: var(--bg-alt);
}

.tab-btn.active {
    color: #090C12;
    background: var(--gold-gradient);
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(229, 193, 88, 0.35);
}

[data-theme="light"] .tab-btn.active {
    color: #FFFFFF;
    background: var(--gold-gradient);
}

/* --------------------------------------------------------------------------
   8. TABLES & RESPONSIVE DATA WRAPPERS
   -------------------------------------------------------------------------- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-pill);
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--gold-border);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.table th {
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    font-weight: 700;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
}

.table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--text-primary);
    transition: background-color 0.15s;
}

.table tr:hover td {
    background-color: var(--bg-alt);
}

.table-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.mobile-table-scroll-hint {
    display: none;
    font-size: 11.5px;
    color: var(--gold-primary);
    background: var(--gold-light);
    border: 1px solid var(--gold-border);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   9. STATUS BADGES & TAGS
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-paid {
    background-color: var(--success-light);
    color: var(--success);
    border-color: var(--success-border);
}

.badge-partially_paid {
    background-color: var(--warning-light);
    color: var(--warning);
    border-color: var(--warning-border);
}

.badge-issued {
    background-color: var(--info-light);
    color: var(--info);
    border-color: var(--info-border);
}

.badge-cancelled {
    background-color: var(--red-light);
    color: var(--red-alert);
    border-color: var(--red-border);
}

.badge-in_stock {
    background-color: var(--success-light);
    color: var(--success);
    border-color: var(--success-border);
}

.badge-sold {
    background-color: var(--bg-alt);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.badge-urgent {
    background-color: var(--red-light);
    color: var(--red-alert);
    border-color: var(--red-border);
    font-weight: 800;
}

/* Purity Badges */
.badge-purity-24k {
    background: rgba(255, 215, 0, 0.15);
    color: #FFD700;
    border-color: rgba(255, 215, 0, 0.4);
}

.badge-purity-22k {
    background: rgba(230, 161, 0, 0.15);
    color: #FFA500;
    border-color: rgba(230, 161, 0, 0.4);
}

.badge-purity-18k {
    background: rgba(205, 127, 50, 0.15);
    color: #E29D62;
    border-color: rgba(205, 127, 50, 0.4);
}

.badge-purity-silver {
    background: rgba(100, 181, 246, 0.15);
    color: #64B5F6;
    border-color: rgba(100, 181, 246, 0.4);
}

/* --------------------------------------------------------------------------
   10. BUTTONS & INTERACTION CONTROLS
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-body);
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--gold-gradient);
    color: #090C12;
    font-weight: 700;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(229, 193, 88, 0.3);
}

[data-theme="light"] .btn-primary {
    color: #FFFFFF;
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(229, 193, 88, 0.45);
    transform: translateY(-1px);
}

.btn-dark {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-dark:hover {
    background-color: var(--bg-alt);
    border-color: var(--gold-border);
}

.btn-danger {
    background-color: var(--red-alert);
    color: #FFFFFF;
}

.btn-danger:hover {
    background-color: var(--red-hover);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.35);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: var(--bg-alt);
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   11. FORMS & INPUT CONTROLS
   -------------------------------------------------------------------------- */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control, .form-select {
    width: 100%;
    padding: 9px 12px;
    font-size: 13.5px;
    font-family: var(--font-body);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    background-color: var(--input-bg);
    color: var(--input-text);
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.form-control::placeholder {
    color: var(--input-placeholder);
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px var(--input-focus-ring);
}

.input-group {
    display: flex;
    align-items: center;
}

.input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-addon {
    padding: 9px 14px;
    background-color: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-left: none;
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

/* --------------------------------------------------------------------------
   12. BILLING & POS MODULE LAYOUT
   -------------------------------------------------------------------------- */
.billing-layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 24px;
    align-items: start;
}

.billing-calc-summary {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 9px;
    font-size: 13.5px;
    color: var(--text-primary);
}

.calc-row.grand-total {
    border-top: 2px dashed var(--gold-border);
    padding-top: 12px;
    margin-top: 12px;
    font-size: 19px;
    font-weight: 800;
    color: var(--heading-color);
    font-family: var(--font-heading);
}

.calc-row.balance-due {
    color: var(--red-alert);
    font-size: 16px;
    font-weight: 800;
}

/* --------------------------------------------------------------------------
   13. JOB CARDS & WORKSHOP KANBAN
   -------------------------------------------------------------------------- */
.job-pipeline {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
}

.job-card-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 3.5px solid var(--gold-primary);
    transition: transform 0.2s, box-shadow 0.2s;
}

.job-card-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.job-card-item.overdue {
    border-top-color: var(--red-alert);
    background-color: var(--red-light);
    border-color: var(--red-border);
}

/* --------------------------------------------------------------------------
   14. MODALS & POPUPS
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(9, 12, 18, 0.75);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
    animation: modalFade 0.2s ease-out;
}

@keyframes modalFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    animation: modalSlide 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-content.modal-lg {
    max-width: 950px;
}

.modal-content.modal-xl {
    max-width: 1150px;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--heading-color);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--red-alert);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* --------------------------------------------------------------------------
   15. NOTIFICATION TOAST
   -------------------------------------------------------------------------- */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
    max-width: 400px;
    width: 100%;
}

.toast {
    padding: 14px 18px;
    background-color: #090C12;
    color: #F8FAFC;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastFade 0.3s ease;
    border-left: 4px solid var(--gold-primary);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.toast.toast-error {
    border-left-color: var(--red-alert);
}

.toast.toast-success {
    border-left-color: var(--success);
}

@keyframes toastFade {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --------------------------------------------------------------------------
   16. DEDICATED FULL-SCREEN LUXURY LOGIN PORTAL
   -------------------------------------------------------------------------- */
#login-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 25%, #182030 0%, #080B10 100%);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.login-portal-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), var(--gold-glow);
    padding: 34px 30px;
    position: relative;
    overflow: hidden;
}

.login-portal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gold-gradient-shimmer);
}

.login-ttw-logo {
    width: 68px;
    height: 68px;
    object-fit: contain;
    margin: 0 auto 12px auto;
    display: block;
    filter: drop-shadow(0 4px 14px rgba(229, 193, 88, 0.4));
    animation: ttwPulse 3s infinite ease-in-out;
}

@keyframes ttwPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); filter: drop-shadow(0 6px 20px rgba(229, 193, 88, 0.6)); }
}

.login-brand-title {
    font-family: var(--font-heading);
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: var(--gold-primary);
    text-align: center;
    margin-bottom: 2px;
}

.login-brand-sub {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.role-quick-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.role-quick-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.role-quick-btn:hover {
    border-color: var(--gold-primary);
    background: var(--gold-light);
    transform: translateY(-2px);
}

.role-quick-btn.active {
    border-color: var(--gold-primary);
    background: var(--gold-light);
    box-shadow: 0 0 0 2px var(--gold-primary);
}

.role-quick-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.role-quick-name {
    font-size: 12px;
    font-weight: 700;
}

.role-quick-sub {
    font-size: 10px;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   17. GLOBAL FOOTER
   -------------------------------------------------------------------------- */
.erp-global-footer {
    margin-top: auto;
    padding: 16px 28px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: var(--text-secondary);
    transition: background-color 0.25s, border-color 0.25s;
}

.erp-global-footer .footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.erp-global-footer .footer-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.footer-brand-text {
    display: flex;
    flex-direction: column;
}

.footer-title {
    font-weight: 700;
    color: var(--heading-color);
}

.footer-credit {
    font-size: 11px;
    color: var(--text-muted);
}

.footer-meta {
    display: flex;
    align-items: center;
    gap: 14px;
}

.system-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--success);
    font-weight: 600;
    font-size: 11.5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.stack-info {
    font-size: 11px;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   GLOBAL PROFESSIONAL ERP FOOTER
   -------------------------------------------------------------------------- */
.erp-global-footer {
    margin-top: auto;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    transition: background-color 0.25s ease, border-color 0.25s ease;
    backdrop-filter: blur(12px);
    z-index: 20;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.footer-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--gold-primary);
    box-shadow: 0 2px 6px rgba(229, 193, 88, 0.3);
}

.footer-brand-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.footer-brand-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    color: var(--heading-color);
}

.footer-brand-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.footer-center {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-compliance-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 500;
}

.status-dot-pulse {
    width: 7px;
    height: 7px;
    background: #10B981;
    border-radius: 50%;
    box-shadow: 0 0 6px #10B981;
    animation: statusPulse 2s infinite ease-in-out;
}

.footer-sep {
    color: var(--gold-border);
    font-size: 12px;
    opacity: 0.7;
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.3;
    flex-shrink: 0;
}

.footer-version-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--gold-primary);
    background: var(--gold-light);
    border: 1px solid var(--gold-border);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    margin-bottom: 3px;
}

.footer-copy {
    font-size: 11px;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   18. RESPONSIVE MEDIA QUERIES (Desktop, Tablet, Mobile)
   -------------------------------------------------------------------------- */
/* Responsive analytics grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* Responsive 2-column grid */
.grid-2col-responsive {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* Tablet & Smaller Desktops (<= 1024px) */
@media (max-width: 1024px) {
    .mobile-hamburger-btn {
        display: inline-flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        bottom: 0;
        width: 280px;
        z-index: 999;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .top-navbar {
        padding: 10px 16px;
    }

    .page-container {
        padding: 18px 16px;
    }

    .billing-layout-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

/* Mobile & Small Tablets (<= 768px) */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 12px;
    }

    .gold-rates-ticker {
        display: none !important;
    }

    .brand-header-text .brand-header-sub,
    .ttw-header-text .ttw-sub {
        display: none;
    }

    .btn-new-bill .btn-new-bill-text {
        display: none;
    }

    .topbar-role-selector .role-selector-label {
        display: none;
    }

    .role-quick-cards {
        grid-template-columns: 1fr;
    }

    .mobile-table-scroll-hint {
        display: flex;
    }

    .job-pipeline {
        grid-template-columns: 1fr;
    }

    .erp-global-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
        padding: 16px 14px;
    }

    .footer-left {
        justify-content: center;
    }

    .footer-right {
        align-items: center;
    }

    .footer-center {
        gap: 8px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .page-header > div:last-child {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
    }

    .analytics-grid,
    .grid-2col-responsive {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Extra Small Mobile (<= 480px) */
@media (max-width: 480px) {
    .top-navbar {
        padding: 8px 12px;
        gap: 8px;
    }

    .gold-rates-ticker {
        display: none;
    }

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

    .metric-card {
        padding: 14px 16px;
    }

    .metric-value {
        font-size: 22px;
    }

    .card-header {
        padding: 12px 14px;
    }

    .card-body {
        padding: 14px;
    }

    .page-container {
        padding: 14px 10px;
    }

    .modal-content {
        max-height: 94vh;
        border-radius: var(--radius-lg);
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 14px 16px;
    }

    #toast-container {
        bottom: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
    }
}
