/* LayoffLedger — single-page financial bridge calculator */

:root {
  --bg: #07090f;
  --bg-elev: #0d1220;
  --bg-elev-2: #131a2d;
  --line: #1f2842;
  --line-soft: #182039;
  --text: #e7ecf6;
  --text-dim: #98a2bd;
  --text-mute: #6c7796;
  --accent: #5ee0a8;
  --accent-warm: #fbb951;
  --accent-warn: #ff6a6a;
  --accent-good: #4ea8ff;
  --pill: #1c2540;
  --radius: 12px;
  --shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 40px rgba(0,0,0,0.35);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body { min-height: 100vh; line-height: 1.5; }

a { color: var(--accent-good); }
button {
  font: inherit; color: var(--text); background: var(--bg-elev-2);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 16px; cursor: pointer; transition: background 120ms ease, border-color 120ms ease;
}
button:hover { background: #1a2240; border-color: #2c3866; }
button.secondary { background: transparent; }

/* Topbar */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #0a0e1a 0%, #07090f 100%);
}
.brand { display: flex; gap: 10px; align-items: center; }
.brand-name { font-weight: 600; letter-spacing: 0.2px; }
.brand-glyph {
  width: 22px; height: 22px; border-radius: 6px;
  background: conic-gradient(from 210deg, var(--accent) 0deg, var(--accent-good) 120deg, var(--accent-warm) 240deg, var(--accent) 360deg);
  box-shadow: 0 0 24px rgba(94, 224, 168, 0.35);
}
.topbar-meta { color: var(--text-dim); display: flex; gap: 14px; align-items: center; font-size: 13px; }
.snapshot strong { color: var(--text); margin-left: 4px; }
.status-pill {
  background: var(--pill); border: 1px solid var(--line);
  padding: 4px 10px; border-radius: 999px; font-size: 12px; color: var(--text-dim);
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  min-height: calc(100vh - 110px);
}
.rail {
  border-right: 1px solid var(--line);
  background: var(--bg-elev);
  padding: 20px 18px 24px;
}
.rail-header h2 { margin: 4px 0 6px; font-size: 16px; }
.rail-sub { color: var(--text-dim); font-size: 13px; margin: 0 0 14px; }
.persona-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.persona-list li {
  background: var(--bg-elev-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer; transition: border-color 120ms ease, transform 120ms ease;
}
.persona-list li:hover { border-color: #2c3866; }
.persona-list li[aria-selected="true"] {
  border-color: var(--accent); box-shadow: 0 0 0 1px rgba(94,224,168,0.20) inset;
}
.persona-list .p-name { font-weight: 600; font-size: 14px; }
.persona-list .p-meta { color: var(--text-dim); font-size: 12px; margin-top: 3px; }
.rail-footer { margin-top: 24px; }
.footnote { color: var(--text-mute); font-size: 12px; line-height: 1.5; }

/* Board */
.board { padding: 24px 28px 40px; min-width: 0; }
.headline {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px;
  border-bottom: 1px solid var(--line); padding-bottom: 22px; margin-bottom: 22px;
}
.headline-main h1 { font-size: 24px; margin: 0 0 6px; letter-spacing: -0.2px; }
.head-sub { color: var(--text-dim); margin: 0; font-size: 14px; }
.headline-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.kpi {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
}
.kpi-label { font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-value { font-size: 17px; font-weight: 600; }
.kpi-warn .kpi-value { color: var(--accent-warn); }
.kpi-good .kpi-value { color: var(--accent); }

/* Grid panels */
.grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}
.panel {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px 18px; box-shadow: var(--shadow);
}
.panel header { margin-bottom: 12px; }
.panel h3 { font-size: 14px; margin: 0 0 2px; letter-spacing: 0.2px; }
.panel-sub { color: var(--text-dim); font-size: 12px; }
.panel-wide { grid-column: 1 / -1; }

/* Stack table */
.stack-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
.stack-table th, .stack-table td {
  text-align: left; padding: 8px 6px; vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
}
.stack-table th { color: var(--text-mute); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.stack-table td.note, .stack-table th.note { color: var(--text-dim); font-size: 12px; }
.stack-table .num, .stack-table .num-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stack-table tfoot th { border-top: 1px solid var(--line); border-bottom: none; font-size: 13px; color: var(--text); text-transform: none; }
.type-pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  border: 1px solid var(--line); color: var(--text-dim); background: var(--bg-elev-2);
}
.type-cash { color: var(--accent); border-color: rgba(94,224,168,0.45); }
.type-in_kind { color: var(--accent-good); border-color: rgba(78,168,255,0.45); }
.type-asset_unlock { color: var(--accent-warm); border-color: rgba(251,185,81,0.45); }
.type-decision_required { color: var(--text-dim); border-color: var(--line); }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline li {
  background: var(--bg-elev-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.timeline .row1 { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.timeline .row2 { color: var(--text-dim); font-size: 12px; margin-top: 4px; }
.timeline .when { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text-mute); white-space: nowrap; }
.urgency-high { border-left: 3px solid var(--accent-warn); }
.urgency-medium { border-left: 3px solid var(--accent-warm); }
.urgency-low { border-left: 3px solid var(--text-mute); }

/* Equity DL */
.equity-dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 0; }
.equity-dl dt { color: var(--text-mute); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.equity-dl dd { margin: 0 0 6px; font-size: 14px; font-variant-numeric: tabular-nums; }
.equity-note { grid-column: 1 / -1; color: var(--text-dim); font-size: 12px; padding-top: 6px; border-top: 1px solid var(--line-soft); }

/* Watch-outs */
.watchouts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.watchouts li {
  background: var(--bg-elev-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 10px 14px;
}
.severity-high { border-left: 3px solid var(--accent-warn); }
.severity-medium { border-left: 3px solid var(--accent-warm); }
.severity-low { border-left: 3px solid var(--text-mute); }
.watchouts .sev { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-mute); }
.watchouts .sev-high { color: var(--accent-warn); }
.watchouts .sev-medium { color: var(--accent-warm); }

/* Negotiation */
.negotiation { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.negotiation li {
  background: var(--bg-elev-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  position: relative;
}
.negotiation li::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 3px 0 0 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-good));
}

/* Plan */
.plan-actions { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.copy-status { color: var(--text-dim); font-size: 12px; }
.plan-text {
  background: #050810; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; max-height: 360px; overflow-y: auto;
  color: #c8d2ed;
}

/* Bottombar */
.bottombar {
  border-top: 1px solid var(--line); padding: 14px 24px;
  color: var(--text-mute); font-size: 12px; background: #050810;
}

/* Responsive */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 280px 1fr; }
  .headline { grid-template-columns: 1fr; }
  .headline-kpis { grid-template-columns: repeat(4, 1fr); }
  .grid { grid-template-columns: 1fr; }
  .negotiation { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .rail { border-right: none; border-bottom: 1px solid var(--line); }
  .headline-kpis { grid-template-columns: repeat(2, 1fr); }
  .board { padding: 18px 16px 32px; }
  .stack-table .note { display: none; }
  .equity-dl { grid-template-columns: 1fr; }
}
