:root {
  --bg: #f5f6f4;
  --surface: #ffffff;
  --ink: #1f2421;
  --muted: #68706b;
  --line: #dfe3df;
  --line-strong: #c8cec9;
  --nav: #252a27;
  --nav-muted: #bdc5bf;
  --accent: #176b52;
  --accent-soft: #e6f2ed;
  --critical: #a62a2a;
  --critical-bg: #faeaea;
  --high: #ad4d13;
  --high-bg: #fff0e4;
  --medium: #806000;
  --medium-bg: #fbf3d5;
  --low: #52605a;
  --low-bg: #edf0ee;
  --ok: #176b52;
  --ok-bg: #e6f2ed;
  --sidebar-width: 218px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--bg); font-size: 14px; line-height: 1.45; }
button, input, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { width: 18px; height: 18px; flex: none; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); background: var(--nav); color: #fff; display: flex; flex-direction: column; z-index: 20; }
.brand { height: 72px; padding: 0 18px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid #3a403c; }
.brand-mark { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); border-radius: 6px; color: #fff; }
.brand strong, .brand small { display: block; letter-spacing: 0; }
.brand strong { font-size: 15px; }
.brand small { color: var(--nav-muted); font-size: 11px; margin-top: 1px; }
nav { padding: 14px 10px; display: grid; gap: 3px; }
nav a, .nav-command { min-height: 40px; display: flex; align-items: center; gap: 11px; padding: 0 11px; color: var(--nav-muted); text-decoration: none; border: 0; background: transparent; width: 100%; cursor: pointer; border-radius: 4px; }
nav a:hover, nav a.active, .nav-command:hover { color: #fff; background: #373e3a; }
nav a.active { box-shadow: inset 3px 0 var(--accent); }
.logout-form { margin-top: auto; border-top: 1px solid #3a403c; padding: 12px 10px; }
.page-shell { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { min-height: 72px; padding: 12px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
h1, h2, p { margin: 0; letter-spacing: 0; }
.topbar h1 { font-size: 20px; line-height: 1.25; }
.freshness { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; margin-top: 4px; }
main { padding: 22px 28px 40px; max-width: 1800px; margin: 0 auto; }
.button { height: 36px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 4px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover { background: #105a44; }
.button.secondary { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.button.secondary:hover { background: #f1f3f1; }
.metric-band { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 18px; }
.metric-band.four { grid-template-columns: repeat(4, minmax(140px, 1fr)); }
.metric-band > div { min-height: 88px; padding: 16px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line); }
.metric-band > div:last-child { border-right: 0; }
.metric-band span { color: var(--muted); font-size: 12px; }
.metric-band strong { font-size: 25px; line-height: 1.2; margin-top: 5px; font-variant-numeric: tabular-nums; }
.section-band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -28px 18px; padding: 18px 28px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.section-heading h2 { font-size: 16px; }
.section-heading p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.risk-totals { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.status { display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 2px 6px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status svg { width: 14px; height: 14px; }
.status.critical { color: var(--critical); background: var(--critical-bg); }
.status.high { color: var(--high); background: var(--high-bg); }
.status.medium { color: var(--medium); background: var(--medium-bg); }
.status.low, .status.unknown { color: var(--low); background: var(--low-bg); }
.status.ok { color: var(--ok); background: var(--ok-bg); }
.toolbar { min-height: 42px; display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.search-field { width: min(360px, 100%); height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line-strong); background: #fff; border-radius: 4px; }
.search-field svg { color: var(--muted); width: 16px; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); min-width: 0; }
select { height: 36px; padding: 0 30px 0 10px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; color: var(--ink); }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; table-layout: auto; min-width: 880px; background: #fff; }
th, td { padding: 10px 11px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { position: sticky; top: 0; z-index: 2; background: #f0f2f0; color: #4f5752; font-size: 11px; text-transform: none; white-space: nowrap; }
.table-sort { width: 100%; min-height: 24px; display: inline-flex; align-items: center; justify-content: flex-start; gap: 5px; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; font-weight: 700; text-align: left; }
.table-sort:hover, .table-sort:focus-visible { color: var(--accent); outline: none; }
.table-sort svg { width: 13px; height: 13px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfa; }
td strong, td small { display: block; }
td small { color: var(--muted); margin-top: 3px; }
.mono { font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.subtle { color: var(--muted); }
.fingerprint { min-width: 260px; }
.path-cell { min-width: 260px; max-width: 420px; }
.compact-list { display: flex; gap: 4px; flex-wrap: wrap; align-items: flex-start; min-width: 100px; }
.code-chip { display: inline-block; padding: 2px 5px; border-radius: 3px; background: #edf0ee; color: #37413b; font-family: "Cascadia Mono", Consolas, monospace; font-size: 11px; }
.unknown-text { color: var(--muted); font-size: 12px; }
.empty { text-align: center; color: var(--muted); padding: 30px; }
details summary { color: var(--accent); cursor: pointer; white-space: nowrap; }
pre { max-width: 520px; max-height: 280px; overflow: auto; padding: 10px; background: #f1f3f1; border: 1px solid var(--line); font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.source-list { display: grid; }
.source-list > div { display: grid; grid-template-columns: minmax(120px, 1fr) auto 70px; align-items: center; gap: 10px; min-height: 38px; border-bottom: 1px solid var(--line); }
.source-list small { color: var(--muted); text-align: right; }
.state-boundary { margin: 0; display: grid; }
.state-boundary > div { display: grid; grid-template-columns: 90px 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.state-boundary dt { font-weight: 700; color: var(--accent); }
.state-boundary dd { margin: 0; color: var(--muted); }
.scope-banner { min-height: 58px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--accent-soft); border: 1px solid #bcd8cc; border-radius: 4px; margin-bottom: 18px; }
.scope-banner.warning { background: var(--high-bg); border-color: #ebc5a8; }
.scope-banner > div { display: flex; flex-direction: column; }
.scope-banner span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.state-tabs { display: inline-flex; gap: 0; margin-bottom: 16px; border: 1px solid var(--line-strong); border-radius: 4px; overflow: hidden; }
.state-tabs span { padding: 7px 11px; background: #fff; border-right: 1px solid var(--line-strong); color: var(--muted); }
.state-tabs span:last-child { border-right: 0; }
.state-tabs span.active { color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.flash-list { display: grid; gap: 8px; margin-bottom: 14px; }
.flash { padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; }
.flash.success { border-color: #9fc9b8; color: var(--ok); }
.flash.warning { border-color: #e0bc68; color: var(--medium); }
.error-state { min-height: 360px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.error-state > strong { font-size: 56px; color: var(--line-strong); }
.error-state h2 { font-size: 20px; margin-top: 5px; }
.error-state p { color: var(--muted); margin-top: 5px; }
.nav-toggle { display: none; }
.icon-button { width: 38px; height: 38px; align-items: center; justify-content: center; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); border-radius: 4px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eef1ef; }
.login-panel { width: min(410px, 100%); padding: 28px; border: 1px solid var(--line-strong); background: #fff; border-radius: 6px; box-shadow: 0 10px 30px rgba(31, 36, 33, 0.08); }
.login-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-heading h1 { font-size: 20px; }
.login-heading p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.login-form { display: grid; gap: 8px; }
.login-form label { font-weight: 600; font-size: 12px; margin-top: 5px; }
.login-form input { height: 40px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 10px; outline: none; }
.login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.login-form .button { margin-top: 10px; width: 100%; height: 40px; }
.oauth-login { width: 100%; height: 40px; }
.login-divider { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 18px 0 10px; color: var(--muted); font-size: 12px; }
.login-divider::before, .login-divider::after { content: ""; height: 1px; background: var(--line); }
.form-error { display: flex; align-items: center; gap: 7px; padding: 9px 10px; margin-bottom: 14px; background: var(--critical-bg); color: var(--critical); border: 1px solid #e7bebe; border-radius: 4px; }
@media (max-width: 1100px) {
  .metric-band { grid-template-columns: repeat(3, 1fr); }
  .metric-band > div:nth-child(3) { border-right: 0; }
  .metric-band > div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .two-column { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: transform 160ms ease; box-shadow: 8px 0 24px rgba(0,0,0,.16); }
  .sidebar.open { transform: translateX(0); }
  .page-shell { margin-left: 0; }
  .nav-toggle { display: flex; position: fixed; top: 11px; left: 12px; z-index: 30; transition: left 160ms ease; }
  .nav-toggle[aria-expanded="true"] { left: calc(var(--sidebar-width) - 50px); }
  .topbar { padding: 10px 12px 10px 60px; min-height: 62px; align-items: flex-start; }
  .topbar h1 { font-size: 17px; }
  .topbar .button span { display: none; }
  .topbar .button { width: 36px; padding: 0; }
  main { padding: 14px 12px 30px; }
  .section-band { margin-left: -12px; margin-right: -12px; padding: 15px 12px; }
  .metric-band, .metric-band.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-band > div { min-height: 72px; padding: 12px; border-bottom: 1px solid var(--line); }
  .metric-band > div:nth-child(odd) { border-right: 1px solid var(--line); }
  .metric-band > div:nth-child(even) { border-right: 0; }
  .metric-band > div:nth-last-child(-n+2) { border-bottom: 0; }
  .metric-band strong { font-size: 21px; }
  .section-heading { flex-direction: column; }
  .risk-totals { justify-content: flex-start; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-field, select { width: 100%; }
  table { min-width: 780px; }
  th, td { padding: 9px; }
  .scope-banner { align-items: flex-start; }
}
@media (max-width: 400px) {
  .topbar { gap: 7px; }
  .freshness > span:first-of-type { display: none; }
  .login-panel { padding: 22px 18px; }
}
