/* Klantportaal (cyclus 60): de schermen van aftekenen.js (.af-), bestellingen.js
   (.bs-) en het tekenvlak (.tv-). De shell en de lijsten staan in klant.css.
   Kleuren uit de ontwerpen: inkt #1b2836, tekst #22303f, zacht #5b6c7e, lijn
   #e2e7ed, accent #ff7a18. Tot 390 px zonder horizontale scroll: elke kolom
   krijgt min-width 0 en lange woorden breken. */

.af-scherm, .bs-scherm {
  --sch-inkt: #1b2836;
  --sch-tekst: #22303f;
  --sch-mid: #46566a;
  --sch-zacht: #5b6c7e;
  --sch-lijn: #e2e7ed;
  --sch-lijn2: #eef1f5;
  --sch-veld: #f6f7f9;
  --sch-veldlijn: #d6dde5;
  --sch-accent: #ff7a18;
  --sch-link: #3d5d8a;
  --sch-groen: #2f7a45;
  --sch-groenbg: #e8f5ec;
  --sch-oranje: #a8470a;
  --sch-oranjebg: #fff1e6;
  --sch-rood: #b42318;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  color: var(--sch-tekst);
  overflow-wrap: anywhere;
}
.af-laden, .bs-laden { color: #5b6c7e; padding: 24px 0; }

/* ---------- gedeeld: knoppen, velden, chips ---------- */
.af-knop, .bs-knop {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 12px;
  padding: 13px 18px;
  min-height: 46px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.af-knop:disabled, .bs-knop:disabled { background: var(--sch-lijn); color: var(--sch-zacht); cursor: not-allowed; border-color: transparent; }
.af-accent, .bs-accent { background: var(--sch-accent); color: var(--sch-inkt); }
.af-donker, .bs-donker { background: var(--sch-inkt); color: #ffffff; }
.af-licht { background: #ffffff; color: var(--sch-inkt); border: 1px solid var(--sch-veldlijn); font-weight: 600; }
.bs-wit { background: #ffffff; color: var(--sch-inkt); border: 1px solid var(--sch-veldlijn); font-weight: 600; }
.bs-stippel { background: transparent; color: var(--sch-link); border: 1.5px dashed #b6c1cc; font-weight: 600; align-self: flex-start; }
.af-link, .bs-link {
  font: inherit;
  font-size: 14px;
  background: none;
  border: 0;
  color: var(--sch-link);
  cursor: pointer;
  padding: 6px 0;
  min-height: 32px;
  text-align: left;
}
.af-link:disabled, .bs-link:disabled { color: var(--sch-zacht); cursor: not-allowed; }
.af-invoer, .bs-invoer {
  font: inherit;
  padding: 12px;
  border: 1px solid var(--sch-veldlijn);
  border-radius: 10px;
  background: var(--sch-veld);
  color: var(--sch-tekst);
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
textarea.af-invoer, textarea.bs-invoer { resize: vertical; }
.af-invoer:focus, .bs-invoer:focus { outline: 2px solid var(--sch-accent); outline-offset: 1px; background: #ffffff; }
.af-code { font-family: ui-monospace, monospace; font-size: 20px; letter-spacing: .3em; max-width: 220px; }
.af-label, .bs-label { font-size: 13px; font-weight: 600; color: var(--sch-mid); }
.af-chip, .bs-chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
  align-self: flex-start;
}
.af-chip-wacht, .bs-chip-actie { color: var(--sch-oranje); background: var(--sch-oranjebg); }
.af-chip-grijs, .bs-chip-grijs { color: var(--sch-mid); background: var(--sch-lijn2); }
.bs-chip-ok { color: var(--sch-groen); background: var(--sch-groenbg); }
.af-fout, .bs-fout { color: var(--sch-rood); font-size: 14px; margin: 0; line-height: 1.45; }
.af-fout:not([hidden]) { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.af-ok { color: var(--sch-groen); font-weight: 600; margin: 0; }
.af-zin, .bs-zin { margin: 0; font-size: 14px; line-height: 1.5; color: var(--sch-mid); }
.af-klein { font-size: 13px; }
.af-pre, .bs-pre { white-space: pre-wrap; }
.af-r { text-align: right; }
.af-midden { text-align: center; }
.af-rij, .bs-rij { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.af-kaart, .bs-kaart {
  background: #ffffff;
  border: 1px solid var(--sch-lijn);
  border-radius: 14px;
  padding: 22px 24px;
  min-width: 0;
}

/* ---------- aftekenen ---------- */
.af-kruimel { font-size: 14px; color: var(--sch-zacht); }
.af-kruimel a { color: var(--sch-link); }
.af-raam { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.af-doc {
  flex: 999 1 560px;
  min-width: 0;
  background: #ffffff;
  border: 1px solid var(--sch-lijn);
  border-radius: 14px;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-sizing: border-box;
}
.af-zij {
  flex: 1 1 360px;
  min-width: 0;
  background: #ffffff;
  border: 1px solid var(--sch-lijn);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-sizing: border-box;
}
.af-kop {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--sch-inkt);
}
.af-kop > div { min-width: 0; }
.af-kicker { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--sch-zacht); }
.af-h1 { margin: 4px 0 0; font-family: Archivo, system-ui, sans-serif; font-size: 30px; font-weight: 700; color: var(--sch-inkt); line-height: 1.2; }
.af-meta { text-align: right; font-size: 14px; color: var(--sch-mid); line-height: 1.6; }
.af-meta strong { color: var(--sch-inkt); }
.af-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 20px; }
.af-raster:empty { display: none; }
.af-sectie { min-width: 0; }
.af-sectie p { margin: 0; line-height: 1.55; }
.af-h2 { margin: 0 0 8px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--sch-zacht); }
.af-h2groot { margin: 0; font-family: Archivo, system-ui, sans-serif; font-size: 20px; font-weight: 700; color: var(--sch-inkt); }
.af-tabelwrap { overflow-x: auto; max-width: 100%; }
.af-tabel { width: 100%; border-collapse: collapse; font-size: 14px; }
.af-tabel th { padding: 8px 8px 8px 0; font-weight: 600; text-align: left; color: var(--sch-zacht); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.af-tabel th.af-r { text-align: right; }
.af-tabel td { padding: 10px 8px 10px 0; border-top: 1px solid var(--sch-lijn2); vertical-align: top; }
.af-tabel th:last-child, .af-tabel td:last-child { padding-right: 0; }
.af-zacht { color: var(--sch-mid); white-space: nowrap; }
.af-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.af-totaal td { border-top: 2px solid var(--sch-inkt); padding-top: 12px; font-weight: 700; color: var(--sch-inkt); }
.af-totaal td.af-num { font-family: Archivo, system-ui, sans-serif; font-size: 18px; }
.af-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0 0 12px; font-size: 14px; }
.af-dl dt { color: var(--sch-zacht); }
.af-dl dd { margin: 0; color: var(--sch-tekst); }
.af-fotos { display: flex; gap: 12px; flex-wrap: wrap; }
.af-foto { display: block; width: 140px; height: 100px; border-radius: 10px; overflow: hidden; background: var(--sch-lijn2); border: 1px solid var(--sch-lijn); }
.af-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.af-handtekeningen { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.6; }
.af-voet {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--sch-zacht);
  padding-top: 16px;
  border-top: 1px solid var(--sch-lijn2);
}
.af-mono { font-family: ui-monospace, monospace; color: var(--sch-mid); }
.af-pdf { color: var(--sch-link); }
.af-form { display: flex; flex-direction: column; gap: 18px; }
.af-form > div:first-child p { margin-top: 6px; }
.af-veld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.af-veld > .af-knop { align-self: flex-start; }
.af-vinkrij { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.af-vinkrij input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--sch-inkt); flex: 0 0 auto; }
#afTeken { font-size: 16px; min-height: 48px; padding: 15px 18px; }
.af-vraag { display: flex; flex-direction: column; align-items: center; }
.af-vraag > .af-link { text-align: center; }
.af-vraagvenster {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fafb;
  border: 1px solid var(--sch-lijn);
  border-radius: 12px;
  padding: 14px;
}
.af-bewaar { background: #f8fafb; border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--sch-zacht); line-height: 1.5; }
.af-bedankt { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.af-vink {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--sch-groenbg);
  color: var(--sch-groen);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
}
.af-dood { display: flex; flex-direction: column; gap: 10px; }

/* ---------- tekenvlak ---------- */
.tv-vlak {
  position: relative;
  width: 100%;
  min-width: 0;
  border: 1.5px dashed #b6c1cc;
  border-radius: 12px;
  background: #fbfcfd;
  overflow: hidden;
  box-sizing: border-box;
}
.tv-vlak.tv-gevuld { border-style: solid; border-color: #9fb0c1; }
.tv-canvas { display: block; cursor: crosshair; color: #1b2836; touch-action: none; }
.tv-canvas.tv-uit { cursor: not-allowed; opacity: .6; }
.tv-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5b6c7e;
  font-size: 14px;
  pointer-events: none;
  text-align: center;
  padding: 0 8px;
}
.tv-hint[hidden] { display: none; }
.tv-wis {
  align-self: flex-end;
  font: inherit;
  font-size: 13px;
  background: none;
  border: 0;
  color: #3d5d8a;
  cursor: pointer;
  padding: 6px 0;
  min-height: 32px;
}
.tv-wis:disabled { color: #5b6c7e; cursor: not-allowed; }

/* ---------- bestellingen ---------- */
.bs-scherm { gap: 24px; }
.bs-kopregel { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.bs-kopregel > div { min-width: 0; }
.bs-h1 { margin: 0; font-family: Archivo, system-ui, sans-serif; font-size: 32px; font-weight: 700; color: var(--sch-inkt); }
.bs-intro { margin: 6px 0 0; color: var(--sch-zacht); font-size: 16px; }
.bs-filters { display: flex; flex-wrap: wrap; gap: 4px; background: #e9edf1; padding: 4px; border-radius: 10px; max-width: 100%; }
.bs-filters[hidden] { display: none; }
.bs-filter {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  min-height: 36px;
  background: transparent;
  color: var(--sch-mid);
}
.bs-filter[aria-pressed="true"] { background: #ffffff; color: var(--sch-inkt); box-shadow: 0 1px 2px rgba(27, 40, 54, .12); }
.bs-raam { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.bs-lijst { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.bs-detail { flex: 999 1 620px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.bs-opdracht {
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 14px;
  cursor: pointer;
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--sch-lijn);
  margin: 1px;
  text-align: left;
  color: var(--sch-tekst);
  box-sizing: border-box;
  min-width: 0;
}
.bs-opdracht[aria-pressed="true"] { border: 2px solid var(--sch-inkt); margin: 0; }
.bs-opkop { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; min-width: 0; }
.bs-optitel { font-weight: 700; color: var(--sch-inkt); font-size: 16px; min-width: 0; }
.bs-opplan { font-size: 13px; color: var(--sch-mid); }
.bs-kaart { display: flex; flex-direction: column; gap: 16px; box-sizing: border-box; }
.bs-kop { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.bs-kop > div { min-width: 0; }
.bs-h2 { margin: 0; font-family: Archivo, system-ui, sans-serif; font-size: 22px; font-weight: 700; color: var(--sch-inkt); }
.bs-h3 { margin: 0; font-family: Archivo, system-ui, sans-serif; font-size: 18px; font-weight: 700; color: var(--sch-inkt); }
.bs-h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--sch-zacht); }
.bs-zacht { font-size: 13px; color: var(--sch-zacht); margin: 0; }
.bs-vet { font-weight: 600; font-size: 14px; }
.bs-groen { color: var(--sch-groen); }
.bs-oranje { color: var(--sch-oranje); }
.bs-rood { color: var(--sch-rood); }
.bs-bruin { font-size: 14px; color: #7a3307; }
.bs-groot { font-size: 16px; color: var(--sch-inkt); }
.bs-mono { font-family: ui-monospace, monospace; font-weight: 600; color: var(--sch-inkt); min-width: 0; }
.bs-breek { overflow-wrap: anywhere; }
.bs-stappen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bs-stap { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bs-balk { height: 8px; border-radius: 99px; background: var(--sch-lijn); }
.bs-stap-aan .bs-balk { background: var(--sch-accent); }
.bs-staplabel { font-weight: 600; color: var(--sch-zacht); }
.bs-stap-aan .bs-staplabel { color: var(--sch-inkt); }
.bs-stap-nu .bs-staplabel { font-weight: 700; }
.bs-stapdatum { font-size: 13px; color: var(--sch-zacht); }
.bs-planning { border-top: 1px solid var(--sch-lijn2); padding-top: 14px; }
.bs-planform { display: flex; flex-direction: column; gap: 14px; }
.bs-datums { display: flex; flex-wrap: wrap; gap: 14px; }
.bs-datums .bs-veld { flex: 1 1 180px; }
.bs-veld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bs-planknop { align-self: flex-start; }
.bs-plan {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafb;
  border: 1px solid var(--sch-lijn);
  border-radius: 12px;
  padding: 16px 18px;
}
.bs-plan-tegen { background: var(--sch-oranjebg); border-color: #ffd2ad; gap: 12px; }
.bs-plan-ok { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; background: var(--sch-groenbg); border-color: #cfe3d4; }
.bs-plan-ok strong { color: var(--sch-inkt); }
.bs-plan-ok .bs-groen { font-size: 14px; }
.bs-vink { color: var(--sch-groen); font-weight: 700; font-size: 20px; }
.bs-wijzig { align-self: flex-start; }
.bs-tweeluik { display: flex; flex-wrap: wrap; gap: 16px; }
.bs-half { flex: 1 1 300px; min-width: 0; gap: 14px; }
.bs-bonnen { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bs-bon { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: #f8fafb; border-radius: 10px; }
.bs-bonkop { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bs-bonkop a { font-size: 14px; color: var(--sch-link); }
.bs-bonstand { font-size: 13px; font-weight: 600; }
.bs-ob { display: flex; flex-direction: column; gap: 8px; }
.bs-ob + .bs-ob { border-top: 1px solid var(--sch-lijn2); padding-top: 12px; }
.bs-oblink { align-self: flex-start; }

@media (max-width: 640px) {
  .af-doc { padding: 22px 18px; }
  .af-zij { padding: 18px; }
  .af-h1 { font-size: 24px; }
  .af-meta { text-align: left; }
  .bs-h1 { font-size: 26px; }
  .bs-kaart { padding: 18px; }
  /* De projectkaarten boven het detail. */
  .bs-raam { flex-direction: column; align-items: stretch; }
  .bs-lijst, .bs-detail { flex: 1 1 auto; }
  .af-raam { flex-direction: column; align-items: stretch; }
  .af-doc, .af-zij { flex: 1 1 auto; }
}
