/* ==================== DESIGN SYSTEM & GLOBAL VARIABLES ==================== */
:root {
    /* Harmony Color Palette (The Pizza Company Green & Red Theme) */
    --bg-primary: #004d26;
    --bg-secondary: rgba(0, 64, 32, 0.85);
    --bg-sidebar: #002d16;
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;
    --border-color: rgba(0, 90, 48, 0.15);
    --border-color-glow: rgba(0, 90, 48, 0.35);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a3aab0;
    --text-muted: #67756f;

    /* Brand & Accent Colors */
    --color-primary: #005a30;
    /* TPC Green */
    --color-primary-hover: #004c27;
    --color-accent: #da291c;
    /* TPC Red */
    --color-accent-hover: #be1c12;

    /* Status Colors */
    --color-success: #22c55e;
    --color-success-bg: rgba(34, 197, 94, 0.15);
    --color-danger: #ef4444;
    /* Soft Red */
    --color-danger-bg: rgba(239, 68, 68, 0.15);
    --color-warning: #eab308;
    /* Amber Yellow */
    --color-warning-bg: rgba(234, 179, 8, 0.15);

    /* Shadows & Border Radius */
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 15px rgba(15, 118, 67, 0.35);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    /* Font Stack */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Outfit', sans-serif;

    /* Transition Speed */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== GLOBAL STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Glowing Blobs */
body::before,
body::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: var(--radius-full);
    filter: blur(120px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.15;
}

body::before {
    top: 10%;
    left: 20%;
    background-color: var(--color-primary);
}

body::after {
    bottom: 15%;
    right: 15%;
    background-color: var(--color-accent);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* ==================== REUSABLE UTILITIES ==================== */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-admin {
    background-color: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-user {
    background-color: rgba(6, 182, 212, 0.2);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-region {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 0.85rem;
}

.status-yes {
    color: var(--color-success);
}

.status-no {
    color: var(--color-danger);
}

.hidden {
    display: none !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #1ea65a 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(15, 118, 67, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(15, 118, 67, 0.4), var(--shadow-glow);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

.btn-clear {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-clear:hover {
    color: var(--color-danger);
}

/* ==================== PAGE: LOGIN PAGE ==================== */
#login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-premium);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    transition: var(--transition-smooth);
}

.login-card:hover {
    border-color: rgba(0, 138, 7, 0.911);
    box-shadow: var(--shadow-premium), 0 0 25px rgba(0, 95, 29, 0.815);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-container {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.3);
}

.logo-icon {
    font-size: 28px;
    color: white;
}

.login-header h1 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(to right, #ffffff, #d1d5db);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Forms input */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group label i {
    margin-right: 4px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background-color: rgba(10, 10, 15, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.error-message {
    background-color: var(--color-danger-bg);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-footer {
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.test-accounts {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.test-accounts span {
    background-color: rgba(255, 255, 255, 0.03);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    display: inline-block;
    color: var(--text-secondary);
}

/* ==================== WORKSPACE LAYOUT ==================== */
#app-page {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: 80px;
    padding: 30px 10px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    margin-bottom: 40px;
    width: 100%;
    transition: var(--transition-smooth);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo i {
    color: var(--color-primary);
    font-size: 1.4rem;
}

.sidebar-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 6px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar.collapsed .sidebar-brand {
    flex-direction: column;
    gap: 20px;
    justify-content: center;
}

.sidebar.collapsed .brand-logo span {
    display: none;
}

.user-profile-sidebar {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
    transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1), justify-content 0.3s;
}

.sidebar.collapsed .user-profile-sidebar {
    padding: 8px;
    justify-content: center;
}

.user-profile-sidebar .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.user-profile-sidebar .info {
    transition: opacity 0.2s;
}

.sidebar.collapsed .user-profile-sidebar .info {
    display: none;
}

.user-profile-sidebar .info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-profile-sidebar .info span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Sidebar Menu Navigation */
.sidebar-nav {
    flex-grow: 1;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav .nav-item {
    margin-bottom: 8px;
}

.sidebar-nav .nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.sidebar.collapsed .sidebar-nav .nav-item a {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.collapsed .sidebar-nav .nav-item a i {
    font-size: 1.25rem;
    margin: 0;
}

.sidebar.collapsed .sidebar-nav .nav-item a span {
    display: none;
}

.sidebar-nav .nav-item:hover a {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.02);
}

.sidebar-nav .nav-item.active a {
    color: white;
    background: linear-gradient(90deg, rgba(15, 118, 67, 0.15) 0%, rgba(15, 118, 67, 0.02) 100%);
    border-left: 3px solid var(--color-primary);
    font-weight: 600;
}

.sidebar.collapsed .sidebar-nav .nav-item.active a {
    border-left: none;
    border-bottom: 3px solid var(--color-primary);
    border-radius: 0;
}

.sidebar-footer {
    margin-top: auto;
    transition: var(--transition-smooth);
}

.sidebar.collapsed .sidebar-footer {
    display: flex;
    justify-content: center;
    width: 100%;
}

.sidebar.collapsed #logout-btn {
    padding: 10px 0;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.sidebar.collapsed #logout-btn span {
    display: none;
}

/* Main Content Area kích thước viền trống vùng Dashboard */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100vh;
    min-width: 0;
}

/* Header/Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.top-bar h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.8rem;
    color: white;
    margin-bottom: 4px;
}

.top-bar p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Tab Panels */
.tab-panel {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.tab-panel.active {
    display: flex;
}

/* ==================== TAB: DASHBOARD ==================== */
.dashboard-sticky-header {
    position: sticky;
    top: -15px; /* Offsets the padding-top of .main-content when sticky */
    z-index: 100;
    background: rgba(0, 77, 38, 0.95); /* brand green sticky background */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding-top: 4px;
    padding-bottom: 8px;
    margin-top: -15px;
    margin-left: -15px;
    margin-right: -15px;
    padding-left: 15px;
    padding-right: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* KPI Cards grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 5px;
}

@media (min-width: 1400px) {
    .kpi-grid {
        grid-template-columns: 1.5fr 1.5fr 0.8fr 0.8fr 0.8fr 0.8fr;
    }
}

@media (min-width: 1024px) and (max-width: 1399px) {
    .kpi-grid {
        grid-template-columns: 1.5fr 1.5fr 1fr 1fr 1fr 1fr;
    }
}

.kpi-card {
    background: #ffffff;
    border: 1px solid rgba(0, 90, 48, 0.15);
    border-radius: var(--radius-md);
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.kpi-card:hover {
    transform: translateY(-3px);
    border-color: #005a30;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.kpi-combined-card {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 0;
    padding: 6px 8px;
}

.kpi-col {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.kpi-col-left {
    flex: 1.6;
    padding-right: 4px;
}

.kpi-col-right {
    flex: 1;
    padding-left: 4px;
}

.kpi-divider {
    width: 1px;
    background-color: rgba(0, 90, 48, 0.12);
    align-self: stretch;
    margin: 2px 2px;
}

/* Tinh chỉnh bên trong combined card để vừa vặn */
.kpi-combined-card .kpi-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    flex-shrink: 0;
}

.kpi-combined-card .kpi-data h3 {
    font-size: 0.68rem;
    margin-bottom: 2px;
}

.kpi-combined-card .kpi-data p {
    font-size: 1.15rem;
}

.kpi-combined-card .kpi-comparison {
    font-size: 0.68rem !important;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.kpi-icon.sales {
    background-color: rgba(139, 92, 246, 0.15);
    color: #c084fc;
}

.kpi-icon.orders {
    background-color: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
}

.kpi-icon.ads {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.kpi-icon.adtc {
    background-color: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.kpi-icon.ontime {
    background-color: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.kpi-icon.zone {
    background-color: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.kpi-data h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
    font-weight: 600;
    margin-bottom: 4px;
}

.kpi-data p {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
}

/* Charts Grid */
.dashboard-charts-grid.grid-4col {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 0.8fr 0.8fr;
    gap: 5px;
    margin-bottom: 20px;
}

.zone-distribution-row {
    grid-template-columns: repeat(4, 1fr) !important;
}

.chart-card.span-2 {
    grid-column: span 2;
}

.chart-card.span-4 {
    grid-column: span 4;
}

@media (max-width: 1200px) {
    .dashboard-charts-grid.grid-4col {
        grid-template-columns: repeat(2, 1fr);
    }
    .chart-card.span-2 {
        grid-column: span 2;
    }
    .chart-card.span-4 {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    #app-page {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        height: 65px !important;
        padding: 0 !important;
        background: rgba(8, 20, 13, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-right: none !important;
        border-top: 1px solid var(--border-color);
        flex-direction: row !important;
        justify-content: space-around !important;
        align-items: center !important;
        z-index: 9999;
    }
    
    .sidebar-brand, 
    .user-profile-sidebar, 
    .sidebar-footer, 
    .sidebar-toggle-btn {
        display: none !important;
    }
    
    .sidebar-nav {
        width: 100%;
        margin: 0 !important;
    }
    
    .sidebar-nav ul {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-around !important;
        align-items: center !important;
        height: 100%;
        width: 100%;
        padding: 0;
    }
    
    .sidebar-nav .nav-item {
        margin: 0 !important;
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100%;
    }
    
    .sidebar-nav .nav-item a {
        display: flex;
        flex-direction: column !important;
        align-items: center;
        justify-content: center;
        gap: 4px !important;
        padding: 8px 4px !important;
        font-size: 0.65rem !important;
        font-weight: 500;
        width: 100%;
        height: 100%;
        border-left: none !important;
        border-bottom: none !important;
        background: transparent !important;
        color: var(--text-secondary);
    }
    
    .sidebar-nav .nav-item a i {
        font-size: 1.1rem !important;
        margin: 0 !important;
    }
    
    .sidebar-nav .nav-item a span {
        display: inline !important;
        font-size: 0.62rem !important;
        text-align: center;
        white-space: nowrap;
    }
    
    .sidebar-nav .nav-item.active a {
        color: var(--color-success) !important;
        font-weight: 600;
    }
    
    .main-content {
        padding: 10px 10px 80px 10px !important;
        max-height: none !important;
        overflow-y: visible !important;
    }
    
    .dashboard-sticky-header {
        position: static !important;
        margin: 0 0 15px 0 !important;
        padding: 0 !important;
        border-bottom: none !important;
        background: transparent !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    
    .filter-panel {
        padding: 12px !important;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
    }
    
    .filter-controls {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }
    
    .filter-group {
        width: 100% !important;
    }
    
    .filter-group select {
        width: 100% !important;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
    
    .kpi-combined-card {
        grid-column: span 2;
        padding: 8px 10px !important;
    }
    
    .kpi-card {
        padding: 10px !important;
        gap: 10px !important;
    }
    
    .kpi-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 1.1rem !important;
    }
    
    .kpi-data p {
        font-size: 1.1rem !important;
    }
    
    .kpi-comparison {
        font-size: 0.68rem !important;
    }
    
    .import-tabs {
        flex-direction: column !important;
        gap: 8px;
    }

    .dashboard-charts-grid.grid-4col {
        grid-template-columns: 1fr;
    }
    .zone-distribution-row {
        grid-template-columns: 1fr !important;
    }
    .chart-card.span-2 {
        grid-column: span 1;
    }
    .chart-card.span-4 {
        grid-column: span 1;
    }
    .chart-card {
        padding: 8px 3px !important;
    }

    /* Custom mobile ordering for charts */
    #card-salesMonthlyChart { order: 1; }
    #card-ordersMonthlyChart { order: 2; }
    #card-riderTypeChart { order: 3; }
    #card-channelChart { order: 4; }
    #card-salesWeeklyChart { order: 5; }
    #card-ordersWeeklyChart { order: 6; }
    #card-salesTrendChart { order: 7; }
    #card-ordersTrendChart { order: 8; }
    #card-salesStoreRankingChart { order: 9; } /* Moved below Daily TC (order 8) */
    #card-storeRankingChart { order: 10; }

    /* Responsive Table Optimizations for Mobile */
    #rider-data-table,
    #monthly-zone-table {
        font-size: 14px !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    #rider-data-table th,
    #rider-data-table td {
        padding: 10px 12px !important;
    }

    #rider-data-table th {
        font-size: 13px !important;
    }

    #rider-data-table td {
        font-size: 14px !important;
    }

    /* Freeze first column (Nhà Hàng) for Rider Table */
    #rider-data-table thead tr th:first-child {
        position: sticky !important;
        left: 0 !important;
        z-index: 35 !important;
        background-color: #e8f5ed !important;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.08);
    }

    #rider-data-table tbody tr td:first-child {
        position: sticky !important;
        left: 0 !important;
        z-index: 25 !important;
        background-color: #ffffff !important;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.08);
    }

    #rider-data-table tbody tr:hover td:first-child {
        background-color: rgba(0, 90, 48, 0.05) !important;
    }

    /* Freeze first column (Zone) for Monthly Zone Table */
    #monthly-zone-table th,
    #monthly-zone-table td {
        font-size: 13px !important;
        padding: 8px 10px !important;
    }

    #monthly-zone-table thead tr:first-child th:first-child {
        position: sticky !important;
        left: 0 !important;
        z-index: 35 !important;
        background-color: #005a30 !important;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.15);
        padding-left: 3px !important;
        padding-right: 3px !important;
        min-width: 55px !important;
        width: 55px !important;
    }

    #monthly-zone-table tbody tr td:first-child {
        position: sticky !important;
        left: 0 !important;
        z-index: 25 !important;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.15);
        padding-left: 3px !important;
        padding-right: 3px !important;
        min-width: 55px !important;
        width: 55px !important;
    }

    /* Fix Weekly Top 10 Late KPI Chart zoom cutting off on mobile */
    .chart-card.is-zoomed .top10-layout-container {
        display: flex !important;
        flex-direction: column !important;
        overflow-y: auto !important;
        height: 100% !important;
        padding-right: 4px;
    }

    .chart-card.is-zoomed .chart-container {
        height: 280px !important;
        flex-shrink: 0 !important;
    }

    .chart-card.is-zoomed {
        height: 85vh !important;
        width: 95vw !important;
        padding: 15px 12px !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .chart-card.is-zoomed .chart-zoom-close-btn {
        top: -12px !important;
        right: -12px !important;
    }
}

.dashboard-section-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, rgba(139, 92, 246, 0), rgba(139, 92, 246, 0.25), rgba(139, 92, 246, 0.5), rgba(139, 92, 246, 0.25), rgba(139, 92, 246, 0));
    margin: 32px 0 24px 0;
}

.chart-card {
    background: #ffffff;
    border: 1px solid rgba(0, 90, 48, 0.15);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents grid columns from stretching due to large canvas */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.chart-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #005a30;
    font-family: var(--font-display);
}

.chart-container {
    position: relative;
    flex-grow: 1;
    height: 220px;
    width: 100%;
    min-width: 0;
}

/* Premium Table Card */
.table-card {
    background: #ffffff;
    border: 1px solid rgba(0, 90, 48, 0.15);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 25px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 90, 48, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: var(--transition-smooth);
}

.table-header:hover {
    background-color: rgba(0, 90, 48, 0.02);
}

.table-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #005a30;
    font-family: var(--font-display);
    display: flex;
    align-items: center;
}

.data-status {
    font-size: 0.8rem;
    color: var(--color-success);
    font-weight: 500;
}

.data-status i {
    margin-right: 4px;
}

.table-wrapper {
    overflow: auto;
    max-height: calc(100vh - 280px);
    min-height: 200px;
    opacity: 1;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, padding 0.4s ease;
}

.table-card.collapsed .table-wrapper {
    max-height: 0 !important;
    opacity: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-top: none !important;
}

.table-card.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

th {
    position: sticky;
    top: 0;
    background-color: #e8f5ed;
    color: #005a30;
    font-weight: 600;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(0, 90, 48, 0.12);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    z-index: 10;
}

td {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(0, 90, 48, 0.06);
    color: #1e293b;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: rgba(0, 90, 48, 0.03);
}

.empty-table {
    text-align: center;
    padding: 40px !important;
    color: var(--text-secondary);
    font-style: italic;
}

/* ==================== POPUP MODAL: IMPORT DATA ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(5, 7, 12, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #ffffff;
    border: 1.5px solid var(--color-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 540px;
    padding: 30px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

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

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: #005a30;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header h2 i {
    color: var(--color-primary);
}

.modal-close {
    font-size: 1.8rem;
    color: #475569;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

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

.modal-body {
    margin-bottom: 25px;
}

.modal-description {
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Drag Drop Box */
.drop-zone {
    border: 2px dashed rgba(0, 90, 48, 0.2);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    background-color: rgba(0, 90, 48, 0.01);
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-bottom: 15px;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--color-primary);
    background-color: rgba(0, 90, 48, 0.04);
}

.drop-icon {
    font-size: 2.5rem;
    color: #475569;
    margin-bottom: 15px;
    transition: var(--transition-smooth);
}

.drop-zone:hover .drop-icon {
    color: var(--color-primary);
    transform: translateY(-5px);
}

.drop-zone p {
    font-size: 0.9rem;
    color: #475569;
}

/* File Selected Details */
.file-details {
    display: flex;
    align-items: center;
    gap: 14px;
    background-color: rgba(0, 90, 48, 0.03);
    border: 1px solid rgba(0, 90, 48, 0.1);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.file-icon {
    font-size: 1.8rem;
    color: var(--color-primary);
}

.file-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

.file-info .name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #0f172a;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.file-info .size {
    font-size: 0.8rem;
    color: #475569;
}

/* Progress bar loading */
.progress-container {
    background-color: rgba(0, 90, 48, 0.02);
    border: 1px solid rgba(0, 90, 48, 0.1);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 20px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

#progress-status {
    color: #0f172a;
}

#progress-percent {
    color: var(--color-primary);
}

.progress-bar-bg {
    height: 6px;
    background-color: rgba(0, 90, 48, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
    border-radius: var(--radius-full);
    transition: width 0.1s ease;
}

.progress-log {
    max-height: 110px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.75rem;
    color: #1e293b;
    background-color: rgba(0, 90, 48, 0.05);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-log .log-entry {
    line-height: 1.4;
}

.progress-log .log-success {
    color: var(--color-success);
}

.progress-log .log-error {
    color: var(--color-danger);
}

.progress-log .log-info {
    color: var(--color-accent);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==================== REPORT FILTER PANEL & PERFORMANCE CELL STYLING ==================== */
.filter-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 5px;
    /* khoảng cách cụm filter vs các box số tổng quan */
    background: transparent;
    border: none;
    padding: 0;
}

.filter-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
}

.filter-row-top,
.filter-row-middle,
.filter-row-bottom {
    display: contents;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
}

.filter-group.flex-grow {
    flex-grow: 1;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-group select,
.filter-group input {
    background-color: #ffffff;
    border: 1px solid rgba(0, 90, 48, 0.2);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: #0f172a;
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-smooth);
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: #005a30;
    box-shadow: 0 0 0 3px rgba(0, 90, 48, 0.15);
}

/* Performance Cell Threshold Coloring */
.perf-badge {
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-block;
}

.perf-high {
    color: #34d399;
    /* Green */
    background-color: rgba(16, 185, 129, 0.1);
}

.perf-mid {
    color: #fbbf24;
    /* Amber/Yellow */
    background-color: rgba(245, 158, 11, 0.1);
}

.perf-low {
    color: #f87171;
    /* Red */
    background-color: rgba(239, 68, 68, 0.1);
}

/* ==================== ADDITIONAL MANAGEMENT STYLES ==================== */
/* Toggle Switch Styles */
.switch-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.switch-input {
    display: none;
}

.switch-label {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
    background-color: var(--text-muted);
    border-radius: var(--radius-full);
    transition: var(--transition-smooth);
}

.switch-label::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: var(--transition-smooth);
}

.switch-input:checked + .switch-label {
    background-color: var(--color-success);
}

.switch-input:checked + .switch-label::after {
    left: 24px;
}

/* Store Assignment Checkbox list inside Modal */
.assign-stores-grid {
    scrollbar-width: thin;
}

.assign-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: rgba(0, 90, 48, 0.02);
    border: 1px solid rgba(0, 90, 48, 0.12);
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
    cursor: pointer;
}

.assign-item:hover {
    background-color: rgba(0, 90, 48, 0.06);
    border-color: rgba(0, 90, 48, 0.3);
}

.assign-item input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
}

.assign-item label {
    cursor: pointer;
    font-size: 0.85rem;
    color: #1e293b;
    user-select: none;
    flex-grow: 1;
}

/* Action buttons in management tables */
.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
}

.btn-action {
    padding: 6px 10px;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-action-edit {
    background-color: rgba(234, 179, 8, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.btn-action-edit:hover {
    background-color: rgba(234, 179, 8, 0.3);
    color: white;
}

.btn-action-delete {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-action-delete:hover {
    background-color: rgba(239, 68, 68, 0.3);
    color: white;
}

.btn-action-assign {
    background-color: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-action-assign:hover {
    background-color: rgba(59, 130, 246, 0.3);
    color: white;
}

/* Pagination Styling */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid rgba(0, 90, 48, 0.12);
}
.pagination-info {
    font-size: 0.85rem;
    color: #475569;
    font-weight: 500;
}
.pagination-controls .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid rgba(0, 90, 48, 0.2);
    color: #005a30;
}
.pagination-controls .btn:hover:not(:disabled) {
    background: rgba(0, 90, 48, 0.05);
    border-color: #005a30;
}

/* Custom Legend styling for chart headers */
.custom-legend {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 500;
    color: #475569;
}

.custom-legend-line {
    display: inline-block;
    width: 14px;
    height: 0;
    vertical-align: middle;
}

.custom-legend-line.solid {
    border-top: 2.5px solid;
}

.custom-legend-line.dashed {
    border-top: 2.5px dashed;
}

.custom-legend-line.dotted {
    border-top: 2.5px dotted;
}

/* Custom Donut Legend at the bottom of the card */
.custom-donut-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 90, 48, 0.1);
}

.custom-donut-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 500;
    color: #475569;
}

.custom-donut-legend-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

/* ==================== CHART ZOOM / OVERLAY SYSTEM ==================== */
/* Make chart titles look clickable */
.chart-card h3,
.chart-card .chart-header h3 {
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.chart-card h3:hover,
.chart-card .chart-header h3:hover {
    color: var(--color-success, #10b981) !important;
    transform: scale(1.02);
}

/* Background overlay when a chart is zoomed */
.chart-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(8, 10, 16, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9990;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-zoom-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Zoomed state for the chart card */
.chart-card.is-zoomed {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(1) !important;
    width: 90vw !important;
    height: 80vh !important;
    max-width: 1200px !important;
    max-height: 800px !important;
    z-index: 9995 !important;
    background: #ffffff !important;
    border: 1.5px solid var(--color-primary) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15) !important;
    padding: 24px 30px !important;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    overflow: visible !important;
}

/* Override the height of the chart container inside zoomed card */
.chart-card.is-zoomed .chart-container {
    height: calc(100% - 60px) !important;
    max-height: none !important;
}

/* Close button for zoomed chart card */
.chart-card .chart-zoom-close-btn {
    display: none;
    position: absolute;
    top: -18px;
    right: -18px;
    background: #ffffff;
    border: 1.5px solid rgba(0, 90, 48, 0.2);
    color: #475569;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.05rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10005;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.chart-card.is-zoomed .chart-zoom-close-btn {
    display: flex;
}

.chart-card .chart-zoom-close-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

/* Dim other chart cards when overlay is active */
body.chart-zoomed-active .chart-card:not(.is-zoomed) {
    opacity: 0.3;
    filter: blur(1.5px);
    pointer-events: none;
}

/* Max Date Display & Import Button Layout */
#data-max-date-display {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    height: 36px;
    align-self: flex-end;
}

#import-trigger-btn {
    margin-left: 10px;
    height: 36px;
    align-self: flex-end;
}

@media (max-width: 768px) {
    /* Mobile View Filters Redesign */
    .filter-controls {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
        align-items: stretch !important;
    }

    .filter-row-top,
    .filter-row-middle,
    .filter-row-bottom {
        display: flex !important;
        width: 100% !important;
        gap: 8px !important;
    }

    /* Row 1: Max Date & Import Data at the very top */
    .filter-row-top {
        order: -1 !important; /* Forces this row to the very top */
        flex-direction: row !important;
        align-items: center !important;
    }

    #data-max-date-display {
        flex: 1 !important;
        width: 100% !important;
        margin: 0 !important;
        justify-content: center !important;
        align-self: stretch !important;
        height: 36px !important;
    }
    
    #import-trigger-btn {
        flex: 1 !important;
        width: 100% !important;
        margin: 0 !important;
        align-self: stretch !important;
        height: 36px !important;
    }

    /* Row 2: Year, Month, Region */
    .filter-row-middle {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        align-items: flex-end !important;
    }

    .filter-row-middle .filter-group {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Row 3: AC, Store, Reset */
    .filter-row-bottom {
        display: grid !important;
        grid-template-columns: 2.2fr 2.2fr 1fr !important;
        align-items: flex-end !important;
    }

    .filter-row-bottom .filter-group {
        width: 100% !important;
        min-width: 0 !important;
    }

    .filter-row-bottom #reset-filters-btn,
    .filter-row-bottom #reset-delivery-filters-btn,
    .filter-row-bottom #reset-rider-filters-btn {
        width: 100% !important;
        height: 36px !important;
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0.8rem !important;
    }


}

/* ==================== DELIVERY PERFORMANCE TAB STYLES ==================== */
.delivery-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
    margin-bottom: 20px;
}

.delivery-charts-grid .span-2 {
    grid-column: span 2;
}

.top10-chart-card {
    padding: 15px 20px;
}

.top10-layout-container {
    display: flex;
    gap: 20px;
    width: 100%;
}

.top10-sidebar {
    width: 180px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-right: 1px solid var(--border-color);
    padding-right: 15px;
}

.top10-main {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.top10-control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top10-control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(0, 90, 48, 0.15);
}

.top10-header-icons {
    display: flex;
    gap: 6px;
    color: #475569;
    font-size: 0.75rem;
}

.top10-kpi-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.top10-kpi-btn {
    background: #f8fafc;
    border: 1px solid rgba(0, 90, 48, 0.15);
    color: #475569;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.top10-kpi-btn:hover {
    background: rgba(0, 90, 48, 0.04);
    color: #005a30;
    border-color: #005a30;
}

.top10-kpi-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 4px 10px rgba(0, 90, 48, 0.2);
}

.top10-week-list-container {
    background: #f8fafc;
    border: 1px solid rgba(0, 90, 48, 0.15);
    border-radius: var(--radius-sm);
    padding: 6px;
}

.top10-week-list {
    max-height: 180px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    padding-right: 4px;
}

/* Custom scrollbar for week list */
.top10-week-list::-webkit-scrollbar {
    width: 4px;
}
.top10-week-list::-webkit-scrollbar-track {
    background: transparent;
}
.top10-week-list::-webkit-scrollbar-thumb {
    background: rgba(0, 90, 48, 0.2);
    border-radius: 2px;
}

.top10-week-btn {
    background: #ffffff;
    border: 1px solid rgba(0, 90, 48, 0.15);
    color: #475569;
    padding: 6px 4px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.top10-week-btn:hover {
    background: rgba(0, 90, 48, 0.04);
    color: #005a30;
}

.top10-week-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Responsive grid stacking for mobile devices */
@media (max-width: 992px) {
    .delivery-charts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .delivery-charts-grid .span-2 {
        grid-column: span 1;
    }
    .top10-layout-container {
        flex-direction: column;
    }
    .top10-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 15px;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .top10-control-group {
        flex: 1;
        min-width: 140px;
    }
    .top10-week-list {
        max-height: 120px;
    }
}