:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #172033;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --line: #263244;
  --accent: #ef4444;
  --accent-2: #fb7185;
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --critical: #7f1d1d;
  --input: #0b1220;
  --shadow: 0 20px 50px rgba(0,0,0,.25);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at top left, #28131a, transparent 28rem), var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
a { color: #fca5a5; text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 2rem; background: rgba(15, 23, 42, .82); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { color: #fff; font-weight: 800; letter-spacing: -.02em; }
nav { display: flex; gap: 1rem; flex-wrap: wrap; }
nav a { color: var(--muted); font-weight: 600; }
.container { width: min(1180px, calc(100% - 2rem)); margin: 2rem auto 5rem; }
.footer { text-align: center; color: var(--muted); padding: 2rem; border-top: 1px solid var(--line); }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.15; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -.04em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
.eyebrow { text-transform: uppercase; color: var(--accent-2); font-weight: 800; letter-spacing: .12em; margin: 0 0 .4rem; font-size: .75rem; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .9rem; }
.preline { white-space: pre-line; }
.card, .auth-card, .metrics article {
  background: linear-gradient(180deg, rgba(23, 32, 51, .96), rgba(17, 24, 39, .96));
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.card { padding: 1.25rem; margin-bottom: 1.25rem; }
.auth-card { max-width: 460px; margin: 8vh auto; padding: 2rem; }
.grid { display: grid; gap: 1.25rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.metrics article { padding: 1.15rem; }
.metrics span { color: var(--muted); display: block; margin-bottom: .5rem; }
.metrics strong { font-size: 2rem; display: block; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.button, button {
  border: 1px solid var(--line);
  color: var(--text);
  background: #1f2937;
  border-radius: 12px;
  padding: .68rem .95rem;
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.45rem;
}
.button.primary, button.primary { background: linear-gradient(135deg, var(--accent), #b91c1c); border-color: #dc2626; color: #fff; }
.button:hover { text-decoration: none; filter: brightness(1.1); }
.actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.stack { display: grid; gap: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.compact-form { margin-top: 1rem; }
.span2 { grid-column: span 2; }
label { color: var(--muted); font-weight: 700; display: grid; gap: .35rem; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input);
  color: var(--text);
  padding: .75rem .85rem;
  font: inherit;
}
textarea { resize: vertical; }
.filters, .upload-form { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.filters input { flex: 1 1 280px; }
.upload-form input[name="description"] { flex: 1 1 320px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .85rem .65rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: #cbd5e1; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: .25rem .6rem; font-size: .8rem; font-weight: 800; white-space: nowrap; }
.badge-critical { background: #7f1d1d; color: #fecaca; }
.badge-high { background: #991b1b; color: #fee2e2; }
.badge-medium { background: #92400e; color: #ffedd5; }
.badge-low { background: #14532d; color: #dcfce7; }
.badge-info { background: #1e3a8a; color: #dbeafe; }
.badge-muted { background: #334155; color: #e2e8f0; }
.badge-active { background: #4c1d95; color: #ede9fe; }
.finding { border-top: 1px solid var(--line); padding: 1rem 0; display: grid; gap: .45rem; }
.finding:first-of-type { border-top: 0; }
.finding-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.drawer { margin-bottom: 1rem; border: 1px dashed var(--line); padding: 1rem; border-radius: 16px; }
.drawer summary { cursor: pointer; font-weight: 800; }
.timeline { display: grid; gap: 1rem; }
.timeline.compact { gap: .7rem; }
.timeline-item { border-left: 3px solid var(--accent); padding-left: 1rem; }
.timeline-item span { color: var(--muted); display: block; font-size: .9rem; }
.flash-stack { display: grid; gap: .7rem; margin-bottom: 1rem; }
.flash { border-radius: 14px; padding: .9rem 1rem; border: 1px solid var(--line); background: #1f2937; }
.flash.success { border-color: #14532d; background: rgba(20,83,45,.45); }
.flash.danger { border-color: #991b1b; background: rgba(127,29,29,.45); }
.flash.warning { border-color: #92400e; background: rgba(146,64,14,.45); }
.flash.info { border-color: #1e3a8a; background: rgba(30,58,138,.45); }
.report { background: #fff; color: #111827; }
.report h1, .report h2, .report h3 { color: #111827; }
.report table { color: #111827; }
.report th, .report td { border-color: #d1d5db; }
.report a { color: #b91c1c; }
@media (max-width: 820px) {
  .grid.two, .metrics, .form-grid { grid-template-columns: 1fr; }
  .span2 { grid-column: span 1; }
  .page-head { flex-direction: column; }
  .topbar { align-items: flex-start; flex-direction: column; gap: .75rem; }
}
@media print {
  body { background: #fff; color: #111; }
  .topbar, .footer, .no-print { display: none !important; }
  .container { width: 100%; margin: 0; }
  .card, .report { box-shadow: none; border: 0; border-radius: 0; }
}
.inline-details summary { cursor: pointer; font-weight: 800; color: #fca5a5; }
.mini-form { display: grid; gap: .6rem; margin: .75rem 0; min-width: 230px; }
.mini-form button { width: 100%; }
.check-row { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: .5rem; }
.check-row input { width: auto; }
