/* Bijkantoor — calm, trustworthy workspace for accounting offices.
   Brand colours (--primary / --accent) come from the kantoor's settings, so every whitelabel looks like its own product. */
:root {
  --primary: #2f5d8a; --accent: #2f7d6d;
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #f7f8fa; --surface-3: #eef0f3;
  --line: #e3e6ea; --line-2: #d6dae0;
  --text: #1c2430; --muted: #5d6877; --faint: #6b7584;
  --ok: #1f8a5b; --warn: #c27a12; --danger: #c8443b; --info: #2f6fb0;
  --primary-soft: color-mix(in srgb, var(--primary) 9%, white);
  --primary-text: color-mix(in srgb, var(--primary) 85%, black);
  --r: 8px; --r-lg: 12px;
  --sh-1: 0 1px 2px rgba(20, 30, 45, .06);
  --sh-2: 0 1px 3px rgba(20, 30, 45, .07), 0 6px 20px rgba(20, 30, 45, .06);
  --sh-3: 0 12px 40px rgba(20, 30, 45, .18);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 600; }
code { font-size: 12.5px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; }
.ico, [data-i] { display: inline-flex; align-items: center; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- layout ---------- */
#app { display: flex; height: 100vh; height: 100dvh; }
#nav { width: 232px; flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; min-height: 64px; }
.brand img { max-height: 34px; max-width: 160px; }
.brand b { display: block; font-size: 14.5px; line-height: 1.2; }
.brand small { display: block; color: var(--faint); font-size: 11.5px; line-height: 1.3; }
.logo-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: white; display: grid; place-items: center; font-weight: 700; flex: none; }
.menu { padding: 4px 10px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; flex: 1; }
.menu .sec { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 14px 8px 4px; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--muted); font-weight: 500; text-decoration: none; }
.menu a:hover { background: var(--surface-2); color: var(--text); }
.menu a.active { background: var(--primary-soft); color: var(--primary-text); }
.menu a .count { margin-left: auto; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--muted); border-radius: 999px; padding: 0 7px; min-width: 20px; text-align: center; }
.menu a .count.hot { background: var(--primary); color: white; }
.nav-foot { padding: 10px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border-radius: 8px; text-align: left; }
.me:hover { background: var(--surface-2); }
.me b { display: block; font-size: 13px; } .me small { display: block; font-size: 11.5px; color: var(--faint); }
.avatar { width: 30px; height: 30px; border-radius: 50%; color: white; display: grid; place-items: center; font-size: 11.5px; font-weight: 650; flex: none; letter-spacing: .02em; }
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }

#main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#top { height: 60px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; height: 36px; color: var(--faint); }
.search:focus-within { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); background: white; }
.search input { border: 0; background: none; outline: none; flex: 1; font: inherit; color: var(--text); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
#view { flex: 1; overflow-y: auto; padding: 24px; }
.page { max-width: 1320px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head > div:first-child { flex: 1; min-width: 240px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 550; font-size: 13px; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: white; }
.btn.primary:hover { background: color-mix(in srgb, var(--primary) 88%, black); }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--danger); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: white; }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn.wide { width: 100%; justify-content: center; height: 40px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 32px; height: 32px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.inp { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 7px; background: white; font: inherit; color: var(--text); outline: none; }
textarea.inp { height: auto; padding: 9px 10px; resize: vertical; line-height: 1.5; }
.inp:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
select.inp { padding-right: 6px; }
.inp.sm { height: 30px; font-size: 13px; width: auto; }
label { display: block; font-size: 12.5px; font-weight: 550; color: var(--muted); }
label .inp { margin-top: 4px; }
.field { margin-bottom: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { padding: 5px 11px; border-radius: 6px; font-size: 12.5px; font-weight: 550; color: var(--muted); }
.seg button.on { background: white; color: var(--text); box-shadow: var(--sh-1); }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.card-head h2 { font-size: 14px; }
.card-head .sub { color: var(--faint); font-size: 12.5px; }
.card-body { padding: 0 16px 14px; }
.card-body.flush { padding: 0 0 6px; }
.empty { color: var(--faint); padding: 14px 16px; font-size: 13px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-top: 1px solid var(--line); min-height: 46px; }
.list-row:first-child { border-top: 0; }
.list-row.click { cursor: pointer; }
.list-row.click:hover { background: var(--surface-2); }
.list-row .main { flex: 1; min-width: 0; }
.list-row .main b { display: block; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .main small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.pill.ok { background: color-mix(in srgb, var(--ok) 13%, white); color: color-mix(in srgb, var(--ok) 80%, black); }
.pill.warn { background: color-mix(in srgb, var(--warn) 15%, white); color: color-mix(in srgb, var(--warn) 75%, black); }
.pill.danger { background: color-mix(in srgb, var(--danger) 12%, white); color: var(--danger); }
.pill.info { background: var(--primary-soft); color: var(--primary-text); }
.pill.demo { background: color-mix(in srgb, var(--warn) 15%, white); color: color-mix(in srgb, var(--warn) 75%, black); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 5px; font-size: 11px; font-weight: 650; color: white; letter-spacing: .02em; }
.bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: var(--primary); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { padding: 14px 16px; cursor: pointer; }
.kpi:hover { border-color: var(--line-2); }
.kpi small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi b { display: block; font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; color: var(--faint); }
.kpi.alert b { color: var(--danger); }
.dash { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dash .col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.funnel { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 0 16px 16px; }
.funnel a { display: block; padding: 10px; border-radius: 8px; background: var(--surface-2); text-decoration: none; color: var(--text); }
.funnel a:hover { background: var(--surface-3); }
.funnel b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.funnel small { color: var(--muted); font-size: 11.5px; }
.time { width: 52px; flex: none; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.due { font-size: 12px; font-weight: 600; white-space: nowrap; }
.due.late { color: var(--danger); } .due.soon { color: var(--warn); } .due.ok { color: var(--faint); }
.check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-2); flex: none; display: grid; place-items: center; }
.check:hover { border-color: var(--primary); }
.check.on { background: var(--ok); border-color: var(--ok); color: white; }
.sugg { display: flex; gap: 10px; padding: 11px 16px; border-top: 1px solid var(--line); }
.sugg:first-child { border-top: 0; }
.sugg .main { flex: 1; min-width: 0; }
.sugg .main b { font-weight: 550; }
.sugg .main p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.agent-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: white; flex: none; }
.agent-ico.lg { width: 40px; height: 40px; border-radius: 10px; }
.agent-ico svg.i { width: 15px; height: 15px; }
.agent-ico.lg svg.i { width: 20px; height: 20px; }

/* ---------- kanban ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.lane { background: var(--surface-3); border-radius: var(--r-lg); padding: 8px; min-height: 120px; }
.lane.over { outline: 2px dashed color-mix(in srgb, var(--primary) 50%, transparent); outline-offset: -2px; }
.lane-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 8px; font-weight: 600; font-size: 13px; }
.lane-head .n { color: var(--faint); font-weight: 500; }
.lane-head .sum { margin-left: auto; font-size: 11.5px; color: var(--faint); font-weight: 500; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; margin-bottom: 7px; box-shadow: var(--sh-1); cursor: grab; }
.kcard:hover { border-color: var(--line-2); }
.kcard.dragging { opacity: .5; }
.kcard b { display: block; font-weight: 550; font-size: 13px; line-height: 1.35; }
.kcard .meta { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.kcard .meta .spacer { flex: 1; }
.kcard.hi { border-left: 3px solid var(--danger); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }

/* ---------- client dossier ---------- */
.dossier-head { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; margin-bottom: 16px; }
.dossier-head .facts { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; }
.dossier-head .facts span small { display: block; color: var(--faint); font-size: 11.5px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { padding: 9px 13px; font-weight: 550; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--primary-text); border-color: var(--primary); }
.job-block { margin-bottom: 12px; }
.docs { padding: 0 16px 12px; }
.doc { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.doc:first-child { border-top: 0; }
.doc .main { flex: 1; }
.doc.ontvangen .main { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.stagebar { display: flex; gap: 3px; margin: 2px 16px 12px; }
.stagebar i { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-3); }
.stagebar i.on { background: var(--primary); }
.note { padding: 12px 16px; border-top: 1px solid var(--line); }
.note:first-child { border-top: 0; }
.note .who { font-size: 12px; color: var(--faint); margin-bottom: 3px; }
.figtable td.neg { color: var(--danger); }
.fig-flag { color: var(--warn); font-weight: 650; }

/* ---------- agenda ---------- */
.week { display: grid; grid-template-columns: 54px repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.week .dh { padding: 10px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); font-weight: 600; font-size: 13px; background: var(--surface-2); }
.week .dh small { display: block; font-weight: 500; color: var(--faint); font-size: 11.5px; }
.week .dh.today { color: var(--primary-text); }
.week .hours { position: relative; }
.week .hour { height: 48px; border-top: 1px solid var(--line); font-size: 11px; color: var(--faint); padding: 2px 6px; text-align: right; }
.week .daycol { position: relative; border-left: 1px solid var(--line); }
.week .daycol .slot { height: 48px; border-top: 1px solid var(--line); }
.ev { position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: 3px 6px; font-size: 11.5px; line-height: 1.3; overflow: hidden; color: var(--text); border-left: 3px solid; cursor: pointer; }
.ev b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev small { color: var(--muted); }
.nowline { position: absolute; left: 0; right: 0; border-top: 2px solid var(--danger); z-index: 2; }

/* ---------- inbox ---------- */
.split { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 16px; align-items: start; }
.mail-item { display: block; width: 100%; text-align: left; padding: 11px 14px; border-top: 1px solid var(--line); }
.mail-item:first-child { border-top: 0; }
.mail-item:hover { background: var(--surface-2); }
.mail-item.on { background: var(--primary-soft); }
.mail-item .top { display: flex; gap: 8px; align-items: baseline; }
.mail-item .top b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mail-item .top time { font-size: 11.5px; color: var(--faint); }
.mail-item .subj { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item .sum { font-size: 12px; color: var(--muted); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mail-item.nieuw .top b::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); margin-right: 6px; vertical-align: 1px; }
.mail-view { padding: 20px 22px; }
.mail-view pre { white-space: pre-wrap; font: inherit; margin: 16px 0; line-height: 1.6; }
.attach { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px; font-size: 12.5px; margin: 0 6px 6px 0; }
.draft-box { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); margin-bottom: 12px; }
.draft-box .dh { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.draft-box .reason { padding: 8px 16px; font-size: 12.5px; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.draft-box .db { padding: 12px 16px; }
.draft-box .db textarea { min-height: 220px; font-size: 13.5px; }
.draft-box .df { display: flex; gap: 8px; padding: 0 16px 14px; }

/* ---------- assistants ---------- */
.agents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.agent-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.agent-card .ah { display: flex; gap: 12px; align-items: center; }
.agent-card .ah b { display: block; font-size: 14.5px; }
.agent-card .ah small { color: var(--muted); font-size: 12.5px; }
.agent-card p { margin: 0; color: var(--muted); font-size: 13px; flex: 1; }
.agent-card .af { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--faint); }
.agent-card.off { opacity: .55; }
.console { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.run-out { padding: 18px 20px; min-height: 160px; }
.md h1, .md h2, .md h3 { margin: 14px 0 6px; font-size: 15px; } .md h1:first-child, .md h2:first-child, .md h3:first-child { margin-top: 0; }
.md p { margin: 0 0 9px; } .md ul, .md ol { margin: 0 0 9px; padding-left: 20px; } .md li { margin: 2px 0; }
.md table { border-collapse: collapse; margin: 8px 0; font-size: 12.5px; }
.md td, .md th { border: 1px solid var(--line); padding: 4px 8px; text-align: left; } .md th { background: var(--surface-2); }
.steps { padding: 4px 0; }
.stp { display: flex; gap: 8px; align-items: flex-start; padding: 5px 16px; font-size: 12.5px; color: var(--muted); }
.stp i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); margin-top: 7px; flex: none; }
.stp.actie i { background: var(--primary); } .stp.actie { color: var(--text); }
.stp.web i { background: var(--info); }
.working { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.working::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ask-box textarea { min-height: 90px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick button { border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; color: var(--muted); background: white; }
.quick button:hover { border-color: var(--primary); color: var(--primary-text); }

/* ---------- team ---------- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.person { padding: 16px; }
.person .ph { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.person .ph b { display: block; font-size: 15px; } .person .ph small { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stats div { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.stats b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; } .stats small { color: var(--muted); font-size: 11.5px; }

/* ---------- drawer / modal / toast / popovers ---------- */
#drawer { position: fixed; inset: 0; background: rgba(20, 28, 40, .28); z-index: 50; display: flex; justify-content: flex-end; }
.drawer-card { width: min(560px, 100%); height: 100%; background: var(--surface); box-shadow: var(--sh-3); overflow-y: auto; animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: .6; } }
.drawer-head { display: flex; gap: 12px; align-items: flex-start; padding: 18px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.drawer-head .t { flex: 1; } .drawer-head .t small { color: var(--muted); display: block; margin-top: 2px; }
.drawer-body { padding: 16px 20px 30px; }
#modal { position: fixed; inset: 0; background: rgba(20, 28, 40, .32); z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal-card { width: min(560px, 100%); max-height: 90vh; overflow-y: auto; background: var(--surface); border-radius: 14px; box-shadow: var(--sh-3); }
.modal-card .mh { padding: 18px 20px 6px; } .modal-card .mb { padding: 10px 20px; } .modal-card .mf { padding: 12px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #1f2937; color: white; padding: 10px 16px; border-radius: 9px; font-size: 13px; z-index: 80; box-shadow: var(--sh-3); max-width: 90vw; }
.pop { position: absolute; top: 40px; left: 0; right: 0; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--sh-3); z-index: 40; max-height: 420px; overflow-y: auto; padding: 4px; }
.pop button { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; padding: 8px 10px; border-radius: 7px; color: var(--text); }
.pop button:hover, .pop button.on { background: var(--surface-2); }
.pop button small { color: var(--faint); margin-left: auto; font-size: 11.5px; }
.pop .grp { font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px 2px; }

/* ---------- settings ---------- */
.set-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.set-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
.set-nav button { text-align: left; padding: 8px 10px; border-radius: 7px; color: var(--muted); font-weight: 550; }
.set-nav button.on { background: var(--primary-soft); color: var(--primary-text); }
.conn { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-top: 1px solid var(--line); }
.conn:first-child { border-top: 0; }
.conn .main { flex: 1; } .conn .main b { display: block; } .conn .main small { color: var(--muted); font-size: 12.5px; }
.swatch { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); padding: 0; }
.toggle { width: 38px; height: 22px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; transition: background .15s; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: var(--sh-1); transition: left .15s; }
.toggle.on { background: var(--ok); } .toggle.on::after { left: 19px; }
.callout { border-radius: 10px; padding: 12px 14px; background: var(--primary-soft); color: var(--primary-text); font-size: 13px; margin-bottom: 14px; }
.callout.warn { background: color-mix(in srgb, var(--warn) 12%, white); color: color-mix(in srgb, var(--warn) 70%, black); }

/* ---------- login ---------- */
.login-page { background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 12%, var(--bg)), var(--bg) 55%); }
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: min(420px, 100%); background: white; border-radius: 16px; box-shadow: var(--sh-2); padding: 28px; }
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.login-brand b { display: block; font-size: 16px; } .login-brand small { color: var(--faint); }
.login-brand img { max-height: 40px; }
.login-card h1 { font-size: 20px; margin-bottom: 16px; }
.login-card label { margin-bottom: 12px; }
.err { color: var(--danger); font-size: 13px; margin: 0 0 10px; }
.demo-users { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.demo-users p { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.demo-users button { display: flex; width: 100%; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; text-align: left; }
.demo-users button:hover { background: var(--surface-2); }
.demo-users small { color: var(--faint); }
.login-foot { color: var(--faint); font-size: 12.5px; margin-top: 16px; }

/* ---------- responsive ---------- */
.only-mobile { display: none; }
@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(3, 1fr); } .dash { grid-template-columns: 1fr; } .console { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  #nav { position: fixed; inset: 0 auto 0 0; z-index: 70; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--sh-3); }
  #nav.open { transform: none; }
  .only-mobile { display: grid; }
  #top { padding: 0 12px; gap: 8px; }
  #askBtn span:not([data-i]) { display: none; }
  #view { padding: 16px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .funnel { grid-template-columns: repeat(3, 1fr); }
  .split, .set-grid { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .demo { display: none; }
  .week { grid-template-columns: 40px repeat(5, minmax(90px, 1fr)); overflow-x: auto; }
}
