/* ==========================================================================
   MOONGIL PROJECT - DESIGN SYSTEM
   Theme: Organic Forest Green  |  Layout: Fixed Sidebar + Top Header
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary:        #2D6A4F;
    --primary-dark:   #1B4332;
    --primary-light:  #E8F5E9;
    --primary-glow:   rgba(45,106,79,0.18);

    --sidebar-bg:     #0F281E;
    --sidebar-width:  260px;
    --header-height:  62px;

    --bg-page:  #F2F6F4;
    --bg-card:  #FFFFFF;

    --text-main:    #0B2519;
    --text-muted:   #748C7A;
    --text-sidebar: #B7CEBF;

    --border:       #D8E2DC;
    --border-light: #EAF0EC;

    --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 14px rgba(45,106,79,0.10);
    --shadow-lg: 0 10px 28px rgba(45,106,79,0.14);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-page);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }

/* ==========================================================================
   SIDEBAR
   ========================================================================== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 300;
    transition: transform 0.3s ease;
    overflow: hidden;
}

/* ---------- Sidebar Brand ---------- */
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    height: var(--header-height);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

/* ---------- Ultra-Stylish MOONGIL Brand & Animated Logo ---------- */
@keyframes logoPulseGlow {
    0% {
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.4), 0 0 20px rgba(245, 158, 11, 0.2);
        border-color: rgba(16, 185, 129, 0.7);
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        box-shadow: 0 0 22px rgba(16, 185, 129, 0.85), 0 0 35px rgba(245, 158, 11, 0.5);
        border-color: rgba(245, 158, 11, 0.9);
        transform: translateY(-2px) rotate(3deg);
    }
    100% {
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.4), 0 0 20px rgba(245, 158, 11, 0.2);
        border-color: rgba(16, 185, 129, 0.7);
        transform: translateY(0px) rotate(0deg);
    }
}

@keyframes textShimmerWave {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes taglineGoldPulse {
    0%, 100% {
        color: #A7F3D0;
        border-color: rgba(82, 183, 136, 0.4);
        box-shadow: 0 0 6px rgba(16, 185, 129, 0.2);
    }
    50% {
        color: #FBBF24;
        border-color: rgba(245, 158, 11, 0.7);
        box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
    }
}

.brand-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #10B981 0%, #52B788 50%, #F59E0B 100%);
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.6);
    animation: logoPulseGlow 3.2s infinite ease-in-out;
    flex-shrink: 0;
}

.sidebar-logo-img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    border-radius: 50%;
    background: transparent;
    padding: 0;
    display: block;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-brand-link:hover .sidebar-logo-img {
    transform: rotate(15deg) scale(1.15);
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: 1px;
}

.sidebar-brand-title {
    font-family: 'Righteous', 'Poppins', sans-serif;
    font-size: 1.55rem;
    font-weight: 400;
    letter-spacing: 2px;
    line-height: 1.05;
    white-space: nowrap;
    text-transform: uppercase;
    background: linear-gradient(120deg, #FFFFFF 0%, #A7F3D0 25%, #52B788 50%, #F59E0B 75%, #FFFFFF 100%);
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textShimmerWave 4s ease infinite;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

.sidebar-brand-tagline {
    font-family: 'Poppins', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
    display: inline-block;
    padding: 1px 7px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(82, 183, 136, 0.5);
    animation: taglineGoldPulse 3s infinite ease-in-out;
    width: fit-content;
}

.sidebar-close-btn {
    display: none;
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(255,255,255,0.08);
    color: #94A3B8;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-close-btn:hover { background: rgba(255,255,255,0.15); color:#fff; }

/* ---------- Sidebar Nav ---------- */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius:4px; }

.sidebar-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    padding: 0.6rem 1.2rem 0.3rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0 0.6rem;
    margin-bottom: 0.4rem;
}

/* Main sidebar link */
.sidebar-item { border-radius: var(--radius-md); overflow: hidden; margin-bottom: 2px; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    color: var(--text-sidebar);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.sidebar-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.05);
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.sidebar-label { flex: 1; }

.sidebar-arrow {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.3);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.07);
    color: #FFFFFF;
}
.sidebar-link:hover .sidebar-icon {
    background: var(--primary);
    color: #fff;
}

/* Active single item */
.sidebar-item.active > .sidebar-link {
    background: linear-gradient(135deg, var(--primary), #40916C);
    color: #FFFFFF;
    box-shadow: 0 4px 12px var(--primary-glow);
}
.sidebar-item.active > .sidebar-link .sidebar-icon {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.sidebar-item.active > .sidebar-link .sidebar-arrow { color: rgba(255,255,255,0.6); }

/* Submenu open state */
.sidebar-item.has-submenu.open > .sidebar-link {
    background: rgba(255,255,255,0.07);
    color: #FFFFFF;
}
.sidebar-item.has-submenu.open > .sidebar-link .sidebar-icon {
    background: var(--primary);
    color: #fff;
}
.sidebar-item.has-submenu.open > .sidebar-link .sidebar-arrow {
    transform: rotate(90deg);
    color: #52B788;
}

/* Submenu */
.sidebar-submenu {
    list-style: none;
    padding: 0.3rem 0 0.3rem 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.sidebar-item.has-submenu.open > .sidebar-submenu {
    max-height: 300px;
}

.sidebar-submenu li { margin-bottom: 2px; }
.sidebar-submenu li a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(183,206,191,0.75);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    border-left: 2px solid transparent;
}
.sidebar-submenu li a i { width: 16px; font-size: 0.82rem; }
.sidebar-submenu li a:hover {
    color: #FFFFFF;
    background: rgba(255,255,255,0.06);
    border-left-color: #52B788;
    padding-left: 1rem;
}
.sidebar-submenu li.active a {
    color: #52B788;
    font-weight: 700;
    border-left-color: #52B788;
    background: rgba(82,183,136,0.08);
}

/* ---------- Sidebar Footer ---------- */
.sidebar-footer {
    padding: 0.85rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.sidebar-user-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.05);
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
    min-width: 0;
}
.sidebar-user:hover { background: rgba(255,255,255,0.09); }

.sidebar-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    background: rgba(239, 68, 68, 0.18);
    color: #FCA5A5 !important;
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.sidebar-logout-btn:hover {
    background: #EF4444;
    color: #FFFFFF !important;
    border-color: #EF4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), #40916C);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.sidebar-user-info { display:flex; flex-direction:column; overflow:hidden; }
.sidebar-user-name  { font-size:0.85rem; font-weight:700; color:#FFFFFF; white-space:nowrap; }
.sidebar-user-role  { font-size:0.72rem; color:rgba(255,255,255,0.4); }

/* ==========================================================================
   TOP HEADER
   ========================================================================== */

/* ==========================================================================
   STYLISH EXECUTIVE TOP HEADER
   ========================================================================== */

.app-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(82, 183, 136, 0.22);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0 1.75rem;
    z-index: 200;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
}

/* Top Hairline Accent Line */
.header-top-accent {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1B4332 0%, #2D6A4F 35%, #52B788 70%, #A7F3D0 100%);
}

.hamburger-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(82, 183, 136, 0.3);
    border-radius: 12px;
    background: rgba(82, 183, 136, 0.1);
    color: var(--primary);
    font-size: 1.15rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}
.hamburger-btn:hover { background: var(--primary); color: #fff; transform: scale(1.04); }

/* Header Live System Status Badge */
.header-status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    background: #F0FDF4;
    border: 1px solid #A7F3D0;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    color: #166534;
    box-shadow: inset 0 1px 2px rgba(22, 101, 52, 0.05);
}
.status-pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: statusPulse 2s infinite;
}
@keyframes statusPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.status-divider { color: #CBD5E1; font-weight: 300; }
.header-live-date { color: #475569; font-weight: 600; }

/* Interactive Search Input */
.header-search {
    flex: 1;
    max-width: 380px;
    position: relative;
    display: flex;
    align-items: center;
    z-index: 250;
}
.header-search .search-icon {
    position: absolute;
    left: 1rem;
    color: #94A3B8;
    font-size: 0.92rem;
    transition: color 0.25s ease;
    pointer-events: none;
    z-index: 2;
}
.header-search input {
    width: 100%;
    padding: 0.5rem 1.2rem 0.5rem 2.6rem;
    height: 42px;
    border: 1px solid rgba(82, 183, 136, 0.28);
    border-radius: var(--radius-full);
    background: #F8FAFC;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.28s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
    position: relative;
    z-index: 1;
    pointer-events: auto;
}
.header-search input::placeholder { color: #94A3B8; }
.header-search input:focus {
    outline: none;
    background: #FFFFFF;
    border-color: #52B788;
    box-shadow: 0 0 0 4px rgba(82, 183, 136, 0.18), 0 4px 12px rgba(27, 67, 50, 0.06);
}
.header-search input:focus ~ .search-icon { color: #52B788; }

/* Global Header Search Live Results Dropdown */
.header-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: 320px;
    background: #FFFFFF;
    border: 1px solid rgba(82, 183, 136, 0.35);
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.15), 0 4px 12px rgba(82, 183, 136, 0.1);
    z-index: 9999;
    max-height: 420px;
    overflow-y: auto;
    display: none;
    padding: 0.6rem 0;
    backdrop-filter: blur(12px);
}
.header-search-dropdown.show {
    display: block;
    animation: fadeInDropdown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.search-res-group-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748B;
    padding: 0.4rem 1rem 0.2rem;
    background: #F8FAFC;
    border-top: 1px solid #F1F5F9;
    border-bottom: 1px solid #F1F5F9;
}
.search-res-group-title:first-child { border-top: none; }
.search-res-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    color: #1E293B;
    text-decoration: none;
    transition: background 0.18s ease;
    border-bottom: 1px solid #F8FAFC;
}
.search-res-item:last-child { border-bottom: none; }
.search-res-item:hover {
    background: #F0FDF4;
}
.search-res-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #E8F5E9;
    color: #2D6A4F;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.search-res-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.search-res-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #0F172A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-res-sub {
    font-size: 0.74rem;
    color: #64748B;
    font-weight: 500;
}
.search-res-badge {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 12px;
    background: #E2E8F0;
    color: #475569;
    text-transform: uppercase;
    flex-shrink: 0;
}
.search-res-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: #94A3B8;
    font-size: 0.84rem;
    font-weight: 600;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-left: auto;
}

/* 🌐 Language Switcher Dropdown Pill */
.header-lang-switch {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    height: 38px;
    padding: 0 0.75rem 0 0.85rem;
    background: #F0FDF4;
    border: 1px solid #A7F3D0;
    border-radius: var(--radius-full);
    transition: all 0.25s ease;
    box-shadow: inset 0 1px 2px rgba(22, 101, 52, 0.05);
}
.header-lang-switch:hover {
    border-color: #52B788;
    background: #E8F5E9;
    box-shadow: 0 4px 12px rgba(82, 183, 136, 0.2);
}
.lang-select-dropdown {
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.82rem;
    font-weight: 800;
    color: #166534;
    cursor: pointer;
    padding-right: 0.2rem;
}
.lang-select-dropdown option {
    background: #FFFFFF;
    color: #1E293B;
    font-weight: 700;
}

/* Hide Google Translate top banner iframe and text artifacts */
.goog-te-banner-frame { display: none !important; }
body { top: 0px !important; }
.skiptranslate { font-size: 0 !important; }
.skiptranslate * { font-size: initial; }

.header-quick-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 38px;
    padding: 0 1rem;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #1B4332 0%, #2D6A4F 100%);
    color: #FFFFFF;
    font-size: 0.83rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(27, 67, 50, 0.25);
    transition: all 0.25s ease;
}
.header-quick-add-btn:hover {
    background: linear-gradient(135deg, #2D6A4F 0%, #40916C 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(27, 67, 50, 0.35);
    color: #FFFFFF;
}

.action-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(82, 183, 136, 0.25);
    background: #F8FAFC;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 0.95rem;
}
.action-btn:hover {
    color: #1B4332;
    border-color: #52B788;
    background: #E8F5E9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(82, 183, 136, 0.2);
}

.pulse-badge {
    position: absolute;
    top: -3px; right: -3px;
    width: 18px; height: 18px;
    background: #EF4444;
    color: #FFFFFF;
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #FFFFFF;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

/* User Profile Pill */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.25rem 0.85rem 0.25rem 0.3rem;
    border: 1px solid rgba(82, 183, 136, 0.3);
    border-radius: var(--radius-full);
    background: #F8FAFC;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.user-profile:hover {
    border-color: #52B788;
    background: #E8F5E9;
    box-shadow: 0 4px 12px rgba(82, 183, 136, 0.2);
}

.user-avatar {
    width: 34px; height: 34px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #1B4332 0%, #40916C 100%);
    color: #FFFFFF;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.88rem;
    box-shadow: 0 2px 6px rgba(27, 67, 50, 0.3);
}

.user-info { display: flex; flex-direction: column; }
.user-name  { font-size: 0.83rem; font-weight: 800; color: #1E293B; line-height: 1.2; }
.user-role  { font-size: 0.68rem; font-weight: 700; color: #52B788; text-transform: uppercase; letter-spacing: 0.4px; }

.btn-logout-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: auto !important;
    padding: 0 0.75rem !important;
    height: 34px !important;
    border-radius: var(--radius-full) !important;
    color: #EF4444 !important;
    background: #FEF2F2 !important;
    border: 1px solid #FCA5A5 !important;
    font-weight: 700;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
    text-decoration: none;
}
.btn-logout-pill:hover {
    background: #EF4444 !important;
    color: #FFFFFF !important;
    border-color: #EF4444 !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4) !important;
}

/* ==========================================================================
   PAGE WRAPPER
   ========================================================================== */

.page-wrapper {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 250;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */

.main-content {
    flex: 1;
    padding: 1.75rem 2rem;
    max-width: 1440px;
    width: 100%;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.page-title::before {
    content: '';
    display: inline-block;
    width: 5px; height: 22px;
    background: var(--primary);
    border-radius: var(--radius-full);
}

.breadcrumb { font-size:0.83rem; color:var(--text-muted); margin-top:0.2rem; }
.breadcrumb span { color:var(--primary); font-weight:600; }

/* ==========================================================================
   STAT CARDS
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

/* ── Billing & Listbills Summary Stat Cards ── */
.billing-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.billing-stat-card {
    background: #FFFFFF;
    border-radius: 18px;
    padding: 1.25rem 1.4rem;
    border: 1px solid #E2E8F0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 0;
}
.billing-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

/* Stylish Supply Grid Card Themes */
.billing-stat-card-total {
    border-left: 5px solid #2D6A4F;
    background: linear-gradient(135deg, #FFFFFF 0%, #F0FDF4 100%);
}
.billing-stat-card-amount {
    border-left: 5px solid #0284C7;
    background: linear-gradient(135deg, #FFFFFF 0%, #F0F9FF 100%);
}
.billing-stat-card-paid {
    border-left: 5px solid #10B981;
    background: linear-gradient(135deg, #FFFFFF 0%, #ECFDF5 100%);
}
.billing-stat-card-balance {
    border-left: 5px solid #EF4444;
    background: linear-gradient(135deg, #FFFFFF 0%, #FEF2F2 100%);
}
.billing-stat-card-items {
    border-left: 5px solid #059669;
    background: linear-gradient(135deg, #FFFFFF 0%, #ECFDF5 100%);
}
.billing-stat-card-pending {
    border-left: 5px solid #F59E0B;
    background: linear-gradient(135deg, #FFFFFF 0%, #FFFBEB 100%);
}

/* ── Shared Page Header Button ── */
.bill-header-btn-wrap {
    display: flex;
    align-items: center;
}
.bill-view-btn {
    background: linear-gradient(135deg, #2D6A4F 0%, #1B4332 100%) !important;
    color: #fff !important;
    padding: 0.65rem 1.4rem !important;
    border-radius: 30px !important;
    font-weight: 700 !important;
    font-size: 0.88rem !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    box-shadow: 0 4px 12px rgba(27,67,50,0.25) !important;
    text-decoration: none !important;
    white-space: nowrap;
    transition: all 0.2s ease !important;
}
.bill-view-btn:hover {
    background: linear-gradient(135deg, #40916C 0%, #2D6A4F 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 18px rgba(27,67,50,0.35) !important;
    color: #fff !important;
}

.dashboard-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    margin-bottom: 1.75rem;
}

@media (min-width: 1600px) {
    .dashboard-metrics-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.dashboard-categories-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.dashboard-booth-stats-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin: 0 1.5rem 1.5rem;
}

.stat-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 1.15rem 1.3rem;
    border: 1px solid var(--border, #E2E8F0);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 0;
    position: relative;
    overflow: hidden;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08); }

/* Modern Card Theme Variants */
.stat-card-retail { border-left: 4px solid #0284C7; background: linear-gradient(135deg, #FFFFFF 0%, #F0F9FF 100%); }
.stat-card-retail .stat-label { color: #0369A1; }
.stat-card-retail .stat-value { color: #0284C7; }

.stat-card-credit { border-left: 4px solid #F59E0B; background: linear-gradient(135deg, #FFFFFF 0%, #FFFBEB 100%); }
.stat-card-credit .stat-label { color: #B45309; }
.stat-card-credit .stat-value { color: #D97706; }

.stat-card-paid { border-left: 4px solid #10B981; background: linear-gradient(135deg, #FFFFFF 0%, #ECFDF5 100%); }
.stat-card-paid .stat-label { color: #047857; }
.stat-card-paid .stat-value { color: #10B981; }

.stat-card-balance { border-left: 4px solid #EF4444; background: linear-gradient(135deg, #FFFFFF 0%, #FEF2F2 100%); }
.stat-card-balance .stat-label { color: #B91C1C; }
.stat-card-balance .stat-value { color: #EF4444; }

.stat-card-unpaid { border-left: 4px solid #DC2626; background: linear-gradient(135deg, #FFFFFF 0%, #FEF2F2 100%); }
.stat-card-unpaid .stat-label { color: #991B1B; }
.stat-card-unpaid .stat-value { color: #DC2626; }

.stat-card-partial { border-left: 4px solid #D97706; background: linear-gradient(135deg, #FFFFFF 0%, #FFFBEB 100%); }
.stat-card-partial .stat-label { color: #92400E; }
.stat-card-partial .stat-value { color: #D97706; }

.stat-card-liters { border-left: 4px solid #16A34A; background: linear-gradient(135deg, #FFFFFF 0%, #F0FDF4 100%); }
.stat-card-liters .stat-label { color: #15803D; }
.stat-card-liters .stat-value { color: #16A34A; }

.stat-card-supply { border-left: 4px solid #9333EA; background: linear-gradient(135deg, #FFFFFF 0%, #FAF5FF 100%); }
.stat-card-supply .stat-label { color: #7E22CE; }
.stat-card-supply .stat-value { color: #9333EA; }

/* Stat Card Icon Variants */
.stat-icon-retail { background: #E0F2FE; color: #0284C7; }
.stat-icon-credit { background: #FEF3C7; color: #D97706; }
.stat-icon-paid   { background: #ECFDF5; color: #10B981; }
.stat-icon-balance{ background: #FEE2E2; color: #EF4444; }
.stat-icon-unpaid { background: #FEE2E2; color: #DC2626; }
.stat-icon-partial{ background: #FEF3C7; color: #D97706; }
.stat-icon-liters { background: #F0FDF4; color: #16A34A; }
.stat-icon-supply { background: #F3E8FF; color: #9333EA; }

/* Stat Card Footer Sub-tag Pills for Laptop & Desktop Clarity */
.stat-footer-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    margin-top: 0.4rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    letter-spacing: 0.2px;
    width: fit-content;
}
.stat-footer-tag.tag-retail { background: #E0F2FE; color: #0369A1; border: 1px solid #BAE6FD; }
.stat-footer-tag.tag-credit { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; }
.stat-footer-tag.tag-paid   { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.stat-footer-tag.tag-balance{ background: #FEF2F2; color: #B91C1C; border: 1px solid #FCA5A5; }
.stat-footer-tag.tag-unpaid { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }
.stat-footer-tag.tag-partial{ background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.stat-footer-tag.tag-liters { background: #F0FDF4; color: #15803D; border: 1px solid #BBF7D0; }
.stat-footer-tag.tag-supply { background: #F3E8FF; color: #7E22CE; border: 1px solid #E9D5FF; }

/* 💳 Settlement Breakdown Widget Styles */
.settlement-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.settlement-box {
    padding: 1rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s ease;
}
.settlement-box:hover { transform: translateY(-2px); }
.settlement-box-paid { background: #ECFDF5; border: 1.5px solid #A7F3D0; }
.settlement-box-paid .settlement-box-title { font-size: 0.78rem; font-weight: 700; color: #065F46; text-transform: uppercase; letter-spacing: 0.5px; display: block; }
.settlement-box-paid .settlement-box-val { margin: 0.2rem 0 0; font-size: 1.35rem; color: #047857; font-weight: 800; }
.settlement-box-paid .settlement-box-sub { font-size: 0.78rem; color: #059669; font-weight: 600; display: block; }
.settlement-box-paid .settlement-box-icon { width: 44px; height: 44px; border-radius: 50%; background: #10B981; color: #FFF; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }

.settlement-box-partial { background: #FEF3C7; border: 1.5px solid #FDE68A; }
.settlement-box-partial .settlement-box-title { font-size: 0.78rem; font-weight: 700; color: #92400E; text-transform: uppercase; letter-spacing: 0.5px; display: block; }
.settlement-box-partial .settlement-box-val { margin: 0.2rem 0 0; font-size: 1.35rem; color: #B45309; font-weight: 800; }
.settlement-box-partial .settlement-box-sub { font-size: 0.78rem; color: #D97706; font-weight: 600; display: block; }
.settlement-box-partial .settlement-box-icon { width: 44px; height: 44px; border-radius: 50%; background: #F59E0B; color: #FFF; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }

.settlement-box-unpaid { background: #FEF2F2; border: 1.5px solid #FCA5A5; }
.settlement-box-unpaid .settlement-box-title { font-size: 0.78rem; font-weight: 700; color: #991B1B; text-transform: uppercase; letter-spacing: 0.5px; display: block; }
.settlement-box-unpaid .settlement-box-val { margin: 0.2rem 0 0; font-size: 1.35rem; color: #B91C1C; font-weight: 800; }
.settlement-box-unpaid .settlement-box-sub { font-size: 0.78rem; color: #DC2626; font-weight: 600; display: block; }
.settlement-box-unpaid .settlement-box-icon { width: 44px; height: 44px; border-radius: 50%; background: #EF4444; color: #FFF; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stat-value {
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    font-weight: 800;
    color: var(--text-main);
    margin-top: 0.2rem;
    line-height: 1.25;
    word-break: break-word;
}
.stat-value.val-unit-text {
    font-size: clamp(0.9rem, 1.6vw, 1.15rem);
    color: #D97706;
    word-break: break-word;
}

.stat-icon {
    width: 46px; height: 46px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* ==========================================================================
   CARD & FORM CONTAINERS
   ========================================================================== */

.content-grid {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 1.5rem;
    align-items: start;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.card-header-compact {
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.6rem;
    margin-bottom: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.card-title i { color: var(--primary); }

.card-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ==========================================================================
   FORM CONTROLS & GRID
   ========================================================================== */

.form-compact-container {
    max-width: 720px;
    width: 100%;
    margin: 0 auto 2rem auto;
}

.form-hero-card {
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.04);
}

.form-grid-2-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem 1.2rem;
}

.span-full {
    grid-column: span 2;
}

.form-group-stacked {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
}

.form-label {
    display: block;
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--text-main);
}
.form-label i { color: var(--primary); margin-right: 0.3rem; }
.form-label span.req { color: var(--primary); }

.form-control-compact {
    width: 100%;
    height: 38px;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-main);
    background: #fff;
    transition: var(--transition);
}
.form-control-compact:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.highlight-total {
    background: #E8F5E9 !important;
    font-weight: 800 !important;
    color: var(--primary) !important;
    border-color: #95D5B2 !important;
}

.form-action-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* ── Vendor Add Form – Inline Label + Input Layout ── */
.vendor-inline-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.vendor-inline-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.vendor-inline-label {
    flex: 0 0 130px;
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    line-height: 1.3;
}
.vendor-inline-label i {
    color: var(--primary);
    margin-right: 0.3rem;
}
.vendor-inline-label .req { color: var(--primary); }

.vendor-inline-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.vendor-input {
    flex: 1;
    min-width: 0;
}

/* Narrower input for numeric fields like Price */
.vendor-input-sm {
    max-width: 160px;
    flex: 0 0 160px;
}

.vendor-auto-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #10B981;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    border-radius: 20px;
    padding: 0.15rem 0.55rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 1.4rem;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, #2D6A4F 0%, #1B4332 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(45, 106, 79, 0.35);
    border: 1px solid rgba(82, 183, 136, 0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #40916C 0%, #2D6A4F 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(82, 183, 136, 0.45);
}

.btn-sm   { padding: 0.42rem 0.9rem; font-size: 0.8rem; border-radius: var(--radius-sm); font-weight: 700; }
.btn-block { width: 100%; }

.btn-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: #fff;
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}
.btn-warning:hover {
    background: linear-gradient(135deg, #FBBF24 0%, #D97706 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.45);
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: #fff;
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    background: linear-gradient(135deg, #F87171 0%, #B91C1C 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.45);
}

.btn-view-all {
    background: linear-gradient(135deg, #06B6D4 0%, #0891B2 100%) !important;
    color: #FFFFFF !important;
    height: 38px;
    padding: 0.55rem 1.2rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: 1px solid rgba(6, 182, 212, 0.4) !important;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}
.btn-view-all:hover {
    background: linear-gradient(135deg, #22D3EE 0%, #0284C7 100%) !important;
    color: #FFFFFF !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(6, 182, 212, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, #F97316 0%, #EA580C 100%) !important;
    color: #FFFFFF !important;
    border: 1px solid rgba(249, 115, 22, 0.4) !important;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
    font-weight: 700;
    transition: var(--transition);
}
.btn-secondary:hover {
    background: linear-gradient(135deg, #FB923C 0%, #C2410C 100%) !important;
    color: #FFFFFF !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.5);
}

/* ==========================================================================
   FILTER SECTION & EXPORT TOOLBAR
   ========================================================================== */

.filter-supply-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 1.4rem;
    margin-bottom: 1.5rem;
}

.filter-supply-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.filter-supply-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}

.filter-date-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 180px;
}

.filter-btn-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.filter-btn-dark {
    background: linear-gradient(135deg, #1B4332 0%, #2D6A4F 100%);
    color: #fff;
    font-weight: 700;
    padding: 0.55rem 1.4rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(82, 183, 136, 0.4);
    cursor: pointer;
    height: 38px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.35);
}
.filter-btn-dark:hover {
    background: linear-gradient(135deg, #2D6A4F 0%, #52B788 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 18px rgba(82, 183, 136, 0.5);
}

.export-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

.export-btn-group { display:flex; align-items:center; gap:0.5rem; flex-wrap:wrap; }

.btn-export {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    color: #F8FAFC;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex; align-items: center; gap: 0.4rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}
.btn-export:hover {
    background: linear-gradient(135deg, #2D6A4F 0%, #1B4332 100%);
    color: #FFFFFF;
    border-color: rgba(82, 183, 136, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(45, 106, 79, 0.4);
}

.search-box-wrap {
    min-width: 240px;
}

.status-filter-wrap {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}
.status-filter-wrap select {
    width: 140px;
}

/* ==========================================================================
   TABLE & MOBILE SCROLL OPTIMIZATION
   ========================================================================== */

.mobile-table-hint {
    display: none;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    position: relative;
    border: 1px solid var(--border-light);
    box-shadow: inset -8px 0 8px -8px rgba(0, 0, 0, 0.12);
}

.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 100%;
}

.custom-table th {
    background: var(--sidebar-bg);
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.85rem 1rem;
    text-align: left;
    white-space: nowrap;
}
.custom-table th:first-child { border-top-left-radius: var(--radius-md); }
.custom-table th:last-child  { border-top-right-radius: var(--radius-md); }

.custom-table td {
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-light);
    background: #fff;
    transition: var(--transition);
}

/* Sticky First Column for Mobile & Tablet Horizontal Scroll */
.custom-table th:first-child,
.custom-table td:first-child:not([colspan]),
.up-table th:first-child,
.up-table td:first-child:not([colspan]) {
    position: sticky;
    left: 0;
    z-index: 5;
    background: #FFFFFF;
    box-shadow: 3px 0 6px rgba(0, 0, 0, 0.06);
}

/* Colspan Empty State Rows must never be sticky and must wrap text naturally */
.custom-table td[colspan],
.up-table td[colspan] {
    position: static !important;
    white-space: normal !important;
    text-align: center !important;
    box-shadow: none !important;
    background: #FFFFFF !important;
}

.custom-table th:first-child,
.up-table th:first-child {
    background: var(--sidebar-bg);
    z-index: 6;
}

.custom-table tr:hover td, .up-table tr:hover td { 
    background: var(--primary-light); 
}
.custom-table tr:hover td:first-child, .up-table tr:hover td:first-child { 
    background: var(--primary-light); 
}

.action-btns-wrap { 
    display: flex; 
    align-items: center; 
    gap: 0.4rem; 
    white-space: nowrap;
}

.table-pagination-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: #64748B;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ── Grand Total Footer Row ── */
.custom-table tfoot {
    position: sticky;
    bottom: 0;
    z-index: 10;
}
.grand-total-row td {
    background: linear-gradient(135deg, #1B2E3C 0%, #0F1F2E 100%) !important;
    color: #F8FAFC !important;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.85rem 0.75rem;
    border-top: 2.5px solid var(--primary);
    border-bottom: none !important;
    white-space: nowrap;
}
/* Override sticky first-column white bg for tfoot */
.custom-table .grand-total-row td:first-child,
.custom-table tfoot .grand-total-row td:first-child {
    position: sticky;
    left: 0;
    z-index: 12;
    background: linear-gradient(135deg, #1B2E3C 0%, #0F1F2E 100%) !important;
    box-shadow: 3px 0 8px rgba(0,0,0,0.3);
    color: #F8FAFC !important;
}
.grand-total-row:hover td,
.custom-table .grand-total-row:hover td,
.custom-table .grand-total-row:hover td:first-child {
    background: linear-gradient(135deg, #243447 0%, #1B2E3C 100%) !important;
}
.grand-total-label {
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #F8FAFC !important;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.grand-total-label i { color: var(--primary); font-size: 0.95rem; }
.grand-total-label .gt-count {
    font-size: 0.76rem;
    font-weight: 500;
    color: #94A3B8;
    margin-left: 0.3rem;
}
.gt-val {
    font-size: 1rem;
    font-weight: 800;
}
.gt-val-blue   { color: #60C6FA !important; }
.gt-val-yellow { color: #FCD34D !important; }
.gt-val-green  { color: #4ADE80 !important; }
.gt-val-red    { color: #F87171 !important; }
.gt-val-purple { color: #C4B5FD !important; }
.gt-val-muted  { color: #94A3B8 !important; font-size: 0.82rem; font-weight: 500; }
.gt-qty-badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.88rem;
}
.gt-qty-blue   { background: rgba(96, 198, 250, 0.18); color: #60C6FA; }
.gt-qty-yellow { background: rgba(252, 211, 77, 0.18);  color: #FCD34D; }
.gt-qty-purple { background: rgba(196,181,253, 0.18);   color: #C4B5FD; }

/* Badges */
.badge { 
    display: inline-block; 
    padding: 0.25rem 0.65rem; 
    border-radius: var(--radius-full); 
    font-size: 0.75rem; 
    font-weight: 700;
    white-space: nowrap;
}
.badge-received  { background:#D8F3DC; color:#1B4332; }
.badge-pending   { background:#FEF3C7; color:#92400E; }
.badge-cancelled { background:#FDE8E8; color:#9B1C1C; }

/* ==========================================================================
   MODAL
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11,37,25,0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.28s ease;
    padding: 1rem;
}
.modal-overlay.active { opacity:1; visibility:visible; }

.modal-card {
    background: #fff;
    width: 100%;
    max-width: 650px;
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 48px rgba(0,0,0,0.22);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.28s ease;
}
.modal-overlay.active .modal-card { transform: translateY(0); }

.modal-header {
    background: var(--sidebar-bg);
    color: #fff;
    padding: 1.1rem 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title { font-size:1.05rem; font-weight:700; display:flex; align-items:center; gap:0.5rem; }
.modal-close-btn { background:transparent; border:none; color:#94A3B8; font-size:1.2rem; cursor:pointer; transition:var(--transition); }
.modal-close-btn:hover { color:#fff; }

.modal-body { padding: 1.4rem; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
}
.btn-cancel {
    background: #E2E8F0;
    color: #475569;
}

/* ==========================================================================
   ALERTS
   ========================================================================== */

.alert {
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.alert-success { background:#D8F3DC; color:#1B4332; border:1px solid #95D5B2; }
.alert-danger   { background:#FDE8E8; color:#9B1C1C; border:1px solid #FBD5D5; }

/* ==========================================================================
   FOOTER
   ========================================================================== */

.app-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    padding: 1.1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: auto;
    width: 100%;
}
.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    text-align: center;
}
.footer-divider {
    color: #CBD5E1;
    font-weight: 700;
}
.app-footer strong {
    color: var(--text-main);
    font-weight: 800;
}
.app-footer .brand-highlight {
    color: var(--primary) !important;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* Booth Receive Form Controls & Table Inputs */
.booth-receive-top-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.booth-receive-date-group {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}
.receive-date-picker {
    width: 180px;
}
.btn-save-receive {
    padding: 0.6rem 1.6rem;
    font-size: 0.9rem;
    height: 38px;
    white-space: nowrap;
}
.retail-input, .credit-input {
    text-align: center;
    width: 110px;
    max-width: 100%;
    margin: 0 auto;
}

/* ==========================================================================
   RESPONSIVE (MOBILE & TABLET ADJUSTMENTS FOR ALL CONTAINERS, LABELS, INPUTS & TABLES)
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .main-content { padding: 1.25rem; }
    .billing-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Mobile */
@media (max-width: 768px) {

    /* Sidebar slides in from left on mobile */
    .sidebar {
        transform: translateX(-100%);
        z-index: 300;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close-btn { display: flex; }

    /* Header stretches full width on mobile */
    .app-header {
        left: 0;
        padding: 0 0.6rem;
        gap: 0.5rem;
        overflow: hidden;
    }
    .hamburger-btn { display: flex; }

    /* Hide date badge on mobile - takes too much space */
    .header-status-badge { display: none; }

    /* Shrink lang switcher on mobile */
    .header-lang-switch {
        height: 34px;
        padding: 0 0.45rem;
        gap: 0.25rem;
    }
    .lang-select-dropdown {
        font-size: 0.74rem;
        max-width: 90px;
    }

    /* Shrink Quick Add button - show icon only on very small screens */
    .header-quick-add-btn {
        height: 34px;
        padding: 0 0.65rem;
        font-size: 0.78rem;
        gap: 0.3rem;
    }

    /* Shrink header actions gap */
    .header-actions {
        gap: 0.4rem;
        margin-left: auto;
        flex-shrink: 0;
    }

    /* Shrink action buttons */
    .action-btn {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }

    /* Page wrapper uses full width */
    .page-wrapper { margin-left: 0; }

    /* Mobile Topbar Profile & Logout Adjustments */
    .user-info {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        max-width: 120px;
        overflow: hidden;
    }
    .user-name {
        font-size: 0.76rem !important;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        max-width: 110px;
    }
    .user-booth-tag, .user-role {
        font-size: 0.66rem !important;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        max-width: 110px;
    }
    .user-profile {
        padding: 0.2rem 0.65rem 0.2rem 0.3rem !important;
        border: 1px solid rgba(82, 183, 136, 0.35) !important;
        background: #F8FAFC !important;
        border-radius: 20px !important;
        gap: 0.35rem !important;
    }
    .user-avatar {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.76rem !important;
    }
    .topbar-logout-text {
        display: none !important;
    }
    .btn-logout-pill {
        width: 34px !important;
        height: 34px !important;
        padding: 0 !important;
        justify-content: center !important;
        border-radius: var(--radius-md) !important;
    }

    /* Container & Card Paddings */
    .main-content {
        padding: 1rem 0.75rem;
    }
    .content-grid {
        grid-template-columns: 1fr;
        gap: 1.15rem;
    }
    .form-compact-container {
        padding: 0;
        margin-bottom: 1.25rem;
    }
    .card {
        padding: 1rem 0.85rem;
        border-radius: var(--radius-md);
        margin-bottom: 1.15rem;
    }
    .form-hero-card {
        padding: 1rem 0.85rem;
    }

    /* Form Grid & Inputs on Mobile */
    .form-grid-2-compact {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .span-full {
        grid-column: span 1 / -1;
    }
    .form-group-stacked {
        margin-bottom: 0.2rem;
        gap: 0.25rem;
    }
    .form-label {
        font-size: 0.82rem;
    }
    .form-control-compact {
        height: 40px;
        font-size: 0.88rem;
        padding: 0.5rem 0.75rem;
    }
    .form-action-row {
        margin-top: 0.85rem;
    }
    .btn-submit-mobile {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    /* Vendor Inline Form – Mobile: keep label LEFT, input RIGHT (still inline row) */
    .vendor-inline-row {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }
    .vendor-inline-label {
        flex: 0 0 100px;
        width: 100px;
        white-space: nowrap;
        font-size: 0.78rem;
    }
    .vendor-input {
        flex: 1 1 0;
        min-width: 0;
        width: 100% !important;
        max-width: 100% !important;
    }
    .vendor-input-sm {
        flex: 1 1 0;
        min-width: 0;
        max-width: 100% !important;
    }
    .vendor-inline-input-wrap {
        flex: 1;
        min-width: 0;
        width: auto;
    }

    /* Filter Supply Section */
    .filter-supply-card {
        padding: 1rem 0.85rem;
    }
    .filter-supply-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .filter-date-item {
        width: 100%;
        min-width: 0;
    }
    .filter-btn-group {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }
    .filter-btn-dark, .btn-view-all {
        flex: 1;
        justify-content: center;
        text-align: center;
        height: 40px;
    }

    /* Export Toolbar & Search Box */
    .export-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .export-btn-group {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 0.3rem;
    }
    .btn-export {
        padding: 0.45rem 0.2rem;
        font-size: 0.73rem;
        justify-content: center;
    }
    .search-box-wrap {
        width: 100%;
        min-width: 0;
    }

    /* ── MVS Filter Card (booth_report, datewisevendor, milk_vs_supply etc.) ── */
    .mvs-filter-card {
        padding: 1rem 0.85rem;
    }
    .mvs-form-grid {
        max-width: 100%;
    }
    /* Keep label + input on same row on mobile — just shrink label */
    .mvs-inline-row {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }
    .mvs-inline-row .mvs-label {
        width: 90px;
        flex-shrink: 0;
        font-size: 0.78rem;
    }
    .mvs-sep-arrow {
        display: none;
    }
    .mvs-btn-row {
        flex-direction: column;
        align-items: stretch;
    }
    .mvs-generate-btn,
    .mvs-reset-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    /* Mobile Data Table & Touch Horizontal Scroll Fix */
    .mobile-table-hint {
        display: flex !important;
        align-items: center;
        gap: 0.4rem;
        font-size: 0.74rem;
        font-weight: 700;
        color: #0284C7;
        background: #EFF6FF;
        border: 1px solid #BAE6FD;
        border-radius: 8px;
        padding: 0.4rem 0.75rem;
        margin: 0.5rem 0.75rem 0.75rem 0.75rem;
    }
    .app-footer {
        padding: 1rem 0.85rem !important;
        text-align: center !important;
        justify-content: center !important;
    }
    .footer-content {
        flex-direction: column !important;
        gap: 0.35rem !important;
        text-align: center !important;
        width: 100% !important;
    }
    .footer-divider {
        display: none !important;
    }
    .footer-left, .footer-right {
        font-size: 0.78rem !important;
        line-height: 1.4 !important;
        text-align: center !important;
    }
    .table-responsive {
        border-radius: 12px !important;
        border: 1px solid #E2E8F0 !important;
        margin: 0 0.5rem 1rem 0.5rem !important;
        width: calc(100% - 1rem) !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        box-shadow: inset -6px 0 6px -6px rgba(0,0,0,0.1) !important;
    }
    .custom-table, .up-table {
        width: 100% !important;
        min-width: 100% !important;
    }
    .custom-table th, .custom-table td:not([colspan]),
    .up-table th, .up-table td:not([colspan]) {
        padding: 0.7rem 0.8rem !important;
        font-size: 0.82rem !important;
        white-space: nowrap !important;
        vertical-align: middle !important;
    }
    .custom-table td[colspan],
    .up-table td[colspan] {
        position: static !important;
        white-space: normal !important;
        text-align: center !important;
        box-shadow: none !important;
        background: #FFFFFF !important;
    }
    .booth-receive-top-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
    }
    .booth-receive-date-group {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .booth-receive-date-group .form-group-stacked,
    .receive-date-picker {
        width: 100% !important;
    }
    .btn-save-receive {
        width: 100% !important;
        justify-content: center;
    }
    .booth-receive-top-row .search-box-wrap {
        width: 100% !important;
    }
    .action-btns-wrap .btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.73rem;
    }
    .status-filter-wrap {
        width: 100%;
    }
    .status-filter-wrap select {
        width: 100% !important;
    }
    .table-pagination-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    /* MVS Pagination row */
    .mvs-pagination-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem 0.85rem;
    }
    .mvs-page-btns {
        flex-wrap: wrap;
    }
    .mvs-page-btn {
        min-width: 32px;
        height: 32px;
        font-size: 0.78rem;
    }

    /* Header & Page Header */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }
    .page-header > div:last-child {
        width: 100%;
    }
    .page-header .btn {
        width: 100%;
        justify-content: center;
    }
    .page-title {
        font-size: 1.2rem;
    }

    /* Inline export toolbar used in booth_report (inline style override) */
    [style*="display:flex"][style*="justify-content:space-between"].export-toolbar,
    div.export-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
        padding: 0.75rem 0.75rem !important;
    }
    .stats-grid,
    .dashboard-categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }
    .billing-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }
    .billing-stats-grid > .billing-stat-card:last-child:nth-child(odd) {
        grid-column: span 2;
    }
    .billing-stat-card {
        padding: 0.9rem 1rem;
        border-radius: 14px;
        gap: 0.5rem;
    }
    .billing-stat-card > div:first-child > div:first-child {
        font-size: 0.68rem !important;
        letter-spacing: 0.2px;
        white-space: normal;
        line-height: 1.2;
    }
    .billing-stat-card > div:first-child > div:last-child {
        font-size: 1.35rem !important;
    }
    .billing-stat-card > div:last-child {
        width: 36px !important;
        height: 36px !important;
        font-size: 1rem !important;
        border-radius: 10px !important;
        flex-shrink: 0;
    }
    .bill-header-btn-wrap {
        width: 100%;
    }
    .bill-view-btn {
        width: 100% !important;
        justify-content: center !important;
    }
    .dashboard-metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.6rem !important;
        margin-bottom: 1.25rem !important;
    }
    .dashboard-booth-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin: 0 0.5rem 1rem;
    }
    .stat-card {
        padding: 0.75rem 0.7rem !important;
        border-radius: 14px !important;
        gap: 0.35rem !important;
    }
    .stat-label {
        font-size: 0.68rem !important;
        letter-spacing: 0.2px !important;
        white-space: normal !important;
        line-height: 1.15 !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .stat-value {
        font-size: 1.12rem !important;
        margin-top: 0.15rem !important;
        line-height: 1.15 !important;
    }
    .stat-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.9rem !important;
        border-radius: 10px !important;
        flex-shrink: 0;
    }
    .stat-footer-tag {
        display: none !important;
    }
    .settlement-stats-grid {
        grid-template-columns: 1fr !important;
        gap: 0.6rem !important;
    }
    .settlement-box {
        padding: 0.75rem 0.85rem !important;
    }
    .settlement-box-val {
        font-size: 1.15rem !important;
    }
    .settlement-box-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.95rem !important;
    }

    .header-search { max-width: 140px; flex-shrink: 1; min-width: 80px; }

    /* Modal Responsive */
    .modal-card {
        max-width: 96vw;
        max-height: 90vh;
        display: flex;
        flex-direction: column;
        margin: 0 0.25rem;
        border-radius: var(--radius-lg);
    }
    .modal-body {
        overflow-y: auto;
        max-height: calc(90vh - 65px);
        padding: 1rem 0.85rem;
    }
}

@media (max-width: 480px) {
    .export-btn-group {
        grid-template-columns: repeat(3, 1fr);
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .billing-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    .billing-stat-card {
        padding: 0.75rem 0.8rem;
    }
    .bill-btn-text {
        display: none;
    }
    .bill-view-btn {
        padding: 0.65rem 1rem !important;
    }
    .dashboard-metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    /* Hide search on very small screens */
    .header-search {
        display: none;
    }
    /* Hide lang switch text label - icon only */
    .header-lang-switch {
        padding: 0 0.4rem;
    }
    /* Hide "New Bill" text - icon only */
    .header-quick-add-btn span {
        display: none;
    }
    .header-quick-add-btn {
        padding: 0 0.55rem;
        min-width: 34px;
        justify-content: center;
    }
    /* Compact user profile on tiny screens */
    .user-profile {
        padding: 0.25rem 0.35rem;
    }
    /* Even smaller table font on tiny screens */
    .custom-table th, .custom-table td {
        padding: 0.55rem 0.5rem;
        font-size: 0.78rem;
    }
    .grand-total-row td {
        padding: 0.65rem 0.5rem !important;
        font-size: 0.78rem !important;
    }
    .grand-total-label {
        font-size: 0.8rem !important;
    }
    .gt-val {
        font-size: 0.85rem !important;
    }
    /* Stat card label smaller */
    .stat-label {
        font-size: 0.72rem;
    }
    .stat-value {
        font-size: 1.1rem;
    }
    /* Full-width generate/reset buttons */
    .mvs-generate-btn,
    .mvs-reset-btn {
        padding: 0.6rem 1rem;
        font-size: 0.84rem;
    }
    /* Card padding tighter */
    .card {
        padding: 0.75rem 0.65rem;
    }
    .mvs-filter-card {
        padding: 0.85rem 0.65rem;
    }
}

/* Large screens */
@media (min-width: 1920px) {
    .main-content { max-width: 1700px; }
}

/* ==========================================================================
   ALL PRODUCT CREDIT & RETAIL SALES DIRECTORY GRID
   ========================================================================== */
.product-sales-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.product-grid-card {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    padding: 1.15rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.product-grid-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(45, 106, 79, 0.12);
    border-color: rgba(82, 183, 136, 0.4);
}

.product-grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.9rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed var(--border);
}

.product-grid-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.product-grid-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    line-height: 1.2;
}

.product-grid-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.product-grid-total-badge {
    text-align: right;
}
.product-grid-total-badge span {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}
.product-grid-total-badge strong {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary);
}

.product-grid-body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.ps-mini-box {
    padding: 0.7rem 0.8rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ps-box-retail {
    background: #F0F9FF;
    border: 1px solid #BAE6FD;
}
.ps-box-credit {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
}

.ps-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.3rem;
}

.ps-badge-retail {
    background: #E0F2FE;
    color: #0284C7;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
}
.ps-badge-credit {
    background: #FEF3C7;
    color: #D97706;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
}

.ps-box-val {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.2rem;
}
.ps-box-retail .ps-box-val { color: #0284C7; }
.ps-box-credit .ps-box-val { color: #D97706; }

.ps-box-sub {
    font-size: 0.74rem;
    font-weight: 600;
    color: #64748B;
}

.product-grid-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.78rem;
}
.ps-foot-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.ps-foot-label {
    color: var(--text-muted);
    font-weight: 600;
}

@media (max-width: 640px) {
    .product-sales-grid-container {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
}

