/* Procurement RFQ — Signisys theme.
 *
 * Palette from signisys.com's own CSS variables: orange #FE6000 (--or), text
 * orange #CF5000 (--or-txt), deep orange #B84200 (--or-d), amber #FEA300,
 * navy #141425 (--nv) / #1E1E36 (--nv2), slate #636380 (--sl), silver
 * #DDDDE8 (--sv). Inter, as on their site.
 *
 * Contrast: white on #FE6000 is 3.05:1 (fails WCAG AA for text), so the bright
 * orange is used for accents only; buttons and links use #D65400→#B84200
 * (4.2–5.5:1, bold text) and #B84200 (5.5:1).
 */

:root {
  --brand: #FE6000; --brand-2: #FEA300; --brand-ink: #B84200;
  --brand-grad: linear-gradient(135deg, #D65400 0%, #B84200 100%);
  --brand-glow: linear-gradient(90deg, #FE8800, #FE6000 55%, #FE072A);
  --brand-soft: #FFF3EA; --brand-soft-2: #FFE4CC;
  --navy: #141425; --navy-2: #1E1E36;

  --bg: #F7F7FA; --surface: #FFFFFF; --surface-2: #F4F4F8; --surface-warm: #FFF9F4;
  --border: #E4E4EC; --border-strong: #DDDDE8;
  --text: #141425; --text-2: #3A3A55; --muted: #636380;

  --ok: #16794A; --ok-soft: #E6F6EE; --warn: #9A5B00; --warn-soft: #FFF4DE;
  --bad: #B91C1C; --bad-soft: #FDECEC; --info: #2B4FB8; --info-soft: #ECF1FD;
  --best: #E6F6EE; --best-ink: #0F5E38;

  --radius: 10px; --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 37, .04), 0 4px 16px rgba(20, 20, 37, .05);
  --shadow-lg: 0 20px 50px rgba(20, 20, 37, .18);
  --ring: 0 0 0 3px rgba(254, 96, 0, .28);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --sidebar-w: 248px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E0E18; --surface: #161624; --surface-2: #1C1C2E; --surface-warm: #211B1C;
    --border: #2A2A40; --border-strong: #34344E;
    --text: #EDEDF3; --text-2: #C9C9DA; --muted: #9A9AB5;
    --brand-ink: #FF8A3D; --brand-soft: #2A1C14; --brand-soft-2: #3A2416;
    --ok: #5CCB8F; --ok-soft: #12291D; --warn: #F0B659; --warn-soft: #2C2312; --bad: #FF8A80; --bad-soft: #321A1A;
    --info: #8FA8FF; --info-soft: #1A2138; --best: #13301F; --best-ink: #7FE0A6;
    --shadow: 0 0 0 1px rgba(255,255,255,.02); --shadow-lg: 0 20px 50px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-ink); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 4px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 650; letter-spacing: -.005em; }
h3 { font-size: 13.5px; margin: 0 0 8px; font-weight: 650; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.id { white-space: nowrap; font-weight: 650; font-variant-numeric: tabular-nums; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
svg.i.sm { width: 15px; height: 15px; }

/* ---------------------------------------------------------------- app layout */
.layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
body.public .layout { display: block; }
body.public .sidebar, body.public .topbar { display: none; }

.sidebar { background: var(--navy); color: #C9C9DA; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; }
.sidebar::before { content: ""; height: 3px; background: var(--brand-glow); flex: none; }
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 20px 20px; color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #FE8800, #FE6000 60%, #E8390C); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(254, 96, 0, .35); flex: none; }
.brand-mark svg { width: 19px; height: 19px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand-text { line-height: 1.2; }
.brand-text strong { display: block; font-size: 15px; letter-spacing: -.01em; }
.brand-text span { font-size: 10.5px; color: #A6A6BF; letter-spacing: .09em; text-transform: uppercase; }
.nav-label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #7C7C99; padding: 14px 22px 6px; font-weight: 650; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: #C9C9DA; font-weight: 500; position: relative; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(254, 96, 0, .14); color: #FF9A5A; }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav .count { margin-left: auto; background: var(--brand); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 700; line-height: 18px; }
.sidebar-foot { margin-top: auto; padding: 14px 20px 18px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 12px; color: #8C8CA8; }
.sidebar-foot strong { color: #E4E4EC; display: block; font-size: 13px; }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 28px; background: rgba(255, 255, 255, .88); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
@media (prefers-color-scheme: dark) { .topbar { background: rgba(22, 22, 36, .88); } }
.topbar .menu-btn { display: none; }
.crumb { font-size: 13px; color: var(--muted); font-weight: 500; }
.crumb strong { color: var(--text); font-weight: 600; }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; position: relative; padding: 0; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .dot { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); line-height: 1; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 22px; border: 1px solid var(--border); background: var(--surface); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; letter-spacing: .02em; flex: none; }
.user-chip .who { line-height: 1.15; }
.user-chip .who strong { display: block; font-size: 13px; }
.user-chip .who span { font-size: 11.5px; color: var(--muted); }

main { width: 100%; max-width: 1360px; margin: 0 auto; padding: 28px 28px 72px; }
body.public main { max-width: none; padding: 0; }

/* ---------------------------------------------------------------- page structure */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p.muted { margin: 2px 0 0; }
.page-head .muted.small a { font-weight: 500; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-ink); margin-bottom: 8px; }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px rgba(254, 96, 0, .18); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 18px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.stack > * + * { margin-top: 18px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2, .card.flush > .card-head { padding: 16px 20px 0; }
.card.flush > h2 { margin-bottom: 12px; }
.card.flush > p { padding: 0 20px 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }

.stat { padding: 16px 18px; position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand-glow); }
.stat .label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .09em; font-weight: 650; }
.stat .value { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .value.small { font-size: 16px; }
.kpi { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.kpi .chip { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); flex: none; }
.kpi .chip svg.i { width: 21px; height: 21px; }
.kpi .v { font-size: 24px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12.5px; color: var(--muted); }
a.kpi { color: inherit; font-weight: inherit; transition: border-color .12s, transform .12s; }
a.kpi:hover { text-decoration: none; border-color: #F5B58A; transform: translateY(-1px); }

.callout { border-radius: var(--radius); padding: 12px 14px; background: var(--info-soft); border: 1px solid transparent; border-left: 3px solid var(--info); }
.callout.warn { background: var(--warn-soft); border-left-color: #E8A200; }
.callout.bad { background: var(--bad-soft); border-left-color: var(--bad); }
.callout.ok { background: var(--ok-soft); border-left-color: var(--ok); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: 11px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .07em; background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.link-row { cursor: pointer; transition: background .12s; }
tbody tr.link-row:hover td { background: var(--surface-warm); }
td.empty { text-align: center; color: var(--muted); padding: 34px; }

/* comparison grid */
.cmp th.vendor { min-width: 156px; }
.cmp td.cell { min-width: 156px; }
.cmp td.line { min-width: 250px; max-width: 350px; position: sticky; left: 0; background: var(--surface); z-index: 1; box-shadow: 1px 0 0 var(--border); }
.cmp th:first-child { position: sticky; left: 0; z-index: 2; }
.cmp .price { font-weight: 650; font-variant-numeric: tabular-nums; font-size: 14.5px; }
.cmp td.best { background: var(--best); }
.cmp td.best .price { color: var(--best-ink); }
.cmp td.declined, .cmp td.missing { color: var(--muted); font-style: italic; }
.cmp .flags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.cmp tfoot td { background: var(--surface-2); font-weight: 650; border-top: 2px solid var(--border-strong); }
.flag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); white-space: nowrap; cursor: help; }
.flag.bad { background: var(--bad-soft); color: var(--bad); }
td.line { min-width: 220px; }

/* ---------------------------------------------------------------- forms */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 11px; width: 100%; transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover, textarea:hover { border-color: #C6C6D6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: #9A9AB5; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
textarea { min-height: 76px; resize: vertical; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand-ink); }
.field { margin-bottom: 14px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.inline-input { width: auto; min-width: 96px; }
table input, table select, table textarea { padding: 6px 8px; }
table input:not([type=checkbox]) { min-width: 96px; }
table textarea { min-width: 200px; min-height: 58px; }
table input[data-f=item] { min-width: 160px; }
.tabs .step-n, .setup-steps .step-n { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px;
  margin-right: 6px; border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; }
.tabs a.active .step-n { background: var(--brand-ink); color: #fff; }
.setup-steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.setup-steps a { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; color: inherit; text-decoration: none; }
.setup-steps a:hover { border-color: var(--brand-ink); }
.setup-steps .step-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.setup-steps .step-n { margin: 1px 0 0; min-width: 22px; height: 22px; border-radius: 11px; }
.setup-steps li.done .step-n { background: var(--good-soft, #E3F6EC); color: var(--good, #177A48); }
.setup-steps li.next a { border-color: var(--brand-ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-ink) 20%, transparent); }
.fsel { position: relative; }
.fsel-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; bottom: 0; left: 12px; }
.fsel-btn { width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; font: inherit; font-weight: 400; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 12px; min-height: 38px; cursor: pointer; }
.fsel-btn:disabled { opacity: .6; cursor: default; }
.fsel-btn:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 1px; }
.fsel-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fsel-caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--muted); font-size: 0; }
.fsel-pop { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 6px; }
.fsel-search { width: 100%; margin-bottom: 6px; }
.fsel-pop ul { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; outline: none; display: flex; flex-direction: column; }
.fsel-pop li { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.fsel-pop li[hidden] { display: none; }
.fsel-pop li.active, .fsel-pop li:hover { background: var(--surface-2); }
.fsel-pop li.on { font-weight: 600; }
.cflag.cflag-none { display: inline-block; width: 24px; height: 18px; box-shadow: none; }
.api-doc { max-width: 1040px; margin: 0 auto; padding: 28px 24px 80px; line-height: 1.6; }
.api-doc h1 { font-size: 28px; margin: 0 0 12px; }
.api-doc h2 { font-size: 22px; margin: 40px 0 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.api-doc h3 { font-size: 18px; margin: 28px 0 10px; }
.api-doc h4 { font-size: 15px; margin: 24px 0 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.api-doc table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: 14px; display: block; overflow-x: auto; }
.api-doc th, .api-doc td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.api-doc th { background: var(--surface-2); }
.api-doc code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.api-doc pre { background: var(--surface-2); padding: 12px 14px; border-radius: 8px; overflow-x: auto; }
.api-doc pre code { background: none; padding: 0; }
.api-doc a { color: var(--brand-ink); }
button.user-chip { font: inherit; color: inherit; cursor: pointer; text-align: left; }
.user-menu { position: absolute; right: 0; top: 46px; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 40; padding: 6px; }
.user-menu button, .user-menu a { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 8px 10px; border-radius: 6px; font: inherit; color: var(--text); cursor: pointer; text-align: left; text-decoration: none; box-sizing: border-box; }
.user-menu button:hover, .user-menu a:hover { background: var(--surface-2); }
.session-warn { position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 110; display: flex; gap: 14px; align-items: center; padding: 10px 14px;
  background: var(--navy); color: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); }
.tracker { list-style: none; margin: 0; padding: 0; }
.tracker li { position: relative; padding: 0 0 16px 30px; }
.tracker li::before { content: ''; position: absolute; left: 9px; top: 20px; bottom: 0; width: 2px; background: var(--border); }
.tracker li:last-child::before { display: none; }
.tracker .dot { position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--border-strong); }
.tracker li.done .dot { background: var(--good-soft); border-color: var(--good, #177A48); }
.tracker li.now .dot { background: var(--brand-soft); border-color: var(--brand-ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-ink) 18%, transparent); }
.tracker li.bad .dot { background: var(--bad-soft); border-color: var(--bad); }
.tracker li.next .dot { border-style: dashed; }
.tracker .t-title { font-weight: 600; }
.tracker .t-sub { color: var(--muted); font-size: 13px; }
.approve-card { max-width: 560px; margin: 24px auto; }
.approve-card h1 { font-size: 22px; margin: 4px 0 6px; }
.approve-total { font-size: 30px; font-weight: 800; margin: 10px 0; }
.approve-card button { min-height: 44px; }
.approve-card .row button { flex: 1; }
.approve-lines { padding-left: 18px; }
@media (max-width: 600px) { .approve-card { margin: 12px 0; border-radius: 0; } }
.file-list, .qa-list { list-style: none; margin: 8px 0 0; padding: 0; }
.file-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.file-list li a { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.file-list li button { margin-left: auto; }
.qa-list li { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.grow { flex: 1; min-width: 0; }
.pre { white-space: pre-wrap; }
.po-doc { max-width: 900px; }
.po-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; border-bottom: 2px solid var(--text); padding-bottom: 14px; margin-bottom: 16px; }
.po-head h2 { margin: 6px 0 2px; }
.po-logo { max-height: 56px; max-width: 200px; }
.po-meta { text-align: right; }
.po-title { font-size: 20px; font-weight: 800; letter-spacing: .08em; }
.po-parties { margin-bottom: 16px; }
.po-lines { width: 100%; border-collapse: collapse; margin: 8px 0 16px; }
.po-lines th, .po-lines td { border-bottom: 1px solid var(--border); padding: 8px; text-align: left; vertical-align: top; }
.po-lines .num { text-align: right; }
@media print {
  .sidebar, .topbar, .no-print, #toasts, .session-warn { display: none !important; }
  .layout { display: block !important; }
  body, .main, main { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  .po-doc { box-shadow: none !important; border: 0 !important; max-width: none; }
}
.setup-card h2 { margin: 2px 0 8px; }
.progress { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-2), var(--brand)); transition: width .4s; }
.sso-box { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
@media (max-width: 640px) {
  table.stack-sm thead { display: none; }
  table.stack-sm, table.stack-sm tbody, table.stack-sm tr, table.stack-sm td { display: block; width: 100%; }
  table.stack-sm tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  table.stack-sm td { position: relative; border: 0 !important; padding: 4px 0 4px 38% !important; text-align: right !important; min-height: 24px; overflow-wrap: anywhere; }
  table.stack-sm td[data-label]::before { content: attr(data-label); position: absolute; left: 0; top: 5px; width: 34%; text-align: left;
    color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
  table.stack-sm td[data-label=""], table.stack-sm td.empty { padding-left: 0 !important; text-align: center !important; }
  table.stack-sm td[data-label=""]::before { display: none; }
  table.form-lines td { padding-left: 0 !important; text-align: left !important; }
  table.form-lines td[data-label]::before { position: static; display: block; width: auto; margin-bottom: 4px; }
  table.form-lines td input, table.form-lines td textarea { width: 100%; }
  .page-head .row { flex-wrap: wrap; }
  .dlg-foot { flex-wrap: wrap; }
}
.choice-set { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.choice-set legend { font-weight: 600; font-size: 13px; margin-bottom: 8px; padding: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 6px; }
.choice-grid.wide { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.choice { position: relative; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 8px; row-gap: 2px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.choice:hover { border-color: var(--brand-ink); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--brand-ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-ink) 25%, transparent); }
.choice:has(input:focus-visible) { outline: 2px solid var(--brand-ink); outline-offset: 2px; }
.choice .cflag { grid-row: 1 / span 2; }
.choice-code { font-weight: 700; font-size: 14px; color: var(--text); }
.choice-sym { font-weight: 600; color: var(--muted); font-size: 13px; }
.choice-name { grid-column: 2 / span 2; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cflag { width: 24px; height: 18px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.12); flex: none; }
.cflag-sm { width: 16px; height: 12px; vertical-align: -1px; margin-right: 5px; }
.cflag-icon { display: inline-flex; align-items: center; justify-content: center; box-shadow: none; color: var(--muted); }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; color: var(--text); font-size: 14px; }

button, .btn { font: inherit; font-weight: 600; font-size: 13.5px; border-radius: 8px; padding: 8px 15px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; transition: background .12s, box-shadow .12s, transform .06s, filter .12s; line-height: 1.35; }
button:hover, .btn:hover { background: var(--surface-2); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: none; box-shadow: var(--ring); }
button.primary, .btn.primary { background: var(--brand-grad); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(214, 84, 0, .28); }
button.primary:hover, .btn.primary:hover { filter: brightness(1.07); background: var(--brand-grad); }
button.danger { color: var(--bad); }
button.danger:hover { background: var(--bad-soft); }
button.small, .btn.small { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand-ink); font-weight: 500; box-shadow: none; }
.link-btn:hover { background: none; text-decoration: underline; }
.send-back { gap: 0; flex-wrap: nowrap; }
.send-back button { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.send-back select { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 0; width: auto; }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 650; padding: 2px 9px 2px 8px; border-radius: 20px; background: var(--surface-2); color: var(--muted); text-transform: capitalize; white-space: nowrap; line-height: 18px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-approved, .badge-awarded, .badge-done, .badge-quoted, .badge-active, .badge-sent, .badge-submitted { background: var(--ok-soft); color: var(--ok); }
.badge-pending_approval, .badge-pending, .badge-open, .badge-queued, .badge-running, .badge-escalated { background: var(--brand-soft); color: var(--brand-ink); }
.badge-sent_back, .badge-closed, .badge-draft { background: var(--warn-soft); color: var(--warn); }
.badge-rejected, .badge-cancelled, .badge-withdrawn, .badge-failed, .badge-declined, .badge-inactive, .badge-disabled { background: var(--bad-soft); color: var(--bad); }

/* ---------------------------------------------------------------- timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 9px 0 12px 22px; border-left: 2px solid var(--border); position: relative; margin-left: 5px; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); position: absolute; left: -7px; top: 12px; }
.timeline li.done::before { background: var(--ok); border-color: var(--ok); }
.timeline li.now::before { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 4px rgba(254, 96, 0, .18); }
.timeline li.bad::before { background: var(--bad); border-color: var(--bad); }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 550; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--brand); }

/* ---------------------------------------------------------------- dialog */
dialog { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0; width: min(580px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(14, 14, 24, .55); backdrop-filter: blur(2px); }
dialog .dlg-body { padding: 22px 22px 8px; }
dialog .dlg-body h2 { font-size: 18px; margin-bottom: 14px; }
dialog .dlg-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); }

/* ---------------------------------------------------------------- notifications */
.notif-wrap { position: relative; }
.notif-panel { position: absolute; right: 0; top: 46px; width: min(390px, calc(100vw - 24px)); max-height: 460px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 40; }
.notif-panel a { display: block; padding: 11px 16px; border-bottom: 1px solid var(--border); color: var(--text); font-weight: 450; }
.notif-panel a.unread { background: var(--surface-warm); box-shadow: inset 3px 0 0 var(--brand); }
.notif-panel a:hover { text-decoration: none; background: var(--surface-2); }

/* ---------------------------------------------------------------- login */
.login-split { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.login-art { background: var(--navy); color: #fff; padding: 44px 56px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.login-art::before { content: ""; position: absolute; width: 640px; height: 640px; right: -240px; top: -200px; background: radial-gradient(circle, rgba(254, 96, 0, .42), rgba(254, 96, 0, 0) 65%); }
.login-art::after { content: ""; position: absolute; width: 540px; height: 540px; left: -220px; bottom: -240px; background: radial-gradient(circle, rgba(254, 163, 0, .2), rgba(254, 163, 0, 0) 65%); }
.login-art > * { position: relative; z-index: 1; }
.login-art .brand { padding: 0; }
.login-art h2 { font-size: 38px; line-height: 1.15; letter-spacing: -.025em; font-weight: 300; margin: auto 0 16px; max-width: 540px; }
.login-art h2 strong { font-weight: 750; background: linear-gradient(90deg, #FEA300, #FE6000); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-art p { color: #B7B7CC; max-width: 480px; font-size: 15px; }
.login-steps { display: flex; gap: 8px; flex-wrap: wrap; margin: 26px 0 auto; }
.login-steps span { font-size: 12px; font-weight: 600; color: #E4E4EC; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .04); padding: 5px 11px; border-radius: 20px; }
.login-art .fine { font-size: 12px; color: #7C7C99; margin-top: 28px; }
.login-form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.login-form .inner { width: min(380px, 100%); }
.login-form h1 { font-size: 26px; }
.demo-users { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.demo-users button { margin: 0 6px 8px 0; }

/* ---------------------------------------------------------------- toasts, pager, misc */
#toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: calc(100vw - 44px); }
.toast { padding: 11px 16px; border-radius: 10px; background: var(--navy); color: #fff; box-shadow: var(--shadow-lg); max-width: 440px; border-left: 3px solid var(--brand); font-weight: 500; }
.toast-error { background: var(--bad); border-left-color: #7F1D1D; }
.pager { display: flex; gap: 8px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; background: var(--surface-2); }
.ai-block { white-space: pre-wrap; }
.kbd-hint { font-size: 12px; color: var(--muted); }
pre.mono { white-space: pre-wrap; word-break: break-word; margin: 6px 0 0; }
details > summary { cursor: pointer; }
.p14 { padding: 14px; } .px14 { padding: 8px 16px; } .note-pad { padding: 12px 20px; }
.mb16 { margin-bottom: 18px; } .mb10 { margin-bottom: 10px; } .mt16 { margin-top: 18px; } .mt12 { margin-top: 12px; } .mt10 { margin-top: 10px; } .mt8 { margin-top: 8px; }
.scroll340 { max-height: 340px; overflow: auto; } .narrow { max-width: 760px; }

/* vendor portal header (no sidebar) */
.portal-top { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: var(--navy); color: #fff; position: relative; }
.portal-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--brand-glow); }
.portal-top .brand { padding: 0; }
.portal-top .secure { margin-left: auto; font-size: 12px; color: #B7B7CC; display: flex; align-items: center; gap: 6px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  .topbar .menu-btn { display: grid; }
  .grid2 { grid-template-columns: 1fr; }
  .login-split { grid-template-columns: 1fr; }
  .login-art { padding: 28px 24px; }
  .login-art h2 { font-size: 26px; margin-top: 28px; }
  .login-steps { margin-bottom: 0; }
  .login-art .fine { display: none; }
}
@media (max-width: 720px) {
  main { padding: 18px 14px 56px; }
  .topbar { padding: 0 14px; }
  .user-chip .who, .crumb { display: none; }
  .user-chip { padding: 3px; }
  .portal-top { padding: 0 14px; }
  .portal-top .secure span { display: none; }
}
.grid2 { align-items: start; }
.login-form button[type=submit] { width: 100%; justify-content: center; padding: 10px 16px; font-size: 14px; }
@media (max-width: 720px) {
  .grid4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .kpi .chip { width: 36px; height: 36px; }
  .stat .value { font-size: 18px; }
}
.cat-chip { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; color: var(--brand-ink); font-weight: 600; font-size: 11.5px; }
dl.kv { display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: 8px 14px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 12.5px; font-weight: 600; }
dl.kv dd { margin: 0; }
fieldset.addr { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; display: grid; gap: 8px; }
ul.org-tree, ul.org-tree ul { list-style: none; margin: 0; padding-left: 18px; }
ul.org-tree { padding-left: 4px; }
ul.org-tree li { position: relative; padding: 3px 0 3px 14px; }
ul.org-tree li::before { content: ""; position: absolute; left: 0; top: 13px; width: 9px; border-top: 1px solid var(--border-strong); }
ul.org-tree ul { border-left: 1px solid var(--border-strong); margin-left: 6px; }
input[type=radio] { width: auto; accent-color: var(--brand-ink); }
.tabs.wrap { flex-wrap: wrap; overflow: visible; }
.login-box { max-width: 400px; margin: 8vh auto; }
.brand-logo { width: 38px; height: 38px; border-radius: 9px; background: #fff; object-fit: contain; padding: 3px; flex: none; }
.logo-edit { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-edit .preview { width: 88px; height: 88px; border-radius: 12px; border: 1px dashed var(--border-strong); background: #fff; display: grid; place-items: center; overflow: hidden; }
.logo-edit .preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-thumb { width: 28px; height: 28px; border-radius: 6px; background: #fff; object-fit: contain; border: 1px solid var(--border); vertical-align: middle; margin-right: 8px; }

/* Two-step sign-in */
.mfa-setup { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; align-items: start; }
.mfa-qr { width: 180px; height: 180px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; box-sizing: border-box; }
.recovery-codes { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; columns: 2; font-size: 15px; line-height: 1.8; }
@media (max-width: 560px) { .mfa-setup { grid-template-columns: minmax(0, 1fr); } }

/* Subscription banner and billing */
.plan-banner { margin: 0 24px; padding: 8px 14px; border-radius: var(--radius); background: var(--info-soft); color: var(--info); font-size: 14px; }
.plan-banner.warn { background: var(--warn-soft); color: var(--warn); }
.plan-banner.bad { background: var(--bad-soft); color: var(--bad); }
.plan-banner a { color: inherit; font-weight: 600; }
#plan-banner:not(:empty) { padding-top: 12px; }
.quote-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.quote-table td { padding: 3px 0; }
.quote-table tr.total td { border-top: 1px solid var(--border); padding-top: 6px; }
ul.tight { margin: 4px 0 0; padding-left: 0; list-style: none; line-height: 1.7; }
fieldset.plan-edit { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 14px 12px; margin: 0 0 12px; }
fieldset.plan-edit legend { font-weight: 600; font-size: 13px; padding: 0 6px; }
.invoice .po-parties { margin: 14px 0; }
.whats-new { margin: 12px 24px 0; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; box-shadow: var(--shadow); }
.whats-new ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; color: var(--text-2); }
.help-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.help-toc { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 2px; padding: 10px; }
.help-toc a { padding: 6px 8px; border-radius: 6px; text-decoration: none; color: var(--text-2); font-size: 14px; }
.help-toc a:hover { background: var(--surface-2); }
.help-sec ol, .help-sec ul { padding-left: 20px; }
@media (max-width: 760px) { .help-layout { grid-template-columns: minmax(0, 1fr); } .help-toc { position: static; } }
.recovery-codes.one-col { columns: 1; word-break: break-all; white-space: pre-wrap; }
.widget-pick { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; }
.widget-pick li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; }
.widget-pick .icon-btn.small { width: 28px; height: 28px; }
.user-menu .menu-label { font-size: 12px; color: var(--muted); padding: 6px 10px 2px; text-transform: uppercase; letter-spacing: .04em; }
.user-menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
