/* Het offerte-document. EEN bron voor editor, voorbeeld, layoutkeuze en PDF.
   Lettertypen komen uit fonts.css (web) of worden door pdf_export gefilterd ingevoegd (PDF).
   Kleuren en lettertypen komen als CSS-variabelen binnen (design.css_vars). Layouts zijn klassen: .layout-<naam>. */

.offerte-canvas{
  --accent:#4f46e5; --accent-soft:#f1f0fd; --accent-softer:#f8f8fe; --on-accent:#fff;
  --font-head:'Plus Jakarta Sans',sans-serif; --font-body:'Inter',sans-serif;
  --px:60px; --py:56px; --nx:-60px; --ny:-56px;
  box-sizing:border-box; position:relative;
  width:100%; max-width:794px; min-height:1122px; margin:0 auto; background:#fff;
  box-shadow:0 1px 2px #0000000d, 0 8px 28px #0000001a; border:1px solid #e2e8f0;
  padding:var(--py) var(--px); font-family:var(--font-body); color:#1f2430; font-size:13.5px; line-height:1.55;
}
.offerte-canvas *{ box-sizing:border-box; }

.offerte-canvas .doc-top{ display:flex; justify-content:space-between; align-items:flex-start; gap:24px; margin-bottom:34px; }
.offerte-canvas .doc-logo{ display:block; max-width:180px; max-height:64px; object-fit:contain; object-position:left center; }
.offerte-canvas .doc-company-fallback{ font-family:var(--font-head); font-weight:700; font-size:16px; color:var(--accent); }
.offerte-canvas .doc-meta{ text-align:right; font-size:12px; color:#6b7280; }
.offerte-canvas .doc-title{ font-family:var(--font-head); font-size:22px; font-weight:700; letter-spacing:.02em; color:var(--accent); margin-bottom:8px; }
.offerte-canvas .doc-meta-row{ display:flex; gap:6px; justify-content:flex-end; align-items:baseline; margin-bottom:2px; }
.offerte-canvas .doc-meta-row > span{ white-space:nowrap; }
.offerte-canvas .doc-meta-row > span:first-child{ color:#9ca3af; }

.offerte-canvas .parties{ display:grid; grid-template-columns:1fr 1fr; gap:24px; margin-bottom:30px; }
.offerte-canvas .party-label{ font-size:10.5px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:#9ca3af; margin-bottom:6px; }
.offerte-canvas .party-name{ font-weight:700; margin-bottom:2px; }
.offerte-canvas .party-line{ color:#4b5563; }
.offerte-canvas .doc-text{ white-space:pre-line; }
.offerte-canvas .doc-intro{ color:#374151; margin-bottom:28px; }

.offerte-canvas .li-table{ width:100%; border-collapse:collapse; margin-bottom:6px; }
.offerte-canvas .li-table thead th{ font-family:var(--font-head); text-align:left; font-size:10.5px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:#9ca3af; border-bottom:2px solid var(--accent); padding:0 8px 8px 0; }
.offerte-canvas .li-table thead th.num{ text-align:right; }
.offerte-canvas .li-table td{ padding:11px 8px 11px 0; border-bottom:1px solid #eef0f3; vertical-align:top; }
.offerte-canvas .li-table td.num{ text-align:right; white-space:nowrap; }
.offerte-canvas .li-total{ font-weight:600; }

.offerte-canvas .totals{ display:flex; justify-content:flex-end; margin:20px 0 34px; }
.offerte-canvas .totals-box{ width:260px; font-size:13px; }
.offerte-canvas .totals-row{ display:flex; justify-content:space-between; padding:6px 0; color:#4b5563; }
.offerte-canvas .totals-row.grand{ font-family:var(--font-head); border-top:2px solid var(--accent); margin-top:4px; padding-top:11px; font-weight:700; font-size:16px; color:#111827; }
.offerte-canvas .totals-row.grand span:last-child{ color:var(--accent); }

.offerte-canvas .doc-footer{ border-top:1px solid #eef0f3; padding-top:20px; font-size:12px; color:#6b7280; line-height:1.6; }
.offerte-canvas .doc-footer .closing{ margin-top:14px; color:#374151; }
.offerte-canvas .sender-recap{ margin-top:20px; font-size:11px; color:#9ca3af; }

/* ================= layouts ================= */

/* Klassiek: dubbele lijn, kleine hoofdletters, rustige tabel */
.offerte-canvas.layout-klassiek .doc-top{ border-bottom:3px double var(--accent); padding-bottom:20px; }
.offerte-canvas.layout-klassiek .doc-title{ font-size:20px; letter-spacing:.2em; font-weight:600; }
.offerte-canvas.layout-klassiek .li-table thead th{ text-transform:none; letter-spacing:0; font-size:12.5px; font-weight:600; color:#4b5563; border-bottom:1px solid var(--accent); }
.offerte-canvas.layout-klassiek .totals-row.grand{ border-top:3px double var(--accent); }
.offerte-canvas.layout-klassiek .party-label{ color:var(--accent); }

/* Minimaal: alleen dunne grijze lijnen, kleur in een klein accent */
.offerte-canvas.layout-minimaal .doc-title{ color:#111827; font-size:17px; font-weight:600; letter-spacing:.14em; }
.offerte-canvas.layout-minimaal .doc-title::after{ content:''; display:block; width:28px; height:2px; background:var(--accent); margin:10px 0 0 auto; }
.offerte-canvas.layout-minimaal .li-table thead th{ border-bottom:1px solid #d1d5db; font-weight:600; }
.offerte-canvas.layout-minimaal .li-table td{ border-bottom:1px solid #f1f2f4; }
.offerte-canvas.layout-minimaal .totals-row.grand{ border-top:1px solid #d1d5db; font-weight:600; }
.offerte-canvas.layout-minimaal .totals-row.grand span:last-child{ color:#111827; }
.offerte-canvas.layout-minimaal .doc-footer{ border-top:0; }

/* Kleurband: gekleurde balk over de volle breedte bovenaan */
.offerte-canvas.layout-kleurband .doc-top{ background:var(--accent); color:var(--on-accent); margin:var(--ny) var(--nx) 34px; padding:34px var(--px); align-items:center; }
.offerte-canvas.layout-kleurband .doc-title, .offerte-canvas.layout-kleurband .doc-company-fallback{ color:var(--on-accent); }
.offerte-canvas.layout-kleurband .doc-meta, .offerte-canvas.layout-kleurband .doc-meta-row > span:first-child{ color:var(--on-accent); opacity:.88; }
.offerte-canvas.layout-kleurband .doc-meta .f{ color:var(--on-accent); border-bottom-color:currentColor; }
.offerte-canvas.layout-kleurband .doc-meta .f:hover, .offerte-canvas.layout-kleurband .doc-meta .f:focus{ background:rgba(255,255,255,.18); }
.offerte-canvas.layout-kleurband .doc-logo{ background:#fff; padding:8px 12px; border-radius:6px; }

/* Zijbalk: brede gekleurde streep langs de linkerrand */
.offerte-canvas.layout-zijbalk{ border-left:16px solid var(--accent); }
.offerte-canvas.layout-zijbalk .doc-title{ font-size:24px; }
.offerte-canvas.layout-zijbalk .li-table thead th{ color:var(--accent); }

/* Gecentreerd: logo en titel in het midden */
.offerte-canvas.layout-gecentreerd .doc-top{ flex-direction:column; align-items:center; text-align:center; gap:18px; border-bottom:1px solid #e5e7eb; padding-bottom:24px; }
.offerte-canvas.layout-gecentreerd .doc-logo{ object-position:center; }
.offerte-canvas.layout-gecentreerd .doc-meta{ text-align:center; width:100%; }
.offerte-canvas.layout-gecentreerd .doc-title{ font-size:26px; letter-spacing:.18em; }
.offerte-canvas.layout-gecentreerd .doc-meta-row{ justify-content:center; }
.offerte-canvas.layout-gecentreerd .parties{ text-align:center; }
.offerte-canvas.layout-gecentreerd .f-name, .offerte-canvas.layout-gecentreerd .parties .f{ text-align:center; }

/* Kaarten: zachte vlakken met afgeronde hoeken */
.offerte-canvas.layout-kaarten{ border-radius:14px; }
.offerte-canvas.layout-kaarten .parties > div{ background:var(--accent-softer); border:1px solid var(--accent-soft); border-radius:12px; padding:16px 18px; }
.offerte-canvas.layout-kaarten .li-table thead th{ background:var(--accent-soft); border-bottom:0; padding:9px 10px; color:#374151; }
.offerte-canvas.layout-kaarten .li-table thead th:first-child{ border-radius:8px 0 0 8px; }
.offerte-canvas.layout-kaarten .li-table thead th:last-child{ border-radius:0 8px 8px 0; }
.offerte-canvas.layout-kaarten .li-table td{ padding-left:10px; }
.offerte-canvas.layout-kaarten .totals-box{ background:var(--accent-soft); border-radius:12px; padding:12px 18px; }

/* Zebra: gekleurde tabelkop, afwisselende rijen, gekleurd totaal */
.offerte-canvas.layout-zebra .li-table thead th{ background:var(--accent); color:var(--on-accent); border-bottom:0; padding:9px 10px; }
.offerte-canvas.layout-zebra .li-table td{ padding:10px; border-bottom:0; }
.offerte-canvas.layout-zebra .li-table tbody tr:nth-child(even) td{ background:var(--accent-softer); }
.offerte-canvas.layout-zebra .totals-row.grand{ background:var(--accent); color:var(--on-accent); border-top:0; padding:10px 12px; border-radius:4px; }
.offerte-canvas.layout-zebra .totals-row.grand span:last-child{ color:var(--on-accent); }

/* Compact: kleiner lettertype en minder witruimte */
.offerte-canvas.layout-compact{ --px:44px; --py:38px; --nx:-44px; --ny:-38px; font-size:12px; line-height:1.45; }
.offerte-canvas.layout-compact .doc-top{ margin-bottom:20px; }
.offerte-canvas.layout-compact .doc-title{ font-size:18px; margin-bottom:4px; }
.offerte-canvas.layout-compact .parties{ margin-bottom:18px; gap:16px; }
.offerte-canvas.layout-compact .doc-intro{ margin-bottom:16px; }
.offerte-canvas.layout-compact .li-table td{ padding:6px 8px 6px 0; }
.offerte-canvas.layout-compact .totals{ margin:12px 0 20px; }
.offerte-canvas.layout-compact .totals-row.grand{ font-size:14px; }
.offerte-canvas.layout-compact .doc-footer{ padding-top:12px; font-size:11px; }

/* Opvallend: grote titel, dikke lijn, groot totaalvlak */
.offerte-canvas.layout-opvallend .doc-top{ align-items:flex-end; border-bottom:6px solid var(--accent); padding-bottom:18px; }
.offerte-canvas.layout-opvallend .doc-title{ font-size:42px; line-height:1; letter-spacing:-.01em; margin-bottom:10px; }
.offerte-canvas.layout-opvallend .li-table thead th{ color:#111827; }
.offerte-canvas.layout-opvallend .totals-box{ width:300px; }
.offerte-canvas.layout-opvallend .totals-row.grand{ background:var(--accent); color:var(--on-accent); border-top:0; padding:14px 16px; font-size:20px; border-radius:8px; margin-top:8px; }
.offerte-canvas.layout-opvallend .totals-row.grand span:last-child{ color:var(--on-accent); }

/* Elegant: dunne lijnen boven en onder de kop, gespatieerde hoofdletters */
.offerte-canvas.layout-elegant .doc-top{ border-top:1px solid var(--accent); border-bottom:1px solid var(--accent); padding:20px 0; align-items:center; }
.offerte-canvas.layout-elegant .doc-title{ font-size:18px; font-weight:400; letter-spacing:.3em; color:#111827; }
.offerte-canvas.layout-elegant .party-label{ color:var(--accent); letter-spacing:.2em; font-weight:600; }
.offerte-canvas.layout-elegant .li-table thead th{ letter-spacing:.2em; font-weight:600; border-bottom:1px solid var(--accent); }
.offerte-canvas.layout-elegant .li-table td{ border-bottom:1px dotted #cbd5e1; }
.offerte-canvas.layout-elegant .totals-row.grand{ border-top:1px solid var(--accent); border-bottom:1px solid var(--accent); padding:11px 0; font-weight:600; }

/* Lijnen: donkere lijnen, geen vlakken; kleur alleen in het totaal */
.offerte-canvas.layout-lijnen .doc-title{ color:#111827; font-size:24px; }
.offerte-canvas.layout-lijnen .doc-meta{ text-align:left; border:1px solid #111827; padding:10px 14px; }
.offerte-canvas.layout-lijnen .doc-meta-row{ justify-content:flex-start; }
.offerte-canvas.layout-lijnen .parties{ border-top:1px solid #111827; border-bottom:1px solid #111827; padding:16px 0; }
.offerte-canvas.layout-lijnen .li-table thead th{ color:#111827; border-bottom:2px solid #111827; }
.offerte-canvas.layout-lijnen .li-table td{ border-bottom:1px solid #111827; }
.offerte-canvas.layout-lijnen .totals-row.grand{ border-top:2px solid #111827; border-bottom:2px solid #111827; padding:10px 0; margin-top:6px; }
.offerte-canvas.layout-lijnen .doc-footer{ border-top:1px solid #111827; }

/* ================= invoervelden in de editor: zien eruit als tekst in het document ================= */
.offerte-canvas .f{ font:inherit; color:inherit; background:transparent; border:0; border-bottom:1px dashed #cbd5e1; border-radius:2px; padding:2px 0; width:100%; min-width:0; }
.offerte-canvas .f:hover{ background:rgba(99,102,241,.06); }
.offerte-canvas .f:focus{ outline:none; background:rgba(99,102,241,.08); border-bottom:1px solid var(--accent); }
.offerte-canvas .f.invalid{ border-bottom:2px solid #dc2626; background:#fef2f2; color:#1f2430; }
.offerte-canvas textarea.f{ resize:none; display:block; overflow:hidden; line-height:inherit; white-space:pre-wrap; }
.offerte-canvas .f-num{ width:130px; text-align:right; }
.offerte-canvas .f-date{ width:150px; text-align:right; font:inherit; }
.offerte-canvas .f-qty{ width:64px; text-align:right; }
.offerte-canvas .f-price{ width:84px; text-align:right; }
.offerte-canvas .f-name{ font-weight:700; }
.offerte-canvas .row-remove, .offerte-canvas .row-save{ border:0; background:none; cursor:pointer; color:#cbd5e1; padding:0 0 0 8px; line-height:1; }
.offerte-canvas .row-remove:hover, .offerte-canvas .row-remove:focus-visible{ color:#dc2626; }
.offerte-canvas .row-save:hover, .offerte-canvas .row-save:focus-visible{ color:var(--accent); }
.offerte-canvas .row-remove svg, .offerte-canvas .row-save svg{ width:14px; height:14px; stroke:currentColor; fill:none; stroke-width:2; }
.offerte-canvas .row-tools{ display:flex; align-items:center; white-space:nowrap; }
.offerte-canvas .add-row-btn{ font:inherit; font-size:12px; font-weight:600; color:var(--accent); background:none; border:0; cursor:pointer; padding:8px 14px 4px 0; display:inline-flex; align-items:center; gap:5px; }
.offerte-canvas .add-row-btn svg{ width:13px; height:13px; stroke:currentColor; fill:none; stroke-width:2.2; }

@media(max-width:640px){
  .offerte-canvas{ --px:18px; --py:24px; --nx:-18px; --ny:-24px; min-height:0; }
  .offerte-canvas.layout-compact{ --px:16px; --py:20px; --nx:-16px; --ny:-20px; }
  .offerte-canvas .doc-top{ flex-direction:column; gap:16px; margin-bottom:24px; }
  .offerte-canvas .doc-meta{ text-align:left; width:100%; }
  .offerte-canvas .doc-meta-row{ justify-content:flex-start; }
  .offerte-canvas .f-num, .offerte-canvas .f-date{ text-align:left; }
  .offerte-canvas .parties{ grid-template-columns:1fr; gap:18px; margin-bottom:22px; }
  .offerte-canvas .totals-box{ width:100%; }
  .offerte-canvas .li-table td, .offerte-canvas .li-table thead th{ padding-right:5px; }
  .offerte-canvas .f-qty{ width:38px; }
  .offerte-canvas .f-price{ width:60px; }
  .offerte-canvas.layout-kleurband .doc-top{ padding:24px var(--px); }
  .offerte-canvas.layout-zijbalk{ border-left-width:10px; }
  .offerte-canvas.layout-gecentreerd .doc-meta-row{ justify-content:center; }
  .offerte-canvas.layout-gecentreerd .doc-meta{ text-align:center; }
  .offerte-canvas.layout-gecentreerd .f-num, .offerte-canvas.layout-gecentreerd .f-date{ text-align:center; }
  .offerte-canvas.layout-opvallend .doc-title{ font-size:32px; }
  .offerte-canvas.layout-opvallend .totals-box{ width:100%; }
}
@media(max-width:400px){
  .offerte-canvas{ --px:12px; --py:20px; --nx:-12px; --ny:-20px; }
  .offerte-canvas.layout-compact{ --px:10px; --nx:-10px; }
  .offerte-canvas .li-table{ font-size:12px; }
  .offerte-canvas .li-table thead th{ font-size:9px; letter-spacing:0; padding-right:3px; }
  .offerte-canvas .li-table td{ padding-right:3px; }
  .offerte-canvas .row-remove, .offerte-canvas .row-save{ padding-left:0; }
  .offerte-canvas .f-qty{ width:30px; }
  .offerte-canvas .f-price{ width:50px; }
}

/* ================= werkbon (zelfde document-systeem, dus ook alle layouts, kleuren en lettertypen) ================= */
.offerte-canvas .section-label{ font-family:var(--font-head); font-size:10.5px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--accent); margin:0 0 10px; }
.offerte-canvas .summary-box{ display:flex; justify-content:flex-end; gap:28px; margin:8px 0 28px; font-size:13px; }
.offerte-canvas .summary-item{ text-align:right; }
.offerte-canvas .summary-item .n{ font-family:var(--font-head); font-size:19px; font-weight:700; color:var(--accent); }
.offerte-canvas .summary-item .l{ color:#9ca3af; font-size:11px; }
.offerte-canvas .wb-table + .add-row-bar, .offerte-canvas .wb-table + .summary-box{ margin-bottom:22px; }
.offerte-canvas .wb-table{ margin-bottom:2px; }
.offerte-canvas .sign-block{ display:grid; grid-template-columns:1fr 1fr; gap:24px; margin:26px 0 8px; page-break-inside:avoid; }
.offerte-canvas .sign-name{ font-weight:600; margin-bottom:8px; }
.offerte-canvas input.sign-name{ display:block; }
.offerte-canvas .sig-canvas{ width:100%; height:108px; border:1.5px dashed #cbd5e1; border-radius:8px; display:block; touch-action:none; cursor:crosshair; background:#fff; }
.offerte-canvas .sig-img{ display:block; width:100%; max-height:108px; object-fit:contain; object-position:left center; border-bottom:1px solid #cbd5e1; }
.offerte-canvas .sig-empty{ height:108px; border-bottom:1px solid #cbd5e1; }
.offerte-canvas .sign-meta{ display:flex; justify-content:space-between; margin-top:6px; font-size:11px; color:#9ca3af; }
.offerte-canvas .sign-clear{ font:inherit; font-size:11px; color:#94a3b8; background:none; border:0; cursor:pointer; text-decoration:underline; text-underline-offset:2px; padding:0; }
.offerte-canvas .sign-clear:hover{ color:#dc2626; }
.offerte-canvas .row-price{ font-size:11.5px; color:#9ca3af; margin-top:4px; display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.offerte-canvas .row-price .f-price{ width:76px; }
.offerte-canvas .f-unit{ width:70px; }
.offerte-canvas .f-time{ width:110px; text-align:right; font:inherit; }
.offerte-canvas.layout-kleurband .doc-meta .f-time{ color:var(--on-accent); }
.offerte-canvas.layout-zebra .section-label, .offerte-canvas.layout-opvallend .section-label{ margin-top:4px; }
@media(max-width:640px){
  .offerte-canvas .sign-block{ grid-template-columns:1fr; }
  .offerte-canvas .summary-box{ justify-content:flex-start; }
  .offerte-canvas .f-unit{ width:52px; }
  .offerte-canvas .f-time{ text-align:left; }
}

/* factuur: betaalgegevens */
.offerte-canvas .pay-box{ border:1px solid #e5e7eb; border-left:3px solid var(--accent); border-radius:6px; padding:12px 16px; margin:0 0 24px; font-size:12.5px; color:#374151; background:var(--accent-softer); }
.offerte-canvas .pay-title{ font-family:var(--font-head); font-size:10.5px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--accent); margin-bottom:4px; }

/* foto's in de werkbon (PDF en portal) */
.offerte-canvas .photo-section{ margin:8px 0 26px; }
.offerte-canvas .photo-phase{ font-size:10.5px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:#9ca3af; margin:12px 0 8px; }
.offerte-canvas .photo-grid{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.offerte-canvas .photo-item{ margin:0; break-inside:avoid; page-break-inside:avoid; }
.offerte-canvas .photo-item img{ display:block; width:100%; aspect-ratio:4/3; object-fit:cover; border-radius:4px; border:1px solid #e5e7eb; background:#f3f4f6; }
.offerte-canvas .photo-item figcaption{ font-size:11px; color:#4b5563; margin-top:4px; line-height:1.35; overflow-wrap:anywhere; }
@media(max-width:640px){ .offerte-canvas .photo-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
