/* Velora CRM — one system for owner and callers. Mona Sans, the Velora triangle as the status marker, quiet surfaces. */
@font-face { font-family: 'Mona Sans'; src: url(fonts/mona-sans-latin-normal-3.woff2) format('woff2'); font-weight: 200 900; font-stretch: 75% 125%; font-display: swap; }
@font-face { font-family: 'Mona Sans'; src: url(fonts/mona-sans-latin-ext-normal-2.woff2) format('woff2'); font-weight: 200 900; font-stretch: 75% 125%; font-display: swap; unicode-range: U+0100-024F; }

:root {
  --bg: #f6f5f2; --panel: #fff; --panel-2: #fbfaf8; --ink: #17161b; --ink-2: #47454f; --muted: #77747f; --line: #e8e5df; --line-2: #d8d4cc;
  --accent: #602eb4; --accent-ink: #4c2393; --accent-soft: #f1ebfb; --on-accent: #fff; --focus: #602eb4;
  --t-neutral: #77747f; --t-muted: #a8a5ad; --t-amber: #a3610c; --t-accent: #602eb4; --t-teal: #0f6b5f; --t-green: #2f6d43; --t-red: #b0281c;
  --s-amber: #fbf1dc; --s-teal: #e0f0ec; --s-green: #e3f0e6; --s-red: #fbe4e1;
  --shadow: 0 1px 0 rgba(23, 22, 27, .04), 0 8px 24px -12px rgba(23, 22, 27, .18);
  --r: 6px; --rail: 224px; --bar: 132px;
  --f: 'Mona Sans', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111014; --panel: #18171c; --panel-2: #1c1b21; --ink: #ecebe7; --ink-2: #c4c1ca; --muted: #8e8a97; --line: #26252c; --line-2: #34323b;
    --accent: #a98bf0; --accent-ink: #c6b3f7; --accent-soft: #261e38; --on-accent: #120d1d; --focus: #b49af2;
    --t-neutral: #9a97a3; --t-muted: #6c6974; --t-amber: #e2aa4f; --t-accent: #b49af2; --t-teal: #5cc2b0; --t-green: #79c48f; --t-red: #f0816f;
    --s-amber: #2e2414; --s-teal: #12292a; --s-green: #142718; --s-red: #321714;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111014; --panel: #18171c; --panel-2: #1c1b21; --ink: #ecebe7; --ink-2: #c4c1ca; --muted: #8e8a97; --line: #26252c; --line-2: #34323b;
  --accent: #a98bf0; --accent-ink: #c6b3f7; --accent-soft: #261e38; --on-accent: #120d1d; --focus: #b49af2;
  --t-neutral: #9a97a3; --t-muted: #6c6974; --t-amber: #e2aa4f; --t-accent: #b49af2; --t-teal: #5cc2b0; --t-green: #79c48f; --t-red: #f0816f;
  --s-amber: #2e2414; --s-teal: #12292a; --s-green: #142718; --s-red: #321714;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.5 var(--f); font-feature-settings: 'tnum' 0; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num, td.num, .tab { font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ── shell ─────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100dvh; }
.rail { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 18px 12px 14px; border-right: 1px solid var(--line); background: var(--panel); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; text-decoration: none; }
.mark { display: inline-block; width: 22px; height: 20px; background: currentColor; -webkit-mask: url(mark.svg) center / contain no-repeat; mask: url(mark.svg) center / contain no-repeat; }
.brand b { font-weight: 700; letter-spacing: .26em; font-size: 12.5px; }
.brand small { display: block; font-size: 10px; letter-spacing: .2em; color: var(--muted); margin-top: 1px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: var(--r); text-decoration: none; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--panel-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.nav a .n { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav a[aria-current="page"] .n { color: var(--accent-ink); }
.nav .sep { height: 1px; background: var(--line); margin: 10px 10px; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 10px; border-top: 1px solid var(--line); font-size: 12.5px; }
.rail-foot .who { font-weight: 600; }
.rail-foot .row { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-size: 12.5px; }
.linkbtn:hover { color: var(--ink); }
.main { min-width: 0; padding: 22px 28px 40px; }
.main.has-bar { padding-bottom: calc(var(--bar) + 30px); }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.pagehead h1 { font-size: 22px; font-weight: 650; font-stretch: 105%; }
.pagehead p { margin: 4px 0 0; color: var(--muted); }
.flash { padding: 10px 14px; border-radius: var(--r); margin-bottom: 14px; border: 1px solid var(--line); background: var(--panel); }
.flash.ok { border-color: color-mix(in srgb, var(--t-green) 40%, var(--line)); }
.flash.error { border-color: color-mix(in srgb, var(--t-red) 50%, var(--line)); color: var(--t-red); }

/* ── controls ──────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); font-weight: 550; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .08s; }
.btn:hover { background: var(--panel-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--accent)); }
.btn.accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .5; cursor: progress; }
.btn .k { font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; line-height: 16px; }
.btn.primary .k { color: inherit; border-color: color-mix(in srgb, var(--panel) 40%, transparent); }
input[type=text], input[type=email], input[type=tel], input[type=search], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=url], select, textarea {
  height: 34px; padding: 0 10px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--panel); min-width: 0; width: 100%;
}
textarea { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
label.f > span b { color: var(--ink); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.check input { margin-top: 3px; accent-color: var(--accent); }

/* ── surfaces ─────────────────────────────────────────────────────── */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.card > .hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 10px; }
.card > .hd h2 { font-size: 13px; font-weight: 650; letter-spacing: .02em; }
.card > .hd .muted { font-size: 12px; }
.card > .bd { padding: 4px 16px 16px; }
.cards { display: grid; gap: 14px; }
.lab { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* status: the Velora triangle as marker, label always present */
.st { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 12.5px; color: var(--ink-2); }
.st::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: var(--tone, var(--t-neutral)); flex: none; }
.st[data-tone=muted] { --tone: var(--t-muted); color: var(--muted); }
.st[data-tone=amber] { --tone: var(--t-amber); }
.st[data-tone=accent] { --tone: var(--t-accent); color: var(--accent-ink); font-weight: 600; }
.st[data-tone=teal] { --tone: var(--t-teal); color: var(--t-teal); font-weight: 600; }
.st[data-tone=green] { --tone: var(--t-green); color: var(--t-green); font-weight: 600; }
.st[data-tone=red] { --tone: var(--t-red); color: var(--t-red); }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }

/* ── views / tabs ─────────────────────────────────────────────────── */
.views { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.views a { padding: 9px 12px; text-decoration: none; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.views a:hover { color: var(--ink); }
.views a[aria-current="page"] { color: var(--ink); border-color: var(--ink); }
.views a .n { font-size: 11.5px; margin-left: 5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar .search { flex: 1 1 260px; max-width: 380px; position: relative; }
.toolbar .search input { padding-left: 30px; }
.toolbar .search::before { content: ''; position: absolute; left: 10px; top: 10px; width: 11px; height: 11px; border: 1.6px solid var(--muted); border-radius: 50%; }
.toolbar .search::after { content: ''; position: absolute; left: 20px; top: 21px; width: 5px; height: 1.6px; background: var(--muted); transform: rotate(45deg); }
.toolbar select { width: auto; }

/* ── the sheet ────────────────────────────────────────────────────── */
.sheet-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: auto; max-height: calc(100dvh - 250px); }
.has-bar .sheet-wrap { max-height: calc(100dvh - 250px - var(--bar)); }
table.sheet { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; font-stretch: 96%; }
.sheet th { position: sticky; top: 0; z-index: 2; background: var(--panel-2); text-align: left; font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; font-stretch: 100%; }
.sheet td { padding: 0 12px; height: 42px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.sheet tr:last-child td { border-bottom: 0; }
.sheet tbody tr { cursor: pointer; transition: background .08s; }
.sheet tbody tr:hover td { background: var(--panel-2); }
.sheet tbody tr[aria-selected="true"] td { background: var(--accent-soft); }
.sheet tbody tr[aria-selected="true"] td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.sheet tbody tr.done td { color: var(--muted); }
.sheet .co b { font-weight: 600; color: var(--ink); }
.sheet .co small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.sheet .co { line-height: 1.25; padding-top: 4px; padding-bottom: 4px; }
.sheet .ph { font-variant-numeric: tabular-nums; font-weight: 550; font-stretch: 100%; letter-spacing: .01em; }
.sheet .note { color: var(--muted); max-width: 260px; }
.sheet td.cb { width: 34px; padding-right: 0; }
.sheet .due { color: var(--t-amber); font-weight: 600; }
.copy { border: 1px solid transparent; background: none; padding: 3px 6px; border-radius: 4px; cursor: pointer; color: var(--muted); font-size: 11.5px; margin-left: 4px; }
.copy:hover { border-color: var(--line-2); color: var(--ink); }
.copy.ok { color: var(--t-green); }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; font-size: 12.5px; color: var(--muted); }

/* ── drawer (lead card) ───────────────────────────────────────────── */
.drawer { position: fixed; top: 0; right: 0; bottom: var(--bar); width: min(520px, 100vw); background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow); transform: translateX(105%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); z-index: 30; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer .dh { padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.drawer .dh h2 { font-size: 19px; font-weight: 650; font-stretch: 104%; }
.drawer .dh .meta { margin-top: 4px; color: var(--muted); font-size: 12.5px; display: flex; gap: 10px; flex-wrap: wrap; }
.drawer .dh .x { position: absolute; top: 14px; right: 14px; }
.drawer .tabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.drawer .tabs button { background: none; border: 0; padding: 10px 10px; font-weight: 550; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; margin-bottom: -1px; }
.drawer .tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--ink); }
.drawer .db { overflow: auto; padding: 16px 20px 24px; flex: 1; }
.why { padding: 12px 14px; border-radius: var(--r); background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 14px; }
.why .lab { margin-bottom: 4px; }
.say { padding: 14px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--r) var(--r) 0; margin: 0 0 14px; font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.say .lab { color: var(--accent-ink); margin-bottom: 6px; }
details.obj { border-top: 1px solid var(--line); }
details.obj summary { padding: 10px 0; cursor: pointer; font-weight: 550; list-style: none; display: flex; justify-content: space-between; }
details.obj summary::after { content: '+'; color: var(--muted); }
details.obj[open] summary::after { content: '−'; }
details.obj p { margin: 0 0 12px; color: var(--ink-2); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.timeline li .when { color: var(--muted); font-size: 12px; }
.fields { display: grid; gap: 10px; margin-bottom: 16px; }

/* ── call bar: the signature ──────────────────────────────────────── */
.callbar { position: fixed; left: var(--rail); right: 0; bottom: 0; height: var(--bar); z-index: 40; background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -12px 30px -22px rgba(0, 0, 0, .35); display: grid; grid-template-columns: minmax(250px, 340px) 1fr; }
.callbar .who { padding: 14px 20px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.callbar .who .co { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.callbar .who .phone { font-size: 27px; font-weight: 640; font-stretch: 112%; letter-spacing: .01em; font-variant-numeric: tabular-nums; line-height: 1.15; margin: 3px 0 7px; color: var(--ink); }
.callbar .who .acts { display: flex; gap: 6px; }
.callbar .out { padding: 12px 18px; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.keys { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.key { position: relative; height: 40px; font-size: 12px !important; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: var(--r); background: var(--panel); cursor: pointer; font-weight: 550; font-size: 12.5px; padding: 0 6px 0 22px; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; transition: background .12s, border-color .12s, transform .06s; }
.key::before { content: attr(data-key); position: absolute; left: 7px; top: 50%; transform: translateY(-50%); font-size: 10.5px; color: var(--muted); font-weight: 600; }
.key:hover { border-color: var(--muted); }
.key:active { transform: translateY(1px); }
.key[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.key[aria-pressed="true"]::before { color: inherit; opacity: .7; }
.key[data-tone=red] { color: var(--t-red); }
.key[data-tone=red][aria-pressed="true"] { background: var(--t-red); color: #fff; border-color: var(--t-red); }
.callbar .row2 { display: flex; gap: 8px; align-items: center; }
.callbar .row2 input[type=text] { flex: 1; }
.callbar .row2 input[type=datetime-local] { width: 210px; flex: none; }
.callbar .row2 input[hidden] { display: none; }
.callbar.idle .who, .callbar.idle .out { opacity: .45; pointer-events: none; }
.toast { position: fixed; left: 50%; bottom: calc(var(--bar) + 16px); transform: translateX(-50%) translateY(10px); opacity: 0; background: var(--ink); color: var(--panel); padding: 9px 14px; border-radius: var(--r); font-size: 13px; transition: opacity .18s, transform .18s; z-index: 60; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--t-red); color: #fff; }

/* ── modal (mail composer) ─────────────────────────────────────────── */
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 0; background: var(--panel); color: var(--ink); width: min(1040px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10, 9, 14, .45); }
.compose { display: grid; grid-template-columns: 340px 1fr; min-height: 560px; }
.compose .side { padding: 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.compose .side h2 { font-size: 16px; font-weight: 650; }
.compose .prev { display: flex; flex-direction: column; min-width: 0; background: var(--panel-2); }
.compose .prev .bar { display: flex; gap: 6px; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.compose .prev .hdrs { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; display: grid; grid-template-columns: 74px 1fr; gap: 3px 10px; }
.compose .prev .hdrs span { color: var(--muted); }
.compose iframe { flex: 1; width: 100%; border: 0; background: #fff; min-height: 380px; }
.compose iframe.mobile { width: 390px; margin: 12px auto; border: 1px solid var(--line); border-radius: 18px; flex: none; height: 600px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 5px 10px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--panel); }
.tpl { display: flex; flex-direction: column; gap: 4px; }
.tpl label { display: flex; gap: 9px; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; font-size: 13px; align-items: flex-start; }
.tpl label:hover { border-color: var(--line-2); }
.tpl input { accent-color: var(--accent); margin-top: 3px; }
.tpl label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* ── dashboard ────────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; }
.kpi { padding: 16px 18px 14px; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi .v { font-size: 30px; font-weight: 640; font-stretch: 108%; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 6px; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 3px; }
.dash { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; align-items: start; }
.attention { list-style: none; margin: 0; padding: 0; }
.attention li { border-top: 1px solid var(--line); }
.attention li:first-child { border-top: 0; }
.attention a { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; text-decoration: none; font-weight: 550; }
.attention a::after { content: '→'; color: var(--muted); }
.attention a:hover { color: var(--accent-ink); }
.funnel { display: grid; gap: 6px; }
.funnel .step { display: grid; grid-template-columns: 150px 1fr 120px; gap: 12px; align-items: center; font-size: 13px; }
.funnel .track { height: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.funnel .track i { display: block; height: 100%; background: var(--ink); }
.funnel .step:nth-child(n+3) .track i { background: var(--accent); }
.funnel .rate { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.funnel .rate b { color: var(--ink); font-weight: 650; margin-right: 6px; }
table.plain { width: 100%; border-collapse: collapse; font-size: 13px; }
table.plain th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 6px 10px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.plain td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.plain tr:last-child td { border-bottom: 0; }
table.plain td.num, table.plain th.num { text-align: right; }
table.plain a { text-decoration: none; font-weight: 550; }
table.plain a:hover { color: var(--accent-ink); }
.chart { width: 100%; height: 150px; display: block; }
.chart .b0 { fill: var(--line-2); }
.chart .b1 { fill: var(--accent); }
.chart text { fill: var(--muted); font-size: 10px; font-family: var(--f); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.money { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
.money > div { padding: 10px 0; border-top: 1px solid var(--line); }
.money .v { font-size: 18px; font-weight: 640; font-variant-numeric: tabular-nums; }
.assume { font-size: 12px; color: var(--muted); margin-top: 8px; }
.bar-h { height: 6px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; margin-top: 6px; }
.bar-h i { display: block; height: 100%; background: var(--accent); }

/* ── pipeline board ───────────────────────────────────────────────── */
.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.col { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; min-height: 200px; }
.col h3 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; padding: 2px 4px 10px; }
.opp { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; text-decoration: none; }
.opp:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.opp b { display: block; font-weight: 600; font-size: 13px; }
.opp small { color: var(--muted); font-size: 12px; }

/* ── editor (quote / invoice) ─────────────────────────────────────── */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
table.items { width: 100%; border-collapse: collapse; }
table.items th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 0 6px 8px; font-weight: 600; }
table.items td { padding: 4px 6px; vertical-align: top; }
table.items td input, table.items td select { height: 32px; }
table.items .amt { text-align: right; padding-top: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-variant-numeric: tabular-nums; }
.totals .grand { font-size: 20px; font-weight: 650; padding-top: 8px; border-top: 1px solid var(--ink); }
.vatbox { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: var(--panel-2); }
.vatbox .why { background: var(--panel); }
.warn { color: var(--t-amber); font-size: 12.5px; margin: 6px 0 0; }
.locked { padding: 10px 12px; border-radius: var(--r); background: var(--s-green); color: var(--t-green); font-size: 13px; }

/* ── login ────────────────────────────────────────────────────────── */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login .art { background: #131418; color: #f2f0ea; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login .art .big { position: absolute; right: -14%; bottom: -12%; width: 82%; aspect-ratio: 1.075; background: #f2f0ea; opacity: .06; -webkit-mask: url(mark.svg) center / contain no-repeat; mask: url(mark.svg) center / contain no-repeat; }
.login .art h1 { font-size: clamp(30px, 3.4vw, 48px); font-weight: 650; font-stretch: 108%; line-height: 1.05; max-width: 12ch; letter-spacing: -.02em; }
.login .art p { color: #a9a69e; max-width: 36ch; }
.login form { align-self: center; justify-self: center; width: min(380px, calc(100% - 48px)); display: flex; flex-direction: column; gap: 14px; }
.login form h2 { font-size: 22px; font-weight: 650; }
.login .err { color: var(--t-red); font-size: 13px; }

/* ── mobile ───────────────────────────────────────────────────────── */
.tabbar { display: none; }
@media (max-width: 1100px) { :root { --rail: 72px; } .brand b, .brand small, .nav a .label, .nav a .n, .rail-foot .who, .rail-foot .row span { display: none; } .nav a { justify-content: center; } .nav a .ab { display: inline; } .rail-foot { align-items: center; } }
.nav a .ab { display: none; font-weight: 700; font-size: 12px; }
@media (max-width: 1100px) { .nav a .ab { display: inline; } }
@media (max-width: 760px) {
  :root { --bar: 0px; }
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  .main { padding: 14px 14px 90px; }
  .main.has-bar { padding-bottom: 260px; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; background: var(--panel); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; text-decoration: none; color: var(--muted); padding: 4px 8px; min-width: 56px; }
  .tabbar a[aria-current="page"] { color: var(--accent-ink); font-weight: 600; }
  .tabbar a .ab { font-weight: 700; font-size: 14px; }
  .kpis { grid-template-columns: 1fr 1fr; } .kpi:nth-child(2) { border-right: 0; } .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .dash, .editor, .grid2, .grid3, .compose, .login { grid-template-columns: 1fr; }
  .login .art { min-height: 220px; padding: 28px; }
  .compose .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .funnel .step { grid-template-columns: 110px 1fr 90px; }
  .sheet-wrap { max-height: none; border: 0; background: none; overflow: visible; }
  table.sheet thead { display: none; }
  table.sheet, table.sheet tbody, table.sheet tr, table.sheet td { display: block; }
  table.sheet tr { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; padding: 10px 12px; }
  table.sheet td { height: auto; border: 0; padding: 2px 0; max-width: none; white-space: normal; }
  table.sheet td.hide-m { display: none; }
  .sheet tbody tr[aria-selected="true"] td:first-child { box-shadow: none; }
  .sheet tbody tr[aria-selected="true"] { border-color: var(--accent); }
  .callbar { left: 0; bottom: calc(58px + env(safe-area-inset-bottom)); height: auto; grid-template-columns: 1fr; }
  .callbar .who { border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; }
  .callbar .who .phone { font-size: 22px; }
  .keys { grid-template-columns: repeat(4, 1fr); }
  .callbar .row2 { flex-wrap: wrap; }
  .callbar .row2 input[type=datetime-local] { width: 100%; }
  .drawer { bottom: 0; top: 0; width: 100vw; z-index: 50; }
  .board { grid-template-columns: repeat(5, 82vw); }
  .toast { bottom: 300px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
