:root {
    color-scheme: light;
    --ink: #17202a;
    --muted: #627083;
    --line: #d9e0e8;
    --panel: #ffffff;
    --bg: #f4f7f9;
    --accent: #146c94;
    --accent-dark: #0f526f;
    --good: #13795b;
    --warn: #9a5b00;
    --bad: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
}

a {
    color: var(--accent);
    text-decoration: none;
}

.topbar {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 24px;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 24px;
}

.brand {
    color: var(--ink);
    font-size: 22px;
    font-weight: 700;
}

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

.nav a {
    border-radius: 6px;
    color: var(--ink);
    padding: 10px 12px;
}

.nav a:hover {
    background: #eef4f7;
}

.shell {
    margin: 0 auto;
    max-width: 1180px;
    padding: 28px 20px 48px;
}

.page-head {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 20px;
}

h1 {
    font-size: 30px;
    letter-spacing: 0;
    margin: 0;
}

h2 {
    font-size: 20px;
    margin: 0 0 16px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
}

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

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

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

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

.field {
    display: grid;
    gap: 7px;
    margin-bottom: 14px;
}

label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

input,
select {
    background: #fff;
    border: 1px solid #bcc8d4;
    border-radius: 6px;
    color: var(--ink);
    font: inherit;
    min-height: 46px;
    padding: 10px 12px;
    width: 100%;
}

input.scan {
    font-size: 24px;
    min-height: 66px;
}

.button,
button {
    background: var(--accent);
    border: 0;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    min-height: 44px;
    padding: 11px 16px;
}

.button:hover,
button:hover {
    background: var(--accent-dark);
}

.button.secondary {
    background: #e9eef2;
    color: var(--ink);
}

.button.secondary:hover {
    background: #dce5eb;
}

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

.table-wrap {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
}

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

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.metric {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.metric strong {
    display: block;
    font-size: 28px;
    margin-top: 8px;
}

.metrics-row,
.report-section {
    margin-top: 18px;
}

.lookup-preview {
    background: #f7fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 14px;
    padding: 14px;
}

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

.flash {
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.flash.success {
    background: #e9f7f1;
    color: var(--good);
}

.flash.error {
    background: #fdecec;
    color: var(--bad);
}

.status {
    border-radius: 999px;
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 9px;
}

.status.open {
    background: #fff4db;
    color: var(--warn);
}

.status.completed {
    background: #e5f5ee;
    color: var(--good);
}

@media (max-width: 760px) {
    .topbar,
    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .grid.two,
    .grid.three,
    .grid.four {
        grid-template-columns: 1fr;
    }

    .shell {
        padding: 18px 12px 36px;
    }
}
