:root {
    --sidebar-width: 200px;
    --primary: #0d6efd;
    --danger: #dc3545;
    --warning: #ffc107;
    --success: #198754;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Inter, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #F4F7FB;
    color: #071A3D;
}

/* ── App Layout (CSS Grid) ── */
#app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
    transition: grid-template-columns 0.25s ease;
}
#main-area {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #F4F7FB;
}

/* ── Sidebar ── */
#sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    align-self: start;
    background-image:
        linear-gradient(
            180deg,
            rgba(255,255,255,1.00) 0%,
            rgba(255,255,255,1.00) 35%,
            rgba(255,255,255,0.65) 50%,
            rgba(255,255,255,0.18) 70%,
            rgba(255,255,255,0.00) 100%
        ),
        url("/assets/orange_sidebar_background.png");
    background-color: #ffffff;
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    border-right: 1px solid #E6EBF2;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 18px 12px;
    box-sizing: border-box;
    transition: width 0.25s ease, min-width 0.25s ease, padding 0.25s ease;
    flex-shrink: 0;
}

.sidebar-logo-wrap {
    cursor: pointer;
    padding: 0 8px;
    margin-bottom: 4px;
    flex-shrink: 0;
}
.sidebar-logo {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #1a2942;
    line-height: 1.1;
}
.sidebar-logo-ck { color: #2F80FF; }
.sidebar-logo-sub {
    margin-top: 4px;
    font-size: 11.5px;
    color: #C7D2E3;
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.15) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 2px; }

.nav-section-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #64748B;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    margin: 20px 8px 6px;
    padding: 0;
}
.sidebar-nav .nav-section-label:first-child { margin-top: 6px; }

.nav-link {
    height: 36px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    border-radius: 8px;
    color: #1a2942;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 2px;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    white-space: nowrap;
}
.nav-link svg { width: 16px; height: 16px; color: #475569; flex-shrink: 0; }
.nav-link:hover { background: rgba(0,0,0,0.06); color: #1a2942; }
.nav-link.active {
    background: rgba(29, 109, 255, 0.10);
    color: #1355CC;
    font-weight: 600;
    box-shadow: none;
}
.nav-link.active svg { color: #1355CC; }

.sidebar-footer {
    flex-shrink: 0;
    padding-top: 10px;
}
.help-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid rgba(120,160,210,0.35);
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    cursor: pointer;
}
.help-card:hover { background: rgba(255,255,255,0.06); }
.help-icon {
    width: 28px;
    height: 28px;
    border: 1.5px solid #2F80FF;
    color: #2F80FF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.help-title {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}
.help-subtitle { font-size: 10px; color: #B8C7DA; }
.sidebar-copyright {
    margin-top: 16px;
    font-size: 11px;
    color: #ffffff;
    line-height: 1.6;
    padding: 0 4px;
}

/* ── App Header ── */
#app-header {
    position: sticky;
    top: 0;
    z-index: 99;
    min-height: 76px;
    background: #ffffff;
    border-bottom: 1px solid #E6EBF2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 32px;
    box-sizing: border-box;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #53657d;
    flex-shrink: 0;
    transition: background 0.15s;
}
.sidebar-toggle:hover { background: #f1f5f9; }
.header-title-block { display: flex; flex-direction: column; gap: 1px; }
.header-page-title {
    font-size: 19px;
    font-weight: 800;
    color: #071a3d;
    line-height: 1.2;
    white-space: nowrap;
}
.header-page-subtitle {
    font-size: 12px;
    font-weight: 400;
    color: #53657d;
    line-height: 1.3;
    white-space: nowrap;
}
.header-right { display: flex; align-items: center; }
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 10px;
    transition: background 0.15s;
}
.user-profile:hover { background: #f1f5f9; }
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0.3px;
    overflow: hidden;
}
.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.user-info { display: flex; flex-direction: column; gap: 1px; }
.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #071a3d;
    line-height: 1.2;
    white-space: nowrap;
}
.user-role {
    font-size: 11px;
    font-weight: 400;
    color: #53657d;
    line-height: 1.3;
    white-space: nowrap;
}

/* ── Sidebar Collapse ── */
body.sidebar-collapsed #app-layout {
    grid-template-columns: 0 1fr;
}
body.sidebar-collapsed #sidebar {
    width: 0;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
}

/* ── Main Content ── */
#main-content {
    flex: 1;
    padding: 22px 28px 32px;
}

/* ── Page Title ── */
.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #1a202c;
}
.page-title .badge { font-size: 0.7rem; vertical-align: middle; }

/* ── KPI Cards ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.kpi-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.2rem 1.4rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.kpi-card .kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    margin-bottom: 0.4rem;
}
.kpi-card .kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    color: #1a202c;
}
.kpi-card .kpi-value.text-danger { color: var(--danger) !important; }
.kpi-card .kpi-sub {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.3rem;
}
.kpi-card .kpi-icon {
    font-size: 1.5rem;
    float: right;
    opacity: 0.15;
    margin-top: -0.2rem;
}

/* ── Charts Row ── */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.75rem;
}
@media (max-width: 900px) { .charts-row { grid-template-columns: 1fr; } }

.chart-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.chart-card .chart-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
}
.chart-card canvas { max-height: 260px; }

/* ── Filters Bar ── */
.filters-bar {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}
.filters-bar label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    display: block;
    margin-bottom: 0.25rem;
}
.filters-bar input, .filters-bar select {
    font-size: 0.875rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: #fff;
    color: #212529;
    min-width: 140px;
}
.filters-bar .btn {
    padding: 0.38rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #0b5ed7; }
.btn-outline { background: #fff; color: #495057; border: 1px solid #ced4da !important; }
.btn-outline:hover { background: #f8f9fa; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #157347; }

/* ── Data Table ── */
.table-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    overflow: hidden;
}
.table-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.table-card-header .table-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
}
.table-responsive { overflow-x: auto; }
table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
table.data-table th {
    background: #f8f9fa;
    padding: 0.65rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    border-bottom: 1px solid #dee2e6;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}
table.data-table th:hover { background: #e9ecef; }
table.data-table th.sort-asc::after { content: ' ▲'; font-size: 0.65rem; }
table.data-table th.sort-desc::after { content: ' ▼'; font-size: 0.65rem; }
table.data-table td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: middle;
    white-space: nowrap;
}
table.data-table tbody tr:hover { background: #f8f9fa; }
table.data-table tbody tr:last-child td { border-bottom: none; }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 0.2em 0.55em;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 4px;
    white-space: nowrap;
}
.badge-danger { background: #fde8ea; color: #b02a37; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-success { background: #d1e7dd; color: #0f5132; }
.badge-info { background: #cff4fc; color: #0a3952; }
.badge-secondary { background: #e9ecef; color: #495057; }

/* ── Loading / Empty States ── */
.loading-state, .empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
    font-size: 0.95rem;
}
.spinner {
    width: 32px; height: 32px;
    border: 3px solid #dee2e6;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 0.75rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── DB connection error banner ── */
.db-error-banner {
    display: none;
    align-items: center;
    gap: 12px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #991B1B;
    line-height: 1.5;
}
.db-error-banner-icon { flex-shrink: 0; color: #DC2626; }
.db-error-banner-text { flex: 1; }
.db-error-banner-text a { color: #1D6DFF; font-weight: 700; text-decoration: none; }
.db-error-banner-text a:hover { text-decoration: underline; }
.db-error-banner-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #991B1B;
    font-size: 14px;
    padding: 2px 4px;
    opacity: 0.6;
    line-height: 1;
    border-radius: 4px;
}
.db-error-banner-close:hover { opacity: 1; background: rgba(153,27,27,0.08); }

/* ── Pages (shown/hidden) ── */
.page { display: none; }
.page.active { display: block; }


/* ── Filter pill buttons ── */
.filter-group { position: relative; display: inline-flex; flex-direction: column; }
.filter-group label { font-size: 0.75rem; font-weight: 600; color: #495057; margin-bottom: 0.25rem; }
.filter-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.875rem; font-weight: 500;
    background: #fff; color: #212529;
    border: 1px solid #ced4da; border-radius: 20px;
    cursor: pointer; white-space: nowrap;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    padding-right: 1.8rem;
}
.filter-btn:hover { border-color: var(--primary); }
.filter-btn.open { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,253,.15); }
select.filter-btn { min-width: 130px; }

/* ── Shared dropdown container ── */
.filter-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 2000;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.14);
    display: none;
}
.filter-dropdown.open { display: block; }

/* ── Date Picker ── */
.dp-panel { display: flex; }
.dp-calendar { padding: 1rem; min-width: 260px; }
.dp-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.dp-nav { background: none; border: none; cursor: pointer; font-size: 1.1rem; padding: 0.2rem 0.5rem; border-radius: 4px; color: #495057; }
.dp-nav:hover { background: #f0f2f5; }
.dp-month-label { font-weight: 600; font-size: 0.9rem; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dp-dow { font-size: 0.7rem; font-weight: 700; color: #6c757d; padding: 0.2rem 0; }
.dp-day {
    font-size: 0.82rem; padding: 0.3rem;
    border-radius: 50%; cursor: pointer;
    border: none; background: none;
    line-height: 1.6; width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    margin: auto;
}
.dp-day:hover:not(:disabled) { background: #e9ecef; }
.dp-day.in-range { background: #dbeafe; border-radius: 0; }
.dp-day.range-start, .dp-day.range-end { background: var(--primary) !important; color: #fff; border-radius: 50%; }
.dp-day.range-start.in-range { border-radius: 50% 0 0 50%; }
.dp-day.range-end.in-range { border-radius: 0 50% 50% 0; }
.dp-day:disabled { color: #ced4da; cursor: default; }
.dp-day.other-month { color: #adb5bd; }
.dp-footer { padding: 0.5rem 1rem; border-top: 1px solid #e9ecef; font-size: 0.78rem; color: #6c757d; }
.dp-presets {
    border-left: 1px solid #e9ecef;
    padding: 0.75rem 0.5rem;
    display: flex; flex-direction: column; gap: 2px;
    min-width: 120px;
}
.dp-preset {
    background: none; border: none; text-align: left;
    padding: 0.4rem 0.75rem; font-size: 0.82rem;
    border-radius: 6px; cursor: pointer; color: #212529;
    white-space: nowrap;
}
.dp-preset:hover { background: #f0f4ff; color: var(--primary); }
.dp-preset.active { background: #e7f0ff; color: var(--primary); font-weight: 600; }

/* ── Multi-select dropdown ── */
.ms-panel { min-width: 260px; }
.ms-search-wrap { padding: 0.6rem 0.75rem; border-bottom: 1px solid #e9ecef; }
.ms-search {
    width: 100%; border: 1px solid #ced4da; border-radius: 6px;
    padding: 0.3rem 0.6rem; font-size: 0.85rem; outline: none;
}
.ms-search:focus { border-color: var(--primary); }
.ms-list { max-height: 260px; overflow-y: auto; padding: 0.3rem 0; }
.ms-item {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.38rem 0.75rem; cursor: pointer; font-size: 0.875rem;
    user-select: none;
}
.ms-item:hover { background: #f8f9fa; }
.ms-item input[type="checkbox"] { cursor: pointer; width: 15px; height: 15px; flex-shrink: 0; }
.ms-item.ms-all { border-bottom: 1px solid #e9ecef; font-weight: 600; margin-bottom: 2px; padding-bottom: 0.5rem; }
.ms-empty { padding: 1rem; text-align: center; color: #6c757d; font-size: 0.85rem; }

/* ── Single-select dropdown ── */
.ss-panel { min-width: 160px; padding: 0.4rem 0; }
.ss-item {
    padding: 0.45rem 1rem; font-size: 0.875rem;
    cursor: pointer; color: #212529;
    transition: background 0.1s;
}
.ss-item:hover { background: #f0f4ff; color: var(--primary); }
.ss-item.ss-active { color: var(--primary); font-weight: 600; background: #e7f0ff; }

/* ── Date picker — editable inputs ── */
.dp-inputs {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.65rem 1rem;
    border-top: 1px solid #e9ecef;
}
.dp-input-group { display: flex; flex-direction: column; gap: 3px; }
.dp-input-group label { font-size: 0.7rem; font-weight: 700; color: #6c757d; }
.dp-input {
    border: 1px solid #ced4da; border-radius: 6px;
    padding: 0.28rem 0.5rem; font-size: 0.82rem;
    width: 98px; outline: none; color: #212529;
    text-align: center;
}
.dp-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(13,110,253,.15); }
.dp-input.dp-invalid { border-color: var(--danger); }
.dp-inputs .dp-sep { color: #adb5bd; font-size: 0.9rem; margin-top: 14px; }

/* ── Dashboard KPI row ── */
.db-kpi-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}
@media (max-width: 1750px) { .db-kpi-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .db-kpi-row { grid-template-columns: repeat(2, 1fr); } }

.db-kpi-card {
    background: #fff;
    border: 1px solid #E6EBF2;
    border-radius: 10px;
    min-height: 104px;
    padding: 18px 16px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: 0 4px 12px rgba(15,23,42,0.06);
    transition: box-shadow 0.18s, transform 0.18s;
}
.db-kpi-card:hover {
    box-shadow: 0 8px 20px rgba(15,23,42,0.09);
    transform: translateY(-1px);
}
.db-kpi-icon {
    width: 46px; height: 46px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}
.db-kpi-icon svg { width: 22px; height: 22px; stroke-width: 2.2; }
.db-icon-blue   { background: #EAF2FF; color: #1E73FF; }
.db-icon-yellow { background: #FFF3D9; color: #F59E0B; }
.db-icon-teal   { background: #DFF7EF; color: #16A46A; }
.db-icon-purple { background: #F1E7FF; color: #7C3AED; }
.db-icon-rose   { background: #FFE8EA; color: #F43F5E; }
.db-icon-indigo { background: #EAF2FF; color: #1E73FF; }

.db-kpi-body { flex: 1; min-width: 0; }
.db-kpi-label {
    font-size: 10.5px; font-weight: 700;
    color: #0B1F44; margin-bottom: 5px;
    text-transform: uppercase; letter-spacing: 0.2px; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.db-kpi-value {
    font-size: 24px; font-weight: 800;
    color: #071A3D; line-height: 1.1;
    margin-bottom: 3px;
}
.db-kpi-desc {
    font-size: 12px; font-weight: 400;
    color: #243B61; line-height: 1.3;
    margin-bottom: 6px;
}
.db-kpi-change {
    font-size: 11px; font-weight: 600;
    margin-top: 2px;
    display: flex; align-items: center; gap: 3px;
}
.db-change-up   { color: #12A66A; }
.db-change-down { color: #EF4444; }
.db-change-neutral { color: #64748B; }

/* ── Dashboard layout rows ── */
.db-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.db-panels-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}
@media (max-width: 1100px) {
    .db-charts-row  { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .db-panels-row  { grid-template-columns: 1fr; }
}

/* ── Dashboard panel card ── */
.db-panel {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #E6EBF2;
    box-shadow: 0 4px 12px rgba(15,23,42,0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.db-panel-lg { /* wider panel — handled by grid */ }
.db-panel-body { padding: 0 24px 16px 24px}

.db-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #F0F4F9;
    flex-shrink: 0;
}
.db-panel-title {
    font-size: 15px;
    font-weight: 700;
    color: #071A3D;
}
.chart-range-select {
    height: 30px;
    padding: 0 28px 0 10px;
    border: 1px solid #D8E1EE;
    border-radius: 6px;
    background: #fff;
    color: #071A3D;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23475569'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 8px 5px;
}
.chart-range-select:focus { outline: none; border-color: var(--primary); }
.db-view-all {
    height: 30px;
    padding: 0 12px;
    border: 1px solid #D8E1EE;
    border-radius: 6px;
    background: #fff;
    color: #071A3D;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}
.db-view-all:hover { background: #F8FAFF; text-decoration: none; }

.db-panel canvas { padding: 0.75rem 1rem 0.5rem; }

/* ── Top Items SVG chart ── */
.top-items-wrap { padding: 8px 12px 2px; }
.ti-view-all { height: auto; padding: 0; border: none; background: none; color: #1D6DFF; font-size: 12px; font-weight: 700; box-shadow: none; }
.ti-view-all:hover { background: none; color: #0F65E8; text-decoration: underline; }

/* ── Donut + legend layout ── */
.db-donut-wrap {
    display: grid;
    grid-template-columns: 190px 1fr;
    column-gap: 28px;
    align-items: center;
    padding: 4px 28px 18px 18px;
    flex: 1;
}
.db-donut-legend { min-width: 0; }
.db-legend-row {
    display: grid;
    grid-template-columns: 1fr 110px 70px;
    column-gap: 18px;
    align-items: center;
    min-height: 28px;
}
.db-legend-dot { width: 9px; height: 9px; border-radius: 999px; flex-shrink: 0; }
.db-legend-name {
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; font-weight: 500; color: #071A3D;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.db-legend-val { font-size: 12px; font-weight: 700; color: #071A3D; white-space: nowrap; text-align: right; }
.db-legend-pct { font-size: 12px; font-weight: 500; color: #53657D; white-space: nowrap; text-align: right; }
.db-legend-total { border-top: 1px solid #E6EBF2; margin-top: 8px; padding-top: 12px; }
.db-legend-total .db-legend-name { font-weight: 700; }
.db-legend-total .db-legend-val  { font-weight: 800; }

/* ── Status dot badges (below par / risk tables) ── */
.db-status-dot { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; font-weight: 600; }
.db-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.db-dot-red    { background: #ef4444; }
.db-dot-orange { background: #f59e0b; }
.db-dot-green  { background: #16a34a; }

/* ── Mini tables inside dashboard panels ── */
.db-mini-table {
    width: 100%; border-collapse: collapse;
    font-size: 0.82rem;
}
.db-mini-table thead th {
    padding: 0.45rem 0.85rem;
    text-align: left;
    font-size: 0.71rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: #6c757d;
    border-bottom: 1px solid #f0f2f5;
    background: #fafafa;
    white-space: nowrap;
}
.db-mini-table tbody td {
    padding: 0.5rem 0.85rem;
    border-bottom: 1px solid #f8f9fa;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}
.db-mini-table tbody tr:last-child td { border-bottom: none; }
.db-mini-table tbody tr:hover td { background: #f8f9fa; }
.db-mini-loading { text-align: center; padding: 1.5rem; }

/* ── Progress bar for vendor spend ── */
.db-progress-wrap { display: flex; align-items: center; gap: 0.5rem; }
.db-progress-bar {
    height: 6px; border-radius: 3px;
    background: #e9ecef; flex: 1; min-width: 50px;
}
.db-progress-fill {
    height: 100%; border-radius: 3px;
    background: #0d6efd; transition: width 0.4s ease;
}

/* ── Orders by Site table ── */
.db-site-table { table-layout: fixed; }
.db-site-table thead th {
    padding: 7px 4px;
    background: transparent;
    white-space: normal;
    vertical-align: bottom;
    line-height: 1.3;
    border-bottom: 1px solid #E6EBF2;
    letter-spacing: 0.35px;
    font-size: 10px;
    font-weight: 800;
    color: #64748B;
    text-transform: uppercase;
}
.db-site-table thead th:first-child { padding-left: 0; }
.db-site-table thead th:last-child  { padding-right: 0; }
.db-site-table tbody td {
    padding: 8px 4px;
    max-width: none;
    font-size: 12px;
    font-weight: 600;
    color: #071A3D;
    border-bottom: 1px solid #EDF2F7;
}
.db-site-table tbody td:first-child { padding-left: 0; }
.db-site-table tbody td:last-child  { padding-right: 0; }
/* Use higher specificity (0,2,1) to beat .db-mini-table thead th (0,1,2) */
.db-site-table thead .db-site-th-num { text-align: center; }
.db-site-name   { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-site-num    { text-align: center; font-weight: 700; }
.db-site-change-down    { color: #EF4444; font-weight: 700; }
.db-site-change-up      { color: #12A66A; font-weight: 700; }
.db-site-change-neutral { color: #64748B; }
.db-site-total-row td   { font-weight: 800 !important; border-top: 1px solid #E6EBF2; border-bottom: none !important; padding-top: 8px; }

/* ── Change arrow in orders-by-site ── */
.db-arrow-up   { color: #16a34a; font-weight: 600; }
.db-arrow-down { color: #dc3545; font-weight: 600; }

/* ── Items Below Par table ── */
.db-par-table { table-layout: fixed; }
.db-par-table thead th {
    padding: 7px 4px;
    background: transparent;
    white-space: normal;
    vertical-align: bottom;
    line-height: 1.3;
    border-bottom: 1px solid #E6EBF2;
    letter-spacing: 0.35px;
    font-size: 10px;
    font-weight: 800;
    color: #64748B;
    text-transform: uppercase;
}
.db-par-table thead th:first-child { padding-left: 0; }
.db-par-table thead th:last-child  { padding-right: 0; }
.db-par-table thead .db-par-th-num { text-align: center; }
.db-par-table tbody td {
    padding: 8px 4px;
    max-width: none;
    font-size: 12px;
    font-weight: 600;
    color: #071A3D;
    border-bottom: 1px solid #EDF2F7;
}
.db-par-table tbody tr:last-child td { border-bottom: none; }
.db-par-table tbody td:first-child { padding-left: 0; }
.db-par-table tbody td:last-child  { padding-right: 0; }
.db-par-name     { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-par-num      { text-align: center; font-weight: 700; }
.db-par-table tbody .db-par-diff-neg { color: #EF4444; font-weight: 700; text-align: center; }
.db-par-status-cell { text-align: left; }
.db-par-status   { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #071A3D; }
.db-par-dot      { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }
.db-par-dot-red    { background: #EF4444; }
.db-par-dot-orange { background: #F59E0B; }

/* ── Vendor Spend Analysis table ── */
.db-vendor-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.db-vendor-table thead th {
    font-size: 10px;
    font-weight: 800;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    padding: 7px 0;
    border-bottom: 1px solid #E6EBF2;
    text-align: left;
}
.db-vendor-table thead th:first-child { padding-left: 0; }
.db-vendor-table thead th:last-child  { padding-right: 0; }
.db-vendor-table thead .db-vendor-th-num { text-align: right; }
.db-vendor-table tbody td {
    font-size: 12px;
    font-weight: 600;
    color: #071A3D;
    padding: 7px 0;
    border-bottom: 1px solid #EDF2F7;
}
.db-vendor-table tbody td:first-child { padding-left: 0; }
.db-vendor-table tbody td:last-child  { padding-right: 0; }
.db-vendor-col       { width: 62%; }
.db-vendor-spend-col { width: 20%; }
.db-vendor-pct-col   { width: 18%; }
.db-vendor-cell {
    display: grid;
    grid-template-columns: 130px 1fr;
    align-items: center;
    column-gap: 16px;
}
.db-vendor-name {
    font-size: 12px;
    font-weight: 600;
    color: #071A3D;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.db-vendor-bar-track { height: 6px; background: #EEF2F8; border-radius: 999px; overflow: hidden; }
.db-vendor-bar-fill  { height: 6px; background: #12A66A; border-radius: 999px; }
.db-vendor-num { font-size: 12px; font-weight: 700; color: #071A3D; text-align: right; }
.db-vendor-pct { font-size: 12px; font-weight: 600; color: #071A3D; text-align: right; }
.db-vendor-total-row td { font-weight: 800 !important; border-top: 1px solid #E6EBF2; border-bottom: none !important; padding-top: 8px; }

/* ── Dashboard status badges (risk level) ── */
.db-badge-danger  { display:inline-block; padding:0.15em 0.55em; border-radius:99px; font-size:0.72rem; font-weight:600; background:#fde8ea; color:#b02a37; }
.db-badge-warning { display:inline-block; padding:0.15em 0.55em; border-radius:99px; font-size:0.72rem; font-weight:600; background:#fff3cd; color:#856404; }
.db-badge-success { display:inline-block; padding:0.15em 0.55em; border-radius:99px; font-size:0.72rem; font-weight:600; background:#d1e7dd; color:#0f5132; }

/* ── Group header rows in sales table ── */
.group-header-row td {
    background: #f0f4fa;
    font-weight: 700;
    font-size: 0.875rem;
    color: #1a202c;
    padding: 0.6rem 1rem;
    border-top: 2px solid #dee2e6;
    letter-spacing: 0.01em;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Purchase Orders Page — Analytics Section
   ──────────────────────────────────────────────────────────────────────────── */
.po-analytics-section {
    display: grid;
    grid-template-columns: minmax(280px, 32%) minmax(0, 1fr);
    gap: 18px;
    margin-bottom: 20px;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
}
/* Allow both columns to shrink below their content size — prevents controls from blowing out layout */
.po-analytics-section > * {
    min-width: 0;
}
@media (max-width: 1550px) {
    .po-analytics-section {
        grid-template-columns: 1fr;
    }
    .po-chart-card {
        width: 100%;
        height: auto;
        min-height: 320px;
    }
    .po-chart-controls {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }
}

/* ── PO KPI Grid (3 × 2) ── */
.po-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    align-content: stretch;
    height: 100%;
    width: 100%;
    min-width: 0;
}
@media (max-width: 1550px) { .po-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .po-kpi-grid { grid-template-columns: 1fr; } }

.po-kpi-card {
    background: #FFFFFF;
    border: 1px solid #E6EBF2;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    padding: 18px;
    min-height: 128px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transition: box-shadow 0.18s, transform 0.18s;
    box-sizing: border-box;
    cursor: pointer;
}
.po-kpi-card:hover {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.09);
    transform: translateY(-1px);
}
.po-kpi-card.active-filter {
    border-color: #1D6DFF;
    box-shadow: 0 0 0 2px rgba(29, 109, 255, 0.12), 0 4px 12px rgba(15, 23, 42, 0.06);
}

.po-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}
.po-kpi-icon svg { width: 22px; height: 22px; stroke-width: 2.2; }

.po-kpi-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.po-kpi-label,
.po-kpi-secondary-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.25px;
    color: #53657D;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.po-kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: #071A3D;
    line-height: 1.2;
    margin-top: 4px;
    order: 1;
}
.po-kpi-secondary-label {
    margin-top: 12px;
    order: 2;
}
.po-kpi-secondary-value {
    font-size: 18px;
    font-weight: 700;
    color: #071A3D;
    margin-top: 2px;
    order: 3;
}
.po-kpi-filter-indicator {
    display: none;
    margin-top: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #1D6DFF;
    order: 4;
}
.po-kpi-card.active-filter .po-kpi-filter-indicator {
    display: block;
}

/* ── PO Trend Chart Card ── */
.po-chart-card {
    background: #FFFFFF;
    border: 1px solid #E6EBF2;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    padding: 16px 20px 16px 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    box-sizing: border-box;
    height: 100%;
    width: 100%;
}

.po-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 12px;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}
.po-chart-title {
    font-size: 16px;
    font-weight: 700;
    color: #071A3D;
}

.po-chart-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 20px;
    margin-left: auto;
    justify-content: flex-end;
    box-sizing: border-box;
}

.po-ctrl-select {
    height: 32px;
    border: 1px solid #D8E1EE;
    border-radius: 6px;
    background: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    color: #071A3D;
    padding: 0 28px 0 10px;
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23475569'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 8px 5px;
}
.po-ctrl-select:focus { outline: none; border-color: #1D6DFF; }

.po-ctrl-btn {
    height: 32px;
    border: 1px solid #D8E1EE;
    border-radius: 6px;
    background: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    color: #071A3D;
    padding: 0 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}
.po-ctrl-btn:hover { background: #F8FAFC; border-color: #B8C7DA; }
.chart-icon-btn {
    height: 32px;
    width: 32px;
    border: 1px solid #D8E1EE;
    border-radius: 6px;
    background: #FFFFFF;
    color: #071A3D;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}
.chart-icon-btn:hover { background: #F8FAFC; border-color: #94A3B8; }

.po-chart-canvas-wrap {
    position: relative;
    flex: 1;
    height: 320px;
    min-height: 200px;
    width: 100%;
}

/* ── PO Table Enhancements ── */
.po-table-card .table-card-header {
    padding: 18px 20px;
    border-bottom: 1px solid #E6EBF2;
}
.po-table-card {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-top: 1px solid #E6EBF2;
    background: #FFFFFF;
    gap: 12px;
    flex-wrap: wrap;
}
.pagination-summary {
    font-size: 13px;
    color: #53657D;
}
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.pagination-button {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #D8E1EE;
    border-radius: 6px;
    background: #FFFFFF;
    color: #071A3D;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.pagination-button.active {
    background: #1D6DFF;
    border-color: #1D6DFF;
    color: #FFFFFF;
}
.pagination-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.pagination-ellipsis {
    font-size: 13px;
    font-weight: 600;
    color: #53657D;
    padding: 0 2px;
}
.po-filter-bar {
    background: #FFFFFF;
    border: 1px solid #E6EBF2;
    border-radius: 10px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 20px;
}
.po-filter-bar .filter-group {
    min-width: 0;
}
.po-filter-bar .filter-label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 4px;
    display: block;
}
.po-filter-pill {
    height: 36px;
    border: 1px solid #CBD5E1;
    border-radius: 999px;
    background: #FFFFFF;
    padding: 0 14px;
    padding-right: 36px;
    font-size: 14px;
    font-weight: 500;
    color: #1E293B;
    min-width: 170px;
}
.po-filter-pill.open {
    border-color: #1D6DFF;
    box-shadow: 0 0 0 3px rgba(29, 109, 255, 0.12);
}
.po-search-group {
    flex: 0 0 auto;
}
input.po-search-input {
    height: 36px;
    width: 320px;
    max-width: 320px;
    border: 1px solid #CBD5E1;
    border-radius: 999px;
    background: #FFFFFF;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: #1E293B;
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-width: unset;
}
input.po-search-input::placeholder {
    color: #94A3B8;
    font-weight: 400;
}
input.po-search-input:hover {
    border-color: #94A3B8;
}
input.po-search-input:focus {
    border-color: #1D6DFF;
    box-shadow: 0 0 0 3px rgba(29, 109, 255, 0.12);
}
.po-filter-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Reusable icon-only toolbar button ── */
.toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    cursor: pointer;
    color: #111827;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
    padding: 0;
}
.toolbar-btn:hover {
    background: #F8FAFC;
    border-color: #94A3B8;
}
@media (max-width: 1100px) {
    .po-filter-bar {
        align-items: stretch;
    }
    .po-filter-actions {
        margin-left: 0;
    }
}
@media (max-width: 1200px) {
    input.po-search-input {
        width: 240px;
        max-width: 240px;
    }
}
.po-table-card .table-title {
    font-size: 16px;
    font-weight: 700;
    color: #071A3D;
}

.po-number-cell {
    color: #1D6DFF;
    font-weight: 600;
}

.po-badge {
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
    white-space: nowrap;
}
.po-badge-closed  { background: #DFF7EF; color: #15803D; }
.po-badge-open    { background: #FFF3D9; color: #92400E; }
.po-badge-default { background: #F1F5F9; color: #475569; }

/* ── Trend / Compare Years mode toggle ── */
.trend-mode-toggle {
    display: inline-flex;
    background: #F1F5F9;
    border: 1px solid #D8E1EE;
    border-radius: 8px;
    padding: 2px;
    flex-shrink: 0;
}
.trend-mode-button {
    height: 30px;
    padding: 0 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 12px;
    font-weight: 700;
    color: #53657D;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.trend-mode-button.active { background: #1D6DFF; color: #FFFFFF; }
.trend-mode-button:not(.active):hover { background: #E2E8F0; }

/* ── Year comparison summary row ── */
.compare-summary {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #53657D;
    padding: 0 2px 4px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.compare-summary strong { color: #071A3D; }

/* ── PO chart category multi-select dropdown ── */
.po-cat-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 2000;
    background: #fff;
    border: 1px solid #D8E1EE;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
    min-width: 170px;
    padding: 6px 0;
    display: none;
}
.po-cat-dropdown.open { display: block; }
.po-cat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #071A3D;
    user-select: none;
}
.po-cat-item:hover { background: #F8FAFC; }
.po-cat-item span {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.po-cat-item input[type="checkbox"] {
    width: 14px;
    min-width: 0;
    height: 14px;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    accent-color: #1D6DFF;
    flex-shrink: 0;
}
.po-cat-divider { border: none; border-top: 1px solid #E6EBF2; margin: 4px 0; }

/* ── PO vendor multi-select dropdown (filter bar + chart) ── */
.po-vendor-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 2000;
    background: #FFFFFF;
    border: 1px solid #E6EBF2;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    width: 240px;
    max-width: 240px;
    max-height: 320px;
    overflow-y: auto;
    padding: 0;
    display: none;
}
.po-vendor-dropdown.open { display: block; }
.po-vendor-search {
    display: block;
    width: calc(100% - 16px);
    height: 34px;
    margin: 8px;
    padding: 0 10px;
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: #071A3D;
    outline: none;
}
.po-vendor-search:focus { border-color: #1D6DFF; }

/* ── Year multi-select dropdown ── */
.po-year-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 2000;
    background: #FFFFFF;
    border: 1px solid #E6EBF2;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    min-width: 160px;
    padding: 8px;
    display: none;
}
.po-year-dropdown.open { display: block; }
.po-year-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #071A3D;
    cursor: pointer;
    border-radius: 5px;
    user-select: none;
    font-family: inherit;
}
.po-year-item:hover { background: #F8FAFC; }
.po-year-item input[type="checkbox"] {
    cursor: pointer;
    accent-color: #1D6DFF;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ── Chart helper / auto-reset message ── */
.chart-helper-message {
    font-size: 12px;
    color: #64748B;
    padding: 4px 2px 0;
}

/* ── PO chart empty state ── */
.po-chart-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    z-index: 1;
}
.po-chart-empty-icon { color: #CBD5E1; }
.po-chart-empty p {
    font-size: 13px;
    font-weight: 500;
    color: #64748B;
    text-align: center;
    max-width: 260px;
    line-height: 1.5;
}
