:root {
    color-scheme: light;
    --ink: #3a4f63;
    --muted: #4e5766;
    --paper: #b6b7bc;
    --white: #fff;
    --line: #bfcbd6;
    --sidebar: #3a4f63;
    --accent: #4b6c9e;
    --focus: #034af3;
    --radius: .85rem;
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); min-height: 100vh; line-height: 1.5; }
a { color: #034af3; text-underline-offset: .25em; }
a:hover { color: #1d60ff; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { margin-bottom: 1.15rem; line-height: 1.12; font-size: clamp(1.85rem, 4vw, 3rem); letter-spacing: -.05em; }
h2 { font-size: 1.18rem; letter-spacing: -.02em; margin: 0 0 .7rem; }
p + p { margin-top: .45rem; }
.main-menu { display:flex; flex-wrap:wrap; gap:.35rem; padding:.4rem clamp(1rem,3vw,2.75rem); background:#3a4f63; }
.nav-group { position:relative; color:#dde4ec; }
.nav-group summary { padding:.55rem .85rem; background:#465c71; }
.nav-group summary:hover, .nav-group[open] summary { background:#bfcbd6; color:#3a4f63; }
.menu-links { position:absolute; z-index:5; min-width:13rem; padding:.3rem; background:#fff; border:1px solid #bfcbd6; box-shadow:0 .4rem 1rem #26374a25; }
.menu-links a { display:block; padding:.5rem .75rem; color:#3a4f63; text-decoration:none; }
.menu-links a:hover, .menu-links a[aria-current] { background:#dde4ec; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-height: 4.4rem; padding: .85rem clamp(1rem, 3vw, 2.75rem); border-bottom: 1px solid var(--line); background: var(--white); }
.top-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; align-items: center; }
.top-actions a, .top-actions button { font-size: .87rem; }
main { max-width: 99rem; padding: clamp(1rem, 3vw, 2.75rem); margin: 0 auto; }
.auth-brand strong { color: var(--accent); }
.auth main { max-width: 32rem; padding-top: clamp(2rem, 9vw, 7rem); }
.auth .panel button { justify-self: stretch; }
.primary, .secondary, .quiet {
    appearance: none; font: inherit; font-size: .9rem; font-weight: 650; min-height: 2.45rem; display: inline-flex;
    align-items: center; justify-content: center; border: 1px solid transparent; border-radius: .48rem;
    cursor: pointer; text-decoration: none; padding: .48rem .85rem; width: fit-content;
}
.primary { background: var(--accent); color: white; }
.primary:hover { background: #3a4f63; color: white; }
.secondary { border-color: var(--line); background: var(--white); color: var(--ink); }
.secondary:hover { background: #f0f1f7; color: var(--ink); }
.quiet { background: transparent; color: inherit; padding-inline: .3rem; }
.quiet:hover { background: #eaeaf1; }
button:disabled { opacity: .5; cursor: default; }
.panel, .metric, .filters { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(.85rem, 2vw, 1.4rem); }
.panel { min-width: 0; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .55rem 1rem; }
.toolbar h2 { margin: 0; }
.introduction { margin-bottom: 1.15rem; color: var(--muted); }
.gap { margin-block: 1rem; }
.filters { display: flex; align-items: end; gap: .75rem; flex-wrap: wrap; margin: 0 0 1rem; }
.filters label { flex: 1 1 8.5rem; }
.filters select { max-width: 100%; text-overflow: ellipsis; }
main > p { margin-block: .8rem; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1.3rem; }
.metric { display: grid; gap: .35rem; }
.metric span, .muted { color: var(--muted); font-size: .9rem; }
.metric strong { font-size: clamp(1.15rem, 2.2vw, 1.7rem); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; margin-top: .7rem; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead { background: #dde4ec; }
th, td { padding: .72rem .65rem; text-align: left; border-bottom: 1px solid var(--line); }
td a { white-space: nowrap; }
td:first-child, th:first-child { padding-left: .75rem; }
.numeric { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.status { display: inline-flex; padding: .15rem .5rem; border-radius: .35rem; background: #f3ecdf; color: #634611; white-space: nowrap; font-size: .78rem; font-weight: 650; }
.status.posted { color: #1b573d; background: #e3f3eb; }
.notice { border: 1px solid #abdbc3; background: #e9f8ef; color: #18523a; border-radius: .55rem; padding: .85rem; margin-bottom: 1rem; }
.notice.error { border-color: #e4b5bc; color: #7e1728; background: #fff1f3; }
.stacked { display: grid; gap: 1rem; }
.narrow { max-width: 34rem; }
.field-grid, .line { display: grid; gap: .75rem; align-items: end; grid-template-columns: repeat(2,minmax(0,1fr)); }
.field-grid .wide { grid-column: 1/-1; }
.line { grid-template-columns: 1fr minmax(9rem,2fr) .85fr .85fr auto; margin: .7rem 0; }
label { display: grid; gap: .3rem; min-width: 0; color: #3e4252; font-size: .87rem; font-weight: 650; }
input:not([type="checkbox"]), select { font: inherit; font-weight: 450; color: var(--ink); width: 100%; min-height: 2.45rem; border: 1px solid #bfc4d1; border-radius: .4rem; background: white; padding: .4rem .55rem; }
input[type="checkbox"] { accent-color: var(--accent); }
.remove { min-width: 2.3rem; font-size: 1.25rem; }
.site-picker { display: grid; grid-template-columns: repeat(auto-fill,minmax(13rem,1fr)); gap: .55rem; min-width: 0; max-height: 20rem; overflow: auto; border: 1px solid var(--line); padding: .7rem; }
.site-picker label { display: flex; align-items: start; font-weight: 500; }
details summary { cursor: pointer; font-weight: 750; }
details form { margin-top: 1rem; max-width: 35rem; }
.totals { justify-content: end; padding-top: .9rem; }
.pagination { justify-content: end; }
@media (max-width: 570px) {
    .nav-group[open] { width:100%; }
    .menu-links { position:static; min-width:0; }
    .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .line, .field-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .topbar { flex-wrap: wrap; }
    .top-actions { margin-left: 0; }
}
@media print {
    .main-menu, .topbar, .filters, .toolbar button, .toolbar a, .pagination { display: none !important; }
    .application { display: block; }
    body, th { background: white; }
    main { padding: 0; }
    th, td { padding: .25rem; }
    .table-wrap { overflow: visible; }
}

.topbar { background: #4b6c9e; color: #f9f9f9; }
.topbar a, .auth-brand strong, .wordmark:hover { color: #f9f9f9; }
.topbar .quiet:hover { background: #3a4f63; }
.auth label { color: #3366ff; }
