/* Werkbonnen-app voor meerdere firma's.
   De kleuren hieronder zijn het neutrale standaardthema (aanmeldscherm, firma zonder huisstijl).
   Na het aanmelden zet app.js (applyTheme) dezelfde variabelen op basis van de twee kleuren van de firma:
     primair   → --accent*  : actiekleur (knoppen, actieve menu's, afgevinkte stappen)
     secundair → --brand*   : merkkleur (bovenbalk, links, focusrand)
   --accent-ink = zwart of wit, automatisch gekozen voor voldoende contrast op de actiekleur;
   --accent-text / --brand-text = dezelfde kleur, zo nodig donkerder gemaakt tot ze leesbaar is op wit. */
:root {
  --grey: #58585A;
  --ink: #23272b; --ink-2: #58585A; --muted: #6b7076; --line: #dfe6ec;
  --bg: #f3f7fa; --glass: rgba(255,255,255,.84); --glass-line: rgba(255,255,255,.9);
  --brand: #1e3a5f; --brand-rgb: 30,58,95; --brand-dark: #1e3a5f; --brand-text: #1e3a5f; --deep: #16283d; --deep-2: #121f2e;
  --accent: #0f766e; --accent-rgb: 15,118,110; --accent-hover: #138a81; --accent-ink: #fff; --accent-text: #0f766e; --accent-edge: transparent;
  --warn: #d97706; --danger: #c0392b; --ok: #15803d;
  --radius: 18px;
  --shadow: 0 10px 30px -14px rgba(31,58,79,.35);
  --shadow-lg: 0 18px 40px -16px rgba(21,42,59,.55);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased;
  font-size: 15px; line-height: 1.5;
}
/* Zachte achtergrond in de kleuren van de firma: merkkleur linksboven, actiekleur rechtsonder */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 600px at 0% 0%, rgba(var(--brand-rgb), .12), transparent 65%),
    radial-gradient(800px 600px at 100% 100%, rgba(var(--accent-rgb), .10), transparent 65%),
    linear-gradient(170deg, #f6f9fc 0%, #eef3f7 55%, #f1f5f6 100%);
}
[hidden] { display: none !important; }
h1 { font-size: 1.6rem; font-weight: 800; margin: 0 0 16px; letter-spacing: -.025em; color: var(--deep); line-height: 1.2; }
h2 { font-size: 1.08rem; font-weight: 700; margin: 0 0 12px; letter-spacing: -.01em; color: var(--deep); }
a { color: var(--brand-text); }

/* ---------- bovenbalk ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: linear-gradient(100deg, var(--deep-2) 0%, var(--deep) 55%, var(--brand-dark) 100%);
  color: #fff; box-shadow: 0 6px 20px -10px rgba(21,42,59,.7);
}
.topbar::after { /* dunne golflijn in logokleuren onder de balk */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}
.tb-brand { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; letter-spacing: -.01em; flex: none; }
.tb-brand { min-width: 0; flex: 0 1 auto !important; }
.tb-brand strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 520px) {
  .tb-logo { max-width: 104px; } .tb-logo img { max-width: 96px; }
  .tb-logo:not(.is-mark) + strong { display: none; }   /* op een gsm volstaat het logo: de naam staat er meestal in */
}
.tb-logo { flex: none; display: grid; place-items: center; height: 34px; min-width: 34px; max-width: 120px; background: #fff; border-radius: 9px; padding: 3px; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.tb-logo img { display: block; height: 28px; width: auto; max-width: 112px; object-fit: contain; }
.tb-logo svg { display: block; width: 28px; height: 28px; }
.tb-logo.is-mark { background: none; box-shadow: none; padding: 0; }
.tb-logo.is-mark svg { width: 34px; height: 34px; }
.tb-nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tb-nav a { color: rgba(255,255,255,.72); text-decoration: none; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: .92rem; white-space: nowrap; transition: .15s; }
.tb-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.tb-nav a.active { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -8px rgba(var(--accent-rgb), .8); }
.tb-user {
  margin-left: auto; background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px; padding: 7px 14px; font: 600 .9rem Inter, sans-serif; cursor: pointer;
  max-width: 46vw; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto;
}
/* Hamburgermenu voor de beheerder: de 8 menu's passen niet naast elkaar onder 1100 px (en niet in de onderbalk) */
/* gsm: de gebruiker als initialen, zodat de firmanaam de rest van de breedte krijgt (niets afgekapt, alles op één regel) */
.tb-user-ini { display: none; }
@media (max-width: 600px) {
  .topbar { gap: 10px; }
  .tb-brand { flex: 1 1 auto !important; }
  .tb-user { flex: none; max-width: none; padding: 7px 12px; letter-spacing: .02em; }
  .tb-user-name { display: none; }
  .tb-user-ini { display: inline; }
}
.tb-menu {
  display: none; flex: none; width: 40px; height: 40px; padding: 0; place-items: center; cursor: pointer;
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 12px;
}
.tb-menu svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.tb-menu[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tb-drop {
  position: absolute; right: 12px; top: calc(100% + 8px); z-index: 30; display: grid; gap: 2px; min-width: 230px;
  padding: 8px; background: #fff; border: 1px solid #e3e8ee; border-radius: 16px; box-shadow: 0 24px 50px -16px rgba(21,42,59,.55);
}
.tb-drop[hidden] { display: none; }
.tb-drop a { color: var(--deep); text-decoration: none; padding: 12px 14px; border-radius: 10px; font-weight: 600; font-size: 1rem; }
.tb-drop a:hover { background: #eef3f7; }
.tb-drop a.active { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 1100px) {
  .tb-nav { display: none; }
  .tb-menu:not([hidden]) { display: grid; }
  .tb-user { margin-left: auto; }
}

.view { max-width: 1000px; margin: 0 auto; padding: 22px 16px 120px; }

/* ---------- onderbalk (gsm) ---------- */
.bottombar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex;
  background: rgba(255,255,255,.95); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid rgba(31,58,79,.08); box-shadow: 0 -8px 24px -16px rgba(21,42,59,.4);
  padding: 4px 4px env(safe-area-inset-bottom);
}
.bottombar a {
  flex: 1; min-width: 0; text-align: center; padding: 6px 2px 7px; color: var(--muted); text-decoration: none;
  font-size: .68rem; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.bottombar a svg { width: 40px; height: 28px; padding: 3px 9px; border-radius: 999px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: .15s; }
.bottombar a.active { color: var(--deep); }
.bottombar a.active svg { background: var(--accent); stroke: var(--accent-ink); box-shadow: 0 6px 14px -6px rgba(var(--accent-rgb), .8), 0 0 0 1px var(--accent-edge); }
@media (min-width: 801px) { .bottombar.has-admin { display: none; } }
/* altijd vast onderaan: eigen laag (geen verspringen bij scrollen of wisselen van menu), vaste hoogte per knop */
.bottombar { transform: translateZ(0); will-change: transform; }
.bottombar a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
/* gsm-toetsenbord open (app.js zet .kb-open en --kb): onderbalk weg, ruimte om het veld boven het toetsenbord te schuiven */
html.kb-open .bottombar { display: none; }
html.kb-open .view, html.kb-open .auth-form { padding-bottom: calc(var(--kb, 0px) + 40px); }
html.kb-open .auth { min-height: calc(100dvh + var(--kb, 0px)); }
@media (max-width: 860px) { html.kb-open .auth-brand { display: none; } html.kb-open .auth-form { padding-top: max(12px, env(safe-area-inset-top)); } }

/* ---------- pagina ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; flex: 1 1 auto; min-width: 0; }
.page-head > * { flex: none; }
.list-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

.card {
  background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
  box-shadow: var(--shadow); min-width: 0;
}
/* titel van een kaart met een stip in de actiekleur */
.card > h2:first-child, .card > .row:first-child > h2 { display: flex; align-items: center; gap: 10px; }
.card > h2:first-child::before, .card > .row:first-child > h2::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none;
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .18); outline: 1px solid var(--accent-edge);
}
/* donkere kaart (lopende interventie): verloop in de merkkleur van de firma met een zachte gloed in de actiekleur */
.card-dark {
  position: relative; overflow: hidden; color: #fff; border: 0; box-shadow: var(--shadow-lg);
  background:
    radial-gradient(520px 260px at 100% 0%, rgba(var(--accent-rgb), .30), transparent 70%),
    linear-gradient(100deg, var(--deep-2) 0%, var(--deep) 55%, var(--brand-dark) 100%);
}
.card-dark > * { position: relative; z-index: 1; }
.card-dark h2 { color: #fff; }
.card-dark .muted { color: rgba(255,255,255,.7); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; gap: 10px; align-items: center; }
.row > input, .row > select { flex: 1; min-width: 0; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid2 > *, .grid3 > * { min-width: 0; }
/* filterrijen: vier filters naast elkaar (Werkbonnen, beheerder); velden en knop even hoog en op dezelfde onderlijn */
.grid3.filters-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .grid3.filters-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.filters { align-items: end; }
.filters input, .filters select, .filters .btn { min-height: 46px; }
.filters .filter-act { margin-bottom: 12px; }
.filters .filter-act .btn { width: 100%; }

/* kerncijfers: gekleurde bovenrand in de drie logokleuren */
/* kolom met het cijfer onderaan: de cijfers staan op één lijn, ook als een label over twee regels loopt */
.grid3 > .card { position: relative; overflow: hidden; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; }
.grid3 > .card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--brand); }
.grid3 > .card:nth-child(2)::before { background: var(--accent); }
.grid3 > .card:nth-child(3)::before { background: var(--grey); }
.big-num { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; color: var(--deep); line-height: 1.15; margin-top: 2px; }

/* ---------- knoppen (pil-vorm, actiekleur = actie) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-align: center;
  border: 1.5px solid transparent; border-radius: 999px; padding: 11px 18px;
  font: 600 .95rem Inter, sans-serif; cursor: pointer; text-decoration: none; line-height: 1.25;
  background: #fff; color: var(--deep); box-shadow: 0 2px 6px -3px rgba(31,58,79,.3); transition: .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-edge); box-shadow: 0 8px 20px -10px rgba(var(--accent-rgb), .8); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-accent { background: linear-gradient(100deg, var(--accent), var(--accent-hover)); color: var(--accent-ink); border-color: var(--accent-edge); box-shadow: 0 10px 24px -10px rgba(var(--accent-rgb), .9); }
.btn-danger { background: #fdecea; color: var(--danger); box-shadow: none; }
.btn-ghost { background: rgba(255,255,255,.55); border-color: var(--line); box-shadow: none; }
.card-dark .btn-ghost { background: rgba(255,255,255,.08); }
/* Clear secondary actions (print, mail): solid white, accent border and text */
.btn-outline { background: #fff; color: var(--accent-text); border-color: var(--accent-text); box-shadow: 0 2px 6px -3px rgba(31,58,79,.3); }
.btn-outline:hover { background: rgba(var(--accent-rgb), .08); }
.btn-big { width: 100%; padding: 17px; font-size: 1.08rem; }
.btn-sm { padding: 6px 12px; font-size: .82rem; box-shadow: none; }

/* ---------- formulieren ---------- */
label { display: block; font-size: .78rem; font-weight: 700; color: var(--ink-2); margin-bottom: 12px; letter-spacing: .01em; min-width: 0; }
input, select, textarea {
  display: block; width: 100%; min-width: 0; max-width: 100%; margin-top: 5px; padding: 11px 13px;
  border: 1.5px solid var(--line); border-radius: 12px; font: 400 1rem Inter, sans-serif; color: var(--ink);
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-text); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .18); }
input:disabled, select:disabled, textarea:disabled { background: #f3f6f8; color: var(--muted); }
/* iOS Safari: datum/tijd-velden negeren anders width:100% en lopen over elkaar */
input[type=date], input[type=datetime-local], input[type=time], input[type=month] {
  -webkit-appearance: none; appearance: none; min-height: 46px; text-align: left; line-height: 1.2;
}
input::-webkit-date-and-time-value { text-align: left; margin: 0; }
input[type=checkbox] { display: inline-block; width: 18px; height: 18px; min-height: 0; margin: 0 8px 0 0; padding: 0; vertical-align: -3px; accent-color: var(--accent); }
textarea { min-height: 90px; resize: vertical; }
/* checkbox met tekst ernaast (Actief, werkdagen) */
label.chk { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: .9rem; font-weight: 600; color: var(--ink); white-space: nowrap; }

/* Medewerkers: één kaartje per persoon (een tabel past niet op een gsm) */
.user-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 12px; margin-bottom: 10px; background: rgba(255,255,255,.7); }
.user-card .grid2 { gap: 0 12px; }
.user-card .grid2 label { margin-bottom: 8px; }
.user-track { margin: 2px 0 10px; line-height: 1.8; }
.user-track code { font-size: .95rem; letter-spacing: .06em; font-weight: 700; color: var(--deep); background: #eef3f7; padding: 2px 8px; border-radius: 6px; }
.user-track .btn-sm { padding: 3px 9px; vertical-align: middle; }
select { -webkit-appearance: none; appearance: none; padding-right: 36px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231f3a4f' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") right 14px center no-repeat; }

/* ---------- labels/status ---------- */
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.b-bezig { background: #fef3c7; color: #92400e; }
.b-afgewerkt { background: #dcfce7; color: #166534; }
.b-gefactureerd { background: #e0edf8; color: #0a5a90; }
.b-nieuw { background: #fee2e2; color: #991b1b; }
/* team vandaag: waar is de technieker nu */
.b-onderweg { background: #e0edf8; color: #0a5a90; }
.b-ter_plaatse { background: #dcfce7; color: #166534; }
.b-vrij { background: #e5e7eb; color: #4b5563; }

/* ---------- lijsten ---------- */
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 8px; margin: 0 -8px; border-bottom: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: inherit; transition: background .15s; }
.list-item:hover { background: rgba(var(--brand-rgb), .06); }
.list-item:last-child { border-bottom: 0; }
.list-item > div { min-width: 0; flex: 1; }
.list-item strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--deep); }
.list-item > div > .small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .aside { flex: none; white-space: nowrap; }
.list-item > div[style*="text-align:right"] { flex: none; }

/* Lange lijsten: eigen scrollvak zodat zoekveld + navigatie in beeld blijven */
.list-panel { min-height: 160px; margin-top: 10px; }

/* Klantenlijst: avatar + naam/contact + afstand + snelknoppen (bellen / route) */
.cust { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.cust:last-child { border-bottom: 0; }
.cust-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 11px 6px; text-decoration: none; color: inherit; border-radius: 12px; }
.cust-link:hover { background: rgba(var(--brand-rgb), .06); }
/* kiesrij bij Nieuwe interventie */
.cust-pick { display: flex; align-items: center; gap: 12px; padding: 11px 6px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); border-radius: 12px; }
.cust-pick:last-child { border-bottom: 0; }
.cust-pick:hover, .cust-pick:active { background: rgba(var(--brand-rgb), .07); }
.pick-chevron { flex: none; color: var(--muted); font-size: 1.5rem; line-height: 1; padding-right: 6px; }
.avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 800 15px Inter, sans-serif; letter-spacing: .02em; box-shadow: 0 4px 10px -4px rgba(21,42,59,.45); }
.cust-txt { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.cust-txt strong { color: var(--deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-meta { display: flex; align-items: center; gap: 7px; min-width: 0; }
.cust-meta .small { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.km { flex: none; font-size: .72rem; font-weight: 800; color: var(--deep); background: #e7edf3; border-radius: 999px; padding: 2px 9px; letter-spacing: .01em; }
.cust-act { flex: none; display: flex; gap: 4px; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; text-decoration: none; }
.iconbtn svg { width: 19px; height: 19px; }
.iconbtn.call { color: var(--brand-text); background: rgba(var(--brand-rgb), .1); }
.iconbtn.call:hover { background: rgba(var(--brand-rgb), .2); }
.iconbtn.nav { color: var(--accent-text); background: rgba(var(--accent-rgb), .12); }
.iconbtn.nav:hover { background: rgba(var(--accent-rgb), .22); }
@media (max-width: 400px) {
  .cust-link { gap: 10px; }
  .avatar { width: 40px; height: 40px; font-size: 14px; }
  .iconbtn { width: 36px; height: 36px; }
}

/* Werkbon-rij (overzicht, vandaag, per klant): status-gekleurde avatar + naam/meta + werk/rit-tijd */
.bon { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; border-radius: 12px; }
.bon:last-child { border-bottom: 0; }
.bon:hover { background: rgba(var(--brand-rgb), .06); }
.bon-txt { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.bon-txt strong { color: var(--deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bon-meta { display: flex; align-items: center; gap: 7px; min-width: 0; }
.bon-meta .small { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bon-meta .badge { flex: none; }
/* breed scherm: alles op één regel; technieker · omschrijving wordt als eerste afgekapt */
.bon-l1 { display: contents; }
.bon-who { flex: 0 1 auto; }
.bon-title { flex: 0 100 auto; }
.bon-title.after-ref { margin-left: -3px; }
.bon-stat { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; }
.bon-w { font-weight: 800; color: var(--deep); font-size: .98rem; white-space: nowrap; }
.bon-stat .small { white-space: nowrap; }

/* ---------- tijdlijn vertrek → terug ---------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 14px 0; }
.step { text-align: center; padding: 9px 3px; border-radius: 12px; background: rgba(255,255,255,.1); font-size: .72rem; line-height: 1.3; }
.step b { display: block; font-size: 1rem; margin-top: 2px; white-space: nowrap; }
.step.done { background: var(--accent); color: var(--accent-ink); }
.card:not(.card-dark) .step { background: #eef3f7; color: var(--ink-2); }
.card:not(.card-dark) .step.done { background: #dcfce7; color: #166534; }

/* ---------- aanmelden: links het product (of de firma via ?firma=), rechts het formulier ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #f4f7fa; }
.auth-brand {
  position: relative; overflow: hidden; color: #fff; display: flex; flex-direction: column; gap: 26px;
  padding: max(clamp(26px, 4vw, 56px), env(safe-area-inset-top)) clamp(24px, 4vw, 56px) clamp(26px, 4vw, 48px);
  background:
    radial-gradient(720px 440px at 105% 105%, rgba(var(--accent-rgb), .38), transparent 70%),
    linear-gradient(155deg, var(--deep-2) 0%, var(--deep) 55%, var(--brand-dark) 100%);
}
.auth-id { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.3rem; letter-spacing: -.01em; min-width: 0; }
.auth-names { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.auth-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-id .tb-logo { height: 44px; min-width: 44px; max-width: 150px; border-radius: 12px; }
.auth-id .tb-logo img { height: 36px; max-width: 140px; }
.auth-id .tb-logo.is-mark svg { width: 44px; height: 44px; }
.auth-with { font-size: .78rem; font-weight: 600; letter-spacing: 0; color: rgba(255,255,255,.72); }
.auth-tag { margin: 0; color: #fff; font-size: clamp(1.45rem, 2.5vw, 2.15rem); font-weight: 800; line-height: 1.2; letter-spacing: -.025em; max-width: 21ch; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-width: 460px; }
.auth-points li { display: flex; gap: 13px; align-items: center; font-size: .93rem; line-height: 1.35; }
.auth-points .ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); }
.auth-points svg { width: 21px; height: 21px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.auth-points b { display: block; font-weight: 700; }
.auth-points small { font-size: .84rem; color: rgba(255,255,255,.72); }

/* illustratie: de app op een gsm, met de handtekening en de route als losse kaartjes. Alles in em, zodat het
   geheel meeschaalt met de beschikbare hoogte (font-size op .stage-in). Kleurt mee via de CSS-variabelen. */
.auth-pitch { display: grid; gap: 10px; }
.auth-sub { margin: 0; color: rgba(255,255,255,.78); font-size: 1.02rem; }
.stage { position: relative; flex: 1; min-height: 0; container-type: size; }
.stage-in { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(min(100cqh, 560px) / 56); }
.stage-in::before { content: ""; position: absolute; left: 50%; top: 50%; width: 46em; height: 46em; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(var(--accent-rgb), .42), transparent); }
.stage-route { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-route path { fill: none; stroke: rgba(255,255,255,.3); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 11; vector-effect: non-scaling-stroke; }
.ph { position: relative; width: 28em; height: 56em; display: flex; flex-direction: column; overflow: hidden; background: #f4f7fa; color: var(--ink); border: .75em solid #0b131c; border-radius: 3.6em; box-shadow: 0 4em 8em -3em rgba(0,0,0,.7), 0 0 0 .12em rgba(255,255,255,.14); }
.ph-bar { display: flex; align-items: center; gap: .8em; padding: 1.7em 1.3em 1.1em; color: #fff; background: linear-gradient(110deg, var(--deep-2), var(--deep) 60%, var(--brand-dark)); border-bottom: .25em solid var(--accent); }
.ph-bar b { flex: 1; min-width: 0; font-size: 1.3em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-bar i { font-style: normal; font-size: .95em; font-weight: 600; padding: .35em .9em; border-radius: 99em; background: rgba(255,255,255,.14); }
.ph-logo { flex: none; display: flex; }
.ph-logo svg { width: 2.6em; height: 2.6em; }
.ph-logo img { height: 2.6em; width: auto; max-width: 7em; object-fit: contain; background: #fff; border-radius: .6em; padding: .2em .4em; }
.ph-body { flex: 1; min-height: 0; display: grid; align-content: start; gap: 1.1em; padding: 1.4em 1.2em 0; }
.ph-hi { font-size: 1.6em; font-weight: 800; letter-spacing: -.02em; color: var(--deep); line-height: 1.15; }
.ph-hi small { display: block; margin-top: .2em; font-size: .58em; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.ph-card { display: grid; gap: .25em; padding: 1.4em 1.3em 1.3em; border-radius: 1.7em; color: #fff; background: radial-gradient(20em 12em at 100% 0%, rgba(var(--accent-rgb), .4), transparent 70%), linear-gradient(150deg, var(--deep-2), var(--deep) 60%, var(--brand-dark)); box-shadow: 0 1.6em 3em -1.6em rgba(0,0,0,.5); }
.ph-row { display: flex; align-items: center; justify-content: space-between; font-size: .88em; color: rgba(255,255,255,.72); }
.ph-pill { padding: .15em .75em; border-radius: 99em; font-weight: 700; background: #fef3c7; color: #854d0e; }
.ph-card > b { font-size: 1.5em; letter-spacing: -.015em; }
.ph-card > small { font-size: .95em; color: rgba(255,255,255,.76); }
.ph-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45em; margin-top: .9em; }
.ph-steps span { text-align: center; padding: .65em .1em; border-radius: .9em; font-size: .74em; line-height: 1.25; background: rgba(255,255,255,.11); }
.ph-steps b { display: block; font-size: 1.32em; }
.ph-steps .done { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-edge); }
.ph-btn { margin-top: .85em; padding: .78em; border-radius: 99em; text-align: center; font-size: 1.15em; font-weight: 800; background: var(--accent); color: var(--accent-ink); box-shadow: 0 .8em 1.6em -.8em rgba(var(--accent-rgb), .95), inset 0 0 0 1px var(--accent-edge); }
.ph-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6em; }
.ph-tiles span { padding: .75em .85em; border-radius: 1.1em; background: #fff; border: 1px solid var(--line); }
.ph-tiles small { display: block; font-size: .78em; color: var(--muted); }
.ph-tiles b { font-size: 1.45em; letter-spacing: -.02em; color: var(--deep); }
.ph-item { display: flex; align-items: center; gap: .9em; padding: .85em; border-radius: 1.1em; background: #fff; border: 1px solid var(--line); min-width: 0; }
.ph-item > span:last-child { min-width: 0; }
.ph-av { flex: none; width: 2.7em; height: 2.7em; display: grid; place-items: center; border-radius: 50%; font-size: .95em; font-weight: 800; background: rgba(var(--accent-rgb), .16); color: var(--deep); }
.ph-item b { display: block; font-size: 1.05em; color: var(--deep); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-item small { display: block; font-size: .85em; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-tabs { display: grid; grid-template-columns: repeat(4, 1fr); padding: .9em .6em 1.4em; background: #fff; border-top: 1px solid var(--line); text-align: center; font-size: .78em; font-weight: 600; color: var(--muted); }
.ph-tabs svg { display: block; width: 2.9em; height: 2.9em; margin: 0 auto .25em; padding: .55em; border-radius: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ph-tabs .on { color: var(--deep); }
.ph-tabs .on svg { background: var(--accent); stroke: var(--accent-ink); }
.fl { position: absolute; width: 18em; padding: 1.2em 1.4em 1.3em; border-radius: 1.6em; background: #fff; color: var(--ink); box-shadow: 0 2.6em 5em -2em rgba(0,0,0,.6), 0 0 0 1px rgba(13,22,32,.05); }
.fl small { display: block; font-size: .95em; font-weight: 600; color: var(--muted); }
.fl b { display: block; font-size: 1.4em; letter-spacing: -.02em; color: var(--deep); }
.fl svg { display: block; width: 100%; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.fl-route { left: calc(50% + 10.5em); top: 9em; }
.fl-route svg { height: 5em; margin-bottom: .5em; }
.fl-route path { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 1 7; }
.fl-route circle { fill: #fff; stroke: var(--accent); stroke-width: 3; }
.fl-route circle.a { fill: var(--deep); stroke: var(--deep); }
.fl-sign { right: calc(50% + 12.5em); bottom: 10em; }
.fl-sign svg { height: 4.6em; margin: .5em 0 .7em; border-bottom: 1px dashed #c9d3dd; }
.fl-sign path { stroke: var(--deep); stroke-width: 2.4; }
.fl-sign span { font-size: .95em; font-weight: 700; color: var(--ok); }
.auth-trust { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .8rem; color: rgba(255,255,255,.76); }
.auth-trust li { display: flex; align-items: center; gap: 7px; }
.auth-trust svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auth-kicker { margin: 0 0 6px; font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); }
/* taalkeuze rechtsboven in het aanmeldkaartje */
.auth-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.auth-top .auth-kicker { min-width: 0; overflow-wrap: anywhere; }
.auth-card .lang-pick { display: inline-flex; align-items: center; gap: 4px; margin: -6px -8px 0 0; flex: none; color: var(--muted); font-size: .8rem; }
.lang-pick svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.lang-pick select { width: auto; margin: 0; padding: 5px 26px 5px 6px; font-size: .8rem; border-color: transparent; background-color: transparent; background-position: right 8px center; color: var(--ink-2); }
.lang-pick select:hover, .lang-pick select:focus { border-color: var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* breed scherm: de illustratie toont de drie troeven al, de lijst is er voor kleine schermen */
@media (min-width: 861px) and (min-height: 621px) { .auth-points { display: none; } }

.auth-form { display: grid; place-items: center; padding: 32px 20px max(32px, env(safe-area-inset-bottom)); background: radial-gradient(700px 420px at 100% 0%, rgba(var(--accent-rgb), .09), transparent 70%), radial-gradient(600px 400px at 0% 100%, rgba(var(--brand-rgb), .07), transparent 70%); }
.auth-card { width: 100%; max-width: 410px; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 38px 34px 30px; box-shadow: 0 30px 70px -36px rgba(21,42,59,.55), 0 2px 6px -3px rgba(21,42,59,.12); }
.auth-card h1 { font-size: 1.8rem; margin: 0 0 6px; }
.auth-card > h1 + p { margin: 0 0 22px; color: var(--muted); }
.auth-card label { font-size: .84rem; margin-bottom: 14px; }
.auth-card input { padding: 13px 14px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 52px; }
.pw-toggle { position: absolute; right: 5px; bottom: 5px; width: 40px; height: 38px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 9px; cursor: pointer; }
.pw-toggle:hover { background: #eef3f7; color: var(--deep); }
.pw-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pw-toggle:focus-visible, .btn:focus-visible, .tb-user:focus-visible, .tb-menu:focus-visible, a:focus-visible { outline: 3px solid rgba(var(--brand-rgb), .45); outline-offset: 2px; }
.caps { display: flex; align-items: center; gap: 7px; margin: -6px 0 12px; font-size: .82rem; font-weight: 600; color: #92400e; }
.caps svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.auth-msg { display: flex; gap: 9px; align-items: flex-start; margin: 0 0 14px; padding: 11px 13px; border-radius: 12px; font-size: .9rem; font-weight: 600; background: #fdecea; color: #8f2419; }
.auth-msg.lock { background: #fef3c7; color: #854d0e; }
.auth-msg.ok { background: #dcfce7; color: #166534; }
.auth-msg svg { width: 18px; height: 18px; flex: none; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auth-card .btn-big { margin-top: 4px; padding: 15px; }
.spin { width: 17px; height: 17px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } .btn { transition: none; } }
.auth-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px; margin: 20px 0 0; font-size: .76rem; color: var(--muted); }
.auth-foot svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; }
.auth-foot .warn { color: #92400e; }
.auth-card .auth-help { margin: 16px 0 0; text-align: center; font-size: .82rem; color: var(--muted); }
.pw-rules { margin: -4px 0 14px; font-size: .82rem; color: var(--muted); }
.pw-rules.ok { color: var(--ok); }
/* één kolom: verplicht nieuw wachtwoord kiezen */
.auth.single { grid-template-columns: minmax(0, 1fr); background: radial-gradient(900px 500px at 50% -10%, rgba(var(--brand-rgb), .14), transparent 70%), #f4f7fa; }
.auth.single .auth-form { align-content: center; gap: 22px; }
.auth.single .auth-id { color: var(--deep); justify-content: center; }

@media (max-width: 1180px) { .fl { display: none; } .auth-points small { display: none; } }
@media (max-height: 800px) and (min-width: 861px) { .auth-brand { gap: 16px; padding-top: 28px; padding-bottom: 24px; } .auth-tag { font-size: 1.5rem; max-width: none; } .auth-sub { font-size: .95rem; } .auth-trust { font-size: .76rem; gap: 6px 16px; } }
@media (max-height: 620px) and (min-width: 861px) { .stage { display: none; } .auth-trust { margin-top: auto; } }
/* tablet staand en gsm: het productpaneel wordt een compacte band bovenaan, het formulier blijft boven de vouw */
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-brand { gap: 14px; padding: max(22px, env(safe-area-inset-top)) 22px 22px; }
  .auth-tag { font-size: 1.2rem; max-width: none; }
  .auth-points { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: none; }
  .auth-points li { flex-direction: column; align-items: flex-start; gap: 8px; font-size: .84rem; }
  .stage, .auth-trust, .auth-sub { display: none; }
  .auth-form { place-items: start center; padding-top: 26px; }
}
@media (max-width: 600px) {
  .auth-brand { gap: 10px; padding: max(16px, env(safe-area-inset-top)) 18px 16px; }
  .auth-id { font-size: 1.12rem; }
  .auth-id .tb-logo { height: 36px; min-width: 36px; } .auth-id .tb-logo img { height: 30px; } .auth-id .tb-logo.is-mark svg { width: 36px; height: 36px; }
  .auth-tag { font-size: 1rem; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
  .auth-points { display: flex; gap: 6px; }
  .auth-points li { flex: 1; flex-direction: row; align-items: center; gap: 6px; font-size: .7rem; line-height: 1.2; padding: 6px 7px; border-radius: 10px; background: rgba(255,255,255,.09); }
  .auth-points .ic { width: 24px; height: 24px; border-radius: 7px; border: 0; background: none; }
  .auth-points svg { width: 17px; height: 17px; }
  .auth-points b { font-weight: 600; }
  .auth-form { padding: 16px 14px max(20px, env(safe-area-inset-bottom)); }
  .auth-card { padding: 22px 18px 18px; border-radius: 18px; }
  .auth-card h1 { font-size: 1.3rem; }
  .auth-card > h1 + p { margin-bottom: 16px; }
}

/* ---------- huisstijl (Instellingen) ---------- */
.brand-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.logo-box { width: 120px; height: 72px; border: 1.5px dashed #b9c7d3; border-radius: 12px; background: #fff; display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: .75rem; font-weight: 600; }
.logo-box img { max-width: 108px; max-height: 60px; object-fit: contain; }
.color-row { display: flex; gap: 8px; align-items: center; margin-top: 5px; }
.color-row input[type=color] { flex: none; width: 48px; height: 44px; padding: 3px; margin: 0; border-radius: 12px; cursor: pointer; }
.color-row input[type=text] { margin: 0; font-family: ui-monospace, Consolas, monospace; text-transform: lowercase; }
.theme-preview { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--bg); }
.theme-preview .pv-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: #fff; background: linear-gradient(100deg, var(--deep-2) 0%, var(--deep) 55%, var(--brand-dark) 100%); border-bottom: 3px solid transparent; border-image: linear-gradient(90deg, var(--brand), var(--accent)) 1; }
.theme-preview .pv-bar strong { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.theme-preview .pv-pill { margin-left: auto; flex: none; padding: 5px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--accent); color: var(--accent-ink); }
.theme-preview .pv-body { padding: 14px 12px; display: grid; gap: 10px; }
.theme-preview .pv-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.theme-preview .pv-steps span { text-align: center; font-size: .68rem; padding: 7px 2px; border-radius: 10px; background: #e9eef3; color: var(--ink-2); font-weight: 600; }
.theme-preview .pv-steps .done { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-edge); }
.theme-preview .pv-note { font-size: .78rem; color: var(--muted); margin: 0; }
.theme-preview a { color: var(--brand-text); font-weight: 600; }
@media (max-width: 700px) { .brand-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- dialoog (tijdelijk wachtwoord, één keer getoond) ---------- */
dialog.dlg { border: 0; border-radius: 20px; padding: 24px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgba(21,42,59,.6); color: var(--ink); }
dialog.dlg::backdrop { background: rgba(18,31,46,.55); }
dialog.dlg h2 { margin-bottom: 8px; }
.secret { display: flex; align-items: center; gap: 8px; margin: 12px 0; padding: 12px 14px; border-radius: 12px; background: #eef3f7; }
.secret code { flex: 1; min-width: 0; font: 700 1.15rem ui-monospace, Consolas, monospace; letter-spacing: .06em; color: var(--deep); overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .9rem; margin: 10px 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* ---------- werkbon mailen ---------- */
dialog.dlg:has(.mail-form) { width: min(520px, calc(100vw - 32px)); }
.mail-form label { margin-bottom: 4px; }
.mail-form textarea { resize: vertical; min-height: 92px; }
.mail-hint { margin: 0 0 12px; }
.mail-count { text-align: right; margin: -2px 0 8px; font-variant-numeric: tabular-nums; }
.mail-kv { padding: 10px 12px; border-radius: 12px; background: #f3f6f9; font-size: .85rem; }
.mail-kv dd { font-weight: 600; }
.mail-kv a { color: var(--brand-text); }
.mail-warn { color: #8f2419; }
.dlg-actions { justify-content: flex-end; margin-top: 14px; }
.mail-log { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; background: #fff; font-size: .88rem; }
.mail-log p { margin: 3px 0; overflow-wrap: anywhere; }
.mail-log .mail-fail { color: #8f2419; }

/* ---------- platformbeheerder: firma's ---------- */
.co { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.co:last-child { border-bottom: 0; }
.co-txt { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.co-txt strong { color: var(--deep); }
.co-act { display: flex; gap: 6px; flex-wrap: wrap; }
.b-actief { background: #dcfce7; color: #166534; }
.b-inactief { background: #e5e7eb; color: #4b5563; }

/* ---------- tabellen ---------- */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- handtekening ---------- */
.sig { width: 100%; height: 190px; border: 2px dashed #b9c7d3; border-radius: 14px; background: #fff; touch-action: none; display: block; }
.sig-img { max-width: 100%; width: 260px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.sig-proof { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: #f3faf6; }
.sig-proof.sig-changed { border-left-color: var(--danger); background: #fdf2f2; }
.sig-proof p { margin: 4px 0 0; }

.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--deep); color: #fff; padding: 12px 20px; border-radius: 999px; opacity: 0; transition: .25s; pointer-events: none; z-index: 100; max-width: 90vw; box-shadow: var(--shadow-lg); font-weight: 600; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--danger); }

/* lijsten lopen mee met de pagina (geen eigen schuifkader dat de lijst afkapt) */
.search-results { min-height: 120px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
pre.json { background: var(--deep-2); color: #d1fae5; padding: 12px; border-radius: 12px; overflow: auto; font-size: .78rem; max-height: 300px; }

/* ---------- gsm (o.a. iPhone 12 mini = 375 px) ---------- */
@media (max-width: 600px) {
  body { font-size: 14.5px; }
  h1 { font-size: 1.35rem; }
  .view { padding: 16px 12px calc(110px + env(safe-area-inset-bottom)); }
  .card { padding: 14px; border-radius: 16px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .grid2 > label[style*="padding-top"] { padding-top: 0 !important; }
  .grid3 { gap: 8px; }
  /* filterrijen (datum/selectie/invoer): 2 naast elkaar, anders worden de velden te smal */
  .grid3.filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
  .filters .full { grid-column: 1 / -1; }
  .filters .full::before { content: none; }
  .grid3 > .card { padding: 12px 10px; }
  .grid3 .small { font-size: .72rem; line-height: 1.25; }
  .big-num { font-size: 1.35rem; }
  .card-list { padding: 12px; }
  .list-item { padding: 10px 6px; margin: 0 -6px; gap: 8px; }
  .list-item strong { font-size: .95rem; }
  .list-item .aside:empty { display: none; }
  .btn { padding: 11px 15px; }
  .step { font-size: .66rem; padding: 8px 2px; }
  .step b { font-size: .92rem; }
  /* brede tabellen (materiaal, facturatie, medewerkers) horizontaal laten scrollen i.p.v. over de rand */
  .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card-dark { overflow: hidden; }
  th, td { padding: 8px 6px; }
  table { font-size: .85rem; }
  .tb-brand strong { font-size: 1rem; }
  /* werkbon-rij op een gsm: status + nummer (+ datum) op regel 1, technieker · omschrijving op een eigen regel */
  .bon-meta { flex-direction: column; align-items: stretch; gap: 2px; }
  .bon-l1 { display: flex; align-items: center; gap: 7px; min-width: 0; }
  .bon-title.after-ref { margin-left: 0; }
  .bon-sep { display: none; }
  .today-list .bon-date { display: none; }   /* in "Vandaag" is de datum altijd vandaag */
}

/* ---------- werkbon afdrukken ---------- */
.print-area { display: none; }
@media print {
  body { background: #fff; }
  body::before { display: none; }
  body > *:not(.print-area) { display: none !important; }
  .print-area { display: block !important; color: #000; font-size: 12px; font-family: Inter, Arial, sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-area table { width: 100%; border-collapse: collapse; }
  .print-area th { text-align: left; font-size: 10px; text-transform: uppercase; color: #555; }
  .print-area .num { text-align: right; }
  .print-area h1 { font-size: 20px; }
  .print-area table td, .print-area table th { border-bottom: 1px solid #ccc; padding: 5px; }
  .print-area .print-foot { font-size: 9px; color: #888; margin-top: 14px; text-align: right; }
  @page { margin: 16mm; }
}

/* gsm en tablet: geen schermtitels die de menunaam herhalen (de onderbalk toont het actieve menu), meer plaats.
   De titel blijft voor schermlezers. */
@media (max-width: 800px) {
  .screen-title { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .page-head { margin-bottom: 12px; justify-content: flex-end; }
  .view { padding-top: 14px; }
}

/* aanmelden op gsm en tablet: dezelfde illustratie als op pc (gsm met route en handtekening), compact in de band
   bovenaan; ze vervangt daar de drie tegeltjes. Bij een open toetsenbord valt de hele band weg (zie kb-open). */
@media (max-width: 860px) {
  .auth .stage { display: block; flex: none; height: 300px; margin: 4px -22px -22px; }
  /* vaste schaal i.p.v. cqh: oudere iPhones (iOS 15) kennen geen containereenheden */
  .auth .stage-in { font-size: calc(300px / 56); }
  .auth .fl { display: block; }
  .auth .auth-points { display: none; }
}
@media (max-width: 600px) {
  .auth .stage { height: 250px; margin: 2px -18px -16px; }
  .auth .stage-in { font-size: calc(250px / 56); }
}
@media (max-width: 600px) and (max-height: 700px) {
  .auth .stage { height: 190px; }
  .auth .stage-in { font-size: calc(190px / 56); }
}

/* aanmelden: geen ondertitel meer onder "Welkom terug", dus de ruimte tot het eerste veld op de titel zelf */
#loginForm h1 { margin-bottom: 20px; }
@media (max-width: 600px) { #loginForm h1 { margin-bottom: 14px; } }

/* Werkbonnen en Uren: kleine knoppen Excel / mailen / afdrukken, rechts bovenaan */
.xbar { display: flex; gap: 8px; margin-left: auto; }
.xbtn { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--deep); cursor: pointer; box-shadow: 0 2px 6px -4px rgba(21,42,59,.35); text-decoration: none; }
.xbtn:hover { border-color: var(--accent-text); }
.xbtn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.x-excel .x-fill { fill: #107c41; stroke: #107c41; }
.x-excel .x-mark { stroke: #fff; stroke-width: 2.4; }
/* filters Werkbonnen (beheerder): Klant, Status, Technieker, Van, Tot; op gsm Klant over de volle breedte, Van en Tot naast elkaar */
.grid3.filters-lijst-admin { grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) {
  .grid3.filters-lijst-admin { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-lijst-admin .f-client { grid-column: 1 / -1; }
}
/* twee filters (Van/Tot, Dag/Technieker) blijven ook op gsm naast elkaar */
.grid2.pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }

/* accountscherm: link naar de handleiding */
.manual-link { display: flex; align-items: center; gap: 14px; max-width: 460px; text-decoration: none; color: var(--ink); }
.manual-link:hover { border-color: var(--accent-text); }
.manual-ic { font-size: 1.6rem; line-height: 1; }
.manual-link b { display: block; color: var(--deep); }
.manual-link small { color: var(--muted); }

/* ======================================================================================================
   Werkbon: hoofding met klant, snelknoppen en statusbalk (Gepland → Bezig → Afgewerkt → Gefactureerd)
   ====================================================================================================== */
.back-link { display: inline-block; margin-bottom: 10px; }
.b-gepland { background: #ede9fe; color: #5b21b6; }
.bon-hero { padding: 18px 18px 14px; }
.bon-hero-main { display: flex; align-items: center; gap: 14px; }
.bon-hero-main .avatar { width: 52px; height: 52px; font-size: 17px; }
.bon-hero-txt { flex: 1; min-width: 0; }
.bon-hero-txt h1 { margin: 2px 0 2px; font-size: 1.45rem; overflow-wrap: anywhere; }
.bon-hero-ref { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.bon-plan { margin: 10px 0 0; padding: 8px 12px; border-radius: 12px; background: #f5f3ff; color: #4c1d95; font-weight: 600; }
.status-track { list-style: none; display: flex; gap: 4px; margin: 14px 0 0; padding: 0; }
.status-track li { flex: 1; min-width: 0; position: relative; padding-top: 12px; text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); }
.status-track li::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; border-radius: 99px; background: #e3e9ef; }
.status-track li.done { color: var(--ink-2); }
.status-track li.done::before { background: rgba(var(--accent-rgb), .45); }
.status-track li.now { color: var(--deep); }
.status-track li.now::before { background: var(--accent); box-shadow: 0 3px 10px -3px rgba(var(--accent-rgb), .9), 0 0 0 1px var(--accent-edge); }
.status-track span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) {
  .bon-hero { padding: 14px; }
  .bon-hero-main { gap: 10px; align-items: flex-start; }
  .bon-hero-main .avatar { width: 42px; height: 42px; font-size: 14px; }
  .bon-hero-txt h1 { font-size: 1.2rem; }
  .bon-hero .cust-act { flex-direction: column; }
}

/* ---------- Instellingen → Modules ---------- */
.mod-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.mod-tile { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; font-weight: 400; color: var(--ink); }
.mod-tile:has(input:checked) { border-color: var(--accent-text); background: rgba(var(--accent-rgb), .06); }
.mod-tile input { margin-top: 3px; }
.mod-tile b { display: block; font-size: .95rem; color: var(--deep); }
.mod-tile small { display: block; font-size: .8rem; color: var(--muted); line-height: 1.4; margin-top: 2px; }
@media (max-width: 760px) { .mod-grid { grid-template-columns: minmax(0, 1fr); } }

/* ======================================================================================================
   Module Planning: planbord (technieker × dag), kaarten verslepen
   ====================================================================================================== */
.pb-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pb-title { font-weight: 800; color: var(--deep); margin: 0 8px; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: #e7edf3; }
.seg a { padding: 5px 12px; border-radius: 999px; font-size: .82rem; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.seg a.on { background: #fff; color: var(--deep); box-shadow: 0 2px 6px -3px rgba(21,42,59,.4); }
.pb-wrap { padding: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.plan-board { display: grid; grid-template-columns: 170px repeat(var(--days), minmax(132px, 1fr)); min-width: calc(170px + var(--days) * 132px); }
.view:has(.plan-board) { max-width: 1400px; }
.pb-corner, .pb-day { position: sticky; top: 0; z-index: 2; background: #f7fafc; border-bottom: 1px solid var(--line); }
.pb-day { padding: 10px 8px; text-align: center; font-size: .78rem; color: var(--muted); border-left: 1px solid var(--line); }
.pb-day b { display: block; font-size: 1rem; color: var(--deep); }
.pb-day span { text-transform: uppercase; font-weight: 700; letter-spacing: .06em; }
.pb-day.is-today { background: rgba(var(--accent-rgb), .1); }
.pb-day.is-today b { color: var(--accent-text); }
.pb-user { position: sticky; left: 0; z-index: 1; display: flex; align-items: center; gap: 9px; padding: 10px; background: #fff; border-bottom: 1px solid var(--line); min-width: 0; }
.pb-user .avatar { width: 34px; height: 34px; font-size: 12px; }
.pb-user > span:last-child { min-width: 0; }
.pb-user b { display: block; font-size: .9rem; color: var(--deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-user small { display: block; font-size: .74rem; color: var(--muted); }
.pb-cell { display: flex; flex-direction: column; gap: 6px; padding: 6px; min-height: 92px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background .12s; }
.pb-cell.is-today { background: rgba(var(--accent-rgb), .04); }
.pb-cell.drop-on { background: rgba(var(--accent-rgb), .16); box-shadow: inset 0 0 0 2px var(--accent); }
.pb-card { display: grid; gap: 1px; padding: 7px 9px 8px; border-radius: 10px; background: #fff; border: 1px solid var(--line); border-left: 4px solid #7c3aed; font-size: .8rem; line-height: 1.3; cursor: pointer; box-shadow: 0 3px 8px -6px rgba(21,42,59,.5); min-width: 0; }
.pb-card[draggable="true"] { cursor: grab; }
.pb-card:hover, .pb-card:focus-visible { border-color: var(--accent-text); outline: none; }
.pb-card.dragging { opacity: .45; }
.pb-card b { color: var(--deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-card small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-time { font-weight: 800; font-size: .74rem; color: #5b21b6; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pb-time .badge { padding: 1px 7px; font-size: .64rem; }
.pb-card.s-bezig { border-left-color: #d97706; }
.pb-card.s-bezig .pb-time { color: #92400e; }
.pb-card.s-afgewerkt, .pb-card.s-gefactureerd { border-left-color: #16a34a; opacity: .78; }
.pb-card.s-afgewerkt .pb-time, .pb-card.s-gefactureerd .pb-time { color: #166534; }
.pb-add { margin-top: auto; align-self: stretch; border: 1.5px dashed #c9d4de; border-radius: 10px; background: none; color: var(--muted); font-size: 1.05rem; line-height: 1; padding: 6px; cursor: pointer; opacity: .55; }
.pb-cell:hover .pb-add, .pb-add:focus-visible { opacity: 1; border-color: var(--accent-text); color: var(--accent-text); }
@media (pointer: coarse) { .pb-add { opacity: 1; } }
.pb-help { margin: 0 4px 14px; }
.plan-pick { max-height: 240px; overflow-y: auto; margin: -6px 0 6px; }
/* dagweergave (gsm): één kolom, de technieker naast zijn opdrachten */
@media (max-width: 760px) {
  .plan-board.is-day { grid-template-columns: 112px minmax(0, 1fr); min-width: 0; }
  .plan-board.is-day .pb-user { flex-direction: column; align-items: flex-start; gap: 4px; }
  .pb-title { flex-basis: 100%; margin: 4px 0 0; order: 9; }
}

/* Vandaag: geplande opdrachten */
.plan-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.plan-row:last-child { border-bottom: 0; }
.plan-row.is-today { background: rgba(124,58,237,.05); border-radius: 12px; }
.plan-when { flex: none; width: 66px; text-align: center; }
.plan-when b { display: block; font-size: 1.05rem; color: #5b21b6; }
.plan-when small { font-size: .72rem; color: var(--muted); }
.plan-what { flex: 1; min-width: 0; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.plan-what strong { color: var(--deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-what small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ======================================================================================================
   Module Foto's
   ====================================================================================================== */
.photo-btns { gap: 6px; }
.photo-btns .btn { cursor: pointer; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 4px; }
.photo { position: relative; padding: 0; border: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 1; background: #e7edf3; cursor: zoom-in; box-shadow: 0 4px 12px -8px rgba(21,42,59,.6); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo span { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 7px 5px; font-size: .7rem; font-weight: 600; color: #fff; text-align: left; background: linear-gradient(transparent, rgba(0,0,0,.7)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
dialog.dlg:has(.photo-view) { width: min(760px, calc(100vw - 24px)); }
.photo-view { margin: -8px -8px 0; border-radius: 14px; overflow: hidden; background: #0b131c; display: grid; place-items: center; }
.photo-view img { max-width: 100%; max-height: 65vh; display: block; }

/* ======================================================================================================
   Module Artikels: zoeklijst bij Materiaal, scanner, beheerlijst
   ====================================================================================================== */
.mat-row { position: relative; }
.mat-desc { position: relative; flex: 3; min-width: 180px; }
.mat-desc input { margin-top: 0; }
.mat-row > input { margin-top: 0; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 15; max-height: 300px; overflow-y: auto; padding: 5px; background: #fff; border: 1px solid #dfe6ec; border-radius: 14px; box-shadow: 0 20px 40px -16px rgba(21,42,59,.55); }
.ac-item { display: block; width: 100%; text-align: left; padding: 9px 11px; border: 0; border-radius: 10px; background: none; font: inherit; cursor: pointer; }
.ac-item:hover, .ac-item.on { background: rgba(var(--accent-rgb), .1); }
.ac-item b { display: block; color: var(--deep); font-size: .92rem; }
.ac-item small { color: var(--muted); font-size: .78rem; }
.ac-chip { margin: 8px 2px 0; color: var(--ink-2); }
.linkbtn { border: 0; background: none; padding: 0 0 0 6px; font: inherit; color: var(--brand-text); text-decoration: underline; cursor: pointer; }
.scan-btn { padding: 9px 11px; }
.scan-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.scan-view { position: relative; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.scan-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-line { position: absolute; left: 10%; right: 10%; top: 50%; height: 2px; background: #ef4444; box-shadow: 0 0 12px #ef4444; }
.art-table tr[data-art] { cursor: pointer; }
.art-table tr[data-art]:hover td { background: rgba(var(--brand-rgb), .05); }
.art-table tr.is-off td { opacity: .6; }
.art-table td b { color: var(--deep); }
/* gsm: de kaart mag niet horizontaal scrollen (de zoeklijst van Materiaal hangt eruit) */
@media (max-width: 600px) { .card:has(.mat-row) { overflow: visible; } }
/* zoeklijst open: de materiaalkaart boven de volgende kaarten (die door backdrop-filter een eigen laag hebben) */
.card:has(.ac-list:not([hidden])) { position: relative; z-index: 6; }
.page-head > .pb-nav { flex: 1 1 auto; justify-content: flex-end; min-width: 0; }

/* ======================================================================================================
   Modules Projecten en Offertes
   ====================================================================================================== */
.b-p-open { background: #e0edf8; color: #0a5a90; }
.b-p-afgerond { background: #e5e7eb; color: #4b5563; }
.b-q-concept { background: #e5e7eb; color: #374151; }
.b-q-verstuurd { background: #e0edf8; color: #0a5a90; }
.b-q-aanvaard { background: #dcfce7; color: #166534; }
.b-q-geweigerd { background: #fee2e2; color: #991b1b; }
.page-head > .seg { flex: none; }
/* vier kerncijfers (project): op pc naast elkaar, op gsm twee per rij */
.grid3.kpi4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid3.kpi4 > .card:nth-child(4)::before { background: #7c3aed; }
.kpi4 .big-num { font-size: 1.55rem; }
@media (max-width: 600px) { .grid3.kpi4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi4 .big-num { font-size: 1.15rem; } }
.q-total { flex: none; text-align: right; }
.q-total small { display: block; font-size: .72rem; color: var(--muted); }
.q-total b { font-size: 1.35rem; color: var(--deep); letter-spacing: -.02em; white-space: nowrap; }
.status-track li.is-no.now::before { background: var(--danger); box-shadow: none; }
.q-lines td { vertical-align: middle; }
.q-lines input, .q-lines select { margin: 0; padding: 7px 9px; font-size: .9rem; border-radius: 9px; }
.q-lines td:first-child { min-width: 220px; }
.q-lines .q-kind { margin-top: 4px; width: auto; font-size: .78rem; padding: 4px 30px 4px 8px; }
.q-qty { display: flex; gap: 4px; justify-content: flex-end; }
.q-qty input:first-child { width: 78px; text-align: right; }
.q-qty input:last-child { width: 52px; }
.q-lines input[data-f="unit_price"] { width: 92px; text-align: right; margin-left: auto; }
@media (max-width: 600px) { .bon-hero .q-total b { font-size: 1.05rem; } }

/* offertelijnen op gsm: elke lijn een blokje (omschrijving bovenaan, daaronder aantal · prijs · totaal), totalen als rijen */
@media (max-width: 600px) {
  .q-lines, .q-lines tbody { display: block; }
  .q-lines tr:first-child { display: none !important; }
  .q-lines tr { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 6px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .q-lines td { border: 0; padding: 0; min-width: 0; }
  .q-lines tr[data-line] td:first-child { grid-column: 1 / -1; min-width: 0; }
  .q-lines tr[data-line] td:nth-child(4) { text-align: right; font-weight: 700; }
  .q-lines tr:not([data-line]) { display: flex; justify-content: space-between; padding: 7px 0; }
  .q-lines tr:not([data-line]) td:empty { display: none; }
  .q-lines tr:not([data-line]) td { text-align: left; }
  .q-qty input:first-child { width: 64px; }
  .q-lines input[data-f=unit_price] { width: 80px; margin-left: 0; }
}
/* veel menu's (modules aan): het hamburgermenu al vanaf 1500 px */
@media (max-width: 1500px) {
  .topbar.many .tb-nav { display: none; }
  .topbar.many .tb-menu:not([hidden]) { display: grid; }
}

/* ---------- breed scherm: meer plaats gebruiken ---------- */
@media (min-width: 1100px) { .view { max-width: 1440px; padding: 26px 32px 120px; } }
.bon-facts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; flex: 0 1 auto; max-width: 48%; }
.fact { font-size: .76rem; font-weight: 600; color: #475569; background: #f1f5f9; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.bon-amt { font-weight: 700; color: var(--deep); font-size: .82rem; white-space: nowrap; }
.lijst-kpi { margin-bottom: 14px; }
@media (max-width: 900px) { .bon-facts { display: none; } }
/* werkbon: breed scherm in twee kolommen (invullen links, project/foto's/facturatie rechts) */
@media (min-width: 1100px) {
  .bon-cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 0 18px; align-items: start; }

}
/* gsm/tablet: één kolom in de volgorde van het werk: tijden, werken, materiaal, project, foto's, handtekening, facturatie */
@media (max-width: 1099px) {
  .bon-cols { display: flex; flex-direction: column; }
  .bon-main, .bon-side { display: contents; }
  .bon-cols > * > .bon-sig { order: 1; }
  .bon-cols > * > .bon-late { order: 2; }
}
.cust-txt { flex: 1 1 auto; }
.cust-facts { max-width: 60%; }
/* Instellingen: breed scherm in twee kolommen kaarten */
@media (min-width: 1100px) {
  .view:has(> .settings-title) { column-count: 2; column-gap: 18px; }
  .view:has(> .settings-title) > * { break-inside: avoid; }
  .view:has(> .settings-title) > .settings-title { column-span: all; }
}
label.chk.chk-long { white-space: normal; align-items: flex-start; gap: 8px; } label.chk.chk-long input { margin-top: 3px; flex: none; }
@media (min-width: 901px) { .q-lines td:first-child { width: 55%; } }
.peppol-badge { display: inline-block; margin-left: 8px; font-size: .74rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; background: #f1f5f9; color: #475569; }
.peppol-badge.pp-yes { background: #dcfce7; color: #166534; }
.peppol-badge.pp-no { background: #fef3c7; color: #92400e; }
/* ---------- menu in groepen (volgorde van het werk) ---------- */
.tb-nav { overflow: visible; align-items: center; }
.tb-grp { position: relative; }
.tb-gbtn { background: none; border: 0; color: rgba(255,255,255,.72); padding: 7px 14px; border-radius: 999px; font: inherit; font-weight: 600; font-size: .92rem; white-space: nowrap; cursor: pointer; transition: .15s; }
.tb-gbtn:hover, .tb-grp.open .tb-gbtn { background: rgba(255,255,255,.1); color: #fff; }
.tb-grp.active .tb-gbtn { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -8px rgba(var(--accent-rgb), .8); }
.tb-gdrop { display: none; position: absolute; top: 100%; left: 0; z-index: 40; min-width: 200px; padding: 8px; margin-top: 6px; background: #fff; border: 1px solid #e3e8ee; border-radius: 14px; box-shadow: 0 24px 50px -16px rgba(21,42,59,.55); flex-direction: column; gap: 2px; }
.tb-gdrop::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }   /* geen gat tussen knop en menu bij aanwijzen */
.tb-grp.open .tb-gdrop { display: flex; }
@media (hover: hover) and (pointer: fine) { .tb-grp:hover .tb-gdrop { display: flex; } }
.tb-gdrop a { color: var(--deep); padding: 10px 14px; border-radius: 10px; }
.tb-gdrop a:hover { background: #eef3f7; color: var(--deep); }
.tb-gdrop a.active { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.tb-sec { padding: 10px 14px 4px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #7a8794; }
.tb-drop .tb-sec:first-child { padding-top: 4px; }
/* module Facturen */
.b-i-concept { background: #e5e7eb; color: #374151; }
.b-i-open { background: #e0edf8; color: #0a5a90; }
.b-i-betaald { background: #dcfce7; color: #166534; }
.b-i-vervallen { background: #fee2e2; color: #991b1b; }
.i-problems { margin: 0 0 4px; padding-left: 18px; color: #92400e; }
.i-problems li { margin: 2px 0; }
.i-lines select.q-kind { margin-top: 0; }
/* breed scherm: dialogen groter (klant kiezen, mailen, inplannen) */
@media (min-width: 900px) {
  dialog.dlg { width: min(640px, calc(100vw - 48px)); padding: 30px 34px; }
  dialog.dlg:has(.mail-form) { width: min(760px, calc(100vw - 48px)); }
  dialog.dlg h2 { font-size: 1.45rem; }
  dialog.dlg .plan-pick { max-height: min(46vh, 440px); }
  dialog.dlg .mail-form textarea { min-height: 120px; }
}
/* ---------- projectdashboard ---------- */
.pv-tabs { display: flex; gap: 4px; margin: 0 0 14px; padding: 5px; background: rgba(255,255,255,.7); border: 1px solid var(--glass-line); border-radius: 14px; overflow-x: auto; scrollbar-width: none; }
.pv-tabs a { flex: 1 0 auto; text-align: center; padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: .92rem; color: #5b6b7a; text-decoration: none; white-space: nowrap; }
.pv-tabs a span { display: inline-block; min-width: 22px; padding: 1px 7px; margin-left: 4px; border-radius: 999px; background: #e8eef3; color: #475569; font-size: .75rem; }
.pv-tabs a:hover { background: #f1f5f9; color: var(--deep); }
.pv-tabs a.on { background: var(--deep); color: #fff; box-shadow: 0 6px 16px -10px rgba(21,42,59,.8); }
.pv-tabs a.on span { background: rgba(255,255,255,.18); color: #fff; }
.pv-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 0 18px; align-items: start; }
@media (max-width: 1000px) { .pv-grid { grid-template-columns: minmax(0, 1fr); } }
.pv-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pv-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.pv-row:last-child { border-bottom: 0; }
.pv-row:nth-child(even) { background: #fafbfc; }
.pv-l { flex: 1 1 auto; min-width: 0; font-weight: 600; color: var(--deep); display: flex; flex-direction: column; }
.pv-l small { font-weight: 500; color: #7a8794; font-size: .74rem; }
.pv-v { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.pv-pill { font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 7px; background: #3b4f63; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pv-pill.warn { background: #ea7a12; }
.pv-pill.bad { background: #b91c1c; }
.pv-pill.muted { background: #e5e9ee; color: #475569; }
.pv-add, .pv-add-ph { flex: none; width: 30px; height: 30px; }
.pv-add { border-radius: 50%; border: 1.5px solid #3b4f63; background: #fff; color: #3b4f63; font-weight: 800; cursor: pointer; line-height: 1; }
.pv-add:hover { background: #3b4f63; color: #fff; }
.pv-alert { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: #fff4e5; color: #8a4b08; border: 1px solid #f6d3a5; font-size: .9rem; }
.pv-sched { margin: 12px 0 0; }
.badge.b-late { background: #fff1de; color: #9a4a00; }
.fact.fact-warn { background: #fff1de; color: #9a4a00; }
.pv-chart { display: grid; gap: 10px; margin: 6px 0 16px; }
.pv-bar { display: grid; grid-template-columns: 96px minmax(0, 1fr) 110px; align-items: center; gap: 10px; }
.pv-bl { font-size: .85rem; color: #475569; font-weight: 600; }
.pv-track { height: 14px; background: #eef2f6; border-radius: 4px; overflow: hidden; }
.pv-fill { display: block; height: 100%; background: var(--brand); border-radius: 0 4px 4px 0; }
.pv-bv { text-align: right; font-weight: 700; color: var(--deep); font-variant-numeric: tabular-nums; font-size: .9rem; }
.pv-bar:hover .pv-fill { filter: brightness(1.12); }
.pv-fin { width: 100%; margin: 0; }
.pv-fin td.neg { color: #b91c1c; }
.pv-fin tr.pv-res td { font-weight: 800; border-top: 2px solid var(--deep); }
.pv-progs { display: grid; gap: 12px; }
.pv-prog { display: grid; gap: 4px; font-size: .88rem; }
.pv-ptrack { height: 8px; border-radius: 4px; background: #eef2f6; overflow: hidden; }
.pv-ptrack span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.pv-ptrack span.over { background: #b91c1c; }
@media (max-width: 600px) { .pv-bar { grid-template-columns: 78px minmax(0, 1fr) 92px; } }
/* gsm/smal: statusknoppen (Alle/Concept/…) volledig zichtbaar op een eigen rij, horizontaal schuifbaar als ze niet passen */
@media (max-width: 760px) {
  .page-head > .seg { order: 5; display: flex; flex: 1 1 100%; max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .page-head > .seg::-webkit-scrollbar { display: none; }
  .page-head > .seg a { flex: 1 0 auto; text-align: center; white-space: nowrap; padding: 8px 12px; }
}
/* werkbon: tijden als tegels */
.tsum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.tsum-i { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: #f3f6f9; border: 1px solid var(--line); min-width: 0; }
.tsum-i span { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #6b7785; }
.tsum-i b { font-size: 1.35rem; font-weight: 800; color: var(--deep); line-height: 1.15; font-variant-numeric: tabular-nums; }
.tsum-i small { font-size: .74rem; color: #7a8794; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsum-i.main { background: rgba(var(--brand-rgb), .07); border-color: rgba(var(--brand-rgb), .18); }
@media (max-width: 420px) { .tsum { gap: 6px; } .tsum-i { padding: 8px 9px; } .tsum-i b { font-size: 1.12rem; } .tsum-i small { white-space: normal; } }
/* factuurlijnen: omschrijving zo breed mogelijk; tot 1000 px elke lijn een kaartje (omschrijving over de volle breedte,
   daaronder aantal · prijs · btw · totaal · ✕), totalen als rijen */
.i-lines td:first-child input[data-f=description] { width: 100%; }
@media (min-width: 1001px) { .i-lines td:first-child { width: 46%; } }
@media (max-width: 1000px) {
  .i-lines, .i-lines tbody { display: block; }
  .i-lines tr:first-child { display: none !important; }
  .i-lines tr[data-line] { display: grid; grid-template-columns: auto auto auto 1fr auto; align-items: center; gap: 8px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .i-lines td { border: 0; padding: 0; min-width: 0; }
  .i-lines tr[data-line] td:first-child { grid-column: 1 / -1; width: auto; }
  .i-lines tr[data-line] td:nth-child(5) { text-align: right; font-weight: 800; font-size: 1rem; }
  .i-lines tr:not([data-line]) { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .i-lines tr:not([data-line]) td:empty { display: none; }
  .i-lines tr:not([data-line]) td { text-align: left; }
  .i-lines input[data-f=description] { font-size: 1rem; padding: 10px 12px; }
  .i-lines input[data-f=unit_price] { width: 92px; margin-left: 0; }
}
@media (min-width: 601px) and (max-width: 900px) { .grid3.kpi4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) { #iAdd .mat-desc, #qAdd .mat-desc { flex: 1 1 100%; } }
/* ---------- Vloto AI (chat rechtsonder) ---------- */
.ai-btn { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, var(--deep), #2b4f78); color: #fff; font: inherit; font-weight: 700; box-shadow: 0 14px 34px -12px rgba(21,42,59,.7); }
.ai-btn span { font-size: 1.15rem; color: #8ef0c2; }
.ai-btn:hover { filter: brightness(1.12); }
.ai-btn[hidden], .ai-panel[hidden] { display: none; }
body.ai-open .ai-btn { display: none; }
.ai-panel { position: fixed; right: 22px; bottom: 22px; z-index: 61; width: min(440px, calc(100vw - 32px)); height: min(640px, calc(100vh - 110px));
  display: flex; flex-direction: column; background: #fff; border-radius: 20px; box-shadow: 0 30px 80px -20px rgba(21,42,59,.55); border: 1px solid #e3e8ee; overflow: hidden; }
.ai-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: linear-gradient(135deg, var(--deep), #2b4f78); color: #fff; }
.ai-head small { display: block; color: rgba(255,255,255,.72); font-size: .76rem; }
.ai-logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.12); color: #8ef0c2; font-size: 1.2rem; }
.ai-x { margin-left: auto; border: 0; background: rgba(255,255,255,.12); color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.ai-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #f6f8fb; }
.ai-msg { max-width: 92%; padding: 10px 14px; border-radius: 14px; font-size: .93rem; line-height: 1.5; }
.ai-msg p { margin: 0 0 6px; } .ai-msg p:last-child { margin: 0; }
.ai-msg ul { margin: 4px 0 6px; padding-left: 18px; } .ai-msg li { margin: 3px 0; }
.ai-msg a { color: #0a5a90; font-weight: 600; }
.ai-msg.user { align-self: flex-end; background: var(--deep); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.ai-msg.assistant { align-self: flex-start; background: #fff; border: 1px solid #e3e8ee; border-bottom-left-radius: 4px; color: var(--ink); }
.ai-hello p { margin: 0 0 8px; }
.ai-sug { display: block; width: 100%; text-align: left; margin: 0 0 6px; padding: 9px 12px; border: 1px solid #dfe6ee; border-radius: 12px; background: #fff; color: var(--deep); font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; }
.ai-sug:hover { border-color: var(--deep); }
.ai-busy { display: flex; gap: 5px; }
.ai-busy span { width: 7px; height: 7px; border-radius: 50%; background: #9aa7b4; animation: aiDot 1s infinite ease-in-out; }
.ai-busy span:nth-child(2) { animation-delay: .15s; } .ai-busy span:nth-child(3) { animation-delay: .3s; }
@keyframes aiDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ai-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #e3e8ee; background: #fff; }
.ai-form textarea { flex: 1; margin: 0; resize: none; min-height: 42px; max-height: 140px; padding: 10px 12px; }
.ai-form .btn { padding: 0 16px; }
.ai-foot { padding: 0 14px 10px; background: #fff; }
@media (max-width: 700px) {
  .ai-btn { right: 14px; bottom: calc(84px + env(safe-area-inset-bottom)); padding: 11px 14px; }
  .ai-btn b { display: none; }
  .ai-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; }
}
@media print { .ai-btn, .ai-panel { display: none !important; } }
/* ---------- zijbalk links (beheerder, breed scherm) ---------- */
.ni { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tb-nav a, .tb-drop a { display: inline-flex; align-items: center; gap: 10px; }
.tb-nav > a .ni, .tb-gbtn .ni { display: none; }
@media (min-width: 1100px) {
  body.side { padding-left: 252px; }
  body.side .topbar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 252px; z-index: 40; flex-direction: column; align-items: stretch; gap: 6px;
    padding: 18px 14px 16px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin;
    background: linear-gradient(180deg, var(--deep-2) 0%, var(--deep) 60%, var(--brand-dark) 100%); box-shadow: 4px 0 24px -12px rgba(21,42,59,.6);
  }
  body.side .topbar::after { left: auto; top: 0; bottom: 0; right: -1px; width: 3px; height: auto; background: linear-gradient(180deg, var(--brand), var(--accent)); }
  body.side .tb-brand { padding: 2px 6px 14px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 6px; }
  body.side .tb-brand strong { font-size: 1.02rem; }
  body.side .tb-nav { flex-direction: column; align-items: stretch; gap: 1px; flex: 1 0 auto; overflow: visible; }
  body.side .tb-nav a { border-radius: 10px; padding: 9px 12px; font-size: .93rem; color: rgba(255,255,255,.78); }
  body.side .tb-nav a .ni { display: block; opacity: .9; }
  body.side .tb-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
  body.side .tb-nav a.active { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 18px -10px rgba(var(--accent-rgb), .9); }
  body.side .tb-nav a.active .ni { opacity: 1; }
  /* groepen: kopje + altijd open lijst (geen uitklapmenu in de zijbalk) */
  body.side .tb-grp { position: static; margin-top: 10px; }
  body.side .tb-gbtn { display: block; width: 100%; text-align: left; padding: 6px 12px 4px; pointer-events: none; background: none !important; box-shadow: none !important;
    color: rgba(255,255,255,.45) !important; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; border-radius: 0; }
  body.side .tb-gbtn .g-cur, body.side .tb-gbtn .g-caret { display: none; }
  body.side .tb-gdrop { display: flex !important; position: static; flex-direction: column; gap: 1px; min-width: 0; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
  body.side .tb-gdrop::before { display: none; }
  body.side .tb-gdrop a { color: rgba(255,255,255,.78); }
  body.side .tb-gdrop a:hover { background: rgba(255,255,255,.08); color: #fff; }
  body.side .tb-gdrop a.active { background: var(--accent); color: var(--accent-ink); }
  body.side .tb-user { margin: 14px 0 0; max-width: none; width: 100%; text-align: left; padding: 10px 14px; border-radius: 12px; }
  body.side .tb-menu, body.side .tb-drop { display: none !important; }
  body.side .view { padding-top: 30px; }
  body.side .ai-panel { bottom: 18px; }
}
/* ---------- planning: urenrooster ---------- */
.plan-board.is-tl { grid-template-columns: 180px repeat(var(--days), minmax(220px, 1fr)); min-width: calc(180px + var(--days) * 220px); }
.plan-board.is-tl.is-day { grid-template-columns: 180px minmax(600px, 1fr); min-width: 780px; }
.view:has(.plan-board.is-tl) { max-width: 1700px; }
.plan-board.is-tl .pb-corner { display: flex; align-items: flex-end; padding: 10px; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #6b7785; }
.plan-board.is-tl .pb-day { padding: 8px 0 0; }
.tl-ticks { position: relative; height: 20px; margin-top: 4px; border-top: 1px solid var(--line); }
.tl-ticks i { position: absolute; top: 3px; transform: translateX(-50%); font-style: normal; font-size: .68rem; font-weight: 700; color: #6b7785; }
.tl-ticks i:first-child { transform: none; padding-left: 4px; }
.tl-ticks i:last-child { transform: translateX(-100%); padding-right: 4px; }
.tl-cell { position: relative; display: block; padding: 0; min-height: 70px; cursor: copy;
  background-image: linear-gradient(to right, rgba(21,42,59,.07) 1px, transparent 1px); background-size: calc(100% / var(--hrs)) 100%; }
.tl-card { position: absolute; height: 52px; padding: 5px 8px; border-radius: 8px; overflow: hidden; cursor: pointer; display: grid; align-content: start; gap: 0;
  background: #7c3aed; color: #fff; font-size: .76rem; line-height: 1.25; box-shadow: 0 4px 10px -6px rgba(21,42,59,.6); border: 1px solid rgba(255,255,255,.35); }
.tl-card b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .8rem; }
.tl-card small, .tl-card .tl-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9; }
.tl-card .tl-t { font-weight: 700; font-size: .7rem; }
.tl-card[draggable="true"] { cursor: grab; }
.tl-card.s-bezig { background: #d97706; } .tl-card.s-afgewerkt { background: #16a34a; } .tl-card.s-gefactureerd { background: #2563eb; }
.tl-card:hover, .tl-card:focus-visible { filter: brightness(1.08); outline: 2px solid var(--deep); outline-offset: 1px; z-index: 2; }
.tl-card.dragging { opacity: .45; }
.tl-add { position: absolute; right: 4px; bottom: 4px; width: 22px; height: 22px; padding: 0; min-height: 0; border-radius: 50%; font-size: .8rem; opacity: 0; transition: opacity .12s; }
.tl-cell:hover .tl-add, .tl-add:focus-visible { opacity: 1; }
.tl-todo { padding: 12px 14px; }
.tl-todo-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
.tl-todo-h b { color: var(--deep); } .tl-todo-h small { color: #6b7785; }
.tl-todo-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-chip { display: grid; padding: 7px 12px; border-radius: 10px; background: #fff7ed; border: 1px dashed #f59e0b; cursor: grab; max-width: 260px; font-size: .8rem; }
.tl-chip b { color: #7c2d12; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-chip small { color: #9a3412; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-chip.dragging { opacity: .5; }
.plan-board.is-tl:not(.is-day) { grid-template-columns: 180px repeat(var(--days), minmax(240px, 1fr)); min-width: calc(180px + var(--days) * 240px); }
@media (max-width: 760px) {
  .plan-board.is-tl, .plan-board.is-tl.is-day { grid-template-columns: 112px minmax(520px, 1fr); min-width: 632px; }
  .plan-board.is-tl .pb-user { flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px; }
  .plan-board.is-tl .pb-user .avatar { width: 28px; height: 28px; font-size: 11px; }
}
/* ---------- rapport: kerncijfers en grafieken ---------- */
.rp-flt { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 16px; }
.rp-dates { display: flex; gap: 10px; } .rp-dates label { margin: 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (max-width: 1000px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi-grid .card.kpi { margin: 0; padding: 14px 16px; position: relative; overflow: hidden; }
.kpi-grid .card.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand); }
.kpi-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; color: #52514e; }
.kpi .big-num { font-size: 1.6rem; margin: 4px 0 2px; }
.kd { font-size: .74rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: #eef2f6; color: #52514e; white-space: nowrap; }
.kd.up { background: #e3f4ea; color: #0f6b38; } .kd.down { background: #fdeaea; color: #a1231d; }
.rp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.rp-grid .rp-wide { grid-column: 1 / -1; }
@media (max-width: 900px) { .rp-grid { grid-template-columns: minmax(0, 1fr); } }
.chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.chart .cg { stroke: #e7e9ee; stroke-width: 1; }
.chart .cl { font-size: 11px; fill: #6b7280; font-family: Inter, sans-serif; }
.chart .chit { fill: transparent; }
.chart .cb:hover path { filter: brightness(1.15); }
.chart .cb:hover .chit { fill: rgba(42,120,214,.06); }
.hbars { display: grid; gap: 10px; margin-top: 6px; }
.hb { display: grid; grid-template-columns: minmax(90px, 30%) minmax(0, 1fr) auto; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.hb-l { font-size: .86rem; font-weight: 600; color: var(--deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-t { display: flex; gap: 2px; height: 14px; background: #f1f4f7; border-radius: 4px; overflow: hidden; }
.hb-t i { display: block; height: 100%; }
.hb-t i:first-child { border-radius: 0 0 0 0; } .hb-t i:last-child { border-radius: 0 4px 4px 0; }
.hb-v { font-weight: 700; font-size: .86rem; color: var(--deep); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hb-v small { color: #6b7280; font-weight: 600; }
.hb:hover .hb-t i { filter: brightness(1.12); }
.legend { display: flex; gap: 16px; margin-top: 12px; font-size: .8rem; color: #52514e; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-tip { position: fixed; z-index: 90; pointer-events: none; background: #16283d; color: #fff; padding: 8px 11px; border-radius: 10px; font-size: .8rem; box-shadow: 0 10px 24px -10px rgba(0,0,0,.5); display: grid; gap: 2px; max-width: 260px; }
.chart-tip[hidden] { display: none; }
.chart-tip span { color: rgba(255,255,255,.82); }
tr.rp-tot td { font-weight: 800; border-top: 2px solid var(--deep); }
/* rapport: inzichten (klanten, debiteuren, werkbonnen, offertes) */
.rp-nav { display: flex; align-items: center; gap: 10px; margin: -4px 0 14px; flex-wrap: wrap; }
.rp-nav .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.rp-nav .seg a { white-space: nowrap; }
.rp-sub { margin: 18px 0 8px; font-size: .95rem; color: var(--deep); }
.row.rp-sub h3 { margin: 0; font-size: .95rem; }
.rp-search { margin: 0 0 8px; }
.rp-tsum { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1100px) { .rp-tsum { grid-template-columns: repeat(6, minmax(0, 1fr)); } #rp-werkbonnen .rp-tsum { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
@media (max-width: 600px) { .rp-tsum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rp-late { color: #a1231d; font-weight: 700; }
.rp-age { display: inline-block; min-width: 2.4em; padding: 1px 7px; border-radius: 999px; font-weight: 700; color: #fff; background: var(--c, #a1231d); text-align: center; }
.rp-older { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .85rem; }
.rp-older select { width: auto; min-height: 36px; padding: 4px 30px 4px 10px; }
#rp-klanten td, #rp-debiteuren td, #rp-offertes td { vertical-align: top; }
[data-tbl] table { font-size: .84rem; }
[data-tbl] th { white-space: normal; vertical-align: bottom; line-height: 1.25; }
[data-tbl] td.num { white-space: nowrap; }
[data-tbl] td:first-child { min-width: 170px; }
#rp-debiteuren [data-tbl] td a, #rp-offertes [data-tbl] td > a { white-space: nowrap; }
@media (max-width: 600px) {
  [data-tbl] td:first-child { min-width: 130px; }
  #rp-klanten .hb, #rp-debiteuren .hb, #rp-werkbonnen .hb { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  #rp-klanten .hb-l, #rp-debiteuren .hb-l, #rp-werkbonnen .hb-l { grid-column: 1 / -1; }
}
#rp-klanten [data-tbl] td, #rp-klanten [data-tbl] th { padding-left: 8px; padding-right: 8px; }
#rp-klanten table, #rp-debiteuren table, #rp-offertes table { font-variant-numeric: tabular-nums; }
/* ---------- lijnen toevoegen en verwijderen: duidelijke knoppen ---------- */
.btn-add { flex: 0 0 auto; padding: 0 18px; min-height: 44px; white-space: nowrap; font-weight: 700; }
.btn-del { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px; border: 1px solid #f3c4c0; background: #fff5f4; color: #b42318;
  font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn-del svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-del:hover, .btn-del:focus-visible { background: #fde3e0; border-color: #e8958c; outline: none; }
@media (max-width: 600px) { .btn-del span { display: none; } .btn-del { padding: 8px; } }
.mat-row .btn-add { order: 9; }

/* Offerte online aanvaard door de klant */
.q-signed { display: flex; gap: 14px; align-items: flex-start; border-left: 4px solid #16a34a; }
.q-signed-ic { width: 38px; height: 38px; flex: none; border-radius: 50%; background: #e7f6ec; color: #15803d; display: grid; place-items: center; font-size: 19px; }
.q-remark { margin: 8px 0 0; font-style: italic; }

/* Aankoopfacturen en voorraad */
.badge.b-p-concept { background: #fef3c7; color: #92400e; }
.badge.b-p-open { background: #dbeafe; color: #1e40af; }
.badge.b-p-betaald { background: #dcfce7; color: #166534; }
.p-drop { border: 2px dashed #b9c6d2; border-radius: 14px; padding: 14px 18px; margin: 0 0 14px; display: flex; flex-direction: column; gap: 2px; background: #fbfcfd; }
.p-drop.on { border-color: var(--brand, #0f8b6f); background: #eefaf5; }
@media (max-width: 760px) { .p-drop { display: none; } }
.p-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.p-cols > .p-form > .card:last-child { margin-bottom: 0; }
@media (max-width: 1000px) { .p-cols { grid-template-columns: 1fr; } }
.p-doc { position: sticky; top: 12px; }
.p-doc iframe { width: 100%; height: min(78vh, 900px); border: 1px solid #e3e8ec; border-radius: 10px; background: #f4f6f8; }
.p-doc img { width: 100%; max-height: 78vh; object-fit: contain; border: 1px solid #e3e8ec; border-radius: 10px; background: #f4f6f8; display: block; }
@media (max-width: 1000px) { .p-doc { position: static; } .p-doc iframe { height: 60vh; } }
.p-check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.p-check input { width: 18px; height: 18px; flex: none; }
.p-diff { background: #fff7ed; border-left: 4px solid #ea580c; padding: 8px 12px; border-radius: 6px; margin: 10px 0 0; font-size: 14px; }
.p-warn { border-left: 4px solid #ea580c; background: #fff7ed; }
.p-lines input[data-f="article"] { min-width: 150px; }
.p-busy { position: fixed; inset: 0; background: rgba(15, 23, 32, .45); display: grid; place-items: center; z-index: 1000; padding: 16px; }
.p-busy-box { background: #fff; border-radius: 14px; padding: 22px 26px; max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.p-busy-box small { color: #5b6b7a; }
.p-busy .spinner { width: 34px; height: 34px; border: 4px solid #dbe3ea; border-top-color: var(--brand, #0f8b6f); border-radius: 50%; animation: pspin .8s linear infinite; }
@keyframes pspin { to { transform: rotate(360deg); } }
.st-table { width: 100%; border-collapse: collapse; }
.st-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: #5b6b7a; padding: 8px; border-bottom: 1px solid #e3e8ec; }
.st-table td { padding: 8px; border-bottom: 1px solid #eef2f5; vertical-align: middle; }
.st-table th.num, .st-table td.num { text-align: right; white-space: nowrap; }
.st-table input[data-min] { width: 90px; text-align: right; }
.st-table tr.st-low td:first-child { box-shadow: inset 3px 0 0 #dc2626; }
.st-neg { color: #b91c1c; }
.st-pos { color: #15803d; }
.st-act { display: flex; gap: 6px; justify-content: flex-end; }
@media (max-width: 640px) { .st-act { flex-direction: column; align-items: stretch; } .st-table input[data-min] { width: 64px; } }

/* betaal-QR op het factuurscherm */
.pay-qr { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; }
.pay-qr svg { flex: none; border: 1px solid #e3e8ec; border-radius: 8px; }
.i-noqr { background: #fff7ed; border-left: 4px solid #ea580c; padding: 8px 10px; border-radius: 6px; }

/* gsm: segmentknoppen (Alle / Concept / …) niet laten wegschuiven maar over twee rijen verdelen, zodat elke keuze zichtbaar is */
@media (max-width: 760px) {
  .page-head > .seg { flex-wrap: wrap; overflow-x: visible; border-radius: 16px; gap: 2px; }
  .page-head > .seg a { flex: 1 1 auto; padding: 8px 10px; }
}

/* gsm: het beheermenu (☰) blijft binnen het scherm en scrolt zelf, zodat ook Aankoopfacturen en Beheer bereikbaar zijn
   (zonder hoogtegrens liep de lijst achter de onderbalk weg op een iPhone) */
.tb-drop {
  max-height: calc(100vh - 170px); max-height: calc(100dvh - 150px - env(safe-area-inset-bottom, 0px));
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; z-index: 60;
}
@media (max-width: 760px) {
  .tb-drop { left: 12px; right: 12px; min-width: 0; grid-template-columns: 1fr 1fr; column-gap: 4px; }
  .tb-drop .tb-sec { grid-column: 1 / -1; padding: 8px 10px 2px; }
  .tb-drop a { padding: 10px 10px; font-size: .95rem; }
}

body.menu-open #aiBtn { display: none; }

/* Aankoopfactuur, gsm: elke lijn als kaartje (omschrijving, artikel, dan aantal · prijs · btw, dan totaal en verwijderen).
   Deze tabel heeft een eigen <thead>: niet de eerste lijn verbergen zoals bij .i-lines. */
@media (max-width: 1000px) {
  .p-lines thead { display: none; }
  .p-lines tbody tr:first-child { display: grid !important; }
  .p-lines tbody tr:first-child:not([data-line]) { display: flex !important; }
  .p-lines tr[data-line] { grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 14px 0; }
  .p-lines tr[data-line] td:nth-child(1), .p-lines tr[data-line] td:nth-child(2) { grid-column: 1 / -1; }
  .p-lines tr[data-line] td:nth-child(2) input { width: 100%; min-width: 0; }
  .p-lines tr[data-line] td:nth-child(3) .q-qty { display: flex; gap: 4px; }
  .p-lines tr[data-line] td:nth-child(3) input { width: 100%; min-width: 0; }
  .p-lines tr[data-line] td:nth-child(3) input[data-f=unit] { max-width: 52px; }
  .p-lines tr[data-line] td:nth-child(4) input, .p-lines tr[data-line] td:nth-child(5) select { width: 100%; min-width: 0; margin: 0; }
  .p-lines tr[data-line] td:nth-child(6) { grid-column: 1 / 3; text-align: left; font-weight: 800; font-size: 1.05rem; align-self: center; }
  .p-lines tr[data-line] td:nth-child(6)::before { content: "Totaal excl. btw  "; font-weight: 600; font-size: .85rem; color: var(--ink-2); }
  .p-lines tr[data-line] td:nth-child(7) { grid-column: 3; justify-self: end; }
  .p-lines tr[data-line] td.num { text-align: left; }
  .p-lines tr[data-line] td:nth-child(6).num { text-align: left; }
  #pAdd { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  #pAdd .mat-desc, #pAdd [name=article] { grid-column: 1 / -1; }
  #pAdd > * { width: 100%; min-width: 0; flex: none !important; }
  #pAdd .btn-add { grid-column: 1 / -1; }
}

/* Meldingen bovenaan Vandaag (beheerder) */
.alerts h2 { margin: 0; }
.alerts .al { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; border-radius: 10px; }
.alerts .al:last-child { border-bottom: 0; }
.alerts .al:hover { background: #f4f7fa; }
.alerts .al-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.alerts .al-txt small { color: var(--ink-2, #5b6b7a); font-size: .84rem; }
.al-dot { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .9rem; color: #fff; }
.al-rood .al-dot { background: #dc2626; }
.al-oranje .al-dot { background: #ea8a0c; }
.al-info .al-dot { background: #64748b; }
.al-dot.ok { background: #16a34a; }
.alerts-ok { display: flex; gap: 12px; align-items: center; }

/* Lijnen van offerte, factuur en aankoopfactuur op gsm/tablet: elke lijn een kaartje met labels.
   Offerte: omschrijving + soort | aantal · prijs | totaal + verwijderen.
   Factuur: omschrijving | aantal · prijs · btw | totaal + verwijderen. Aankoopfactuur: zie .p-lines hierboven. */
@media (max-width: 1000px) {
  .q-lines, .q-lines tbody { display: block; }
  .q-lines tr:first-child:not([data-line]) { display: none !important; }
  .q-lines tr[data-line] { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; margin: 0 0 10px; background: #f8fafc; border: 1px solid var(--line); border-radius: 14px; }
  .q-lines tr[data-line] td { border: 0; padding: 0; min-width: 0; text-align: left; }
  .q-lines tr[data-line] td:first-child { grid-column: 1 / -1; width: auto; }
  .q-lines tr[data-line] td:first-child input { width: 100%; font-size: 1rem; padding: 10px 12px; }
  .q-lines tr[data-line] td:first-child .q-kind { width: 100%; margin-top: 8px; font-size: .9rem; padding: 8px 30px 8px 10px; }
  .q-lines tr[data-line] input, .q-lines tr[data-line] select { width: 100%; min-width: 0; margin: 0; font-size: .95rem; padding: 9px 10px; }
  .q-lines tr[data-line] .q-qty { display: flex; gap: 6px; }
  .q-lines tr[data-line] .q-qty input[data-f=unit] { max-width: 60px; }
  .q-lines tr[data-line] td:nth-child(2)::before { content: "Aantal"; }
  .q-lines tr[data-line] td:nth-child(3)::before { content: "Prijs excl. btw"; }
  .q-lines tr[data-line] td:nth-child(2)::before, .q-lines tr[data-line] td:nth-child(3)::before { display: block; font-size: .74rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
  /* offerte (geen btw-kolom): 4 = totaal, 5 = verwijderen */
  .q-lines:not(.i-lines) tr[data-line] td:nth-child(4) { align-self: center; font-weight: 800; font-size: 1.05rem; }
  .q-lines:not(.i-lines) tr[data-line] td:nth-child(4)::before { content: "Totaal  "; font-weight: 600; font-size: .85rem; color: var(--ink-2); }
  .q-lines:not(.i-lines) tr[data-line] td:nth-child(5) { justify-self: end; }
  /* factuur: 4 = btw, 5 = totaal, 6 = verwijderen */
  .i-lines:not(.p-lines) tr[data-line] { grid-template-columns: 1fr 1fr 1fr; }
  .i-lines:not(.p-lines) tr[data-line] td:nth-child(4)::before { content: "Btw"; display: block; font-size: .74rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
  .i-lines:not(.p-lines) tr[data-line] td:nth-child(5) { grid-column: 1 / 3; align-self: center; font-weight: 800; font-size: 1.05rem; }
  .i-lines:not(.p-lines) tr[data-line] td:nth-child(5)::before { content: "Totaal excl. btw  "; font-weight: 600; font-size: .85rem; color: var(--ink-2); }
  .i-lines:not(.p-lines) tr[data-line] td:nth-child(6) { justify-self: end; }
  /* aankoopfactuur: zelfde kaartje (labels voor aantal en prijs komen van hierboven, btw erbij) */
  .p-lines tr[data-line] td:nth-child(3)::before { content: "Aantal"; }
  .p-lines tr[data-line] td:nth-child(4)::before { content: "Prijs excl. btw"; }
  .p-lines tr[data-line] td:nth-child(2)::before { content: "Artikel"; }
  .p-lines tr[data-line] td:nth-child(5)::before { content: "Btw"; }
  .p-lines tr[data-line] td:nth-child(2)::before, .p-lines tr[data-line] td:nth-child(4)::before, .p-lines tr[data-line] td:nth-child(5)::before { display: block; font-size: .74rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
  .p-lines tr[data-line] { grid-template-columns: 1fr 1fr 1fr; }
  /* totalen onder de lijnen: gewone rijen */
  .q-lines tr:not([data-line]):not(:first-child) { display: flex !important; justify-content: space-between; padding: 8px 4px; border-bottom: 1px solid var(--line); }
  .q-lines tr:not([data-line]) td:empty { display: none; }
  .q-lines tr:not([data-line]) td { border: 0; text-align: left; padding: 0; }
  /* de AI-knop mag de laatste rijen (totalen, knoppen) niet bedekken */
  #view { padding-bottom: 96px; }
}
@media (max-width: 1000px) { .q-lines tr[data-line] td.num, .q-lines tr[data-line] td:nth-child(n) { text-align: left; } .q-lines tr[data-line] td:last-child { text-align: right; } }

/* Aanvragen met AI-analyse */
.lead-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.lead-who { display: flex; flex-direction: column; }
.lead-who b { font-size: 1.05rem; }
.lead-head select { width: auto; }
.lead-ai { margin: 10px 0 6px; padding: 10px 12px; background: #f4f7fb; border-left: 4px solid var(--accent, #0f8b6f); border-radius: 10px; }
.lead-ai-wait { background: none; border: 0; padding: 0; margin: 6px 0; }
.lead-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.chip { display: inline-block; font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #e6eef6; color: #23405e; text-transform: capitalize; }
.chip.u-red { background: #fde2e2; color: #b91c1c; }
.chip.u-blue { background: #dbeafe; color: #1e40af; }
.chip.u-grey { background: #eceff3; color: #475569; }
.lead-sum { margin: 2px 0 6px; font-weight: 600; }
.lead-q { margin: 4px 0 4px; padding-left: 18px; }
.lead-next { margin: 4px 0 0; color: #23405e; }
.lead-msg { margin: 6px 0; }
.lead-msg p { white-space: pre-wrap; margin: 6px 0 0; }
.lead-contact { display: flex; gap: 14px; flex-wrap: wrap; margin: 6px 0 10px; }
.lead-actions { gap: 8px; }

/* Instellingen: mail doorsturen naar Vloto */
.mi-addr { user-select: all; }
.mi-log { border-top: 1px solid var(--line); }
.mi-row { display: flex; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.mi-txt { display: flex; flex-direction: column; min-width: 0; }
.mi-txt small { color: var(--ink-2); }

/* Lijsten: sorteren en pagineren */
.list-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 2px 2px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.list-tools .lt-sort { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.list-tools select { width: auto; margin: 0; padding: 6px 30px 6px 10px; font-size: .88rem; }
.list-tools .lt-dir { padding: 6px 12px; }
.list-tools .lt-count { margin-left: auto; }
.list-card { padding-top: 12px; padding-bottom: 12px; }
.list-card .list-tools { border-bottom: 0; padding-bottom: 0; margin: 0; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 2px 2px; margin-top: 6px; border-top: 1px solid var(--line); }
.pg-btns { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pg-n { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink); }
.pg-n:hover:not(:disabled) { background: #f1f5f9; }
.pg-n.on { background: var(--accent, #0f8b6f); border-color: var(--accent, #0f8b6f); color: var(--accent-ink, #fff); }
.pg-n:disabled { opacity: .4; cursor: default; }
.pg-gap { padding: 0 4px; color: var(--ink-2); }
.pg-per select { width: auto; margin: 0; padding: 6px 30px 6px 10px; font-size: .85rem; }
@media (max-width: 600px) { .pager { justify-content: center; } .pager > .muted { width: 100%; text-align: center; } }

/* Panelen dichtklappen (titel of pijltje) */
.fold-title { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px; }
.fold-btn { margin-left: auto; width: 30px; height: 30px; flex: none; border: 0; border-radius: 8px; background: transparent; cursor: pointer; position: relative; color: var(--ink-2); }
.fold-btn::before { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; border-right: 2.2px solid currentColor; border-bottom: 2.2px solid currentColor; transform: translate(-50%, -70%) rotate(45deg); transition: transform .15s; }
.fold-btn:hover { background: #f1f5f9; }
.card.folded .fold-btn::before { transform: translate(-50%, -40%) rotate(-135deg); }
.card.folded > :not(.card-head) { display: none !important; }
.card.folded { padding-bottom: 14px; }
.card-head.row { gap: 8px; }
.card-head.row > h2.fold-title { flex: 1; }
.card-head.row > h2 .fold-btn { order: 3; }

/* Rondleiding: het menu-item wordt opgelicht met een uitsparing in een donkere laag, met een kaartje ernaast */
.nav-tour { opacity: .8; }
.nav-tour:hover { opacity: 1; }
.tour-shade { position: fixed; inset: 0; background: rgba(8, 18, 32, .62); z-index: 9000; }
.tour-hole { position: fixed; z-index: 9001; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(8, 18, 32, .62), 0 0 0 3px var(--accent, #e4572e); pointer-events: auto; transition: left .25s, top .25s, width .25s, height .25s; }
.tour-pop { position: fixed; z-index: 9002; width: min(340px, calc(100vw - 24px)); background: var(--card, #fff); color: var(--ink, #14324a); border-radius: 16px; padding: 18px 18px 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); transition: left .25s, top .25s; }
.tour-pop h3 { margin: 2px 0 6px; font-size: 1.12rem; color: var(--deep, #14324a); }
.tour-pop p { margin: 0 0 14px; line-height: 1.5; }
.tour-count { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text, #c2410c); }
.tour-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour-bar > span { display: flex; gap: 8px; }
.tour-bar .btn { min-height: 38px; padding: 6px 14px; }
.tour-skip { background: none; border: 0; color: var(--muted, #64748b); text-decoration: underline; cursor: pointer; padding: 6px 0; font: inherit; }
body.tour-on #adminMenu { z-index: 8999; }
@media (prefers-reduced-motion: reduce) { .tour-hole, .tour-pop { transition: none; } }

/* Rondleiding: keuze en procesrondleiding */
.tour-pop.tour-busy { opacity: .55; }
.tour-more { width: 100%; margin: 0 0 12px; justify-content: center; }
.tour-choose h3 { margin-bottom: 12px; }
.tour-opt { display: block; width: 100%; text-align: left; background: var(--bg, #f6f8fb); border: 1px solid var(--line, #e2e8f0); border-radius: 12px; padding: 12px 14px; margin: 0 0 10px; cursor: pointer; font: inherit; color: inherit; }
.tour-opt:hover, .tour-opt:focus-visible { border-color: var(--accent-text, #c2410c); }
.tour-opt b { display: block; color: var(--deep, #14324a); }
.tour-opt small { display: block; color: var(--muted, #64748b); margin-top: 2px; }

/* Meldingen als popup rechtsboven */
.notify-box { position: fixed; top: 74px; right: 16px; z-index: 8500; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.notify { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; background: var(--card, #fff); border-radius: 14px; padding: 12px 10px 12px 14px; box-shadow: 0 16px 40px rgba(8, 18, 32, .22); border-left: 4px solid var(--accent, #e4572e); opacity: 0; transform: translateX(24px); transition: opacity .25s, transform .25s; }
.notify.in { opacity: 1; transform: none; }
.notify.out { opacity: 0; transform: translateX(24px); }
.notify-ic { font-size: 1.3rem; line-height: 1.2; }
.notify-body { flex: 1; min-width: 0; text-decoration: none; color: var(--ink, #14324a); }
.notify-body b { display: block; color: var(--deep, #14324a); }
.notify-body span { display: block; font-size: .9rem; color: var(--muted, #64748b); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notify-x { background: none; border: 0; color: var(--muted, #64748b); cursor: pointer; font-size: 1rem; padding: 2px 6px; }
@media (max-width: 700px) { .notify-box { top: 64px; right: 10px; left: 10px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .notify { transition: none; } }

/* Tweestapsverificatie: code-invoer (aanmelden, inschakelen), QR-code, herstelcodes */
input.mfa-code { font: 700 1.5rem ui-monospace, Consolas, monospace; letter-spacing: .32em; text-align: center; padding: 12px 10px; }
input.mfa-code.rc { font-size: 1.15rem; letter-spacing: .12em; }
input.mfa-code::placeholder { color: #c3ccd4; letter-spacing: .32em; }
.auth-card label.mfa-remember { display: flex; margin: 0 0 14px; font-size: .88rem; }
.mfa-steps { margin: 0 0 10px; padding-left: 20px; font-size: .9rem; line-height: 1.5; }
.mfa-steps li + li { margin-top: 4px; }
.mfa-qr { display: flex; justify-content: center; margin: 6px 0 4px; }
.mfa-qr svg { width: 200px; height: 200px; max-width: 70vw; max-height: 70vw; border: 1px solid #e3e8ec; border-radius: 10px; }
.mfa-open { text-align: center; margin: 4px 0 8px; }
.mfa-manual { margin: 0 0 14px; }
.mfa-manual summary { cursor: pointer; color: var(--brand-text); font-weight: 600; }
.mfa-manual .secret code { font-size: 1rem; letter-spacing: .08em; }
.mfa-h { font-size: 1rem; margin: 14px 0 4px; }
.mfa-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin: 10px 0 12px; padding: 12px 14px 12px 34px; border-radius: 12px; background: #eef3f7; }
.mfa-codes code { font: 700 1rem ui-monospace, Consolas, monospace; letter-spacing: .04em; color: var(--deep); }
.mfa-inline { margin-top: 4px; }
.mfa-inline label { margin-bottom: 12px; }
.mfa-card h1 { font-size: 1.5rem; }
@media (max-width: 380px) { .mfa-codes { grid-template-columns: 1fr; } }

/* ============ Campagnes (platformbeheerder, public/modules/campaigns.js) ============ */
.cp-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.cp-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 8px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
.cp-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cp-table .num { text-align: right; white-space: nowrap; }
.cp-table tr[data-go] { cursor: pointer; }
.cp-table tr[data-go]:hover td { background: #f6f9fc; }
.cp-sort th { cursor: pointer; user-select: none; }
.cp-sort th.asc::after { content: " ▲"; } .cp-sort th.desc::after { content: " ▼"; }
.cp-scroll { overflow-x: auto; max-height: 70vh; overflow-y: auto; }
.cp-act { white-space: nowrap; text-align: right; }
.cp-filters { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 8px; margin-bottom: 6px; }
.cp-filters > * { margin: 0; }
.cp-count { justify-content: space-between; align-items: center; margin-bottom: 6px; } .cp-count p { margin: 0; }
@media (max-width: 800px) { .cp-filters { grid-template-columns: 1fr 1fr; } .cp-filters input { grid-column: 1 / -1; } }
.cp-ovr { font-size: .8rem; }
.cp-hist summary { cursor: pointer; }
.cp-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 12px; }
.cp-counts { background: #f3f7fb; border-radius: 12px; padding: 10px 14px; font-size: .9rem; }
.badge.cp-b-concept { background: #e5e7eb; color: #374151; }
.badge.cp-b-bezig { background: #dbeafe; color: #1e40af; }
.badge.cp-b-gepauzeerd { background: #fef3c7; color: #92400e; }
.badge.cp-b-gestopt { background: #fee2e2; color: #991b1b; }
.badge.cp-b-klaar { background: #dcfce7; color: #166534; }
.badge.cp-b-bounce { background: #fde2e2; color: #b91c1c; }
.badge.cp-s-wachtend { background: #eceff3; color: #475569; } .badge.cp-s-bezig { background: #dbeafe; color: #1e40af; }
.badge.cp-s-verzonden { background: #dcfce7; color: #166534; } .badge.cp-s-mislukt, .badge.cp-s-bounce { background: #fde2e2; color: #b91c1c; }
.badge.cp-s-overgeslagen { background: #f3f4f6; color: #6b7280; }
.page-head h1 .badge { vertical-align: middle; margin-left: 6px; }
.cp-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 660px); gap: 16px; align-items: start; }
@media (max-width: 1200px) { .cp-edit { grid-template-columns: 1fr; } }
.cp-html { min-height: 360px; font: 400 .78rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; }
.cp-prev .row { justify-content: space-between; }
.cp-prev iframe { width: 100%; height: 900px; border: 1px solid var(--line); border-radius: 12px; background: #eef2f7; }
.cp-text { white-space: pre-wrap; font-size: .82rem; background: #f6f9fc; border-radius: 12px; padding: 14px; max-height: 900px; overflow: auto; }
.chip[data-ph] { border: 0; cursor: pointer; text-transform: none; font-family: ui-monospace, Consolas, monospace; }
.cp-send { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.cp-send > .card:first-child { grid-row: span 2; }
.cp-checks { max-height: 210px; overflow: auto; border: 1.5px solid var(--line); border-radius: 12px; padding: 6px 10px; margin: 4px 0 12px; display: flex; flex-direction: column; gap: 4px; }
.cp-checks label.chk { white-space: normal; font-weight: 500; }
.cp-checks .cp-chk-q { margin: 0 0 4px; padding: 6px 10px; font-size: .85rem; }
.cp-aud { background: #f3f7fb; border-radius: 14px; padding: 12px 16px; }
.cp-warn { color: #9a4a00; font-weight: 600; }
.cp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 8px; }
.cp-tile { margin: 0; padding: 14px 16px; } .cp-tile .big-num { font-size: 1.6rem; }
.cp-bars { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 8px; overflow-x: auto; }
.cp-bar { position: relative; flex: 0 0 22px; height: 100%; display: flex; align-items: flex-end; gap: 2px; padding-bottom: 18px; }
.cp-bar i, .cp-bar b { display: block; width: 9px; border-radius: 3px 3px 0 0; min-height: 1px; }
.cp-bar i, .cp-key.s { background: var(--brand, #1e3a5f); } .cp-bar b, .cp-key.o { background: #14b8a6; }
.cp-bar span { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; font-size: .62rem; color: var(--muted); }
.cp-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; margin-left: 8px; }
.cp-res-head { justify-content: space-between; } .cp-res-head h2 { flex: 1; margin: 0; }
.cp-res-head input, .cp-res-head select { width: auto; margin: 0; flex: 0 1 200px; }
.cp-file { cursor: pointer; }

/* Campagnes – doelgroep: volle breedte, drie filterlijsten en de samenvatting naast elkaar; één regel per optie */
.cp-send { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cp-send > .card:first-child { grid-row: auto; }
.cp-send > .cp-aud-card { grid-column: 1 / -1; }
.cp-aud-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.cp-fbox { border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 10px 6px; background: #fff; min-width: 0; }
.cp-fhead { display: flex; align-items: baseline; gap: 8px; padding: 0 4px 8px; }
.cp-fhead strong { font-size: .92rem; }
.cp-fsel { flex: 1; }
.cp-fclear { background: none; border: 0; padding: 0; color: var(--accent-text, #0f766e); font: inherit; font-size: .82rem; cursor: pointer; text-decoration: underline; }
.cp-fbox .cp-chk-q { width: 100%; margin: 0 0 6px; padding: 7px 10px; font-size: .86rem; }
.cp-flist { max-height: 240px; overflow-y: auto; overflow-x: hidden; }
.cp-opt { display: flex; align-items: center; gap: 10px; padding: 6px 6px; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: .9rem; margin: 0; min-width: 0; }
.cp-opt:hover { background: #f3f7fb; }
.cp-opt input { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; }
.cp-opt-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-opt-n { flex: 0 0 auto; font-size: .76rem; font-weight: 600; color: var(--muted); background: #eef2f7; border-radius: 99px; padding: 1px 8px; }
.cp-opt:has(input:checked) { background: #ecfdf5; }
.cp-opt:has(input:checked) .cp-opt-n { background: #d1fae5; color: #065f46; }
.cp-aud-side { grid-column: 1 / -1; grid-row: 1; display: grid; grid-template-columns: minmax(220px, 260px) minmax(260px, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: center; }
.cp-fsel { white-space: nowrap; }
@media (max-width: 1000px) { .cp-aud-side { grid-template-columns: 1fr; } }
.cp-aud-side label { margin: 0; }
.cp-aud-side .cp-aud { padding: 16px 18px; }
.cp-aud-side .big-num { font-size: 2.4rem; line-height: 1; }
@media (max-width: 1000px) { .cp-aud-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .cp-send { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .cp-aud-grid { grid-template-columns: 1fr; } }

/* Zijbalk: enkel het menu schuift; de knop met de naam blijft onderaan in beeld */
@media (min-width: 1100px) {
  body.side .topbar { overflow: hidden; }
  body.side .tb-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; margin-right: -6px; padding-right: 6px; }
  body.side .tb-nav a { padding: 8px 12px; }
  body.side .tb-user { flex: 0 0 auto; margin-top: 10px; }
}
/* Accountpagina: snelkoppelingen naast elkaar, daaronder twee kolommen */
.acct { max-width: 980px; }
.acct-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 14px; }
.acct-links .manual-link { max-width: none; margin: 0; }
.acct-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.acct-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.acct-col > .card { margin: 0; max-width: none; }
.acct-pw h2 { margin-top: 0; }
.acct-col #logout { width: 100%; margin: 0; }
.acct-legal { margin: 22px 0 0; }
.acct-legal a { color: inherit; }
@media (max-width: 820px) { .acct-cols { grid-template-columns: 1fr; } }

/* Aanmeldscherm: copyright en links onder de kaart */
.auth-legal { margin-top: 4px !important; font-size: .76rem; }
.auth-legal a { color: inherit; }

/* Bezoekers & video (public/modules/webstats.js): zelfde tegels, staafjes en tabel als Campagnes */
.ws-head-act { gap: 8px; }
.ws-period { padding: 12px 16px; }
.ws-period .row { gap: 12px; align-items: flex-end; }
.ws-lbl { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: .78rem; color: var(--muted); font-weight: 600; }
.ws-lbl select, .ws-lbl input { margin: 0; width: auto; min-width: 150px; }
.ws-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ws-grid > .card { margin: 0 0 16px; min-width: 0; }
@media (max-width: 1000px) { .ws-grid { grid-template-columns: 1fr; } }
.ws-bars { gap: 2px; }
.ws-bars .cp-bar { flex: 1 0 18px; justify-content: center; }
.ws-bars .cp-bar i, .ws-bars .cp-bar b { width: 8px; }
.ws-nowrap { white-space: nowrap; }
.ws-h2 { margin-top: 18px; }
.ws-table tbody tr[data-sid] { cursor: pointer; }
.ws-table tbody tr[data-sid]:hover td { background: #f6f9fc; }
.ws-ip { font: 500 .82rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; }
.ws-pct { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ws-pbar { display: inline-block; width: 72px; height: 8px; border-radius: 4px; background: #e5eaf0; overflow: hidden; }
.ws-pbar i { display: block; height: 100%; border-radius: 4px; background: #14b8a6; }
.ws-pbar i.done { background: #16a34a; }
.ws-done { color: #16a34a; font-weight: 700; text-align: center; }

/* AI-hulp (modules/aiassist.js): werkbon inspreken, Opvolgen, uitleg Vloto AI */
.dict { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 14px; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--primary, #e4572e) 7%, transparent); }
.dict .btn { flex: none; }
.dict .small { flex: 1 1 220px; }
.dict-rec { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; }
.dict-rec .rec-on { background: #b91c1c; border-color: #b91c1c; animation: recPulse 1.4s ease-in-out infinite; }
@keyframes recPulse { 50% { box-shadow: 0 0 0 6px rgba(185, 28, 28, .18); } }
@media (prefers-reduced-motion: reduce) { .dict-rec .rec-on { animation: none; } }
.dict-mats { display: grid; gap: 6px; }
.dict-mat { display: grid !important; grid-template-columns: auto 1fr 84px auto; align-items: center; gap: 8px; margin: 0 !important; padding: 8px 10px; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; font-weight: 400; }
.dict-mat input[type=number] { width: 84px; margin: 0; }
.dict-mat-d { min-width: 0; overflow-wrap: anywhere; }
#dlg:has(.dict-mats), #dlg:has(#fuMsg), #dlg:has(#dictText) { width: min(640px, calc(100vw - 24px)); }
.ai-feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: stretch; }
.ai-feats .ai-feat { display: flex; flex-direction: column; }
.ai-feats .ai-feat > .btn { margin-top: auto; align-self: flex-start; }
.ai-feats .ai-feat > p:not(.small) { flex: 1 1 auto; }
.ai-feats .ai-feat > p.small { margin-bottom: 14px; }
.ai-feats .card { margin: 0; }
.ai-feat-h { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.ai-feat-h h2 { margin: 0; }
.ai-feat-i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; font-size: 1.2rem; background: color-mix(in srgb, var(--primary, #e4572e) 12%, transparent); flex: none; }
.ai-meter { height: 8px; border-radius: 99px; background: var(--line, #e5e7eb); margin-top: 10px; overflow: hidden; }
.ai-meter i { display: block; height: 100%; background: var(--primary, #e4572e); border-radius: 99px; }

/* Vloto AI: inspreken en voorlezen */
.ai-form .ai-mic { flex: none; padding-left: 12px; padding-right: 12px; }
.ai-form .ai-mic.on { background: #b91c1c; border-color: #b91c1c; color: #fff; animation: recPulse 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .ai-form .ai-mic.on { animation: none; } }
.ai-spk.on { background: rgba(255,255,255,.22); }
.ai-msg.assistant { position: relative; }
.ai-say { position: absolute; right: 6px; bottom: 4px; border: 0; background: none; cursor: pointer; font-size: .85rem; opacity: .55; padding: 2px 4px; border-radius: 6px; }
.ai-say:hover, .ai-say:focus-visible { opacity: 1; background: rgba(0,0,0,.06); }

/* Te factureren: controle vóór de factuur */
.bchk-sum { padding: 12px 16px; }
.bchk-row td { border-top: 0; padding-top: 0; }
.bchk-badge { display: inline-block; font-size: .8rem; font-weight: 700; padding: 2px 10px; border-radius: 99px; }
.bchk-ok .bchk-badge { background: #dcfce7; color: #166534; }
.bchk-letop .bchk-badge { background: #fef3c7; color: #92400e; }
.bchk-probleem .bchk-badge { background: #fee2e2; color: #991b1b; }
.bchk-row ul { margin: 6px 0 2px; padding-left: 18px; font-size: .88rem; }
/* foto kiezen voor de AI */
.ph-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.ph-pick-i { position: relative; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 0; overflow: hidden; background: #fff; cursor: pointer; text-align: left; }
.ph-pick-i img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.ph-pick-i span { display: block; font-size: .78rem; padding: 4px 6px; color: var(--muted, #6b7280); }
.ph-pick-i em { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.8); font-style: normal; font-weight: 700; }
.ph-pick-i:hover { outline: 2px solid var(--primary, #e4572e); }
.ph-res { display: grid; grid-template-columns: 160px 1fr; gap: 14px; align-items: start; margin-bottom: 10px; }
.ph-res img { width: 100%; border-radius: 10px; }
@media (max-width: 560px) { .ph-res { grid-template-columns: 1fr; } }

/* planning: voorstel met AI */
.plan-ai { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 4px 0 8px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--primary, #e4572e) 7%, transparent); }
.plan-ai .small { flex: 1 1 220px; }
#planAiRes { flex: 1 1 100%; display: grid; gap: 6px; }
.plan-ai-opt { display: grid; gap: 2px; text-align: left; padding: 8px 10px; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; background: #fff; cursor: pointer; }
.plan-ai-opt small { color: var(--muted, #6b7280); }
.plan-ai-opt:hover, .plan-ai-opt.on { border-color: var(--primary, #e4572e); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary, #e4572e) 25%, transparent); }

.mod-tile.mod-locked { opacity: .6; cursor: not-allowed; }

/* lokale beheerapp: Firma's (live) */
.lf-card { margin-bottom: 16px; }
.lf-card.lf-off { opacity: .75; }
.lf-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px 20px; margin-bottom: 10px; }
.lf-head h2 { margin: 0; }
.lf-switches { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.lf-sw { display: inline-flex !important; align-items: center; gap: 6px; margin: 0 !important; font-weight: 600; cursor: pointer; }
.lf-max { display: inline-flex !important; align-items: center; gap: 6px; margin: 0 !important; font-weight: 600; }
.lf-max input { width: 120px; margin: 0; }
.lf-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; }
@media (max-width: 1000px) { .lf-cols { grid-template-columns: 1fr; } }
.lf-cols h3 { margin: 4px 0 8px; font-size: .95rem; }
.lf-acts { white-space: nowrap; text-align: right; }
.lf-acts .btn { padding: 3px 8px; }
.lf-uoff td { color: var(--muted, #6b7280); }

.mod-tile.mod-ro { cursor: default; }
.mod-tile.mod-ro em { display: block; margin-top: 6px; font-style: normal; font-size: .8rem; font-weight: 700; }
.mod-tile.mod-ro.is-on em { color: #166534; }
.mod-tile.mod-ro.is-off { opacity: .55; }
.lf-mods { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg-2, #f3f6f9); }
.lf-mods .lf-sw { font-weight: 500; }

.lf-ov td, .lf-ov th { white-space: nowrap; }
.lf-row { cursor: pointer; }
.lf-row:hover td { background: var(--bg-2, #f3f6f9); }
.lf-row.is-sel td { background: color-mix(in srgb, var(--primary, #0f9d8a) 10%, transparent); }
.lf-row.is-sel td:first-child { box-shadow: inset 3px 0 0 var(--primary, #0f9d8a); }
.lf-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 1000px) { .lf-grid { grid-template-columns: 1fr; } }
.lf-grid h3 { margin: 4px 0 8px; font-size: .95rem; }
.lf-kv td:last-child { width: 220px; }
.lf-kv input[type=number], .lf-kv select { width: 100%; margin: 0; }
.lf-kv input[type=checkbox] { width: 18px; height: 18px; margin: 0; }

/* Aanvragen zoals Outlook: lijst links, leesvenster rechts */
.mailbox { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.mb-list { padding: 0; overflow: hidden; position: sticky; top: 12px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; }
.mb-tools { padding: 10px 12px; border-bottom: 1px solid var(--line, #e5e7eb); }
.mb-tools .list-tools { margin: 0; }
.mb-rows { overflow-y: auto; flex: 1 1 auto; }
.mb-pager { padding: 8px 12px; border-top: 1px solid var(--line, #e5e7eb); }
.mb-item { display: grid; gap: 2px; width: 100%; text-align: left; padding: 10px 14px 11px 16px; border: 0; border-bottom: 1px solid var(--line, #e5e7eb); background: none; cursor: pointer; font: inherit; color: inherit; position: relative; }
.mb-item:hover { background: var(--bg-2, #f3f6f9); }
.mb-item.is-sel { background: color-mix(in srgb, var(--primary, #0f9d8a) 11%, transparent); }
.mb-item.is-sel::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary, #0f9d8a); }
.mb-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.mb-top b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-item.is-new .mb-top b { font-weight: 800; }
.mb-item.is-new::after { content: ""; position: absolute; left: 6px; top: 16px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary, #0f9d8a); }
.mb-top time { font-size: .78rem; color: var(--muted, #6b7280); flex: none; }
.mb-item.is-new .mb-top time { color: var(--primary, #0f9d8a); font-weight: 700; }
.mb-sub { font-size: .8rem; color: var(--ink-2, #374151); display: flex; align-items: center; gap: 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mb-sub em { font-style: normal; color: var(--muted, #6b7280); }
.mb-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; flex: none; }
.mb-dot.u-red { background: #dc2626; } .mb-dot.u-blue { background: #2563eb; } .mb-dot.u-grey { background: #94a3b8; }
.mb-prev { font-size: .8rem; color: var(--muted, #6b7280); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mb-read .lead { margin: 0; }
.mb-back { display: none; margin-bottom: 8px; }
@media (max-width: 860px) {
  .mailbox { grid-template-columns: 1fr; }
  .mb-list { position: static; max-height: none; }
  .mailbox .mb-read { display: none; }
  .mailbox.mb-open .mb-list { display: none; }
  .mailbox.mb-open .mb-read { display: block; }
  .mb-back { display: inline-flex; }
}

/* ===== Vloto admin — Firma's (lijst + detail + modals) ===== */
.lf-ph { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px 16px; }
.lf-stats { margin-bottom: 14px; }
.lf-tile { padding: 14px 16px; }
.lf-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 14px; margin-bottom: 14px; }
.lf-filters input[type=search] { flex: 1 1 240px; min-width: 180px; margin: 0; }
.lf-filters select { flex: 0 0 auto; margin: 0; }
.lf-listcard { padding-top: 12px; }
.lf-count { margin: 0 0 8px; }
/* standaard datatabel */
.lf-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.lf-table th, .lf-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line, #e5e7eb); white-space: nowrap; }
.lf-table thead th { position: sticky; top: 0; z-index: 1; background: var(--bg-2, #f3f6f9); color: var(--muted, #556); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.lf-table td.num, .lf-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.lf-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg-2, #f3f6f9) 45%, transparent); }
.lf-sortable { cursor: pointer; user-select: none; }
.lf-sortable:hover { color: var(--deep, #10284b); }
.lf-sortable.is-sort { color: var(--primary, #0f9d8a); }
.lf-arrow { font-size: .7em; margin-left: 3px; }
.lf-row { cursor: pointer; }
.lf-row:hover td { background: color-mix(in srgb, var(--primary, #0f9d8a) 8%, transparent) !important; }
.lf-row:focus-visible { outline: 2px solid var(--primary, #0f9d8a); outline-offset: -2px; }
/* detail */
.lf-back { display: inline-block; font-size: .85rem; font-weight: 600; color: var(--muted, #556); text-decoration: none; margin-bottom: 4px; }
.lf-back:hover { color: var(--primary, #0f9d8a); }
.lf-title { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lf-kvlist { display: grid; gap: 0; margin: 6px 0 0; }
.lf-kv2 { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 6px 14px; padding: 7px 0; border-bottom: 1px solid var(--line, #eef2f6); font-size: .92rem; }
.lf-kv2:last-child { border-bottom: 0; }
.lf-kv2 dt { color: var(--muted, #556); margin: 0; } .lf-kv2 dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.lf-pkg { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; margin-bottom: 12px; }
.lf-pkg input[type=number] { width: 110px; }
.lf-danger { border: 1px solid color-mix(in srgb, var(--danger, #c0392b) 35%, transparent); }
.lf-danger h2 { color: var(--danger, #c0392b); }
/* badges */
.badge.b-ok { background: #dcfce7; color: #166534; }
.badge.b-off { background: #fee2e2; color: #991b1b; }
/* modalformulieren */
dialog.dlg.dlg-wide { width: min(720px, calc(100vw - 32px)); }
.lf-form h3 { margin: 0 0 8px; font-size: .9rem; color: var(--muted, #556); text-transform: uppercase; letter-spacing: .04em; }
.lf-fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 22px; }
@media (max-width: 620px) { .lf-fgrid { grid-template-columns: 1fr; } }
.lf-f { display: block; margin: 0 0 11px; font-size: .82rem; font-weight: 600; color: var(--ink-2, #374151); }
.lf-f input, .lf-f select { width: 100%; margin: 3px 0 0; }
.lf-req { color: var(--danger, #c0392b); }
.lf-hint { display: block; font-weight: 500; color: var(--muted, #6b7280); font-size: .76rem; margin-top: 2px; }
.lf-form .lf-sw { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: .9rem; margin: 2px 0 11px; }
