/* BlueManager — interface styles.
   Neutral slate surfaces; the company's brand colour (--accent) is used sparingly for primary actions,
   the active menu item and focus. Spacing scale 4/8/12/16/24/32 (--s1 … --s6). Mobile first. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/inter-var.woff2") format("woff2"); }

:root {
  /* surfaces & text */
  --bg: #f6f7f9; --panel: #ffffff; --subtle: #f9fafb; --soft: #f2f4f7;
  --ink: #101828; --ink-2: #344054; --muted: #667085; --faint: #98a2b3;
  --line: #e4e7ec; --line-2: #d0d5dd;
  /* company accent (overridden per company in base.html) */
  --accent: #0e7c99; --accent-dark: #0b6177; --accent-soft: #e6f3f6; --accent-ink: #ffffff; --accent-text: #0e7c99;
  /* BlueManager brand (product pages) */
  --bm-deep: #074552; --bm-cyan: #21a3bd; --bm-aqua: #64dbe1;
  /* status */
  --ok: #067647; --ok-soft: #ecfdf3; --ok-line: #abefc6;
  --warn: #b54708; --warn-soft: #fffaeb; --warn-line: #fedf89;
  --err: #b42318; --err-soft: #fef3f2; --err-line: #fecdca;
  --wa: #128c4a;
  --radius: 10px; --radius-s: 8px; --radius-xs: 6px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 24px -6px rgba(16, 24, 40, .12), 0 4px 8px -4px rgba(16, 24, 40, .06);
  --ring: 0 0 0 4px var(--accent-soft);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --top: 60px; --side: 248px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; background: var(--bg); color: var(--ink);
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 1.5rem; line-height: 1.25; font-weight: 650; margin: 0 0 var(--s1); letter-spacing: -.02em; }
h2 { font-size: 1rem; line-height: 1.4; font-weight: 600; margin: 0 0 var(--s4); letter-spacing: -.005em; }
h3 { font-size: .9rem; font-weight: 600; margin: var(--s5) 0 var(--s3); }
p { margin: 0 0 var(--s3); }
small, .small { font-size: .8rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.red { color: var(--err); font-weight: 600; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: var(--soft); padding: 1px 6px; border-radius: 4px; }
code.big-code { font-size: 1.05rem; letter-spacing: .08em; padding: 6px 10px; display: inline-block; }
pre.plain { white-space: pre-wrap; background: var(--subtle); border: 1px solid var(--line); padding: var(--s3) var(--s4); border-radius: var(--radius-s);
  font-family: inherit; font-size: .88rem; margin: 0; }
.ic { width: 18px; height: 18px; flex-shrink: 0; vertical-align: -4px; }
.ic.sm { width: 15px; height: 15px; vertical-align: -3px; }
.ic.lg { width: 22px; height: 22px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- app frame ---------- */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--top); background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--s4); padding: 0 var(--s5) 0 0; }
.brand { display: flex; align-items: center; width: var(--side); flex-shrink: 0; padding: 0 var(--s5); min-width: 0; height: 100%; }
.brand img { max-height: 36px; max-width: 180px; object-fit: contain; display: block; }
.brand .brand-name { font-weight: 650; font-size: 1rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.topsearch { flex: 1; max-width: 440px; position: relative; }
.topsearch .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.topsearch input { padding-left: 36px; background: var(--subtle); min-height: 38px; }
.topsearch input:focus { background: #fff; }
.topbar .spacer { flex: 1; }
.topbar a.user { display: flex; align-items: center; gap: var(--s2); color: var(--ink-2); font-size: .86rem; font-weight: 500; white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: inline-flex;
  align-items: center; justify-content: center; font-weight: 600; font-size: .75rem; letter-spacing: .02em; }
.topbar .m-search { display: none; }
.lang { display: flex; border: 1px solid var(--line); border-radius: var(--radius-xs); overflow: hidden; }
.lang a { color: var(--muted); font-size: .74rem; font-weight: 600; padding: 3px 8px; }
.lang a.on { background: var(--soft); color: var(--ink); }
.lang a:hover { text-decoration: none; color: var(--ink); }
.menu-toggle { display: none; background: none; border: 0; box-shadow: none; color: var(--ink-2); padding: 0 var(--s3); min-height: 44px; cursor: pointer; }
.menu-toggle:hover { background: none; }
.trialbar { background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--warn-line); font-size: .84rem; padding: 7px var(--s4); text-align: center; }
.trialbar.ro { background: var(--err-soft); color: var(--err); border-color: var(--err-line); }
.trialbar a { color: inherit; font-weight: 600; text-decoration: underline; }

.shell { display: flex; min-height: calc(100vh - var(--top)); }
nav.side { width: var(--side); flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--line); padding: var(--s4) var(--s3);
  position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; display: flex; flex-direction: column; }
nav.side a { display: flex; align-items: center; gap: var(--s3); padding: 8px var(--s3); border-radius: var(--radius-xs); color: var(--ink-2);
  font-size: .875rem; font-weight: 500; margin-bottom: 1px; }
nav.side a .ic { color: var(--faint); width: 18px; height: 18px; }
nav.side a:hover { background: var(--subtle); text-decoration: none; color: var(--ink); }
nav.side a.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
nav.side a.on .ic { color: var(--accent-text); }
nav.side .group { font-size: .7rem; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: var(--s4) var(--s3) var(--s1); }
nav.side .cta { background: var(--accent); color: var(--accent-ink); justify-content: center; font-weight: 600; margin-bottom: var(--s3); padding: 9px; box-shadow: var(--shadow-xs); }
nav.side .cta .ic { color: inherit; }
nav.side .cta:hover { background: var(--accent-dark); color: var(--accent-ink); }
nav.side .grow { flex: 1; }
nav.side .powered { display: flex; align-items: center; gap: var(--s2); font-size: .72rem; color: var(--muted); padding: var(--s3); margin-top: var(--s3);
  border-top: 1px solid var(--line); line-height: 1.35; }
nav.side .powered img { width: 22px; height: 22px; object-fit: contain; }
nav.side .powered a { display: inline; padding: 0; margin: 0; color: var(--ink-2); font-size: inherit; font-weight: 600; }
nav.side .powered a:hover { background: none; }
nav.side .company-id { font-size: .72rem; color: var(--muted); padding: 0 var(--s3); }
nav.side .company-id code { font-size: .72rem; }
main { flex: 1; min-width: 0; padding: var(--s6) 40px 48px; max-width: 1360px; }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s5); }
.pagehead p, .pagehead .muted { margin: 0; }

/* ---------- surfaces ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs);
  padding: var(--s5); margin-bottom: var(--s4); }
.card > h2:first-child { display: flex; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); flex-wrap: wrap; }
.card > h2 .count { font-weight: 500; color: var(--muted); font-size: .85rem; margin-left: var(--s1); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: var(--s4) var(--s5); margin: 0; border-bottom: 1px solid var(--line); }
.grid { display: grid; gap: var(--s4); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid > .card { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s4); margin-bottom: var(--s5); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4) var(--s5); box-shadow: var(--shadow-xs); }
.stat .label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 1.5rem; font-weight: 650; margin-top: 4px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: .78rem; color: var(--muted); margin-top: 2px; }

/* ---------- buttons ---------- */
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: .875rem; font-weight: 600;
  padding: 0 14px; min-height: 38px; border-radius: var(--radius-s); border: 1px solid var(--accent); background: var(--accent);
  color: var(--accent-ink); cursor: pointer; white-space: nowrap; text-decoration: none; box-shadow: var(--shadow-xs);
  transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover, button:hover { background: var(--accent-dark); border-color: var(--accent-dark); text-decoration: none; }
.btn:focus-visible, button:focus-visible { outline: none; box-shadow: var(--ring); }
.btn .ic, button .ic { width: 16px; height: 16px; }
.btn.ghost, button.ghost { background: var(--panel); color: var(--ink-2); border-color: var(--line-2); }
.btn.ghost:hover, button.ghost:hover { background: var(--subtle); color: var(--ink); border-color: var(--line-2); }
.btn.danger, button.danger { background: var(--panel); color: var(--err); border-color: var(--err-line); }
.btn.danger:hover, button.danger:hover { background: var(--err-soft); }
.btn.small, button.small { padding: 0 10px; font-size: .8rem; min-height: 32px; border-radius: var(--radius-xs); }
.btn.big, button.big { min-height: 44px; padding: 0 var(--s5); font-size: .95rem; }
.btn.full, button.full { width: 100%; }
.btn.icon, button.icon { padding: 0; width: 32px; }
.btn.wa, button.wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn.wa:hover { background: #0e7a40; border-color: #0e7a40; }
.btn.link, button.link { background: none; border: 0; box-shadow: none; color: var(--accent-text); padding: 0; min-height: 0; font-weight: 500; }
button:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.actions.end { justify-content: flex-end; }
.actions.divider { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); }
form.inline { display: inline; }

/* ---------- forms ---------- */
label { display: block; font-size: .8rem; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
input, select, textarea { font: inherit; font-size: 16px; width: 100%; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-s);
  background: #fff; color: var(--ink); min-height: 40px; box-shadow: var(--shadow-xs); transition: border-color .12s, box-shadow .12s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[readonly] { background: var(--subtle); color: var(--ink-2); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background: #fff 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='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; min-height: 0; margin: 0 var(--s2) 0 0; accent-color: var(--accent); flex-shrink: 0; box-shadow: none; }
input[type=file] { padding: 6px; font-size: .85rem; }
input[type=color] { padding: 3px; }
select.auto, input.auto { width: auto; }
textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s4); margin-bottom: var(--s4); }
.fields .wide { grid-column: 1 / -1; }
.fields .span2 { grid-column: span 2; }
.fields small.muted { display: block; margin-top: 4px; }
.field { margin-bottom: var(--s4); }
.check { display: flex; align-items: center; font-weight: 500; color: var(--ink); font-size: .875rem; margin: 0; cursor: pointer; }
.w-55 { width: 64px; } .w-70 { width: 78px; } .w-100 { width: 108px; } .w-110 { width: 120px; } .w-160 { width: 170px; }
.toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s3); }
.toggle { display: flex; align-items: flex-start; gap: var(--s3); border: 1px solid var(--line); border-radius: var(--radius-s); padding: var(--s3) var(--s4);
  cursor: pointer; font-weight: 400; margin: 0; background: var(--panel); }
.toggle:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.toggle input { margin-top: 3px; }
.toggle span { display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.toggle small { text-transform: none; }
tr.is-off td { color: var(--faint); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { text-align: left; font-size: .75rem; color: var(--muted); font-weight: 500; padding: 10px var(--s3); border-bottom: 1px solid var(--line);
  white-space: nowrap; background: var(--subtle); }
td { padding: 12px var(--s3); border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: var(--s4); }
th:last-child, td:last-child { padding-right: var(--s4); }
.card > table th:first-child, .card > table td:first-child, .card .table-wrap th:first-child, .card .table-wrap td:first-child { padding-left: 0; }
.card > table th:last-child, .card > table td:last-child, .card .table-wrap th:last-child, .card .table-wrap td:last-child { padding-right: 0; }
.card > table th, .card .table-wrap th { background: none; }
.card.flush .table-wrap th:first-child, .card.flush .table-wrap td:first-child { padding-left: var(--s5); }
.card.flush .table-wrap th:last-child, .card.flush .table-wrap td:last-child { padding-right: var(--s5); }
.card.flush .table-wrap th { background: var(--subtle); }
tbody tr:hover td, table tr:hover td { background: #fbfcfd; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td small { color: var(--muted); }
tfoot td { font-weight: 600; border-top: 1px solid var(--line); border-bottom: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.edit td { padding: 6px var(--s2); vertical-align: middle; }
table.edit input, table.edit select { min-height: 34px; padding: 5px 8px; font-size: 14px; box-shadow: none; }

/* ---------- badges, alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 500; line-height: 1.5; padding: 1px 8px; border-radius: 999px;
  background: var(--soft); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge.err { background: var(--err-soft); color: var(--err); border-color: var(--err-line); }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.flash { display: flex; gap: var(--s2); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--radius-s); margin-bottom: var(--s4);
  font-size: .875rem; font-weight: 500; border: 1px solid; }
.flash.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.flash.err { background: var(--err-soft); color: var(--err); border-color: var(--err-line); }
.flash.info { background: var(--accent-soft); color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.empty { color: var(--muted); padding: var(--s3) 0; font-size: .875rem; }
details { margin-top: var(--s3); }
details summary { cursor: pointer; font-weight: 600; color: var(--accent-text); padding: var(--s1) 0; font-size: .875rem; }
details[open] summary { margin-bottom: var(--s3); }
.m-only { display: none; }

/* ---------- dashboard ---------- */
.getting-started { border-color: var(--line); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.checklist li { display: flex; align-items: center; gap: var(--s3); padding: 6px 0; font-size: .875rem; }
.checklist .tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-2); display: inline-flex; align-items: center;
  justify-content: center; flex-shrink: 0; color: #fff; }
.checklist .tick .ic { width: 12px; height: 12px; }
.checklist li.done { color: var(--muted); }
.checklist li.done .tick { background: var(--ok); border-color: var(--ok); }
.meter { height: 6px; background: var(--soft); border-radius: 99px; overflow: hidden; margin: 0 0 var(--s4); }
.meter > div { height: 100%; background: var(--accent); border-radius: 99px; }
.stage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s2); }
.stage-grid a { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); padding: 8px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-s); color: var(--ink-2); font-size: .82rem; }
.stage-grid a:hover { border-color: var(--line-2); background: var(--subtle); text-decoration: none; }
.stage-grid a strong { font-variant-numeric: tabular-nums; color: var(--faint); font-weight: 600; }
.stage-grid a.has strong { color: var(--accent-text); }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .title { font-weight: 500; color: var(--ink); }
.list-row small { display: block; color: var(--muted); }

/* ---------- job page ---------- */
.jobcard { padding-bottom: var(--s4); }
.jobhead { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: flex-start; justify-content: space-between; }
.jobhead h1 { margin: 2px 0 2px; }
.jobhead .contact { margin-top: var(--s3); }
.money-box { text-align: right; }
.big-money { font-size: 1.6rem; font-weight: 650; letter-spacing: -.02em; margin-top: var(--s1); font-variant-numeric: tabular-nums; }
.progress { height: 4px; background: var(--soft); border-radius: 99px; overflow: hidden; margin: var(--s5) 0 var(--s3); }
.progress > div { height: 100%; background: var(--accent); }
.steps { display: flex; gap: 6px; overflow-x: auto; padding-bottom: var(--s2); scrollbar-width: thin; }
.steps .step { flex: 0 0 auto; font-size: .72rem; font-weight: 500; padding: 3px 9px; border-radius: 999px; background: var(--panel);
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.steps .step.done { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
.steps .step.skip { color: var(--faint); text-decoration: line-through; }
.steps .step.now { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nextbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3);
  background: var(--subtle); border: 1px solid var(--line); border-radius: var(--radius-s); padding: var(--s3) var(--s4); margin-top: var(--s3); }
.nextbar .label { font-size: .75rem; color: var(--muted); font-weight: 500; }
.nextbar form { margin: 0; }
.next { background: var(--subtle); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: var(--s3) var(--s4); border-radius: var(--radius-s); font-size: .875rem; margin-top: var(--s3); }
.next.ok-note { background: var(--ok-soft); border-color: var(--ok-line); border-left-color: var(--ok); color: var(--ok); }
.tabs { display: flex; gap: var(--s5); overflow-x: auto; margin: var(--s5) 0 var(--s4); position: sticky; top: var(--top); z-index: 20;
  background: var(--bg); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: var(--s3) 2px; color: var(--muted); font-weight: 500; font-size: .875rem; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--accent-text); border-bottom-color: var(--accent); font-weight: 600; }
/* panes are all visible until the script takes over, so nothing is ever hidden if JavaScript fails */
body.tabs-ready .tabpane { display: none; }
body.tabs-ready .tabpane.on { display: block; }
section.card { scroll-margin-top: calc(var(--top) + 64px); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--s5); font-size: .875rem; margin: 0 0 var(--s4); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.totals { margin-left: auto; max-width: 380px; width: 100%; font-size: .875rem; }
.totals div { display: flex; justify-content: space-between; gap: var(--s5); padding: 4px 0; font-variant-numeric: tabular-nums; }
.totals .grand { font-weight: 650; font-size: 1.05rem; border-top: 1px solid var(--line); margin-top: var(--s1); padding-top: var(--s2); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: var(--s2); margin-top: var(--s3); }
.photos figure { margin: 0; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--line); display: block; background: var(--soft); }
.photos figcaption { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.order { border: 1px solid var(--line); border-radius: var(--radius-s); padding: var(--s4); margin-bottom: var(--s3); background: var(--subtle); }
.order h3:first-child { margin-top: 0; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: .875rem; }
.timeline li { padding: 10px 0 10px var(--s4); border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 15px; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.timeline .when { color: var(--muted); font-size: .76rem; }
.linkbox { background: var(--subtle); border: 1px solid var(--line); border-radius: var(--radius-s); padding: var(--s3) var(--s4); margin-top: var(--s4); }
.linkbox input { flex: 1; min-width: 200px; min-height: 34px; font-size: 13px; }

/* quote builder */
table.quote .room-input { font-weight: 600; margin-bottom: var(--s1); }
table.quote td.c-desc { min-width: 260px; }
table.quote .line-total { display: block; color: var(--muted); }
.row-actions { display: flex; gap: var(--s1); justify-content: flex-end; }
.add-line { margin-top: var(--s4); }
.add-line .fields { margin-bottom: 0; }
.quote-foot { margin-top: var(--s5); align-items: start; }

/* quote preview */
.preview-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s4); align-items: start; }
.pdf-frame { padding: 0; overflow: hidden; }
.pdf-frame iframe { width: 100%; height: 78vh; border: 0; display: block; }
.send-box { position: sticky; top: calc(var(--top) + var(--s4)); display: grid; gap: var(--s3); }
.send-box form { margin: 0; }

/* ---------- pipeline board ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: var(--s4); align-items: start; overflow-x: auto; padding-bottom: var(--s4); }
.col { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s2); min-height: 140px; }
.col-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); padding: var(--s2) var(--s2) var(--s3); font-size: .875rem; }
.jcard { display: block; background: var(--panel); border-radius: var(--radius-s); padding: var(--s3); margin-bottom: var(--s2); border: 1px solid var(--line);
  color: var(--ink); font-size: .84rem; box-shadow: var(--shadow-xs); }
.jcard:hover { border-color: var(--line-2); text-decoration: none; box-shadow: var(--shadow); }
.jcard.stuck { box-shadow: inset 3px 0 0 var(--err), var(--shadow-xs); }
.jc-top, .jc-bottom { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
.jc-top { margin-bottom: var(--s2); }
.jc-bottom { margin-top: var(--s2); color: var(--muted); }
.jcard .amt { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- calendar ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s2); }
.day { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-s); min-height: 160px; padding: var(--s2); }
.day.today { border-color: var(--accent); box-shadow: var(--ring); }
.day h4 { margin: 0 0 var(--s2); font-size: .76rem; font-weight: 600; color: var(--muted); }
.ev { display: block; background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: var(--radius-xs); padding: 6px var(--s2);
  margin-bottom: 6px; font-size: .78rem; color: var(--ink); }
.ev.done { background: var(--ok-soft); border-color: var(--ok); }

/* ---------- signature ---------- */
.sigpad { border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: #fff; touch-action: none; width: 100%; height: 230px; display: block; }

/* ---------- login, sign-up & public pages ---------- */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--s6) var(--s4);
  background: radial-gradient(1200px 500px at 50% -10%, #e9f6f9 0%, rgba(233,246,249,0) 70%), var(--bg); }
.login { width: 100%; max-width: 400px; }
.login.wide { max-width: 560px; }
.login > .card { padding: var(--s6); box-shadow: var(--shadow); }
.login h1 { font-size: 1.35rem; text-align: center; margin-bottom: 6px; }
.login .lede { text-align: center; color: var(--muted); margin-bottom: var(--s5); }
.login-logo { display: block; max-width: 220px; max-height: 90px; object-fit: contain; margin: 0 auto var(--s5); }
.login-name { text-align: center; font-size: 1.4rem; font-weight: 650; margin-bottom: var(--s5); letter-spacing: -.02em; }
.wordmark { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: var(--s5); text-decoration: none; }
.wordmark img { width: 40px; height: 40px; object-fit: contain; }
.wordmark span { font-size: 1.45rem; font-weight: 700; letter-spacing: -.03em; color: var(--bm-deep); }
.wordmark span b { color: var(--bm-cyan); font-weight: 700; }
.wordmark:hover { text-decoration: none; }
.wordmark.sm img { width: 28px; height: 28px; }
.wordmark.sm span { font-size: 1.1rem; }
.auth-foot { text-align: center; font-size: .8rem; color: var(--muted); margin-top: var(--s5); }
.auth-foot a { color: var(--ink-2); font-weight: 500; }
.powered { text-align: center; font-size: .76rem; color: var(--faint); margin-top: var(--s4); }
.powered a { color: var(--muted); }
.public-name { font-size: 1.2rem; font-weight: 650; }
.logo-preview { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s2); }
.logo-preview img { max-height: 56px; max-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px; }
input.color { width: 64px; height: 40px; padding: 3px; }
.wizard-steps { display: flex; gap: var(--s2); margin-bottom: var(--s5); }
.wizard-steps span { flex: 1; font-size: .8rem; font-weight: 500; color: var(--muted); padding-top: var(--s2); border-top: 3px solid var(--line); }
.wizard-steps span.on { color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.wizard-steps span.done { color: var(--ink-2); border-color: var(--accent); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--s4); }
.plan { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); }
.plan.best { border-color: var(--accent); box-shadow: var(--ring); }
.plan h3 { display: flex; justify-content: space-between; align-items: center; }
.plan .price { font-size: 1.9rem; font-weight: 700; letter-spacing: -.03em; margin: var(--s2) 0; }
.plan ul { padding-left: 1.1rem; color: var(--ink-2); margin: 0 0 var(--s4); }
.hp { position: absolute; left: -9999px; }
.public { max-width: 720px; margin: 0 auto; padding: var(--s6) var(--s4) 48px; }
.public-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); padding-bottom: var(--s4); border-bottom: 1px solid var(--line); }
.public-head img { max-height: 52px; max-width: 220px; object-fit: contain; }
.public .label { font-size: .75rem; color: var(--muted); font-weight: 500; }
.public .split { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s4); }
.accent-card { border-color: var(--accent); box-shadow: var(--ring); }
.qroom { font-weight: 600; margin: var(--s4) 0 var(--s1); font-size: .85rem; color: var(--ink-2); }
.qline .num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.qline { display: flex; justify-content: space-between; gap: var(--s4); padding: 10px 0; border-bottom: 1px solid var(--line); }
.terms { margin: 0; padding-left: 1.2rem; color: var(--muted); font-size: .875rem; }
.public-foot { text-align: center; margin-top: var(--s6); color: var(--muted); }

/* ---------- legal pages ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: var(--s6) var(--s4) 64px; }
.legal-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); margin-bottom: var(--s5); }
.legal-head .wordmark { margin: 0; }
.legal .card { padding: 40px; }
.legal h1 { font-size: 1.75rem; margin-bottom: var(--s2); }
.legal h2 { font-size: 1.05rem; margin: 32px 0 10px; }
.legal p, .legal li { color: var(--ink-2); line-height: 1.65; font-size: .92rem; }
.legal ul { padding-left: 1.2rem; margin: 0 0 var(--s3); }
.legal li { margin-bottom: 6px; }
.legal .meta { color: var(--muted); font-size: .85rem; margin-bottom: var(--s5); }
.legal .summary { background: var(--subtle); border: 1px solid var(--line); border-radius: var(--radius-s); padding: var(--s4) var(--s5); margin-bottom: var(--s4); }
.legal .summary p { margin: 0; }
.legal-nav { display: flex; gap: var(--s4); font-size: .85rem; }
@media (max-width: 860px) { .legal .card { padding: var(--s5); } }

/* ---------- platform admin ---------- */
.platform-top { background: var(--bm-deep); border-bottom: 0; }
.platform-top .brand-name, .platform-top a.user { color: #e3f4f7; }
.platform-top .brand .tag { font-size: .7rem; font-weight: 600; color: var(--bm-deep); background: var(--bm-aqua); border-radius: 4px; padding: 1px 6px; margin-left: 8px; }
.platform-top nav { display: flex; gap: var(--s4); }
.platform-top nav a { color: #b9dfe6; font-size: .86rem; font-weight: 500; }
.platform-top nav a:hover { color: #fff; text-decoration: none; }
.platform-main { max-width: 1240px; margin: 0 auto; padding: var(--s6) var(--s5) 48px; }

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  main { padding: var(--s5); }
  .board { grid-template-columns: repeat(4, 260px); }
  .preview-grid { grid-template-columns: 1fr; }
  .send-box { position: static; }
}

/* ---------- phone ---------- */
@media (max-width: 860px) {
  :root { --top: 56px; }
  body { font-size: 15px; }
  .menu-toggle { display: inline-flex; align-items: center; }
  .brand { width: auto; padding: 0; max-width: 40vw; }
  .brand img { max-height: 30px; max-width: 120px; }
  .topbar { gap: var(--s2); padding: 0 var(--s3) 0 0; }
  .topbar a.user .name, .lang { display: none; }
  .topsearch { display: none; }
  .topbar .m-search { display: inline-flex; }
  nav.side { position: fixed; top: var(--top); left: 0; bottom: 0; height: auto; z-index: 50; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: var(--shadow-lg); width: 272px; }
  body.menu-open nav.side { transform: none; }
  body.menu-open::after { content: ""; position: fixed; inset: var(--top) 0 0 0; background: rgba(16, 24, 40, .4); z-index: 45; }
  main { padding: var(--s4) var(--s3) 48px; }
  .pagehead { margin-bottom: var(--s4); }
  h1 { font-size: 1.3rem; }
  .card { padding: var(--s4); margin-bottom: var(--s3); }
  .stats { grid-template-columns: 1fr 1fr; gap: var(--s2); }
  .stat { padding: var(--s3); }
  .stat .value { font-size: 1.15rem; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr 1fr; gap: var(--s3); }
  .fields .span2 { grid-column: 1 / -1; }
  th, td { padding: var(--s2); }
  .m-only { display: inline; }
  a.m-only, .btn.m-only { display: flex; margin: var(--s3); }

  .money-box { text-align: left; width: 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3); }
  .big-money { font-size: 1.3rem; margin: 0; }
  .nextbar { flex-direction: column; align-items: stretch; }
  .nextbar .btn, .nextbar button { width: 100%; }
  .tabs { margin: var(--s4) calc(-1 * var(--s3)) var(--s3); padding: 0 var(--s3); gap: var(--s4); }
  .totals { max-width: none; }

  /* quote rows become cards */
  table.quote.editable, table.quote.editable tbody, table.quote.editable tr, table.quote.editable td { display: block; width: 100%; }
  table.quote.editable tr.head { display: none; }
  table.quote.editable tr { border: 1px solid var(--line); border-radius: var(--radius-s); padding: var(--s3); margin-bottom: var(--s3); background: var(--subtle); }
  table.quote.editable tr:hover td { background: transparent; }
  table.quote.editable td { border: 0; padding: var(--s1) 0; text-align: left; }
  table.quote.editable td[data-label] { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: var(--s2); }
  table.quote.editable td[data-label]::before { content: attr(data-label); font-size: .78rem; font-weight: 500; color: var(--muted); }
  table.quote.editable td.c-desc { min-width: 0; }
  table.quote.editable input { width: 100% !important; }
  table.quote.editable .row-actions { justify-content: stretch; margin-top: var(--s2); }
  table.quote.editable .row-actions button { flex: 1; min-height: 38px; }

  /* tables marked .cards become one card per row */
  table.cards, table.cards tbody, table.cards thead, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards tr.head, table.cards thead, table.cards .d-only { display: none; }
  table.cards tr:has(th) { display: none; }
  table.cards tr { border-bottom: 1px solid var(--line); padding: var(--s3) 0; }
  .card.flush table.cards tr { padding: var(--s3) var(--s4); }
  table.cards tr:hover td { background: transparent; }
  table.cards td, .card.flush .table-wrap table.cards td:first-child, .card.flush .table-wrap table.cards td:last-child { border: 0; padding: 2px 0; text-align: left; }
  table.cards td[data-label] { display: flex; justify-content: space-between; gap: var(--s3); }
  table.cards td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .82rem; }
  table.cards td.card-title { font-weight: 600; margin-bottom: var(--s1); }
  table.cards .actions.end { justify-content: flex-start; margin-top: var(--s2); }
  table.cards tfoot tr { display: flex; justify-content: space-between; gap: var(--s3); padding-top: var(--s3); }
  table.cards tfoot td { width: auto; }
  table.cards tfoot td:nth-child(2):not(:last-child), table.cards tfoot td:nth-child(3):not(:last-child) { display: none; }
  /* other wide tables scroll sideways instead of squashing */
  .table-wrap > table:not(.cards):not(.quote) { min-width: 560px; }

  .board { grid-template-columns: 1fr; overflow: visible; }
  .col { min-height: 0; }
  .week { grid-template-columns: 1fr; }
  .day { min-height: 0; }
  .pdf-frame iframe { height: 60vh; }
  .public { padding: var(--s4) var(--s3) 48px; }
  .public-head img { max-height: 40px; }
  .login > .card { padding: var(--s5); }
  .platform-top nav { gap: var(--s3); }
  .platform-main { padding: var(--s4) var(--s3) 48px; }
}

@media (max-width: 420px) {
  .fields { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}

@media print { .topbar, nav.side, .tabs, .actions, form, .nextbar { display: none !important; } main { padding: 0; } .card { box-shadow: none; } .tabpane { display: block !important; } }
