/* Standaard donker (grafiet/zwart met DIN-magenta); licht via data-theme="light". */
:root {
  --bg: #0d0d0f;
  --surface: #17171a;
  --surface-2: #222226;
  --text: #ececee;
  --muted: #9b9ba3;
  --line: #2b2b30;
  --brand: #F0479B;
  --brand-2: #FF7DBD;
  --brand-ink: #160811;
  --accent: #F0479B;
  --danger: #ff8a80;
  --ok: #86d6a0;
  --warn-bg: #2f2710;
  --warn-ink: #f0cf7a;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%);
  --tabbar-h: 64px;
  --k-weinig-bg: #45201d; --k-weinig-ink: #ffb4ab;
  --k-normaal-bg: #1d3325; --k-normaal-ink: #9fe0b5;
  --k-veel-bg: #1e2a3d; --k-veel-ink: #a9c8f5;
  --deal-bg: #352c16; --deal-ink: #efd08a;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f4f3;
  --surface: #ffffff;
  --surface-2: #ececea;
  --text: #161618;
  --muted: #5f5f67;
  --line: #dcdcdf;
  --brand: #17171a;
  --brand-2: #B4036E;
  --brand-ink: #ffffff;
  --accent: #B4036E;
  --danger: #b3261e;
  --ok: #1e7b45;
  --warn-bg: #fff4d6;
  --warn-ink: #6e5100;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 4px 16px rgb(0 0 0 / 5%);
  --k-weinig-bg: #fde2e0; --k-weinig-ink: #8a1c14;
  --k-normaal-bg: #dcf1e4; --k-normaal-ink: #145a32;
  --k-veel-bg: #e1ecfb; --k-veel-ink: #174a8b;
  --deal-bg: #f5ecd6; --deal-ink: #6d5212;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 1rem/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
}
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 1.45rem; margin: 8px 0 12px; }
h1 small { display: block; font-size: .9rem; font-weight: 400; color: var(--muted); }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 6px; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 6px; font-size: .85em; word-break: break-all; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); }
.sync-chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 5px 12px; font-size: .8rem; cursor: pointer;
}
.theme-btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; width: 34px; height: 34px; cursor: pointer; font-size: 1rem; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.sync-chip.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }

main { max-width: 900px; margin: 0 auto; padding: 8px 16px; outline: none; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .72rem; color: var(--muted); min-width: 0; white-space: nowrap; letter-spacing: -.01em; }
@media (max-width: 400px) { .tabbar a { font-size: .62rem; letter-spacing: -.02em; } }
@media (max-width: 370px) { .tabbar a { font-size: .56rem; letter-spacing: -.03em; } }
@media (max-width: 340px) { .tabbar a { font-size: .5rem; } }
.tabbar a span { font-size: 1.25rem; filter: grayscale(1); opacity: .75; }
.tabbar a.on { color: var(--brand); font-weight: 600; }
.tabbar a.on span { filter: none; opacity: 1; }

.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line); padding: 16px; margin: 12px 0;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card-head h1, .card-head h2 { margin: 0; }
.empty { text-align: center; padding: 32px 16px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.sub { display: block; color: var(--muted); font-size: .85rem; font-weight: 400; }
.grow { flex: 1; min-width: 0; }
.late { color: var(--danger); }
.back { display: inline-block; margin: 6px 0; font-size: .95rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--brand-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.ok { color: var(--ok); }
.btn.small { min-height: 34px; padding: 4px 10px; font-size: .85rem; }
.btn:disabled { opacity: .5; }
.icon { border: 0; background: none; color: var(--muted); font-size: 1.1rem; padding: 8px; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.actions.left { justify-content: flex-start; }

.fab {
  position: fixed; right: 20px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink); font-size: 1.8rem; box-shadow: 0 6px 20px rgb(0 0 0 / 25%);
}

.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.k-weinig { background: var(--k-weinig-bg); color: var(--k-weinig-ink); }
.badge.k-normaal { background: var(--k-normaal-bg); color: var(--k-normaal-ink); }
.badge.k-veel { background: var(--k-veel-bg); color: var(--k-veel-ink); }
.badge.deal { background: var(--deal-bg); color: var(--deal-ink); }

.alert { display: block; background: var(--warn-bg); color: var(--warn-ink); padding: 12px 14px; border-radius: 12px; margin: 12px 0; }

/* KPI's */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); position: relative; overflow: hidden; min-width: 0; }
.kpi span { display: block; font-size: .78rem; color: var(--muted); }
.kpi b { display: block; font-size: 1.25rem; margin-top: 2px; overflow-wrap: anywhere; }
.kpi b small, .kpi > small { font-size: .78rem; color: var(--muted); font-weight: 400; }
.kpi i { position: absolute; left: 0; bottom: 0; height: 4px; width: var(--p); background: var(--brand-2); }

/* lijsten */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 8px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list li > a, .list li > div { flex: 1; min-width: 0; color: var(--text); }
.list li > a.btn { flex: none; }
.list b { font-weight: 600; }
.list.compact li { padding: 9px 2px; }
.list li.clickable { cursor: pointer; }
#klantList { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 12px; }

.searchbar { display: flex; gap: 8px; margin: 8px 0; }
.searchbar input { flex: 1; min-width: 0; }
.searchbar select { width: auto; flex: none; max-width: 40%; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .85rem; white-space: nowrap; cursor: pointer; }
.chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.sector-filter { width: 100%; margin-bottom: 4px; }

/* formulieren */
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-2); outline-offset: 0; border-color: transparent; }
label { display: block; font-size: .85rem; color: var(--muted); margin: 10px 0 0; }
label > input, label > select, label > textarea { margin-top: 4px; }
label.inline { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 1rem; }
label.inline input { width: auto; min-height: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 420px) { .row3 { grid-template-columns: 1fr 1fr; } }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 12px 0; padding: 4px 12px 12px; }
legend { padding: 0 4px; }
.calc .advies { background: var(--surface-2); padding: 10px; border-radius: 10px; margin: 10px 0 0; }

.chips-radio { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips-radio label { margin: 0; }
.chips-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips-radio span { display: inline-block; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); font-size: .85rem; cursor: pointer; }
.chips-radio input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.chips-radio input:focus-visible + span { outline: 2px solid var(--brand-2); }

/* klantkaart */
.hero h1 { margin: 0; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 14px 0; }
.details { display: grid; grid-template-columns: 100px 1fr; gap: 6px 12px; margin: 0; }
.details dt { color: var(--muted); font-size: .85rem; }
.details dd { margin: 0; overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.timeline time { color: var(--muted); font-size: .82rem; }

/* activiteiten */
.acts { list-style: none; margin: 0; padding: 0; }
.act { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.act:last-child { border-bottom: 0; }
.check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--brand-2); background: transparent; cursor: pointer; flex: none; }
.check:hover { background: var(--brand-2); }
.act.late .t { color: var(--danger); }
.late-h { color: var(--danger); }

/* route */
.route { list-style: none; margin: 0; padding: 0; }
.route li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-left: 3px solid var(--brand-2); padding-left: 12px; margin-left: 4px; }
.route li.depot { border-left-style: dotted; color: var(--muted); }
.route li.done { opacity: .6; }
.route time { font-weight: 700; min-width: 48px; font-variant-numeric: tabular-nums; }
.route time small { display: block; font-weight: 400; color: var(--muted); }

/* pipeline */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.col { background: var(--surface-2); border-radius: var(--radius); padding: 10px; min-height: 200px; scroll-snap-align: start; }
.col.over { outline: 2px dashed var(--brand-2); }
.col header { display: flex; flex-direction: column; margin-bottom: 8px; }
.col header span { font-size: .8rem; color: var(--muted); }
.deal { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.deal.dragging { opacity: .5; }
.deal-foot { display: flex; justify-content: space-between; margin-top: 6px; font-size: .82rem; }

/* Claude */
.claude-card { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.claude-note { background: var(--surface-2); border-left: 3px solid var(--accent); padding: 10px 12px; border-radius: 8px; margin: 0 0 10px; }

/* dag afsluiten */
.dagrow { border-radius: 12px; }
.tsv { background: var(--surface-2); padding: 10px; border-radius: 10px; overflow-x: auto; font-size: .8rem; white-space: pre; }

/* offerte */
.q-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--brand); padding-bottom: 10px; margin-bottom: 12px; }
.q-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .92rem; }
.q-table th, .q-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.q-table td:last-child, .q-table th:last-child { text-align: right; white-space: nowrap; }
.q-table tfoot td { font-weight: 700; border-bottom: 0; }

/* dialoog */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / 35%); }
dialog::backdrop { background: rgb(0 0 0 / 45%); }
.dlg { padding: 18px; }
.dlg h2 { margin-top: 0; }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .2s;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 50; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.auth-page { display: grid; place-items: center; min-height: 80vh; }

@media print {
  .topbar, .tabbar, .noprint, #toast, .fab { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  .card { box-shadow: none; border: 0; }
}

/* optionele koppelingen (Excel, Microsoft 365) */
details.optional > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 8px; }
details.optional > summary::-webkit-details-marker { display: none; }
details.optional > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; }
details.optional[open] > summary::before { transform: rotate(90deg); }
details.optional[open] > summary { margin-bottom: 8px; }
@media (prefers-reduced-motion: reduce) { details.optional > summary::before { transition: none; } }

/* service & tickets */
.segmented { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; margin: 8px 0 12px; }
.segmented a { flex: 1; text-align: center; padding: 8px; border-radius: 9px; color: var(--muted); font-weight: 500; }
.segmented a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.list.tickets li { align-items: flex-start; }
.ticket { border-left: 3px solid transparent; padding-left: 8px !important; }
.prio-line-spoed { border-left-color: var(--danger); }
.prio-line-hoog { border-left-color: var(--accent); }
.ticket-badges { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.code { font-variant-numeric: tabular-nums; font-size: .78rem; color: var(--muted); font-weight: 600; }
.badge.prio-spoed { background: var(--k-weinig-bg); color: var(--k-weinig-ink); }
.badge.prio-hoog { background: var(--deal-bg); color: var(--deal-ink); }
.badge.st-opgelost, .badge.st-gesloten { background: var(--k-normaal-bg); color: var(--k-normaal-ink); }
.badge.st-onderweg { background: var(--k-veel-bg); color: var(--k-veel-ink); }
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 10px; }
.agenda { display: grid; gap: 10px; }
@media (min-width: 760px) { .agenda { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); } }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.day.today { border-color: var(--accent); }
.day header { display: flex; flex-direction: column; margin-bottom: 4px; }
.route .list.compact li { padding: 6px 0; }

/* CRM */
.crm-head { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.status-badge { border: 1px solid var(--line); cursor: pointer; font: inherit; font-size: .72rem; font-weight: 600; }
.nav-card { display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.table-wrap { overflow-x: auto; }
.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(70px, 30%) 1fr auto; align-items: center; gap: 8px; font-size: .85rem; }
.bar-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 12px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar { display: block; height: 100%; background: var(--brand-2); border-radius: 0 4px 4px 0; }
.bar-value { font-variant-numeric: tabular-nums; min-width: 60px; text-align: right; }
.bar-row:hover .bar { background: var(--brand); }

/* foto's, handtekening, voorraad */
.photos { display: grid; gap: 8px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.photo-grid:empty { display: none; }
.thumb { position: relative; margin: 0; aspect-ratio: 1; max-width: 100%; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .icon { position: absolute; top: 2px; right: 2px; background: rgb(0 0 0 / 55%); color: #fff; border-radius: 50%; width: 26px; height: 26px; padding: 0; font-size: .8rem; }
canvas.sig { width: 100%; height: 150px; background: #fff; border-radius: 10px; border: 1px dashed var(--line); touch-action: none; display: block; }
.sig-img { max-width: 220px; background: #fff; border-radius: 8px; padding: 4px; }
.ticket-media { display: grid; gap: 8px; margin: 10px 0; }
.ticket-media:empty { display: none; }
.stock-pick { display: grid; gap: 4px; max-height: 220px; overflow-y: auto; }
.stock-row { display: grid; grid-template-columns: 1fr 72px; align-items: center; gap: 8px; margin: 0; color: var(--text); }
.stock-row input { min-height: 38px; padding: 6px 8px; margin: 0; }
.list.stock li { gap: 4px; }
.stock-n { min-width: 36px; text-align: center; font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.list.stock .icon { font-size: 1.3rem; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); }

/* zelf plannen */
.stop-tools { display: flex; flex-direction: column; align-items: center; }
.stop-tools .icon { padding: 4px 8px; font-size: .9rem; }
.add-stop { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.add-stop select { flex: 1; min-width: 200px; }
.time-inline { width: 112px; min-height: 34px; padding: 4px 6px; font: inherit; font-weight: 700; }

/* ---------- Desktop (mobile first: alles hieronder geldt alleen op brede schermen) ---------- */
@media (min-width: 1024px) {
  :root { --sidebar-w: 220px; }
  body { padding-bottom: 32px; padding-left: var(--sidebar-w); }
  .topbar { padding-left: 24px; padding-right: 24px; }
  main { max-width: 1400px; padding: 16px 32px 32px; }

  /* Menubalk onderaan wordt een zijbalk links */
  .tabbar {
    top: 0; bottom: 0; right: auto; width: var(--sidebar-w); height: auto;
    display: flex; flex-direction: column; gap: 4px;
    padding: 76px 12px 16px; border-top: 0; border-right: 1px solid var(--line);
  }
  .tabbar a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 14px; border-radius: 10px; font-size: .95rem; }
  .tabbar a span { font-size: 1.15rem; }
  .tabbar a:hover { background: var(--surface-2); }
  .tabbar a.on { background: var(--surface-2); }
  .topbar { position: sticky; z-index: 11; }

  #toast, .fab { bottom: 24px; }
  #toast { left: calc(50% + var(--sidebar-w) / 2); }

  /* Klantenlijst in kolommen */
  #klantList { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); column-gap: 24px; padding: 0 16px; }
  #klantList li:last-child { border-bottom: 1px solid var(--line); }

  /* Overzichten met kaarten: twee kolommen, kop en KPI's over de volle breedte */
  #view.wide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; align-items: start; }
  #view.wide-grid > * { grid-column: 1 / -1; }
  #view.wide-grid > section.card:not(.hero), #view.wide-grid > details.card, #view.wide-grid > a.nav-card { grid-column: auto; }
  #view.wide-grid > .card { margin: 10px 0; }

  .kpis { grid-template-columns: repeat(4, 1fr); }
  .board { grid-auto-columns: minmax(260px, 1fr); }
  dialog { width: min(720px, calc(100vw - 48px)); }
  .dlg { padding: 24px; }
  .quick { grid-template-columns: repeat(auto-fit, minmax(140px, max-content)); }
  .row3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1500px) {
  #view.wide-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #view.wide-grid > .kpis, #view.wide-grid > h1, #view.wide-grid > .alert, #view.wide-grid > .back { grid-column: 1 / -1; }
}

/* voorraadbeheer */
.q-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stock-table { padding: 4px 12px; }
.stock-table tr.clickable { cursor: pointer; }
.stock-table tr.clickable:hover td { background: var(--surface-2); }
.stock-table td .sub { display: block; }
.qty-input { width: 76px; min-height: 38px; padding: 6px 8px; text-align: right; flex: none; }
.supplier + .supplier { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 4px; }
.loc-qty { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.loc-qty > div { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; min-width: 84px; }
.loc-qty b { display: block; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.stock-pick.tall { max-height: 50vh; }
.segmented { overflow-x: auto; scrollbar-width: none; }
.segmented a { flex: 1 0 auto; white-space: nowrap; padding-inline: 12px; }
.col-min { display: none; }
@media (min-width: 560px) { .col-min { display: table-cell; } }

/* meldingen & QR */
.head-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.qr-box { margin: 10px 0; }
.qr-box summary { cursor: pointer; color: var(--brand); }
.qr-wrap { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-top: 8px; }
.qr-wrap svg { border-radius: 8px; flex: none; max-width: 100%; }
.meld-page { max-width: 560px; }
.meld-head { display: flex; gap: 12px; align-items: center; margin: 12px 0; }
.meld-head h1 { margin: 0; }
.meld-head { justify-content: space-between; align-items: flex-start; }
.meld-head { flex-wrap: wrap-reverse; }
.lang-switch { display: flex; gap: 4px; flex-wrap: nowrap; justify-content: flex-end; margin-left: auto; }
.lang-switch .btn { min-width: 0; padding: 4px 8px; }
.meld-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
body.melden { padding-bottom: 24px; padding-left: 0; }
.chips-radio.big span { padding: 12px 16px; font-size: 1rem; }
a.btn.disabled { opacity: .5; pointer-events: none; }

/* logo */
.brand { gap: 10px; }
.brand .logo { height: 20px; width: auto; display: block; }
.brand-sub { font-weight: 500; font-size: .8rem; color: var(--muted); border-left: 1px solid var(--line); padding-left: 10px; }
.logo-on-light { display: none !important; }
:root[data-theme="light"] .logo-on-light { display: block !important; }
:root[data-theme="light"] .logo-on-dark { display: none !important; }
.meld-head .logo { height: 26px; width: auto; margin-bottom: 8px; }
/* mobile first: alleen logo; vanaf 480 px ook "Klantkaart" */
.brand-sub { display: none; }
.sync-chip { white-space: nowrap; }
@media (min-width: 480px) { .brand-sub { display: inline; } }

/* Inlogscherm eigen server */
body.logged-out .tabbar, body.logged-out #syncBtn, body.logged-out .as-fab, body.logged-out .as-panel { display: none !important; }
body.logged-out { padding-left: 0 !important; }
.login-card { max-width: 420px; margin: 8vh auto 0; }

/* ---------- zwevende assistent ---------- */
/* ---------- zwevende assistent ---------- */
.as-fab {
  position: fixed; right: 16px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); z-index: 40;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink);
  box-shadow: 0 6px 20px rgb(0 0 0 / 35%);
  transition: transform .15s ease;
}
.as-fab:hover { transform: scale(1.06); }
.as-fab:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 3px; }
body.as-open .as-fab { transform: rotate(45deg) scale(.9); }
.as-panel {
  position: fixed; z-index: 45; display: flex; flex-direction: column;
  left: 0; right: 0; top: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  background: var(--surface); border: 1px solid var(--line);
}
.as-panel[hidden] { display: none; }
@media (min-width: 700px) {
  .as-panel {
    left: auto; top: auto; right: 16px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 84px);
    width: 420px; height: min(640px, calc(100vh - var(--tabbar-h) - 120px));
    border-radius: var(--radius); box-shadow: 0 12px 40px rgb(0 0 0 / 40%);
  }
}
@media (max-width: 699px) { body.as-open .as-fab { display: none; } }
.as-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.as-actions { display: flex; gap: 4px; }
.as-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.as-msg { max-width: 88%; padding: 8px 12px; border-radius: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.as-msg p { margin: 0 0 6px; } .as-msg p:last-child { margin-bottom: 0; }
.as-msg ul { margin: 4px 0 6px; padding-left: 18px; }
.as-msg a { color: var(--brand); text-decoration: underline; }
.as-msg.me { align-self: flex-end; background: var(--brand); color: var(--brand-ink); white-space: pre-wrap; border-bottom-right-radius: 4px; }
.as-msg.bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.as-action { align-self: flex-start; font-size: .85rem; color: var(--ok); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.as-status { align-self: flex-start; color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: 8px; }
.as-dots { width: 18px; height: 6px; background: radial-gradient(circle, var(--muted) 2px, transparent 2.5px) 0 0 / 6px 6px repeat-x; animation: as-blink 1s steps(3) infinite; }
@keyframes as-blink { from { width: 6px; } to { width: 24px; } }
@media (prefers-reduced-motion: reduce) { .as-dots { animation: none; } .as-fab { transition: none; } }
.as-empty { color: var(--text); }
.as-empty p { margin: 0 0 10px; }
.as-empty .chip { display: block; width: 100%; text-align: left; margin: 6px 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; }
.as-empty .chip:hover { border-color: var(--brand); }
.as-form { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom) * 0); border-top: 1px solid var(--line); align-items: flex-end; }
.as-form textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.as-form textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; }

.pin-code { font-size: 2.2rem; font-weight: 700; letter-spacing: .3em; text-align: center; margin: 12px 0; font-variant-numeric: tabular-nums; }
.warn-note { background: var(--warn-bg); color: var(--warn-ink); padding: 8px 10px; border-radius: 10px; }

.pin-code { font-size: 2.2rem; font-weight: 700; letter-spacing: .3em; text-align: center; margin: 12px 0; font-variant-numeric: tabular-nums; }
.warn-note { background: var(--warn-bg); color: var(--warn-ink); padding: 8px 10px; border-radius: 10px; }

/* Server: aantallen dit apparaat / server */
.mini-table { width: 100%; border-collapse: collapse; font-size: .78rem; table-layout: fixed; margin: 6px 0 10px; font-variant-numeric: tabular-nums; }
.mini-table th, .mini-table td { padding: 4px 3px; overflow: hidden; text-overflow: ellipsis; text-align: right; border-bottom: 1px solid var(--line); }
.mini-table th:first-child, .mini-table td:first-child { text-align: left; color: var(--muted); }
.mini-table th { font-weight: 600; color: var(--muted); font-size: .7rem; overflow: visible; white-space: nowrap; }

/* Instellingen: inklapbare, versleepbare blokken */
.blocks-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 4px; }
.setting { position: relative; }
details.setting > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 28px; }
details.setting > summary::-webkit-details-marker { display: none; }
details.setting > summary::after {
  content: ''; flex: none; margin-left: auto; margin-right: 4px; width: 8px; height: 8px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-2px) rotate(45deg); transition: transform .15s;
}
details.setting:not([open]) > summary::after { transform: rotate(-45deg); }
details.setting > summary::before { content: none; }
details.setting[open] > summary { margin-bottom: 10px; }
details.setting > summary h2 { margin: 0; font-size: 1.05rem; }
.drag-handle {
  flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; margin: -4px 0 -4px -6px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 1.1rem; line-height: 1;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.drag-handle:hover, .drag-handle:focus-visible { background: var(--surface-2); color: var(--text); outline: none; }
a.setting-link { padding-left: 44px; }
a.setting-link > .drag-handle { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); margin: 0; }
.setting.dragging { opacity: .85; box-shadow: 0 10px 30px rgb(0 0 0 / 35%); outline: 2px solid var(--brand); z-index: 5; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }
@media (prefers-reduced-motion: reduce) { details.setting > summary::after { transition: none; } }

/* Video's voor social media */
.video-list { display: grid; grid-template-columns: repeat(auto-fill, 150px); gap: 16px 14px; justify-content: start; }
.video-list > li.muted { grid-column: 1 / -1; }
.video-item { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 0; padding: 0 !important; border: 0 !important; }
.video-thumb { position: relative; aspect-ratio: 9 / 16; width: 100%; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; font-size: 2rem; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-dur { position: absolute; right: 6px; bottom: 6px; background: rgb(0 0 0 / 70%); color: #fff; font-size: .72rem; padding: 2px 6px; border-radius: 6px; }
.video-wait { position: absolute; left: 6px; top: 6px; font-size: .9rem; }
.video-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; min-width: 0; font-size: .86rem; }
.video-meta b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; line-height: 1.3; }
.video-meta .sub { overflow-wrap: anywhere; }
.video-player { width: 100%; max-height: 50vh; border-radius: 10px; background: #000; margin: 4px 0 10px; }
progress { width: 100%; height: 12px; accent-color: var(--brand); }

/* Dag afsluiten: wijzigingen per klant */
.dag-wijz { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.dag-wijz > summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .9rem; }
.dag-wijz[open] > summary { margin-bottom: 8px; }

.list-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -2px 0 6px; }

/* Instellingen › Gebruikers: rolkeuze per gebruiker */
.users-list li { gap: 12px; flex-wrap: wrap; }
.users-list .sub { display: block; overflow-wrap: anywhere; }
.role-select { flex: none; width: auto; min-width: 150px; max-width: 100%; }

/* Taalkiezer in de koptekst */
.lang-sel { width: auto; min-width: 0; flex: none; padding: 6px 4px 6px 8px; font-size: .85rem; border-radius: 999px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }

/* ---------- Instellingen: overzichtelijk ---------- */
.set-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.set-top h1 { margin-bottom: 4px; }
.set-tools { display: flex; gap: 2px; flex-wrap: wrap; }
.set-tools .btn { color: var(--muted); padding-inline: 8px; }
.set-tools .btn:hover { color: var(--text); }
.set-search { position: relative; display: block; margin: 6px 0 14px; }
.set-search span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: .95rem; opacity: .7; pointer-events: none; }
.set-search input { padding-left: 38px; border-radius: 999px; background: var(--surface); }
.set-empty { text-align: center; padding: 16px 0; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 8px; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); min-width: 0; transition: transform .12s ease, border-color .12s ease; }
.tile:hover { border-color: var(--brand-2); transform: translateY(-1px); }
button.tile { font: inherit; text-align: left; cursor: pointer; }
button.tile:disabled { opacity: .6; cursor: progress; }
.tile b { font-size: .98rem; }
.tile .sub { font-size: .78rem; line-height: 1.3; }
.tile-ico { font-size: 1.5rem; line-height: 1; margin-bottom: 6px; }
.tile-badge { position: absolute; top: 10px; right: 10px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-size: .74rem; font-weight: 700; background: var(--danger); color: var(--bg); }
:root[data-np] .tile { border-color: transparent; background: var(--bg); box-shadow: var(--np-out-sm); }
:root[data-np] .tile:active { box-shadow: var(--np-in-sm); }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } .tile:hover { transform: none; } }

.set-group { margin: 18px 0 0; }
.set-group-h { margin: 0 0 6px 2px; }
.set-group > .setting { margin: 8px 0; }
@media (min-width: 1024px) {
  .set-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; align-items: start; }
  .set-group > .set-group-h, .set-group > .blocks-bar { grid-column: 1 / -1; }
}
.set-head { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.set-ico { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 1.15rem; background: color-mix(in srgb, var(--brand-2) 16%, var(--surface-2)); }
.set-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.set-txt b { font-size: 1rem; font-weight: 650; line-height: 1.25; }
.set-txt small { color: var(--muted); font-size: .8rem; font-weight: 400; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
@media (max-width: 520px) {
  .set-head { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; row-gap: 4px; }
  .set-head .set-ico { grid-row: span 2; align-self: start; }
  .set-head .set-badge { grid-column: 2; justify-self: start; max-width: 100%; }
}
.set-badge { flex: none; font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; max-width: 46%; overflow: hidden; text-overflow: ellipsis; }
.set-badge.on { background: var(--k-normaal-bg); color: var(--k-normaal-ink); }
.set-badge.bad { background: var(--k-weinig-bg); color: var(--k-weinig-ink); }
details.setting > summary h2 { flex: 1; min-width: 0; font-size: 1rem; }
details.setting[open] > summary { padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.set-group details.setting > summary .drag-handle { opacity: .45; }
.set-group details.setting > summary:hover .drag-handle, .set-group details.setting > summary .drag-handle:focus-visible { opacity: 1; }
#view.searching .drag-handle { visibility: hidden; }
:root[data-np] .set-ico { background: var(--bg); box-shadow: var(--np-in-sm); }
:root[data-np] details.setting[open] > summary { border-bottom-color: transparent; }
:root[data-np] .set-search input { border-radius: 999px; }

/* Koptekst past altijd op een telefoon: de sync-knop wordt ingekort in plaats van uit beeld te schuiven. */
.topbar { min-width: 0; }
.top-actions { min-width: 0; flex-shrink: 1; }
.top-actions > * { flex-shrink: 0; }
.top-actions .sync-chip { flex-shrink: 1; min-width: 0; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; }
.brand { flex-shrink: 0; }
@media (max-width: 420px) { .top-actions { gap: 5px; } .brand .logo { height: 16px; } .top-actions .sync-chip { font-size: .7rem; padding: 4px 8px; } .lang-sel { padding: 4px 2px 4px 6px; font-size: .78rem; } .theme-btn { width: 30px; height: 30px; font-size: .9rem; } }

/* Installeren als app */
.install-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 12px; padding: 12px 14px; border-radius: var(--radius); background: color-mix(in srgb, var(--brand-2) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--brand-2) 40%, var(--line)); }
.install-banner img { border-radius: 11px; flex: none; }
.install-banner .grow { min-width: 180px; }
.install-banner .sub { margin-top: 2px; }
.install-actions { display: flex; gap: 6px; margin-left: auto; }
.install-steps { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
:root[data-np] .install-banner { border-color: transparent; background: var(--bg); box-shadow: var(--np-out); }
:root[data-np] .install-steps { background: var(--bg); box-shadow: var(--np-in-sm); }

/* DIN Monitor-kaart op het dashboard */
.mon-sum { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin: 0 0 6px; }
.mon-ok { color: var(--ok); }
.mon-card.mon-down { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.mon-card .list li { display: flex; justify-content: space-between; gap: 10px; }

/* Websitemonitor (scherm Websites) */
.web-up { color: var(--ok); }
.badge.web-down { color: var(--danger); } .badge.web-warn { color: #c98a00; } .badge.web-up { color: var(--ok); }
.web-sites { display: grid; gap: 12px; margin-bottom: 14px; }
.web-site { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow), inset 4px 0 0 var(--muted); color: var(--text); }
.web-site.up { box-shadow: var(--shadow), inset 4px 0 0 var(--ok); }
.web-site.down { box-shadow: var(--shadow), inset 4px 0 0 var(--danger); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }
.web-name { min-width: 0; } .web-name b { display: block; overflow-wrap: anywhere; } .web-name .sub { display: block; font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.web-right { text-align: right; } .web-ms { font-weight: 600; }
.web-meta { grid-column: 2 / 4; display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .8rem; }
.web-full { grid-column: 1 / 4; }
.web-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); vertical-align: middle; }
.web-dot.up { background: var(--ok); box-shadow: 0 0 8px color-mix(in srgb, var(--ok) 60%, transparent); }
.web-dot.down { background: var(--danger); box-shadow: 0 0 10px color-mix(in srgb, var(--danger) 70%, transparent); animation: web-pulse 1.6s infinite; }
@keyframes web-pulse { 50% { box-shadow: 0 0 16px color-mix(in srgb, var(--danger) 85%, transparent); } }
@media (prefers-reduced-motion: reduce) { .web-dot.down { animation: none; } }
.web-bars { display: flex; gap: 2px; align-items: flex-end; height: 28px; padding: 3px 5px; border-radius: 10px; margin-top: 4px; }
.web-bars i { flex: 1; min-width: 2px; background: var(--ok); border-radius: 2px; opacity: .85; }
.web-bars i.f { background: var(--danger); height: 100% !important; }
.web-chart { width: 100%; height: 140px; display: block; border-radius: 12px; }
.web-chart .line { fill: none; stroke: var(--brand); stroke-width: 1.5; }
.web-chart .area { fill: color-mix(in srgb, var(--brand) 16%, transparent); }
.web-chart .fail { stroke: var(--danger); stroke-width: 2; }
.web-chart text { fill: var(--muted); font-size: 10px; }
.web-chart .grid { stroke: color-mix(in srgb, var(--muted) 25%, transparent); }
.web-kpis { grid-template-columns: repeat(3, 1fr) !important; }
.web-li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mon-card .list li a { color: var(--text); } .mon-card .list li a .sub { display: block; }
/* neumorfisch: in de achtergrondkleur, diepte met schaduw */
:root[data-np] .web-site { border-color: transparent; background: var(--bg); box-shadow: var(--np-out), inset 4px 0 0 var(--muted); }
:root[data-np] .web-site.up { box-shadow: var(--np-out), inset 4px 0 0 var(--ok); }
:root[data-np] .web-site.down { box-shadow: var(--np-in), inset 4px 0 0 var(--danger); }
:root[data-np] .web-bars, :root[data-np] .web-chart { box-shadow: var(--np-in-sm); }

/* Facturen */
.badge.inv-concept { color: var(--muted); } .badge.inv-open { color: var(--brand); } .badge.inv-vervallen { color: var(--danger); }
.badge.inv-betaald { color: var(--ok); } .badge.inv-gecrediteerd { color: var(--muted); text-decoration: line-through; }
.inv-list { padding: 4px 14px; } .inv-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.inv-list .sub { display: block; font-size: .82rem; color: var(--muted); }
.inv-amount { text-align: right; white-space: nowrap; } .inv-amount .sub { display: block; }
.inv-actions { flex-wrap: wrap; margin-bottom: 12px; }
.inv-head { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; line-height: 1.5; }
.inv-meta { display: grid; grid-template-columns: auto auto; gap: 2px 14px; align-content: start; }
.inv-meta span { color: var(--muted); font-size: .88rem; }
.inv-table td:first-child { white-space: pre-wrap; }
.inv-totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 18px; max-width: 360px; margin: 12px 0 8px auto; }
.inv-totals b { text-align: right; } .inv-total { font-size: 1.1rem; border-top: 1px solid var(--line); padding-top: 6px; }
.inv-li { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.inv-form h2 { margin: 18px 0 6px; } .inv-form h2:first-child { margin-top: 0; }
.inv-form label .sub { font-size: .78rem; color: var(--muted); }
.inv-lines { display: grid; gap: 8px; margin-bottom: 8px; }
.inv-line { display: grid; grid-template-columns: 1fr 70px 70px 100px 76px auto; gap: 6px; align-items: center; }
.inv-line input, .inv-line select { min-width: 0; }
@media (max-width: 640px) {
  .inv-line { grid-template-columns: 1fr 1fr 1fr auto; padding: 8px; border-radius: 12px; background: var(--surface-2); }
  .inv-line .inv-oms { grid-column: 1 / -1; }
}
:root[data-np] .inv-line { background: transparent; }
@media (max-width: 640px) { :root[data-np] .inv-line { box-shadow: var(--np-in-sm); } }
/* Factuurregels op een smalle telefoon: omschrijving bovenaan, daaronder aantal × prijs · btw en het bedrag */
@media (max-width: 520px) {
  .inv-table thead { display: none; }
  .inv-table tr { display: grid; grid-template-columns: auto auto auto 1fr; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .inv-table td { padding: 0; border: 0; font-size: .85rem; color: var(--muted); }
  .inv-table td:first-child { grid-column: 1 / -1; color: var(--text); font-size: .95rem; }
  .inv-table td:nth-child(2)::after { content: ' ×'; }
  .inv-table td:last-child { text-align: right; color: var(--text); font-weight: 600; }
}

/* Leads */
.lead-list { padding: 4px 14px; }
.lead-list .sub { display: block; font-size: .82rem; color: var(--muted); }
.lead-list .lead-msg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lead-list li > div { min-width: 0; flex: 1; }
.lead-list li.lead-nieuw b:first-child { color: var(--brand); }
.badge.lead-b-nieuw { color: var(--brand); } .badge.lead-b-opgepakt { color: #c98a00; } .badge.lead-b-omgezet { color: var(--ok); } .badge.lead-b-afgewezen { color: var(--muted); }
.lead-new { color: var(--brand); }
.lead-actions { flex-wrap: wrap; margin-bottom: 12px; }
.lead-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.lead-dl dt { color: var(--muted); font-size: .88rem; } .lead-dl dd { margin: 0; overflow-wrap: anywhere; }
.lead-quote { margin: 14px 0 0; padding: 10px 14px; border-left: 3px solid var(--brand); background: var(--surface-2); border-radius: 0 10px 10px 0; white-space: pre-wrap; }
.chips-quick { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.lead-form-li { display: flex; justify-content: space-between; align-items: center; gap: 10px; } .lead-form-li .sub { display: block; font-size: .8rem; color: var(--muted); }
textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; white-space: pre; }
:root[data-np] .lead-quote { background: var(--bg); box-shadow: var(--np-in-sm); }
