.reports-page {
    display: grid;
    gap: 22px;
    width: min(1480px, 100%);
    margin-inline: auto;
}

.reports-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    padding: 10px;
    border: 1px solid var(--border);
    border-inline-start: 4px solid var(--brand);
    background: var(--surface-raised);
}

.reports-tabs {
    display: inline-grid;
    grid-auto-flow: column;
    gap: 4px;
    flex: 0 0 auto;
    padding: 3px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.reports-tabs a {
    min-width: 132px;
    padding: 9px 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
}

.reports-tabs a:hover {
    color: var(--brand);
}

.reports-tabs a.active {
    background: var(--brand);
    color: var(--brand-contrast);
}

.reports-period {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 190px)) auto;
    align-items: end;
    gap: 8px;
}

.reports-period label {
    gap: 4px;
}

.reports-period label span {
    color: var(--muted);
    font-size: 11px;
}

.reports-period input {
    min-height: 36px;
    padding-block: 6px;
}

.reports-period button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    gap: 6px;
}

.reports-period .ui-icon {
    width: 15px;
    height: 15px;
}

.report-section {
    display: grid;
    gap: 14px;
    padding-block: 2px 4px;
}

.report-section + .report-section,
.report-section + .reports-layout,
.reports-layout + .report-section {
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.report-section-heading,
.report-panel-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
}

.report-section-heading > div,
.report-panel-heading > div {
    min-width: 0;
}

.report-section-heading span,
.report-panel-heading span {
    display: block;
    margin-bottom: 3px;
    color: var(--brand);
    font-size: 10px;
    font-weight: 850;
}

.report-section-heading h2,
.report-panel-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: 20px;
    line-height: 1.25;
}

.report-section-heading > small {
    padding: 5px 8px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 11px;
    direction: ltr;
}

.report-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
    gap: 10px;
}

.report-metric {
    --report-tone: var(--brand);
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
    min-height: 104px;
    gap: 11px;
    padding: 15px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-block-start: 3px solid var(--report-tone);
    background: var(--surface-raised);
}

.report-metric[data-tone="accent"] { --report-tone: var(--accent); }
.report-metric[data-tone="success"] { --report-tone: var(--success); }
.report-metric[data-tone="warning"] { --report-tone: #d97706; }
.report-metric[data-tone="danger"] { --report-tone: var(--danger); }
.report-metric[data-tone="info"] { --report-tone: #0284c7; }

.report-metric-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid color-mix(in srgb, var(--report-tone) 32%, var(--border));
    background: color-mix(in srgb, var(--report-tone) 12%, var(--surface));
    color: var(--report-tone);
}

.report-metric-icon .ui-icon {
    width: 19px;
    height: 19px;
}

.report-metric > div {
    min-width: 0;
}

.report-metric-label {
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-metric strong {
    display: block;
    margin-top: 7px;
    color: var(--text);
    font-size: 23px;
    line-height: 1.1;
}

.report-metric small {
    display: block;
    margin-top: 6px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reports-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 14px;
}

.reports-layout-wide {
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
}

.reports-layout-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-stack {
    display: grid;
    gap: 14px;
}

.report-panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-block-start: 3px solid color-mix(in srgb, var(--accent) 72%, var(--border));
    background: var(--surface-raised);
}

.report-panel-full {
    margin-top: 14px;
}

.report-panel-heading {
    min-height: 58px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface-soft) 86%, var(--brand));
}

.report-panel-heading span {
    color: var(--muted);
}

.report-panel-heading h2 {
    font-size: 16px;
}

.report-panel-heading > strong {
    color: var(--brand);
    font-size: 17px;
}

.report-table {
    font-size: 12px;
}

.report-table th,
.report-table td {
    padding: 9px 10px;
}

.report-table th {
    background: color-mix(in srgb, var(--surface-soft) 88%, var(--brand));
    font-size: 10px;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}

.report-table tbody tr:last-child td {
    border-bottom: 0;
}

.report-record-link {
    color: var(--text);
    font-weight: 800;
    text-decoration: none;
}

.report-record-link:hover {
    color: var(--brand);
}

.report-bars {
    display: grid;
    gap: 14px;
    padding: 15px;
}

.report-bar-row {
    display: grid;
    gap: 7px;
}

.report-bar-copy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 4px 10px;
}

.report-bar-copy strong {
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-bar-copy small {
    grid-column: 1;
    color: var(--muted);
    font-size: 10px;
}

.report-bar-copy b {
    grid-column: 2;
    grid-row: 1 / span 2;
    color: var(--text);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.report-bar-track {
    display: block;
    height: 7px;
    overflow: hidden;
    background: color-mix(in srgb, var(--border) 72%, transparent);
}

.report-bar-track i {
    display: block;
    height: 100%;
    background: var(--brand);
}

.report-bars-accent .report-bar-track i {
    background: var(--accent);
}

.report-bars-success .report-bar-track i {
    background: var(--success);
}

.report-rate,
.report-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding-inline: 8px;
    border: 1px solid color-mix(in srgb, var(--brand) 26%, var(--border));
    background: color-mix(in srgb, var(--brand) 9%, var(--surface));
    color: var(--brand);
    font-size: 11px;
    font-weight: 850;
}

.report-state.is-good {
    border-color: color-mix(in srgb, var(--success) 30%, var(--border));
    background: color-mix(in srgb, var(--success) 10%, var(--surface));
    color: var(--success);
}

.report-state.is-warning {
    border-color: color-mix(in srgb, #d97706 34%, var(--border));
    background: color-mix(in srgb, #d97706 10%, var(--surface));
    color: #b45309;
}

.report-commitments .report-metrics {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.reports-page .empty-state {
    margin: 0;
    padding: 18px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 1180px) {
    .reports-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .reports-tabs {
        align-self: start;
    }

    .reports-period {
        grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    }

    .reports-layout-three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reports-layout-three > :last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .reports-page {
        gap: 18px;
    }

    .reports-toolbar {
        padding: 8px;
    }

    .reports-tabs {
        display: grid;
        width: 100%;
    }

    .reports-tabs a {
        min-width: 0;
    }

    .reports-period {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reports-period button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .report-metrics,
    .reports-layout,
    .reports-layout-wide,
    .reports-layout-three {
        grid-template-columns: 1fr;
    }

    .reports-layout-three > :last-child {
        grid-column: auto;
    }

    .report-section-heading {
        align-items: start;
        flex-direction: column;
    }

    .report-section-heading > small {
        align-self: stretch;
        text-align: center;
    }
}

@media (max-width: 460px) {
    .reports-tabs {
        grid-auto-flow: row;
    }

    .reports-period {
        grid-template-columns: 1fr;
    }

    .reports-period button {
        grid-column: auto;
    }

    .report-metric {
        grid-template-columns: 34px minmax(0, 1fr);
        min-height: 94px;
        padding: 12px;
    }

    .report-metric-icon {
        width: 34px;
        height: 34px;
    }
}

