:root {
  --oranje: #f26522;
  --oranje-donker: #d9520f;
  --oranje-licht: #fff1e8;
  --tekst: #1f2328;
  --zacht: #626a73;
  --rand: #e3e6ea;
  --vlak: #f6f7f9;
  --wit: #ffffff;
  --ok: #1f8a4c;
  --ok-licht: #e6f5ec;
  --bijna: #b7791f;
  --bijna-licht: #fff6dd;
  --laat: #c62828;
  --laat-licht: #fdeaea;
  --radius: 12px;
  --schaduw: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .04);
  --tab-hoogte: 64px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--tekst);
  background: var(--wit);
  -webkit-text-size-adjust: 100%;
}

[hidden] { display: none !important; }

h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

.zacht { color: var(--zacht); }

/* ---------- Oranje balk ---------- */
.balk {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--oranje);
  color: var(--wit);
  padding-top: env(safe-area-inset-top);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}
.balk-binnen {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.merk { font-weight: 800; font-size: 1.25rem; letter-spacing: .2px; white-space: nowrap; }
.merk-sub { font-weight: 500; font-size: .85rem; opacity: .9; margin-left: 6px; }
.gebruiker { display: flex; align-items: center; gap: 10px; font-size: .9rem; min-width: 0; }
.gebruiker span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knop-link {
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .5);
  color: var(--wit);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
  white-space: nowrap;
}
.knop-link:hover { background: rgba(255, 255, 255, .3); }

@media (max-width: 480px) {
  .merk-sub { display: none; }
  #gebruikerNaam { display: none; }
}

/* ---------- Tabs: onderaan op mobiel, bovenaan op laptop ---------- */
.tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  background: var(--wit);
  border-top: 1px solid var(--rand);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  flex: 1;
  min-height: var(--tab-hoogte);
  border: 0;
  background: none;
  font: inherit;
  font-size: .78rem;
  color: var(--zacht);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  padding: 6px 2px;
}
.tabs button .ico { font-size: 1.3rem; line-height: 1; }
.tabs button[aria-current="page"] { color: var(--oranje); font-weight: 700; }

.inhoud {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--tab-hoogte) + 32px + env(safe-area-inset-bottom));
}

@media (min-width: 800px) {
  .tabs {
    position: sticky;
    top: 56px;
    bottom: auto;
    border-top: 0;
    border-bottom: 1px solid var(--rand);
    justify-content: center;
    padding: 0 16px;
  }
  .tabs-binnen { display: flex; }
  .tabs button {
    flex: 0 0 auto;
    flex-direction: row;
    min-height: 48px;
    font-size: .95rem;
    padding: 0 18px;
    border-bottom: 3px solid transparent;
  }
  .tabs button .ico { font-size: 1rem; }
  .tabs button[aria-current="page"] { border-bottom-color: var(--oranje); }
  .inhoud { padding: 24px 24px 48px; }
}

.laden { color: var(--zacht); text-align: center; padding: 40px 0; }

/* ---------- Knoppen en formulieren ---------- */
.knop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--rand);
  background: var(--wit);
  color: var(--tekst);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.knop:hover { background: var(--vlak); }
.knop:disabled { opacity: .6; cursor: default; }
.knop-primair { background: var(--oranje); border-color: var(--oranje); color: var(--wit); }
.knop-primair:hover { background: var(--oranje-donker); }
.knop-breed { width: 100%; }
.knop-klein { min-height: 36px; padding: 0 12px; font-size: .9rem; }

label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 14px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  font: inherit;
  font-weight: 400;
  color: var(--tekst);
  background: var(--wit);
  border: 1px solid #cfd4da;
  border-radius: 10px;
}
textarea { resize: vertical; }
input:disabled { background: var(--vlak); color: var(--zacht); }
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 3px solid rgba(242, 101, 34, .35);
  outline-offset: 1px;
  border-color: var(--oranje);
}
.schakel { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.schakel input { width: 22px; height: 22px; accent-color: var(--oranje); }

.fout {
  background: var(--laat-licht);
  color: var(--laat);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .92rem;
}

/* ---------- Inloggen ---------- */
.login-kaart {
  max-width: 400px;
  margin: 32px auto;
  padding: 24px;
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--schaduw);
}

/* ---------- Kop van een scherm ---------- */
.scherm-kop {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.scherm-kop p { margin: 0; }

/* ---------- Statuslabels ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}
.st-ok .badge, .badge.st-ok { background: var(--ok-licht); color: var(--ok); }
.st-bijna .badge, .badge.st-bijna { background: var(--bijna-licht); color: var(--bijna); }
.st-laat .badge, .badge.st-laat { background: var(--laat-licht); color: var(--laat); }
.st-geen .badge, .badge.st-geen { background: var(--vlak); color: var(--zacht); }

/* ---------- Taakkaarten (medewerker) ---------- */
.kaarten { display: grid; gap: 12px; }
@media (min-width: 800px) { .kaarten { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1050px) { .kaarten { grid-template-columns: repeat(3, 1fr); } }

.taak {
  border: 1px solid var(--rand);
  border-left: 6px solid var(--rand);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--wit);
  box-shadow: var(--schaduw);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.taak.st-ok { border-left-color: var(--ok); }
.taak.st-bijna { border-left-color: var(--bijna); }
.taak.st-laat { border-left-color: var(--laat); }
.taak-kop { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.taak-kop h3 { margin: 0; }
.taak p { margin: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .88rem; color: var(--zacht); margin: 0; }
.meta div { display: flex; gap: 4px; }
.meta dt { font-weight: 400; }
.meta dd { margin: 0; color: var(--tekst); font-weight: 600; }
.laatste-opm { font-size: .88rem; color: var(--zacht); font-style: italic; }
.afvink-rij { display: flex; gap: 8px; margin-top: auto; }
.afvink-rij input { margin-top: 0; flex: 1; min-width: 0; }
.afvink-knop { flex: 0 0 auto; min-height: 48px; padding: 0 18px; font-size: 1rem; }

/* ---------- Samenvatting / filters ---------- */
.tellers { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.teller {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--rand);
  background: var(--wit);
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}
.teller b { font-size: 1.05rem; }
.teller[aria-pressed="true"] { border-color: var(--tekst); box-shadow: inset 0 0 0 1px var(--tekst); }
.teller .stip { width: 10px; height: 10px; border-radius: 50%; background: var(--zacht); }
.teller.st-ok .stip { background: var(--ok); }
.teller.st-bijna .stip { background: var(--bijna); }
.teller.st-laat .stip { background: var(--laat); }

.filterrij { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filterrij select, .filterrij input[type="text"] { width: auto; min-width: 180px; margin-top: 0; }
.filterrij label { margin: 0; }

/* ---------- Overzicht per persoon ---------- */
.persoon {
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--schaduw);
}
.persoon-kop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--vlak);
  border-bottom: 1px solid var(--rand);
}
.persoon-kop h3 { margin: 0; }
.persoon-kop .mini { display: flex; gap: 6px; }
.rij {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rand);
  border-left: 5px solid transparent;
  cursor: pointer;
  background: var(--wit);
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  border-top: 0; border-right: 0;
}
.rij:last-child { border-bottom: 0; }
.rij:hover { background: #fafafa; }
.rij.st-ok { border-left-color: var(--ok); }
.rij.st-bijna { border-left-color: var(--bijna); background: #fffcf2; }
.rij.st-laat { border-left-color: var(--laat); background: #fff7f7; }
.rij-titel { font-weight: 600; }
.rij-info { grid-column: 1 / -1; font-size: .85rem; color: var(--zacht); }
@media (min-width: 800px) {
  .rij { grid-template-columns: 2fr 1fr 1fr 1fr auto; align-items: center; }
  .rij-info { grid-column: auto; }
}

/* ---------- Beheerlijsten ---------- */
.lijst {
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--schaduw);
}
.lijst-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rand);
}
.lijst-item:last-child { border-bottom: 0; }
.lijst-item.uit { background: var(--vlak); }
.lijst-item.uit .li-titel { color: var(--zacht); text-decoration: line-through; }
.li-tekst { min-width: 0; }
.li-titel { font-weight: 600; }
.li-sub { font-size: .86rem; color: var(--zacht); }
.li-acties { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

.leeg {
  text-align: center;
  padding: 32px 16px;
  color: var(--zacht);
  border: 1px dashed var(--rand);
  border-radius: var(--radius);
}

/* ---------- Dialogen ---------- */
.dialoog {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}
.dialoog::backdrop { background: rgba(20, 20, 20, .45); }
.dialoog form { padding: 20px; }
.dialoog-knoppen { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ---------- Melding (toast) ---------- */
.melding {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-hoogte) + 16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--tekst);
  color: var(--wit);
  padding: 12px 18px;
  border-radius: 10px;
  z-index: 50;
  max-width: calc(100vw - 32px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
}
.melding.fout-melding { background: var(--laat); }

/* ---------- Pincodevelden ---------- */
input.pin-veld {
  font-size: 1.6rem;
  letter-spacing: .6em;
  text-align: center;
  padding-left: .6em; /* compenseert letter-spacing zodat de cijfers echt in het midden staan */
  max-width: 220px;
}

/* ---------- Bijvullen ---------- */
.st-meer .badge, .badge.st-meer { background: var(--oranje-licht); color: var(--oranje-donker); }
.teller.st-meer .stip { background: var(--oranje); }
.kop-knoppen { display: flex; gap: 8px; flex-wrap: wrap; }

.samenvatting {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--rand);
  border-left: 6px solid var(--rand);
  box-shadow: var(--schaduw);
}
.samenvatting.st-laat { border-left-color: var(--laat); background: #fff7f7; }
.samenvatting.st-ok { border-left-color: var(--ok); background: #f6fcf8; }
.sv-getal { font-size: 2.2rem; font-weight: 800; line-height: 1; min-width: 1.4em; text-align: center; }
.samenvatting.st-laat .sv-getal { color: var(--laat); }
.samenvatting.st-ok .sv-getal { color: var(--ok); }
.sv-tekst b { font-size: 1.05rem; }
.sv-datum { font-size: .85rem; margin-top: 2px; }

.filterrij .teller { min-height: 44px; }
@media (max-width: 480px) {
  .filterrij select { flex: 1 1 100%; }
}

.norm-blok { border-bottom: 1px solid var(--rand); }
.norm-blok:last-child { border-bottom: 0; }
.norm-blok > .norm-rij { border-bottom: 0; }
.norm-rij {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 2px 10px;
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--rand);
  border-left: 6px solid transparent;
  background: var(--wit);
  font: inherit;
  color: inherit;
  text-align: left;
}
.lijst > .norm-rij:last-child { border-bottom: 0; }
button.norm-rij { cursor: pointer; }
button.norm-rij:hover { filter: brightness(.98); }
.norm-rij.st-laat { border-left-color: var(--laat); background: #fff7f7; }
.norm-rij.st-ok { border-left-color: var(--ok); }
.norm-rij.st-meer { border-left-color: var(--oranje); background: #fffaf6; }
.norm-titel { font-weight: 700; grid-column: 1; }
.norm-telling { grid-column: 2; font-size: .92rem; white-space: nowrap; }
.norm-rij .badge { grid-column: 3; }
.norm-sub { grid-column: 1 / 3; font-size: .83rem; color: var(--zacht); }
.norm-pijl { grid-column: 3; grid-row: 2; justify-self: end; color: var(--laat); font-size: 1.1rem; line-height: 1; }
@media (max-width: 480px) {
  .norm-rij { grid-template-columns: 1fr auto; }
  .norm-titel { grid-column: 1 / -1; }
  .norm-telling { grid-column: 1; }
  .norm-rij .badge { grid-column: 2; justify-self: end; }
  .norm-sub { grid-column: 1; }
  .norm-pijl { grid-column: 2; grid-row: auto; }
}

.suggesties { background: var(--vlak); padding: 10px 14px 12px 20px; border-top: 1px solid var(--rand); }
.sug-kop { margin: 0 0 6px; font-size: .88rem; font-weight: 600; color: var(--zacht); }
.sug-lijst { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sug-lijst li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--wit); border: 1px solid var(--rand); border-radius: 10px; padding: 8px 12px;
}
.sug-tekst { min-width: 0; }
.sug-titel { font-size: .95rem; }
.sug-sub { font-size: .82rem; color: var(--zacht); }
.sug-leeg, .laden-klein { margin: 0; color: var(--zacht); font-size: .9rem; }
.sug-uitleg { margin: 0 0 8px; font-size: .8rem; color: var(--zacht); }
.sug-lijst.genummerd { counter-reset: sug; }
.sug-lijst.genummerd li { counter-increment: sug; }
.sug-lijst.genummerd li::before {
  content: counter(sug); flex: none; align-self: flex-start;
  min-width: 1.6em; height: 1.6em; border-radius: 50%; display: grid; place-items: center;
  background: var(--vlak); color: var(--zacht); font-size: .78rem; font-weight: 700;
}
.sug-lijst.genummerd .sug-tekst { flex: 1; }
.sug-prijs { font-weight: 700; white-space: nowrap; }
.sug-reden { font-size: .8rem; color: var(--zacht); margin-top: 2px; }
.sug-reden.gat { color: var(--ok); font-weight: 600; }
.sug-labels { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.badge.st-uq { background: var(--oranje-licht); color: var(--oranje-donker); font-weight: 700; }

/* ---------- Normen beheren ---------- */
.knop-terug {
  background: none; border: 0; padding: 4px 0; margin-bottom: 4px;
  font: inherit; font-weight: 600; color: var(--oranje-donker); cursor: pointer;
}
.afd-kop { font-size: 1rem; color: var(--zacht); margin: 18px 0 8px; }
.knop-gevaar { color: var(--laat); border-color: #f0c4c4; }
.knop-gevaar:hover { background: var(--laat-licht); }
.dialoog-knoppen .vul { flex: 1; }
@media (max-width: 480px) {
  .dialoog-knoppen { flex-wrap: wrap; }
  .dialoog-knoppen .vul { display: none; }
  .dialoog-knoppen .knop-gevaar { order: 3; flex: 1 1 100%; }
  .dialoog-knoppen .knop:not(.knop-gevaar) { flex: 1; }
}
.twee-kol { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset.groepen { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
fieldset.groepen legend { font-weight: 600; font-size: .92rem; padding: 0; }
fieldset.groepen legend .zacht { font-weight: 400; margin-left: 4px; }
.groep-keuze {
  margin-top: 6px;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #cfd4da;
  border-radius: 10px;
  padding: 4px 10px;
}
.groep-optie { margin: 0; padding: 7px 0; font-weight: 400; border-bottom: 1px solid var(--vlak); }
.groep-optie:last-child { border-bottom: 0; }
.groep-optie input { flex-shrink: 0; }
.toewijs-uitleg { margin: 2px 0 6px; font-size: .82rem; }
.fo-blok { border-top: 1px solid var(--rand); padding-top: 12px; }
.fo-blok textarea { font-size: .92rem; line-height: 1.45; }
.fo-uitleg { margin: -6px 0 12px; font-size: .8rem; }
.fo-kaart {
  border: 1px solid var(--rand); border-left: 4px solid var(--oranje, #f26a21); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 14px; background: var(--wit);
}
.fo-kaart summary { cursor: pointer; display: flex; flex-direction: column; gap: 2px; list-style: none; }
.fo-kaart summary::-webkit-details-marker { display: none; }
.fo-kaart summary .fo-titel::after { content: ' ▾'; color: var(--zacht); font-weight: 400; }
.fo-kaart[open] summary .fo-titel::after { content: ' ▴'; }
.fo-kaart .fo-titel { font-weight: 600; }
.fo-tekst { margin-top: 10px; border-top: 1px solid var(--vlak); padding-top: 10px; font-size: .95rem; line-height: 1.5; }
.fo-tekst h3 { font-size: 1rem; margin: 12px 0 4px; }
.fo-tekst h3:first-child { margin-top: 0; }
.fo-tekst p { margin: 0 0 8px; }
.fo-tekst ul { margin: 0 0 8px; padding-left: 20px; }
.dialoog.dialoog-breed { width: min(860px, calc(100vw - 24px)); max-width: none; }
.bulk-bevestig { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--bijna-licht); color: var(--tekst, #222); font-size: .9rem; border: 1px solid #f0d58a; }
.bulk-uitleg { margin: -6px 0 10px; font-size: .82rem; }
.bulk-voorbeeld { overflow-x: auto; margin: 0 0 14px; }
.bulk-tabel { width: 100%; border-collapse: collapse; font-size: .85rem; }
.bulk-tabel th { text-align: left; font-weight: 600; color: var(--zacht); padding: 4px 8px 4px 0; border-bottom: 1px solid var(--rand); }
.bulk-tabel td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--vlak); vertical-align: top; }
.bulk-tabel td:nth-child(2) { word-break: break-all; }
.bulk-tabel .badge { white-space: normal; }
.afspraken-kop { font-size: 1rem; margin: 20px 0 10px; color: var(--zacht); font-weight: 600; }
.li-sub.fo-regel { font-size: .82rem; }
.toewijs-snel { display: flex; flex-wrap: wrap; gap: 6px; }
.toewijs-snel .knop { padding: 4px 10px; font-size: .8rem; min-height: 0; }
@media (min-width: 800px) { .melding { bottom: 24px; } }

/* ---------- Startscherm "Vandaag" ---------- */
.dash { display: grid; gap: 20px; }
@media (min-width: 900px) {
  .dash-beheer { grid-template-columns: 1fr 1fr; align-items: start; }
  .dash-breed { grid-column: 1 / -1; }
}
.dash-blok { min-width: 0; }
.dash-kop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.dash-kop h2 { margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-leeg { margin: 0; padding: 4px 0; }
.dash-lijst { margin-top: 10px; }
.dash .tellers { margin-bottom: 0; }

.knop-tekst {
  background: none;
  border: 0;
  padding: 6px 2px;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  color: var(--oranje-donker);
  cursor: pointer;
  white-space: nowrap;
}
.knop-tekst:hover { text-decoration: underline; }
.kaart-hist { align-self: flex-start; padding: 0; }

.dash-klaar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--rand);
  border-left: 6px solid var(--rand);
}
.dash-klaar.st-ok { border-left-color: var(--ok); background: #f6fcf8; }
.dash-vink {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.3rem; font-weight: 700;
  background: var(--vlak); color: var(--zacht);
}
.dash-klaar.st-ok .dash-vink { background: var(--ok); color: var(--wit); }

.dash-tegel {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--rand);
  border-left: 6px solid var(--rand);
  background: var(--wit);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--schaduw);
}
.dash-tegel.st-laat { border-left-color: var(--laat); background: #fff7f7; }
.dash-tegel.st-ok { border-left-color: var(--ok); background: #f6fcf8; }
.dash-getal { font-size: 2.2rem; font-weight: 800; line-height: 1; min-width: 1.2em; text-align: center; }
.dash-tegel.st-laat .dash-getal { color: var(--laat); }
.dash-tegel.st-ok .dash-getal { color: var(--ok); }
.dash-tegel-tekst { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.dash-pijl { font-size: 1.6rem; color: var(--zacht); }

.dash-rijknop {
  width: 100%;
  background: var(--wit);
  border: 0;
  border-bottom: 1px solid var(--rand);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.dash-rijknop:hover { background: #fafafa; }
.dash-rijknop .li-tekst { display: flex; flex-direction: column; }
.dash-tijd { white-space: nowrap; flex-shrink: 0; }

/* ---------- Geschiedenis ---------- */
.dialoog-binnen { padding: 20px; }
.hist-label { margin: 0 0 2px; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.hist-lijst { list-style: none; margin: 0 0 12px; padding: 0; max-height: 50vh; overflow-y: auto; }
.hist-lijst li { padding: 10px 0; border-bottom: 1px solid var(--rand); }
.hist-lijst li:last-child { border-bottom: 0; }
.hist-opm { font-style: italic; color: var(--zacht); margin-top: 2px; }

/* ---------- Knop in de melding (ongedaan maken) ---------- */
.melding { display: flex; align-items: center; gap: 14px; }
.melding-actie {
  background: none;
  border: 0;
  padding: 4px 0;
  font: inherit;
  font-weight: 700;
  color: #ffb98f;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: underline;
}

/* ---------- TV-wand ---------- */
.tv-tegel { margin-bottom: 16px; }
.tv-groep {
  border: 1px solid var(--rand);
  border-left: 6px solid var(--rand);
  border-radius: var(--radius);
  margin-bottom: 12px;
  background: var(--wit);
  box-shadow: var(--schaduw);
  overflow: hidden;
}
.tv-groep.st-laat { border-left-color: var(--laat); }
.tv-groep.st-ok { border-left-color: var(--ok); }
.tv-groep.st-meer { border-left-color: var(--bijna); }
.tv-groep.st-meer > summary .badge { background: var(--bijna-licht); color: var(--bijna); }
.tv-groep > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}
.tv-groep > summary::-webkit-details-marker { display: none; }
.tv-groep > summary::after { content: '▾'; color: var(--zacht); }
.tv-groep[open] > summary::after { content: '▴'; }
.tv-groep.st-laat > summary { background: #fff7f7; }
.tv-groep-naam { font-weight: 700; font-size: 1.1rem; flex: 1; }
.tv-inhoud { padding: 4px 16px 16px; border-top: 1px solid var(--rand); background: var(--vlak); }
.tv-inhoud h3 { font-size: .9rem; margin: 16px 0 8px; color: var(--zacht); text-transform: uppercase; letter-spacing: .04em; }
.tv-lijst { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tv-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--wit);
  border: 1px solid var(--rand);
  border-radius: 10px;
}
.tv-item.tv-advies { border: 2px solid var(--oranje); background: var(--oranje-licht); }
.tv-tekst { min-width: 0; }
.tv-titel { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.tv-nr {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--oranje); color: var(--wit);
  font-size: .8rem; font-weight: 700;
}
.tv-sub { font-size: .82rem; color: var(--zacht); }
.tv-uitleg { margin: 4px 0 2px; }
.tv-uitleg .badge { white-space: normal; }
/* Labels in de lijst houden hun eigen kleur, los van de kleur van de maatgroep */
.tv-inhoud .badge.st-ok { background: var(--ok-licht); color: var(--ok); }
.tv-inhoud .badge.st-bijna { background: var(--bijna-licht); color: var(--bijna); }
.tv-inhoud .badge.st-laat { background: var(--laat-licht); color: var(--laat); }
.tv-inhoud .badge.st-geen { background: var(--vlak); color: var(--zacht); }
.tv-chips { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
@media (max-width: 520px) {
  .tv-item { flex-direction: column; }
  .tv-chips { flex-direction: row; flex-wrap: wrap; }
}

/* Zes tabs passen op een smalle telefoon */
@media (max-width: 420px) { .tabs button { font-size: .68rem; } }
