:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #17202a;
  --muted: #5d6b79;
  --border: #dde2e8;
  --accent: #2563eb;
  --accent-text: #ffffff;
  --green: #15803d;
  --green-bg: #dcfce7;
  --red: #b91c1c;
  --red-bg: #fee2e2;
  --amber: #a16207;
  --amber-bg: #fef3c7;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --surface: #182029;
    --surface-2: #1f2934;
    --text: #e6edf3;
    --muted: #93a1b0;
    --border: #2b3744;
    --accent: #60a5fa;
    --accent-text: #0b1220;
    --green: #4ade80;
    --green-bg: #12321f;
    --red: #f87171;
    --red-bg: #3a1717;
    --amber: #fbbf24;
    --amber-bg: #3a2c0d;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
header.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
header.top h1 { font-size: 17px; margin: 0; }
header.top .who { color: var(--muted); font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
main { max-width: 720px; margin: 24px auto; padding: 0 16px; }
main.wide { max-width: 1400px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px;
}
.card h2 { margin: 0 0 12px; font-size: 18px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
button, .btn {
  text-decoration: none; display: inline-block;
  font: inherit; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 8px; padding: 8px 14px; cursor: pointer;
}
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.big { font-size: 18px; padding: 14px 28px; width: 100%; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.link { background: none; border: none; color: var(--accent); padding: 0; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; max-width: 100%;
}
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.error { color: var(--red); margin-top: 8px; }
.hidden { display: none !important; }

.verdict { border-radius: var(--radius); padding: 20px; text-align: center; margin-bottom: 16px; }
.verdict.approved { background: var(--green-bg); color: var(--green); }
.verdict.rejected { background: var(--red-bg); color: var(--red); }
.verdict .big { font-size: 30px; font-weight: 800; letter-spacing: 0.02em; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.metric { border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: var(--surface-2); }
.metric .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric .t { font-size: 12px; color: var(--muted); }
.metric.pass { border-color: var(--green); }
.metric.pass .v { color: var(--green); }
.metric.fail { border-color: var(--red); background: var(--red-bg); }
.metric.fail .v { color: var(--red); }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 12px 0; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width 0.3s; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 600; }
.tips { margin: 12px 0 0; padding-left: 20px; }

.badge {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px;
  white-space: nowrap;
}
.badge.approved { background: var(--green-bg); color: var(--green); }
.badge.rejected { background: var(--red-bg); color: var(--red); }
.badge.missing { background: var(--surface-2); color: var(--muted); }
.badge.late, .badge.warn { background: var(--amber-bg); color: var(--amber); }

/* admin */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 10px 14px; color: var(--muted); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.tile .n { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile .l { font-size: 13px; color: var(--muted); }
.tile.approved .n { color: var(--green); }
.tile.rejected .n { color: var(--red); }
.tile.warn .n { color: var(--amber); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; background: var(--surface-2); white-space: nowrap; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.g { color: var(--green); font-weight: 600; }
td.r { color: var(--red); font-weight: 700; background: var(--red-bg); }
tr.status-rejected td:first-child { box-shadow: inset 4px 0 0 var(--red); }
tr.status-approved td:first-child { box-shadow: inset 4px 0 0 var(--green); }
.flags { margin: 0; padding-left: 16px; font-size: 12px; color: var(--amber); min-width: 200px; }
dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); max-width: 420px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
.device { font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.confirm {
  display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-size: 15px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 12px; cursor: pointer;
}
.confirm input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
