:root {
  color-scheme: light;
  --ink: #182c37; --muted: #4b6675; --paper: #f2f6f8; --line: #cbd9e0;
  --accent: #135967; --surface: #fff;
  font: 16px/1.5 system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
[hidden] { display: none !important; }
header { min-height: 4rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: .65rem max(1rem,calc((100vw - 78rem)/2)); background: #142e3b; color: white; }
.brand { color: white; text-decoration: none; font: 700 1.25rem Georgia,serif; letter-spacing: .18em; }
nav { display: flex; gap: .25rem; flex-wrap: wrap; }
nav button { border-color: transparent; color: white; background: transparent; }
nav button[aria-current] { background: #294958; }
main { width: min(calc(100% - 2rem),78rem); margin: 1.5rem auto 4rem; }
h1,h2 { font-family: Georgia,serif; font-weight: 500; line-height: 1.16; }
h1 { font-size: clamp(2rem,5vw,3.2rem); margin: .35em 0 .65em; }
h2 { font-size: 1.55rem; margin: 0 0 .8em; }
p { margin: 0 0 .75rem; }
#status:empty { display: none; }
#status { padding: .65rem .85rem; background: #dceef0; border-left: .24rem solid var(--accent); }
#status[data-error] { background: #fae8e1; border-color: #a64328; }
form { display: grid; gap: .75rem; }
label { font-size: .88rem; font-weight: 650; display: grid; min-width: 0; gap: .25rem; }
input,select,textarea,button,.primary { font: inherit; border: 1px solid var(--line); border-radius: .25rem; }
input,select,textarea { width: 100%; color: var(--ink); background: white; padding: .46rem .55rem; }
button,.primary { display: inline-block; cursor: pointer; padding: .42rem .75rem; background: white; color: var(--ink); text-decoration: none; justify-self: start; }
.primary { background: var(--accent); border-color: var(--accent); color: white; }
button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 3px solid #4c9bb4; outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.filters { grid-template-columns: repeat(4,minmax(0,1fr)); align-items: end; }
.filters label:nth-child(5),.filters label:nth-child(6),.filters .actions { grid-column: span 2; }
.filters select[multiple] { padding: .25rem; }
.chart { position: relative; height: clamp(18rem,48vh,32rem); margin: 1.4rem 0 .75rem; background: white; border: 1px solid var(--line); padding: 1rem; }
#empty-chart { position: absolute; inset: 45% 1rem auto; text-align: center; color: var(--muted); }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
.admin-grid section { background: var(--surface); padding: 1.2rem; border-top: 3px solid var(--accent); }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; }
.table-scroll { overflow: auto; max-height: 24rem; margin-top: .75rem; }
table { width: 100%; border-collapse: collapse; font-size: .89rem; }
th,td { text-align: left; padding: .45rem .55rem; border-bottom: 1px solid var(--line); }
th { background: #eaf1f4; } td { font-variant-numeric: tabular-nums; }
.check { display: flex; gap: .5rem; align-items: center; }
.check input { width: auto; }
summary { cursor: pointer; }
@media(max-width: 720px) {
  .admin-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filters label:nth-child(5),.filters label:nth-child(6) { grid-column: auto; }
}
