/* ============================================================
   Perfecte Muren — Offertes
   Mobile-first, licht + donker thema, en print-CSS die alleen
   het offerte-document op papier zet.
   ============================================================ */

:root {
  --accent: #8e2d9c;        /* merk-paars (perfectemuren.nl) */
  --accent-zacht: #7a2686;
  --groen: #1e9e4b;         /* merk-groen (.nl) */
  --ok: #1e9e4b;
  --waarschuwing: #b3261e;

  --fond: #f7f4f8;          /* heel licht paars-getint gebroken wit */
  --kaart: #ffffff;
  --inkt: #211826;
  --inkt-stil: #6f6577;
  --rand: #e7e0ea;
  --veld: #faf7fb;
  --schaduw: 0 1px 3px rgba(45, 20, 55, 0.09);
}

html[data-theme="donker"] {
  --accent: #d08fe0;        /* lichter paars voor donker */
  --accent-zacht: #bd76d0;
  --groen: #46c47f;
  --ok: #46c47f;
  --fond: #17131a;
  --kaart: #211b26;
  --inkt: #ece6ef;
  --inkt-stil: #a89bb0;
  --rand: #322a38;
  --veld: #1b151f;
  --schaduw: 0 1px 3px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fond);
  color: var(--inkt);
}

/* ===== Chrome ===== */

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px calc(0px + env(safe-area-inset-top, 0px) * 0 + 12px);
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  position: sticky; top: 0; z-index: 5;
  background: var(--fond);
  border-bottom: 1px solid var(--rand);
}
.merk { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--inkt); }
.merk-blok {
  position: relative;
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); color: #fff;
  font-weight: 800; font-size: 15px; letter-spacing: 0.5px;
}
.merk-blok::after {
  content: ""; position: absolute; right: 4px; bottom: 4px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--groen);
}
html[data-theme="donker"] .merk-blok { color: #17131a; }
.merk-naam { font-weight: 700; }
.merk-terug { gap: 4px; margin-left: -6px; color: var(--inkt); }
.merk-terug .merk-naam { font-size: 15px; }
.top-knop {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  text-decoration: none; color: var(--inkt-stil);
  border-radius: 10px;
}
.top-knop:hover { background: var(--veld); color: var(--inkt); }
.top-knop:active { background: var(--rand); }

.pagina-kop {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 18px 16px 0;
  max-width: 720px; margin: 0 auto; width: 100%;
}
.pagina-kop-tekst { flex: 1; min-width: 0; }
.pagina-kop h1 { margin: 0; font-size: 24px; letter-spacing: -0.01em; }
.pagina-sub { margin: 1px 0 0; font-size: 13.5px; color: var(--inkt-stil); }
.kop-telling {
  display: inline-grid; place-items: center;
  min-width: 26px; height: 26px; padding: 0 8px;
  border-radius: 99px; background: var(--rand); color: var(--inkt-stil);
  font-size: 14px; font-weight: 700;
}
h1.tussenkop { font-size: 20px; margin: 24px 4px 4px; }
h2 { font-size: 17px; margin: 0 0 8px; }
/* Icoon in een kop of sectietitel loopt netjes mee met de tekst. */
h2 > .ic, .rk-kop-naam > .ic { vertical-align: -3px; margin-right: 7px; color: var(--accent); }

.inhoud {
  max-width: 720px; margin: 0 auto;
  padding: 14px 16px calc(90px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 14px;
}
.inhoud.met-totaalbalk { padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }

/* ===== Tabbalk onderin ===== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex;
  background: var(--kaart);
  border-top: 1px solid var(--rand);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px 9px;
  text-decoration: none;
  color: var(--inkt-stil);
  font-size: 11.5px; font-weight: 600;
}
.tab-pil {
  display: grid; place-items: center;
  width: 48px; height: 28px; border-radius: 99px;
  transition: background 0.15s;
}
.tab-ic { font-size: 21px; line-height: 1; }
.tab-actief { color: var(--accent); }
.tab-actief .tab-pil { background: color-mix(in srgb, var(--accent) 13%, transparent); }
.tab:active .tab-pil { background: var(--rand); }

/* ===== Zijbalk (tablet/desktop) — zelfde menu, andere vorm ===== */
.zijbalk { display: none; }
.zij-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 10px;
  text-decoration: none; color: var(--inkt-stil);
  font-size: 14.5px; font-weight: 600;
}
.zij-item:hover { background: var(--veld); color: var(--inkt); }
.zij-actief { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.zij-actief:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.zij-merk { padding: 4px 8px 14px; }
.zij-nieuw {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin: 2px 2px 12px; padding: 11px;
  border: none; border-radius: 11px;
  background: var(--accent); color: #fff;
  font: inherit; font-size: 14.5px; font-weight: 700;
  cursor: pointer;
}
html[data-theme="donker"] .zij-nieuw { color: #17131a; }
.zij-nieuw:hover { background: var(--accent-zacht); }
.zij-scheiding { height: 1px; background: var(--rand); margin: 9px 8px; }
.zij-vul { flex: 1; }

/* ===== ＋-knop en het keuzeblad ===== */
.fab {
  position: fixed; right: 16px; z-index: 7;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border: none; border-radius: 18px;
  background: var(--accent); color: #fff;
  box-shadow: 0 7px 18px rgba(90, 31, 138, 0.36);
  cursor: pointer;
}
html[data-theme="donker"] .fab { color: #17131a; }
.fab:active { transform: translateY(1px); }
.inhoud.met-totaalbalk ~ .fab { display: none; }

/* Vangnet: een eigen display-regel mag [hidden] nooit overrulen. */
[hidden] { display: none !important; }

.sheet-laag {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(20, 8, 26, 0.42);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 520px;
  background: var(--kaart);
  border-radius: 18px 18px 0 0;
  padding: 8px 12px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 40px rgba(45, 20, 55, 0.25);
}
.sheet-greep {
  width: 40px; height: 4px; border-radius: 99px;
  background: var(--rand); margin: 6px auto 10px;
}
.sheet-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 10px; border: none; border-radius: 12px;
  background: none; color: var(--inkt); font: inherit; text-align: left;
  text-decoration: none; cursor: pointer;
}
.sheet-item:hover { background: var(--veld); }
.sheet-item:active { background: var(--rand); }
.sheet-ic {
  flex: none; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent);
}
.sheet-tekst { display: flex; flex-direction: column; }
.sheet-tekst strong { font-size: 15px; }
.sheet h2 { padding: 4px 10px 2px; }
.nieuws-lijst { margin: 4px 0 14px; padding: 0 10px 0 28px; }
.nieuws-lijst li { margin-bottom: 9px; font-size: 14.5px; line-height: 1.45; }
.nieuws-lijst li::marker { color: var(--accent); }
.nieuws-sheet { max-height: 82vh; overflow-y: auto; }
.sheet a { color: var(--accent); }

/* ===== Kaarten & velden ===== */

.kaart {
  background: var(--kaart);
  border: 1px solid var(--rand);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--schaduw);
}
.kaart p { margin: 6px 0; }
.welkom h2 { font-size: 20px; }

.stil { color: var(--inkt-stil); font-size: 14px; }
.midden { text-align: center; }

input, select, textarea {
  width: 100%;
  font: inherit; color: var(--inkt);
  background: var(--veld);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 5px 0;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: transparent;
}
textarea { resize: vertical; }
.veld-label { display: block; margin-top: 10px; font-size: 13.5px; font-weight: 600; color: var(--inkt-stil); }
.veld-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check-rij { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.check-rij input { width: auto; margin: 0; }

/* ===== Knoppen ===== */

.knop {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600;
  color: var(--inkt);
  background: var(--kaart);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 10px 16px;
  text-decoration: none;
  cursor: pointer;
}
.knop:active { transform: translateY(1px); }
.knop-primair { background: var(--accent); border-color: var(--accent); color: #fff; }
html[data-theme="donker"] .knop-primair { color: #15181d; }
.knop-breed { width: 100%; }
.knop-klein { padding: 7px 12px; font-size: 14px; }
.knop-actief { outline: 2px solid var(--accent); }
.knop-gevaar { color: var(--waarschuwing); }
.knop-bevestig { background: var(--waarschuwing); border-color: var(--waarschuwing); color: #fff; }
.knop-rij { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.actie-rij .knop { flex: 1; }
.mini-knop {
  flex: none;
  width: 34px; height: 34px;
  border: none; border-radius: 8px;
  background: transparent; color: var(--inkt-stil);
  font-size: 15px; cursor: pointer;
}
.mini-knop:active, .mini-knop.knop-bevestig { background: var(--waarschuwing); color: #fff; }

.voetlinks {
  display: flex; gap: 10px; justify-content: center;
  color: var(--inkt-stil); font-size: 14.5px; margin-top: 8px;
}
.voetlinks a { color: var(--inkt-stil); }

/* ===== Overzicht ===== */

.offerte-rij {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  text-decoration: none; color: var(--inkt);
}
.offerte-rij-links, .offerte-rij-rechts { display: flex; flex-direction: column; gap: 3px; }
.offerte-rij-rechts { align-items: flex-end; }

.chip {
  font-size: 12.5px; font-weight: 700;
  padding: 2px 9px; border-radius: 99px;
}
.chip-grijs { background: var(--rand); color: var(--inkt-stil); }
.chip-blauw { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.chip-groen { background: rgba(46, 125, 50, 0.14); color: var(--ok); }
.chip-rood  { background: rgba(179, 38, 30, 0.12); color: var(--waarschuwing); }
.chip-oranje { background: rgba(230, 126, 34, 0.16); color: #b35c00; }
.chip-donkergroen { background: rgba(27, 94, 32, 0.2); color: #1b5e20; }
.chip-paars { background: rgba(110, 90, 130, 0.16); color: #6e5a82; }
.chip-type { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-zacht); }
html[data-theme="donker"] .chip-oranje { color: #f0a35c; }
html[data-theme="donker"] .chip-donkergroen { color: #7bc67f; }
html[data-theme="donker"] .chip-paars { color: #b39ecb; }
html[data-theme="donker"] .chip-type { color: var(--accent); }

/* ===== Lijsten: één kaart, rijen eronder ===== */

.lijst { padding: 0; overflow: hidden; }
.rij {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 12px 14px;
  border: none; border-bottom: 1px solid var(--rand);
  background: none; color: var(--inkt); font: inherit; text-align: left;
  text-decoration: none;
}
.rij:last-child { border-bottom: none; }
a.rij, button.rij { cursor: pointer; }
a.rij:hover, button.rij:hover { background: var(--veld); }
a.rij:active, button.rij:active { background: var(--rand); }
.rij-ic {
  flex: none; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--accent);
}
.rij-ic-rood { background: rgba(179, 38, 30, 0.11); color: var(--waarschuwing); }
.rij-ic-oranje { background: rgba(230, 126, 34, 0.15); color: #b35c00; }
html[data-theme="donker"] .rij-ic-oranje { color: #f0a35c; }
.rij-tekst { flex: 1; min-width: 0; }
.rij-t1 { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rij-t2 { font-size: 13px; color: var(--inkt-stil); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rij-rechts { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.rij-bedrag { font-size: 15px; font-weight: 700; white-space: nowrap; }
.rij-pijl { flex: none; color: var(--inkt-stil); display: grid; place-items: center; }
.rij-vink {
  flex: none; width: 26px; height: 26px;
  border: 2px solid var(--rand); border-radius: 50%;
  background: none; cursor: pointer;
}
.rij-vink:hover { border-color: var(--accent); }

/* ===== Sectiekop boven een lijst ===== */
.sectiekop {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; padding: 4px 4px 0; margin-bottom: -4px;
}
.sectiekop h2 { margin: 0; font-size: 14.5px; }
.sectiekop span { font-size: 13px; color: var(--inkt-stil); font-weight: 600; }

/* ===== Lege staat ===== */
.leeg { text-align: center; padding: 26px 20px; }
.leeg-ic {
  display: grid; place-items: center; margin: 0 auto 10px;
  width: 52px; height: 52px; border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--accent);
}
.leeg h2 { font-size: 16.5px; margin-bottom: 4px; }
.leeg .knop { margin-top: 14px; }

/* ===== Zoekveld met icoon ===== */
.zoekveld { position: relative; display: flex; align-items: center; }
.zoekveld > .ic { position: absolute; left: 12px; color: var(--inkt-stil); pointer-events: none; }
.zoekveld input { margin: 0; padding-left: 37px; }

/* ===== Statusfilters als chips ===== */
.chip-rij {
  display: flex; gap: 7px; overflow-x: auto;
  margin: 0 -16px; padding: 2px 16px 4px;
  scrollbar-width: none;
}
.chip-rij::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: none;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px; border-radius: 99px;
  border: 1px solid var(--rand); background: var(--kaart); color: var(--inkt-stil);
  font: inherit; font-size: 13px; font-weight: 600;
  white-space: nowrap; cursor: pointer;
}
.filter-chip:hover { border-color: var(--accent); color: var(--inkt); }
.filter-tel { opacity: 0.7; font-weight: 700; }
.filter-chip-aan { background: var(--accent); border-color: var(--accent); color: #fff; }
html[data-theme="donker"] .filter-chip-aan { color: #17131a; }
.filter-chip-aan:hover { color: #fff; }
html[data-theme="donker"] .filter-chip-aan:hover { color: #17131a; }
.totaalregel { margin: 0; padding: 0 4px; font-size: 13px; color: var(--inkt-stil); }
.totaalregel b { color: var(--inkt); }

/* ===== Offerte-detail: eerst de acties, dan pas het papier ===== */
.detail-kop { padding: 16px; }
.detail-nr { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--inkt-stil); letter-spacing: 0.02em; }
.detail-klant { margin: 2px 0 0; font-size: 20px; letter-spacing: -0.01em; }
.detail-adres { margin: 1px 0 0; font-size: 13.5px; color: var(--inkt-stil); }
.detail-bedrag { margin: 10px 0 0; font-size: 30px; font-weight: 800; letter-spacing: -0.025em; }
.detail-meta { margin: 2px 0 0; font-size: 12.5px; color: var(--inkt-stil); }
.detail-chips { margin-left: 4px; }
/* Drie knoppen naast elkaar, ook op een smalle telefoon. */
.detail-kop .actie-rij .knop { flex: 1 1 0; min-width: 0; padding: 10px 6px; font-size: 14px; gap: 5px; }
.detail-kop .actie-rij .ic { flex: none; }

/* Bewust block, geen flex: de tekst bevat <strong>/<a>/<button> en die zouden als
   losse flex-kolommen naast elkaar komen te staan in plaats van door te lopen. */
.melding-blok {
  margin: 0; padding: 11px 13px; border-radius: 12px;
  font-size: 14px; line-height: 1.45;
}
.melding-blok > .ic { vertical-align: -4px; margin-right: 6px; }
.melding-blok a { color: inherit; }
.melding-blok .knop { margin-left: 4px; vertical-align: -1px; }
.melding-goed { background: rgba(30, 158, 75, 0.12); color: var(--ok); }
.melding-let { background: rgba(230, 126, 34, 0.13); color: #8a5a05; }
html[data-theme="donker"] .melding-let { color: #f0a35c; }

/* ===== Tijdlijn (verloop van een offerte) ===== */
.tijdlijn { display: flex; flex-direction: column; gap: 12px; }
.tl-regel { display: flex; gap: 11px; font-size: 14px; opacity: 0.62; }
.tl-nu { opacity: 1; }
.tl-stip {
  flex: none; width: 9px; height: 9px; border-radius: 50%;
  background: var(--inkt-stil); margin-top: 6px;
}
.tl-nu .tl-stip { background: var(--groen); }
.tijdlijn .stil { font-size: 12.5px; }

/* ===== Filterbalk met dropdowns (klanten + offertes) ===== */
.filter-rij { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-rij .filter-select { flex: 1 1 46%; min-width: 140px; margin: 0; }

.uitstel-reden {
  background: rgba(230, 126, 34, 0.12);
  border-radius: 10px; padding: 10px 12px;
  font-size: 14.5px; margin: 8px 0;
}
.te-laat { color: var(--waarschuwing); font-weight: 600; }

/* ===== Meetblad ===== */

.ruimte-kop { display: flex; gap: 6px; align-items: center; }
.ruimte-notitie {
  margin: 8px 0 2px;
  font-size: 13.5px;
  color: #8a5a00;
  background: rgba(244, 162, 97, 0.14);
  border-radius: 8px;
  padding: 8px 10px;
}
html[data-theme="donker"] .ruimte-notitie { color: #f0b45c; }
.ruimte-naam { font-weight: 700; }
.maat-rij { display: flex; gap: 6px; align-items: center; }
.maat-rij input { flex: 1; min-width: 0; }
.maat-rij .opening-naam { flex: 1.4; }
.maat-x, .maat-m { color: var(--inkt-stil); flex: none; }
.ruimte-netto { margin: 10px 0 0; text-align: right; }

/* Inklapbare ruimtes in de m²-rekentool (accordion) */
.rk-kop-rij { display: flex; align-items: center; gap: 6px; }
.rk-kop {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  background: transparent; border: none; padding: 4px 0;
  font: inherit; color: var(--inkt); cursor: pointer; text-align: left;
}
.rk-chevron { flex: none; display: grid; place-items: center; width: 16px; color: var(--inkt-stil); transition: transform 0.15s; }
.rk-chevron-open { transform: rotate(90deg); }
.rk-kop-naam { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-kop-m2 { flex: none; font-weight: 700; color: var(--accent); white-space: nowrap; }
.rk-body { margin-top: 10px; }
/* Project-map (hoofdmap) om de ruimtes heen */
.rk-project { border-color: var(--accent); }
.rk-projectkop .rk-kop-naam { font-size: 16px; }
.rk-ruimtes { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.rk-ruimtes .ruimte { background: var(--veld); }

/* Voortgangs- en verbruiksbalk */
.voortgang { height: 9px; border-radius: 99px; background: var(--rand); overflow: hidden; margin: 8px 0 5px; }
.voortgang-vul { height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.35s ease; }
.voortgang-vul.vol { background: var(--waarschuwing); }
.voortgang-tekst { font-size: 13px; color: var(--inkt-stil); }

/* Wachtrij met gekozen plattegronden (berekenen pas op "Bereken nu") */
.plan-wachtrij { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--rand); border-radius: 10px; background: var(--veld); }
.plan-wachtrij p { margin: 0 0 6px; }
.plan-lijst { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.plan-lijst li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.plan-lijst li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rechthoek-hulp {
  border: 1px dashed var(--rand); border-radius: 10px;
  padding: 10px; margin-top: 8px;
}

/* Verstuur-paneel: even checken + eventueel CC vóór de offerte de deur uit gaat */
.verstuur-form { margin-top: 0; }
.verstuur-form .veld-label { margin-top: 8px; }

/* Keuze per ruimte: opmeten (b×h) of m² zelf invullen — als segmented toggle */
.invoer-keuze { margin: 10px 0 4px; }
.invoer-keuze .knop { flex: 1; }
.invoer-keuze .knop-actief { background: var(--accent); border-color: var(--accent); color: #fff; outline: none; }
html[data-theme="donker"] .invoer-keuze .knop-actief { color: #15181d; }

.totaal-balk {
  position: fixed; left: 16px; right: 16px;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  max-width: 688px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--accent); color: #fff;
  border-radius: 14px; padding: 13px 18px;
  box-shadow: 0 6px 18px rgba(90, 31, 138, 0.28);
  font-size: 15px; z-index: 5;
}
html[data-theme="donker"] .totaal-balk { color: #15181d; }
.totaal-balk strong { font-size: 18px; white-space: nowrap; }
.totaal-balk .balk-m2 { font-size: 12.5px; line-height: 1.3; padding-right: 8px; }
.inhoud.met-totaalbalk > .knop-primair.knop-breed {
  position: fixed; left: 16px; right: 16px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  max-width: 688px; margin: 0 auto; z-index: 5;
  box-shadow: 0 6px 18px rgba(90, 31, 138, 0.28);
}

/* ===== Offerte-document ===== */

/* Huisstijl-document, exact naar het PDF-voorbeeld. Bewust vaste kleuren
   (papier is altijd wit, ook in donker thema): paars #7B2FBE, donkerpaars
   #5A1F8A (toeslag-kop), tekst #1A1A1A, grijs #888, rijen #F5F5F5/#EFEFEF,
   raster #DDD. Lettertype Helvetica zoals de PDF. */
.offerte-document {
  padding: 26px 24px;
  background: #fff; color: #1A1A1A;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 12.5px; line-height: 1.35;
}
.offerte-document .doc-logo { display: block; width: 170px; max-width: 60%; height: auto; margin: 0 0 10px; }
.doc-lijn-paars { border-top: 2px solid #7B2FBE; margin-bottom: 12px; }
.doc-grijs { color: #888; }

/* Kop: bedrijfsblok links, OFFERTE-gegevens rechts */
.doc-kop { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.doc-kop-bedrijf { line-height: 1.55; }
.doc-merknaam { color: #7B2FBE; font-weight: 700; }
.doc-kop-meta { text-align: right; line-height: 1.55; white-space: nowrap; }

/* Sectiekopjes: vet paars, geen kapitalen (zoals de PDF) */
.doc-kopje { font-size: 13.5px; font-weight: 700; color: #7B2FBE; margin: 16px 0 7px; }
.doc-tekst { margin: 0 0 8px; font-size: 12.5px; }
.doc-klant { margin: 0; font-size: 13.5px; line-height: 1.55; }

/* Projectdetails: label/waarde zonder randen */
.doc-details { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.doc-details th, .doc-details td { text-align: left; padding: 4px 6px; vertical-align: top; }
.doc-details th { width: 33%; font-weight: 700; color: #888; }

/* Tabellen: raster #DDD, paarse koprij, om-en-om rijkleuren, paarse totaalrij */
.doc-tabel { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: fixed; border: 1px solid #DDD; }
.doc-tabel th, .doc-tabel td { text-align: left; padding: 7px 8px; border: 1px solid #DDD; vertical-align: top; }
.doc-tabel thead th { color: #fff; background: #7B2FBE; font-weight: 700; border-color: #7B2FBE; }
.doc-toeslag thead th { background: #5A1F8A; border-color: #5A1F8A; }
.doc-tabel tbody tr:nth-child(odd) td { background: #F5F5F5; }
.doc-tabel tbody tr:nth-child(even) td { background: #fff; }
.doc-tabel .num { text-align: right; white-space: nowrap; }
.doc-tabel td:first-child { word-break: break-word; }
.doc-subtotaal td, .doc-tabel .doc-subtotaal td { background: #EFEFEF !important; font-weight: 700; }
.doc-btwrij td, .doc-tabel .doc-btwrij td { background: #EFEFEF !important; }
.doc-btwrij em { color: #888; font-style: italic; }
.doc-totaal td, .doc-tabel .doc-totaal td { background: #7B2FBE !important; color: #fff; font-weight: 700; border-color: #7B2FBE; }
.doc-oppervlak th:nth-child(1), .doc-oppervlak td:nth-child(1) { width: 47%; }
.doc-oppervlak th:nth-child(2), .doc-oppervlak td:nth-child(2) { width: 23.5%; }
/* Eén-koloms variant (alleen wanden óf alleen plafonds afgewerkt) */
.doc-oppervlak-een th:nth-child(1), .doc-oppervlak-een td:nth-child(1) { width: 62%; }
.doc-oppervlak-een th:nth-child(2), .doc-oppervlak-een td:nth-child(2) { width: 38%; }
.doc-prijs th:nth-child(1), .doc-prijs td:nth-child(1) { width: 47%; }
.doc-prijs th:nth-child(2), .doc-prijs td:nth-child(2) { width: 12%; }
.doc-prijs th:nth-child(3), .doc-prijs td:nth-child(3) { width: 13%; }

.doc-opmerking { white-space: pre-wrap; }
.doc-scheiding { border-top: 1px solid #DDD; margin: 18px 0 10px; }

/* Akkoord / handtekeningen: twee kolommen met schrijflijn + naam */
.doc-akkoord { display: flex; gap: 24px; margin: 14px 0 4px; font-size: 12.5px; }
.doc-akkoord-vak { flex: 1; line-height: 1.5; }
.doc-handtekening { display: flex; align-items: flex-end; gap: 7px; margin-top: 26px; }
.doc-schrijflijn { flex: 1; max-width: 190px; border-bottom: 1px solid #1A1A1A; height: 1px; }
.doc-digitaal { font-style: italic; margin-top: 26px; color: #1A1A1A; }

/* Voet: paarse lijn + gecentreerde regel */
.doc-voet { margin-top: 22px; font-size: 11.5px; }
.doc-lijn-voet { border-top-width: 1.5px; margin-bottom: 8px; }
.doc-voetregel { margin: 0 0 4px; text-align: center; }

/* ===== Dashboard ===== */

.dash-tegels { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dash-tegel {
  display: flex; flex-direction: column; gap: 2px; padding: 14px;
  text-decoration: none; color: var(--inkt);
}
a.dash-tegel:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--rand)); }
.dash-tegel strong { font-size: 21px; letter-spacing: -0.02em; }
.dash-voet { margin-top: 2px; }
.dash-voet a { color: var(--inkt-stil); }
.filter-balk {
  display: flex; gap: 6px; overflow-x: auto;
  padding-bottom: 4px; margin: -4px 0 2px;
  scrollbar-width: none;
}
.filter-balk::-webkit-scrollbar { display: none; }
.filter-balk .knop { flex: none; }

/* ===== Klanten ===== */

.klant-kop { display: flex; flex-direction: column; gap: 10px; }
.klant-offerte { padding: 10px 0; border-bottom: 1px solid var(--rand); }
.klant-offerte:last-of-type { border-bottom: none; margin-bottom: 8px; }
.notitie { padding: 8px 0; border-top: 1px solid var(--rand); margin-top: 8px; }
.notitie p { margin: 0 0 2px; white-space: pre-wrap; }

/* ===== Feedback ===== */

.fb-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--rand); }
.fb-item:last-child { border-bottom: none; }
.fb-item p { margin: 0; }
.fb-item .taak-tekst { flex: 1; min-width: 0; }
.fb-item .taak-tekst input { margin: 3px 0; }
.taak-bewerk { align-items: stretch; }
.fb-klaar p { text-decoration: line-through; color: var(--inkt-stil); }
.fb-vink {
  flex: none; width: 30px; height: 30px;
  border: 1.5px solid var(--rand); border-radius: 99px;
  background: transparent; color: var(--ok);
  font-size: 15px; cursor: pointer;
}

/* ===== Foto's per klant (voor & na) ===== */

.foto-groep + .foto-groep { margin-top: 14px; }
.foto-groep h3 {
  font-size: 14px; font-weight: 700; margin: 0 0 8px;
  color: var(--inkt-stil);
}
.foto-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 10px;
}
.foto-tegel {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px; overflow: hidden;
  background: var(--veld); border: 1px solid var(--rand);
}
.foto-tegel img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-tegel.laadt { display: grid; place-items: center; }
.foto-tegel.laadt::after { content: "…"; color: var(--inkt-stil); font-size: 20px; }
.foto-weg {
  position: absolute; top: 4px; right: 4px;
  width: 26px; height: 26px; border: none; border-radius: 8px;
  background: rgba(0, 0, 0, 0.55); color: #fff;
  font-size: 13px; cursor: pointer; line-height: 1;
}
.foto-weg.knop-bevestig { background: var(--waarschuwing); width: auto; padding: 0 8px; }
.foto-leeg { color: var(--inkt-stil); font-size: 13.5px; margin: 0 0 8px; }
.bijlage-lijst { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.bijlage-kaart { display: flex; align-items: stretch; gap: 6px; }
.bijlage-open {
  flex: 1; display: flex; align-items: center; gap: 8px;
  text-align: left; font: inherit; font-weight: 600; color: var(--inkt);
  background: var(--veld); border: 1px solid var(--rand); border-radius: 10px;
  padding: 11px 12px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bijlage-open:active { transform: translateY(1px); }
.foto-weg-inline {
  position: static; width: 40px; height: auto; flex: none;
  background: var(--kaart); color: var(--inkt-stil); border: 1px solid var(--rand);
}
.foto-weg-inline:active, .foto-weg-inline.knop-bevestig { background: var(--waarschuwing); color: #fff; }

/* ===== Login ===== */

.login {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(1100px 520px at 50% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    var(--fond);
}
.login-kaart {
  width: 100%; max-width: 400px;
  background: var(--kaart);
  border: 1px solid var(--rand);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(90, 31, 138, 0.16);
  overflow: hidden;
}
/* Paarse merkkop met het echte logo, in de huisstijl van de offerte */
.login-kop {
  background: linear-gradient(135deg, var(--accent), var(--accent-zacht));
  padding: 26px 24px 20px;
  text-align: center;
}
.login-logo {
  display: block; width: 210px; max-width: 78%; height: auto; margin: 0 auto 8px;
  /* logo-pm-wit.png = witte tekst + groene .NL (net als de site), past op de paarse kop */
}
.login-tagline {
  margin: 0; color: rgba(255, 255, 255, 0.92);
  font-size: 13.5px; font-weight: 600; letter-spacing: 0.4px;
}
.login-body { padding: 22px 24px 24px; }
.login-body h1 { font-size: 21px; margin: 0 0 6px; }
.login-body .stil { margin-bottom: 12px; }
.login-body .veld-label { margin-top: 12px; }
.login-body .check-rij { justify-content: flex-start; }
.login-body .knop-breed { margin-top: 14px; padding: 12px 16px; }
.login-fout { color: var(--waarschuwing); font-size: 14px; min-height: 18px; margin: 10px 0 0; }
.login-voet { margin: 0; font-size: 12.5px; color: var(--inkt-stil); text-align: center; }

/* ===== Zachte melding ===== */

.melding {
  position: fixed; left: 16px; right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  max-width: 560px; margin: 0 auto; z-index: 50;
  background: var(--inkt); color: var(--fond);
  border-radius: 12px; padding: 12px 16px;
  font-size: 14.5px;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
}
.melding.zichtbaar { opacity: 1; transform: none; }

/* ===== Mobiel: offerte-kop netjes stapelen, tabel strak binnen de kaart ===== */
@media (max-width: 520px) {
  .offerte-document { padding: 18px 14px; font-size: 12px; }
  .doc-kop { flex-direction: column; gap: 10px; }
  .doc-kop-meta { text-align: left; }
  .doc-tabel, .doc-details { font-size: 11.5px; }
  .doc-tabel th, .doc-tabel td { padding: 6px 4px; }
  /* Smal scherm: koppen mogen wél afbreken, en de getallen kleiner + de kolommen
     ruimer, anders botsen de m²- en prijskolom ("129,38 m€ 20,25"). */
  .doc-tabel thead th, .doc-tabel thead th.num { white-space: normal; font-size: 10.5px; }
  .doc-tabel td.num { font-size: 10.5px; }
  .doc-prijs th:nth-child(1), .doc-prijs td:nth-child(1) { width: 31%; }
  .doc-prijs th:nth-child(2), .doc-prijs td:nth-child(2) { width: 21%; }
  .doc-prijs th:nth-child(3), .doc-prijs td:nth-child(3) { width: 23%; }
  .doc-prijs th:nth-child(4), .doc-prijs td:nth-child(4) { width: 25%; }
  .doc-oppervlak th:nth-child(1), .doc-oppervlak td:nth-child(1) { width: 40%; }
  .doc-oppervlak th:nth-child(2), .doc-oppervlak td:nth-child(2),
  .doc-oppervlak th:nth-child(3), .doc-oppervlak td:nth-child(3) { width: 30%; }
  .doc-akkoord { flex-direction: column; gap: 16px; }
}

/* ===== Toetsenbord: overal een zichtbare focusring ===== */
a:focus-visible, button:focus-visible, .rij:focus-visible, .tab:focus-visible,
.zij-item:focus-visible, .filter-chip:focus-visible, .sheet-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 10px;
}

/* ===== Tablet & desktop: zijbalk in plaats van onderbalk ===== */
@media (min-width: 900px) {
  body { padding-left: 232px; }
  .zijbalk {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 8;
    width: 232px;
    display: flex; flex-direction: column; gap: 2px;
    padding: 16px 12px calc(16px + env(safe-area-inset-bottom, 0px));
    background: var(--kaart);
    border-right: 1px solid var(--rand);
    overflow-y: auto;
  }
  .top { display: none; }
  .tabbar { display: none; }
  .pagina-kop { max-width: 860px; padding-top: 26px; }
  .pagina-kop h1 { font-size: 27px; }
  .inhoud { max-width: 860px; padding-bottom: 40px; }
  .inhoud.met-totaalbalk { padding-bottom: 120px; }
  .fab { display: none; }
  .melding { left: calc(232px + 16px); }
  .totaal-balk { left: calc(232px + 16px); }
  .sheet-laag { align-items: center; padding-left: 232px; }
  .sheet { border-radius: 16px; max-width: 440px; }
  .chip-rij { margin: 0; padding: 2px 0 4px; flex-wrap: wrap; }
}

/* ===== Print: alleen het offerte-document, in zwart-op-wit ===== */

@media print {
  body { background: #fff; color: #000; font-size: 12.5pt; padding-left: 0; }
  .top, .pagina-kop, .actie-rij, .knop, .kaart:not(.offerte-document), .melding, .voetlinks,
  .tabbar, .zijbalk, .fab, .sheet-laag, .sectiekop, .chip-rij, .zoekveld,
  .totaalregel, .melding-blok { display: none !important; }
  /* Het document mag op het scherm ingeklapt staan; op papier hoort het er altijd op. */
  .doc-wrap[hidden] { display: block !important; }
  .inhoud { padding: 0; max-width: none; display: block; }
  @page { size: A4; margin: 18mm 20mm; }
  .offerte-document {
    border: none; box-shadow: none; border-radius: 0; padding: 0;
    font-size: 9pt;
  }
  /* Merkkleur en rijkleuren behouden op papier (kleurenprint/PDF). */
  .offerte-document, .offerte-document * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .offerte-document .doc-logo { width: 45mm; }
  .doc-kopje { font-size: 10pt; }
  .doc-tabel, .doc-details { font-size: 9pt; }
  .doc-tabel th, .doc-tabel td { padding: 5pt 6pt; }
  .doc-tabel, .doc-akkoord, .doc-voet { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* Verbeterpunten: antwoord van Mark */
.fb-antwoord{margin:4px 0 6px;padding:6px 10px;border-left:2px solid var(--primair,#2f6b4f);background:rgba(47,107,79,.08);border-radius:0 6px 6px 0;font-size:13px}.fb-antwoord strong{display:block;font-size:10px;letter-spacing:.08em;text-transform:uppercase;margin-bottom:2px}
