:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #f0f3f2;
  --border: #e2e7e5;
  --text: #16201c;
  --muted: #5e6b66;
  --pine: #1f6f54;
  --pine-weak: #e4f1ec;
  --red: #c7362f;
  --amber: #c9820a;
  --yellow: #a8920a;
  --slate: #64748b;
  --shadow: 0 1px 2px rgba(16,32,28,.06), 0 4px 16px rgba(16,32,28,.05);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1613; --surface: #15201c; --surface-2: #1b2824; --border: #27332e;
    --text: #e8efeb; --muted: #9bada6; --pine: #43b690; --pine-weak: #16302682;
    --red: #f06a62; --amber: #e8a53a; --yellow: #d6c24a; --slate: #94a3b8;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--pine); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- login ---- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow); padding: 40px; max-width: 400px; width: 100%; text-align: center;
}
.brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 20px; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--pine); }
.login-card p { color: var(--muted); }
.btn-google {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  width: 100%; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-weight: 600; cursor: pointer; font-size: 15px;
}
.btn-google:hover { border-color: var(--pine); text-decoration: none; }
.err { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red);
  border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); padding: 10px 12px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }

/* ---- app shell ---- */
header.topbar {
  position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid var(--border);
}
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 16px; }
.topbar .who { margin-left: auto; color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 12px; }
.topbar .who a { color: var(--muted); }
main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 64px; }

/* ---- cards ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
}
.card .k { color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.card .v { font-size: 28px; font-weight: 750; margin-top: 6px; letter-spacing: -.02em; }
.card .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---- panels / charts ---- */
.grid { display: grid; gap: 16px; margin-top: 18px; }
.grid.cols-3 { grid-template-columns: 1.6fr 1fr 1fr; }
@media (max-width: 880px) { .grid.cols-3 { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.panel h2 { font-size: 14px; margin: 0 0 14px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.chart-box { position: relative; height: 240px; }

/* ---- table ---- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 24px 0 12px; }
.toolbar h2 { font-size: 16px; margin: 0; margin-right: auto; }
select, input[type=search] {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px; font-size: 14px;
}
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; }
tbody tr:hover { background: var(--surface-2); }
td.title { white-space: normal; max-width: 340px; color: var(--muted); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.sev-critical, .sev-high { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
.sev-medium { background: color-mix(in srgb, var(--amber) 18%, transparent); color: var(--amber); }
.sev-low { background: color-mix(in srgb, var(--yellow) 18%, transparent); color: var(--yellow); }
.sev-minimal, .sev-none { background: var(--surface-2); color: var(--muted); }
.pill { font-size: 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.muted { color: var(--muted); }
.loading { color: var(--muted); padding: 40px; text-align: center; }
