:root {
  --bg: #f4f6fa; --panel: #fff; --ink: #1b2430; --muted: #667085; --line: #e3e8ef;
  --brand: #2f5bea; --brand-ink: #fff;
  --crit: #b42318; --high: #e8590c; --med: #d99a00; --low: #2f9e44; --info: #8a94a6;
  --p1: #b42318; --p2: #e8590c; --p3: #d99a00; --p4: #2f9e44;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--ink); }
.hidden { display: none !important; }
.topbar { display: flex; align-items: center; gap: 24px; padding: 10px 24px; background: #101828; color: #fff; position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; font-size: 16px; letter-spacing: .3px; }
.logo { color: #f79009; margin-right: 4px; }
nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav a { color: #cbd5e1; text-decoration: none; padding: 6px 12px; border-radius: 6px; }
nav a:hover { background: #1d2939; }
nav a.active { background: var(--brand); color: #fff; }
.btn { border: 1px solid transparent; background: var(--brand); color: var(--brand-ink); padding: 7px 14px; border-radius: 7px; cursor: pointer; font: inherit; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: #475467; color: #e4e7ec; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.access { display: flex; gap: 16px; align-items: end; padding: 10px 24px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.access label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
input, select, textarea { font: inherit; padding: 6px 9px; border: 1px solid #cfd6e2; border-radius: 7px; background: #fff; color: var(--ink); }
textarea { width: 100%; min-height: 64px; resize: vertical; }
main { padding: 20px 24px 60px; max-width: 1280px; margin: 0 auto; }
h2 { margin: 0 0 12px; font-size: 18px; }
h3 { margin: 0 0 10px; font-size: 14px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 14px; }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 14px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); margin-bottom: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .v { font-size: 30px; font-weight: 700; line-height: 1.1; }
.kpi .l { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi.bad .v { color: var(--crit); }
.kpi.warn .v { color: var(--high); }
.kpi.good .v { color: var(--low); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: #f8fafd; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; white-space: nowrap; }
.sev-CRITICAL { background: var(--crit); } .sev-HIGH { background: var(--high); } .sev-MEDIUM { background: var(--med); }
.sev-LOW { background: var(--low); } .sev-INFO { background: var(--info); }
.pri-P1 { background: var(--p1); } .pri-P2 { background: var(--p2); } .pri-P3 { background: var(--p3); } .pri-P4 { background: var(--p4); }
.st { background: #eef2f7; color: #344054; border: 1px solid #d5dbe5; }
.kev { background: #7a0c2e; }
.muted { color: var(--muted); }
.danger { color: var(--crit); font-weight: 600; }
.score { font-weight: 700; font-variant-numeric: tabular-nums; }
.trunc { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 12px; }
.filters label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.filters .chk { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 7px; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 10px; }
.bar-row { display: grid; grid-template-columns: 104px 1fr 36px; gap: 8px; align-items: center; margin: 6px 0; }
.bar-track { background: #eef2f7; border-radius: 6px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; }
.chart-svg { width: 100%; height: 190px; }
.empty { color: var(--muted); padding: 12px 0; }
.toast { position: fixed; right: 20px; bottom: 20px; background: #101828; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 20; max-width: 420px; }
.toast.err { background: var(--crit); }
.scrim { position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 9; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100%); background: #fff; z-index: 10; box-shadow: -8px 0 24px rgba(16,24,40,.2); overflow-y: auto; }
.drawer-inner { padding: 20px 22px 40px; }
.meta { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 12px 0; font-size: 13px; }
.meta dt { color: var(--muted); } .meta dd { margin: 0; word-break: break-word; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 12px 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.form-row label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); flex: 1; min-width: 160px; }
pre.desc { white-space: pre-wrap; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: 13px/1.5 inherit; }
.upload-form { max-width: 560px; display: grid; gap: 10px; }
.upload-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.result { background: #f0f9ff; border: 1px solid #b9e6fe; border-radius: 8px; padding: 10px 12px; margin-top: 12px; }
@media (max-width: 720px) { .topbar { flex-wrap: wrap; padding: 10px 12px; } main { padding: 14px 12px 50px; } .cols-2 { grid-template-columns: 1fr; } }
