:root {
  color-scheme: light;
  --bg: #f6f6f3;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --sidebar: #16161a;
  --sidebar-ink: #c9c8c2;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --line: #e1e0d9;
  --line-strong: #c3c2b7;
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-soft: #e4eefb;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --good: #0ca30c;
  --good-ink: #006300;
  --good-soft: #e3f4e3;
  --warn: #fab219;
  --warn-ink: #8a5a00;
  --warn-soft: #fdf1d6;
  --bad: #d03b3b;
  --bad-ink: #b02a2a;
  --bad-soft: #fbe5e5;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.06);
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d0d; --surface: #1a1a19; --surface-2: #242422; --sidebar: #111110; --sidebar-ink: #a9a8a0;
    --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781; --line: #2c2c2a; --line-strong: #383835;
    --accent: #3987e5; --accent-soft: #1c2a3d; --series-1: #3987e5; --series-2: #d95926;
    --good-ink: #0ca30c; --good-soft: #15291a; --warn-ink: #fab219; --warn-soft: #2e2512; --bad-ink: #e66767; --bad-soft: #321b1b;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d; --surface: #1a1a19; --surface-2: #242422; --sidebar: #111110; --sidebar-ink: #a9a8a0;
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781; --line: #2c2c2a; --line-strong: #383835;
  --accent: #3987e5; --accent-soft: #1c2a3d; --series-1: #3987e5; --series-2: #d95926;
  --good-ink: #0ca30c; --good-soft: #15291a; --warn-ink: #fab219; --warn-soft: #2e2512; --bad-ink: #e66767; --bad-soft: #321b1b;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 224px; flex: none; background: var(--sidebar); color: var(--sidebar-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.nav { display: flex; flex-direction: column; padding: 0 10px 14px; flex: 1; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #6d6c66; padding: 14px 10px 6px; }
.nav a { color: var(--sidebar-ink); padding: 7px 10px; border-radius: 7px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.nav-spacer { flex: 1; min-height: 16px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.view { padding: 24px 28px 60px; max-width: 1400px; width: 100%; }
.menu-btn { display: none; }

.search { position: relative; flex: 1; max-width: 520px; }
.search input { width: 100%; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 420px; overflow-y: auto; padding: 6px; z-index: 30; }
.search-results .group { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px 4px; }
.search-results a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--ink); }
.search-results a:hover, .search-results a.focus { background: var(--surface-2); text-decoration: none; }
.search-results small { color: var(--muted); margin-left: 6px; }

.quick-add { position: relative; }
.timer { display: flex; align-items: center; gap: 6px; }
.topbar-spacer { flex: 1; }
.brand-logo { width: 170px; height: auto; display: block; }
.auth-logo { width: 220px; height: auto; display: block; }
.logo-on-dark { display: none; }
:root[data-theme="dark"] .logo-on-light { display: none; }
:root[data-theme="dark"] .logo-on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-on-light { display: none; }
  :root:not([data-theme="light"]) .logo-on-dark { display: block; }
}
body.no-time [data-time] { display: none !important; }
.hbar .fill.over { background: var(--bad); }
.hbar .fill.near { background: var(--warn); }
.drop-zone.dragging-over { outline: 2px dashed var(--accent); outline-offset: -6px; background: var(--accent-soft); }
.files-list { list-style: none; margin: 8px 0 0; padding: 0; }
.files-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.files-list li:last-child { border-bottom: 0; }
.budget-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) 110px 110px 110px auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.budget-row.head { font-size: 12px; font-weight: 600; color: var(--muted); padding-top: 0; }
.budget-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.budget-row .track { height: 10px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.budget-row .fill { height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }
.budget-row .fill.over { background: var(--bad); }
.budget-row .fill.near { background: var(--warn); }
@media (max-width: 820px) { .budget-row { grid-template-columns: minmax(0, 1fr) 90px 90px; } .budget-row .track, .budget-row .hide-sm { display: none; } }
.timer-run { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 4px 4px 10px; background: var(--surface); max-width: 340px; }
.timer-run .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: pulse 1.4s infinite; flex: none; }
.timer-run .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink-2); min-width: 0; }
.timer-run .clock { font-variant-numeric: tabular-nums; font-weight: 650; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .timer-run .dot { animation: none; } }

/* line items editor */
.items-editor table { width: 100%; border-collapse: collapse; }
.items-editor th { padding: 4px 6px; font-size: 11.5px; }
.items-editor td { padding: 4px 3px; border: 0; }
.items-editor input { width: 100%; padding: 6px 8px; }
.items-editor td.amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-right: 6px; color: var(--ink-2); }
.items-editor .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.items-editor .total { font-weight: 650; font-variant-numeric: tabular-nums; }
.logo-preview { max-height: 56px; max-width: 220px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; }
.preview-frame { width: 100%; height: 60vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; min-width: 190px; z-index: 30; display: flex; flex-direction: column; }
.menu button { text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; color: var(--ink); font: inherit; cursor: pointer; }
.menu button:hover { background: var(--surface-2); }

/* ---------- controls ---------- */
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; min-height: 80px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.btn { font: inherit; font-weight: 550; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 7px 13px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad-ink); }
.btn.small { padding: 4px 9px; font-size: 12.5px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.icon-btn { background: none; border: 0; font-size: 16px; cursor: pointer; color: var(--ink-2); padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--surface-2); }

/* ---------- page parts ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type="search"] { width: 240px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); padding: 4px 11px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink-2); }
.chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.stack > * + * { margin-top: 16px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.kpi .value { font-size: 24px; font-weight: 650; margin-top: 4px; letter-spacing: -.02em; }
.kpi .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi.alert .value { color: var(--bad-ink); }
a.kpi:hover { text-decoration: none; border-color: var(--line-strong); }
a.kpi { color: inherit; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card .table-wrap { border: 0; border-radius: 0; margin: 0 -18px -18px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface); white-space: nowrap; user-select: none; }
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--ink); }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.muted { color: var(--muted); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.empty { color: var(--muted); padding: 28px; text-align: center; }
.strike { text-decoration: line-through; color: var(--muted); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 550; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.plain::before { display: none; }
.badge.good { background: var(--good-soft); color: var(--good-ink); }
.badge.warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge.bad { background: var(--bad-soft); color: var(--bad-ink); }
.badge.info { background: var(--accent-soft); color: var(--accent); }
.due { font-size: 12.5px; white-space: nowrap; }
.due.overdue { color: var(--bad-ink); font-weight: 600; }
.due.soon { color: var(--warn-ink); font-weight: 600; }
.pri-high { color: var(--bad-ink); font-weight: 600; font-size: 12px; }

/* ---------- pipeline ---------- */
.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.column { background: var(--surface-2); border-radius: var(--radius); padding: 10px; min-height: 200px; }
.column.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.column-head { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 10px; }
.column-head strong { font-size: 13px; }
.column-head span { color: var(--muted); font-size: 12px; }
.deal { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; }
.deal:hover { border-color: var(--line-strong); }
.deal.dragging { opacity: .5; }
.deal .name { font-weight: 600; }
.deal .meta { color: var(--muted); font-size: 12px; margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.deal .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; }

/* ---------- client detail ---------- */
.stepper { display: flex; gap: 4px; margin: 4px 0 20px; flex-wrap: wrap; }
.step { flex: 1; min-width: 110px; border: 0; background: var(--surface-2); color: var(--ink-2); padding: 9px 12px; font: inherit; font-weight: 550; cursor: pointer; text-align: left; border-radius: 6px; }
.step:hover { filter: brightness(.97); }
.step.done { background: var(--accent-soft); color: var(--accent); }
.step.current { background: var(--accent); color: #fff; }
.step small { display: block; font-weight: 400; opacity: .8; font-size: 11.5px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 14px; font: inherit; font-weight: 550; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tab.on { color: var(--ink); border-bottom-color: var(--ink); }
.tab .count { color: var(--muted); font-weight: 400; margin-left: 4px; }
dl.facts { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--muted); font-size: 12px; white-space: nowrap; min-width: 82px; }
.timeline .what { white-space: pre-wrap; overflow-wrap: anywhere; }
.note-form { display: flex; gap: 8px; margin-bottom: 10px; }
.note-form select { width: 110px; }
.note-form input { flex: 1; }

/* ---------- task list ---------- */
.tasklist { list-style: none; margin: 0; padding: 0; }
.tasklist li { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.tasklist li:last-child { border-bottom: 0; }
.tasklist .t-main { flex: 1; min-width: 0; cursor: pointer; }
.tasklist .t-title { font-weight: 500; }
.tasklist .t-sub { color: var(--muted); font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.group-title { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 6px; }
.group-title:first-child { margin-top: 0; }
.group-title span { color: var(--muted); font-size: 12px; }
.type-icon { width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 12px; flex: none; background: var(--surface-2); color: var(--ink-2); }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.calendar .dow { background: var(--surface); padding: 6px 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.calendar .day { background: var(--surface); min-height: 104px; padding: 6px; font-size: 12px; }
.calendar .day.other { background: var(--surface-2); color: var(--muted); }
.calendar .day.today .num { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 6px; }
.calendar .num { font-weight: 600; display: inline-block; margin-bottom: 4px; }
.calendar .ev { display: block; padding: 2px 6px; border-radius: 4px; margin-bottom: 2px; background: var(--accent-soft); color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.calendar .ev.overdue { background: var(--bad-soft); color: var(--bad-ink); }
.calendar .ev.done { opacity: .5; text-decoration: line-through; }

/* ---------- charts ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .s1 { fill: var(--series-1); }
.chart .s2 { fill: var(--series-2); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover { fill: var(--ink); fill-opacity: .04; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: 130px 1fr 90px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.hbar .track { height: 10px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.tooltip { position: fixed; z-index: 60; background: var(--ink); color: var(--surface); padding: 8px 10px; border-radius: 8px; font-size: 12px; pointer-events: none; box-shadow: var(--shadow); line-height: 1.5; }
.tooltip b { font-variant-numeric: tabular-nums; }

/* ---------- modal & toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10,10,12,.45); display: grid; place-items: start center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 620px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.confirm-backdrop { z-index: 70; place-items: center; }
.confirm-box { max-width: 440px; }
.confirm-msg { white-space: pre-line; margin: 0 0 16px; line-height: 1.5; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px 20px 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.field.check { flex-direction: row; align-items: center; gap: 8px; padding-top: 22px; }
.form-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; gap: 8px; }
.form-foot .right { display: flex; gap: 8px; margin-left: auto; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); z-index: 70; font-weight: 500; }
.toast.error { background: var(--bad); color: #fff; }

.alert-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.alert-row:last-child { border-bottom: 0; }
.alert-row .info { min-width: 0; }
.alert-row .info div:last-child { color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.mt { margin-top: 16px; }

/* ---------- sign-in ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px 28px; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; letter-spacing: -.02em; margin-bottom: 26px; }
.auth-card h1 { font-size: 22px; }
.auth-card p.muted { margin: 4px 0 20px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card form[hidden] { display: none; }
.auth-card .field small { font-size: 12px; }
.remember { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; }
.btn.block { width: 100%; padding: 10px; margin-top: 4px; }
.btn:disabled { opacity: .6; cursor: default; }
.auth-error { background: var(--bad-soft); color: var(--bad-ink); padding: 9px 12px; border-radius: 8px; font-size: 13px; }
.auth-help { color: var(--muted); font-size: 12.5px; margin: 4px 0 0; text-align: center; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

.intake-card { max-width: 640px; }
.intake-logo { max-height: 48px; max-width: 220px; object-fit: contain; }
fieldset.services { border: 0; padding: 0; margin: 0; }
fieldset.services legend { font-size: 12.5px; font-weight: 550; color: var(--ink-2); padding: 0; margin-bottom: 6px; }
#services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 560px) { #services { grid-template-columns: minmax(0, 1fr); } .intake-card { padding: 24px 18px; } }

.user-box { padding: 12px 18px 16px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #2c2c2a; color: #fff; display: grid; place-items: center; font-weight: 650; font-size: 12px; flex: none; }
.user-box .who { min-width: 0; flex: 1; }
.user-box .who div { color: #fff; font-weight: 550; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-box .who button { background: none; border: 0; padding: 0; color: var(--sidebar-ink); font: inherit; font-size: 12px; cursor: pointer; }
.user-box .who button:hover { color: #fff; text-decoration: underline; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid.side, .grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .menu-btn { display: inline-block; }
  .topbar { padding: 10px 16px; }
  .view { padding: 18px 16px 60px; }
  .grid.cols-2, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 12px; }
  .kpi .value { font-size: 19px; }
  .board { grid-template-columns: repeat(5, 260px); }
  .calendar .day { min-height: 64px; }
  .calendar .ev { font-size: 0; height: 6px; padding: 0; }
  .hbar { grid-template-columns: 90px 1fr 70px; }
  .timer-run .who { display: none; }
  .timer .btn-label { display: none; }
}
@media print {
  .sidebar, .topbar, .actions, .toolbar { display: none !important; }
  .view { padding: 0; }
}
