/* Reports & Analytics page — scoped to avoid affecting the sidebar or other portal screens. */
.reports-page {
    --report-green: #15966a;
    --report-green-dark: #0f7553;
    --report-red: #d90416;
    --report-ink: #111827;
    --report-muted: #667085;
    --report-line: #e0e5ec;
    display: grid;
    gap: 20px;
    min-width: 0;
}
.reports-page h2,.reports-page h3,.reports-page p{margin:0}
.reports-hero{position:relative;display:flex;align-items:center;justify-content:space-between;gap:24px;min-height:100px;padding:24px 28px;overflow:hidden;border-radius:16px;color:#fff;background:radial-gradient(circle at 92% 50%,rgba(255,255,255,.14) 0 76px,transparent 77px),radial-gradient(circle at 28% 50%,rgba(255,255,255,.08) 0 88px,transparent 89px),linear-gradient(115deg,#171717,#b40816 56%,#d90416);box-shadow:0 12px 30px rgba(90,0,8,.16)}
.reports-hero-copy{position:relative;z-index:1;display:flex;align-items:center;gap:18px}.reports-hero-copy h2{font-size:22px;font-weight:750}.reports-hero-copy p{margin-top:6px;color:rgba(255,255,255,.83);font-size:14px}.reports-hero-icon{display:grid;flex:0 0 52px;width:52px;height:52px;place-items:center;border-radius:14px;background:rgba(255,255,255,.17)}
.reports-hero-icon svg,.reports-download-button svg,.report-export-button svg,.report-metric-icon svg,.report-insight-icon svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.reports-download-button,.report-export-button{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:42px;padding:10px 16px;border:1px solid rgba(255,255,255,.22);border-radius:10px;color:#fff;background:rgba(255,255,255,.17);font-weight:700;white-space:nowrap;transition:background 160ms ease,transform 160ms ease}.reports-download-button:hover,.report-export-button:hover{color:#fff;background:rgba(255,255,255,.27);transform:translateY(-1px)}
.reports-metrics{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px}.report-metric-card{display:flex;align-items:center;gap:14px;min-width:0;min-height:80px;padding:16px 18px;border:1px solid var(--report-line);border-radius:14px;background:#fff;box-shadow:0 2px 8px rgba(16,24,40,.035)}.report-metric-card>div{min-width:0}.report-metric-card strong,.report-metric-card span{display:block}.report-metric-card strong{color:var(--report-ink);font-size:24px;line-height:1.05;white-space:nowrap}.report-metric-card>div>span{margin-top:4px;color:#344054;font-size:12px}.report-metric-icon{display:grid;flex:0 0 42px;width:42px;height:42px;place-items:center;border-radius:11px}.report-metric-icon.blue{color:#3569b7;background:#eaf1ff}.report-metric-icon.green{color:#14865f;background:#e5f7ef}.report-metric-icon.red{color:#be3333;background:#fdeaea}.report-metric-icon.purple{color:#8951b5;background:#f0e8f8}.report-metric-icon.amber{color:#b77a19;background:#fff3df}
.reports-filter-card{display:flex;align-items:flex-start;gap:12px;padding:16px 18px;border:1px solid var(--report-line);border-radius:14px;background:#fff}.report-range-presets,.report-date-form{display:flex;align-items:center;gap:8px}.report-range-button,.report-apply-button,.report-reset-button{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:8px 14px;border:1px solid #d8dee7;border-radius:9px;color:#182230;background:#fff;font-weight:700;cursor:pointer;white-space:nowrap}.report-range-button:hover,.report-range-button.active{color:#fff;border-color:var(--report-red);background:var(--report-red)}.report-date-form{position:relative;flex:1;flex-wrap:wrap}.report-date-field{display:flex;align-items:center;gap:8px;color:var(--report-muted);font-size:11px;font-weight:700}.report-date-field input{width:150px;min-height:38px;padding:7px 10px;border-radius:9px}.report-date-separator{color:#98a2b3;font-size:12px}.report-apply-button{color:#fff;border-color:var(--report-red);background:var(--report-red)}.report-apply-button:hover{color:#fff;background:#a9000e}.report-reset-button:hover{background:#f5f7fa}
.report-advanced-filters{flex-basis:100%;width:100%;margin-top:2px;border-top:1px solid #edf0f4}.report-advanced-filters summary{display:inline-flex;align-items:center;gap:7px;padding-top:12px;color:#475467;font-size:12px;font-weight:700;cursor:pointer;list-style:none}.report-advanced-filters summary::-webkit-details-marker{display:none}.report-filter-count{display:inline-grid;min-width:20px;height:20px;padding:0 6px;place-items:center;border-radius:999px;color:#fff;background:var(--report-red);font-size:10px}.report-filter-grid{display:grid;grid-template-columns:repeat(6,minmax(130px,1fr));gap:12px;padding-top:14px}.report-filter-grid label{display:grid;gap:5px;color:var(--report-muted);font-size:11px}.report-filter-grid select{min-height:38px;padding:7px 9px;border-radius:9px}.report-filter-actions{display:flex;grid-column:1/-1;gap:8px}
.reports-analytics-grid{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(360px,.92fr);gap:18px}.report-surface{min-width:0;overflow:hidden;border:1px solid var(--report-line);border-radius:14px;background:#fff;box-shadow:0 2px 8px rgba(16,24,40,.03)}.report-card-header{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:22px 24px 12px}.report-card-header h3{color:var(--report-ink);font-size:17px;font-weight:750}.report-card-header p{margin-top:5px;color:var(--report-muted);font-size:12px}.report-view-toggle{display:inline-flex;padding:3px;border-radius:8px;background:#f2f4f7}.report-view-toggle button{min-height:28px;padding:5px 10px;border:0;border-radius:6px;color:#475467;background:transparent;font-size:11px;font-weight:700;cursor:pointer}.report-view-toggle button.active{color:#101828;background:#fff;box-shadow:0 1px 3px rgba(16,24,40,.12)}
.report-chart-view{display:grid;grid-template-columns:32px minmax(0,1fr);gap:10px;height:300px;padding:12px 20px 24px 18px}.report-chart-scale{display:flex;flex-direction:column;justify-content:space-between;padding-bottom:25px;color:#667085;font-size:10px;text-align:right}.report-bar-scroll{min-width:0;overflow-x:auto;overflow-y:hidden}.report-bar-chart{position:relative;display:grid;grid-template-columns:repeat(var(--report-columns),minmax(28px,1fr));align-items:end;min-width:100%;height:100%;padding:6px 0 26px;border-bottom:0;background:repeating-linear-gradient(to bottom,#fff 0,#fff calc(25% - 1px),#eef1f5 25%)}.report-bar-chart::after{content:"";position:absolute;left:0;right:0;bottom:25px;border-bottom:1px solid #dfe4ea}.report-bar-column{position:relative;display:flex;align-items:center;justify-content:flex-end;flex-direction:column;height:100%;min-width:0;padding:0 4px}.report-bar{width:min(28px,72%);min-height:0;border-radius:4px 4px 0 0;background:linear-gradient(180deg,#e22031,#b60816);box-shadow:0 4px 10px rgba(217,4,22,.13)}.report-bar-value{min-height:16px;margin-bottom:3px;color:#475467;font-size:9px;font-weight:700}.report-bar-label{position:absolute;top:calc(100% + 7px);left:50%;color:#667085;font-size:9px;white-space:nowrap;transform:translateX(-50%)}.report-table-view{max-height:300px;overflow:auto;padding:0 20px 20px}.report-table-view table,.report-mini-table table{min-width:100%}.report-table-view th,.report-table-view td,.report-mini-table th,.report-mini-table td{padding:10px 12px}
.report-donut-layout{display:grid;grid-template-columns:minmax(210px,1fr) minmax(170px,.8fr);align-items:center;gap:24px;min-height:300px;padding:10px 34px 34px}.report-donut{position:relative;display:grid;width:180px;height:180px;margin:auto;place-items:center;border-radius:50%}.report-donut::after{content:"";position:absolute;inset:25px;border-radius:50%;background:#fff;box-shadow:inset 0 0 0 1px #eef1f5}.report-donut>div{position:relative;z-index:1;display:grid;justify-items:center}.report-donut strong{color:var(--report-ink);font-size:30px}.report-donut span{margin-top:3px;color:var(--report-muted);font-size:11px}.report-donut-legend{display:grid;gap:15px}.report-donut-legend>div{display:grid;grid-template-columns:10px minmax(0,1fr) auto;align-items:center;gap:9px;color:#344054;font-size:12px}.report-donut-legend strong{color:#101828}.legend-dot{width:9px;height:9px;border-radius:50%}.legend-dot.delivered{background:#22a875}.legend-dot.returned{background:#d43b3b}.legend-dot.process{background:#dfe4ea}
.reports-insights{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.report-insight-card{display:flex;align-items:flex-start;gap:16px;min-height:108px;padding:20px 22px;border:1px solid var(--report-line);border-radius:14px;background:#fff}.report-insight-icon{display:grid;flex:0 0 42px;width:42px;height:42px;place-items:center;border-radius:11px}.report-insight-card.positive .report-insight-icon{color:#16805d;background:#e2f5ed}.report-insight-card.warning .report-insight-icon{color:#ac6b12;background:#fff0d8}.report-insight-card.danger .report-insight-icon{color:#bd3030;background:#fde4e4}.report-insight-card.neutral .report-insight-icon{color:#475467;background:#eef1f5}.report-insight-card h3{color:var(--report-ink);font-size:15px;font-weight:750}.report-insight-card p{margin-top:6px;color:#475467;font-size:12px;line-height:1.55}
.city-header{align-items:center;padding-bottom:18px}.report-export-button{min-height:38px;padding:8px 14px;border-color:var(--report-red);color:#fff;background:var(--report-red)}.report-export-button:hover{background:#aa000e}.report-city-table-scroll{margin:0 24px;overflow-x:auto;border:1px solid #dfe4ea;border-radius:12px}.report-city-table{min-width:700px}.report-city-table th,.report-city-table td{padding:15px 18px}.report-city-table th{color:#101828;background:#f6f8fb;font-size:11px}.report-city-table tbody tr:hover td{background:#fcfcfd}.report-rate-cell{display:grid;grid-template-columns:minmax(120px,190px) 70px;align-items:center;gap:14px}.report-rate-track{height:8px;overflow:hidden;border-radius:999px;background:#e7ebf0}.report-rate-track>span{display:block;height:100%;border-radius:inherit}.report-rate-track .good{background:#22a875}.report-rate-track .warning{background:#ee9d12}.report-rate-track .danger{background:#d43b3b}
.report-pagination{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px 24px 22px;color:#344054;font-size:12px}.report-pagination nav{display:flex;align-items:center;gap:7px}.report-pagination a,.report-pagination nav>span{display:inline-grid;min-width:36px;height:36px;padding:0 11px;place-items:center;border:1px solid #dfe4ea;border-radius:9px;color:#182230;background:#fff;font-weight:650}.report-pagination a:hover,.report-pagination a.active{color:#fff;border-color:var(--report-red);background:var(--report-red)}.report-pagination nav>span.disabled{color:#98a2b3;background:#f8fafc}.report-pagination nav>span.ellipsis{min-width:auto;padding:0 3px;border:0;background:transparent}
.report-status-details{border:1px solid var(--report-line);border-radius:14px;background:#fff}.report-status-details>summary{padding:16px 20px;color:#344054;font-weight:700;cursor:pointer}.report-status-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;padding:0 18px 18px}.report-mini-table{max-height:280px;overflow:auto;padding:0 18px 18px}
@media(max-width:1380px){.reports-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.report-filter-grid{grid-template-columns:repeat(3,minmax(150px,1fr))}}
@media(max-width:1100px){.reports-filter-card{flex-direction:column}.report-date-form{width:100%}.reports-analytics-grid{grid-template-columns:1fr}.reports-insights{grid-template-columns:1fr}}
@media(max-width:780px){.reports-page{gap:14px}.reports-hero{align-items:stretch;flex-direction:column;padding:20px;border-radius:12px}.reports-download-button{align-self:flex-start}.reports-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.report-metric-card{padding:14px}.report-metric-card strong{font-size:20px}.report-date-form{align-items:stretch}.report-date-field{align-items:stretch;flex:1 1 180px;flex-direction:column;gap:4px}.report-date-field input{width:100%}.report-date-separator{display:none}.report-filter-grid{grid-template-columns:1fr}.report-donut-layout{grid-template-columns:1fr}.report-status-grid{grid-template-columns:1fr}.report-pagination{align-items:flex-start;flex-direction:column}.report-pagination nav{max-width:100%;overflow-x:auto}}
@media(max-width:520px){.reports-metrics{grid-template-columns:1fr}.report-range-presets{width:100%;overflow-x:auto}.report-range-button{flex:0 0 auto}.report-date-form>.report-apply-button{width:100%}.report-card-header{padding:18px 16px 10px}.report-chart-view{height:260px;padding-inline:10px}.report-donut-layout{padding:8px 18px 24px}.report-insight-card{padding:17px}.report-city-table-scroll{margin-inline:14px}.report-pagination{padding-inline:14px}}

/* Report summary icon and range-control polish. */
.reports-page .report-metric-card > .report-metric-icon {
    display: grid !important;
    align-items: center !important;
    justify-items: center !important;
    place-items: center !important;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    padding: 0 !important;
    overflow: hidden;
    line-height: 0;
}

.reports-page .report-metric-card > .report-metric-icon > svg {
    display: block;
    width: 22px !important;
    height: 22px !important;
    margin: auto !important;
    flex: 0 0 22px;
}

.reports-page .report-range-button.active {
    color: #fff !important;
    border-color: var(--report-red) !important;
    background: var(--report-red) !important;
    box-shadow: 0 5px 14px rgba(217, 4, 22, .2);
}

.reports-page .report-range-button:hover:not(.active) {
    color: var(--report-red);
    border-color: rgba(217, 4, 22, .42);
    background: #fff4f5;
}

.reports-page .report-advanced-filters {
    display: none !important;
}

.reports-page .reports-filter-card {
    align-items: center;
    flex-wrap: wrap;
}

.reports-page .report-date-form {
    display: none !important;
    align-items: center;
    margin: 0;
}

.reports-page .reports-filter-card:has(.report-range-button[data-custom-range].active) .report-date-form {
    display: flex !important;
}

@media (max-width: 780px) {
    .reports-page .reports-filter-card:has(.report-range-button[data-custom-range].active) .report-date-form {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .reports-page .report-date-form .report-apply-button {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    .reports-page .report-metric-card > .report-metric-icon {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
    }

    .reports-page .reports-filter-card:has(.report-range-button[data-custom-range].active) .report-date-form {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .reports-page .report-date-form > * {
        grid-column: 1 !important;
        width: 100%;
    }
}