/* --- Brand Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@500;600;700;800&display=swap');

:root {
    /* --- The Royal Palette --- */
    --brand-navy: #0a192f;
    /* Deep Luxurious Navy */
    --brand-gold: #D4AF37;
    --brand-gold-light: #f4e5bc;
    --brand-white: #ffffff;
    --bg-light: #f4f6f8;

    /* --- Functional Colors --- */
    --profit-green: #2ecc71;
    /* Fresh crisp green for money in */
    --balance-red: #e74c3c;
    /* Alert red for money owed */
    --royal-blue: #0d1b2a;
    /* Deep professional blue */
    --text-dark: #2c3e50;
    --text-light: #95a5a6;
}

/* --- Base Reset & Typography --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    /* Slightly larger, highly readable base text */
    background-color: var(--bg-light);
    color: var(--text-dark);
    margin: 0;
    display: flex;
    justify-content: flex-start;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
}

/* --- Layout --- */
.dashboard-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

.main-content {
    flex-grow: 1;
    padding: 20px;
    /* Reduced padding to decrease space between sidebar and content */
    overflow-y: auto;
    background: linear-gradient(to bottom right, #f4f6f8, #e9ecef);
    transition: background-color 0.3s ease, color 0.3s ease;
    width: calc(100% - 260px);
    /* Ensure it takes max available width next to sidebar */
}

/* --- Sidebar (The Luxury Panel) - FIXED --- */
/* MOBILE HAMBURGER MENU - Global */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1000;
    background: var(--brand-navy);
    color: var(--brand-gold);
    border: 1px solid var(--brand-gold);
    border-radius: 4px;
    padding: 10px;
    font-size: 1.2em;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
}

.sidebar {
    width: 260px !important;
    min-width: 260px !important;
    max-width: 260px !important;
    flex: 0 0 260px !important;
    background-color: var(--brand-navy);
    color: var(--brand-white);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.2);
    border-right: 3px solid var(--brand-gold);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    z-index: 100;
}

/* --- LOGO STYLING (Sir's 'n' Suits BY GEORGE) --- */
.sidebar-header {
    text-align: center;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding: 8px 15px 14px 15px;
    flex-shrink: 0;
}

.logo-container {
    text-align: center;
    padding-bottom: 0;
}

.brand-logo {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 1.6em;
    color: var(--brand-gold);
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
}

.brand-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.6em;
    letter-spacing: 4px;
    color: var(--brand-white);
    margin-top: 8px;
    display: block;
    text-transform: uppercase;
}

.sidebar-logo {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 1.5em;
    color: var(--brand-gold);
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
}

.sidebar-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.55em;
    letter-spacing: 4px;
    color: var(--brand-white);
    margin-top: 5px;
    display: block;
    text-transform: uppercase;
}

.sidebar-n,
.brand-n {
    font-size: 0.7em;
    font-style: italic;
    color: var(--brand-white);
    text-transform: lowercase;
}

/* --- User Info --- */
#user-info {
    text-align: center;
    font-size: 0.85em;
    color: #888;
    margin: 0 15px 20px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-weight: 600;
    color: var(--brand-white);
    flex-shrink: 0;
}

/* --- Navigation Links - FIXED LAYOUT --- */
.sidebar nav {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0 15px;
    min-height: 0;
    overflow-y: auto;
}

.sidebar nav a,
.dropdown-trigger {
    color: #ccc !important;
    text-decoration: none !important;
    padding: 12px 15px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    margin-bottom: 8px !important;
    border-radius: 4px !important;
    transition: background-color 0.2s ease, color 0.2s ease, border-left-color 0.2s ease !important;
    font-weight: 500 !important;
    border: none !important;
    border-left: 3px solid transparent !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-sizing: border-box !important;
    background: transparent !important;
    font-size: 15px !important;
    font-family: inherit !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    box-shadow: none !important;
    height: 45px !important;
    width: 100% !important;
}

.dropdown-trigger {
    justify-content: space-between !important;
}

.sidebar nav a:hover,
.dropdown-trigger:hover {
    background-color: rgba(212, 175, 55, 0.1) !important;
    color: var(--brand-gold) !important;
    border-left: 3px solid var(--brand-gold) !important;
    padding-left: 15px !important;
    transform: none !important;
}

.sidebar nav a.active,
.dropdown-trigger.active {
    background-color: rgba(212, 175, 55, 0.15) !important;
    color: var(--brand-gold) !important;
    border-left: 3px solid var(--brand-gold) !important;
    padding-left: 15px !important;
    font-weight: 600 !important;
}

/* --- Sidebar Dropdown Menu --- */
.sidebar-dropdown {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

.dropdown-arrow {
    display: inline-block !important;
    width: 16px !important;
    text-align: center !important;
    font-size: 0.8em;
    transition: transform 0.2s ease;
}

.sidebar-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-content {
    display: flex;
    flex-direction: column;
    padding-left: 15px;
    margin-top: 4px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s ease, opacity 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

.sidebar-dropdown.open .dropdown-content {
    max-height: 300px;
    opacity: 1;
    pointer-events: all;
}

.dropdown-content a {
    padding: 10px 15px !important;
    font-size: 0.9em !important;
    margin-bottom: 4px !important;
    height: 38px !important;
}

/* Special styling for logout button - ALWAYS VISIBLE AT BOTTOM */
.sidebar nav a[href*="logout"],
.sidebar nav a#logout-btn {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    background: transparent !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    text-align: center !important;
    justify-content: center !important;
    font-weight: 600 !important;
    color: #ef4444 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    height: 45px !important;
}

.sidebar nav a[href*="logout"]:hover,
.sidebar nav a#logout-btn:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: #ef4444 !important;
    color: #dc2626 !important;
    padding-left: 15px !important;
    transform: none !important;
}

.sidebar nav a[href*="logout"] i,
.sidebar nav a#logout-btn i {
    color: #ef4444 !important;
}

/* Special styling for New Global Order button */
.nav-cta {
    background: var(--brand-gold) !important;
    border: none !important;
    color: var(--brand-navy) !important;
    text-align: center !important;
    justify-content: center !important;
    font-weight: 700 !important;
    margin-top: auto !important;
    margin-bottom: 10px !important;
    padding: 12px 15px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2) !important;
    transition: all 0.2s ease !important;
    height: 45px !important;
}

.nav-cta:hover {
    background: #ebcd50 !important;
    color: var(--brand-navy) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.3) !important;
    padding-left: 15px !important;
}

/* --- Buttons (Gold Standard) - SIMPLIFIED --- */
button {
    background-color: var(--brand-navy);
    color: var(--brand-gold);
    border: 1px solid var(--brand-gold);
    padding: 10px 20px;
    /* Sleek padding */
    border-radius: 8px;
    /* Modern pillish shape */
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Smoother interaction */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85em;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

button:hover {
    background-color: var(--brand-gold);
    color: var(--brand-navy);
}

.small-btn {
    padding: 6px 12px;
    font-size: 0.75em;
    width: auto;
    text-transform: none;
}

/* --- Modal Styles --- */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    /* Increased to be above bottom-nav (9999) */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: flex-start;
    /* Changed from center to prevent top clipping when content is tall */
    padding: env(safe-area-inset-top, 20px) env(safe-area-inset-right, 20px) env(safe-area-inset-bottom, 20px) env(safe-area-inset-left, 20px);
    box-sizing: border-box;
    overflow-y: auto;
    /* Allow scrolling of the modal container itself just in case */
}

.modal-content {
    background-color: white;
    margin: auto;
    margin-top: 20px;
    /* Instead of relying purely on flex center, add top margin */
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    width: 100%;
    max-width: 600px;
    /* Sensible default */
    box-sizing: border-box;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover {
    color: #000;
}

/* Modal action buttons */
.modal-content button {
    padding: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

/* --- Cards & Containers --- */
.metric-card,
.shop-card,
.container,
.modal-content {
    background: var(--brand-white);
    border-radius: 16px;
    /* Soft, modern radius */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    /* Expansive soft shadow */
    border-top: none;
    /* Removed harsh gold accent */
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Very subtle boundary */
}

/* --- SLEEK METRIC CARDS (New Design) --- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: white;
    padding: 24px;
    /* More breathable */
    border-radius: 16px;
    border: none;
    border-left: 5px solid var(--brand-navy);
    /* Default accent */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    min-width: 0;
    /* Fix flexbox overflow */
}

.metric-card:hover {
    transform: translateY(-5px);
    /* Stronger lift effect */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* Specific Card Accents */
.card-gold {
    border-left-color: var(--brand-gold);
}

.card-green {
    border-left-color: var(--profit-green);
}

.card-red {
    border-left-color: var(--balance-red);
}

.card-blue {
    border-left-color: #3b82f6;
}

/* Old Stat Box (Legacy support if needed, updated to match theme) */
.stat-box {
    background: var(--brand-navy);
    color: var(--brand-gold);
}

/* --- MODERN DONUT CHART LAYOUT --- */
.donut-card-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: calc(100% - 50px);
}

.donut-legend {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 100%;
    overflow-y: auto;
    padding-right: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8em;
    color: #555;
}

.legend-label-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-value {
    font-weight: 700;
    color: var(--brand-navy);
    white-space: nowrap;
}

.donut-chart-wrapper {
    flex: 1.2;
    position: relative;
    height: 100%;
    min-width: 0;
}

/* --- Tables --- */
table {
    width: 100%;
    border-collapse: separate;
    /* Required for border-radius on rows/cells */
    border-spacing: 0;
    background: white;
    border-radius: 16px;
    /* Smooth corners */
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

th {
    background: #f8fafc;
    /* Lighter modern header */
    color: #475569;
    /* Slate grey for readability */
    padding: 16px 20px;
    text-align: left;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #edf2f7;
}

td {
    padding: 18px 20px;
    /* Breathable table data */
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 0.95em;
}

tr:hover td {
    background-color: #f8fafc;
    /* Very subtle hover */
}

/* --- Admin Table Enhancements --- */
#orders-table-container,
#admin-orders-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

/* Ensure table cells don't wrap and crunch together on smaller screens */
table {
    white-space: nowrap;
}

th,
td {
    padding: 12px 15px;
    /* Slightly tighter padding */
}

.ref-column {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85em;
    color: #666;
}

.admin-actions-cell {
    text-align: center;
    white-space: nowrap;
}

.btn-compact {
    padding: 6px 10px !important;
    font-size: 0.9em !important;
    min-width: 38px;
    margin-right: -5px;
    /* Slight overlap for space saving */
    position: relative;
    z-index: 1;
}

.btn-compact:hover {
    z-index: 2;
    transform: scale(1.1);
}

/* --- Inputs --- */
input,
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    /* Chunky modern inputs */
    margin: 8px 0 20px;
    border: 1px solid #e2e8f0;
    /* Soft slate border */
    border-radius: 12px;
    /* Smooth corners */
    background: #fdfdfd;
    font-family: 'Inter', sans-serif;
    font-size: 0.95em;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

input:focus,
select:focus,
textarea:focus {
    border-color: #3b82f6;
    /* Modern Blue outline focus */
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    /* Sleek focus ring */
    background: white;
}

/* --- Status Indicators --- */
.status-indicator {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    display: inline-block;
}

.status-1 {
    background: #7f8c8d;
}

/* Assigned - Gray */
.status-2 {
    background: var(--brand-gold);
    color: black;
}

/* In Progress - Gold */
.status-3 {
    background: var(--royal-blue);
}

/* QA - Blue */
.status-4 {
    background: var(--profit-green);
}

/* Ready - Green */
.status-5 {
    background: var(--brand-navy);
    border: 1px solid var(--brand-gold);
    color: var(--brand-gold);
}

/* Collected - Navy/Gold */
.status-6 {
    background: #000;
}

/* Closed */

/* --- Typography Headers --- */
h1 {
    font-family: 'Playfair Display', serif;
    color: var(--brand-navy);
    margin-bottom: 5px;
    font-size: 2em;
}

h2 {
    font-family: 'Playfair Display', serif;
    color: var(--brand-gold);
    margin-bottom: 15px;
    font-size: 1.5em;
}

p {
    line-height: 1.6;
}

/* --- Login Container --- */
.login-container {
    max-width: 400px;
    margin: 80px auto;
    text-align: center;
    padding: 40px;
    background: var(--brand-navy);
    /* Navy card */
    color: var(--brand-white);
    border: 2px solid var(--brand-gold);
    border-radius: 8px;
}

.login-container h1 {
    color: var(--brand-gold);
}

.login-container h2 {
    color: var(--brand-white);
    font-family: 'Inter', sans-serif;
    padding: 10px 15px;
    border: 1px solid #ddd;
    text-transform: uppercase;
    margin-bottom: 30px;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--brand-gold);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #b8941f;
}

/* --- 📱 MOBILE BOTTOM DOCK STYLES --- */

/* Default: Hide the bottom nav on Desktop */
.bottom-nav {
    display: none;
}

/* On Mobile: Hide Sidebar, Show Bottom Nav */
@media (max-width: 768px) {

    /* Enable Sidebar Drawer */
    .sidebar {
        display: flex !important;
    }

    .mobile-menu-btn {
        display: block !important;
    }

    /* Adjust main content so it doesn't get hidden behind the bar */
    .main-content {
        padding: 15px 15px 65px 15px !important;
        /* Perfect flush padding */
        width: 100% !important;
        margin: 0 !important;
    }

    /* The Dock Container - fixed height, never shifts */
    .bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        min-height: 60px;
        max-height: 60px;
        background: var(--brand-navy);
        border-top: 2px solid #D4AF37;
        z-index: 9999;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.5);
        padding-bottom: 0;
        overflow: visible;
    }

    /* The Icons - fixed height prevents shifting */
    .nav-item {
        color: #888;
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        font-size: 0.7em;
        font-weight: 600;
        width: 20%;
        height: 60px;
        min-height: 60px;
        flex-shrink: 0;
    }

    .nav-item i {
        font-size: 1.6em;
        margin-bottom: 4px;
        color: #aaa;
        transition: color 0.2s;
    }

    /* Active State */
    .nav-item.active i,
    .nav-item.active span {
        color: #D4AF37;
        /* Gold */
    }

    /* The "New Order" Center Button - stable, no floating */
    .nav-item.center-fab {
        position: relative;
        top: 0;
        /* ⛔ removed top:-25px - was causing bottom nav to dance */
    }

    .nav-item.center-fab .fab-circle {
        width: 46px;
        height: 46px;
        background: #D4AF37;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 3px solid var(--brand-navy);
        box-shadow: 0 4px 12px rgba(212, 175, 55, 0.5);
    }

    .nav-item.center-fab i {
        color: #000;
        margin: 0;
        font-size: 1.5em;
    }
}

/* ============================================ */
/* MOBILE RESPONSIVE DESIGN (Tablet & Phone) */
/* ============================================ */

@media (max-width: 1024px) {
    .main-content {
        padding: 30px;
    }

    .metrics-bar {
        flex-wrap: wrap;
    }

    .metric-card {
        min-width: calc(50% - 10px);
        margin-bottom: 10px;
    }
}

@media (max-width: 768px) {

    /* Stack layout vertically */
    .dashboard-container {
        flex-direction: column;
    }

    /* Sidebar becomes sliding drawer - FIXED */
    .sidebar {
        position: fixed;
        z-index: 9999;
        height: 100%;
        width: 230px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding-top: 10px;
    }

    /* Make text more compact on mobile */
    .sidebar nav a {
        padding: 8px 12px !important;
        font-size: 0.85em !important;
        margin-bottom: 2px !important;
    }

    .sidebar-logo {
        font-size: 1.1em !important;
    }

    .sidebar-subtitle {
        font-size: 0.4em !important;
    }

    #user-info {
        padding: 8px !important;
        margin: 5px 10px 10px !important;
        font-size: 0.75em !important;
    }

    /* NUCLEAR FIX: Force Sidebar Content ABOVE the Overlay */
    .sidebar nav,
    .sidebar .sidebar-header,
    .sidebar #user-info {
        position: relative;
        z-index: 5;
    }

    /* Mobile sidebar header: tight top, room for X button on left */
    .sidebar .sidebar-header {
        padding: 10px 10px 12px 50px;
        margin-bottom: 8px;
        text-align: left;
    }

    .sidebar .sidebar-logo {
        text-align: left;
        font-size: 1em !important;
    }

    .sidebar .sidebar-subtitle {
        text-align: left;
    }

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

    .main-content {
        padding: 20px;
        padding-top: 60px;
        /* Space for hamburger button */
        width: 100%;
    }

    /* Mobile hamburger button */
    .mobile-menu-btn {
        display: block;
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 10000;
        background: var(--brand-navy);
        color: var(--brand-gold);
        border: 1px solid var(--brand-gold);
        border-radius: 4px;
        padding: 8px;
        font-size: 1.0em;
        cursor: pointer;
    }

    /* When sidebar is open, keep X button anchored inside the sidebar top-left */
    .sidebar.active~* .mobile-menu-btn,
    body.sidebar-open .mobile-menu-btn {
        left: 12px;
    }

    /* Prevent title overlapping with hamburger menu */
    .dashboard-main-title {
        font-size: 1.05em !important;
        line-height: 1.2 !important;
        text-align: left;
        letter-spacing: -0.3px;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .main-content>header p,
    .dashboard-header-container p {
        margin-left: 0 !important;
        padding-right: 0 !important;
        margin-top: 8px !important;
        font-size: 0.8em !important;
        text-align: left;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Fix flexbox text truncation causing horizontal scroll */
    .main-content>header>div:first-child,
    .dashboard-header-container>div:first-child,
    .inv-header>div:first-child {
        min-width: 0 !important;
        flex: 1 !important;
    }

    /* Overlay for mobile sidebar */
    .sidebar::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        display: none;
        z-index: -1;
        /* NUCLEAR FIX: Send overlay behind the sidebar background */
    }

    .sidebar.active::after {
        display: block;
    }

    /* Mobile-friendly tables */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        font-size: 0.9em;
    }

    th,
    td {
        padding: 10px;
        min-width: 120px;
        /* Prevent columns from collapsing */
    }

    /* Stack metrics cards */
    .metrics-bar {
        flex-direction: column;
        gap: 10px;
    }

    .metrics-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
    }

    .metric-card {
        width: auto !important;
        min-width: 0 !important;
        padding: 10px 6px !important;
        border-radius: 8px !important;
        border-left-width: 3px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }

    /* Action buttons: 3-column grid layout for mobile */
    .quick-actions-toolbar {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 5px !important;
    }

    .quick-actions-toolbar button {
        width: 100% !important;
        padding: 8px 2px !important;
        font-size: 0.55em !important;
        flex-direction: column !important;
        text-align: center;
        gap: 4px !important;
        justify-content: center !important;
        white-space: normal !important;
        line-height: 1.1 !important;
        min-width: 0 !important;
    }

    .quick-actions-toolbar button i {
        font-size: 1.4em !important;
        margin-right: 0 !important;
    }

    .main-content>header {
        position: relative;
    }

    /* Top right header settings icons */
    .top-header-actions {
        position: absolute;
        top: 0;
        right: 0;
        gap: 4px !important;
        flex-wrap: nowrap !important;
    }

    .top-header-actions button {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.85em !important;
        padding: 0 !important;
    }

    .metrics-grid .metric-card div[style*="font-size:1.6em"],
    .metrics-grid .metric-card div[style*="font-size: 1.6em"],
    .metrics-grid .metric-card #total-revenue,
    .metrics-grid .metric-card #active-count,
    .metrics-grid .metric-card #ready-count,
    .metrics-grid .metric-card #pending-count,
    .metrics-grid .metric-card #closed-count,
    .metrics-grid .metric-card #total-unpaid,
    .metrics-grid .metric-card #total-due-count {
        font-size: 1.05em !important;
        font-weight: 800 !important;
        margin: 4px 0 !important;
    }

    .metrics-grid .metric-card span[style*="font-size:0.75em"],
    .metrics-grid .metric-card span[style*="font-size: 0.75em"] {
        font-size: 0.55em !important;
        line-height: 1.1 !important;
        display: block !important;
    }

    .metrics-grid .metric-card i {
        font-size: 0.85em !important;
        margin-left: 2px !important;
    }

    .metrics-grid .metric-card div[style*="font-size:0.7em"],
    .metrics-grid .metric-card div[style*="font-size: 0.7em"],
    .metrics-grid .metric-card #revenue-breakdown,
    .metrics-grid .metric-card #unpaid-breakdown {
        font-size: 0.55em !important;
        margin-top: 4px !important;
        padding-top: 3px !important;
    }

    /* Make the last card (Due Status) span all 3 columns horizontally */
    .metrics-grid .metric-card:nth-child(7) {
        grid-column: 1 / -1 !important;
    }

    .metrics-grid .metric-card:nth-child(7) div[style*="gap: 15px"] {
        gap: 10px !important;
        padding-top: 10px !important;
        margin-top: 5px !important;
    }

    .metrics-grid .metric-card:nth-child(7) div[style*="padding-left: 15px"] {
        padding-left: 10px !important;
    }

    /* Adjust filter bars for mobile */
    .filter-bar {
        flex-direction: column;
        gap: 10px;
    }

    .filter-bar select,
    .filter-bar button {
        width: 100%;
    }
}

.super-metric-card {
    padding: 12px 10px !important;
}

.super-metric-card div[style*="font-size: 2.2em"] {
    font-size: 1.3em !important;
}

/* Adjust form layouts */
.filter-bar select,
.filter-bar button {
    width: auto;
    margin: 0;
}

.admin-actions-cell {
    flex-direction: row;
}

.btn-compact {
    margin-right: 2px;
}

/* Adjust form layouts */
form fieldset {
    padding: 15px;
}

/* Make buttons larger for touch */
button {
    padding: 15px;
    font-size: 1em;
}

.small-btn {
    padding: 8px 15px;
    font-size: 0.9em;
}

/* Adjust modal for mobile */
.modal-content {
    width: 95%;
    margin: 20px auto;
    /* Force margin instead of auto to prevent flex centering clipping */
    padding: 20px 15px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    box-sizing: border-box;
}

/* Login container adjustments */
.login-container {
    margin: 40px auto;
    width: 90%;
    padding: 30px 20px;
}

/* Logo adjustments for mobile */
.sidebar-logo {
    font-size: 1.4em;
}

.sidebar-subtitle {
    font-size: 0.45em;
    letter-spacing: 3px;
}

.brand-logo {
    font-size: 1.6em;
}

.brand-subtitle {
    font-size: 0.45em;
    letter-spacing: 3px;
}

/* Improve spacing in order cards */
.order-list h2 {
    font-size: 1.2em;
}

/* Fix sidebar nav spacing on mobile */
.sidebar nav {
    padding: 0 10px;
}

.sidebar nav a {
    padding: 10px 12px;
    font-size: 0.9em;
}

/* --- Admin Management Screen Mobile Optimization --- */
.management-grid,
.shop-list-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.shop-card,
.management-card {
    padding: 15px !important;
    margin-bottom: 0 !important;
}

.management-card h3 {
    font-size: 1.1em !important;
    margin-bottom: 10px !important;
}


@media (max-width: 480px) {
    .main-content {
        padding: 15px;
        padding-top: 50px;
    }

    h1 {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.2em;
    }

    /* Further reduce table font size */
    table {
        font-size: 0.8em;
    }

    th,
    td {
        padding: 8px;
        min-width: 100px;
    }

    /* Action buttons: 3-column grid layout for mobile */
    .quick-actions-toolbar {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }

    .quick-actions-toolbar button {
        width: 100% !important;
        padding: 5px 2px !important;
        line-height: 1.1 !important;
        font-size: 0.5em !important;
        white-space: normal !important;
        min-width: 0 !important;
        flex-direction: column !important;
        text-align: center;
        gap: 5px !important;
        justify-content: center !important;
    }

    .quick-actions-toolbar button i {
        font-size: 1.2em !important;
        margin-right: 0 !important;
    }

    /* Prevent title overlapping with hamburger menu */
    .dashboard-main-title {
        margin-left: 55px !important;
        padding-right: 110px !important;
        /* Avoid right absolute buttons */
        font-size: 1.1em !important;
        line-height: 1.2 !important;
        text-align: left;
    }

    .dashboard-header-text {
        margin-left: 45px !important;
    }

    .dashboard-header-text .dashboard-main-title {
        margin-left: 0 !important;
    }

    /* Form inputs larger on very small screens */
    input,
    select,
    textarea {
        padding: 14px;
        font-size: 16px;
        /* Prevents iOS zoom on focus */
    }

    /* Adjust sidebar width for very small screens */
    .sidebar {
        width: 230px;
    }

    /* Fix logout button on small screens */
    .sidebar nav a[href*="logout"],
    .sidebar nav a#logout-btn {
        margin-bottom: 15px;
        padding: 12px;
    }

    /* Extra compacting for very small screens */
    .container,
    .shop-card,
    .modal-content {
        padding: 12px !important;
        border-radius: 12px !important;
    }

    .management-card .card-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .management-card .card-actions button {
        width: 100% !important;
        padding: 10px 5px !important;
        font-size: 0.8em !important;
    }
}

/* Animation fixes - Reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {

    .sidebar,
    .mobile-menu-btn,
    .filter-bar,
    button {
        display: none !important;
    }

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

/* [Change 6] Elegant Table Action Buttons */
.table-btn {
    background: transparent;
    border: 1px solid #ddd;
    color: #333;
    padding: 6px 12px;
    font-size: 0.85em;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-btn:hover {
    background: var(--brand-navy);
    color: var(--brand-white);
    border-color: var(--brand-navy);
}

/* Specific override for receipt if needed, or keep generic */
.table-btn-receipt {
    margin-left: 5px;
}

/* --- Big Logout Button (Highly Visible Red) --- */
.big-logout-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: fixed !important;
    top: 18px !important;
    right: 18px !important;
    width: 13px !important;
    height: 13px !important;
    background: #e74c3c !important;
    border: 1px solid #fff200 !important;
    border-radius: 5px !important;
    z-index: 10003 !important;
    box-shadow: 0 1px 3px rgba(231, 76, 60, 0.18), 0 0 0 1px rgba(255, 242, 0, 0.08);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 0.4em !important;
    color: #fff !important;
    outline: none !important;
}

.big-logout-btn i {
    color: #fff200 !important;
    font-size: 0.45em !important;
    text-shadow: 0 0 2px #fff200, 0 0 1px #e74c3c;
}

.big-logout-btn:active {
    transform: scale(0.96) rotate(2deg);
    background: #fff200 !important;
    color: #e74c3c !important;
}

.big-logout-btn:active i {
    color: #e74c3c !important;
}

@media (max-width: 480px) {
    .big-logout-btn {
        width: 16px !important;
        left: auto !important;
        right: 4px !important;
        top: 4px !important;
        height: 16px !important;
        font-size: 0.4em !important;
        border-radius: 4px !important;
    }

    .big-logout-btn i {
        font-size: 0.45em !important;
    }
}

/* ============================================ */
/* 🌙 DARK MODE SYSTEM */
/* ============================================ */
body.dark-mode {
    --bg-light: #0f172a;
    --text-dark: #f8fafc;
    --brand-white: #1e293b;
    --brand-navy: #f8fafc;
    /* NUCLEAR FIX: Inverts all inline dark-navy text to pure white */
    color: var(--text-dark);
}

body.dark-mode .main-content {
    background: #0f172a !important;
    /* Solid dark background */
}

body.dark-mode .sidebar {
    background-color: #020617 !important;
    /* Explicitly dark navy/black since we inverted --brand-navy */
    border-right-color: #1e293b !important;
}

body.dark-mode .sidebar-subtitle {
    color: #94a3b8 !important;
    /* Readable light gray on the dark sidebar */
}

/* NUCLEAR FIX: Force all elements that have inline "background: white" to become dark cards */
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background:white"],
body.dark-mode [style*="background-color: white"],
body.dark-mode [style*="background-color:white"],
body.dark-mode .action-card,
body.dark-mode .metric-card,
body.dark-mode .shop-card,
body.dark-mode .entity-card,
body.dark-mode .entity-header,
body.dark-mode .entity-actions,
body.dark-mode .container,
body.dark-mode .modal-content,
body.dark-mode table,
body.dark-mode .filter-bar,
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background:#fff"],
body.dark-mode .tdm-sidebar,
body.dark-mode [style*="background:#f8fafc"] {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

/* Fix Tailor Details Modal Header (which uses var(--brand-navy) that gets inverted to white) */
body.dark-mode #tailor-details-modal>div>div:first-child {
    background: #020617 !important;
    border-bottom: 2px solid var(--brand-gold) !important;
}

/* Fix phone text color */
body.dark-mode #tdm-phone {
    color: #f8fafc !important;
}

/* Force all text inside dark cards to be white */
body.dark-mode .metric-card div,
body.dark-mode .action-card h3,
body.dark-mode .action-card label,
body.dark-mode .entity-card div,
body.dark-mode section h2 {
    color: #f8fafc !important;
}

body.dark-mode #user-info {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border: 1px solid #334155 !important;
}

body.dark-mode .mobile-menu-btn {
    background: #020617 !important;
    color: var(--brand-gold) !important;
}

body.dark-mode .filter-bar .fa-search {
    color: #cbd5e1 !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #94a3b8 !important;
}

body.dark-mode .metric-card span {
    color: #94a3b8 !important;
    /* Muted text for labels */
}

/* Overriding specific card colors so they don't look muddy */
body.dark-mode .card-gold {
    border-left-color: #D4AF37 !important;
}

body.dark-mode .card-green {
    border-left-color: #10b981 !important;
}

body.dark-mode .card-red {
    border-left-color: #ef4444 !important;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea,
body.dark-mode .form-group input,
body.dark-mode .form-group select {
    background: #0f172a !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode .form-group input:focus,
body.dark-mode .form-group select:focus {
    background: #020617 !important;
    border-color: #D4AF37 !important;
}

body.dark-mode th {
    background: #0f172a !important;
    color: var(--brand-gold) !important;
    border-bottom: 2px solid #334155 !important;
}

body.dark-mode td {
    border-bottom-color: #334155 !important;
    color: #cbd5e1 !important;
    background: #1e293b !important;
}

body.dark-mode tr:hover td {
    background-color: #0f172a !important;
}

body.dark-mode .legend-item {
    color: #cbd5e1;
}

/* Overriding the white background on the new header buttons */
body.dark-mode button[title="Refresh Data"],
body.dark-mode button[title="Toggle Dark Mode"] {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

body.dark-mode button[title="Refresh Data"]:hover,
body.dark-mode button[title="Toggle Dark Mode"]:hover {
    background: #334155 !important;
    color: #f8fafc !important;
}

body.dark-mode #revenue-breakdown,
body.dark-mode #unpaid-breakdown {
    border-top-color: #334155 !important;
    color: #94a3b8 !important;
}

body.dark-mode .close-btn {
    color: #94a3b8;
}

body.dark-mode .close-btn:hover {
    color: #f8fafc;
}

/* --- Messages Interface Dark Mode --- */
body.dark-mode .inbox-layout {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

body.dark-mode .inbox-sidebar {
    background: #0f172a;
    border-right-color: #334155;
}

body.dark-mode .inbox-sidebar-title {
    background: #1e293b;
    color: #e2e8f0;
    border-bottom-color: #334155;
}

body.dark-mode .thread-card {
    border-bottom-color: #334155;
}

body.dark-mode .thread-card:hover {
    background-color: #1e293b;
}

body.dark-mode .thread-card.active {
    background-color: rgba(212, 175, 55, 0.15);
}

body.dark-mode .thread-client-name {
    color: #e2e8f0;
}

body.dark-mode .thread-meta {
    color: #94a3b8;
}

body.dark-mode .chat-container {
    background: #1e293b;
}

body.dark-mode .chat-pane-header {
    background: #1e293b;
    border-bottom-color: #334155;
}

body.dark-mode .client-info-title {
    color: #e2e8f0;
}

body.dark-mode .chat-messages-stream {
    background-color: #0f172a;
}

body.dark-mode .msg-bubble.them {
    background: #1e293b;
    color: #cbd5e1;
    border-color: #334155;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.dark-mode .msg-bubble.me {
    background: #2563eb;
    color: #f8fafc;
    border-color: #1d4ed8;
}

body.dark-mode .btn-chat-send {
    background: var(--brand-gold);
    color: #0f172a;
}

body.dark-mode .btn-chat-send:hover {
    background: #ca8a04;
    color: #0f172a;
}

body.dark-mode .msg-input-pane {
    background: #1e293b;
    border-top-color: #334155;
}

body.dark-mode .msg-input-pane .input-group input {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

body.dark-mode .msg-input-pane .input-group input:focus {
    border-color: var(--brand-gold);
    outline: none;
}

body.dark-mode #thread-bulk-actions {
    background: #1e293b !important;
    border-top-color: #334155 !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode #thread-selected-count {
    color: #e2e8f0 !important;
}

/* --- Search Results Popover (Floating Dropdown) --- */
.form-group {
    position: relative;
}

.search-results-popover {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    /* Above most elements */
    margin-top: -15px;
    /* Adjust to sit tightly against the inputs */
    display: none;
}

.search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    font-size: 0.9em;
    color: #334155;
    transition: background 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f8fafc;
}

/* Dark Mode Dropdown Support */
body.dark-mode .search-results-popover {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

body.dark-mode .search-result-item {
    color: #cbd5e1;
    border-bottom-color: #334155;
}

body.dark-mode .search-result-item:hover {
    background: #0f172a;
}

/* ============================================ */
/* 🌙 DARK MODE — Client Details Overlay        */
/* ============================================ */

/* Full-page modal background */
body.dark-mode #order-modal {
    background: #0f172a !important;
}

body.dark-mode #order-modal .modal-content {
    background: #0f172a !important;
    color: #f8fafc !important;
}

/* Client name heading */
body.dark-mode #client-info-view h2 {
    color: #f8fafc !important;
}

/* Phone + label text */
body.dark-mode #client-info-view p,
body.dark-mode #client-info-view span {
    color: #94a3b8 !important;
}

/* Edit Info button */
body.dark-mode #client-info-view .small-btn {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border: 1px solid #334155 !important;
}

/* Measurement cards */
body.dark-mode .history-item {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-mode .history-item [style*="border-bottom: 2px solid #f1f5f9"],
body.dark-mode .history-item [style*="border-bottom:2px solid #f1f5f9"] {
    border-bottom-color: #334155 !important;
}

/* Coat Details header text inside cards */
body.dark-mode .history-item h4,
body.dark-mode .history-item span,
body.dark-mode .history-item div {
    color: #e2e8f0 !important;
}

/* Measurement label text (Hips, Chest, etc.) */
body.dark-mode .history-measurements td:first-child,
body.dark-mode .history-measurements [style*="color: #64748b"],
body.dark-mode .history-measurements [style*="color:#64748b"] {
    color: #94a3b8 !important;
}

/* Measurement value text */
body.dark-mode .history-measurements td:last-child,
body.dark-mode .history-measurements strong {
    color: #f8fafc !important;
}

/* Category section backgrounds (#f8fafc blocks inside measurement cards) */
body.dark-mode .history-item [style*="background: #f8fafc"],
body.dark-mode .history-item [style*="background:#f8fafc"],
body.dark-mode .history-item [style*="background: #f1f5f9"],
body.dark-mode .history-item [style*="background:#f1f5f9"] {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

/* Edit pencil button on cards */
body.dark-mode .history-item .small-btn {
    background: #0f172a !important;
    color: #94a3b8 !important;
    border: 1px solid #334155 !important;
}

/* Date badge on measurement cards */
body.dark-mode .history-item [style*="background: #f1f5f9"] {
    background: #0f172a !important;
    color: #94a3b8 !important;
}

/* Audit log section */
body.dark-mode .history-item [style*="border-top:1px dashed"],
body.dark-mode .history-item [style*="border-top: 1px dashed"] {
    border-top-color: #334155 !important;
}

body.dark-mode .history-item [id^="audit-log-"] {
    background: #0f172a !important;
    border-color: #334155 !important;
}

body.dark-mode .history-item [id^="audit-diff-"] {
    background: #1e293b !important;
    border-color: #334155 !important;
}

/* Section headers (Measurement History / Order & Billing History) */
@media (max-width: 768px) {
    .client-details-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}

body.dark-mode .client-details-grid h3 {
    color: #f8fafc !important;
}

/* Order & Billing table */
body.dark-mode #order-modal table {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode #order-modal thead tr {
    background: #0f172a !important;
}

body.dark-mode #order-modal th {
    background: #0f172a !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

body.dark-mode #order-modal td {
    color: #cbd5e1 !important;
    border-bottom-color: #1e293b !important;
}

body.dark-mode #order-modal tbody tr:hover td {
    background: #0f172a !important;
}

/* "No history found" empty state */
body.dark-mode #order-modal [style*="color: #64748b"][style*="font-style: italic"] {
    color: #475569 !important;
    background: #1e293b !important;
    border-color: #334155 !important;
}

/* Client notes (yellow card) stays readable in dark mode */
body.dark-mode #client-notes-container [style*="background: #fff8e1"] {
    background: #1c1a00 !important;
    border-left-color: #ffc107 !important;
}

/* Add Profile button stays gold-on-navy */
body.dark-mode #order-modal .small-btn[style*="background: var(--brand-navy)"] {
    background: #1e3a5f !important;
    color: var(--brand-gold) !important;
}

/* Close button */
body.dark-mode #order-modal .close-btn {
    color: #94a3b8 !important;
}

body.dark-mode #order-modal .close-btn:hover {
    color: #f8fafc !important;
}

/* ---- Measurement sub-cards (dm-meas-card) ---- */
body.dark-mode .dm-meas-card {
    background: #0f172a !important;
    border-color: #334155 !important;
}

body.dark-mode .dm-meas-header {
    color: #f8fafc !important;
}

body.dark-mode .dm-meas-field {
    border-bottom-color: #334155 !important;
}

body.dark-mode .dm-meas-label {
    color: #64748b !important;
}

body.dark-mode .dm-meas-value {
    color: #e2e8f0 !important;
}

/* ---- Date badge pill on measurement cards ---- */
body.dark-mode .history-item [style*="background: #f1f5f9"],
body.dark-mode .history-item [style*="background:#f1f5f9"] {
    background: #1e293b !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

/* ---- Edit pencil icon button on cards ---- */
body.dark-mode .history-item button.small-btn,
body.dark-mode .history-item .small-btn {
    background: #1e293b !important;
    color: #94a3b8 !important;
    border: 1px solid #334155 !important;
}

/* ---- Top-right Edit Info button ---- */
body.dark-mode #client-info-view button.small-btn {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border: 1px solid #334155 !important;
}

/* ---- Add Profile / Add Garment button ---- */
body.dark-mode .client-details-grid button.small-btn {
    border: 1px solid var(--brand-gold) !important;
}

/* ---- "No measurements recorded" text inside dark card ---- */
body.dark-mode .history-item p,
body.dark-mode .history-item>div>p {
    color: #64748b !important;
}

/* ---- Known Garments badge (Suit pill) ---- */
body.dark-mode #client-info-view [style*="background: var(--brand-navy)"],
body.dark-mode #client-info-view span[style*="border-radius: 20px"] {
    background: #1e3a5f !important;
    color: var(--brand-gold) !important;
}





.mobile-back-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 65px;
    z-index: 1000;
    background: transparent;
    color: var(--brand-navy);
    border: none;
    border-radius: 4px;
    padding: 10px;
    font-size: 1.4em;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-back-btn {
        display: block;
    }
}

@media (max-width: 768px) {
    .filter-bar {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        padding: 10px !important;
    }

    .filter-bar>div:first-child {
        grid-column: 1 / -1 !important;
        /* Search bar spans full width */
    }

    .filter-bar>div {
        min-width: 0 !important;
    }

    .filter-bar select,
    .filter-bar input {
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        font-size: 0.85em !important;
        padding: 8px !important;
    }

    .filter-bar input {
        padding-left: 40px !important;
    }

    .filter-bar .search-box {
        width: 100% !important;
    }
}

/* ============================================ */
/* 📊 BUSINESS INTELLIGENCE & BI ANALYTICS STYLES */
/* ============================================ */

/* Header controls spacing */
.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.control-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.control-bar select,
.control-bar button,
.control-bar input {
    width: auto !important;
    margin: 0 !important;
    height: 42px !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
}

.control-btn {
    padding: 10px 15px !important;
    border-radius: 8px !important;
    font-size: 0.9em !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.2s ease !important;
    height: 42px !important;
}

.control-bar select {
    border: 1px solid #cbd5e1 !important;
    background-color: white !important;
    color: #334155 !important;
    cursor: pointer;
    font-weight: 500;
}

body.dark-mode .control-bar select {
    border-color: #475569 !important;
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
}

/* Scorecards Grid */
.scorecard-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: 12px !important;
    margin-bottom: 25px !important;
}

.scorecard {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    border-left: 4px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #eee;
}

.scorecard:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.scorecard.revenue {
    border-left-color: #10b981 !important;
}

.scorecard.margin {
    border-left-color: #8b5cf6 !important;
}

.scorecard.acquisition {
    border-left-color: #3b82f6 !important;
}

.scorecard.speed {
    border-left-color: #f59e0b !important;
}

.score-title {
    font-size: 0.75em;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.score-val {
    font-size: 1.4em;
    font-weight: 800;
    color: var(--brand-black);
    margin: 3px 0;
}

.score-trend {
    font-size: 0.75em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up {
    color: #10b981;
}

.trend-down {
    color: #ef4444;
}

@media (max-width: 768px) {
    .scorecard-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .scorecard {
        padding: 12px 10px !important;
        gap: 6px !important;
    }

    .score-title {
        font-size: 0.65em !important;
    }

    .score-val {
        font-size: 1.2em !important;
    }

    .score-trend {
        font-size: 0.6em !important;
    }
}

/* Sections Layout */
.bi-section {
    display: flex;
    gap: 25px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* BI Cards */
.bi-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.bi-card-title {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--brand-navy);
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    min-height: 250px;
    flex-grow: 1;
}

/* Cortex AI Feed */
.ai-feed {
    background: linear-gradient(135deg, var(--brand-navy) 0%, #0d1b2a 100%);
    color: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    height: 100%;
}

body.dark-mode .ai-feed {
    background: linear-gradient(135deg, #1e293b 0%, #020617 100%);
}

.ai-feed .bi-card-title {
    color: var(--brand-gold) !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

#ai-insights-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    max-height: 380px;
}

.insight-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
}

.insight-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(212, 175, 55, 0.3);
}

.insight-title {
    font-weight: 700;
    font-size: 0.95em;
    color: var(--brand-gold-light);
    margin-bottom: 6px;
}

.insight-text {
    font-size: 0.85em;
    line-height: 1.5;
    color: #cbd5e1;
}

/* Leaderboard Table */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.leaderboard-table th {
    background: transparent;
    padding: 8px 12px;
    border-bottom: 2px solid #edf2f7;
    font-size: 0.75em;
    color: #64748b;
}

.leaderboard-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9em;
}

.leaderboard-table tr:hover td {
    background-color: #f8fafc;
}

@media (max-width: 768px) {
    .leaderboard-table {
        width: max-content !important;
        margin: 0 auto !important;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 8px 4px !important;
        font-size: 0.85em !important;
    }
}

/* Dark Mode Overrides for Financial Overview */
body.dark-mode .kpi-card,
body.dark-mode .chart-container,
body.dark-mode .control-panel {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .kpi-value,
body.dark-mode .chart-container h3,
body.dark-mode .control-panel label {
    color: #f1f5f9 !important;
}

body.dark-mode .kpi-header {
    color: #94a3b8 !important;
}

body.dark-mode .kpi-subtext {
    color: #64748b !important;
}

body.dark-mode .control-group input,
body.dark-mode .control-group select {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #cbd5e1 !important;
}

body.dark-mode .control-panel>button,
body.dark-mode .control-btn,
body.dark-mode .chart-container a {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #cbd5e1 !important;
}

body.dark-mode .control-panel>button:hover,
body.dark-mode .control-btn:hover,
body.dark-mode .chart-container a:hover {
    background: #334155 !important;
    color: #f1f5f9 !important;
}

/* Dark Mode Overrides for BI Dashboard */
body.dark-mode .scorecard,
body.dark-mode .bi-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .score-val,
body.dark-mode .bi-card-title {
    color: #f1f5f9;
}

body.dark-mode .bi-card-title {
    border-bottom-color: #334155;
}

body.dark-mode .score-title {
    color: #94a3b8;
}

/* ===== GLOBAL MEGA DROPDOWN SYSTEM ===== */
.nav-dropdown-item {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown-item>a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-dropdown-item .chevron-icon {
    font-size: 0.75em;
    transition: transform 0.3s ease;
    color: var(--text-muted, #94a3b8);
}

.nav-dropdown-item:hover .chevron-icon {
    transform: rotate(180deg);
    color: var(--gold, #d4af37);
}

.mega-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    transform: translateY(12px);
    width: 540px;
    background: var(--bg-card, #0f172a);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--gold-border, rgba(212, 175, 55, 0.25));
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(212, 175, 55, 0.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1100;
}

[data-theme="light"] .mega-dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.nav-dropdown-item:hover .mega-dropdown-menu,
.nav-dropdown-item:focus-within .mega-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(4px);
}

.mega-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.mega-link-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none !important;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.mega-link-card::after {
    display: none !important;
}

.mega-link-card:hover {
    background: rgba(212, 175, 55, 0.08);
    border-color: var(--gold-border, rgba(212, 175, 55, 0.25));
    transform: translateY(-2px);
}

.mega-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--gold-glow, rgba(212, 175, 55, 0.15));
    border: 1px solid var(--gold-border, rgba(212, 175, 55, 0.25));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold, #d4af37);
    font-size: 1.05em;
    flex-shrink: 0;
}

.mega-title {
    font-weight: 700;
    font-size: 0.88em;
    color: var(--text-main, #f8fafc);
    display: flex;
    align-items: center;
    gap: 6px;
}

.mega-desc {
    font-size: 0.76em;
    color: var(--text-muted, #94a3b8);
    line-height: 1.3;
    margin-top: 2px;
}

.mega-badge {
    font-size: 0.6em;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
    background: var(--gold, #d4af37);
    color: var(--bg-deep, #030712);
    line-height: 1;
}

/* ===== SCROLL REVEAL & MICRO-ANIMATIONS ===== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

.animate-scale-in {
    opacity: 0;
    transform: scale(0.93);
    transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-scale-in.animated {
    opacity: 1;
    transform: scale(1);
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.float-element {
    animation: floatSlow 5s ease-in-out infinite;
}

/* ===== FAQ ACCORDION STYLES ===== */
.faq-section {
    padding: 80px 8%;
    max-width: 1100px;
    margin: 0 auto;
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 40px;
}

.faq-item {
    background: var(--bg-card, rgba(17, 24, 39, 0.7));
    border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition-smooth, all 0.3s ease);
}

[data-theme="light"] .faq-item {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}

.faq-item:hover {
    border-color: var(--gold-border, rgba(212, 175, 55, 0.3));
}

.faq-question {
    padding: 22px 26px;
    font-size: 1.05em;
    font-weight: 700;
    color: var(--text-main, #f3f4f6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.faq-question i {
    color: var(--gold, #d4af37);
    transition: transform 0.3s ease;
    font-size: 0.9em;
}

.faq-item.open .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 26px;
    color: var(--text-muted, #9ca3af);
    font-size: 0.95em;
    line-height: 1.7;
}

.faq-item.open .faq-answer {
    max-height: 500px;
    padding: 0 26px 22px 26px;
}

body.dark-mode .leaderboard-table th {
    border-bottom-color: #334155;
    color: #94a3b8;
}

body.dark-mode .leaderboard-table td {
    border-bottom-color: #334155;
    color: #cbd5e1;
}

body.dark-mode .leaderboard-table tr:hover td {
    background-color: #0f172a;
}

/* Leaderboard Rank Badges */
.rank-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: 700;
}

.rank-1 {
    background: var(--brand-gold) !important;
    color: var(--brand-navy) !important;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.4);
}

.rank-2 {
    background: #e2e8f0 !important;
    color: #475569 !important;
}

.rank-3 {
    background: #fed7aa !important;
    color: #9a3412 !important;
}

.rank-4,
.rank-5 {
    background: var(--brand-navy) !important;
    color: var(--brand-gold) !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
}

body.dark-mode .rank-2 {
    background: #475569 !important;
    color: #f1f5f9 !important;
}

body.dark-mode .rank-3 {
    background: #7c2d12 !important;
    color: #ffedd5 !important;
}

body.dark-mode .rank-4,
body.dark-mode .rank-5 {
    background: #334155 !important;
    color: #f1f5f9 !important;
}

/* ============================================ */
/* 📦 INVENTORY MANAGEMENT STYLES */
/* ============================================ */

.inv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.inv-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    margin-bottom: 2px;
}

@media (max-width: 768px) {
    .inv-header {
        margin-bottom: 10px;
    }

    .inv-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
        margin-bottom: 2px;
    }

    .inv-stat-card {
        padding: 8px 4px;
        border-radius: 8px;
    }

    .inv-stat-card .stat-value {
        font-size: 1.1em;
        margin-bottom: 0px;
    }

    .inv-stat-card .stat-label {
        font-size: 0.6em;
    }
}

.inv-stat-card {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #f1f5f9;
}

.inv-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.inv-stat-card .stat-value {
    font-size: 1.5em;
    font-weight: 800;
    color: var(--brand-navy);
    margin-bottom: 2px;
}

.inv-stat-card .stat-value.good {
    color: #10b981;
}

.inv-stat-card .stat-value.low {
    color: #f59e0b;
}

.inv-stat-card .stat-label {
    color: #64748b;
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.inv-add-panel {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 2px;
    border-top: 4px solid var(--brand-gold);
    border: 1px solid #f1f5f9;
}

.inv-add-panel h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--brand-navy);
    display: flex;
    align-items: center;
    font-size: 1em;
}

.inv-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    align-items: end;
}

@media (min-width: 769px) {
    .inv-form-grid {
        /* Desktop: 1 row, 6 columns layout */
        grid-template-columns: 2fr 1.2fr 0.8fr 0.8fr 1.2fr auto;
    }
}

@media (max-width: 768px) {
    .inv-form-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .inv-form-grid>div:nth-child(6) {
        /* Button spans full width on mobile */
        grid-column: 1 / -1;
    }

    .inv-form-grid input,
    .inv-form-grid select {
        padding: 8px 12px;
        font-size: 0.9em;
    }

    .btn-add-item {
        height: 40px;
        font-size: 0.9em;
    }
}

.inv-form-grid label {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.inv-form-grid input,
.inv-form-grid select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95em;
    box-sizing: border-box;
    transition: all 0.2s;
    background-color: #f8fafc;
}

.inv-form-grid input:focus,
.inv-form-grid select:focus {
    outline: none;
    border-color: var(--brand-gold);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.btn-add-item {
    background: var(--brand-gold);
    color: var(--brand-navy);
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95em;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-add-item:hover {
    background: #eab308;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}


.inv-toolbar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.inv-toolbar select,
.inv-toolbar button {
    width: auto !important;
    margin: 0 !important;
}

.inv-search-wrap {
    position: relative;
    flex-grow: 1;
    min-width: 250px;
}

.inv-search-wrap i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.inv-search {
    width: 100%;
    margin: 0;
    padding: 12px 15px 12px 40px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 0.95em;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

.inv-filter {
    padding: 12px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: white;
    font-family: 'Inter', sans-serif;
    color: #475569;
    min-width: 150px;
    width: auto;
    margin: 0;
    cursor: pointer;
}

.inv-table-wrap {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    border: 1px solid #f1f5f9;
}

.inv-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.inv-table th {
    text-align: left;
    padding: 15px 20px;
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.inv-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.inv-table tr:hover td {
    background: #f8fafc;
}

.stock-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 700;
}

.stock-good {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.stock-low {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stock-out {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.inv-actions {
    display: flex;
    gap: 10px;
}

.inv-actions button {
    background: transparent;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-edit {
    color: #3b82f6;
}

.btn-edit:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

.btn-restock {
    color: #10b981;
}

.btn-restock:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
}

.btn-delete {
    color: #ef4444;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

/* Inventory Modals */
.inv-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.inv-modal-overlay.active {
    display: flex;
}

.inv-modal {
    background: white;
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    opacity: 0;
    animation: slideUpIn 0.3s forwards;
}

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

.inv-modal h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: var(--brand-navy);
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 15px;
    display: flex;
    align-items: center;
}

.inv-modal .form-group {
    margin-bottom: 20px;
}

.inv-modal label {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.inv-modal input,
.inv-modal select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.inv-modal input:focus,
.inv-modal select:focus {
    outline: none;
    border-color: var(--brand-gold);
}

.inv-modal-btns {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

.btn-cancel {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-cancel:hover {
    background: #e2e8f0;
}

.btn-save-edit {
    background: var(--brand-navy);
    color: var(--brand-gold);
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-save-edit:hover {
    background: #0f172a;
}

/* Order Form Toggle */
.order-type-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.order-type-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    color: #64748b;
}

.order-type-btn.active {
    background: var(--brand-navy);
    color: var(--brand-gold);
}

body.dark-mode .order-type-wrapper {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .order-type-btn {
    color: #94a3b8;
}

body.dark-mode .order-type-btn.active {
    background: var(--brand-gold);
    color: var(--brand-navy);
}


/* Dark Mode Support for Order Form Bottom Section */
.extras-list-wrapper {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    background: #f8fafc;
}

.extra-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    gap: 10px;
}

.extra-item-name {
    color: #334155;
    font-size: 0.9em;
    font-weight: 600;
}

.extra-item-cat {
    font-size: 0.75em;
    background: #e0e7ff;
    color: #4338ca;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 6px;
}

.extra-item-desc {
    font-size: 0.8em;
    color: #64748b;
    margin-top: 2px;
}

.extra-qty-input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    text-align: center;
    font-size: 0.9em;
}

body.dark-mode .extras-list-wrapper {
    background: var(--dark-surface);
    border-color: var(--dark-border);
}

body.dark-mode .extra-item-row {
    border-color: var(--dark-border);
}

body.dark-mode .extra-item-name {
    color: #e2e8f0;
}

body.dark-mode .extra-item-cat {
    background: rgba(67, 56, 202, 0.3);
    color: #818cf8;
}

body.dark-mode .extra-item-desc {
    color: #94a3b8;
}

body.dark-mode .extra-qty-input {
    background: #0f172a;
    color: #f8fafc;
    border-color: #334155;
}

/* Admin Modal Review */
.admin-modal-title {
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

body.dark-mode .admin-modal-title {
    border-color: var(--dark-border);
}

.admin-review-summary-box {
    background: #f9f9f9;
    padding: 15px;
    margin: 15px 0;
    border-left: 4px solid var(--brand-gold);
}

body.dark-mode .admin-review-summary-box {
    background: rgba(255, 255, 255, 0.05);
}

.btn-finalize {
    width: 100%;
    background-color: var(--brand-navy);
    color: var(--brand-gold);
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-finalize:hover {
    background-color: #1a365d;
}

body.dark-mode .btn-finalize {
    background-color: var(--brand-gold);
    color: var(--brand-navy);
}

.extras-subtotal-panel {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    padding: 8px 12px;
    background: #f1f5f9;
    border-radius: 8px;
}

body.dark-mode .extras-subtotal-panel {
    background: #1e293b;
}

body.dark-mode .extras-subtotal-panel span {
    color: #cbd5e1 !important;
}

.extras-grand-total-panel {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
    padding: 8px 12px;
    background: #e0f2fe;
    border-radius: 8px;
    border: 1px solid #bae6fd;
}

body.dark-mode .extras-grand-total-panel {
    background: #0f172a;
    border-color: #0369a1;
}

body.dark-mode .extras-grand-total-panel span {
    color: #7dd3fc !important;
}

body.dark-mode #submit-order-btn {
    background: var(--brand-gold) !important;
    color: var(--brand-navy) !important;
    border: none;
}

/* Dark Mode Support for Inventory */
body.dark-mode .inv-stat-card,
body.dark-mode .inv-add-panel,
body.dark-mode .inv-table-wrap,
body.dark-mode .inv-modal,
body.dark-mode .inv-filter,
body.dark-mode .inv-search,
body.dark-mode .inv-modal input,
body.dark-mode .inv-modal select,
body.dark-mode .inv-form-grid input,
body.dark-mode .inv-form-grid select {
    background: #1e293b;
    color: #f8fafc;
    border-color: #334155;
}

body.dark-mode .inv-add-panel h3,
body.dark-mode .inv-modal h3 {
    color: #f8fafc;
    border-color: #334155;
}

body.dark-mode .inv-table th {
    background: #0f172a;
    color: #cbd5e1;
    border-color: #334155;
}

body.dark-mode .inv-table td {
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .inv-table tr:hover td {
    background: #0f172a;
}

body.dark-mode .btn-cancel {
    background: #334155;
    color: #e2e8f0;
}

body.dark-mode .btn-add-item {
    background: var(--brand-gold);
    color: var(--brand-navy);
}

body.dark-mode .inv-actions button {
    border-color: #334155;
}

/* --- Expense Summary Cards --- */
.expense-summary-grid {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 15px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.expense-summary-grid::-webkit-scrollbar {
    height: 6px;
}

.expense-summary-grid::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.expense-summary-card {
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #f1f5f9;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 200px;
    flex-shrink: 0;
}

.expense-summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.ex-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.1);
    color: var(--brand-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    flex-shrink: 0;
}

.ex-info h4 {
    margin: 0 0 4px 0;
    font-size: 0.8em;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ex-amount {
    margin: 0 0 2px 0;
    font-size: 1.2em;
    font-weight: 800;
    color: var(--brand-navy);
}

.ex-count {
    margin: 0;
    font-size: 0.8em;
    color: #94a3b8;
}

/* Dark Mode Support for Expense Cards */
body.dark-mode .expense-summary-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

body.dark-mode .ex-info h4,
body.dark-mode .ex-count {
    color: #94a3b8;
}

body.dark-mode .ex-amount {
    color: #f1f5f9;
}

body.dark-mode .ex-icon-circle {
    background: rgba(212, 175, 55, 0.15);
}

/* --- Measurements Grid --- */
.measurement-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.measurement-field {
    display: flex;
    flex-direction: column;
}

.measurement-group h4 {
    margin: 15px 0 10px 0;
    color: var(--brand-navy);
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 5px;
    font-size: 1.1em;
}

body.dark-mode .measurement-group h4 {
    color: #cbd5e1;
    border-color: #334155;
}

@media (max-width: 768px) {
    .expense-summary-grid {
        gap: 10px;
        scroll-snap-type: x mandatory;
    }

    .expense-summary-card {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        min-width: 140px;
        scroll-snap-align: start;
    }

    .ex-icon-circle {
        width: 35px;
        height: 35px;
        font-size: 1em;
    }

    .ex-amount {
        font-size: 1.1em;
    }

    .measurement-fields {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .measurement-field label {
        font-size: 0.8em;
    }

    .measurement-field input {
        padding: 8px;
    }
}

/* --- Form Row Layout --- */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row .form-group {
    margin-bottom: 0;
    /* Override default bottom margin inside grid */
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}

/* --- Dark Mode Form Refinements --- */
body.dark-mode fieldset {
    border-color: #334155 !important;
}

body.dark-mode legend {
    color: var(--brand-gold) !important;
}

body.dark-mode label,
body.dark-mode .form-group label {
    color: #cbd5e1 !important;
}

body.dark-mode .measurement-field label {
    color: #94a3b8 !important;
}

/* Mobile Spacing Fixes for Inventory */
@media (max-width: 768px) {
    .inv-add-panel {
        margin-bottom: 15px !important;
    }

    .inv-toolbar {
        gap: 10px !important;
        margin-bottom: 15px !important;
        flex-wrap: wrap;
    }

    .inv-search-wrap {
        margin-bottom: 0 !important;
        width: 100% !important;
        min-width: 100% !important;
        flex: 0 0 100% !important;
    }

    .inv-filter {
        margin-bottom: 0 !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        padding: 10px 5px !important;
        font-size: 0.85em !important;
    }

    /* Remove the huge white background box around mobile table cards */
    .inv-table-wrap {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }
}

/* Dark mode for mobile inventory cards */
body.dark-mode .inv-table tr {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode .inv-table td {
    border-bottom-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-mode .inv-table td::before {
    color: #94a3b8 !important;
}

/* ==========================================================================
   ✨ PREMIUM LAPTOP & DESKTOP ENHANCEMENTS (WIDTH > 768px)
   ========================================================================== */
@media (min-width: 769px) {

    /* --- Main Content Background --- */
    .main-content {
        padding: 24px 12px !important;
        background: #f9fafb !important;
        border-radius: 0;
        box-shadow: none !important;
        width: calc(100% - 260px) !important;
    }

    body.dark-mode .main-content {
        background: #0f172a !important;
    }

    /* --- Custom Scrollbar for Desktop --- */
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    ::-webkit-scrollbar-track {
        background: transparent;
    }

    ::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
        transition: background 0.3s ease;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

    body.dark-mode ::-webkit-scrollbar-thumb {
        background: #334155;
    }

    body.dark-mode ::-webkit-scrollbar-thumb:hover {
        background: #475569;
    }

    /* --- Sidebar Redesign --- */
    .sidebar {
        background-color: var(--bg-light, #f8fafc) !important;
        color: #1f2937 !important;
        border-right: 1px solid #e2e8f0 !important;
        box-shadow: none !important;
    }

    body.dark-mode .sidebar {
        background-color: var(--bg-dark, #0f172a) !important;
        color: #f3f4f6 !important;
        border-right: 1px solid #334155 !important;
    }

    .sidebar-logo {
        color: #4f46e5 !important;
        /* Indigo modern accent */
    }

    .sidebar-subtitle {
        color: #64748b !important;
        /* Muted gray in light mode */
    }

    body.dark-mode .sidebar-subtitle {
        color: #94a3b8 !important;
        /* Light gray in dark mode */
    }

    #user-info {
        background: #f3f4f6 !important;
        color: #4b5563 !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 8px !important;
    }

    body.dark-mode #user-info {
        background: #0f172a !important;
        color: #9ca3af !important;
        border: 1px solid #334155 !important;
    }

    .sidebar nav a,
    .dropdown-trigger {
        color: #4b5563 !important;
        font-size: 13px !important;
        border-radius: 8px !important;
        border-left: none !important;
        padding: 10px 14px !important;
        height: 42px !important;
        transition: all 0.2s ease !important;
    }

    body.dark-mode .sidebar nav a,
    body.dark-mode .dropdown-trigger {
        color: #d1d5db !important;
    }

    .sidebar nav a:hover,
    .dropdown-trigger:hover {
        background-color: #f3f4f6 !important;
        color: #111827 !important;
        padding-left: 14px !important;
    }

    body.dark-mode .sidebar nav a:hover,
    body.dark-mode .dropdown-trigger:hover {
        background-color: #334155 !important;
        color: #ffffff !important;
    }

    .sidebar nav a.active,
    .dropdown-trigger.active {
        background: linear-gradient(90deg, #f5f3ff 0%, #ffffff 100%) !important;
        color: #4f46e5 !important;
        font-weight: 600 !important;
        box-shadow: none !important;
    }

    body.dark-mode .sidebar nav a.active,
    body.dark-mode .dropdown-trigger.active {
        background: linear-gradient(90deg, #1e1b4b 0%, #1e293b 100%) !important;
        color: #818cf8 !important;
    }

    /* --- Sidebar Dropdown Menu Animation --- */
    .sidebar-dropdown .dropdown-content {
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        display: flex !important;
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, padding 0.3s ease;
        padding-left: 12px;
        margin-top: 0;
    }

    .sidebar-dropdown.open .dropdown-content {
        opacity: 1;
        max-height: 250px;
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .dropdown-content a {
        font-size: 11.5px !important;
        padding: 8px 12px !important;
        height: 34px !important;
    }

    #user-info {
        font-size: 11.5px !important;
        margin-bottom: 12px !important;
        padding: 8px !important;
    }

    /* --- Interactive Guides / Help Banners --- */
    .dashboard-guide-banner {
        background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
        border: 1px solid #7dd3fc;
        border-left: 5px solid #0284c7;
        color: #0369a1;
        padding: 16px 20px;
        border-radius: 14px;
        margin-bottom: 25px;
        display: flex;
        align-items: flex-start;
        gap: 15px;
        position: relative;
        box-shadow: 0 4px 15px rgba(2, 132, 199, 0.05);
        transition: all 0.3s ease;
    }

    .dashboard-guide-banner h4 {
        margin: 0 0 4px 0;
        font-size: 1.05em;
        font-weight: 700;
        color: #0c4a6e;
    }

    .dashboard-guide-banner p {
        margin: 0;
        font-size: 0.9em;
        line-height: 1.5;
        color: #075985;
    }

    .dashboard-guide-banner .close-guide-btn {
        appearance: none;
        -webkit-appearance: none;
        background: transparent !important;
        border: none;
        color: #0284c7;
        font-size: 1.2em;
        cursor: pointer;
        position: absolute;
        top: 12px;
        right: 15px;
        padding: 4px;
        margin: 0;
        line-height: 1;
        transition: color 0.2s ease;
        align-self: flex-start;
    }

    .dashboard-guide-banner .close-guide-btn:hover {
        color: #0369a1;
    }

    body.dark-mode .dashboard-guide-banner {
        background: linear-gradient(135deg, #0c1e35 0%, #082f49 100%) !important;
        border: 1px solid #0c4a6e !important;
        border-left: 5px solid #38bdf8 !important;
        color: #e0f2fe !important;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2) !important;
    }

    body.dark-mode .dashboard-guide-banner h4 {
        color: #f0f9ff !important;
    }

    body.dark-mode .dashboard-guide-banner p {
        color: #bae6fd !important;
    }

    /* --- Metric Cards --- */
    .metrics-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 12px !important;
    }

    .metric-card {
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-left: none !important;
        border-radius: 8px !important;
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03) !important;
        padding: 10px 12px !important;
        transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    }

    body.dark-mode .metric-card {
        background: #1e293b !important;
        border: 1px solid #334155 !important;
    }

    .metric-card:hover {
        transform: translateY(-1px) !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
    }

    /* Target inner typography of metric cards to shrink sizes on laptops */
    .metric-card #total-revenue,
    .metric-card #active-count,
    .metric-card #ready-count,
    .metric-card #pending-count,
    .metric-card #closed-count,
    .metric-card #total-unpaid,
    .metric-card #total-due-count {
        font-size: 1.3em !important;
        font-weight: 800 !important;
    }

    .metric-card span[style*="font-size:0.75em"],
    .metric-card span[style*="font-size: 0.75em"] {
        font-size: 11px !important;
    }

    .metric-card div[style*="font-size:0.7em"],
    .metric-card div[style*="font-size: 0.7em"],
    .metric-card #revenue-breakdown,
    .metric-card #unpaid-breakdown {
        font-size: 10px !important;
        margin-top: 5px !important;
        padding-top: 4px !important;
    }

    /* --- Table styling --- */
    table {
        border-radius: 10px !important;
        border: 1px solid #e2e8f0 !important;
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.02) !important;
        width: 100% !important;
        table-layout: auto !important;
    }

    body.dark-mode table {
        border: 1px solid #334155 !important;
    }

    th,
    td {
        white-space: nowrap !important;
    }

    td:nth-child(1) {
        /* Shop column */
        max-width: 140px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    td:nth-child(2) {
        /* Customer column */
        max-width: 120px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    td:nth-child(4),
    /* References column */
    .ref-column {
        max-width: 120px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    th {
        background: #fafafa !important;
        color: #4b5563 !important;
        border-bottom: 1px solid #e2e8f0 !important;
        font-size: 11.5px !important;
        font-weight: 600 !important;
        text-transform: none !important;
        padding: 10px 12px !important;
        letter-spacing: 0px !important;
    }

    body.dark-mode th {
        background: #1e293b !important;
        color: #9ca3af !important;
        border-bottom: 1px solid #334155 !important;
    }

    td {
        padding: 10px 12px !important;
        font-size: 12.5px !important;
        border-bottom: 1px solid #f3f4f6 !important;
        color: #1f2937 !important;
    }

    body.dark-mode td {
        border-bottom: 1px solid #334155 !important;
        color: #e5e7eb !important;
    }

    tr:hover td {
        background-color: #fafafa !important;
    }

    body.dark-mode tr:hover td {
        background-color: rgba(255, 255, 255, 0.02) !important;
    }

    /* --- Dot Badges for Table Status --- */
    .status-indicator {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 3px 8px !important;
        border-radius: 6px !important;
        font-size: 11px !important;
        font-weight: 600 !important;
        text-transform: capitalize !important;
        letter-spacing: 0px !important;
        border: none !important;
    }

    .status-indicator::before {
        content: "●" !important;
        font-size: 0.7em !important;
        margin-right: 6px !important;
    }

    /* Status Classes Colors */
    .status-indicator.status-1 {
        background-color: #f3f4f6 !important;
        color: #4b5563 !important;
    }

    .status-indicator.status-1::before {
        color: #9ca3af !important;
    }

    .status-indicator.status-2 {
        background-color: #eff6ff !important;
        color: #1d4ed8 !important;
    }

    .status-indicator.status-2::before {
        color: #3b82f6 !important;
    }

    .status-indicator.status-3 {
        background-color: #fdf2f8 !important;
        color: #be185d !important;
    }

    .status-indicator.status-3::before {
        color: #ec4899 !important;
    }

    .status-indicator.status-4 {
        background-color: #f0fdf4 !important;
        color: #15803d !important;
    }

    .status-indicator.status-4::before {
        color: #22c55e !important;
    }

    .status-indicator.status-5 {
        background-color: #fffbeb !important;
        color: #b45309 !important;
    }

    .status-indicator.status-5::before {
        color: #f59e0b !important;
    }

    .status-indicator.status-6 {
        background-color: #fafafa !important;
        color: #737373 !important;
    }

    .status-indicator.status-6::before {
        color: #a3a3a3 !important;
    }

    /* Dark Mode Indicators */
    body.dark-mode .status-indicator.status-1 {
        background-color: rgba(243, 244, 246, 0.06) !important;
        color: #9ca3af !important;
    }

    body.dark-mode .status-indicator.status-2 {
        background-color: rgba(59, 130, 246, 0.12) !important;
        color: #60a5fa !important;
    }

    body.dark-mode .status-indicator.status-3 {
        background-color: rgba(236, 72, 153, 0.12) !important;
        color: #f472b6 !important;
    }

    body.dark-mode .status-indicator.status-4 {
        background-color: rgba(34, 197, 94, 0.12) !important;
        color: #4ade80 !important;
    }

    body.dark-mode .status-indicator.status-5 {
        background-color: rgba(245, 158, 11, 0.12) !important;
        color: #fbbf24 !important;
    }

    body.dark-mode .status-indicator.status-6 {
        background-color: rgba(250, 250, 250, 0.05) !important;
        color: #a3a3a3 !important;
    }

    /* --- Form Fields & Focus Glow --- */
    .form-group input,
    .form-group select,
    .form-group textarea,
    input[type="text"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        border: 1.5px solid #cbd5e1 !important;
        border-radius: 10px !important;
        padding: 8px 12px !important;
        font-size: 13px !important;
        transition: all 0.25s ease !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.01) !important;
    }

    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus,
    input[type="text"]:focus,
    input[type="number"]:focus,
    input[type="date"]:focus,
    select:focus,
    textarea:focus {
        border-color: #4f46e5 !important;
        box-shadow: 0 0 0 3.5px rgba(79, 70, 229, 0.15) !important;
        background-color: #fff !important;
    }

    body.dark-mode .form-group input,
    body.dark-mode .form-group select,
    body.dark-mode .form-group textarea,
    body.dark-mode input[type="text"],
    body.dark-mode input[type="number"],
    body.dark-mode input[type="date"],
    body.dark-mode select,
    body.dark-mode textarea {
        border: 1.5px solid #334155 !important;
        background-color: #1e293b !important;
        color: #f8fafc !important;
    }

    body.dark-mode .form-group input:focus,
    body.dark-mode .form-group select:focus,
    body.dark-mode .form-group textarea:focus,
    body.dark-mode input[type="text"]:focus,
    body.dark-mode input[type="number"]:focus,
    body.dark-mode input[type="date"]:focus,
    body.dark-mode select:focus,
    body.dark-mode textarea:focus {
        border-color: #818cf8 !important;
        box-shadow: 0 0 0 3.5px rgba(129, 140, 248, 0.25) !important;
        background-color: #1a2333 !important;
    }

    /* --- Interactive Buttons & Focus States --- */
    .btn,
    button:not(.close-btn):not(.close-guide-btn):not(.mobile-menu-btn):not(.dropdown-trigger) {
        border-radius: 10px !important;
        padding: 12px 24px !important;
        font-weight: 600 !important;
        letter-spacing: 0.2px !important;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
        cursor: pointer !important;
    }

    .btn:hover,
    button:not(.close-btn):not(.close-guide-btn):not(.mobile-menu-btn):not(.dropdown-trigger):hover {
        transform: translateY(-1.5px) !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08) !important;
    }

    .btn:active,
    button:not(.close-btn):not(.close-guide-btn):not(.mobile-menu-btn):not(.dropdown-trigger):active {
        transform: translateY(0) !important;
    }
}

/* Fix for client details modal sideways scrolling on mobile */
@media (max-width: 768px) {
    .client-details-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Hide "You may be looking for" suggestion card on large screens (laptops/desktops) */
@media (min-width: 769px) {
    .suggestion-card {
        display: none !important;
    }
}

/* --- Dynamic CRM: Hide Tailor Features --- */
body.business-type-art .tailor-only,
body.business-type-accessories .tailor-only,
body.business-type-fabric .tailor-only {
    display: none !important;
}

/* --- Dynamic CRM: Terminology Swap --- */
body:not(.business-type-tailor) .garment-text {
    display: none !important;
}

body:not(.business-type-tailor) .product-text {
    display: inline !important;
}

/* --- Alert Animations --- */
@keyframes alertBlink {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }

    50% {
        box-shadow: 0 0 10px 4px rgba(239, 68, 68, 0.6);
    }
}

.blink-alert {
    animation: alertBlink 2s infinite ease-in-out;
    position: relative;
    border-radius: inherit;
}

/* ===== MARKETPLACE LISTING MODAL LIGHT MODE CONTRAST FIXES ===== */
[data-theme="light"] .listing-modal-content,
body.light-mode .listing-modal-content {
    background: #ffffff !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.18) !important;
}

[data-theme="light"] #modal-listing-title,
body.light-mode #modal-listing-title {
    color: #0f172a !important;
}

[data-theme="light"] #modal-listing-desc,
body.light-mode #modal-listing-desc {
    color: #334155 !important;
}

[data-theme="light"] #modal-shop-name,
body.light-mode #modal-shop-name {
    color: #0f172a !important;
}

[data-theme="light"] .modal-shop-info,
body.light-mode .modal-shop-info {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

[data-theme="light"] #modal-listing-category,
body.light-mode #modal-listing-category {
    background: rgba(15, 23, 42, 0.08) !important;
    color: #0f172a !important;
}

[data-theme="light"] .listing-modal-close,
body.light-mode .listing-modal-close {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

/* ===== Card Image Cycle Buttons ===== */
.card-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(217, 177, 56, 0.4);
    color: #fce786;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    font-size: 12px;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    opacity: 0.8; /* Make visible by default */
}
.card-nav-btn:hover {
    background: rgba(217, 177, 56, 0.95);
    color: #0f172a;
    transform: translateY(-50%) scale(1.1);
    opacity: 1;
}
.card-nav-btn.prev { left: 8px; }
.card-nav-btn.next { right: 8px; }