:root {
  --bg: #f4f6f9; --panel: #ffffff; --ink: #18212f; --muted: #647084; --line: #e2e7ee; --brand: #1f5eff; --brand-ink: #ffffff;
  --side: #121a2b; --side-ink: #c5cede; --ok: #12805c; --ok-bg: #e2f5ee; --warn: #9a6200; --warn-bg: #fdf1d7; --bad: #b3261e; --bad-bg: #fde7e5;
  --info: #2b5aa8; --info-bg: #e6eefb; --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1420; --panel: #161e2e; --ink: #e7ecf4; --muted: #94a0b5; --line: #263145; --brand: #5b8bff; --brand-ink: #0b1220;
    --side: #0a0f19; --ok: #4fd1a5; --ok-bg: #11342b; --warn: #f0b955; --warn-bg: #3a2c0d; --bad: #ff8a80; --bad-bg: #40181a; --info: #8db4ff; --info-bg: #17284a; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; } h2 { font-size: 16px; margin: 0 0 10px; } h3 { font-size: 13px; margin: 14px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.logo { font-weight: 700; font-size: 16px; color: #fff; padding: 2px 10px 14px; }
.logo small { display: block; font-weight: 400; font-size: 11px; color: var(--side-ink); opacity: .7; }
.side select { width: 100%; margin: 0 0 12px; background: #1c2740; color: #fff; border: 1px solid #2c3a5a; }
.nav a { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 7px; color: var(--side-ink); }
.nav a:hover { background: #1c2740; text-decoration: none; } .nav a.on { background: var(--brand); color: #fff; }
.nav .sep { margin: 12px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .55; }
.side .foot { margin-top: auto; font-size: 12px; padding: 10px; border-top: 1px solid #23304c; }
.side .foot a { color: var(--side-ink); display: inline-block; margin-right: 10px; }
.main { padding: 22px 26px 60px; min-width: 0; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.head .sub { color: var(--muted); margin-top: 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 7px; padding: 7px 12px; cursor: pointer; }
button:hover { border-color: var(--brand); } button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
button.small { padding: 3px 8px; font-size: 12px; } button.danger { color: var(--bad); } button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink); max-width: 100%; }
textarea { width: 100%; min-height: 70px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.grid { display: grid; gap: 14px; } .kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 14px; }
.kpi .n { font-size: 26px; font-weight: 700; line-height: 1.1; } .kpi .l { color: var(--muted); font-size: 12px; margin-bottom: 4px; } .kpi .d { font-size: 12px; color: var(--muted); margin-top: 4px; }
.two { grid-template-columns: 1.3fr 1fr; } @media (max-width: 1000px) { .two { grid-template-columns: 1fr; } }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { border-collapse: collapse; width: 100%; } th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; background: var(--panel); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; } tr.click { cursor: pointer; } tr.click:hover td { background: color-mix(in srgb, var(--brand) 6%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.ok, .pill.live, .pill.match { background: var(--ok-bg); color: var(--ok); }
.pill.warning, .pill.pending, .pill.submitted, .pill.partial, .pill.medium { background: var(--warn-bg); color: var(--warn); }
.pill.mismatch, .pill.needs_fix, .pill.duplicate, .pill.high { background: var(--bad-bg); color: var(--bad); }
.pill.todo, .pill.skipped, .pill.low, .pill.none { background: var(--info-bg); color: var(--info); }
.muted { color: var(--muted); } .small { font-size: 12px; } .nowrap { white-space: nowrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.issue { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; } .issue .pill { flex: none; }
.bar { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; display: flex; } .bar i { display: block; height: 100%; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; } .legend b { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.job { background: var(--info-bg); color: var(--info); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; }
.job.failed { background: var(--bad-bg); color: var(--bad); } .job.done { background: var(--ok-bg); color: var(--ok); }
.modal { position: fixed; inset: 0; background: rgba(8, 12, 22, .55); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow: auto; z-index: 20; }
.modal[hidden], .toast[hidden] { display: none; }
.sheet { background: var(--panel); border-radius: 12px; padding: 20px; width: min(780px, 100%); border: 1px solid var(--line); }
.sheet .x { float: right; } .form { display: grid; grid-template-columns: 150px 1fr; gap: 10px 12px; align-items: center; } .form input, .form select { width: 100%; }
.cmp { display: grid; grid-template-columns: 90px repeat(3, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: 13px; }
.cmp > div { padding: 8px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); overflow-wrap: anywhere; } .cmp .h { font-weight: 600; background: var(--bg); font-size: 12px; }
pre.ai { white-space: pre-wrap; font: inherit; background: var(--bg); padding: 12px; border-radius: 8px; max-height: 420px; overflow: auto; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 30; max-width: 90vw; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; } .login .card { width: min(380px, 100%); } .login input { width: 100%; margin-bottom: 10px; } .login button { width: 100%; }
.spark { vertical-align: middle; } .up { color: var(--ok); } .down { color: var(--bad); }
.empty { padding: 34px; text-align: center; color: var(--muted); }
@media (max-width: 760px) { .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; } .main { padding: 16px; } .form { grid-template-columns: 1fr; } .cmp { grid-template-columns: 70px repeat(3, minmax(120px, 1fr)); overflow-x: auto; } }
