:root {
  --bg: #0b0f17; --panel: #131a26; --panel-2: #1a2333; --line: #243044;
  --ink: #e8eef7; --muted: #8a99b0; --accent: #4da3ff;
  --good: #34d399; --ok: #fbbf24; --warn: #fb923c; --bad: #f87171;
  --shadow: 0 6px 24px rgba(0,0,0,.35); --radius: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; }

.shell { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }

/* sidebar */
.sidebar { background: #0e131d; border-right: 1px solid var(--line); padding: 18px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.logo { color: var(--accent); font-size: 22px; }
.brand strong { display: block; letter-spacing: .14em; }
.brand small { color: var(--muted); font-size: 12px; }
.vswitch { padding: 4px 8px 10px; }
.vswitch label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 5px; }
.vswitch select { width: 100%; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); border-radius: 9px; padding: 9px 10px; font: inherit; font-weight: 600; }
.vswitch select:focus { outline: 0; border-color: var(--accent); }
.navgroup { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; padding: 14px 10px 6px; }

/* portfolio venture cards */
.vcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s; }
.vcard:hover { border-color: var(--accent); }
.vcard .vtop { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.vcard .vname { font-size: 16px; font-weight: 700; }
.vcard .vparent { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.vcard .vmetrics { display: flex; gap: 18px; margin: 10px 0; }
.vcard .vmetrics .m b { font-size: 19px; display: block; line-height: 1.1; }
.vcard .vmetrics .m span { font-size: 11px; color: var(--muted); }
.vcard .vissue { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 9px; }
.vtype { font-size: 10px; padding: 2px 7px; border-radius: 6px; background: var(--panel-2); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ring { --p: 0; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: conic-gradient(var(--ringc) calc(var(--p) * 1%), var(--panel-2) 0); }
.ring > span { width: 36px; height: 36px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; }
.nav { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: var(--muted);
  padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 13.5px; margin-bottom: 1px; }
.nav:hover { color: var(--ink); background: var(--panel); }
.nav.active { color: var(--ink); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.side-foot { margin-top: auto; padding: 12px 10px 4px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); }

main { padding: 26px 30px; max-width: 1200px; }
.loading { color: var(--muted); padding: 60px; text-align: center; }

/* header row */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; margin: 0; }
.page-head p { color: var(--muted); margin: 4px 0 0; max-width: 68ch; font-size: 14px; }

/* grid + cards */
.grid { display: grid; gap: 16px; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: 1.2fr .8fr; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .cols-3, .cols-2, .cols-4 { grid-template-columns: 1fr; } .shell { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.card.hero { background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.card .hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card .hd h3 { margin: 0; }

/* buttons */
.btn { background: var(--accent); color: #05203f; border: 0; padding: 9px 15px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.danger { background: #3a1a1a; color: var(--bad); }
.iconbtn { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 4px 7px; border-radius: 7px; }
.iconbtn:hover { color: var(--ink); background: var(--panel-2); }

/* gauge */
.gauge { display: flex; align-items: center; gap: 20px; }
.dial { position: relative; width: 128px; height: 128px; flex: none; }
.dial svg { transform: rotate(-90deg); }
.dial .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.dial .val b { font-size: 32px; display: block; line-height: 1; }
.dial .val span { font-size: 11px; color: var(--muted); }
.band { font-weight: 600; }
.tone-good { color: var(--good); } .tone-ok { color: var(--ok); } .tone-warn { color: var(--warn); } .tone-bad { color: var(--bad); }
.stroke-good { stroke: var(--good); } .stroke-ok { stroke: var(--ok); } .stroke-warn { stroke: var(--warn); } .stroke-bad { stroke: var(--bad); }

.sub { color: var(--muted); font-size: 13px; }
.kpi { font-size: 30px; font-weight: 700; line-height: 1.1; }
.kpi-row { display: flex; gap: 26px; flex-wrap: wrap; }
.kpi-row .k span { display: block; color: var(--muted); font-size: 12px; }

/* questions */
.q { display: grid; gap: 10px; }
.q .item { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.q .item .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.q ul { margin: 6px 0 0; padding-left: 18px; }

/* bottlenecks / insights */
.bottleneck, .insight { display: flex; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.bottleneck:first-child, .insight:first-child { border-top: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; }
.dot.high { background: var(--bad); } .dot.med { background: var(--warn); } .dot.low { background: var(--ok); }
.bottleneck b { display: block; } .bottleneck small, .insight small { color: var(--muted); }
.tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 7px; border-radius: 6px; height: fit-content; flex: none; }
.tag.insight { background: #1e3a5f; color: #9cc7ff; } .tag.warning { background: #4a2318; color: #ffb89c; } .tag.recommendation { background: #1d3d2f; color: #8ee3b8; }

/* bars */
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 42px; align-items: center; gap: 10px; font-size: 13px; }
.bar { height: 8px; background: var(--panel-2); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; }

/* fdi components */
.comp { margin-bottom: 14px; }
.comp .head { display: flex; justify-content: space-between; align-items: baseline; }
.comp .head b { font-size: 15px; } .comp .head .s { font-weight: 700; }
.comp .detail { color: var(--muted); font-size: 13px; margin-top: 2px; }
.comp .track { height: 10px; background: var(--panel-2); border-radius: 6px; margin-top: 8px; overflow: hidden; }
.comp .track > i { display: block; height: 100%; }
.callout { background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 12px 14px; border-radius: 8px; margin-top: 14px; }

/* simulation timeline */
.simctl { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.simctl input[type=range] { flex: 1; accent-color: var(--accent); }
.verdict { font-size: 16px; padding: 14px 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 18px; }
.tl { position: relative; padding: 0 0 22px 28px; border-left: 2px solid var(--line); }
.tl:last-child { border-left-color: transparent; }
.tl .day { position: absolute; left: -23px; top: -2px; width: 44px; height: 44px; border-radius: 50%; background: var(--panel-2); border: 2px solid var(--line); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.tl.high .day { border-color: var(--bad); color: var(--bad); } .tl.med .day { border-color: var(--warn); color: var(--warn); }
.tl .body { margin-left: 36px; } .tl .body b { display: block; } .tl .body small { color: var(--muted); }

/* table */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: 0; }
.pill { font-size: 12px; padding: 3px 9px; border-radius: 20px; font-weight: 600; white-space: nowrap; }
.pill.good { background: #143028; color: var(--good); } .pill.ok { background: #3a3115; color: var(--ok); }
.pill.bad { background: #3a1a1a; color: var(--bad); } .pill.warn { background: #3a2a18; color: var(--warn); }
.pill.neutral { background: var(--panel-2); color: var(--muted); }
.founder-row { background: rgba(77,163,255,.06); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 120px; }
.kcol h4 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; justify-content: space-between; }
.kcol .kval { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.kcard { background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; margin-bottom: 7px; cursor: grab; font-size: 13px; }
.kcard:hover { border-color: var(--accent); }
.kcard b { display: block; } .kcard small { color: var(--muted); }
.kcard.drag-over { outline: 2px dashed var(--accent); }

/* funnel */
.funnel { display: grid; gap: 6px; }
.fbar { display: grid; grid-template-columns: 110px 1fr 80px; align-items: center; gap: 10px; font-size: 13px; }
.fbar .ftrack { height: 26px; background: var(--panel-2); border-radius: 7px; overflow: hidden; }
.fbar .ftrack > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #2d6cb3); }

/* modal */
#modalRoot.open { position: fixed; inset: 0; background: rgba(4,7,12,.65); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 480px; box-shadow: var(--shadow); max-height: 90vh; overflow-y: auto; }
.modal header { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal header h3 { margin: 0; font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.modal .body { padding: 18px 20px; }
.modal footer { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; color: var(--ink); padding: 9px 11px; font: inherit; }
.field textarea { min-height: 72px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--accent); }

/* toast */
#toastRoot { position: fixed; bottom: 18px; right: 18px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--good); padding: 11px 15px; border-radius: 10px; box-shadow: var(--shadow); font-size: 13.5px; animation: slidein .2s ease; }
.toast.err { border-left-color: var(--bad); }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } }

.empty { text-align: center; color: var(--muted); padding: 30px; }
.lead { color: var(--muted); margin: -6px 0 16px; max-width: 70ch; }
.section-title { margin: 0 0 4px; font-size: 22px; }
