/* ════════════════════════════════════════════
   PLANNING SCHERM — css/planning.css
   Desktop-first, minimalistisch, geen shadows
════════════════════════════════════════════ */

/* Layout override — planning scherm vult hele hoogte */
#screen-planning {
  padding: 0 !important;
  background: #F4F4F1 !important;
  height: calc(100vh - 56px);
  overflow: hidden;
}

.pl-layout {
  display: flex;
  height: 100%;
  overflow: hidden;
}

/* ── ZONE 1: CASE PANEL (links) ── */
.pl-case-panel {
  width: 300px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #E2E2DF;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pl-case-header {
  padding: 12px 14px 0;
  border-bottom: 1px solid #E2E2DF;
  flex-shrink: 0;
}

.pl-case-titel {
  font-size: 13px;
  font-weight: 700;
  color: #111;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pl-zoek {
  width: 100%;
  border: 1px solid #E2E2DF;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 13px;
  color: #111;
  background: #F9F9F7;
  outline: none;
  margin-bottom: 10px;
  box-sizing: border-box;
}
.pl-zoek:focus { border-color: #C9A84C; background: #fff; }
.pl-zoek::placeholder { color: #aaa; }

.pl-tabs {
  display: flex;
  gap: 0;
  margin: 0 -14px;
}
.pl-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #888;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  text-align: center;
}
.pl-tab.active {
  color: #111;
  border-bottom-color: #C9A84C;
  font-weight: 600;
}
.pl-tab:hover:not(.active) { color: #444; }

.pl-case-lijst {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* Sectie headers in case lijst */
.pl-sectie-header {
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #999;
  background: #F4F4F1;
  border-bottom: 1px solid #E2E2DF;
  position: sticky;
  top: 0;
  z-index: 1;
}
.pl-sectie-header.urgent { color: #B42318; }

/* Case items */
.pl-case-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #F0F0EE;
  cursor: pointer;
  transition: background .1s;
  border-left: 3px solid transparent;
}
.pl-case-item:hover { background: #F9F9F7; }
.pl-case-item.geselecteerd {
  background: #EFF6FF;
  border-left-color: #2563EB;
}

.pl-case-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.pl-case-dot-rood   { background: #B42318; }
.pl-case-dot-oranje { background: #D97706; }
.pl-case-dot-grijs  { background: #CCC; }
.pl-case-dot-blauw  { background: #175CD3; }
.pl-case-dot-groen  { background: #027A48; }

.pl-case-info { flex: 1; min-width: 0; }

.pl-case-rij1 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.pl-case-nummer {
  font-size: 12px;
  font-weight: 700;
  color: #111;
  font-family: monospace;
  white-space: nowrap;
}
.pl-case-stad {
  font-size: 12px;
  color: #555;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-case-rij2 {
  font-size: 11px;
  color: #888;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Datum-label voor visits buiten huidige bekeken week */
.pl-case-datum-buiten-week {
  font-size: 11px;
  color: #94A3B8;
  margin-left: auto;
  font-style: italic;
}

/* Mini badges (3px radius, niet pills) */
.pl-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pl-badge-nieuw       { background: #F2F4F7; color: #344054; border-color: #D0D5DD; }
.pl-badge-beschikbaar { background: #EFF8FF; color: #175CD3; border-color: #B2DDFF; }
.pl-badge-voorgesteld { background: #FFFAEB; color: #B54708; border-color: #FEDF89; }
.pl-badge-bevestigd   { background: #ECFDF3; color: #027A48; border-color: #ABEFC6; }
.pl-badge-issue       { background: #FEF3F2; color: #B42318; border-color: #FECDCA; }
.pl-badge-afgerond    { background: #F2F4F7; color: #667085; border-color: #D0D5DD; }
.pl-badge-geparkeerd  { background: #F4F3FF; color: #5925DC; border-color: #D9D6FE; }
.pl-badge-prio        { background: #FEF3F2; color: #B42318; border-color: #FECDCA; }
.pl-badge-normaal     { background: #F2F4F7; color: #344054; border-color: #D0D5DD; }
.pl-badge-opvulling   { background: #F9FAFB; color: #98A2B3; border-color: #EAECF0; }
.pl-badge-onderweg    { background: #EFF8FF; color: #175CD3; border-color: #B2DDFF; }
.pl-badge-ontvangen   { background: #ECFDF3; color: #027A48; border-color: #ABEFC6; }

.pl-leeg {
  padding: 24px 16px;
  font-size: 13px;
  color: #aaa;
  text-align: center;
}

/* ── ZONE 2: WEEK GRID (midden) ── */
.pl-grid-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #F4F4F1;
}

.pl-grid-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #E2E2DF;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.pl-grid-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pl-grid-nav button {
  background: none;
  border: 1px solid #E2E2DF;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 13px;
  color: #444;
  cursor: pointer;
  transition: border-color .15s;
}
.pl-grid-nav button:hover { border-color: #999; }
.pl-grid-nav span {
  font-size: 13px;
  font-weight: 600;
  color: #111;
  white-space: nowrap;
  padding: 0 4px;
}

.pl-grid-tellers {
  display: flex;
  gap: 8px;
  margin-left: auto;
  align-items: center;
}
/* Consistente pill-stijl voor alle vier de filters; alleen kleur verschilt */
.pl-teller {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  height: 28px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s, transform .08s;
  white-space: nowrap;
  user-select: none;
}
.pl-teller:hover { transform: translateY(-1px); }
.pl-teller-icoon { font-size: 13px; line-height: 1; }
.pl-teller-getal { font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-teller-label { font-weight: 500; opacity: .85; }
.pl-teller-x {
  margin-left: 2px; font-size: 11px; opacity: .75;
  display: inline-flex; width: 14px; height: 14px;
  align-items: center; justify-content: center; border-radius: 50%;
  background: rgba(0,0,0,.06);
}

.pl-teller-issue      { background: #FEF3F2; color: #B42318; border-color: #FECDCA; }
.pl-teller-geparkeerd { background: #F2F4F7; color: #475467; border-color: #D0D5DD; }
.pl-teller-team       { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.pl-teller-klaar      { background: #ECFDF3; color: #027A48; border-color: #ABEFC6; }

/* Actieve filter: dikkere border in eigen kleur */
.pl-teller-actief {
  border-width: 2px;
  padding: 4px 11px;
  box-shadow: 0 0 0 2px rgba(0,0,0,.04);
}
.pl-teller-issue.pl-teller-actief      { border-color: #B42318; }
.pl-teller-geparkeerd.pl-teller-actief { border-color: #475467; }
.pl-teller-team.pl-teller-actief       { border-color: #92400E; }
.pl-teller-klaar.pl-teller-actief      { border-color: #027A48; }

.pl-optimizer-btn {
  background: #C9A84C;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.pl-optimizer-btn:hover { background: #A67C2E; }

.pl-grid-wrap {
  flex: 1;
  overflow: auto;
  padding: 12px;
}

/* Planning grid tabel */
.pl-grid-tabel {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #E2E2DF;
  border-radius: 4px;
  table-layout: fixed;
}

.pl-grid-tabel th {
  background: #F4F4F1;
  border-bottom: 1px solid #E2E2DF;
  border-right: 1px solid #E2E2DF;
  padding: 8px 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pl-grid-tabel th:last-child { border-right: none; }
/* Vandaag in header: geen gele bg meer, alleen een klein pillje */
.pl-grid-tabel th.vandaag { background: #F4F4F1; }
.pl-vandaag-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #fff;
  background: #152038;
  border-radius: 999px;
  line-height: 1.4;
  vertical-align: middle;
}

.pl-monteur-kop {
  width: 110px;
  text-align: left !important;
  padding-left: 12px !important;
  font-size: 10px !important;
  color: #bbb !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pl-monteur-cel {
  background: #FAFAFA;
  border-right: 1px solid #E2E2DF;
  border-bottom: 1px solid #E2E2DF;
  /* border-left wordt inline gezet met de monteur-kleur (5px strip) */
  padding: 8px 10px 8px 10px;
  vertical-align: middle;
  white-space: nowrap;
  position: sticky;
  left: 0;
  z-index: 1;
}
.pl-monteur-naam-txt {
  font-size: 12px;
  font-weight: 600;
  color: #222;
}

.pl-dag-cel {
  border-right: 1px solid #E2E2DF;
  border-bottom: 1px solid #E2E2DF;
  padding: 0;
  vertical-align: top;
  min-height: 64px;
  min-width: 110px;
  position: relative;
}
.pl-dag-cel:last-child { border-right: none; }
/* Vandaag-cellen: geen gele tint meer — pill in header is genoeg */
.pl-dag-cel.vandaag { background: transparent; }

/* Staat 1 — geen rij of beschikbaar=false: diagonale streep, geen klik */
.pl-dag-cel.pl-dag-leeg-onbeschikbaar {
  background: repeating-linear-gradient(
    -45deg, transparent, transparent 3px,
    rgba(0,0,0,.05) 3px, rgba(0,0,0,.05) 6px
  );
  cursor: not-allowed;
}

/* Staat 2 — beschikbaar, geen visits: zachte groene tint (geen linker-rand,
   de tint doet het werk). Wordt overschreven door .pl-dag-heeft-visits. */
.pl-dag-cel-beschikbaar {
  background: #F0FDF4;
  padding: 0 5px 4px;
}
/* Staat 3 — beschikbaar mét visits: witte cel zodat monteur-tint van
   kaartjes goed contrasteert. */
.pl-dag-cel-beschikbaar.pl-dag-heeft-visits {
  background: #fff;
}

.pl-grid-tabel tr:last-child .pl-dag-cel { border-bottom: none; }
.pl-grid-tabel tr:last-child .pl-monteur-cel { border-bottom: none; }

/* ── Contextstrip per dag-cel ── */
.pl-dag-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 4px;
  margin: 0 -5px 4px;
  border-bottom: 1px solid #F0F0EE;
  font-size: 10px;
  color: #6B7280;
  cursor: pointer;
  user-select: none;
  min-height: 18px;
  transition: background .12s;
}
.pl-dag-strip:hover { background: #F9FAFB; }
.pl-strip-tijd {
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}
.pl-strip-icons {
  display: inline-flex; gap: 4px; align-items: center;
}
.pl-strip-icoon {
  font-size: 11px; line-height: 1;
  display: inline-flex; align-items: center;
}
.pl-strip-icoon.pl-strip-actief { color: #B45309; }
.pl-strip-route {
  text-decoration: none;
  font-size: 12px; line-height: 1;
  padding: 1px 3px; border-radius: 3px;
  background: #E8F0FE; color: #1967D2;
}
.pl-strip-route:hover { background: #D2E3FC; }

/* Stop blokjes — achtergrond komt via inline monteur-tint (issue overrulet
   met lichtrood). Status onderscheid: vorm + kleur van de 4px linker-rand
   plus een klein icon naast de tijd. Stippel = wacht-op-actie, vol = klaar. */
.pl-stop {
  position: relative;            /* D5.7: anker voor .tegel-badge absolute */
  border-left: 4px solid #D0D5DD;
  border-radius: 0 3px 3px 0;
  padding: 4px 6px 4px 8px;
  margin-bottom: 3px;
  cursor: pointer;
  transition: filter .12s;
}

/* D5.7 — Pakket+tool badge ook in planning-grid. Basisstyle hier
   gedupliceerd uit monteur.css zodat planning.css onafhankelijk laadt.
   Op kleinere tegels iets compacter (8px font, 1px/3px padding) zodat
   '📦 3/3' rechtsboven past zonder over stad-naam te lopen. */
/* Wendy's planning-tegels: absolute top-right badge.
   D5.12-fix-2 (28 mei): font-size 8px → 10px + padding 1px 3px → 2px 4px
   na user-feedback dat de D5.7-spec (8px) te klein leest op desktop-
   planning-tegels. Git-archeologie bevestigde: planning-badge was sinds
   introductie altijd 8px (bewust compact). Dit is geen revert maar een
   leesbaarheids-bump bovenop D5.7. Initialen-suffix evenredig groter
   (7px → 8px). Eventueel risico voor lange initialen op smalle tegels
   geaccepteerd — Wendy ziet 'm liever leesbaar dan compact. */
.pl-stop .tegel-badge {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(0,0,0,.5);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  z-index: 2;
  pointer-events: none;
  white-space: nowrap;
}
.pl-stop .tegel-badge-leeg  { background: #c62828; }
.pl-stop .tegel-badge-deels { background: #ef6c00; }
.pl-stop .tegel-badge-ok    { background: #2e7d32; }
.pl-stop .tegel-badge-init {
  font-size: 8px;
  font-weight: 600;
  background: rgba(255,255,255,.25);
  padding: 1px 3px;
  border-radius: 3px;
  letter-spacing: 0.2px;
}
.pl-stop:last-child { margin-bottom: 0; }
.pl-stop:hover { filter: brightness(.96); }

/* Bevestigd — definitieve groene volle rand */
.pl-stop-bevestigd { border-left: 4px solid #10B981; }

/* Voorgesteld door optimizer — stippel oranje, vraagt om bel-actie */
.pl-stop-voorgesteld { border-left: 4px dashed #F59E0B; }

/* Verzet — was eerder bevestigd, wacht op nieuwe bevestiging. Stippel
   identiek aan voorgesteld; verschil komt uit het ↻-icoon naast de tijd. */
.pl-stop-verzet { border-left: 4px dashed #F59E0B; }

/* Kantoor-tussenstop — grijze achtergrond, dunner, niet klikbaar (geen
   visit_id). Komt uit inplanningen-rij met visit_id IS NULL. */
.pl-stop-kantoor {
  background: #F1F5F9;
  border-left: 4px solid #94A3B8;
  cursor: default;
  opacity: 0.85;
  font-style: italic;
}
.pl-stop-kantoor:hover { filter: none; }

/* Issue — rode volle rand én lichtrode bg (overrulet monteur-tint inline) */
.pl-stop-issue {
  border-left: 4px solid #DC2626;
}

/* Monteur is nu bezig — groene gloed + groene volle rand */
.pl-stop-bezig {
  border-left: 4px solid #10B981;
  background: linear-gradient(to right, rgba(16, 185, 129, .12) 0%, transparent 35%);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .25);
}

/* Afgerond — grijze rand, lichte opacity */
.pl-stop-afgerond {
  border-left: 4px solid #6B7280;
  opacity: .72;
}

/* Niet uitgevoerd (bv klant niet thuis) — oranje rand, oranje tint */
.pl-stop-niet_uitgevoerd {
  border-left: 4px solid #F97316;
  background: rgba(249, 115, 22, .06);
}

/* Status-iconen — gecombineerde selector om de generieke .pl-stop-status-icoon
   base-color (oranje #B45309 hieronder) niet te laten winnen op specificiteit. */
.pl-stop-status-icoon.pl-stop-status-bezig            { color: #10B981; font-weight: 600; }
.pl-stop-status-icoon.pl-stop-status-afgerond         { color: #10B981; font-weight: 600; }
.pl-stop-status-icoon.pl-stop-status-vervolgafspraak  { color: #F59E0B; font-weight: 600; }
.pl-stop-status-icoon.pl-stop-status-niet-uitgevoerd  { color: #F97316; font-weight: 600; }

/* Lock-icoon (gelockt_voor_optimizer) naast tijd */
.pl-stop-lock-icoon {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  line-height: 1;
  vertical-align: middle;
}

/* Status-icoon naast tijd */
.pl-stop-status-icoon {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  line-height: 1;
  color: #B45309;
  vertical-align: middle;
}
.pl-stop-status-icoon.pl-stop-status-verzet { color: #B45309; }
.pl-stop-status-icoon.pl-stop-status-issue  { color: #B42318; font-weight: 700; }
.pl-stop-tijd { font-size: 10px; color: #999; margin-bottom: 1px; }
.pl-stop-naam { font-size: 12px; font-weight: 600; color: #111; }
.pl-stop-nr {
  float: right;
  font-size: 10px;
  color: #bbb;
  font-weight: 600;
}

/* PRIO-ster is een aparte dimensie naast de status-rand. De rand drukt
   uit "wacht op bel / bevestigd / issue", de ster drukt uit "voorrang". */
.pl-stop-prio-ster {
  color: #D97706;
  font-size: 11px;
  margin-left: 4px;
}

/* maps-link-btn — vervangen door .pl-strip-route in de contextstrip */

/* ── ZONE 3: DETAIL PANEL (rechts) ── */
.pl-detail-panel {
  width: 360px;
  min-width: 360px;
  flex-shrink: 0;
  background: #fff;
  border-left: 1px solid #E2E2DF;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pl-detail-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid #E2E2DF;
  flex-shrink: 0;
}
.pl-detail-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.pl-detail-nr {
  font-size: 14px;
  font-weight: 700;
  color: #111;
  font-family: monospace;
}
.pl-detail-sluit {
  background: none;
  border: none;
  color: #999;
  font-size: 18px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.pl-detail-sluit:hover { color: #333; }
.pl-detail-subtitel {
  font-size: 12px;
  color: #666;
}

.pl-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.pl-detail-sectie {
  padding: 12px 16px;
  border-bottom: 1px solid #F0F0EE;
}
.pl-detail-sectie-titel {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #999;
  margin-bottom: 8px;
}

.pl-detail-rij {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  font-size: 13px;
}
.pl-detail-label {
  color: #888;
  font-size: 11px;
  font-weight: 500;
  flex-shrink: 0;
  min-width: 80px;
}
.pl-detail-waarde {
  color: #111;
  font-weight: 500;
  text-align: right;
  word-break: break-word;
  max-width: 200px;
}
.pl-detail-waarde a { color: #2563EB; text-decoration: none; }
.pl-detail-waarde a:hover { text-decoration: underline; }

/* Acties in detail panel */
.pl-detail-acties {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pl-btn {
  border-radius: 4px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-align: left;
  transition: background .12s, border-color .12s;
  width: 100%;
}
.pl-btn-primair {
  background: #C9A84C;
  color: #fff;
  border-color: #A67C2E;
}
.pl-btn-primair:hover { background: #A67C2E; }
.pl-btn-sec {
  background: #fff;
  color: #222;
  border-color: #D0D5DD;
}
.pl-btn-sec:hover { background: #F4F4F1; border-color: #999; }
.pl-btn-groen { background: #ECFDF3; color: #027A48; border-color: #ABEFC6; }
.pl-btn-groen:hover { background: #D1FAE5; }
.pl-btn-rood { background: #FEF3F2; color: #B42318; border-color: #FECDCA; }
.pl-btn-rood:hover { background: #FEE2E2; }

/* Bewerk formulier */
.pl-edit-form { padding: 12px 16px; }
.pl-edit-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  margin-bottom: 3px;
  margin-top: 10px;
}
.pl-edit-label:first-child { margin-top: 0; }
.pl-edit-input {
  width: 100%;
  border: 1px solid #D0D5DD;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 13px;
  color: #111;
  background: #FAFAFA;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s;
}
.pl-edit-input:focus { border-color: #C9A84C; background: #fff; }
.pl-edit-textarea {
  width: 100%;
  border: 1px solid #D0D5DD;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 13px;
  color: #111;
  background: #FAFAFA;
  box-sizing: border-box;
  outline: none;
  resize: vertical;
  font-family: inherit;
  transition: border-color .15s;
}
.pl-edit-textarea:focus { border-color: #C9A84C; background: #fff; }
.pl-edit-acties {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.pl-edit-acties .pl-btn { flex: 1; text-align: center; }

/* ── INPLAN POPUP ── */
.pl-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 2000;
}
.pl-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 1px solid #E2E2DF;
  border-radius: 4px;
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: 80vh;
  z-index: 2001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pl-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid #E2E2DF;
  flex-shrink: 0;
}
.pl-popup-titel {
  font-size: 14px;
  font-weight: 700;
  color: #111;
}
.pl-popup-body {
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pl-popup-veld label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  margin-bottom: 4px;
}
.pl-popup-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid #E2E2DF;
  flex-shrink: 0;
}
.pl-popup-footer .pl-btn { width: auto; }

/* ── DAG-OVERDRACHT (Ronde A.3) ────────────────────────────────────── */

/* Klein context-menu dat opent op rechtsklik van een visit-cel */
.pl-dag-context-menu {
  position: fixed;
  z-index: 9000;
  background: #fff;
  border: 1px solid #E2E2DF;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  padding: 4px 0;
  min-width: 180px;
  font-size: 13px;
}
.pl-context-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: #111;
  font-size: 13px;
}
.pl-context-item:hover { background: #F3F4F6; }
.pl-context-icoon { font-size: 14px; }

/* Modal voor overdracht-dialoog */
.pl-overdr-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pl-overdr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  cursor: pointer;
}
.pl-overdr-modal {
  position: relative;
  background: #fff;
  width: 560px;
  max-width: 96vw;
  max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pl-overdr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #E2E2DF;
  background: #F4F4F1;
}
.pl-overdr-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #111;
}
.pl-overdr-sluit {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #888;
  line-height: 1;
  padding: 0 4px;
}
.pl-overdr-sluit:hover { color: #111; }
.pl-overdr-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.pl-overdr-aantal {
  font-size: 12px;
  color: #666;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
}
.pl-overdr-visits {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  border: 1px solid #E2E2DF;
  border-radius: 6px;
  overflow: hidden;
}
.pl-overdr-visit {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid #F0F0EE;
}
.pl-overdr-visit:last-child { border-bottom: none; }
.pl-overdr-tijd { font-weight: 600; color: #111; flex: 0 0 50px; }
.pl-overdr-stad { color: #111; flex: 1; }
.pl-overdr-meta { color: #666; font-size: 12px; }
.pl-overdr-tag {
  font-size: 12px;
  padding: 1px 5px;
}
.pl-overdr-tag-warn { color: #B45309; }

.pl-overdr-hint {
  font-size: 12px;
  color: #666;
  margin: 4px 0 12px;
  line-height: 1.4;
}
.pl-overdr-hint-warn {
  color: #B91C1C;
  background: #FEF2F2;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #FECACA;
}

.pl-overdr-keuze-titel {
  font-size: 13px;
  font-weight: 600;
  color: #111;
  margin: 14px 0 8px;
}

.pl-overdr-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 0;
  cursor: pointer;
  user-select: none;
}
.pl-overdr-radio input[type="radio"] { margin: 0; cursor: pointer; }

.pl-overdr-select {
  width: 100%;
  margin: 4px 0 6px 24px;
  padding: 8px 12px;
  border: 1px solid #D0D5DD;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  outline: none;
  width: calc(100% - 24px);
}
.pl-overdr-select:disabled { background: #F9FAFB; color: #999; cursor: not-allowed; }

.pl-overdr-doel-waarschuw {
  margin-left: 24px;
  font-size: 12px;
  color: #B45309;
  min-height: 16px;
  line-height: 1.4;
  margin-bottom: 6px;
}

.pl-overdr-team-blok {
  background: #F9FAFB;
  border: 1px solid #E2E2DF;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.pl-overdr-team-titel {
  font-size: 13px;
  font-weight: 600;
  color: #111;
  margin-bottom: 8px;
}

.pl-overdr-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid #E2E2DF;
  background: #FAFAFA;
}
.pl-overdr-footer .co-btn { padding: 8px 16px; }

/* Toast */
.pl-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #111;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 4px;
  z-index: 3000;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  white-space: nowrap;
}
.pl-toast.zichtbaar {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Optimizer overlay */
.pl-opt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pl-opt-card {
  background: #fff;
  border-radius: 4px;
  padding: 28px 32px;
  text-align: center;
}
.pl-opt-spinner {
  width: 36px; height: 36px;
  border: 3px solid #E2E2DF;
  border-top-color: #C9A84C;
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: pl-spin .8s linear infinite;
}
@keyframes pl-spin { to { transform: rotate(360deg); } }
.pl-opt-tekst { font-size: 14px; color: #555; }

/* ── UNIVERSELE CASE OVERLAY ────────────────────────────────────── */

#case-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
}
#case-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  cursor: pointer;
}
#case-overlay-modal {
  position: relative;
  background: white;
  width: 1120px;
  max-width: 96vw;
  max-height: 92vh;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
#co-header {
  padding: 14px 20px;
  border-bottom: 1px solid #E8E8E8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FAFAFA;
  flex-shrink: 0;
  gap: 12px;
}
#co-header-left { flex: 1; min-width: 0; }
#co-nr { font-size: 17px; font-weight: 700; color: #111; margin-bottom: 2px; }
#co-sub { font-size: 12px; color: #666; }
#co-header-center {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #888; flex-shrink: 0;
}
#co-nav-pos { min-width: 48px; text-align: center; }
.co-nav-btn {
  width: 28px; height: 28px;
  border: 1px solid #DDD; border-radius: 3px;
  background: white; cursor: pointer;
  font-size: 14px; color: #555;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.co-nav-btn:hover { background: #F5F5F5; }
#co-header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
#co-close {
  width: 28px; height: 28px;
  border: 1px solid #DDD; border-radius: 3px;
  background: white; cursor: pointer;
  font-size: 17px; color: #555;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
#co-close:hover { background: #F5F5F5; }
/* #co-body grid: zie main.css — 2-kolom (zone-left + zone-right).
   Oude 3-kolom .co-col layout is verwijderd. */
.co-col { padding: 16px 18px; }
.co-col:not(:last-child) { border-right: 1px solid #F0F0EE; }
.co-section-label {
  font-size: 10px; font-weight: 600; color: #888;
  text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: 10px;
}
.co-field { margin-bottom: 10px; }
.co-field label { display: block; font-size: 11px; color: #888; margin-bottom: 3px; }
.co-val {
  font-size: 13px; color: #111; font-weight: 500;
  min-height: 30px; padding: 5px 8px;
  border: 1px solid transparent; border-radius: 3px;
  line-height: 1.4;
  transition: border-color .15s, box-shadow .15s;
}
.co-val.co-editable {
  border: 1px solid #E8E8E8;
  background: #FAFAFA;
  cursor: text;
  outline: none;
}
.co-val.co-editable:hover { border-color: #C9A84C; background: white; }
.co-val.co-editable:focus { border-color: #2563EB; background: white; box-shadow: 0 0 0 2px rgba(37,99,235,0.1); }
.co-val.co-textarea { min-height: 140px; resize: vertical; white-space: pre-wrap; }
.co-link { color: #2563EB; cursor: pointer; }
.co-link:hover { text-decoration: underline; }

/* Info balken */
.co-info-balk {
  padding: 9px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.4;
}
.co-info-oranje { background: #FEF3C7; color: #92400E; border-left: 3px solid #F59E0B; }
.co-info-blauw  { background: #EFF6FF; color: #1D4ED8; border-left: 3px solid #3B82F6; }
.co-info-groen  { background: #F0FDF4; color: #166534; border-left: 3px solid #16A34A; }
.co-info-rood   { background: #FEF2F2; color: #991B1B; border-left: 3px solid #EF4444; }
.co-info-grijs  { background: #F9FAFB; color: #6B7280; border-left: 3px solid #9CA3AF; }

/* Tijdlijn */
.co-tijdlijn { display: flex; flex-direction: column; gap: 12px; }
.co-tijdlijn-item { display: flex; align-items: flex-start; gap: 10px; }
.co-tijdlijn-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 3px;
  flex-shrink: 0;
}
.co-tijdlijn-label { font-size: 12px; font-weight: 500; color: #333; }
.co-tijdlijn-datum { font-size: 11px; color: #888; margin-top: 1px; }
.co-tijdlijn-sub  { font-size: 11px; color: #D97706; margin-top: 2px; font-style: italic; }

/* Footer */
#co-footer {
  padding: 11px 20px;
  border-top: 1px solid #E8E8E8;
  display: flex; align-items: center; gap: 8px;
  background: #FAFAFA;
  flex-shrink: 0;
}
#co-acties { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; justify-content: space-between; }
.co-btn {
  padding: 7px 15px; border-radius: 3px;
  font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1px solid #DDD;
  background: white; color: #333;
}
.co-btn:hover { background: #F5F5F5; }
.co-btn-primary { background: #C9A84C; color: white; border-color: #C9A84C; }
.co-btn-primary:hover { background: #B8960A; }
.co-btn-danger { color: #DC2626; border-color: #FCA5A5; }
.co-btn-danger:hover { background: #FEF2F2; }

/* Acties-kolom: uniforme vertical button stack */
#co-overige-acties .co-btn {
  width: 100%; padding: 8px 12px; min-height: 36px;
  font-size: 13px; border: 1px solid #DDD;
  text-align: center; box-sizing: border-box;
}
#co-overige-acties .co-btn.co-btn-primary { background: #C9A84C; color: white; border-color: #C9A84C; }
#co-overige-acties .co-btn.co-btn-danger  { color: #DC2626; border-color: #FCA5A5; background: white; }
.co-toggle-wrap { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }

/* Afspraak sectie form inputs */
.co-form-input {
  width: 100%;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid #DDD;
  border-radius: 3px;
  background: white;
  color: #111;
  box-sizing: border-box;
  font-family: inherit;
}
.co-form-input:focus { outline: none; border-color: #2563EB; box-shadow: 0 0 0 2px rgba(37,99,235,0.1); }
.co-form-input:disabled { background: #F9FAFB; color: #374151; cursor: default; }
#co-afspraak-knoppen { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.co-tijd-label { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.co-tijdvak-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: #666; font-weight: 400; cursor: pointer;
}
.co-tijdvak-toggle input[type=checkbox] { margin: 0; }
#co-tijd-vak { display: flex; }

/* Toast */
#co-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: #1A1A1A;
  color: white;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 4px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
#co-toast.co-toast-zichtbaar {
  opacity: 1;
  transform: translateY(0);
}
