/* BBS investment simulation – dark "investment memo" theme matching the slide deck */
:root {
  --bg: #0b1726;
  --surface: #13233a;
  --surface-2: #182b45;
  --surface-3: #1e3352;
  --line: #2a4166;
  --grid: #22385a;
  --ink-1: #f4f7fb;
  --ink-2: #a9b8c9;
  --ink-3: #7f92a8;
  --amber: #f2a541;
  --amber-ink: #1a1203;
  --teal: #3fb6a8;
  --red: #ef6b4d;
  --chart-1: #cf7f26;   /* BBS / your team  (validated vs --surface, dark mode) */
  --chart-2: #1f9a8a;   /* MSCI ACWI equivalent */
  --radius: 10px;
  --serif: "Source Serif 4", Cambria, Georgia, serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink-1); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 2rem; line-height: 1.15; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; margin-top: 1.4em; color: var(--ink-2); }
code { font: 600 .95em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-3); padding: .1em .4em; border-radius: 4px; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.amber { color: var(--amber); }
.pos { color: var(--teal); }
.neg { color: var(--red); }
.r { text-align: right; }
.c { text-align: center; }
.kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 700; color: var(--amber); margin: 0 0 .35rem; }

/* ---------------------------------------------------------------- layout */
.topbar { display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--amber); }
.brand:hover { text-decoration: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand b { color: var(--ink-1); font-family: var(--serif); font-size: 1.05rem; }
.brand small { color: var(--ink-3); font-size: .75rem; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { color: var(--ink-2); padding: 6px 12px; border-radius: 6px; font-weight: 500; }
.topbar nav a:hover { background: var(--surface-3); text-decoration: none; color: var(--ink-1); }
.topbar nav a.on { background: var(--surface-3); color: var(--ink-1); }
.who { display: flex; align-items: center; gap: 12px; font-size: .9rem; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 24px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; margin-bottom: 20px; }
.card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.grid-2 > .card { margin-bottom: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h3 { margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { max-width: 760px; }
.empty { color: var(--ink-3); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: 8px; }

/* ---------------------------------------------------------------- pills, tags, flash */
.pill { padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.pill-amber { background: rgba(242,165,65,.15); color: var(--amber); }
.pill-teal { background: rgba(63,182,168,.15); color: var(--teal); }
.tag { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .06em; padding: 2px 6px; border-radius: 4px; background: var(--surface-3); color: var(--ink-2); vertical-align: middle; }
.tag-angel { color: var(--amber); }
.tag-vc { color: var(--teal); }
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-weight: 500; }
.flash-ok { background: rgba(63,182,168,.14); border: 1px solid rgba(63,182,168,.4); }
.flash-err { background: rgba(239,107,77,.14); border: 1px solid rgba(239,107,77,.45); }
.stale { background: var(--amber); color: var(--amber-ink); text-align: center; padding: 8px; font-weight: 600; }
.stale a { color: var(--amber-ink); text-decoration: underline; }
.banner { display: block; background: linear-gradient(90deg, rgba(242,165,65,.18), rgba(242,165,65,.04)); border: 1px solid rgba(242,165,65,.5); color: var(--ink-1); padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; }
.banner:hover { text-decoration: none; border-color: var(--amber); }

/* ---------------------------------------------------------------- buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 .92rem var(--sans); padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-3); color: var(--ink-1); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn-primary:hover { background: #f5b45e; border-color: #f5b45e; }
.btn-amber { border-color: var(--amber); color: var(--amber); background: transparent; }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.btn-row form { margin: 0; }
label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 12px; }
input, select { font: 500 .95rem var(--sans); color: var(--ink-1); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; width: 100%; margin-top: 5px; }
input:focus, select:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: transparent; }
input:disabled { opacity: .45; }
input[type=checkbox] { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--amber); flex: none; }
input[type=file] { padding: 6px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled input, fieldset:disabled select { opacity: .6; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { margin: 0; }
.inline-form .or { color: var(--ink-3); padding-bottom: 10px; font-size: .85rem; }
.input-unit, .input-eur { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; margin-top: 5px; }
.input-unit input, .input-eur input { border: 0; margin: 0; background: transparent; }
.input-unit span, .input-eur > span { padding: 0 10px; color: var(--ink-3); font-weight: 600; }
.input-unit input { width: 80px; }
.input-eur { font-size: 1.4rem; }
.input-eur input { font-size: 1.4rem; font-weight: 700; padding: 10px 10px 10px 0; }
.check { display: flex; gap: 12px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; color: var(--ink-1); font-weight: 500; cursor: pointer; }
.check span { display: flex; flex-direction: column; gap: 3px; }
.check small { color: var(--ink-2); font-weight: 400; }
.num-input { text-align: right; font-variant-numeric: tabular-nums; min-width: 110px; }
.num-input.edited { border-color: var(--amber); }
.stack { display: flex; flex-direction: column; }
.filter { width: 220px; margin: 0; padding: 6px 10px; font-size: .85rem; }
.w-name { min-width: 170px; }
.w-s { min-width: 80px; max-width: 110px; }

/* ---------------------------------------------------------------- KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi span { color: var(--ink-2); font-size: .8rem; font-weight: 600; }
.kpi b { font: 700 1.45rem var(--serif); font-variant-numeric: tabular-nums; }
.kpi small { color: var(--ink-3); font-size: .8rem; }
.kpis-hero .kpi b { font-size: 2rem; }

/* ---------------------------------------------------------------- round & bidding */
.terms { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 14px 0 18px; }
.terms div { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.terms dt { font-size: .75rem; color: var(--ink-3); font-weight: 600; }
.terms dd { margin: 2px 0 0; font: 700 1.1rem var(--serif); }
.state { display: flex; gap: 10px; align-items: center; background: var(--surface-2); padding: 14px; border-radius: 8px; color: var(--ink-1); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.dot-idle { background: var(--ink-3); }
.dot-amber { background: var(--amber); box-shadow: 0 0 0 4px rgba(242,165,65,.18); }
.dot-teal { background: var(--teal); box-shadow: 0 0 0 3px rgba(63,182,168,.18); }
.live { display: inline-flex; align-items: center; gap: 8px; }
.countdown { display: flex; align-items: baseline; gap: 10px; background: rgba(242,165,65,.1); border: 1px solid rgba(242,165,65,.45); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
.countdown span { color: var(--ink-2); font-weight: 600; font-size: .85rem; }
.countdown b { font: 700 1.6rem var(--serif); font-variant-numeric: tabular-nums; color: var(--amber); }
.countdown small { color: var(--ink-3); }
.countdown.urgent b { color: var(--red); }
.countdown.done { border-color: var(--line); background: var(--surface-2); }
.countdown.done b { color: var(--ink-2); }
.countdown.big b { font-size: 2.4rem; }
.bid-form { display: flex; flex-direction: column; gap: 12px; }
.bid-form label.amount { margin: 0; }
.submitted { color: var(--teal); font-weight: 600; margin: 0; }

/* ---------------------------------------------------------------- slide viewer */
.viewer { outline: none; }
.viewer-stage { position: relative; background: #000; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; }
.viewer-stage:fullscreen { border-radius: 0; display: flex; align-items: center; }
.viewer-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.viewer-nav, .viewer-full { position: absolute; background: rgba(11,23,38,.7); color: var(--ink-1); border: 1px solid var(--line); border-radius: 50%; width: 38px; height: 38px; font-size: 1.4rem; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s; }
.viewer-stage:hover .viewer-nav, .viewer-stage:hover .viewer-full, .viewer:focus-within .viewer-nav { opacity: 1; }
.viewer-nav { top: 50%; transform: translateY(-50%); }
.viewer-nav.prev { left: 10px; }
.viewer-nav.next { right: 10px; }
.viewer-full { top: 10px; right: 10px; font-size: 1rem; }
.viewer-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; }
.thumb { position: relative; flex: none; width: 104px; padding: 0; border: 2px solid transparent; border-radius: 6px; background: none; cursor: pointer; overflow: hidden; }
.thumb img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; }
.thumb.on { border-color: var(--amber); }
.thumb-tag { position: absolute; left: 4px; bottom: 4px; font-size: .62rem; font-weight: 700; padding: 1px 5px; border-radius: 3px; background: rgba(11,23,38,.85); color: var(--ink-3); }
.thumb-tag.on { color: var(--teal); }

/* ---------------------------------------------------------------- tables */
.table-scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .9rem; }
.tbl th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th.r { text-align: right; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tfoot td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; }
.tbl-form td { padding: 6px 6px; }
.tbl-form input, .tbl-form select { margin: 0; }
.row-muted td { color: var(--ink-3); }
.row-focus td { background: rgba(242,165,65,.1); }
.row-exit td { background: var(--surface-2); }
.st { font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.st-ok { background: rgba(63,182,168,.16); color: var(--teal); }
.st-wait { background: rgba(242,165,65,.14); color: var(--amber); }
.st-idle { background: var(--surface-3); color: var(--ink-2); }
.monitor-head { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 12px; }
.monitor-head div { display: flex; flex-direction: column; }
.monitor-head b { font: 700 1.25rem var(--serif); }

/* ---------------------------------------------------------------- admin */
.tracker { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 0; margin: 0 0 20px; }
.tracker li { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; }
.tracker li b { font-size: .88rem; }
.tracker li span { font-size: .78rem; color: var(--ink-3); }
.tracker li.ph-published { border-color: rgba(63,182,168,.5); }
.tracker li.ph-published span { color: var(--teal); }
.tracker li.ph-briefing span, .tracker li.ph-bidding span, .tracker li.ph-closed span { color: var(--amber); }
.tracker li.current { border-color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber); }
.control .unpublish { margin-top: 18px; }
.log { max-height: 420px; overflow-y: auto; font-size: .85rem; }
.log-row { display: grid; grid-template-columns: 64px 80px auto 1fr; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--grid); }
.log-row span:last-child { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.danger { border-color: rgba(239,107,77,.35); }
.cred-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cred { border: 1px dashed var(--line); border-radius: 8px; padding: 14px; }
.cred div { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.cred div span { color: var(--ink-3); font-size: .8rem; }

/* ---------------------------------------------------------------- login */
.login { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; min-height: calc(100vh - 160px); }
.login h1 { font-size: 2.6rem; }
.login-copy p.muted { font-size: 1.05rem; max-width: 520px; }
.login-card { max-width: 400px; width: 100%; justify-self: end; }

/* ---------------------------------------------------------------- charts */
.chart-box { position: relative; width: 100%; }

/* ---------------------------------------------------------------- responsive & print */
@media (max-width: 900px) {
  .grid-2, .login { grid-template-columns: minmax(0, 1fr); }
  .login-card { justify-self: stretch; max-width: none; }
  .tracker { grid-template-columns: repeat(3, 1fr); }
  .topbar { flex-wrap: wrap; gap: 10px 16px; padding: 10px 16px; }
  .topbar nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .wrap { padding: 16px; }
  h1 { font-size: 1.6rem; }
}
@media print {
  body { background: #fff; color: #000; }
  .topbar, .no-print, .flash { display: none !important; }
  .card { border: 0; background: #fff; }
  .cred { border-color: #999; break-inside: avoid; color: #000; }
  .cred code { background: #eee; color: #000; }
}
