/* Verejka UI components, v1. Depends on tokens.css. Plain CSS, class names are the contract Sova reuses in pages.rs. */

/* ================= base ================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--w-regular) var(--t-14)/var(--lh-14) var(--font-sans);
  font-feature-settings: "cv11", "ss03"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }
h1, h2, h3, h4 { margin: 0; font-weight: var(--w-semibold); letter-spacing: -.011em; }
p { margin: 0; }
.num, .tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum", "cv11"; }
.display { font-family: var(--font-display); font-weight: 560; letter-spacing: -.018em; font-optical-sizing: auto; }
.overline { font-size: var(--t-11); line-height: var(--lh-11); font-weight: var(--w-semibold); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); } .ink2 { color: var(--ink-2); }
.small { font-size: var(--t-12); line-height: var(--lh-12); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i-lg { width: 20px; height: 20px; } .i-sm { width: 14px; height: 14px; vertical-align: -2px; }
kbd, .kbd { font: var(--w-medium) 11px/1 var(--font-sans); padding: 3px 5px; border-radius: var(--r-xs); border: 1px solid var(--line-strong); border-bottom-width: 2px; color: var(--muted); background: var(--surface); }
hr.rule { border: 0; border-top: 1px solid var(--line); margin: var(--s-6) 0; }

/* ================= buttons ================= */
.btn { --h: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: var(--w-medium) var(--t-14)/1 var(--font-sans); white-space: nowrap; cursor: pointer; text-decoration: none !important;
  transition: background var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease), transform var(--d-fast) var(--ease);
  box-shadow: var(--sh-1); }
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), var(--sh-1); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; } .btn-danger:hover { filter: brightness(.94); }
.btn-dark { background: var(--invert); border-color: var(--invert); color: var(--on-invert); }
.btn-dark:hover { background: #24322c; border-color: #24322c; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--ink); }
.btn-on { background: var(--brand-soft); border-color: var(--brand-soft-2); color: var(--brand-ink); }
.btn-sm { --h: 30px; padding: 0 10px; font-size: var(--t-13); gap: 6px; }
.btn-lg { --h: 44px; padding: 0 20px; font-size: 15px; border-radius: 8px; }
.btn-xl { --h: 52px; padding: 0 26px; font-size: 16px; border-radius: 10px; }
.btn-icon { width: var(--h); padding: 0; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (pointer: coarse) { .btn { --h: 44px; } .btn-sm { --h: 40px; } }

/* ================= inputs ================= */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: var(--t-13); font-weight: var(--w-medium); color: var(--ink-2); }
.input, .select { height: 36px; width: 100%; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font: var(--t-14)/1 var(--font-sans); box-shadow: inset 0 1px 1px rgba(14,26,21,.03); transition: border-color var(--d-fast), box-shadow var(--d-fast); }
.input::placeholder { color: var(--faint); }
.input:hover, .select:hover { border-color: var(--faint); }
.input:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c6863' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input-icon { position: relative; } .input-icon > .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon > .input { padding-left: 34px; }
.input-icon > kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
@media (pointer: coarse) { .input, .select { height: 44px; font-size: 16px; } }

/* ================= chips, badges, filters ================= */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-pill); background: var(--surface-2);
  color: var(--ink-2); font: var(--w-medium) 12px/1 var(--font-sans); white-space: nowrap; border: 1px solid transparent; }
.chip-brand { background: var(--brand-soft); color: var(--brand-ink); }
.chip-signal { background: var(--signal-bg); color: var(--signal); border-color: var(--signal-line); }
.chip-danger { background: var(--danger-bg); color: var(--danger); }
.chip-info { background: var(--info-bg); color: var(--info); }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-outline { background: transparent; border-color: var(--line-strong); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--brand); color: #fff; font: 600 11px/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.src { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: var(--r-xs); font: 600 10.5px/1 var(--font-sans); letter-spacing: .04em; text-transform: uppercase; border: 1px solid var(--line-strong); color: var(--ink-2); background: var(--surface); }

/* filter bar: one row of pill dropdowns on desktop; on phones it scrolls sideways and the full set opens in a sheet */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fpill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line-strong);
  background: var(--surface); font: var(--w-medium) 13px/1 var(--font-sans); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.fpill b { color: var(--ink); font-weight: var(--w-semibold); }
.fpill.on { border-color: color-mix(in srgb, var(--brand) 45%, var(--line-strong)); background: var(--brand-soft); color: var(--brand-ink); }
.fpill.on b { color: var(--brand-ink); }
.fpill .i { width: 14px; height: 14px; color: var(--muted); }
.fpill.add { border-style: dashed; color: var(--muted); }
@media (pointer: coarse) { .fpill { height: 40px; } }
.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--surface-3); gap: 2px; }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; font: var(--w-medium) 13px/1 var(--font-sans); color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1), 0 0 0 1px var(--line); }

/* ================= cards, sections ================= */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-1); }
.card-pad { padding: var(--s-5); }
.card-h { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-h h2, .card-h h3 { font-size: 15px; line-height: 22px; font-weight: var(--w-semibold); }
.card-h .sub { color: var(--muted); font-size: 13px; }
.card-h .end { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-f { padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; gap: 12px; align-items: center; }
.section-h { display: flex; align-items: baseline; gap: 12px; margin: var(--s-10) 0 var(--s-3); }
.section-h h2 { font-size: 18px; line-height: 26px; }
.section-h .end { margin-left: auto; }
.note { font-size: 12px; line-height: 17px; color: var(--muted); }

/* ================= KPI cards ================= */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh-1); }
.kpi { background: var(--surface); padding: 16px 18px 15px; display: grid; gap: 4px; align-content: start; min-height: 112px; }
.kpi .k { font-size: 12.5px; line-height: 16px; color: var(--muted); font-weight: var(--w-medium); display: flex; gap: 6px; align-items: center; }
.kpi .v { font-size: 26px; line-height: 32px; font-weight: 620; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 15px; font-weight: 560; color: var(--ink-2); letter-spacing: 0; }
.kpi .f { font-size: 12px; line-height: 16px; color: var(--muted); }
.kpi .delta { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi .delta.up { color: var(--ok); } .kpi .delta.down { color: var(--danger); }
.kpi.is-signal .v { color: var(--signal); }
.kpi.is-warn .v { color: var(--danger); }
.kpi .spark { height: 28px; margin-top: 4px; }

/* ================= data tables ================= */
.tbl-wrap { position: relative; overflow: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.tbl-wrap.has-more::after { content: ""; position: sticky; right: 0; top: 0; float: right; width: 28px; height: 100%; margin-top: -100%; pointer-events: none; background: linear-gradient(to right, transparent, var(--surface)); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--t-13); line-height: var(--lh-13); }
.tbl th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--muted); font-weight: var(--w-medium); font-size: 12px; text-align: left;
  padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { padding-left: 18px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 18px; }
.tbl th.sort { cursor: pointer; } .tbl th.sort::after { content: "↕"; margin-left: 4px; color: var(--faint); }
.tbl th[aria-sort="descending"] { color: var(--ink); } .tbl th[aria-sort="descending"]::after { content: "↓"; color: var(--brand); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink); }
.tbl tbody tr { transition: background var(--d-fast); }
.tbl tbody tr:hover td { background: var(--row-hover); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num, .tbl th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl td.num { font-weight: var(--w-medium); }
.tbl .date { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.tbl .sticky-col { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.tbl th.sticky-col { z-index: 3; background: var(--surface-2); }
.tbl .t-main { font-weight: var(--w-medium); color: var(--ink); display: block; }
.tbl a.t-main { color: var(--ink); } .tbl a.t-main:hover { color: var(--brand); }
.tbl .t-sub { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.tbl .t-note { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; font-size: 12px; line-height: 16px; color: var(--ink-2); }
.tbl .t-note .i { width: 13px; height: 13px; margin-top: 2px; }
.tbl .t-note.signal { color: var(--signal); } .tbl .t-note.info { color: var(--info); } .tbl .t-note.muted { color: var(--muted); }
.tbl .bar { height: 4px; border-radius: 2px; background: var(--brand-soft-2); margin-top: 6px; overflow: hidden; }
.tbl .bar > i { display: block; height: 100%; background: var(--viz-1); border-radius: 2px; }
.tbl-more { display: flex; justify-content: center; padding: 10px; border-top: 1px solid var(--line); }
.tbl-more .btn { box-shadow: none; }
table tr[hidden] { display: none !important; }
/* phone pattern: each row becomes a two-column list item, amount stays on the first line, the rest folds into meta lines */
@media (max-width: 640px) {
  table.tbl.stack thead { display: none; }
  table.tbl.stack, .tbl.stack tbody { display: block; }
  .tbl.stack tr[hidden] { display: none !important; }
  .tbl.stack tr { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; row-gap: 3px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
  .tbl.stack tr:last-child { border-bottom: 0; }
  .tbl.stack td { display: block; padding: 0; border: 0; background: transparent !important; }
  .tbl.stack td:first-child, .tbl.stack td:last-child { padding: 0; }
  .tbl.stack td.c-main { order: 0; flex: 1 1 calc(100% - 124px); min-width: 0; }
  .tbl.stack td.c-amt { order: 1; flex: 0 0 auto; margin-left: auto; text-align: right; font-size: 14px; }
  .tbl.stack td.c-meta { order: 2; flex: 0 1 auto; text-align: left; font-size: 12px; line-height: 17px; color: var(--muted); font-weight: 400; }
  .tbl.stack tr::after { content: ""; order: 1; flex-basis: 100%; height: 0; }
  .tbl.stack td.c-meta:not(.c-full) ~ td.c-meta:not(.c-full)::before { content: "·"; margin-right: 8px; color: var(--faint); }
  .tbl.stack td.c-meta[data-l]::after { content: " " attr(data-l); }
  /* a multi-line meta block after the date (supplier + subject) gets its own line in every row, without a dangling "·" */
  .tbl.stack td.c-meta.date ~ td.c-meta:has(.t-sub) { flex: 1 1 100%; }
  .tbl.stack td.c-meta.date ~ td.c-meta:has(.t-sub)::before { content: none; }
  .tbl.stack td.c-full { order: 3; flex: 1 1 100%; }
  .tbl.stack td.c-hide-m { display: none; }
}

/* ================= tabs ================= */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px; color: var(--muted); font-weight: var(--w-medium); white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"], .tabs a.on { color: var(--ink); }
.tabs a[aria-current="page"]::after, .tabs a.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
.tabs .count { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }

/* ================= callouts, toasts, states ================= */
.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; line-height: 19px; color: var(--ink-2); }
.callout > .i { margin-top: 1px; }
.callout.signal { background: var(--signal-bg); border-color: var(--signal-line); color: #6b3a07; }
.callout.info { background: var(--info-bg); border-color: #cbd9f6; color: #1c3f8a; }
.callout.danger { background: var(--danger-bg); border-color: #f6c9c4; color: #7d1a12; }
.callout b { color: inherit; }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-radius: var(--r-md); background: var(--invert); color: var(--on-invert); box-shadow: var(--sh-3); font-size: 13.5px; }
.toast .i { color: #6fd3b2; } .toast a { color: #8fe0c5; font-weight: 600; margin-left: 6px; }
.skel { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 40%, var(--surface-2) 80%); background-size: 200% 100%; animation: skel 1.4s linear infinite; border-radius: 4px; }
@keyframes skel { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.empty { display: grid; justify-items: center; gap: 10px; padding: 40px 24px; text-align: center; color: var(--muted); }
.empty .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.empty h3 { color: var(--ink); font-size: 15px; }
.empty p { max-width: 380px; font-size: 13px; line-height: 19px; }
.err-card { max-width: 560px; margin: 24px auto; }
.err-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.err-card .empty { grid-template-columns: minmax(0, 1fr); }
.err-search { display: flex; gap: 8px; width: 100%; max-width: 380px; margin-top: 6px; }
.err-search .input { flex: 1 1 auto; min-width: 0; }

/* ================= menus / avatar ================= */
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #0b6e57, #2a9d7c); color: #fff; font: 600 12.5px/1 var(--font-sans); letter-spacing: .02em; flex: none; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.menu { min-width: 264px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-3); }
.menu .m-head { display: flex; gap: 10px; align-items: center; padding: 10px 10px 12px; }
.menu .m-head .who b { display: block; font-size: 13.5px; } .menu .m-head .who span { font-size: 12px; color: var(--muted); }
.menu .m-sep { height: 1px; background: var(--line); margin: 6px -6px; }
.menu .m-label { padding: 8px 10px 4px; }
.menu a, .menu button.m-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: var(--t-13)/1 var(--font-sans); text-decoration: none; cursor: pointer; }
.menu a .i, .menu button.m-item .i { color: var(--muted); }
.menu a:hover, .menu a.hl { background: var(--surface-2); text-decoration: none; }
.menu a .end { margin-left: auto; color: var(--muted); font-size: 12px; }
.menu .plan { margin: 4px 4px 6px; padding: 10px 12px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-ink); font-size: 12.5px; line-height: 17px; display: flex; gap: 10px; align-items: center; }
.menu .plan b { font-weight: 650; }
@media (pointer: coarse) { .menu a, .menu button.m-item { height: 44px; font-size: 15px; } }

/* ================= brand mark ================= */
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none !important; }
.logo .mark { width: 26px; height: 26px; border-radius: 7px; background: var(--brand); display: grid; place-items: center; box-shadow: inset 0 -1px 0 rgba(0,0,0,.18); }
.logo .mark svg { width: 18px; height: 18px; }
.logo .word { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.logo.on-night { color: var(--night-ink); }

/* ================= app shell ================= */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; border-right: 1px solid var(--line); background: var(--sidebar); overflow-y: auto; }
.sidebar .sb-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 12px; }
.sb-search { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--faint); font-size: 13px; margin-bottom: 6px; box-shadow: var(--sh-1); }
.sb-search kbd { margin-left: auto; }
.sb-ask { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 8px; background: var(--invert); color: var(--on-invert); font-weight: var(--w-medium); font-size: 13.5px; margin-bottom: 10px; text-decoration: none !important; }
.sb-ask .i { color: var(--invert-accent); } .sb-ask kbd { margin-left: auto; background: transparent; border-color: #3b4a43; color: #a7b5ae; }
.nav-group { display: grid; gap: 1px; margin-bottom: 12px; }
.nav-group .overline { padding: 8px 10px 4px; font-size: 10.5px; }
.nav-item { min-width: 0; display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: 7px; color: var(--ink-2); font-size: 13.5px; font-weight: var(--w-medium); text-decoration: none !important; }
.nav-item .i { color: var(--muted); }
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1), 0 0 0 1px var(--line); }
.nav-item[aria-current="page"] .i { color: var(--brand); }
.nav-item .badge, .nav-item .end { margin-left: auto; }
.nav-item .end { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.sb-recent .nav-item { font-weight: 400; font-size: 13px; color: var(--ink-2); }
.sb-recent .nav-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-foot { margin-top: auto; display: grid; gap: 8px; padding-top: 8px; }
.sb-fresh { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 11.5px; line-height: 15px; color: var(--muted); }
.sb-fresh .pulse { width: 7px; height: 7px; border-radius: 50%; background: #1fae7f; box-shadow: 0 0 0 3px #1fae7f22; flex: none; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.sb-user:hover, .sb-user.open { background: var(--surface-3); }
.sb-user .who { min-width: 0; } .sb-user .who b { display: block; font-size: 13px; font-weight: 600; } .sb-user .who span { display: block; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user .i { margin-left: auto; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.crumbs a { color: var(--muted); } .crumbs b { color: var(--ink); font-weight: var(--w-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs .i { width: 14px; height: 14px; color: var(--faint); }
.topbar .end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.content { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 28px 28px 80px; }
.page-h { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-h h1 { font-family: var(--font-display); font-weight: 560; font-size: var(--t-32); line-height: var(--lh-32); letter-spacing: -.02em; }
.page-h .lead { color: var(--muted); font-size: 14px; line-height: 21px; margin-top: 6px; max-width: 680px; }
.page-h .end { margin-left: auto; display: flex; gap: 8px; }

/* phone chrome: top bar + bottom tab bar replace the sidebar */
.m-top, .tabbar { display: none; }
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .m-top { display: flex; position: sticky; top: 0; z-index: 30; height: 56px; align-items: center; gap: 4px; padding: 0 8px 0 14px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .m-top .logo { margin-right: auto; } .m-top .logo .word { font-size: 20px; }
  .m-top .tap { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; color: var(--ink-2); border: 0; background: none; }
  .m-top .tap .i { width: 20px; height: 20px; }
  .topbar { display: none; }
  .content { padding: 18px 16px calc(var(--tabbar-h) + 32px); }
  .page-h h1 { font-size: 27px; line-height: 32px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-top: 1px solid var(--line); }
  .tabbar a { position: relative; display: grid; justify-items: center; align-content: center; gap: 4px; color: var(--muted); font-size: 10.5px; font-weight: 600; text-decoration: none; min-height: 44px; }
  .tabbar a .i { width: 22px; height: 22px; stroke-width: 1.7; }
  .tabbar a[aria-current="page"] { color: var(--brand); }
  .tabbar a .badge { position: absolute; top: 7px; left: calc(50% + 6px); height: 16px; min-width: 16px; font-size: 10px; box-shadow: 0 0 0 2px var(--surface); }
  .tabbar a.ask .bubble { width: 40px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--invert); color: var(--invert-accent); margin-top: -2px; }
  .tabbar a.ask .bubble .i { width: 18px; height: 18px; }
  .tabbar a.ask[aria-current="page"] .bubble { background: var(--brand); color: #fff; }
}

/* ================= marketing shell ================= */
.site { background: #fbfbfa; }
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, #fbfbfa 82%, transparent); backdrop-filter: saturate(1.5) blur(12px); -webkit-backdrop-filter: saturate(1.5) blur(12px); border-bottom: 1px solid transparent; }
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .in { max-width: 1200px; margin: 0 auto; height: 64px; display: flex; align-items: center; gap: 28px; padding: 0 28px; }
.site-header nav { display: flex; gap: 4px; }
.site-header nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-size: 14px; font-weight: var(--w-medium); text-decoration: none; }
.site-header nav a:hover { background: var(--surface-3); color: var(--ink); }
.site-header nav a[aria-current="page"] { color: var(--ink); }
.site-header .end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.site-header .burger { display: none; }
.site-header nav .m-only { display: none; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px 0 6px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); box-shadow: var(--sh-1); }
.eyebrow .chip { height: 18px; font-size: 11px; }
.h-display { font-family: var(--font-display); font-weight: 520; letter-spacing: -.028em; font-size: var(--t-64); line-height: var(--lh-64); }
.h-section { font-family: var(--font-display); font-weight: 520; letter-spacing: -.022em; font-size: var(--t-44); line-height: var(--lh-44); }
.lead-xl { font-size: 19px; line-height: 29px; color: var(--ink-2); }
.site-footer { background: var(--night); color: var(--night-muted); padding: 64px 0 32px; font-size: 13.5px; }
.site-footer a { color: var(--night-ink); opacity: .82; } .site-footer a:hover { opacity: 1; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.site-footer h4 { color: var(--night-ink); font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer .legal { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--night-line); display: flex; gap: 20px; flex-wrap: wrap; font-size: 12.5px; }
.site-footer .legal .end { margin-left: auto; display: flex; gap: 18px; }
@media (max-width: 860px) {
  .site-header nav, .site-header .end .hide-m { display: none; }
  .site-header .burger { display: grid; }
  .site-header.open { background: #fbfbfa; border-bottom-color: var(--line); }
  .site-header.open nav { display: flex; flex-direction: column; gap: 2px; position: absolute; top: 60px; left: 0; right: 0; padding: 8px 10px 14px; background: #fbfbfa; border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px -12px rgba(15, 23, 20, .18); }
  .site-header.open nav a { padding: 12px 10px; font-size: 16px; }
  .site-header.open nav .m-only { display: block; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 14px; }
  .site-header .in { padding: 0 8px 0 18px; gap: 8px; height: 60px; }
  .wrap { padding: 0 18px; }
  .h-display { font-size: 40px; line-height: 44px; letter-spacing: -.026em; }
  .h-section { font-size: 31px; line-height: 36px; }
  .lead-xl { font-size: 17px; line-height: 26px; }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
  .site-footer .cols > :first-child { grid-column: 1 / -1; }
  .site-footer .legal .end { margin-left: 0; }
}

/* ================= deal-window track (signature element) =================
   A 12-month line from today. The amber band is the window when a supplier should act (2 to 9 months before the end).
   The pin is the contract end. Pins left of the band = too late to prepare, right of it = early warning. */
.track { position: relative; height: 6px; border-radius: 3px; background: var(--surface-3); margin-top: 8px; min-width: 120px; }
.track .win { position: absolute; top: -1px; bottom: -1px; left: 16.6%; width: 58.4%; background: var(--signal-bg); border: 1px solid var(--signal-line); border-radius: 4px; }
.track .pin { position: absolute; top: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 2px var(--surface); transform: translateX(-50%); }
.track .pin.late { background: var(--faint); }
.track .tender { position: absolute; top: -4px; width: 2px; height: 14px; border-radius: 1px; background: var(--info); transform: translateX(-50%); }
.track-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.track-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ================= entity header (company / buyer) ================= */
.entity { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: start; }
.entity .ava { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--brand); box-shadow: var(--sh-1); font: 650 18px/1 var(--font-sans); letter-spacing: -.02em; }
.entity .ava .i { width: 26px; height: 26px; stroke-width: 1.5; }
.entity h1 { font-family: var(--font-display); font-weight: 560; font-size: 34px; line-height: 40px; letter-spacing: -.022em; }
.entity .facts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; color: var(--muted); font-size: 13px; }
.entity .facts span { display: inline-flex; align-items: center; gap: 6px; }
.entity .facts .i { width: 14px; height: 14px; color: var(--faint); }
.entity .facts b { color: var(--ink-2); font-weight: var(--w-medium); }
.entity .acts { display: flex; gap: 8px; }
.jumpbar { position: sticky; top: var(--topbar-h); z-index: 10; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); margin: 22px -28px 0; padding: 0 28px; }
@media (max-width: 960px) {
  .entity { grid-template-columns: auto 1fr; gap: 12px; }
  .entity .ava { width: 44px; height: 44px; border-radius: 11px; }
  .entity .ava .i { width: 22px; height: 22px; }
  .entity h1 { font-size: 26px; line-height: 31px; }
  .entity .acts { grid-column: 1 / -1; }
  .entity .acts .btn { flex: 1; }
  .jumpbar { top: 56px; margin: 16px -16px 0; padding: 0 8px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { min-height: 0; padding: 13px 14px; }
  .kpi .v { font-size: 21px; line-height: 27px; }
}

/* ================= sidebar extras, top-bar user button ================= */
.sb-usage { padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 11.5px; color: var(--muted); }
.sb-usage .row { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; } .sb-usage b { color: var(--ink-2); font-weight: 600; }
.meter { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; } .meter > i { display: block; height: 100%; background: var(--brand); border-radius: 2px; }
.user-btn { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 6px 0 2px; border-radius: var(--r-pill); border: 1px solid transparent; background: none; cursor: pointer; color: var(--muted); }
.user-btn:hover, .user-btn.open { background: var(--surface); border-color: var(--line); box-shadow: var(--sh-1); }
.topbar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }

/* ================= small shared fixes ================= */
.bar > i { display: block; height: 100%; border-radius: 3px; }
.seg button { white-space: nowrap; }
.card-h { flex-wrap: wrap; row-gap: 8px; }
.section-h { flex-wrap: wrap; row-gap: 6px; }
@media (max-width: 960px) {
  .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .section-h { margin-top: 32px; }
  .section-h h2 { flex: 1 1 100%; }
  .section-h .end { margin-left: 0; }
  .track-legend { display: none; }
}

@media (max-width: 640px) {
  .card-h > h2, .card-h > h3 { flex: 1 1 0; min-width: 0; }
  .card-h > .sub { display: none; }
}
