:root {
  --bg: #12131C; --surface: #1C1E2B; --surface-2: #262939; --line: #2C2F42; --line-2: #3A3D55;
  --text: #F2F2F7; --muted: #A9ABC2; --faint: #8487A3;
  --accent: #FFD23F; --accent-ink: #12131C; --cyan: #4DD6FF; --ok: #4ADE80; --warn: #FFB547; --err: #FF7A85;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 12px; }
button:hover { border-color: var(--faint); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
button.danger { color: var(--err); }
button.link { background: none; border: 0; padding: 0; color: var(--muted); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; width: 100%; }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; resize: vertical; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
label { display: block; color: var(--muted); font-size: 13px; margin: 12px 0 4px; }
label.check { display: flex; gap: 8px; align-items: center; }
label.check input { width: auto; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
[hidden] { display: none !important; }
.muted { color: var(--faint); }

.top { display: flex; align-items: center; gap: 24px; padding: 12px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.brand span { color: var(--faint); }
.top nav { display: flex; gap: 4px; }
.top nav button { background: none; border: 0; color: var(--muted); padding: 8px 12px; border-radius: 8px; }
.top nav button.on { background: var(--surface-2); color: var(--text); }
.who { margin-left: auto; display: flex; gap: 16px; align-items: center; }
.who form { margin: 0; }

main { max-width: 1200px; margin: 0 auto; padding: 20px; }
.flash { margin-bottom: 16px; padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); }
.flash.err { border-color: var(--err); color: var(--err); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.card b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.card span { color: var(--faint); font-size: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.panel h2 { margin: 0 0 10px; font-size: 15px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.cols .panel { margin-bottom: 16px; }

.chart { width: 100%; height: 180px; display: block; }
.chart .ok { fill: var(--ok); } .chart .unsure { fill: var(--warn); } .chart .noboard { fill: var(--err); }
.axis { display: flex; justify-content: space-between; color: var(--faint); font-size: 11px; margin-top: 4px; }
.legend { color: var(--faint); font-size: 12px; display: flex; gap: 6px; align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-left: 8px; }
.c-ok { background: var(--ok); } .c-unsure { background: var(--warn); } .c-noboard { background: var(--err); }

.list { display: flex; flex-direction: column; }
.list .row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.list .row:first-child { border-top: 0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--faint); }
.dot.on { background: var(--ok); }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; color: var(--faint); font-weight: 500; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl progress { width: 120px; height: 8px; vertical-align: middle; accent-color: var(--accent); }
.st { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.st.running { color: var(--cyan); } .st.done { color: var(--ok); } .st.failed, .st.canceled { color: var(--err); } .st.queued { color: var(--warn); }
.small { font-size: 12px; color: var(--faint); word-break: break-word; }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input { flex: 1 1 260px; width: auto; }
.toolbar select { width: auto; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.vcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.vcard .pic { aspect-ratio: 1; background: var(--surface-2); border-radius: 10px; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--faint); font-size: 12px; }
.vcard .pic img { width: 100%; height: 100%; object-fit: contain; }
.vcard .t { font-size: 13px; line-height: 1.3; }
.vcard .meta { color: var(--faint); font-size: 12px; }
.vcard .meta.low { color: var(--warn); }
.vcard .acts { display: flex; gap: 6px; margin-top: auto; }
.vcard .acts button { flex: 1; padding: 5px 8px; font-size: 12px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 16px; color: var(--faint); }

.addjob { max-width: 640px; }
.addjob button { margin-top: 14px; }

.login { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 16px; }
.login-box { width: 100%; max-width: 340px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.login-box h1 { font-size: 17px; margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.login-box button { width: 100%; margin-top: 16px; padding: 10px; }
.err { color: var(--err); margin: 10px 0 0; }

@media (max-width: 640px) {
  .top { gap: 10px; padding: 10px 12px; }
  main { padding: 12px; }
  .tbl .hide-sm { display: none; }
}
