/*
  base.css — design tokens, app layout (sidebar + main), typography.
  Light, calm "product lab" look: soft neutrals, one indigo accent,
  teal for deterministic evidence and violet for AI guidance.
*/
:root {
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --ink: #0e1424;
  --ink-2: #3b4459;
  --muted: #6b7489;
  --line: #e4e7f0;
  --line-2: #eef0f6;
  --accent: #4b45e0;
  --accent-soft: #eceafe;
  --evidence: #0f8f83;
  --evidence-soft: #e3f5f2;
  --ai: #7a3fe4;
  --ai-soft: #f1eafe;
  --manual: #2f86c9;
  --manual-soft: #e6f1fa;
  --p1: #d63b3b;
  --p2: #e8762b;
  --p3: #d6a419;
  --p4: #8b93a7;
  --ev4: #0f8f83;
  --ev3: #3aa79b;
  --ev2: #7cc4ba;
  --ev1: #c3e3de;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, .16);
  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--mono); font-size: 12.5px; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 22px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; }
h4 { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
p { margin: 0; }

/* ---------- App frame ---------- */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 18px;
  padding: 22px 16px;
  background: linear-gradient(180deg, #0f1430 0%, #171c3d 100%);
  color: #cfd3ea;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 6px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; position: relative; background: radial-gradient(circle at 30% 30%, #8d86ff, #4b45e0 60%, #2a2585); box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 6px 18px rgba(75,69,224,.5); }
.brand-mark span { position: absolute; inset: 8px; border: 1.5px solid rgba(255,255,255,.75); border-radius: 50%; }
.brand-mark span:nth-child(2) { transform: rotate(60deg) scaleX(.45); }
.brand-mark span:nth-child(3) { transform: rotate(-60deg) scaleX(.45); }
.brand-name { color: #fff; font-weight: 650; font-size: 15px; }
.brand-sub { font-size: 12px; color: #8d93b5; }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-group { margin: 14px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #6f75a0; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px;
  color: #cfd3ea; font-size: 13.5px;
}
.nav a i { font-style: normal; font-size: 11px; font-family: var(--mono); color: #6f75a0; width: 18px; }
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.nav a.active { background: rgba(141,134,255,.18); color: #fff; box-shadow: inset 2px 0 0 #8d86ff; }
.nav a.active i { color: #b5b0ff; }
.nav a.nav-cta { background: linear-gradient(90deg, rgba(141,134,255,.28), rgba(141,134,255,.08)); color: #fff; font-weight: 600; }

.scenario-box { margin-top: auto; padding: 14px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.scenario-box label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #8d93b5; margin-bottom: 6px; }
.scenario-box select { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.14); background: #0f1430; color: #fff; font: inherit; font-size: 13px; }
.scenario-note { font-size: 12px; color: #9ba0c2; margin-top: 8px; line-height: 1.45; }

.main { min-width: 0; padding: 0 32px 48px; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 18px;
  padding: 16px 0; margin-bottom: 8px;
  background: linear-gradient(var(--bg) 70%, rgba(244,245,250,0));
}
.topbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.org { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-legend { display: flex; gap: 14px; margin-left: auto; font-size: 12px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-evidence { background: var(--evidence); }
.dot-ai { background: var(--ai); }
.dot-manual { background: var(--manual); }

.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 8px 0 22px; }
.view-head p { color: var(--muted); max-width: 720px; margin-top: 6px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }

@media (max-width: 1100px) {
  .topbar-legend { display: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-group { display: none; }
  .main { padding: 0 16px 40px; }
  .view-head { flex-direction: column; align-items: flex-start; }
  .topbar .pill { display: none; }
}
