:root {
  --ink: #1a1f2b; --muted: #5b6577; --line: #e2e6ee; --bg: #eef1f6; --card: #fff;
  --brand: #0f2740; --brand2: #16496f; --accent: #1f6feb; --danger: #b91c1c;
  --crit: #7f1d1d; --high: #b91c1c; --med: #c2660c; --low: #b7950b; --info: #2563a8;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.55 "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; }
.brand { color: #fff; font-weight: 700; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand .mark { color: #7fb3e6; }
.brand .sub { font-weight: 400; color: #9db9d6; font-size: 12.5px; margin-left: 8px; }
.topbar nav { display: flex; align-items: center; gap: 18px; }
.topbar nav a { color: #dce8f5; }
.who { color: #9db9d6; font-size: 13px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 16px 60px; }
.page-head { margin-bottom: 18px; }
.page-head h1 { margin: 0 0 4px; font-size: 24px; color: var(--brand); }
.page-head.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 18px 20px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(20,30,50,.05); }
.card h2 { margin: 0 0 12px; font-size: 16px; color: var(--brand); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f6f8fc; }
.grid .num { text-align: right; }
.empty { color: var(--muted); text-align: center; padding: 22px; }
.fix { color: var(--muted); font-size: 12.5px; margin-top: 3px; }

.stack { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
input, select { font: inherit; color: var(--ink); padding: 8px 10px; border: 1px solid #cfd6e2;
  border-radius: 6px; background: #fff; }
input:focus, select:focus { outline: 2px solid #9cc2f7; border-color: var(--accent); }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.inline input[name="target"] { flex: 1; min-width: 160px; }
.check { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; }

.btn { display: inline-block; font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 6px;
  border: 1px solid #cfd6e2; background: #fff; color: var(--ink); cursor: pointer; }
.btn:hover { background: #f3f6fb; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #1a5fd0; }
.btn.danger { color: var(--danger); border-color: #e7b8b8; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions form { margin: 0; }

.sev-pill { display: inline-block; min-width: 64px; text-align: center; color: #fff; font-weight: 700;
  font-size: 11px; letter-spacing: .04em; padding: 3px 8px; border-radius: 3px; text-transform: uppercase; }
.sev-critical { background: var(--crit); }
.sev-high { background: var(--high); }
.sev-medium { background: var(--med); }
.sev-low { background: var(--low); }
.sev-info, .sev-informational { background: var(--info); }

.status { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 10px; background: #eef1f6; color: var(--muted); }
.s-active { background: #e6f4ea; color: #1e6b34; }
.s-closed { background: #f1f1f1; color: #777; }
.s-draft { background: #fff4e0; color: #9a5b00; }
.s-passive { background: #eef1f6; color: var(--muted); }
.s-standard { background: #e8efff; color: #1f4fbf; }
.kind { font-size: 11.5px; font-weight: 700; text-transform: uppercase; }
.k-include { color: #1e6b34; }
.k-exclude { color: var(--danger); }

.auth-banner { background: #eaf3ea; border: 1px solid #bcd9bc; border-left: 4px solid #2e7d32;
  padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.tile .n { font-size: 24px; font-weight: 700; }
.tile .l { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }

.job { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; border: 1px solid var(--line); background: #fff; }
.job-running, .job-queued { background: #eef5ff; border-color: #bcd4f5; }
.job-done { background: #eaf3ea; border-color: #bcd9bc; }
.job-error { background: #fdecec; border-color: #f0c2c2; }
.err { color: var(--danger); font-size: 12.5px; margin-top: 4px; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid #9cc2f7;
  border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite;
  vertical-align: -2px; margin: 0 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

.alert { background: #fdecec; border: 1px solid #f0c2c2; color: var(--danger);
  padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; }
.login-shell { min-height: 80vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 30px 28px; box-shadow: 0 6px 30px rgba(20,30,50,.1); }
.login-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.login-brand { font-size: 22px; font-weight: 700; color: var(--brand); }
.login-brand .mark { color: var(--accent); }
.fineprint { font-size: 11.5px; color: var(--muted); margin-top: 18px; }

/* history */
.delta-new { color: #b91c1c; font-weight: 600; }
.delta-fixed { color: #1e6b34; font-weight: 600; margin-left: 6px; }
h3.sub { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; margin: 4px 0 8px; }
h3.sub.new { color: #b91c1c; }
h3.sub.fixed { color: #1e6b34; }
.chg { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.chg:last-child { border-bottom: 0; }
.trend { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 6px;
  margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.trend-col { display: flex; flex-direction: column; align-items: center; flex: 1; max-width: 48px; height: 100%; }
.trend-bar { flex: 1; width: 100%; display: flex; flex-direction: column-reverse; }
.trend-bar .seg { width: 100%; min-height: 3px; border-radius: 2px; }
.trend-label { font-size: 11px; color: var(--muted); margin-top: 4px; }

@media (max-width: 760px) {
  .two-col, .tiles { grid-template-columns: 1fr; }
  .topbar .sub { display: none; }
  .grid { display: block; overflow-x: auto; }
}
