/* Matramat — portaal, in de huisstijl van matramat.be
   (#41525c donker blauwgrijs + #c5bd08 limoengeel, Rubik) */

@font-face {
    font-family: 'Rubik';
    src: url('../fonts/rubik-latin-400-normal.woff2') format('woff2');
    font-weight: 400; font-display: swap;
}
@font-face {
    font-family: 'Rubik';
    src: url('../fonts/rubik-latin-500-normal.woff2') format('woff2');
    font-weight: 500; font-display: swap;
}
@font-face {
    font-family: 'Rubik';
    src: url('../fonts/rubik-latin-700-normal.woff2') format('woff2');
    font-weight: 700; font-display: swap;
}

:root {
    /* Variabelenamen historisch (--sand-*); waarden = matramat-huisstijl. */
    --sand-50: #f7f8f9;
    --sand-100: #eef0f2;
    --sand-500: #c5bd08;
    --sand-600: #41525c;
    --sand-700: #313e46;
    --ink: #2b343a;
    --ink-soft: #6b7a84;
    --line: #dfe4e7;
    --white: #fff;
    --green-600: #2e7d32;
    --green-bg: #e8f3e9;
    --red-600: #b3261e;
    --red-bg: #fbebea;
    --amber-bg: #fdf3dc;
    --amber-700: #8a6a1d;
    --blue-bg: #e8eef5;
    --blue-700: #33526e;
}

* { box-sizing: border-box; }

/* Portaal (beheer, werf en tablet): klein lettertype zoals de productenlijst,
   zodat er veel op één scherm past. Alle maten staan in rem en schalen mee;
   aanraakdoelen houden hun minimum van 44px. */
html.compact { font-size: 85%; }
html.compact body { line-height: 1.4; }

body {
    margin: 0;
    font-family: 'Rubik', -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--sand-50);
    color: var(--ink);
    line-height: 1.55;
}

a { color: var(--sand-700); }
h1 { font-size: 1.6rem; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.25rem 0 0.6rem; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.9rem; }
.ta-right { text-align: right; }
/* Enkel voor schermlezers (bv. de paginatitel van de werf-startpagina). */
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.brand-mark {
    width: 22px; height: 22px; border-radius: 6px; vertical-align: -4px;
    background: linear-gradient(135deg, var(--sand-500), var(--sand-700));
    display: inline-block;
}
.brand-logo { height: 26px; width: auto; vertical-align: middle; }

/* Topbar */
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar-inner {
    max-width: 1120px; margin: 0 auto; padding: 0.6rem 1rem;
    display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.topbar-brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--ink); }
.topbar-nav { display: flex; gap: 0.35rem; flex-wrap: wrap; flex: 1; }
.topbar-nav a {
    text-decoration: none; color: var(--ink-soft); padding: 0.35rem 0.65rem;
    border-radius: 8px; font-weight: 500;
}
.topbar-nav a:hover { background: var(--sand-100); color: var(--ink); }
.topbar-nav a.active { background: var(--sand-100); color: var(--sand-700); font-weight: 600; }
.topbar-user { display: flex; align-items: center; gap: 0.75rem; }
.user-name { font-weight: 600; }

.main { max-width: 1120px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
[hidden] { display: none !important; }

/* ============ Beheer: zijbalk ============ */
.app-shell { display: grid; grid-template-columns: 172px minmax(0, 1fr); min-height: 100vh; }
/* Beheerlijsten mogen breed: op een groot scherm krijgen tabellen met veel
   kolommen (producten, klanten) de ruimte i.p.v. uit hun kader te lopen. */
.has-sidebar .main { max-width: 1640px; margin: 0; padding: 1.25rem 1.5rem 3rem; width: 100%; }

.sidebar {
    background: var(--white); border-right: 1px solid var(--line);
    display: flex; flex-direction: column; gap: 0.8rem;
    padding: 0.9rem 0.5rem; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    font-size: 0.86rem;
}
.sidebar-brand { display: block; padding: 0.15rem 0.6rem; }
/* Het logo is breed (7:1): schaal op de kolombreedte, nooit afsnijden. */
.sidebar-brand .brand-logo { display: block; width: 100%; max-width: 210px; height: auto; max-height: 30px; object-fit: contain; object-position: left center; }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.sidebar-nav a {
    text-decoration: none; color: var(--ink-soft); font-weight: 500;
    padding: 0.32rem 0.55rem; border-radius: 7px; border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: var(--sand-100); color: var(--ink); }
.sidebar-nav a.active {
    background: var(--sand-100); color: var(--sand-600); font-weight: 700;
    border-left-color: var(--sand-500);
}
.sidebar-sep { border-top: 1px solid var(--line); margin: 0.4rem 0.4rem; }
/* Groepstitel in de zijbalk (Uitvoering, Verkoop, ...). */
.sidebar-group {
    margin: 0.7rem 0.55rem 0.1rem; font-size: 0.68rem; font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); opacity: 0.75;
}
.sidebar-user {
    border-top: 1px solid var(--line); padding: 0.7rem 0.4rem 0;
    display: flex; flex-direction: column; gap: 0.35rem; align-items: flex-start;
}

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.6rem; border-right: none; border-bottom: 1px solid var(--line); }
    .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
    .sidebar-nav a { border-left: none; padding: 0.35rem 0.6rem; }
    .sidebar-group { display: none; }
    .sidebar-user { border-top: none; padding: 0; flex-direction: row; align-items: center; margin-left: auto; }
    .has-sidebar .main { padding: 1.25rem 1rem 3rem; }
    /* Werf-startpagina: één kolom. minmax(0, 1fr) anders houdt een lange
       regel (bon + badge) de kolom breder dan het scherm. */
    .werf-home .werf-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Buttons */
.btn {
    display: inline-block; padding: 0.55rem 1.1rem; border-radius: 10px; cursor: pointer;
    font: inherit; font-weight: 600; text-decoration: none; text-align: center;
    border: 2px solid transparent; background: none;
}
.btn-primary { background: var(--sand-600); color: var(--white); }
.btn-primary:hover { background: var(--sand-700); }
.btn-primary:disabled { background: var(--line); color: var(--ink-soft); cursor: not-allowed; }
.btn-outline { border-color: var(--sand-600); color: var(--sand-700); background: var(--white); }
.btn-outline:hover { background: var(--sand-100); }
.btn-ghost { color: var(--sand-700); }
.btn-danger-outline { border-color: var(--red-600); color: var(--red-600); background: var(--white); }
.btn-danger-outline:hover { background: var(--red-bg); }
.btn-danger { border-color: var(--red-600); background: var(--red-600); color: var(--white); }
.btn-danger:hover { filter: brightness(1.08); }
.btn-small { padding: 0.3rem 0.7rem; font-size: 0.9rem; border-radius: 8px; }
.btn-big { padding: 0.8rem 1.4rem; font-size: 1.05rem; }
.btn-huge { display: block; width: 100%; padding: 1.1rem 1.4rem; font-size: 1.3rem; border-radius: 14px; }

/* Flash + badges */
.flash { padding: 0.75rem 1rem; border-radius: 10px; margin: 0 0 1rem; }
.flash-success { background: var(--green-bg); color: var(--green-600); }
.flash-error { background: var(--red-bg); color: var(--red-600); }
.flash-warning { background: var(--amber-bg); color: var(--amber-700); }
.temp-password { font-size: 1.15rem; background: var(--white); padding: 0.15rem 0.5rem; border-radius: 6px; }

.badge {
    display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px;
    font-size: 0.82rem; font-weight: 600; white-space: nowrap;
}
.badge-draft { background: var(--amber-bg); color: var(--amber-700); }
.badge-tablet { background: var(--blue-bg); color: var(--blue-700); }
.badge-signed { background: var(--green-bg); color: var(--green-600); }
.badge-cancelled { background: var(--red-bg); color: var(--red-600); }
.badge-invoiced { background: var(--blue-bg); color: var(--blue-700); }
.badge-neutral { background: var(--sand-100); color: var(--sand-700); }

/* Panels, tables, forms */
.panel {
    background: var(--white); border: 1px solid var(--line); border-radius: 14px;
    padding: 1.25rem 1.4rem; margin-bottom: 1.25rem;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.page-head h1 { margin: 0.25rem 0; }

.table { width: 100%; border-collapse: collapse; }
/* Een paneel met een tabel scrolt horizontaal zodra de kolommen niet passen,
   zodat acties en cijfers nooit buiten het kader vallen. */
.panel:has(> .table) { overflow-x: auto; }
.table th, .table td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { white-space: nowrap; }
/* Kolommen die op één regel horen: nummers, bedragen, datums, badges, acties. */
.nowrap, .table td.nowrap, .table .badge { white-space: nowrap; }
.table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr:last-child td { border-bottom: none; }
.actions-cell { display: flex; gap: 0.4rem; justify-content: flex-end; flex-wrap: wrap; }

.stack { display: flex; flex-direction: column; gap: 0.75rem; }
.stack label { font-weight: 600; margin-bottom: -0.35rem; }
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 500 !important; }

input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="date"], select, textarea {
    font: inherit; padding: 0.6rem 0.75rem; border: 1.5px solid var(--line);
    border-radius: 10px; background: var(--white); color: var(--ink); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--sand-500); border-color: var(--sand-500); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem 1.25rem; }
.form-grid label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; }
.form-grid label.check { flex-direction: row; align-items: center; }
.span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 0.75rem; align-items: center; }
.search-form { display: flex; gap: 0.6rem; margin: 0.75rem 0 1rem; max-width: 480px; }
.inline-form { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }

.filter-tabs { display: flex; gap: 0.3rem; flex-wrap: wrap; margin: 0.75rem 0 1rem; }
.filter-tabs a {
    text-decoration: none; color: var(--ink-soft); padding: 0.35rem 0.8rem;
    border-radius: 999px; border: 1px solid var(--line); background: var(--white);
}
.filter-tabs a.active { background: var(--sand-600); border-color: var(--sand-600); color: var(--white); }

/* Productbeheer: basisprijs (BH) prominent in formulier en overzicht */
.price-base input { font-size: 1.25rem; font-weight: 600; border-color: var(--sand-500); max-width: 280px; }
.table .price-col-base { background: var(--sand-100); font-weight: 600; }
.table th.price-col-base { color: var(--sand-700); }

/* Beheer → Bestellingen: formulier met gewogen en losse productlijnen */
.order-error-list { margin: 0; padding-left: 1.1rem; }
.order-section { border-top: 1px solid var(--line); padding-top: 0.9rem; }
.order-section h2 { margin: 0 0 0.15rem; }
.order-rows { display: flex; flex-direction: column; gap: 0.55rem; }
.order-row { display: flex; gap: 0.6rem; align-items: center; }
.order-row select { flex: 1 1 auto; }
.order-row .order-qty { flex: 0 0 110px; width: 110px; }
.order-existing { list-style: none; margin: 0 0 0.75rem; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.order-existing li {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    border: 1.5px solid var(--line); border-radius: 10px; padding: 0.45rem 0.85rem;
    background: var(--sand-50);
}
.order-existing .line-desc { font-weight: 600; }
.order-existing .order-line-product { max-width: 22rem; font-weight: 600; }
.form-grid .order-existing .check { flex-direction: row; margin: 0; white-space: nowrap; }
/* Bestelde hoeveelheid (ton) naast elk product, met verpakking en big bags */
.order-row .order-ton { flex: 0 0 150px; width: 150px; }
.order-row .order-packaging { flex: 0 0 115px; width: 115px; }
.order-row .order-count { flex: 0 0 80px; width: 80px; }
.order-row .order-owner { flex: 0 0 95px; white-space: nowrap; }
.form-grid .order-row .check { flex-direction: row; margin: 0; }
.order-existing-qty .order-count { width: 64px; padding: 0.35rem 0.6rem; }
.order-services li { background: var(--white); }
.order-row-head { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); margin-bottom: -0.3rem; }
.order-row-head .order-row-product { flex: 1 1 auto; }
.order-existing-qty { display: flex; align-items: center; gap: 0.45rem; margin-left: auto; white-space: nowrap; }
.order-existing-qty .order-ton { width: 110px; padding: 0.35rem 0.6rem; }

/* Beheer → Mailbox: overzicht en detail van de ingelezen mails */
.sidebar-nav a.has-badge { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.sidebar-nav .badge { font-size: 0.78rem; padding: 0.05rem 0.5rem; }

.mail-toolbar { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin: 0; }
.mail-subject { font-weight: 600; }
.mail-from { display: block; }
.mail-from-mail { display: block; font-size: 0.85rem; color: var(--ink-soft); }
.mail-summary { color: var(--ink-soft); min-width: 20ch; max-width: 38ch; }
.mail-wanted { display: block; margin-top: 0.2rem; font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.mail-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0 0 1rem; }

.mail-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.mail-columns .panel { margin-bottom: 0; }
.mail-columns h2:first-child { margin-top: 0; }

/* De mailtekst zoals ze binnenkwam: wel afbreken, nooit horizontaal scrollen. */
.mail-body {
    margin: 0; padding: 0.9rem 1rem; font: inherit;
    white-space: pre-wrap; overflow-wrap: anywhere;
    background: var(--sand-50); border: 1px solid var(--line); border-radius: 10px;
    max-height: 30rem; overflow-y: auto;
}
.mail-lead { margin: 0.75rem 0 0; }
.mail-linked {
    margin: 1rem 0 0; padding: 0.6rem 0.9rem; border-radius: 10px;
    background: var(--green-bg); color: var(--green-600);
}

.mail-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.mail-lines li { border: 1.5px solid var(--line); border-radius: 10px; padding: 0.5rem 0.85rem; background: var(--sand-50); }
.mail-line-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; font-weight: 600; }
.mail-line-match { display: block; font-size: 0.9rem; color: var(--ink-soft); }
.mail-line-match.is-missing { color: var(--red-600); }

.mail-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin: 1.25rem 0 0.5rem; }
.mail-actions form { margin: 0; }

@media (max-width: 1000px) {
    .mail-columns { grid-template-columns: 1fr; }
}

/* Dashboard */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.9rem; margin-bottom: 1.25rem; }
.stat {
    background: var(--white); border: 1px solid var(--line); border-radius: 14px;
    padding: 1rem 1.2rem; text-decoration: none; color: var(--ink);
    display: flex; flex-direction: column;
}
.stat:hover { border-color: var(--sand-500); }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--sand-700); }
.stat-label { color: var(--ink-soft); }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.6rem 1.5rem; margin: 0; }
.detail-grid dt { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
.detail-grid dd { margin: 0.1rem 0 0.5rem; font-size: 1.05rem; }

.choice-list { display: flex; flex-direction: column; gap: 0.5rem; }
.choice {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    padding: 0.7rem 1rem; border: 1.5px solid var(--line); border-radius: 10px;
    text-decoration: none; color: var(--ink); font-weight: 600;
}
.choice:hover { border-color: var(--sand-500); }
.choice.active { border-color: var(--sand-600); background: var(--sand-100); }

.signature-img { max-width: 320px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }

/* Auth */
.auth-wrap { display: flex; justify-content: center; padding: 3rem 0.5rem; }
.auth-panel { width: 100%; max-width: 430px; }
.auth-title { font-size: 1.4rem; margin-bottom: 0.25rem; }
.auth-title .brand-logo { height: 34px; }
.auth-sub { margin-top: 0; color: var(--ink-soft); }

/* ============ WERF-MODUS: vult het scherm, gewone lettergrootte ============ */
/* De pagina gebruikt de volle breedte en hoogte. Lettergrootte, knoppen en
   velden blijven de gewone maten (root 16px, .main 1.1rem). Aanraakdoelen
   hebben een vloer van 44px, zonder ze op te blazen. */
body.werf-mode {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
body.werf-mode .topbar { flex: none; }
body.werf-mode .topbar-inner {
    max-width: none;
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}
/* Geen vaste kolom: de pagina vult het scherm, van telefoon tot werf-tv. */
body.werf-mode .main,
body.werf-wide .main,
body.tablet-mode .main,
body.werf-mode.has-sidebar .main {
    max-width: none;
    width: 100%;
    margin: 0;
    min-width: 0;
    flex: 1 1 auto;
    font-size: 1.1rem;
    padding: 1.25rem 1rem 3rem;
}
/* Beheer bekijkt de werf in de zijbalk-layout; die blijft een grid. */
body.werf-mode.has-sidebar { display: block; }
body.werf-mode.has-sidebar .app-shell { min-height: 100vh; min-height: 100dvh; }
.werf-mode h1 { font-size: 2rem; }
.werf-home h2 { margin-top: 2rem; }
/* Werf-startpagina: twee kolommen naast elkaar (liggende tablet) —
   weegbonnen links, bestellingen rechts. Onder 900px één kolom
   (zie de breakpoint bij de zijbalk). */
.werf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.werf-home .werf-col > h2:first-child { margin-top: 0.25rem; }
.werf-col h3 { font-size: 1.1rem; margin: 1.25rem 0 0.4rem; }
.werf-col-sub { margin: -0.35rem 0 0; color: var(--ink-soft); }
.hint { color: var(--ink-soft); font-size: 1.05rem; }

.wizard-card {
    background: var(--white); border: 1px solid var(--line); border-radius: 16px;
    padding: 1.5rem 1.6rem; margin-bottom: 1.25rem;
}
.wizard-head { margin-bottom: 0.75rem; }
.wizard-meta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.ticket-number { font-weight: 700; color: var(--sand-700); font-size: 1.1rem; }
/* Wizard-kop: klantnaam naast het bonnummer (zichtbaar zodra gekozen). */
.wizard-customer { font-weight: 500; font-size: 1rem; }
.wizard-progress {
    list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem;
    padding: 0; margin: 0.6rem 0 0;
}
.wizard-progress li {
    padding: 0.25rem 0.7rem; border-radius: 999px; font-size: 0.85rem;
    background: var(--white); border: 1px solid var(--line); color: var(--ink-soft);
}
.wizard-progress li.done { background: var(--green-bg); border-color: transparent; color: var(--green-600); }
.wizard-progress li.done a { color: inherit; text-decoration: none; }
.wizard-progress li.current { background: var(--sand-600); border-color: var(--sand-600); color: var(--white); font-weight: 600; }

.input-huge {
    font-size: 1.6rem; padding: 0.9rem 1rem; border-radius: 14px; width: 100%;
    border: 2px solid var(--line);
}
.input-big { font-size: 1.15rem; padding: 0.7rem 0.85rem; }
.input-plate { text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.weight-input { position: relative; }
.input-weight { padding-right: 3.6rem; font-variant-numeric: tabular-nums; }
.weight-unit {
    position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
    font-size: 1.3rem; font-weight: 700; color: var(--ink-soft);
}
.input-qty { max-width: 8rem; }

.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.7rem; }
.option-card {
    position: relative; display: flex; flex-direction: column; gap: 0.15rem;
    border: 2px solid var(--line); border-radius: 14px; padding: 0.9rem 1rem 0.8rem;
    cursor: pointer; background: var(--white);
}
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card:has(input:checked) { border-color: var(--sand-600); background: var(--sand-100); }
.option-card:hover { border-color: var(--sand-500); }
.option-title { font-weight: 700; font-size: 1.1rem; }
.option-sub { color: var(--ink-soft); font-size: 0.92rem; }
.option-suggested { border-style: dashed; }
.suggest-label { font-weight: 600; margin: 0.4rem 0 0.1rem; }
.option-scroll { max-height: 55vh; overflow-y: auto; padding: 2px; }
.option-empty { grid-column: 1 / -1; margin: 0.2rem 0; }

/* Productkaart met maat-chips (stap Product): de kaart zelf is geen keuze,
   elke maat-chip is de echte radio. Na .option-card zodat de overrides winnen. */
.option-card-group { cursor: default; }
.option-card-group:hover { border-color: var(--line); }
.option-card-group:has(input:checked):hover { border-color: var(--sand-600); }
.maat-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.4rem; }
.maat-chip {
    position: relative; display: inline-block; margin: 0; padding: 0.45rem 0.95rem;
    border: 2px solid var(--line); border-radius: 999px; cursor: pointer;
    background: var(--white); font-weight: 600; font-size: 0.98rem;
}
.maat-chip input { position: absolute; opacity: 0; pointer-events: none; }
.maat-chip:hover { border-color: var(--sand-500); }
.maat-chip:has(input:checked) { background: var(--sand-600); border-color: var(--sand-600); color: var(--white); }

/* Productstap: '+ Toevoegen'-knop (extra product op dezelfde weging) boven de wizard-nav. */
.line-add-btn { align-self: flex-start; }

/* Productstap: verpakking (los / big bag), aantal big bags (snelknoppen 1–5 +
   invulveld) en eigen big bags van de klant. Het blok verschijnt (met JS) pas
   na een maat met "Big bag mogelijk". */
.packaging-block {
    margin: 0; border: 2px solid var(--line); border-radius: 14px; padding: 0.9rem 1.1rem 1.1rem;
    background: var(--sand-50); display: flex; flex-direction: column; gap: 0.7rem;
}
.packaging-block legend { font-weight: 700; font-size: 1.15rem; padding: 0 0.35rem; }
.packaging-block[hidden], .bigbag-details[hidden] { display: none; }
.bigbag-details { display: flex; flex-direction: column; gap: 0.55rem; }
.field-label { font-weight: 600; }
.count-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.count-btn {
    min-width: 3.5rem; min-height: 3.5rem; font: inherit; font-size: 1.35rem; font-weight: 700;
    border: 2px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); cursor: pointer;
}
.count-btn:hover { border-color: var(--sand-500); }
.count-btn.is-active { background: var(--sand-600); border-color: var(--sand-600); color: var(--white); }
.count-row .input-qty { width: 7rem; }
/* Vulkost van de big bags: automatisch, dus stil in de lijst. */
.line-list .line-service { color: var(--ink-soft); }

/* Navigatie onderaan een wizardstap: '← Vorige'-link naast de grote Verder-knop */
.wizard-nav { display: flex; align-items: stretch; gap: 0.7rem; }
.wizard-nav .btn-huge { flex: 1; width: auto; }
.wizard-nav-back {
    display: flex; align-items: center; padding: 1.1rem 1.2rem;
    font-size: 1.15rem; white-space: nowrap; border-radius: 14px;
}
.wizard-nav-back:hover { background: var(--sand-100); }

.ticket-list { list-style: none; padding: 0; margin: 0.5rem 0; display: flex; flex-direction: column; gap: 0.5rem; }
.ticket-item {
    display: flex; align-items: center; gap: 1rem; padding: 0.85rem 1rem;
    background: var(--white); border: 1.5px solid var(--line); border-radius: 12px;
    text-decoration: none; color: var(--ink);
}
.ticket-item:hover { border-color: var(--sand-500); }
.ticket-item-nr { font-weight: 700; color: var(--sand-700); white-space: nowrap; }
.ticket-item-name { flex: 1; min-width: 0; }
body.werf-mode .ticket-item { flex-wrap: wrap; }
body.werf-mode .werf-col { min-width: 0; }

/* Bestellingen op de werf-home: klaargezet door de admin, één claimknop. */
.order-list { list-style: none; padding: 0; margin: 0.5rem 0; display: flex; flex-direction: column; gap: 0.6rem; }
.order-item {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    background: var(--white); border: 1.5px solid var(--line); border-left: 5px solid var(--sand-500);
    border-radius: 12px; padding: 0.9rem 1.1rem;
}
.order-info { flex: 1 1 16rem; display: flex; flex-direction: column; gap: 0.2rem; }
.order-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.order-head .badge { font-size: 0.95rem; padding: 0.15rem 0.75rem; }
.order-customer { font-weight: 700; font-size: 1.15rem; }
.order-lines { color: var(--ink); list-style: none; margin: 0; padding: 0; }
.order-notes { color: var(--ink-soft); font-style: italic; }
/* Afhaalfilter op de werf: dezelfde tabs als in beheer, maar aantikbaar groot. */
.werf-home .filter-tabs a { padding: 0.55rem 1.1rem; font-size: 1.05rem; }
/* "Besteld: 12,5 ton" bij een gewogen product in de wizard: klein en stil. */
.ordered-hint { display: block; font-size: 0.9rem; font-weight: 400; color: var(--ink-soft); }

.line-list { list-style: none; padding: 0; margin: 0.5rem 0 1rem; }
.line-list li {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    padding: 0.5rem 0; border-bottom: 1px solid var(--line);
}

.review-list { margin: 0 0 1rem; }
.review-list > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.review-list dt { color: var(--ink-soft); }
.review-list dd { margin: 0; font-weight: 600; text-align: right; }
.review-highlight dt, .review-highlight dd { font-size: 1.3rem; color: var(--sand-700) !important; }

/* Verdeelblok (controlestap): gewogen netto manueel over de producten verdelen.
   .verdeel-row is een label in een form.stack — scope onder .verdeel-block zodat
   de margin-reset het wint van '.stack label'. */
.verdeel-block {
    border: 2px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem;
    background: var(--sand-50); display: flex; flex-direction: column; gap: 0.55rem;
}
.verdeel-block h2 { margin: 0; }
.verdeel-block .hint { margin: 0; }
.verdeel-block .verdeel-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0; }
.verdeel-name { font-weight: 600; }
.verdeel-input { display: inline-block; }
.verdeel-input .input-weight { width: 11rem; font-variant-numeric: tabular-nums; }
.verdeel-input .weight-unit { font-size: 1.05rem; }
.verdeel-som { margin: 0.25rem 0 0; font-weight: 700; min-height: 1.4em; }
.verdeel-som.verdeling-ok { color: var(--green-600); }
.verdeel-som.verdeling-mis { color: var(--red-600); }

.warning-card { border: 2px solid var(--amber-700); }
.warning-text { font-size: 1.25rem; background: var(--amber-bg); color: var(--amber-700); padding: 0.9rem 1rem; border-radius: 12px; }

.signature-box { border: 2px dashed var(--line); border-radius: 14px; background: var(--white); touch-action: none; }
/* Vaste hoogte, volle breedte. JS tekent de lijnen opnieuw bij resize en rotatie. */
.signature-box canvas {
    width: 100%;
    height: 220px;
    display: block;
    touch-action: none;
    border-radius: 12px;
}
.signature-actions { display: flex; gap: 0.75rem; align-items: center; }
.signature-actions .btn-huge { flex: 1; }

.done-card { text-align: center; display: flex; flex-direction: column; gap: 1rem; align-items: center; }
.done-check {
    width: 84px; height: 84px; border-radius: 50%; background: var(--green-bg);
    color: var(--green-600); font-size: 3rem; line-height: 84px; font-weight: 700;
}
.done-check-tablet { background: var(--blue-bg); color: var(--blue-700); }
.done-card .btn { width: 100%; }

/* Tablet-modus: gedeeld toestel. Breedte en padding volgen de werf-regels
   bovenaan, zodat ook dit scherm de randen vult. */
.topbar-tablet .topbar-inner { justify-content: space-between; }
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.tablet-logout { margin: 0; }
.logout-quiet {
    background: none; border: none; cursor: pointer; font: inherit;
    color: var(--ink-soft); font-size: 0.85rem; opacity: 0.65; padding: 0.25rem 0.4rem;
}
.logout-quiet:hover { opacity: 1; text-decoration: underline; }
.ticket-item-big { padding: 1.15rem 1.25rem; flex-wrap: wrap; }
.ticket-item-big .ticket-item-name { font-size: 1.35rem; font-weight: 700; flex-basis: 100%; }
.ticket-item-sub { color: var(--ink-soft); flex: 1; }
.ticket-item-go { color: var(--sand-700); font-weight: 700; white-space: nowrap; }

/* Tekenscherm: op een breed scherm de bon links en de handtekening rechts,
   zodat het vak het scherm vult zonder de knoppen eronder weg te duwen. */
@media (min-width: 901px) {
    body.tablet-mode .wizard-card:has([data-sign-form]) {
        display: grid;
        grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
        column-gap: 1.5rem;
        align-items: start;
    }
    body.tablet-mode .wizard-card:has([data-sign-form]) > h1,
    body.tablet-mode .wizard-card:has([data-sign-form]) > .flash,
    body.tablet-mode .wizard-card:has([data-sign-form]) > a.btn-ghost {
        grid-column: 1 / -1;
    }
}
/* Aanraakdoelen: vloer van 44px op echte knoppen en velden, zonder ze
   groter te maken dan hun gewone padding al is. */
body.werf-mode .btn,
body.werf-mode .option-card,
body.werf-mode .maat-chip,
body.werf-mode .count-btn,
body.werf-mode .filter-tabs a,
body.werf-mode .topbar-nav a,
body.werf-mode .topbar-user a,
body.werf-mode .logout-quiet,
body.werf-mode .ticket-item,
body.werf-mode .role-card,
body.werf-mode .fullscreen-toggle {
    min-height: 44px;
}
body.werf-mode .btn,
body.werf-mode .filter-tabs a,
body.werf-mode .topbar-nav a,
body.werf-mode .topbar-user a,
body.werf-mode .logout-quiet,
body.werf-mode .maat-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
body.werf-mode .btn { min-width: 44px; }
body.werf-mode .btn-huge { display: flex; width: 100%; }
body.werf-mode .wizard-nav,
body.werf-mode .signature-actions { flex-wrap: wrap; }
body.werf-mode .wizard-nav .btn-huge,
body.werf-mode .signature-actions .btn-huge { flex: 1 1 12rem; width: auto; }
body.werf-mode input[type="text"],
body.werf-mode input[type="email"],
body.werf-mode input[type="password"],
body.werf-mode input[type="search"],
body.werf-mode input[type="date"],
body.werf-mode input[type="number"],
body.werf-mode select,
body.werf-mode textarea {
    min-height: 44px;
    max-width: 100%;
}
/* Nummerplaat, gewicht en zoekveld blijven leesbaar en worden geen baan
   over de volle tv-breedte. Kaarten en knoppen gebruiken wel de pagina. */
body.werf-mode input.input-huge,
body.werf-mode select.select-carrier,
body.werf-mode input.input-big:not(.input-qty):not(.input-weight) {
    max-width: min(100%, 42rem);
}
body.werf-mode .topbar-brand { display: inline-flex; align-items: center; min-height: 44px; }
body.werf-mode .logout-quiet { padding: 0.4rem 0.75rem; }

/* Volledig scherm: knop in de balk, uitleg als de browser het niet kan
   (iOS Safari). De uitleg zweeft, zodat ze de wizard niet wegduwt. */
.fullscreen-control { position: relative; display: flex; align-items: center; }
.sidebar .fullscreen-toggle { width: 100%; }
.fullscreen-fallback {
    position: fixed;
    z-index: 40;
    right: max(0.75rem, env(safe-area-inset-right));
    top: calc(3.6rem + env(safe-area-inset-top));
    width: min(22rem, calc(100vw - 1.5rem));
    margin: 0;
    padding: 0.85rem 1rem;
    background: var(--white);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(43, 52, 58, 0.16);
    font-size: 0.95rem;
    line-height: 1.45;
}

/* Rolkaarten op het tekenscherm: "Ik ben de transporteur / klant" */
.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.role-card {
    display: flex; align-items: center; gap: 0.6rem; border: 2px solid var(--line);
    border-radius: 14px; padding: 1rem 1.1rem; font-size: 1.15rem; font-weight: 600;
    background: var(--white); cursor: pointer;
}
.role-card input { width: 1.35rem; height: 1.35rem; accent-color: var(--sand-600); flex: none; }
.role-card:has(input:checked) { border-color: var(--sand-600); background: var(--sand-50); }
.role-card.is-unavailable { opacity: 0.55; cursor: not-allowed; }
.role-card .packaging-hint { display: block; font-size: 0.8rem; font-weight: 500; color: var(--ink-soft); }

/* Import */
.import-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; }
.import-grid .panel { margin-bottom: 0; }
.import-grid code { background: var(--sand-100); padding: 0.05rem 0.35rem; border-radius: 5px; font-size: 0.85rem; }
.import-grid input[type="file"] { font: inherit; }
.tight-list { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.tight-list li { margin: 0.1rem 0; }
.panel-danger { border-color: var(--red-600); margin-top: 1.25rem; }
.panel-danger h2, .panel-danger h3 { color: var(--red-600); }
.danger-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; }
.danger-actions input[type="text"] { max-width: 240px; }
.mapping-table select { max-width: 320px; }
.preview-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 1rem; }
.preview-scroll .table { min-width: 640px; }
.preview-scroll td, .preview-scroll th { white-space: nowrap; }

/* Pagination (Laravel default markup) */
nav[role="navigation"] { margin-top: 0.75rem; }

/* ============ Weegbon — lay-out van de echte verzendnota ============ */
.bon-page { background: var(--sand-50); }
.bon-toolbar { max-width: 720px; margin: 1rem auto 0; padding: 0 1rem; display: flex; justify-content: space-between; }
.bon {
    max-width: 720px; margin: 1rem auto 3rem; background: var(--white);
    border: 1px solid var(--line); border-radius: 14px; padding: 2rem 2.2rem;
}

/* Kop: logo links, openingsuren rechts */
.bon-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--sand-600); padding-bottom: 1rem; }
.bon-brand { font-size: 1.5rem; font-weight: 700; }
.bon-brand .brand-logo { height: 44px; }
.bon-openings { text-align: right; font-size: 0.85rem; line-height: 1.5; }
.bon-openings strong { display: block; font-size: 0.9rem; margin-bottom: 0.15rem; }

/* Titelregel: documentsoort + groot bonnummer, daaronder de datum */
.bon-title { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: 1.2rem; }
.bon-title-doc { font-size: 1.05rem; font-weight: 700; letter-spacing: 0.05em; }
.bon-title-number { font-size: 1.7rem; font-weight: 800; color: var(--sand-700); }
.bon-date { color: var(--ink-soft); margin-top: 0.1rem; }

/* Kenteken- en klantblok */
.bon-kenteken { margin-top: 0.9rem; }
.bon-transporteur { margin-left: 1.5rem; }
.bon-label { font-weight: 700; }
.bon-klant { margin-top: 0.9rem; }
.bon-klant-kop { display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; }
.bon-klantnr { font-weight: 700; color: var(--sand-700); }
.bon-klant-adres { margin-top: 0.15rem; line-height: 1.45; }

/* Productregels: ref | omschrijving | aantal */
.bon-producten { margin-top: 1rem; }
.bon-lines { width: 100%; border-collapse: collapse; margin-top: 0.25rem; }
.bon-lines td { padding: 0.35rem 0.6rem 0.35rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.bon-ref { width: 5.5rem; color: var(--ink-soft); white-space: nowrap; }
.bon-opm { margin-top: 0.8rem; min-height: 1.4rem; }

/* Wegingblok: weging 1 (tarra), weging 2 (bruto), netto + tijdstip rechts */
.bon-weging { margin-top: 1rem; }
.bon-weegtabel { border-collapse: collapse; width: 100%; max-width: 28rem; }
.bon-weegtabel td { padding: 0.3rem 1.2rem 0.3rem 0; }
.bon-weegtijd { text-align: right; vertical-align: middle; color: var(--ink-soft); white-space: nowrap; padding-right: 0 !important; }
.bon-netto td { border-top: 2px solid var(--ink); font-size: 1.1rem; }

/* Drie handtekeningvakken: afzender (voorgedrukt) / transporteur / klant */
.bon-sign3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin-top: 1.5rem; }
.sign-box { border: 1px solid var(--ink); border-radius: 4px; min-height: 9.5rem; display: flex; flex-direction: column; }
.sign-box-title { font-size: 0.8rem; font-weight: 700; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); }
.sign-box-area { padding: 0.5rem; flex: 1; }
.sign-afzender { margin: 0; font-size: 0.8rem; color: var(--ink-soft); line-height: 1.5; }
.sign-img { display: block; max-width: 100%; max-height: 4.5rem; }
.sign-meta { font-size: 0.75rem; color: var(--ink-soft); margin-top: 0.25rem; }

/* CE-regel + voetblok in drie kolommen */
.bon-ce { margin: 1rem 0 0; font-size: 0.8rem; color: var(--ink-soft); }
.bon-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1rem; padding-top: 0.8rem; border-top: 2px solid var(--sand-600); font-size: 0.8rem; line-height: 1.5; }
.bon-foot strong { display: block; margin-bottom: 0.15rem; }

@media print {
    @page { size: A4; margin: 12mm; }
    .no-print, .topbar, .fullscreen-control { display: none !important; }
    body { background: #fff; }
    .bon { border: none; margin: 0; max-width: none; padding: 0; }
    .bon-weging, .bon-sign3, .bon-foot { break-inside: avoid; }
    .sign-box { border-color: #000; }
}

/* Instellingen: een stapel vakjes. Een nieuw vakje is een partial die hier
   vanzelf de tussenruimte en het anker meekrijgt. */
.settings-cards { display: flex; flex-direction: column; gap: 1.25rem; }
.settings-card.panel { margin-bottom: 0; scroll-margin-top: 1rem; }
.settings-card > h2 { margin-top: 0; }
.settings-card h3 { font-size: 1.05rem; margin: 0.35rem 0; }
.settings-card .form-grid { margin-top: 0.9rem; }
.settings-note { margin-top: 1.25rem; }

/* Voorbeeld van de banner op de website. Zelfde kleuren als
   www/css/site.css .announce: #c5bd08 (--sand-500) en vet #313e46
   (--sand-700). Contrast ongeveer 5,6:1 (WCAG AA). */
.banner-preview .announce {
    background: var(--sand-500); color: var(--sand-700); text-align: center;
    padding: 0.6rem 1.25rem; font-weight: 700; line-height: 1.45;
    margin: 0.75rem 0 0; border-radius: 8px;
}
.banner-preview .announce p { margin: 0 auto; max-width: 70rem; overflow-wrap: anywhere; white-space: pre-line; }

@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
    .bon-sign3, .bon-foot, .role-cards { grid-template-columns: 1fr; }
    .topbar-user { width: 100%; justify-content: flex-end; }
}

/* ============ Beheerlijsten: zoeken, kolomkiezer, multiselect ============ */
.list-toolbar { display: flex; gap: 0.75rem; align-items: flex-start; flex-wrap: wrap; margin: 0.75rem 0 1rem; }
.list-toolbar .search-form { margin: 0; flex: 1 1 320px; max-width: 560px; }
.kolomkiezer { position: relative; }
.kolomkiezer summary { list-style: none; cursor: pointer; }
.kolomkiezer summary::-webkit-details-marker { display: none; }
.kolomkiezer-panel {
    position: absolute; right: 0; z-index: 20; margin-top: 0.4rem; min-width: 240px;
    background: var(--white); border: 1px solid var(--line); border-radius: 12px;
    padding: 0.85rem 1rem; box-shadow: 0 10px 30px rgba(43, 52, 58, 0.12);
}
.kolomkiezer-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem 1rem; margin-bottom: 0.75rem; }
.kolomkiezer-list .check { font-weight: 500 !important; white-space: nowrap; }
.kolomkiezer-actions { display: flex; gap: 0.5rem; align-items: center; }

.bulk-check { width: 2.2rem; text-align: center; }
.bulk-check input { width: 1.1rem; height: 1.1rem; }
.table tr.is-selected td { background: var(--blue-bg); }
.bulk-bar {
    position: sticky; bottom: 0.75rem; z-index: 15; margin-top: 1rem;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
    background: var(--sand-600); color: var(--white); border-radius: 12px; padding: 0.7rem 1rem;
    box-shadow: 0 10px 30px rgba(43, 52, 58, 0.25);
}
.bulk-bar .btn-ghost { color: var(--white); }
.bulk-bar .btn-danger-outline { background: transparent; color: #ffb4ad; border-color: #ffb4ad; }
.bulk-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.row-actions { display: flex; gap: 0.6rem; justify-content: flex-end; align-items: center; white-space: nowrap; }
.row-actions form { margin: 0; }
.btn-link-danger { background: none; border: none; padding: 0; font: inherit; color: var(--red-600); cursor: pointer; text-decoration: underline; }
.btn-link { background: none; border: none; padding: 0; font: inherit; color: var(--blue-700, inherit); cursor: pointer; text-decoration: underline; }

/* Bulk bewerken: compacte invoervelden per rij */
.bulk-edit-scroll { overflow-x: auto; }
.bulk-edit-table { min-width: 960px; }
.bulk-edit-table td, .bulk-edit-table th { padding: 0.35rem 0.4rem; vertical-align: middle; }
.bulk-edit-table input[type="text"], .bulk-edit-table input[type="email"], .bulk-edit-table input[type="tel"], .bulk-edit-table select { padding: 0.35rem 0.5rem; font-size: 0.95rem; width: 100%; min-width: 5.5rem; }
.bulk-edit-table input.is-narrow { min-width: 4.5rem; max-width: 6.5rem; }
.bulk-edit-table .check { white-space: nowrap; }
.quick-apply { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem 1rem; align-items: end; }
.quick-apply label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; }

/* Bulk verwijderen: bevestigingsoverzicht */
.delete-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.delete-preview ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.delete-preview li { margin: 0.15rem 0; }

.filter-tabs .filter-label { align-self: center; min-width: 6.5rem; margin-right: 0.25rem; }
.bulk-edit-table [aria-invalid="true"], .quick-apply [aria-invalid="true"] { border-color: var(--red-600); box-shadow: 0 0 0 2px var(--red-bg); }

/* CE-teken naast productlijnen (weegbon) */
.ce-mark { display: inline-block; vertical-align: -0.15em; margin-left: 0.35rem; color: var(--ink); }
.bon-ce .ce-mark { margin: 0 0.2rem 0 0; }

/* Onlinefact-knoppen (klanten, producten, instellingen) */
.onlinefact-toolbar { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin: 0; }
.btn-outline:disabled { border-color: var(--line); color: var(--ink-soft); background: var(--white); cursor: not-allowed; }
.onlinefact-error { margin: 0.75rem 0; overflow-wrap: anywhere; }

/* Productenlijst: één rij per product (groep) met de maten ingesprongen eronder */
.list-intro { margin: 0 0 0.25rem; }
.product-list .group-row td { background: var(--sand-50); border-top: 2px solid var(--line); }
.product-list tr.group-row:first-child td { border-top: none; }
.group-line { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.group-name { font-size: 1.05rem; }
.product-list .variant-maat { padding-left: 2rem; white-space: nowrap; }
.product-list .row-actions { flex-wrap: wrap; white-space: normal; }
/* Compact zoals de bestellingen: zoveel mogelijk producten op één blad. */
.table.product-list { font-size: 0.94rem; }
.table.product-list th { font-size: 0.8rem; }
.table.product-list th, .table.product-list td { padding: 0.2rem 0.45rem; }
.product-list .group-name { font-size: 1rem; }
.product-list .group-line { gap: 0.35rem; }
.product-list .variant-maat { padding-left: 1.1rem; }
.product-list .badge, .product-list .badge-toggle { font-size: 0.78rem; padding: 0.05rem 0.4rem; }
.product-list .row-actions { gap: 0.15rem 0.6rem; font-size: 0.86rem; }

/* Bevestiging bij verwijderen van een maat of groep (native dialog). */
dialog.confirm-dialog {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.25rem 1.4rem 1.1rem;
    max-width: 40rem;
    width: calc(100vw - 2rem);
    color: var(--ink);
    background: var(--white);
    box-shadow: 0 18px 50px rgba(43, 52, 58, 0.28);
}
dialog.confirm-dialog::backdrop { background: rgba(43, 52, 58, 0.48); }
dialog.confirm-dialog h2 { margin: 0 0 0.6rem; font-size: 1.25rem; }
dialog.confirm-dialog p { margin: 0.35rem 0 0.75rem; }
dialog.confirm-dialog ul { margin: 0.35rem 0 0.85rem; padding-left: 1.15rem; }
dialog.confirm-dialog li { margin: 0.15rem 0; }
dialog.confirm-dialog .form-actions { margin-top: 0.35rem; }
.product-list tr.is-inactive td, .table tr.is-inactive td { color: var(--ink-soft); }
.badge-toggle { border: 1px solid transparent; cursor: pointer; font: inherit; font-size: 0.82rem; font-weight: 600; }
.badge-toggle.is-on { background: var(--green-bg); color: var(--green-600); border-color: var(--green-600); }
.badge-toggle.is-off { background: var(--white); color: var(--ink-soft); border-color: var(--line); }
.badge-toggle:hover { text-decoration: underline; }
.badge-toggle:focus-visible { outline: 2px solid var(--sand-500); outline-offset: 1px; }
.group-photo { display: block; max-width: 220px; border-radius: 10px; margin-top: 0.4rem; border: 1px solid var(--line); }
.bulk-edit-table .bulk-edit-name { white-space: nowrap; font-weight: 600; }

/* Orderboek: Excel-achtige maandtab, horizontaal scrollend */
.orderboek-wide.has-sidebar .main { max-width: none; }
.ob-nav { margin: 0.4rem 0 1rem; }
.ob-legend { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin: 0 0 0.4rem; font-size: 0.78rem; color: var(--ink-soft); }
.ob-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.ob-swatch { width: 0.9rem; height: 0.9rem; border-radius: 3px; border: 1px solid var(--line); display: inline-block; }
.ob-swatch.tone-open { background: var(--white); border: 1px solid var(--line); }
.ob-filters { display: flex; flex-wrap: wrap; gap: 0.4rem 0.6rem; align-items: center; margin: 0 0 0.4rem; }
.ob-filters label { display: flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; font-weight: 600; color: var(--ink-soft); }
.ob-filters select, .ob-filters input { min-width: 6.5rem; max-width: 10rem; padding: 0.2rem 0.4rem; font-size: 0.78rem; }
.ob-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.ob-sheet { border-collapse: collapse; min-width: 2200px; font-size: 0.88rem; }
.ob-sheet th, .ob-sheet td { border: 1px solid var(--line); padding: 0.28rem 0.35rem; vertical-align: middle; }
.ob-sheet th { position: sticky; top: 0; background: var(--sand-100); z-index: 1; font-size: 0.8rem; }
/* Voorraad: eigen scrolkader, kolomtitels blijven staan bij het scrollen. */
.stock-scroll { max-height: calc(100vh - 140px); overflow: auto; }
.stock-scroll .stock-overview thead th { z-index: 3; box-shadow: inset 0 -1px 0 var(--line); }
/* Geen kleur meer voor gefactureerd (blauw) of stock-in (groen): alle regels wit. */
.ob-sheet tr.tone-invoiced td,
.ob-sheet tr.tone-stock td { background: var(--white); }
.ob-sheet tr.tone-open td { background: var(--white); }
.ob-sheet tr.ob-total td { background: var(--sand-600); color: var(--white); font-weight: 700; }
.ob-sheet td.num, .ob-sheet th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ob-sheet input[type="text"], .ob-sheet input[type="number"], .ob-sheet select {
    padding: 0.2rem 0.3rem; font-size: 0.78rem; border-radius: 6px; min-width: 4.2rem; width: 100%;
}
.ob-sheet input.ob-tiny { min-width: 3.2rem; max-width: 5.5rem; }
.ob-sheet input.ob-wide { min-width: 7rem; }
.ob-sheet input[type="date"] { padding: 0.2rem 0.3rem; font-size: 0.78rem; border-radius: 6px; width: 8.2rem; }
/* Verpakking: "los" of "BB" zonder pijltje; het aantal big bags staat er
   enkel naast bij big bag. */
.ob-sheet th.ob-pack, .ob-sheet td.ob-pack { width: 3.4rem; max-width: 4.6rem; }
.ob-sheet td.ob-pack .ob-pack-in { display: flex; align-items: center; }
.ob-sheet td.ob-pack select { -webkit-appearance: none; appearance: none; background-image: none; min-width: 0; width: 2.6rem; padding: 0.15rem 0.2rem; cursor: pointer; }
.ob-sheet td.ob-pack input.ob-count { display: none; min-width: 0; width: 1.9rem; padding: 0.15rem 0.2rem; }
.ob-sheet td.ob-pack.is-bb input.ob-count { display: block; }
/* Smalle kolommen: leverancier ("stock") en lossen. */
.ob-sheet th.ob-narrow, .ob-sheet td.ob-narrow { width: 3.2rem; max-width: 4.2rem; }
.ob-sheet td.ob-narrow input { min-width: 0; width: 100%; }
.ob-sheet td.ob-narrow .muted { font-size: 0.72rem; }
/* Gewicht en het vinkje "gewogen/gelost" op één regel. */
.ob-sheet td.ob-tons-cell { white-space: nowrap; }
.ob-sheet td.ob-tons-cell input[name="tons"] { display: inline-block; vertical-align: middle; }
.ob-sheet td.ob-tons-cell .ob-confirm { display: inline-flex; vertical-align: middle; padding: 0 0.2rem; }
/* Keuzelijst naast een veld (facturen) neemt niet de hele cel in. */
.ob-sheet td.nowrap select { width: auto; }
.ob-sheet td.nowrap input[type="text"] { width: 4.8rem; min-width: 0; }
.ob-sheet td.ob-stack select, .ob-sheet td.ob-stack input { display: block; }
.ob-sheet td.ob-stack input { margin-top: 0.2rem; }
.ob-sheet tr.ob-new td { background: var(--sand-100); border-top: 2px solid var(--sand-600); }
.ob-sheet td.is-missing input { border-color: var(--red-600); background: var(--red-bg); }
.ob-sheet .ob-no-price { color: var(--red-600); font-weight: 700; }
.ob-missing { display: block; color: var(--red-600); font-size: 0.7rem; font-weight: 700; }
/* Rekenblad (met JavaScript): rasterlook, vaste koprij, eerste kolom en totaalrij. */
.ob-sheet-status { min-height: 1.3rem; margin: 0 0 0.35rem; font-size: 0.85rem; color: var(--ink-soft); }
.ob-sheet-status.is-ok { color: var(--green-600); }
.ob-sheet-status.is-error { color: var(--red-600); font-weight: 600; }
.js-sheet .ob-scroll { max-height: calc(100vh - 120px); overflow: auto; scroll-padding-left: 9rem; scroll-padding-top: 2.4rem; scroll-padding-bottom: 2.4rem; }
.js-sheet .ob-sheet th:first-child, .js-sheet .ob-sheet td:first-child { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--line); }
.js-sheet .ob-sheet thead th { z-index: 2; }
.js-sheet .ob-sheet thead th:first-child { z-index: 4; }
.js-sheet .ob-sheet tfoot td { position: sticky; bottom: 0; z-index: 2; }
.js-sheet .ob-sheet tfoot td:first-child { z-index: 4; }
.js-sheet .ob-sheet td { padding: 0; }
.js-sheet .ob-sheet td.num, .js-sheet .ob-sheet td.muted, .js-sheet .ob-sheet td.ob-state-cell { padding: 0.28rem 0.35rem; }
.js-sheet .ob-sheet td a.muted { padding: 0 0.3rem; font-size: 0.72rem; }
.js-sheet .ob-sheet td input, .js-sheet .ob-sheet td select {
    border: 1px solid transparent; border-radius: 0; background: transparent; box-shadow: none; padding: 0.3rem 0.35rem; margin: 0;
}
.js-sheet .ob-sheet td input:hover, .js-sheet .ob-sheet td select:hover { border-color: rgba(43, 52, 58, 0.18); }
.js-sheet .ob-sheet td input:focus, .js-sheet .ob-sheet td select:focus {
    outline: 2px solid var(--green-600); outline-offset: -2px; background: var(--white); border-color: transparent;
}
.js-sheet .ob-sheet td input[inputmode="decimal"] { text-align: right; font-variant-numeric: tabular-nums; }
.js-sheet .ob-sheet td.is-missing input { background: var(--red-bg); border-color: var(--red-600); }
.js-sheet .ob-sheet td.ob-pack input.ob-count { margin-top: 0; border-left-color: rgba(43, 52, 58, 0.12); }
.js-sheet .ob-sheet td.ob-stack input { margin-top: 0; }
.ob-sheet .is-invalid, .js-sheet .ob-sheet td .is-invalid { outline: 2px solid var(--red-600); outline-offset: -2px; background: var(--red-bg); }
/* Meteen verborgen (niet pas als het script loopt): het rekenblad bewaart vanzelf. Zonder JavaScript toont een noscript-stijl de knop. */
.ob-sheet .ob-save-btn { display: none; }
.js-sheet .ob-sheet tr.is-error .ob-save-btn { display: inline-flex; margin-left: 0.25rem; }
.ob-sheet tr.is-estimate input[name="tons"], .ob-sheet tr.is-estimate input[name="requested_on"] { color: var(--red-600); font-weight: 700; }
.ob-sheet .ob-confirm { display: flex; align-items: center; gap: 0.2rem; font-size: 0.7rem; color: var(--red-600); padding: 0 0.3rem 0.15rem; white-space: nowrap; }
.ob-sheet .ob-confirm input, .js-sheet .ob-sheet td .ob-confirm input { width: auto; min-width: 0; margin: 0; padding: 0; }
.ob-sheet td.ob-flow { font-weight: 700; padding: 0.28rem 0.35rem; }
.variant-code { display: inline-block; margin-left: 0.4rem; padding: 0 0.4rem; border-radius: 6px; background: var(--sand-100); color: var(--ink-soft); font-size: 0.78rem; font-weight: 600; }
.tariff-table input { width: 100%; min-width: 0; padding: 0.25rem 0.35rem; font-size: 0.85rem; }
.tariff-table td, .tariff-table th { padding: 0.25rem 0.3rem; }
.tariff-table input.tariff-price, .tariff-table input.tariff-km { width: 4.8rem; text-align: right; }
.tariff-table td:first-child input { min-width: 11rem; }
.pickup-field { display: flex; flex-direction: column; gap: 0.3rem; }
.pickup-choice { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem 0.8rem; }
.pickup-choice label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; }
.pickup-choice .input-kw { width: 6rem; }
.orders-sheet td { padding: 0.35rem 0.5rem; }
.orders-sheet tr.order-more td { border-top-color: transparent; }
table.ob-sheet.orders-sheet { width: 100%; min-width: 0; }
.orders-sheet tr.order-more .ob-ref, .orders-sheet tr.order-more td:nth-child(2), .orders-sheet tr.order-more td:nth-child(3) { color: var(--ink-soft); }
.orders-sheet .order-weight { color: var(--red-600); font-weight: 700; }
.orders-sheet .actions-cell { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.sheet-import { margin: 0 0 1rem; padding: 0.6rem 1rem; }
.sheet-import summary { cursor: pointer; font-weight: 600; }
.sheet-import .inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.cost-block { border: 1px solid var(--line); border-radius: 12px; padding: 0.75rem 1rem 1rem; }
.cost-block legend { font-weight: 700; padding: 0 0.35rem; }
/* Eenvoudig orderboek: hoofdrij + uitklapbare detailregel. */
.ob-sheet.ob-simple { min-width: 0; width: auto; font-size: 0.94rem; }
.ob-sheet .ob-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 0.25rem; }
.ob-sheet .ob-sort:focus-visible { outline: 2px solid var(--sand-600); outline-offset: 2px; }
.ob-sheet .ob-sort::after { content: "↕"; opacity: 0.35; font-size: 0.9em; }
.ob-sheet th[aria-sort="ascending"] .ob-sort::after { content: "▲"; opacity: 1; }
.ob-sheet th[aria-sort="descending"] .ob-sort::after { content: "▼"; opacity: 1; }
.ob-sheet.ob-simple th { font-size: 0.82rem; text-align: left; }
.ob-sheet.ob-simple input.ob-wide { min-width: 12rem; }
/* Smalle kolommen zoals in Berts Excel: product, bestemming, transporteur, gewicht, prijs. */
.ob-sheet.ob-simple input[name="product_name"] { min-width: 0; width: 7rem; }
.ob-sheet.ob-simple input[name="unload_place"] { min-width: 0; width: 7.5rem; }
.ob-sheet.ob-simple input[name="carrier_name"] { min-width: 0; width: 6.5rem; }
.ob-sheet.ob-simple td > input[name="tons"], .ob-sheet.ob-simple td input[name="tons"] { min-width: 0; width: 4.2rem; }
.ob-sheet.ob-simple input[name="sales_price"] { min-width: 0; width: 4.4rem; }
.ob-sortbar { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 0.25rem 0; font-size: 0.8rem; }
.ob-sortbar select { padding: 0.2rem 0.4rem; font-size: 0.78rem; }
.ob-sortbar label { display: flex; align-items: center; gap: 0.4rem; font-weight: 600; white-space: nowrap; }
.ob-sheet .ob-sort { text-decoration: underline dotted; text-underline-offset: 3px; }
.ob-detail-head { margin: 0.2rem 0 0.6rem; font-size: 0.9rem; }
.ob-note { margin: 0 0 0.4rem; font-size: 0.78rem; color: var(--ink-soft); }
.ob-note.is-warn { color: var(--red-600); font-weight: 600; }
.ob-detail-grid section { background: rgba(255, 255, 255, 0.55); border: 1px solid var(--line); border-radius: 10px; padding: 0.5rem 0.7rem; }
.ob-detail-grid section.ob-focus { border-color: var(--sand-600); box-shadow: 0 0 0 1px var(--sand-600) inset; }
.ob-figures .ob-big dt, .ob-figures .ob-big dd { font-size: 1rem; font-weight: 700; color: var(--ink); }
.ob-sheet.ob-simple input.ob-tiny { max-width: 7rem; }
.ob-sheet.ob-simple input.ob-mid { min-width: 8rem; }
.ob-ref a { font-weight: 600; }
.ob-kind { display: inline-block; min-width: 4.4rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
tr.is-estimate .ob-kind { color: var(--red-600); font-weight: 700; }
.ob-flowtag { margin-left: 0.3rem; padding: 0 0.35rem; border-radius: 6px; background: rgba(255, 255, 255, 0.7); font-size: 0.72rem; font-weight: 700; }
.ob-detail-toggle { border: 1px solid var(--line); background: var(--white); border-radius: 6px; padding: 0.1rem 0.5rem; font: inherit; font-size: 0.78rem; cursor: pointer; }
.ob-detail-toggle[aria-expanded="true"] { background: var(--sand-600); color: var(--white); border-color: var(--sand-600); }
.ob-detail-sum { margin-left: 0.4rem; font-size: 0.78rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
/* Detail standaard dicht, ook terwijl de pagina nog laadt (zonder JavaScript: zie <noscript> in de maand). */
.ob-sheet tr.ob-detail:not(.is-open) { display: none; }
.js-sheet .ob-sheet tr.ob-detail > td:first-child { position: static; box-shadow: none; }
.ob-sheet tr.ob-detail > td { padding: 0.6rem 0.8rem 0.9rem; border-top: none; }
.ob-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.8rem 1.4rem; }
.ob-detail-grid h3 { margin: 0 0 0.35rem; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
.ob-detail-grid label { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.78rem; font-weight: 600; margin-bottom: 0.4rem; }
.js-sheet .ob-sheet .ob-detail-grid input, .js-sheet .ob-sheet .ob-detail-grid select { border: 1px solid rgba(43, 52, 58, 0.18); background: var(--white); border-radius: 6px; width: 100%; }
.ob-detail-grid .inline-form { display: flex; gap: 0.3rem; }
.ob-detail-grid .inline-form select { width: auto; flex: 1; }
.ob-detail-grid .inline-form input { width: 6rem; }
.ob-detail-grid .ob-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.ob-figures { margin: 0; display: grid; gap: 0.15rem; }
.ob-figures div { display: flex; justify-content: space-between; gap: 0.6rem; font-size: 0.85rem; }
.ob-figures dt { color: var(--ink-soft); }
.ob-figures dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.ob-sheet .ob-detail-grid label.is-missing input { border-color: var(--red-600); background: var(--red-bg); }
.ob-state { display: inline-block; min-width: 0.9rem; font-weight: 700; text-align: center; }
tr.is-saving .ob-state, tr.is-dirty .ob-state { color: var(--ink-soft); }
tr.is-saved .ob-state { color: var(--green-600); }
tr.is-error .ob-state { color: var(--red-600); }
.ob-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.ob-summary div { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem 0.9rem; }
.ob-summary strong { display: block; font-size: 1.15rem; }
.ob-summary span { color: var(--ink-soft); font-size: 0.82rem; }
.ob-summary div.is-alarm { border-color: var(--red-600); }
.ob-summary div.is-alarm strong { color: var(--red-600); }
/* Voorraad: overzicht per maat, rood onder het minimum. */
.stock-overview tr.is-below td { background: #fde2e1; }
.stock-overview tr.is-below td:first-child a { color: var(--red-600); font-weight: 700; }
.stock-min-form { gap: 0.3rem; flex-wrap: nowrap; }
.stock-min-form input { width: 5.5rem; padding: 0.2rem 0.4rem; }
details.stock-detail > summary { cursor: pointer; list-style: none; }
details.stock-detail > summary::-webkit-details-marker { display: none; }
details.stock-detail > summary::before { content: "▸ "; color: var(--ink-soft); }
details.stock-detail[open] > summary::before { content: "▾ "; }
.order-stock { color: var(--ink-soft); }
.ob-monthnav { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.stock-move { font-size: 0.9rem; }
.stock-move td.num { text-align: right; white-space: nowrap; }
.stock-below { color: var(--red-600); font-weight: 700; }

/* Orderboek detail: welke facturen horen bij de flow (ja/nee, zoals Berts tabel). */
.ob-detail-grid .ob-docs-section { grid-column: 1 / -1; }
.ob-docs { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
.ob-docs th, .ob-docs td { border-bottom: 1px solid var(--line); padding: 0.25rem 0.4rem; text-align: left; vertical-align: middle; }
.ob-docs thead th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
.ob-docs tbody th { white-space: nowrap; font-weight: 700; }
.ob-docs tr.is-no th, .ob-docs tr.is-no td { color: var(--ink-soft); background: rgba(0, 0, 0, 0.03); }
.ob-docs tr.is-focus th { color: var(--sand-700); }
.ob-docs .ob-yes { display: inline-block; padding: 0 0.45rem; border-radius: 999px; background: var(--green-bg); color: var(--green-600); font-weight: 700; }
.ob-docs .ob-no { display: inline-block; padding: 0 0.45rem; border-radius: 999px; background: rgba(0, 0, 0, 0.06); color: var(--ink-soft); }
.js-sheet .ob-sheet .ob-docs input, .js-sheet .ob-sheet .ob-docs select { border: 1px solid rgba(43, 52, 58, 0.18); background: var(--white); border-radius: 6px; }
.ob-docs input[name$="_price"] { width: 5.5rem; text-align: right; }
.ob-docs input[name$="_number"] { width: 7rem; }
.ob-docs input[name="supplier_name"] { width: 10rem; }
.ob-docs td.is-missing input { border-color: var(--red-600); background: var(--red-bg); }
.ob-docs .ob-sub { display: block; font-size: 0.68rem; color: var(--ink-soft); }
.ob-docs .ob-readonly { font-variant-numeric: tabular-nums; }

/* Orderboek: verpakking en factuurnummers in de rij, teller ontbrekende nummers. */
.ob-sheet.ob-simple td.ob-pack { white-space: nowrap; }
.ob-sheet.ob-simple td.ob-pack select { width: 2.8rem; min-width: 0; }
.ob-sheet.ob-simple td.ob-pack input.ob-count { width: 2.4rem; min-width: 0; }
.ob-nrs { white-space: nowrap; }
.ob-nrs-in { display: grid; grid-template-columns: repeat(3, max-content); gap: 0.4rem; align-items: center; }
.ob-nr-slot { display: flex; gap: 0.3rem; }
.ob-nr { display: flex; align-items: center; gap: 0.2rem; font-size: 0.75rem; font-weight: 700; color: var(--ink-soft); }
.ob-sheet.ob-simple .ob-nr input { width: 5.2rem; min-width: 0; padding: 0.1rem 0.25rem; font-size: 0.8rem; }
/* Ontbrekend factuurnummer (aankoop, transport, lossen, verkoop): rood. */
.ob-nr input:placeholder-shown { background: #fdecec; border-color: #d9534f; color: #b52a25; }
.ob-nr input:placeholder-shown::placeholder { color: #c9302c; font-weight: 700; opacity: 1; }
.ob-nr:has(input:placeholder-shown) > span { color: #c9302c; }
/* Nog geen laaddatum: ook rood. */
.ob-sheet input.ob-date.is-missing { background: #fdecec; border-color: #d9534f; color: #b52a25; }
.ob-missing-numbers { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.45rem; margin: 0.2rem 0; font-size: 0.75rem; }
.ob-missing-numbers a, .ob-missing-numbers .ob-missing-total { padding: 0.1rem 0.5rem; border-radius: 999px; background: #fde2e1; color: var(--red-600); text-decoration: none; }
.ob-missing-numbers .is-zero { background: var(--green-bg); color: var(--green-600); }
.ob-pack-in { display: inline-flex; gap: 0.2rem; align-items: center; }
.ob-sheet.ob-simple td.ob-pack { width: auto; max-width: none; min-width: 7.4rem; }

/* Detail: "detail" toont de facturen, "resultaat" de cijfers. */
.js-sheet .ob-detail:not([data-panel="resultaat"]) .ob-panel-resultaat { display: none; }
.js-sheet .ob-detail[data-panel="resultaat"] .ob-panel-facturen { display: none; }
.ob-detail-toggle + .ob-detail-toggle { margin-left: 0.2rem; }
.ob-detail-toggle[aria-expanded="true"] { background: var(--ink); color: var(--white); }
.ob-detail-grid .ob-result { max-width: 22rem; }
.ob-fullform { margin-left: 0.6rem; font-size: 0.72rem; font-weight: 400; text-transform: none; letter-spacing: 0; }

/* Orderboek overzicht: sommen per groep. */
.ob-summary-table { font-size: 0.88rem; white-space: nowrap; }
.ob-summary-table tfoot td { font-weight: 700; border-top: 2px solid var(--ink); background: var(--sand-100); }

/* Uitgeklapt detail/resultaat: een kaart onder de regel, altijd zichtbaar
   (blijft links staan bij horizontaal scrollen), met tegels. */
.ob-sheet tr.ob-detail > td { background: #f4f1ea !important; padding: 0.5rem 0.6rem 0.8rem; }
.ob-sheet tr[data-form]:has(+ tr.ob-detail.is-open) > td { border-bottom-color: transparent; box-shadow: inset 0 -2px 0 var(--ink); }
.ob-card { position: sticky; left: 0.5rem; width: max-content; max-width: min(1150px, calc(100vw - 320px)); background: var(--white);
    border: 1px solid var(--line); border-left: 5px solid var(--sand-600); border-radius: 10px; padding: 0.6rem 0.8rem 0.7rem;
    box-shadow: 0 2px 8px rgba(43, 52, 58, 0.08); white-space: normal; }
.ob-detail.tone-open .ob-card { border-left-color: #9aa3ab; }
.ob-detail.tone-stock .ob-card,
.ob-detail.tone-invoiced .ob-card { border-left-color: #9aa3ab; }
.ob-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-bottom: 0.6rem; font-size: 0.92rem; }
.ob-card-head .ob-fullform { margin-left: auto; font-size: 0.78rem; }
.ob-card-head .ob-fullform + .ob-fullform { margin-left: 0.9rem; }
.ob-tiles { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: stretch; }
.ob-tile { min-width: 11rem; max-width: 15rem; flex: 1 1 11rem; background: var(--sand-50); border: 1px solid var(--line); border-radius: 8px; padding: 0.45rem 0.6rem; }
.ob-tile.is-missing { border-color: var(--red-600); background: #fff3f2; }
.ob-tile-title { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); margin-bottom: 0.3rem; }
.ob-tile-note { margin: 0 0 0.3rem; font-size: 0.8rem; color: var(--ink-soft); }
.ob-tile-value { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 0.15rem; }
.ob-tile label { display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.74rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 0.3rem; }
.js-sheet .ob-sheet .ob-tile input { width: 100%; border: 1px solid rgba(43, 52, 58, 0.22); background: var(--white); border-radius: 6px; padding: 0.2rem 0.4rem; font-size: 0.88rem; }
.ob-tile input[name$="_price"] { text-align: right; }
.ob-not-needed { flex-basis: 100%; margin: 0; font-size: 0.78rem; color: var(--ink-soft); }
.ob-kpi { min-width: 8.5rem; background: var(--sand-50); border: 1px solid var(--line); border-radius: 8px; padding: 0.4rem 0.6rem; display: flex; flex-direction: column; gap: 0.1rem; }
.ob-kpi span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
.ob-kpi strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.ob-kpi.is-main { background: var(--green-bg); border-color: var(--green-600); }
.ob-kpi.is-main strong { font-size: 1.2rem; color: var(--green-600); }
.ob-kpi.is-open { background: #f1f2f3; }

/* Orderboek als rekenblad: volledig scherm, alle cijfers als kolommen,
   kolomtitels en de eerste kolom blijven staan bij het scrollen. */
body.ob-rekenblad .sidebar, body.ob-rekenblad .ob-nav, body.ob-rekenblad .ob-intro,
body.ob-rekenblad .ob-legend, body.ob-rekenblad .ob-month-summary { display: none; }
/* Orderboek: compacte kop — totalen op één regel, uitleg inklapbaar. */
.ob-total-detail > summary { list-style: none; cursor: pointer; }
.ob-total-detail > summary::-webkit-details-marker { display: none; }
.ob-total-more { margin-left: 0.6rem; padding: 0 0.45rem; border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 6px; font-size: 0.75rem; }
.ob-total-more::after { content: " ▸"; }
.ob-total-detail[open] .ob-total-more::after { content: " ▾"; }
.ob-total-detail .ob-totals div { color: var(--ink); }
.ob-total-note { margin: 0.3rem 0 0; font-weight: 400; font-size: 0.75rem; }
.ob-totals { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0 0; }
.ob-totals div { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 0.3rem 0.6rem; }
.ob-totals dt { color: var(--ink-soft); font-size: 0.72rem; }
.ob-totals dd { margin: 0; font-weight: 700; font-size: 0.88rem; }
.ob-help summary { cursor: pointer; text-decoration: underline dotted; }
.ob-help[open] { flex-basis: 100%; }
.ob-help p { margin: 0.3rem 0; max-width: 60rem; }
body.ob-rekenblad .app-shell { grid-template-columns: minmax(0, 1fr); }
body.ob-rekenblad.has-sidebar .main { padding: 0.5rem 0.75rem 0.5rem; max-width: none; }
body.ob-rekenblad .page-head { margin-bottom: 0.3rem; }
body.ob-rekenblad .page-head h1 { font-size: 1.15rem; margin: 0; }
body.ob-rekenblad .ob-filters { margin-bottom: 0.3rem; }
body.ob-rekenblad .ob-scroll { max-height: calc(100vh - 11rem); overflow: auto; }
body.ob-rekenblad .ob-sheet.ob-simple { width: max-content; }
body.ob-rekenblad .ob-sheet thead th { position: sticky; top: 0; z-index: 3; }
body.ob-rekenblad .ob-sheet tbody td:first-child, body.ob-rekenblad .ob-sheet thead th:first-child { position: sticky; left: 0; z-index: 2; }
body.ob-rekenblad .ob-sheet thead th:first-child { z-index: 4; }
body.ob-rekenblad .ob-sheet tbody tr.tone-open td:first-child { background: var(--white); }
body.ob-rekenblad .ob-sheet tbody tr.tone-stock td:first-child,
body.ob-rekenblad .ob-sheet tbody tr.tone-invoiced td:first-child { background: var(--white); }
body.ob-rekenblad .ob-sheet tbody td:first-child { box-shadow: 1px 0 0 var(--line); }
body.ob-rekenblad .ob-sheet td.ob-profit { font-weight: 700; }
body.ob-rekenblad .ob-sheet td.is-missing input { border-color: var(--red-600); background: #fff3f2; }
.ob-mode-toggle { margin-left: auto; }
/* Rekenblad compact zoals Berts Excel: lage rijen, cellen zonder kaders. */
body.ob-rekenblad .ob-sheet { font-size: 0.82rem; }
body.ob-rekenblad .ob-sheet th, body.ob-rekenblad .ob-sheet td { padding: 0.12rem 0.3rem; }
body.ob-rekenblad .ob-sheet th { font-size: 0.72rem; }
body.ob-rekenblad .ob-sheet input, body.ob-rekenblad .ob-sheet select { padding: 0.05rem 0.2rem; font-size: 0.82rem; }
body.ob-rekenblad .ob-sheet td.ob-open { background: rgba(58, 155, 216, 0.12); }
body.ob-rekenblad .ob-sheet input[name="customer_order_number"] { width: 7.5rem; min-width: 0; }
/* Rekenblad: totaalrij onderaan per kolom (blijft zichtbaar), stock achteraan. */
body.ob-rekenblad .ob-sheet tfoot td { position: sticky; bottom: 0; z-index: 3; background: var(--sand-600); color: var(--white); font-weight: 700; }
body.ob-rekenblad .ob-sheet tfoot td:first-child { left: 0; z-index: 4; }
body.ob-rekenblad .ob-sheet td.ob-stock { font-weight: 600; border-left: 2px solid var(--line); }

/* Volledig formulier van een orderboekregel: compact, op één blad. */
.ob-compact-form { padding: 0.6rem 0.8rem; font-size: 0.85rem; }
.ob-compact-head { margin: 0 0 0.4rem; color: var(--ink-soft); }
.ob-compact-form fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 0.5rem; padding: 0.35rem 0.6rem 0.5rem;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.3rem 0.6rem; }
.ob-compact-form legend { font-weight: 700; font-size: 0.8rem; padding: 0 0.3rem; }
.ob-compact-form label { display: flex; flex-direction: column; gap: 0.05rem; font-size: 0.72rem; font-weight: 600; color: var(--ink-soft); margin: 0; }
.ob-compact-form label.w2 { grid-column: span 2; }
.ob-compact-form input, .ob-compact-form select { padding: 0.15rem 0.35rem; font-size: 0.85rem; min-height: 0; }
.ob-compact-form .ob-inline { display: flex; gap: 0.2rem; }
.ob-compact-form .ob-inline input { width: 3.2rem; }
.ob-compact-docs { grid-column: 1 / -1; border-collapse: collapse; width: 100%; }
.ob-compact-docs th, .ob-compact-docs td { padding: 0.15rem 0.35rem; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.82rem; }
.ob-compact-docs thead th { font-size: 0.7rem; color: var(--ink-soft); text-transform: uppercase; }
.ob-compact-docs input { width: 100%; max-width: 12rem; }
.ob-compact-bottom { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; }
.ob-compact-bottom .w-notes { flex: 1 1 18rem; }
.ob-compact-surcharges { flex: 1 1 16rem; font-size: 0.8rem; }
.ob-compact-surcharges summary { cursor: pointer; font-weight: 600; }
.ob-surcharge-group { display: flex; flex-wrap: wrap; gap: 0.2rem 0.8rem; margin-top: 0.25rem; }
.ob-compact-delete { margin-top: 0.4rem; }

/* Eén detail: gegevens links, de berekening rechts. */
.ob-detail-two { display: grid; grid-template-columns: minmax(16rem, 1fr) minmax(20rem, 1.1fr); gap: 0.8rem 1.2rem; }
@media (max-width: 900px) { .ob-detail-two { grid-template-columns: 1fr; } }
.ob-detail-two h3 { margin: 0 0 0.35rem; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
.ob-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.35rem 0.6rem; }
.ob-fields label { display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.72rem; font-weight: 600; color: var(--ink-soft); }
.js-sheet .ob-sheet .ob-fields input { width: 100%; border: 1px solid rgba(43, 52, 58, 0.22); background: var(--white); border-radius: 6px; padding: 0.2rem 0.4rem; font-size: 0.86rem; }
.ob-fields input[name$="_price"] { text-align: right; }
.ob-fields label.is-missing input { border-color: var(--red-600); background: #fff3f2; }
.ob-calc { border-collapse: collapse; width: 100%; font-size: 0.86rem; }
.ob-calc th, .ob-calc td { padding: 0.18rem 0.4rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.ob-calc th { font-weight: 600; }
.ob-calc td:nth-child(2) { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.ob-calc td.num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.ob-calc tr.ob-calc-sum td, .ob-calc tr.ob-calc-sum th { border-top: 2px solid var(--ink); }
.ob-calc tr.ob-calc-profit th, .ob-calc tr.ob-calc-profit td.num { color: var(--green-600); font-size: 1rem; font-weight: 700; }
.ob-calc tr.ob-calc-stock th, .ob-calc tr.ob-calc-stock td { border-bottom: none; color: var(--ink-soft); }
.ob-calc-open { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--ink-soft); }
.ob-sheet .ob-card .ob-calc th, .ob-sheet .ob-card .ob-calc td { background: transparent !important; border-left: none; border-right: none; border-top: none; }
.ob-sheet .ob-card .ob-calc tr.ob-calc-sum th, .ob-sheet .ob-card .ob-calc tr.ob-calc-sum td { border-top: 2px solid var(--ink); }
/* Detail: opmerking en toeslagen. */
.ob-detail-data .ob-notes { display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.72rem; font-weight: 600; color: var(--ink-soft); margin-top: 0.4rem; }
.js-sheet .ob-sheet .ob-detail-data .ob-notes input { width: 100%; border: 1px solid rgba(43, 52, 58, 0.22); background: var(--white); border-radius: 6px; padding: 0.2rem 0.4rem; font-size: 0.86rem; }
.ob-surcharges { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.7rem; margin-top: 0.4rem; font-size: 0.8rem; }
.ob-surcharges-title { font-size: 0.72rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; }
.ob-surcharge-target { font-weight: 600; }
.ob-surcharges label.check { display: inline-flex; align-items: center; gap: 0.25rem; }
/* Sorteerbare kolomtitels in gewone lijsten (Weegbonnen, Bestellingen). */
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link span { opacity: 0.4; font-size: 0.85em; }
.sort-link.is-active span { opacity: 1; }
.orders-sheet .ob-sort { all: unset; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.orders-sheet .ob-sort::after { content: " ↕"; opacity: 0.35; font-size: 0.9em; }
.orders-sheet th[aria-sort="ascending"] .ob-sort::after { content: " ▲"; opacity: 1; }
.orders-sheet th[aria-sort="descending"] .ob-sort::after { content: " ▼"; opacity: 1; }

/* Rekenblad: smallere kolommen. */
body.ob-rekenblad .ob-sheet th { white-space: normal; line-height: 1.15; vertical-align: bottom; }
body.ob-rekenblad .ob-sheet th .ob-sort { white-space: normal; }
body.ob-rekenblad .ob-sheet .ob-kind { display: none; }
body.ob-rekenblad .ob-sheet td, body.ob-rekenblad .ob-sheet th { padding: 0.1rem 0.2rem; }
body.ob-rekenblad .ob-sheet input[name="customer_name"] { min-width: 0; width: 8.5rem; }
body.ob-rekenblad .ob-sheet input[name="product_name"] { width: 5.2rem; }
body.ob-rekenblad .ob-sheet input[name="unload_place"] { width: 5.2rem; }
body.ob-rekenblad .ob-sheet input[name="carrier_name"] { width: 5rem; }
body.ob-rekenblad .ob-sheet input[name="customer_order_number"] { width: 5.5rem; }
body.ob-rekenblad .ob-sheet input[name="tons"], body.ob-rekenblad .ob-sheet input[name="sales_price"] { width: 3.6rem; }
body.ob-rekenblad .ob-sheet input[type="date"] { width: 6.9rem; font-size: 0.78rem; }
body.ob-rekenblad .ob-sheet td.ob-pack { min-width: 0; }
body.ob-rekenblad .ob-sheet td.ob-pack select { width: 3.6rem; }
body.ob-rekenblad .ob-sheet td.ob-pack input.ob-count { width: 1.9rem; }
body.ob-rekenblad .ob-nrs-in { gap: 0.2rem; }
body.ob-rekenblad .ob-sheet .ob-nr input { width: 3.8rem; font-size: 0.76rem; }
body.ob-rekenblad .ob-sheet input[name="supplier_name"] { min-width: 0; width: 5.5rem; }
body.ob-rekenblad .ob-sheet input[name="purchase_price"], body.ob-rekenblad .ob-sheet input[name="transport_price"], body.ob-rekenblad .ob-sheet input[name="extra_price"] { min-width: 0; width: 3.6rem; }
body.ob-rekenblad .ob-sheet td.num { font-size: 0.78rem; }
body.ob-rekenblad .ob-sheet .ob-flowtag { font-size: 0.66rem; padding: 0 0.2rem; }
body.ob-rekenblad .ob-sheet input, body.ob-rekenblad .ob-sheet select { min-width: 0 !important; }
body.ob-rekenblad .ob-sheet .ob-nr input { width: 3.4rem; }
body.ob-rekenblad .ob-sheet td.num, body.ob-rekenblad .ob-sheet th.num { padding-left: 0.15rem; padding-right: 0.25rem; }

/* Nieuwe bestelling: compact op één blad, zoals het orderboek. */
.order-compact fieldset { grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }
.order-compact label.w-full, .order-compact .w-full { grid-column: 1 / -1; }
.order-compact textarea { padding: 0.15rem 0.35rem; font-size: 0.85rem; min-height: 0; resize: vertical; }
.order-compact .pickup-field { display: flex; flex-direction: column; gap: 0.05rem; font-size: 0.72rem; font-weight: 600; color: var(--ink-soft); }
.order-compact .pickup-choice { display: flex; gap: 0.3rem; align-items: flex-end; }
.order-compact .pickup-choice label { flex: 0 0 auto; }
.order-compact .pickup-choice input[type="date"] { width: 8.5rem; }
.order-compact .pickup-choice .input-kw { width: 3.5rem; }
.order-compact .order-section { display: block; }
.order-compact .order-existing { margin: 0 0 0.4rem; gap: 0.2rem; }
.order-compact .order-existing li { padding: 0.2rem 0.4rem; font-size: 0.82rem; }
.order-compact .order-rows { gap: 0.2rem; }
.order-compact .order-row { gap: 0.3rem; }
.order-compact .order-row select, .order-compact .order-row input { padding: 0.15rem 0.3rem; font-size: 0.82rem; min-height: 0; }
.order-compact .order-row-head { font-size: 0.7rem; margin-bottom: 0; }
.order-compact .form-actions { margin-top: 0.3rem; }
.ob-compact-form .w2 { grid-column: span 2; }
.order-compact .pickup-choice { flex-wrap: nowrap; }
.order-compact .pickup-choice label { flex-direction: row; align-items: center; gap: 0.25rem; }
.order-compact .order-row .check.order-owner { flex-direction: row; align-items: center; gap: 0.2rem; font-size: 0.75rem; }

/* Orderboek: smalle kolom flow (sorteerbaar). */
.ob-sheet th.ob-flow-col, .ob-sheet td.ob-flow-col { width: 2.6rem; text-align: center; }
.ob-sheet td.ob-flow-col .ob-flowtag { margin-left: 0; }

/* Excel info: exports, inlezen en archief. */
.excel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.excel-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.excel-links a { font-weight: 600; }
.excel-month { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.excel-month select { padding: 0.2rem 0.4rem; font-size: 0.8rem; }
.excel-table td { vertical-align: top; }

/* Kleine weegbon (venster vanuit het orderboek). */
.mini-ticket-dialog { width: min(34rem, calc(100vw - 2rem)); padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25); font-size: 0.85rem; }
.mini-ticket-dialog::backdrop { background: rgba(20, 25, 28, 0.35); }
.mini-ticket-close { position: absolute; top: 0.4rem; right: 0.6rem; border: 0; background: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink-soft); }
.mini-ticket-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin: 0 1.6rem 0.6rem 0; }
.mini-ticket-head strong { font-size: 1rem; }
.mini-ticket-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.35rem 1rem; margin: 0 0 0.6rem; }
.mini-ticket-grid dt { font-size: 0.7rem; color: var(--ink-soft); }
.mini-ticket-grid dd { margin: 0; }
.mini-ticket-lines { width: 100%; border-collapse: collapse; margin: 0 0 0.5rem; }
.mini-ticket-lines td { border-top: 1px solid var(--line); padding: 0.3rem 0.2rem; }
.mini-ticket-lines td.num { text-align: right; white-space: nowrap; }
.mini-ticket-foot { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; margin: 0; font-size: 0.78rem; }
.back-link { display: inline-flex; margin: 0 0 0.6rem; }

/* Conceptfactuur: opmaak als een factuur. */
.invoice-doc { max-width: 60rem; font-size: 0.88rem; }
.invoice-head { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.invoice-from { line-height: 1.5; }
.invoice-meta h2 { margin: 0 0 0.4rem; font-size: 1.3rem; }
.invoice-meta dl { display: grid; grid-template-columns: auto auto; gap: 0.15rem 0.8rem; margin: 0; }
.invoice-meta dl div { display: contents; }
.invoice-meta dt { color: var(--ink-soft); }
.invoice-meta dd { margin: 0; font-weight: 600; }
.invoice-to { margin: 0 0 1rem auto; padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: 8px; max-width: 22rem; line-height: 1.5; }
.invoice-lines { width: 100%; border-collapse: collapse; margin: 0 0 0.8rem; }
.invoice-lines th { text-align: left; font-size: 0.75rem; color: var(--ink-soft); border-bottom: 2px solid var(--ink); padding: 0.35rem 0.4rem; }
.invoice-lines td { border-bottom: 1px solid var(--line); padding: 0.35rem 0.4rem; vertical-align: top; }
.invoice-lines .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.invoice-lines tfoot td { border-bottom: 0; padding-top: 0.25rem; }
.invoice-lines tr.invoice-total td { font-weight: 700; font-size: 1rem; border-top: 2px solid var(--ink); }
.invoice-lines tr.is-missing td { background: var(--red-bg); }
.invoice-price input { width: 5.5rem; padding: 0.15rem 0.3rem; text-align: right; }
.invoice-actions { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.invoice-actions .muted { flex: 1; min-width: 16rem; }
.orders-help { margin: 0 0 0.5rem; font-size: 0.8rem; color: var(--ink-soft); }

/* Werf, stap Klant: gekozen klant duidelijk, kaarten niet afgeknipt. */
.option-scroll { flex-shrink: 0; }
#customer-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.5rem; }
#customer-grid .option-card, .option-suggested { padding: 0.6rem 0.8rem; }
.option-card:not(.option-card-group):has(input:checked) { border-color: var(--ink); background: var(--ink); color: var(--white); }
.option-card:not(.option-card-group):has(input:checked) .option-sub { color: rgba(255, 255, 255, 0.8); }
.option-card:not(.option-card-group):has(input:checked)::after { content: "✓"; position: absolute; top: 0.45rem; right: 0.7rem; font-weight: 700; font-size: 1.1rem; }
.chosen-customer { margin: 0.2rem 0 0; padding: 0.5rem 0.8rem; border-radius: 10px; background: var(--green-bg); color: var(--green-600); font-size: 1.05rem; }
.invoice-tools { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.invoice-tools select { width: auto; }

/* Orderboek-detail, Gegevens: tabel zoals de berekening (label links, waarde rechts). */
.ob-data { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.ob-data th { text-align: left; font-weight: 600; width: 38%; padding: 0.25rem 0.5rem 0.25rem 0; vertical-align: middle; }
.ob-data td { padding: 0.2rem 0; vertical-align: middle; }
.ob-data tr + tr th, .ob-data tr + tr td { border-top: 1px solid rgba(43, 52, 58, 0.08); }
.ob-data tr.ob-data-group th { padding-top: 0.55rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); border-top: 0; }
.ob-data tr.ob-data-group:first-child th { padding-top: 0; }
.ob-data label { display: inline; margin: 0; font-size: inherit; font-weight: inherit; }
.ob-data label.check { display: inline-flex; gap: 0.3rem; align-items: center; }
.ob-data .ob-data-sub { display: block; font-weight: 400; font-size: 0.72rem; color: var(--ink-soft); }
.ob-data td input[type="text"] { width: 100%; padding: 0.2rem 0.4rem; }
.ob-data td.ob-money { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.ob-data td.ob-money input[type="text"] { width: 6rem; text-align: right; }
.ob-data tr.is-missing input { border-color: var(--red-600); background: var(--red-bg); }
.ob-data .ob-missing { flex-basis: 100%; }
/* De rasterstijl van het orderboek niet in de gegevens-tabel van het detail. */
.ob-sheet .ob-data th, .ob-sheet .ob-data td { position: static; background: none; border: 0; box-shadow: none; font-size: 0.82rem; }
.ob-sheet .ob-data tr + tr th, .ob-sheet .ob-data tr + tr td { border-top: 1px solid rgba(43, 52, 58, 0.08); }
.ob-sheet .ob-data tr.ob-data-group th { border-top: 0; font-size: 0.7rem; }
.js-sheet .ob-sheet .ob-data td input[type="text"], .ob-sheet .ob-data td input[type="text"] { border: 1px solid rgba(43, 52, 58, 0.22); background: var(--white); border-radius: 6px; padding: 0.2rem 0.4rem; margin: 0; }
.js-sheet .ob-sheet .ob-data tr.is-missing td input[type="text"], .ob-sheet .ob-data tr.is-missing td input[type="text"] { border-color: var(--red-600); background: var(--red-bg); }
.js-sheet .ob-sheet .ob-data td { padding: 0.2rem 0; }
.btn-sub { margin-left: 0.4rem; padding: 0 0.4rem; border-radius: 6px; background: rgba(255, 255, 255, 0.2); font-weight: 600; font-size: 0.85em; }
.sidebar-user .btn { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
/* Rekenblad: smalle eerste kolom (Bon). */
body.ob-rekenblad .ob-sheet th:first-child, body.ob-rekenblad .ob-sheet td.ob-ref { width: 3.6rem; max-width: 3.9rem; white-space: nowrap; }
body.ob-rekenblad .ob-sheet td.ob-ref { padding: 0.2rem 0.3rem; font-size: 0.8rem; }
body.ob-rekenblad .ob-sheet th:first-child .ob-sort { font-size: 0.75rem; }
/* Gewone weergave: kortere label "Order/Weegbon" vooraan. */
.ob-kind { min-width: 3.4rem; font-size: 0.66rem; }
/* Lege plaats (factuur niet nodig): even breed als een nummer, zodat de letters onder elkaar staan. */
.ob-sheet.ob-simple .ob-nr-empty { width: calc(5.2rem + 1rem); }
body.ob-rekenblad .ob-sheet .ob-nr-empty { width: calc(3.4rem + 0.9rem); }
/* Factuurnummers: drie kolommen van vaste breedte (A | T | L/V), de letter in
   een vak van vaste breedte en het veld vult de rest. Zo staan dezelfde
   letters op elke regel exact onder elkaar. */
.ob-sheet .ob-nrs-in { grid-template-columns: repeat(3, 6.6rem); gap: 0.35rem; }
body.ob-rekenblad .ob-sheet .ob-nrs-in { grid-template-columns: repeat(3, 4.9rem); gap: 0.25rem; }
.ob-sheet .ob-nrs-in .ob-nr-slot { display: block; }
.ob-sheet .ob-nrs-in .ob-nr { width: 100%; gap: 0.15rem; }
.ob-sheet .ob-nrs-in .ob-nr > span { flex: none; display: inline-block; width: 0.85rem; text-align: center; }
body.ob-rekenblad .ob-sheet .ob-nrs-in .ob-nr input, .ob-sheet.ob-simple .ob-nrs-in .ob-nr input, .ob-sheet .ob-nrs-in .ob-nr input { flex: 1; width: 100%; min-width: 0; }
body.ob-rekenblad .ob-sheet .ob-nrs-in .ob-nr-empty, .ob-sheet .ob-nrs-in .ob-nr-empty { width: auto; }
/* Verpakking: smalle kolom ("los" of "BB" + aantal). */
.ob-sheet.ob-simple td.ob-pack, body.ob-rekenblad .ob-sheet td.ob-pack, .ob-sheet th.ob-pack { width: 3.6rem; min-width: 0; max-width: 3.9rem; padding-left: 0.15rem; padding-right: 0.15rem; }
.ob-sheet.ob-simple td.ob-pack select, body.ob-rekenblad .ob-sheet td.ob-pack select { width: 1.9rem; padding: 0.15rem 0.1rem; }
.ob-sheet.ob-simple td.ob-pack input.ob-count, body.ob-rekenblad .ob-sheet td.ob-pack input.ob-count { width: 1.5rem; padding: 0.15rem 0.1rem; text-align: center; }
.ob-sheet td.ob-pack .ob-pack-in { gap: 0.1rem; }

/* Voorraad: opmaak zoals het orderboek. */
.stock-summary { display: flex; flex-wrap: wrap; gap: 0.2rem 1.2rem; margin: 0 0 0.4rem; font-size: 0.8rem; color: var(--ink-soft); }
.stock-summary strong { color: var(--ink); margin-left: 0.2rem; }
.stock-summary .is-alarm, .stock-summary .is-alarm strong { color: var(--red-600); }
.stock-swatch-below { background: #fde2e1; }
.stock-tools { margin: 0 0 0.5rem; }
.stock-tools > summary { list-style: none; display: inline-flex; }
.stock-tools > summary::-webkit-details-marker { display: none; }
.stock-tools-in { display: grid; gap: 0.5rem; margin-top: 0.5rem; padding: 0.6rem 0.8rem; background: var(--white); border: 1px solid var(--line); border-radius: 10px; font-size: 0.82rem; }
.stock-tools-in .inline-form { gap: 0.4rem; align-items: center; }
.stock-tools-in input, .stock-opening input { padding: 0.25rem 0.4rem; font-size: 0.8rem; }
.stock-num { max-width: 6.5rem; }
.ob-sheet.stock-overview { width: 100%; }
.stock-overview td { padding: 0.3rem 0.45rem; }
.stock-overview .stock-min-form { display: flex; gap: 0.2rem; align-items: center; }
.stock-overview .stock-min-form input { width: 4.2rem; padding: 0.15rem 0.3rem; font-size: 0.8rem; text-align: right; }
.stock-overview .stock-min-form .btn { padding: 0.1rem 0.4rem; }
.stock-overview tr.stock-detail-row > td { background: var(--sand-100); padding: 0.5rem 0.8rem 0.8rem; }
.stock-opening { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; margin: 0 0 0.5rem; font-size: 0.8rem; }
.stock-move { width: 100%; }
.stock-corrections { width: 100%; font-size: 0.8rem; }

/* Transporttarieven in de opmaak van het orderboek. */
.ob-sheet.tariff-table { font-size: 0.8rem; }
.ob-sheet.tariff-table td, .ob-sheet.tariff-table th { padding: 0.15rem 0.25rem; }
.ob-sheet.tariff-table input { padding: 0.15rem 0.3rem; font-size: 0.8rem; }
.ob-sheet.tariff-table input.tariff-price, .ob-sheet.tariff-table input.tariff-km { width: 4rem; }
.ob-sheet.tariff-table td:first-child input { min-width: 10rem; }
.ob-sheet.tariff-table tr.tariff-new td { background: var(--sand-100); }
.tariff-actions { display: flex; gap: 0.8rem; align-items: center; margin-top: 0.6rem; }

/* Weegbonnen in de opmaak van het orderboek. */
.ob-filter-tabs { margin: 0.2rem 0 0.5rem; }
.ob-filter-tabs a { padding: 0.2rem 0.6rem; font-size: 0.78rem; }
table.ob-sheet.tickets-sheet { width: 100%; min-width: 0; }
.tickets-sheet td, .tickets-sheet th { padding: 0.3rem 0.5rem; }
.tickets-sheet th .sort-link { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.tickets-sheet .badge { font-size: 0.7rem; padding: 0.05rem 0.45rem; }
/* Open bestellingen: compactere knoppen. */
.orders-sheet .actions-cell { justify-content: flex-end; gap: 0.2rem; }
.orders-sheet .actions-cell .btn { padding: 0.1rem 0.45rem; font-size: 0.72rem; min-height: 0; }

/* AI-koppeling: voorstellen bij Bestellingen, banner in het formulier. */
.ai-proposals { margin: 0.4rem 0 1rem; }
.ai-proposals h2, .orders-title { font-size: 1rem; margin: 0.6rem 0 0.4rem; }
.ai-proposals-sheet td { vertical-align: top; }
.ai-proposals-sheet tr.is-check td { background: #fde2e1; }
.ai-warnings { color: var(--red-600); font-size: 0.8rem; }
.ai-what div { white-space: nowrap; }
.ai-source summary { cursor: pointer; font-size: 0.78rem; color: var(--ink-soft); }
.ai-source pre { white-space: pre-wrap; max-width: 46rem; max-height: 18rem; overflow: auto; font-size: 0.78rem; background: var(--sand-100); padding: 0.4rem 0.6rem; border-radius: 6px; }
.ai-proposals .actions-cell form.inline { display: inline; }
.ai-banner { border: 1px solid var(--sand-500); background: var(--sand-100); border-radius: 8px; padding: 0.6rem 0.8rem; margin-bottom: 0.7rem; font-size: 0.86rem; }
.ai-banner.is-check { border-color: var(--red-600); background: #fde2e1; }
.ai-banner ul { margin: 0.3rem 0 0 1.1rem; padding: 0; }
.ai-change { margin-top: 0.3rem; }
.ai-key-field { width: 100%; font-family: monospace; font-size: 0.82rem; margin: 0.2rem 0 0.6rem; }
.ai-new-key { border: 2px solid var(--sand-500); }
.ai-steps { margin: 0 0 0.5rem 1.2rem; padding: 0; line-height: 1.6; }
.ai-tokens, .ai-history { margin-top: 0.7rem; width: 100%; }

/* Controles */
.checks-tabs { margin: 0.4rem 0 0.7rem; }
.checks-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.checks-actions form { margin: 0; }
.checks-tabs .badge { font-size: 0.72rem; padding: 0 0.4rem; }
.checks-sheet td { vertical-align: top; }
.check-dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #e8a33d; }
.check-dot.is-error { background: var(--red-600); }
.checks-sheet tr.is-error td { background: #fde2e1; }
.check-ok summary { list-style: none; cursor: pointer; }
.check-ok summary::-webkit-details-marker { display: none; }
.check-ok-form { display: inline; margin: 0; }
.checks-dismissed summary { cursor: pointer; font-weight: 600; }
.checks-dismissed table { margin-top: 0.6rem; width: 100%; }
.checks-settings { display: grid; gap: 0.35rem; }
.checks-settings label { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; font-size: 0.86rem; }
.checks-input { display: flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
.checks-input input { width: 7.5rem; text-align: right; }
.check-warnings { border: 1px solid #e8a33d; background: #fff4e0; border-radius: 8px; padding: 0.55rem 0.8rem; margin-bottom: 0.7rem; font-size: 0.86rem; }
.check-warnings.is-error { border-color: var(--red-600); background: #fde2e1; }
.check-warnings ul { margin: 0.25rem 0 0 1.1rem; padding: 0; }
.dash-checks li { margin: 0.15rem 0; }
.dash-checks .plain-list { list-style: none; margin: 0; padding: 0; font-size: 0.86rem; }
.werf-check { font-size: 1.05rem; }

/* Statistieken */
.stat-filters { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: flex-end; margin: 0.3rem 0 0.6rem; font-size: 0.8rem; }
.stat-filters label { display: flex; flex-direction: column; gap: 0.1rem; font-weight: 600; color: var(--ink-soft); }
.stat-filters select, .stat-filters input { font-size: 0.82rem; padding: 0.2rem 0.35rem; max-width: 14rem; }
.stat-tabs { margin-bottom: 0.7rem; }
.stat-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 0.6rem; margin-bottom: 0.9rem; }
.stat-kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0.55rem 0.75rem; display: flex; flex-direction: column; gap: 0.1rem; }
.stat-kpi strong { font-size: 1.25rem; }
.stat-kpi-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
.stat-up { color: #2e7d32; font-weight: 700; }
.stat-down { color: var(--red-600); font-weight: 700; }
.stat-table h2 { font-size: 1rem; margin: 0; }
.stat-table .ob-sheet { width: 100%; }
.stat-neg { color: var(--red-600); }
.stat-chart { margin: 0.3rem 0 0.7rem; }
.stat-chart svg { width: 100%; height: 170px; display: block; }
.stat-legend { display: flex; gap: 1rem; font-size: 0.75rem; color: var(--ink-soft); }
.stat-legend i { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 2px; margin-right: 0.3rem; vertical-align: -1px; }
.stat-axis { display: grid; font-size: 0.7rem; color: var(--ink-soft); text-align: center; margin-top: 0.15rem; white-space: nowrap; }
.history-preview { margin: 0.5rem 0 1rem; }
.history-sample-title { font-size: 1rem; margin-top: 1rem; }
.history-run { margin-top: 0.8rem; }
.history-run { display: grid; gap: 0.6rem; max-width: 52rem; }
.history-run label { display: flex; flex-direction: column; gap: 0.2rem; }
.history-run label.check { flex-direction: row; align-items: center; gap: 0.4rem; }
.history-wipe { border: 1px solid var(--red-600); border-radius: 8px; padding: 0.5rem 0.8rem; background: #fdf1f0; }
.history-wipe summary { cursor: pointer; font-weight: 700; color: var(--red-600); }
.history-map h2 { font-size: 1rem; margin: 0 0 0.5rem; }
.history-map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.4rem 0.8rem; }
.history-map-grid label { display: flex; flex-direction: column; font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); gap: 0.1rem; }
.history-map-grid select { font-size: 0.8rem; padding: 0.15rem 0.3rem; }

/* ===== Tegelmenu en gsm-weergave van Beheer ===== */
.mobile-menu, .mobile-menu-btn, .dash-tiles-mobile { display: none; }
.admin-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.6rem, 1fr)); gap: 0.55rem; }
.admin-tile {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem;
    min-height: 5.8rem; padding: 0.65rem 0.3rem; background: var(--white); border: 1px solid var(--line); border-radius: 14px;
    text-decoration: none; color: var(--ink); font: inherit; cursor: pointer; text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.admin-tile:active { transform: scale(0.97); }
.admin-tile.active { border-color: var(--sand-500); background: var(--sand-100); }
.admin-tile[hidden] { display: none; }
.admin-tile-icon { font-size: 1.75rem; line-height: 1; }
.admin-tile-label { font-size: 0.82rem; font-weight: 600; line-height: 1.15; }
.admin-tile-badge { position: absolute; top: 0.35rem; right: 0.35rem; font-size: 0.72rem; padding: 0.05rem 0.45rem; }

@media (max-width: 760px) {
    .has-sidebar .app-shell { display: block; }
    .has-sidebar .sidebar {
        position: sticky; top: 0; z-index: 50; height: auto; display: flex; flex-direction: row; flex-wrap: nowrap;
        align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.5rem 0.8rem;
        padding-top: max(0.5rem, env(safe-area-inset-top)); border-right: none; border-bottom: 1px solid var(--line); background: var(--white);
    }
    .has-sidebar .sidebar-nav, .has-sidebar .sidebar-user { display: none; }
    .has-sidebar .sidebar-brand { padding: 0; }
    .has-sidebar .sidebar-brand .brand-logo { max-width: 150px; max-height: 26px; }
    .mobile-menu-btn {
        display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.85rem; min-height: 44px;
        border: 1px solid var(--line); border-radius: 10px; font-weight: 700; cursor: pointer; background: var(--sand-100);
    }
    .mobile-menu-btn .badge { font-size: 0.72rem; }
    .nav-toggle:checked ~ .mobile-menu { display: block; }
    .mobile-menu {
        position: fixed; inset: 0; z-index: 100; background: var(--sand-50); overflow-y: auto;
        padding: max(0.8rem, env(safe-area-inset-top)) 0.8rem 2rem;
    }
    .mobile-menu-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; font-size: 1.1rem; }
    .mobile-menu-user { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin-top: 1.2rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }
    .dash-tiles-mobile { display: block; margin-bottom: 1rem; }
    .admin-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    .has-sidebar .main { padding: 0.8rem 0.7rem 3rem; }
    .page-head { gap: 0.5rem; }
    .page-head h1 { font-size: 1.3rem; }
    .panel { padding: 0.8rem; }
    .ob-sheet { font-size: 0.78rem; }
    .ob-scroll { -webkit-overflow-scrolling: touch; }
    .stat-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
    .stat-kpi strong { font-size: 1.05rem; }
    .stat-filters label { flex: 1 1 45%; }
    .stat-filters select, .stat-filters input { max-width: none; width: 100%; }
    .ob-filter-tabs { overflow-x: auto; white-space: nowrap; flex-wrap: nowrap; }
    .checks-sheet td:nth-child(2) { display: none; }
    .checks-sheet th:nth-child(2) { display: none; }
    .dash-checks li { font-size: 0.82rem; }
    .stat-chart svg { height: 130px; }
    input, select, textarea { font-size: 16px; } /* geen inzoomen op iPhone */
}
@media (max-width: 360px) {
    .admin-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.order-cards { display: none; }
@media (max-width: 760px) {
    .order-cards { display: grid; gap: 0.55rem; margin-bottom: 0.8rem; }
    .orders-table { display: none; }
    .order-card { display: block; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 0.65rem 0.8rem; color: var(--ink); text-decoration: none; }
    .order-card.is-check { border-color: var(--red-600); background: #fdf1f0; }
    .order-card-head { display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.2rem; }
    .order-card-head .badge { margin-left: auto; }
    .order-card-customer { font-weight: 600; margin-bottom: 0.25rem; }
    .order-card-line { display: flex; justify-content: space-between; gap: 0.6rem; font-size: 0.92rem; padding: 0.1rem 0; }
    .order-card-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
    .order-card-actions form { display: inline; }
}
.history-diff { background: #fde2e1; color: var(--red-600); font-weight: 700; }
.history-match h3 { font-size: 0.95rem; margin: 0.9rem 0 0.3rem; }
.history-match-table { width: 100%; }
.history-pick { width: 100%; min-width: 16rem; }
.history-suggest { margin-top: 0.2rem; font-size: 0.75rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.history-suggest .chip { border: 1px solid var(--line); background: var(--sand-100); border-radius: 999px; padding: 0.05rem 0.5rem; font-size: 0.75rem; cursor: pointer; }
.history-dialog { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; width: min(26rem, 92vw); }
.history-dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
.history-dialog form { display: grid; gap: 0.5rem; }
.history-dialog label { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.85rem; font-weight: 600; }
.ob-unit { font-size: 0.7rem; color: var(--ink-soft); margin-left: 0.15rem; }

.checks-settings .field-error { display: block; color: var(--red-600); font-size: 0.85rem; }

/* Orderboek: rekenblad en gewone weergave staan op dezelfde pagina; wisselen zonder herladen. */
body:not(.ob-rekenblad) .ob-sheet .ob-col-sheet, body:not(.ob-rekenblad) .ob-sheet .ob-l-sheet { display: none !important; }
body.ob-rekenblad .ob-sheet .ob-col-plain, body.ob-rekenblad .ob-sheet .ob-l-plain, body.ob-rekenblad .ob-sheet tr.ob-detail { display: none !important; }
