/* Portco Command Center. Design system ported from call-intelligence-platform
   (calls.avenuegp.com: frontend/src/index.css), which is the source of truth.

   Small on purpose: three type sizes, two weights (plus display's 300), one radius
   (buttons only), no shadows, no cards. Structure is hairlines and whitespace. Orange
   marks the live thing and nothing else: the active nav item and tab, the primary
   action, the latest ARR point. Negative red marks a regression or a gap.

   Type roles: serif = what a person or the agent wrote; sans = the interface;
   mono = what the system measured. */

:root {
  --bg: #FBF9F5;
  --bg-selected: #F6F1E7;
  --ink: #16130F;
  --ink-body: #4E483F;
  --ink-meta: #8A8278;
  --ink-faint: #A9A197;
  --rule: #E6E0D5;
  --rule-faint: #F1EBE1;
  --rule-input: #D8D0C3;
  --orange: #FF9300;
  --orange-hover: #D97600;
  --negative: #C62828;
  --font-display: "Newsreader", Georgia, serif;
  --font-ui: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --size-display: 40px;
  --size-body: 15px;
  --size-small: 12px;
  --radius: 6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font-ui);
  font-size: var(--size-body); line-height: 1.6; font-weight: 400; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding-left: 18px; }
a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--orange); }
a:hover { color: var(--orange-hover); }
input, select, button, textarea { font-family: inherit; font-size: var(--size-body); line-height: 1.6; color: inherit; }
input::placeholder { color: var(--ink-faint); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.4); }
:focus-visible { outline: 1px solid var(--orange); outline-offset: 3px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 6px; border: 3px solid var(--bg); }

/* ---- type recipes ---- */
.display { font-family: var(--font-display); font-weight: 300; font-size: var(--size-display); line-height: 1.1; letter-spacing: -0.02em; }
.label { font-family: var(--font-mono); font-size: var(--size-small); line-height: 1; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-meta); font-weight: 400; }
.label-inline { font-family: var(--font-mono); font-size: var(--size-small); line-height: 1; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-meta); }
.serif { font-family: var(--font-display); font-weight: 400; }
.measure { font-family: var(--font-mono); font-weight: 400; font-variant-numeric: tabular-nums; }
.small { font-size: var(--size-small); }
.medium { font-weight: 500; }
.ink { color: var(--ink); } .body { color: var(--ink-body); } .meta { color: var(--ink-meta); } .faint { color: var(--ink-faint); }
.neg { color: var(--negative); }

/* ---- buttons and fields ---- */
.btn-primary { background: var(--orange); color: #fff; border: 0; padding: 10px 20px; border-radius: var(--radius); cursor: pointer; white-space: nowrap; }
.btn-primary:disabled { background: none; border: 1px solid var(--rule-input); color: var(--ink-faint); cursor: default; }
.btn-outline { background: none; color: var(--ink); border: 1px solid var(--rule-input); padding: 10px 20px; border-radius: var(--radius); cursor: pointer; white-space: nowrap; }
.btn-text { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink-meta); font-size: var(--size-small); }
.btn-text:hover { color: var(--ink); }
.btn-underline { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); border-bottom: 1px solid var(--orange); white-space: nowrap; }
.field { background: none; border: 0; border-bottom: 1px solid var(--rule-input); outline: none; padding: 0 0 8px; width: 100%; min-width: 0; }
select.field { appearance: none; cursor: pointer; padding-right: 16px;
  background: linear-gradient(45deg, transparent 50%, var(--ink-meta) 50%) right 6px top 9px / 5px 5px no-repeat,
              linear-gradient(135deg, var(--ink-meta) 50%, transparent 50%) right 1px top 9px / 5px 5px no-repeat; }
input[type=checkbox] { width: 15px; height: 15px; margin: 4px 0 0; accent-color: var(--ink); cursor: pointer; }

/* ---- structure: there are no cards ---- */
.app-shell { min-width: 1180px; }
.column { max-width: 1180px; margin: 0 auto; padding: 0 32px; }
.page { padding-top: 64px; padding-bottom: 64px; }
.page-head { margin-bottom: 48px; display: flex; align-items: flex-end; justify-content: space-between; gap: 48px; }
.page-head h1 { margin-top: 24px; max-width: 24ch; }
.page-head .lede { margin-top: 12px; color: var(--ink-body); max-width: 62ch; }
.section { padding: 48px 0; border-top: 1px solid var(--rule); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-head h2 { font-family: var(--font-display); font-weight: 300; font-size: 28px; line-height: 1.15; letter-spacing: -0.01em; }
.group { border-top: 1px solid var(--rule); }
.group-row { padding: 20px 0; border-bottom: 1px solid var(--rule-faint); }
.group-row:last-child { border-bottom: 0; }
.rail { border-left: 1px solid var(--rule); padding-left: 32px; }
.quoted-flat { border-left: 1px solid var(--rule); padding-left: 16px; }
.quoted-neg { border-left: 1px solid var(--negative); padding-left: 16px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.cols-7-5 { display: grid; grid-template-columns: 7fr 5fr; gap: 48px; }
.stack-2 > * + * { margin-top: 8px; }
.stack-3 > * + * { margin-top: 12px; }
.row { display: flex; align-items: baseline; gap: 16px; }
.row.between { justify-content: space-between; }
.empty { color: var(--ink-body); }

/* ---- header: 56px bar over a 40px tab row ---- */
.app-header { border-bottom: 1px solid var(--rule); }
.app-header .bar { display: flex; height: 56px; align-items: center; gap: 48px; }
.app-header .brand { display: flex; align-items: center; gap: 16px; border: 0; flex-shrink: 0; }
.app-header .brand img { height: 20px; width: auto; }
.app-header nav { display: flex; gap: 32px; }
.app-header nav a { border: 0; color: var(--ink-meta); white-space: nowrap; }
.app-header nav a:hover { color: var(--ink); }
.app-header nav a.active { color: var(--ink); font-weight: 500; }
.app-header .right { margin-left: auto; display: flex; align-items: center; gap: 32px; }
.tabs { border-top: 1px solid var(--rule-faint); }
.tabs .column { display: flex; height: 40px; align-items: stretch; gap: 32px; }
.tabs a { display: flex; align-items: center; border-bottom: 1px solid transparent; color: var(--ink-meta); }
.tabs a:hover { color: var(--ink); }
.tabs a.active { border-bottom-color: var(--orange); color: var(--ink); }

/* ---- facts beside the headline ---- */
.facts { display: flex; gap: 40px; flex-shrink: 0; }
.fact .v { font-family: var(--font-mono); font-size: 22px; line-height: 1.2; margin-top: 12px; display: block; }
.fresh { display: flex; flex-wrap: wrap; gap: 8px 32px; margin-top: 24px; }
.fresh .stale { color: var(--negative); }

/* ---- metric grid: label above value, hairlines between ---- */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--rule); }
.metric { padding: 20px 24px 20px 0; border-bottom: 1px solid var(--rule-faint); }
.metric .v { font-family: var(--font-mono); font-size: 22px; line-height: 1.2; margin: 12px 0 4px; display: block; }

/* ---- key/value list ---- */
dl.kv { display: grid; grid-template-columns: auto 1fr; border-top: 1px solid var(--rule); }
dl.kv dt, dl.kv dd { padding: 10px 0; border-bottom: 1px solid var(--rule-faint); }
dl.kv dt { color: var(--ink-body); padding-right: 24px; }
dl.kv dd { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
dl.kv dd.text { font-family: var(--font-ui); }

/* ---- tables ---- */
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; padding: 0 16px 12px 0; border-bottom: 1px solid var(--rule); font-weight: 400; }
table.t td { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--rule-faint); vertical-align: baseline; }
table.t tr:last-child td { border-bottom: 0; }
table.t .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
table.t th.num { text-align: right; }
table.t .mono { font-family: var(--font-mono); font-size: var(--size-small); word-break: break-all; }
table.t tr.clickable { cursor: pointer; }
table.t tr.clickable:hover td { background: var(--bg-selected); }

/* ---- meter: a 2px hairline that is partly darker ---- */
.meter { position: relative; height: 2px; background: var(--rule); min-width: 96px; }
.meter .fill { position: absolute; left: 0; top: 0; height: 2px; background: var(--ink); }
.meter .fill.neg { background: var(--negative); }
.meter .tick { position: absolute; top: -4px; width: 1px; height: 10px; background: var(--ink-meta); }

/* ---- chart ---- */
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 24px; margin-top: 16px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 20px; height: 0; border-top: 1.5px solid var(--ink); display: inline-block; }
.sw.uwp { border-top: 1.5px dashed var(--ink-meta); }
.sw.bud { border-top: 1.5px dotted var(--ink-faint); }

/* ---- action items ---- */
.filters { display: flex; gap: 32px; align-items: baseline; }
.filters .opt { background: none; border: 0; padding: 0; cursor: pointer; border-bottom: 1px solid transparent; }
.filters .opt[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--orange); }
.arow { display: grid; grid-template-columns: 24px 1fr 160px; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--rule-faint); align-items: start; }
.arow:last-child { border-bottom: 0; }
.arow.done .t { text-decoration: line-through; color: var(--ink-faint); }
.arow .due { text-align: right; }
form.add { display: grid; grid-template-columns: 3fr 1fr 1fr 1fr 1fr auto; gap: 24px; align-items: end; padding-top: 32px; }
form.add label { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* ---- VCP ---- */
.vrow { display: grid; grid-template-columns: 1fr 140px; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--rule-faint); align-items: start; }
.vrow:last-child { border-bottom: 0; }

/* ---- feed ---- */
.feed-row { display: grid; grid-template-columns: 120px 96px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--rule-faint); align-items: baseline; }
.feed-row:last-child { border-bottom: 0; }

details.more > summary { cursor: pointer; list-style: none; padding: 16px 0 0; }
details.more > summary::-webkit-details-marker { display: none; }
footer.foot { padding-top: 32px; border-top: 1px solid var(--rule); }

/* =====================================================================
   v3: cleaner company page. Tabs instead of one long scroll, a written
   position statement as the hero, fewer labels (sentence case, sans).
   ===================================================================== */
.cap { font-size: 13px; color: var(--ink-meta); }               /* quiet sentence-case label */
.hero { padding: 56px 0 40px; }
.hero .top { display: flex; align-items: baseline; justify-content: space-between; gap: 32px; }
.hero h1 { font-family: var(--font-display); font-weight: 400; font-size: 22px; letter-spacing: -0.01em; }
.hero .statement { font-family: var(--font-display); font-weight: 300; font-size: 36px; line-height: 1.22;
  letter-spacing: -0.015em; max-width: 30ch; margin-top: 20px; text-wrap: pretty; }
.hero .statement .n { font-variant-numeric: lining-nums tabular-nums; }
.hero .statement .down { color: var(--negative); }
.hero .meta-line { margin-top: 24px; display: flex; gap: 24px; flex-wrap: wrap; }
.hero .meta-line .stale { color: var(--negative); }

.vtabs { border-bottom: 1px solid var(--rule); display: flex; gap: 32px; }
.vtabs button { background: none; border: 0; padding: 0 0 14px; margin-bottom: -1px; cursor: pointer;
  color: var(--ink-meta); border-bottom: 1px solid transparent; font-size: 15px; }
.vtabs button:hover { color: var(--ink); }
.vtabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--orange); }
.vtabs .count { font-family: var(--font-mono); font-size: 12px; margin-left: 6px; color: var(--ink-faint); }
.vtabs .count.neg { color: var(--negative); }

.view { padding: 48px 0 80px; }
.view[hidden] { display: none; }
.split { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 64px; }
.split.even { grid-template-columns: 1fr 1fr; }
.h2 { font-family: var(--font-display); font-weight: 400; font-size: 22px; letter-spacing: -0.01em; margin-bottom: 20px; }
.h2 .cap { font-family: var(--font-ui); margin-left: 12px; letter-spacing: 0; }
.block + .block { margin-top: 56px; }

.news { border-top: 1px solid var(--rule); }
.news .item { display: grid; grid-template-columns: 72px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--rule-faint); }
.news .when { font-family: var(--font-mono); font-size: 12px; color: var(--ink-meta); padding-top: 4px; }
.news .what { font-family: var(--font-display); font-size: 18px; line-height: 1.45; }
.news .src { margin-top: 6px; }
.news .src a { border-bottom-color: var(--rule-input); color: var(--ink-meta); font-size: 13px; }
.news .src a:hover { border-bottom-color: var(--orange); }

.upcoming .item { padding: 14px 0; border-bottom: 1px solid var(--rule-faint); }
.upcoming .item:first-child { padding-top: 0; }
.upcoming .when { font-family: var(--font-mono); font-size: 12px; color: var(--ink-meta); }
.upcoming .title { margin-top: 4px; }
.alert { margin-top: 16px; padding-left: 14px; border-left: 1px solid var(--negative); color: var(--ink-body); font-size: 14px; }
.alert b { color: var(--negative); font-weight: 500; display: block; font-size: 13px; }

.owe { margin-top: 40px; }
.owe .head { display: flex; justify-content: space-between; align-items: baseline; }
.owe .big { font-family: var(--font-mono); font-size: 28px; line-height: 1; }
.mini { display: grid; grid-template-columns: 18px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule-faint); font-size: 14px; }
.mini:last-child { border-bottom: 0; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--rule); }
.kpi .v { font-family: var(--font-mono); font-size: 28px; line-height: 1.1; display: block; margin-top: 8px; }
.kpi .s { font-size: 13px; color: var(--ink-meta); margin-top: 6px; display: block; }

.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.clamp.open { -webkit-line-clamp: unset; display: block; }

.tp2 { padding: 22px 0; border-bottom: 1px solid var(--rule-faint); }
.tp2:first-child { padding-top: 0; }
.tp2 .when { font-family: var(--font-mono); font-size: 12px; color: var(--ink-meta); }
.tp2 .title { font-weight: 500; margin-top: 4px; }
.tp2 ul { margin-top: 10px; font-family: var(--font-display); color: var(--ink-body); padding-left: 18px; }
.tp2 ul li + li { margin-top: 6px; }
.tp2 .who { font-size: 13px; color: var(--ink-meta); margin-top: 10px; }

.fund { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; }
.fund + .fund { margin-top: 56px; padding-top: 56px; border-top: 1px solid var(--rule); }
.fund .name { display: flex; justify-content: space-between; align-items: baseline; }
.note { font-family: var(--font-display); color: var(--ink-body); line-height: 1.55; margin-top: 24px; max-width: 60ch; }

.seg2 { display: flex; gap: 24px; align-items: baseline; }
.seg2 button { background: none; border: 0; padding: 0 0 4px; cursor: pointer; color: var(--ink-meta); border-bottom: 1px solid transparent; font-size: 14px; }
.seg2 button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--orange); }
.toolbar2 { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }

.vcp2 { display: grid; grid-template-columns: 10px 1fr 130px; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--rule-faint); align-items: start; }
.vcp2:last-child { border-bottom: 0; }
.dot2 { width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; background: var(--ink-faint); }
.dot2.green { background: var(--ink); } .dot2.amber { background: var(--orange); } .dot2.red { background: var(--negative); }

@media (max-width: 900px) {
  .app-shell { min-width: 0; }
  .split, .split.even, .fund, .cols-2, .cols-7-5 { grid-template-columns: 1fr; gap: 40px; }
  .kpis, .metrics { grid-template-columns: repeat(2, 1fr); }
  .hero .statement { font-size: 28px; }
  .app-header .right { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.news .src { color: var(--ink-meta); font-size: 13px; }
.upcoming a, .tp2 .title a, .news .what a { border-bottom-color: var(--rule-input); }
.upcoming a:hover, .tp2 .title a:hover, .news .what a:hover { border-bottom-color: var(--orange); }
.hero .context { display: flex; gap: 20px; }
[hidden] { display: none !important; }
.split, .fund { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; }
.vcp2 a, .arow a, .tp2 .who a { border-bottom-color: var(--rule-input); color: var(--ink-meta); }
.vcp2 a:hover, .arow a:hover, .tp2 .who a:hover { border-bottom-color: var(--orange); }
details.more > summary { display: inline-block; margin-top: 16px; padding: 0; }
