:root {
  --bg: #f5f6f8; --panel: #ffffff; --ink: #1d2433; --muted: #667085; --line: #e3e6eb;
  --accent: #c99400; --accent-ink: #1d2433; --ok: #1a7f4b; --ok-bg: #e7f6ee; --warn: #9a6400; --warn-bg: #fff4dc;
  --err: #b42318; --err-bg: #fdecea; --info-bg: #eef2f8; --radius: 8px;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: #1f5fbf; text-decoration: none; }
a:hover { text-decoration: underline; }
header.top { display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 56px; background: #161a23; color: #fff; }
header.top .brand { color: #f0b90b; font-weight: 700; font-size: 16px; letter-spacing: .2px; }
header.top nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
header.top nav a { color: #c9cfdb; padding: 6px 12px; border-radius: 6px; white-space: nowrap; }
header.top nav a.active, header.top nav a:hover { background: #262c38; color: #fff; text-decoration: none; }
header.top .logout { display: flex; align-items: center; gap: 10px; color: #c9cfdb; margin: 0; }
main { max-width: 1280px; margin: 0 auto; padding: 24px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card .value { font-size: 22px; font-weight: 650; }
.card .label { color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
/* Long tables scroll inside a screen-high box: the horizontal scrollbar stays in view and the header stays on top. */
.table-wrap.tall { max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.table-wrap.tall thead th { position: sticky; top: 0; z-index: 1; box-shadow: inset 0 -1px 0 var(--line); }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; background: #fafbfc; }
th.num, td.num { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nowrap, th.nowrap { white-space: nowrap; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.err { background: var(--err-bg); color: var(--err); }
.chip.idle { background: var(--info-bg); color: #3b4a63; }
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--err-bg); color: var(--err); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
form.stack { display: grid; gap: 14px; max-width: 520px; }
form.inline { display: inline; }
label { display: grid; gap: 4px; font-weight: 600; font-size: 13px; }
label .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
textarea { font: 12px/1.4 ui-monospace, Consolas, monospace; padding: 8px 10px; border: 1px solid #cdd2da; border-radius: 6px; width: 100%; resize: vertical; }
input[type=text], input[type=password], input[type=date], select {
  font: inherit; padding: 8px 10px; border: 1px solid #cdd2da; border-radius: 6px; background: #fff; color: var(--ink); width: 100%;
}
input:focus, select:focus, button:focus-visible { outline: 2px solid #f0b90b; outline-offset: 1px; }
button, .button { font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 6px; border: 1px solid #cdd2da; background: #fff; color: var(--ink); cursor: pointer; display: inline-block; }
button.primary, .button.primary { background: #f0b90b; border-color: #e0ab00; color: #1d2433; }
button.danger { background: #fff; border-color: #f1b5ae; color: var(--err); }
button.link { background: none; border: 0; padding: 0; color: #c9cfdb; font-weight: 400; }
button:hover, .button:hover { filter: brightness(.97); text-decoration: none; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.row > label { flex: 1 1 160px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; font-weight: 400; }
.checks label { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.presets button { padding: 4px 10px; font-weight: 500; font-size: 12px; }
.presets button.active { background: #f0b90b; border-color: #e0ab00; color: #1d2433; font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions.center { align-items: center; }
.bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bar h2 { margin: 0; }
.mt { margin-top: 16px; }
form.stack.wide { max-width: none; }
dl.props { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.props dt { color: var(--muted); }
dl.props dd { margin: 0; }
.login { max-width: 380px; margin: 10vh auto; }
code { background: #f0f2f5; padding: 1px 5px; border-radius: 4px; }
@media (max-width: 720px) {
  header.top { padding: 0 12px; gap: 12px; }
  main { padding: 16px; }
  header.top .logout span { display: none; }
}
