/* Vulnerability Ledger: a quiet working surface where only the deadlines shout. */
:root {
  --ink: #1F2A37;
  --muted: #5B6B7C;
  --line: #D9E3EE;
  --bg: #F4F7FA;
  --panel: #FFFFFF;
  --accent: #5B9BD5;
  --accent-ink: #1F4E79;
  --blue-l: #BDD7EE;
  --orange-l: #F8CBAD;
  --orange: #F4B183;
  --crit: #A61B1B;
  --crit-bg: #FBE9E9;
  --amber-bg: #FFE9A8;
  --ok: #2F6B3A;
  --font: Calibri, Carlito, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: Consolas, "Liberation Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.45; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { color: #0F2D4A; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1 { font-size: 1.75rem; line-height: 1.15; margin: 0 0 .25rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .6rem; font-weight: 700; }
h2:first-child { margin-top: 0; }
p { margin: 0 0 .75rem; }
code, .mono { font-family: var(--mono); font-size: .88em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.warn { color: #8A4B00; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- top bar */
.topbar { display: flex; align-items: center; gap: 1.5rem; padding: 0 1.5rem; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; min-height: 56px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.brand-lg { font-size: 1.4rem; margin-bottom: 1.5rem; }
.brand-mark { width: 18px; height: 22px; border-radius: 2px;
  background: linear-gradient(var(--accent) 0 50%, var(--orange) 50% 100%); }
.mainnav { display: flex; gap: .25rem; flex-wrap: wrap; flex: 1; }
.mainnav a { padding: 1rem .7rem; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; }
.mainnav a:hover { color: var(--ink); }
.mainnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 700; }
.who { display: flex; align-items: center; gap: .9rem; }
.who form { margin: 0; }
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); vertical-align: middle;
  animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* ---- page */
.page { max-width: 1280px; margin: 0 auto; padding: 1.75rem 1.5rem 4rem; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.pagehead > div:first-child { max-width: 75ch; }
.actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 70ch; }
.crumb { margin: 0 0 .25rem; color: var(--muted); }
.block { margin-top: 2.25rem; }
.block-head { display: flex; justify-content: space-between; align-items: center; }
.meta { color: var(--muted); font-size: .9rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 1.25rem 1.4rem; margin-bottom: 1.25rem; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.25rem; align-items: start; }
.split-narrow { grid-template-columns: 320px minmax(0, 1fr); }
@media (max-width: 960px) { .split, .split-narrow { grid-template-columns: 1fr; } }

/* ---- flash */
.flash { padding: .7rem 1rem; border-radius: 4px; margin-bottom: 1rem; border-left: 4px solid; background: var(--panel); }
.flash-ok { border-color: var(--ok); }
.flash-error { border-color: var(--crit); background: var(--crit-bg); }
.flash-warn { border-color: var(--orange); background: #FDF1E8; }

/* ---- buttons & forms */
.btn { display: inline-block; font: inherit; font-weight: 700; padding: .5rem 1rem; border-radius: 4px; border: 1px solid var(--accent-ink);
  background: var(--accent-ink); color: #fff; cursor: pointer; text-decoration: none; line-height: 1.3; }
.btn:hover { background: #163A5C; color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-quiet { background: var(--panel); color: var(--accent-ink); border-color: var(--blue-l); }
.btn-quiet:hover { background: #EEF5FB; color: var(--accent-ink); }
.btn-danger { background: var(--crit); border-color: var(--crit); }
.btn-danger:hover { background: #821414; }
.linkbtn { font: inherit; background: none; border: 0; color: var(--accent-ink); cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
input, select, textarea { font: inherit; color: var(--ink); padding: .45rem .6rem; border: 1px solid #B9C8D8; border-radius: 4px; background: #fff; max-width: 100%; }
textarea { width: 100%; resize: vertical; }
textarea.mono { font-family: var(--mono); font-size: .85rem; line-height: 1.5; }
.form label { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; font-weight: 600; }
.form label input, .form label select, .form label textarea { font-weight: 400; }
.form label.check, label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
.form.narrow { max-width: 720px; }
.hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
.row2, .row3, .row5 { display: grid; gap: 0 1rem; }
.row2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 760px) { .row2, .row3, .row5 { grid-template-columns: 1fr; } }
.sourcegrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .2rem 1rem; margin-bottom: 1rem; }
@media (max-width: 760px) { .sourcegrid { grid-template-columns: 1fr; } }
details.sources { border: 1px solid var(--line); border-radius: 4px; padding: .7rem 1rem; margin-bottom: 1rem; background: #FAFCFE; }
details.sources summary { cursor: pointer; font-weight: 700; }
.inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 0 0 .5rem; }
.sticky { position: sticky; bottom: 0; padding: .75rem 0; background: linear-gradient(transparent, var(--bg) 35%); }
.statuspick { border: 0; padding: 0; margin: 0 0 1rem; display: grid; gap: .25rem; }
.radio { display: flex; gap: .5rem; align-items: center; font-weight: 400 !important; flex-direction: row !important; margin: 0 !important; }

/* ---- filters */
.filters { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: .8rem 1rem; margin-bottom: 1rem; }
.filters label { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; color: var(--muted); }
.filters label.check { flex-direction: row; align-items: center; color: var(--ink); font-size: 1rem; padding-bottom: .45rem; }
.filters .grow { flex: 1; min-width: 200px; }

/* ---- severity, status, kev */
.sev { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.sev-critical { background: var(--crit); color: #fff; }
.sev-high { background: var(--orange-l); color: #5A2A08; }
.sev-medium { background: var(--amber-bg); color: #5A4400; }
.sev-low { background: var(--blue-l); color: #1F3B57; }
.sev-unscored { background: #E5E9EE; color: #3A4654; }
.sev-mini { font-size: .72rem; padding: 0 .4rem; }
.score { font-variant-numeric: tabular-nums; font-weight: 700; }
.kev { display: inline-block; font-size: .75rem; font-weight: 700; color: var(--crit); border: 1px solid var(--crit); border-radius: 3px; padding: 0 .35rem; vertical-align: middle; }
.status { font-size: .85rem; white-space: nowrap; padding: .05rem .5rem; border-radius: 3px; border: 1px solid var(--line); }
.status-yet-to-update { border-color: #E8B4B4; color: #7A1D1D; background: #FFF6F6; }
.status-in-progress { border-color: var(--orange); color: #6B3408; background: #FFF6EF; }
.status-updated { border-color: #A9CFB2; color: var(--ok); background: #F2FAF4; }
.status-not-applicable, .status-risk-accepted { color: var(--muted); background: #F4F6F8; }
.tag { font-size: .75rem; background: #E5E9EE; padding: 0 .4rem; border-radius: 3px; color: var(--muted); }
.count { font-weight: 700; text-decoration: none; padding: 0 .35rem; border-radius: 3px; }
.count-critical, .count-overdue { background: var(--crit); color: #fff; }
.count-high { background: var(--orange-l); color: #5A2A08; }
.count-medium { background: var(--amber-bg); color: #5A4400; }
.count-low { background: var(--blue-l); color: #1F3B57; }
.count-unscored { background: #E5E9EE; color: #3A4654; }

/* ---- the SLA clock: the one loud element */
.clock { display: grid; gap: .15rem; min-width: 7.5rem; }
.clock-label { font-weight: 700; font-variant-numeric: tabular-nums; }
.clock-bar { height: 4px; background: #E6ECF2; border-radius: 2px; overflow: hidden; }
.clock-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .6s ease-out; }
.clock-date { font-size: .8rem; color: var(--muted); }
.clock-soon .clock-label { color: #8A3A06; }
.clock-soon .clock-bar span { background: var(--orange); }
.clock-today .clock-label, .clock-overdue .clock-label { color: var(--crit); }
.clock-today .clock-bar span, .clock-overdue .clock-bar span { background: var(--crit); }
.clock-done .clock-label, .clock-none .clock-label { color: var(--muted); font-weight: 400; }
@media (prefers-reduced-motion: reduce) { .clock-bar span { transition: none; } }

/* ---- dashboard */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: end; margin-bottom: 1.25rem; }
.hero h1 { font-size: 2.4rem; }
@media (max-width: 960px) { .hero { grid-template-columns: 1fr; } }
.tally { display: flex; gap: 0; margin: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); flex-wrap: wrap; }
.tally-item { padding: .6rem 1rem; border-right: 1px solid var(--line); display: grid; gap: .2rem; justify-items: start; }
.tally-item:last-child { border-right: 0; }
.tally dt { font-size: .85rem; color: var(--muted); }
.tally dd { margin: 0; font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.tally-overdue.is-hot { background: var(--crit); border-radius: 5px 0 0 5px; }
.tally-overdue.is-hot dt, .tally-overdue.is-hot dd { color: #fff; }
.duelist { list-style: none; margin: 0; padding: 0; border-top: 3px solid var(--crit); background: var(--panel);
  border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.due { display: grid; grid-template-columns: 11rem minmax(0, 1fr) 16rem; gap: 1.25rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); align-items: start; }
.due-clock .clock-label { font-size: 1.15rem; }
.due-sys { display: grid; gap: .3rem; justify-items: start; }
@media (max-width: 760px) { .due { grid-template-columns: 1fr; gap: .5rem; } }
.vid { font-weight: 700; font-family: var(--font); }
.vtitle { color: var(--muted); font-size: .92rem; max-width: 80ch; }
.empty { background: var(--panel); border: 1px dashed #B9C8D8; border-radius: 6px; padding: 2rem; text-align: left; }

/* ---- tables */
.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.grid { width: 100%; border-collapse: collapse; font-size: .95rem; }
.grid th { text-align: left; font-weight: 700; background: #EEF4FA; border-bottom: 1px solid var(--line); padding: .55rem .75rem; white-space: nowrap; font-size: .85rem; }
.grid td { padding: .6rem .75rem; border-bottom: 1px solid #E7EDF3; vertical-align: top; }
.grid tr:last-child td { border-bottom: 0; }
.grid .num { text-align: right; }
.grid .chk { width: 2rem; }
.grid.compact td { padding: .4rem .75rem; }
.grid tr.retired td { color: var(--muted); }
.vcell { min-width: 18rem; }
.bulkbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: .75rem; padding: .7rem 1rem; background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px; }
.bulkbar input[type=text] { flex: 1; min-width: 200px; }
.pager { display: flex; gap: 1rem; justify-content: center; align-items: center; margin-top: 1rem; }
.evt { font-family: var(--mono); font-size: .8rem; padding: 0 .35rem; border-radius: 3px; background: #EEF4FA; }
.evt-finding { background: #FDF1E8; }
.evt-system { background: var(--blue-l); }
.evt-report, .evt-mail { background: #E9F5EC; }
.evt-user { background: #F1EEF8; }
.useractions form { margin: 0 0 .4rem; display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.useractions input { padding: .25rem .5rem; font-size: .9rem; }

/* ---- finding detail */
.vhead { font-size: 2rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.facts > div { display: grid; gap: .3rem; align-content: start; justify-items: start; }
.facts .score { font-size: 1.6rem; }
.k { font-size: .85rem; color: var(--muted); }
@media (max-width: 760px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kv { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .45rem 1rem; margin: 0 0 1rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.desc { white-space: pre-line; max-width: 80ch; }
.refs { padding-left: 1.2rem; font-size: .9rem; overflow-wrap: anywhere; }
.history { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--blue-l); }
.history li { padding: 0 0 .9rem 1rem; position: relative; }
.history li::before { content: ""; position: absolute; left: -6px; top: .45rem; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }

/* ---- scans */
.runs { list-style: none; margin: 0; padding: 0; }
.runs li { padding: .5rem .6rem; border-radius: 4px; }
.runs li.is-current { background: #EEF4FA; }
.log { background: #1E2A36; color: #DCE6F0; padding: 1rem; border-radius: 4px; font-family: var(--mono); font-size: .8rem;
  line-height: 1.5; max-height: 70vh; overflow: auto; white-space: pre-wrap; }

/* ---- danger zone */
.block.danger { border-top: 1px solid var(--line); padding-top: 1.25rem; }
.block.danger form { display: flex; gap: .6rem; flex-wrap: wrap; }
.block.danger input { flex: 1; min-width: 220px; }

/* ---- auth */
.page-auth { min-height: 100vh; display: grid; place-items: center; }
.authbox { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 6px; padding: 2rem; }
.authbox .btn { width: 100%; margin-top: .5rem; }

/* ---- additions: settings sections, sign-on, import, branding */
.brand-icon { width: 22px; height: 22px; object-fit: contain; }
.brand-lg .brand-icon { width: 28px; height: 28px; }
.subnav { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; flex-wrap: wrap; }
.subnav a { padding: .55rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.subnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--orange); font-weight: 700; }
.btn-sso { display: block; text-align: center; padding: .7rem 1rem; }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .85rem; margin: 1.25rem 0 1rem; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.authfoot { margin: 1rem 0 0; text-align: center; font-size: .9rem; }
.steps { padding-left: 1.2rem; display: grid; gap: .55rem; }
code.copy { display: block; margin-top: .25rem; padding: .35rem .5rem; background: #EEF4FA; border: 1px solid var(--line); border-radius: 3px;
  overflow-wrap: anywhere; user-select: all; }
.iconpreview { display: flex; align-items: end; gap: .75rem; margin-bottom: 1rem; }
.iconpreview img { border: 1px solid var(--line); border-radius: 4px; padding: 4px; background: #fff; }
.imp-tag { font-size: .8rem; font-weight: 700; padding: .05rem .5rem; border-radius: 3px; background: #E5E9EE; color: var(--muted); }
.imp-tag-add { background: #E9F5EC; color: var(--ok); }
.imp-tag-match { background: var(--blue-l); color: #1F3B57; }
.imp-tag-error { background: var(--crit-bg); color: var(--crit); }
.grid tr.imp-error td { background: #FFFAFA; }
.grid tr.imp-example td { color: var(--muted); }
.import-confirm { margin-top: 1rem; }
legend { font-weight: 600; margin-bottom: .35rem; }
