:root {
    --navy: #17365d;
    --blue: #1f4e78;
    --light-blue: #d9eaf7;
    --yellow: #f5c842;
    --green: #237a57;
    --red: #a83b3b;
    --grey-050: #f7f8fa;
    --grey-100: #eef1f4;
    --grey-300: #cbd2d9;
    --grey-600: #59636e;
    --grey-900: #1d252c;
    --white: #fff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--grey-050);
    color: var(--grey-900);
    line-height: 1.45;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: var(--navy);
    color: var(--white);
    border-bottom: 5px solid var(--yellow);
}

.header-inner {
    min-height: 92px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.eyebrow {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .12em;
    opacity: .78;
}

.brand {
    color: var(--white);
    font-size: 25px;
    font-weight: 700;
    text-decoration: none;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

nav a {
    color: var(--white);
    text-decoration: none;
    padding: 10px 13px;
    border-radius: 5px;
}

nav a:hover,
nav a.active {
    background: rgba(255,255,255,.16);
}

main {
    padding: 32px 0 56px;
}

h1 { color: var(--navy); margin-top: 0; }
h2 { color: var(--blue); }

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.muted { color: var(--grey-600); }

.grid {
    display: grid;
    gap: 20px;
}

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

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

.card {
    background: var(--white);
    border: 1px solid var(--grey-300);
    border-radius: 9px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(23,54,93,.05);
}

.kpi-label {
    color: var(--grey-600);
    font-size: 14px;
    margin-bottom: 6px;
}

.kpi-value {
    color: var(--navy);
    font-size: 31px;
    font-weight: 700;
}

.button,
button {
    display: inline-block;
    border: 0;
    border-radius: 5px;
    padding: 11px 16px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    background: var(--blue);
    color: var(--white);
}

.button-secondary { background: var(--grey-600); }
.button-small {
    padding: 7px 11px;
    font-size: 14px;
}
.button-warning { background: #8a6300; }
.button-danger { background: var(--red); }

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

th, td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--grey-300);
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--blue);
    color: var(--white);
    position: sticky;
    top: 0;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--grey-300);
    border-radius: 8px;
}

form .field {
    margin-bottom: 16px;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

input[type="text"],
input[type="date"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 11px;
    border: 1px solid var(--grey-300);
    border-radius: 5px;
    background: var(--white);
    font: inherit;
}

.checkbox-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.checkbox-row input { width: auto; }

.alert {
    padding: 13px 16px;
    border-radius: 6px;
    margin-bottom: 18px;
}

.alert-success { background: #e3f4ec; color: #19543d; }
.alert-error { background: #fbe6e6; color: #792929; }
.alert-warning { background: #fff3cd; color: #6d5100; }

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-completed { background: #dff3e9; color: #1e6248; }
.badge-running { background: #fff1c7; color: #725500; }
.badge-failed { background: #f8dede; color: #7e2f2f; }

.chart-card canvas {
    max-height: 390px;
}

.site-footer {
    background: var(--navy);
    color: var(--white);
    padding: 22px 0;
}

@media (max-width: 850px) {
    .header-inner,
    .page-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .grid-4,
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.grid-4,
.grid-2,
.chart-card,
.table-wrap {
    margin-bottom: 24px;
}

.card h2 {
    margin: 0 0 14px;
}

.chart-card {
    min-height: 360px;
    display: flex;
    flex-direction: column;
}

.chart-card canvas {
    width: 100% !important;
    height: 280px !important;
    max-height: none;
}

.grid-2 .chart-card canvas {
    height: 300px !important;
}

.kpi-value {
    line-height: 1.15;
}

@media (max-width: 850px) {
    .chart-card {
        min-height: 320px;
    }

    .chart-card canvas,
    .grid-2 .chart-card canvas {
        height: 260px !important;
    }
}

.kpi-grid {
    margin-bottom: 6px;
}

.chart-grid {
    margin-top: 0;
}

.kpi-grid .card {
    padding-bottom: 12px;
}

.chart-grid .chart-card {
    padding-top: 12px;
}

.chart-grid .card h2 {
    margin-bottom: 8px;
}

.kpi-grid {
    margin-bottom: 0;
}

.chart-grid .chart-card {
    padding-top: 0;
}

.chart-grid .card h2 {
    margin-top: 0;
}

.kpi-grid {
    margin-bottom: 20px;
}

.kpi-grid .card {
    padding-bottom: 20px;
}

.chart-grid .chart-card {
    padding-top: 20px;
}
.sort-button {
    width: 100%;
    min-height: 24px;
    padding: 0 14px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    position: relative;
}

.sort-button:hover {
    text-decoration: underline;
}

.sort-button::after {
    content: "";
    position: absolute;
    right: 2px;
    top: 50%;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: .45;
    transform: translateY(-25%);
}

.sort-button[data-sort-direction="asc"]::after {
    border-top: 0;
    border-bottom: 5px solid currentColor;
    opacity: 1;
    transform: translateY(-60%);
}

.sort-button[data-sort-direction="desc"]::after {
    border-top: 5px solid currentColor;
    border-bottom: 0;
    opacity: 1;
    transform: translateY(-25%);
}

.sort-button:focus-visible {
    outline: 2px solid var(--yellow);
    outline-offset: 2px;
}
.table-filters {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(220px, 280px) auto;
    gap: 14px;
    align-items: end;
    margin: 0 0 12px;
}

.table-filters .field {
    margin-bottom: 0;
}

.filter-count {
    color: var(--grey-600);
    font-weight: 700;
    padding: 11px 0;
    white-space: nowrap;
}

@media (max-width: 850px) {
    .table-filters {
        grid-template-columns: 1fr;
    }

    .filter-count {
        padding: 0;
    }
}
.chart-card-tall {
    min-height: 1100px;
}

.chart-card-tall canvas {
    height: 1000px !important;
}

.pagination-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin: -12px 0 24px;
    color: var(--grey-600);
    font-weight: 700;
}

.pagination-controls button {
    padding: 7px 11px;
    font-size: 14px;
}

.pagination-controls button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

@media (max-width: 850px) {
    .pagination-controls {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .chart-card-tall {
        min-height: 900px;
    }

    .chart-card-tall canvas {
        height: 800px !important;
    }
}
.section-heading-inline {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 12px;
}

.section-heading-inline h2 {
    margin: 0;
}

.segmented-control {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.segmented-control button {
    border: 0;
    border-right: 1px solid var(--grey-300);
    border-radius: 0;
    background: var(--white);
    color: var(--navy);
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 700;
}

.segmented-control button:hover,
.segmented-control button:focus-visible {
    background: var(--light-blue);
    color: var(--navy);
}

.segmented-control button:last-child {
    border-right: 0;
}

.segmented-control button.active,
.segmented-control button.active:hover,
.segmented-control button.active:focus-visible {
    background: var(--blue);
    color: var(--white);
    box-shadow: inset 0 0 0 1px var(--blue);
}

@media (max-width: 850px) {
    .section-heading-inline {
        align-items: flex-start;
        flex-direction: column;
    }
}
.chart-note {
    color: var(--grey-600);
    font-weight: 700;
    margin: 0 0 12px;
}
