:root {
  --blauw: #2563eb;
  --blauw-licht: #eff4ff;
  --groen: #2e7d32;
  --groen-licht: #e6f4e7;
  --rood: #c00000;
  --grijs: #595959;
  --rand: #e2e6ea;
  --achtergrond: #f4f6f8;
  --wit: #ffffff;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--achtergrond);
  color: #1a1a1a;
  min-height: 100dvh;
}

.hidden { display: none !important; }
.muted { color: var(--grijs); font-size: 0.85rem; }

.demo-banner {
  background: #fff3cd;
  color: #7a5c00;
  text-align: center;
  font-size: 0.78rem;
  padding: 6px 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}

/* ---------- login ---------- */
.login-wrap {
  max-width: 420px;
  margin: 0 auto;
  padding: 48px 20px calc(40px + env(safe-area-inset-bottom));
  text-align: center;
}
.login-logo { font-size: 3rem; margin-bottom: 8px; }
.login-wrap h1 { font-size: 1.6rem; color: var(--blauw); margin-bottom: 4px; }
.login-personen { margin-top: 28px; display: grid; gap: 10px; }
.persoon-knop {
  display: flex; align-items: center; gap: 12px;
  background: var(--wit); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 14px 16px; font-size: 1rem; cursor: pointer; width: 100%;
}
.persoon-knop:active { background: var(--blauw-licht); }
.persoon-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--blauw); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.persoon-rol { margin-left: auto; font-size: 0.75rem; color: var(--grijs); text-transform: capitalize; }

.login-pin { margin-top: 28px; }
.pin-naam { font-weight: 700; font-size: 1.1rem; margin-bottom: 14px; }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin-bottom: 20px; }
.pin-dots span {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--blauw); display: inline-block;
}
.pin-dots span.vol { background: var(--blauw); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 260px; margin: 0 auto 16px; }
.pin-pad button {
  font-size: 1.4rem; padding: 14px 0; border-radius: var(--radius);
  border: 1px solid var(--rand); background: var(--wit); cursor: pointer;
}
.pin-pad button:disabled { opacity: 0; pointer-events: none; }
.pin-pad button:active { background: var(--blauw-licht); }
.pin-fout { color: var(--rood); font-weight: 600; margin-top: 8px; }
.btn-link { background: none; border: none; color: var(--blauw); font-size: 0.9rem; cursor: pointer; }

/* ---------- app-schil ---------- */
.app-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 16px 10px;
  max-width: 640px; margin: 0 auto; width: 100%;
}
.app-header h1 { font-size: 1.35rem; color: var(--blauw); }
.user-chip {
  background: var(--wit); border: 1px solid var(--rand); border-radius: 999px;
  padding: 8px 14px; font-size: 0.85rem; cursor: pointer; color: var(--grijs);
}

main {
  max-width: 640px; margin: 0 auto; width: 100%;
  padding: 4px 12px calc(84px + env(safe-area-inset-bottom));
}
.laadtekst { text-align: center; padding: 32px 0; }

/* ---------- secties & taken ---------- */
.sectie {
  background: var(--wit); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 14px; margin-bottom: 14px;
}
.sectie-kop { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.sectie-kop h2 { font-size: 1.05rem; color: var(--blauw); }
.sectie-score {
  background: var(--blauw-licht); color: var(--blauw);
  font-weight: 700; font-size: 0.85rem; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.sectie-score.klaar { background: var(--groen-licht); color: var(--groen); }
.voortgang { height: 6px; background: var(--rand); border-radius: 3px; margin: 10px 0 4px; overflow: hidden; }
.voortgang-balk { height: 100%; background: var(--groen); border-radius: 3px; transition: width 0.3s; }

.zone-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--grijs); margin: 14px 2px 6px;
}
.zone-label.rood { color: var(--rood); }

.taak {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--wit); border: 1px solid var(--rand); border-radius: 12px;
  padding: 12px; margin-bottom: 8px; cursor: pointer; font-size: 0.95rem;
}
.taak:active { background: var(--achtergrond); }
.taak-check {
  width: 26px; height: 26px; min-width: 26px; border-radius: 50%;
  border: 2px solid var(--rand); display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; color: #fff;
}
.taak.gedaan { background: var(--groen-licht); border-color: #cde8cf; }
.taak.gedaan .taak-check { background: var(--groen); border-color: var(--groen); }
.taak-tekst { flex: 1; }
.taak-tekst small { display: block; color: var(--grijs); font-size: 0.75rem; margin-top: 2px; }
.taak-actie {
  background: var(--blauw); color: #fff; font-size: 0.78rem; font-weight: 600;
  padding: 7px 11px; border-radius: 999px; white-space: nowrap;
}
.taak-foto-badge { font-size: 1rem; }

/* ---------- acties ---------- */
.actie {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--rand); border-radius: 12px; padding: 12px; margin-bottom: 8px;
}
.actie.gedaan { background: var(--groen-licht); border-color: #cde8cf; }
.actie.inactief { opacity: 0.5; }
.actie-info { flex: 1; }
.actie-info p { font-size: 0.95rem; }
.actie-info small { color: var(--grijs); font-size: 0.78rem; }
.badge { border-radius: 999px; padding: 2px 8px; font-size: 0.72rem; font-weight: 700; }
.badge.besteld { background: #fff3cd; color: #7a5c00; }
.badge.klaar { background: var(--groen-licht); color: var(--groen); }

/* ---------- controle ---------- */
.controle-datum {
  display: flex; align-items: center; gap: 12px;
  background: var(--wit); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 14px;
}
.controle-datum label { font-size: 0.85rem; font-weight: 600; color: var(--grijs); }
.controle-datum input {
  flex: 1; border: 1px solid var(--rand); border-radius: 8px; padding: 8px 10px; font-size: 0.95rem;
}
.controle-open { font-size: 0.9rem; color: var(--rood); padding: 5px 2px; }
.controle-open small { color: var(--grijs); }
.galerij { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.galerij-item {
  border: 1px solid var(--rand); border-radius: 10px; overflow: hidden;
  background: var(--wit); cursor: pointer; text-align: left; padding: 0;
}
.galerij-item img { width: 100%; height: 96px; object-fit: cover; display: block; }
.galerij-item .geen-foto { display: flex; height: 96px; align-items: center; justify-content: center; color: var(--grijs); }
.galerij-item small { display: block; padding: 6px 8px; font-size: 0.7rem; color: var(--grijs); }

/* ---------- beheer ---------- */
.formulier { display: grid; gap: 8px; }
.formulier input, .formulier select {
  border: 1px solid var(--rand); border-radius: 10px; padding: 12px; font-size: 0.95rem; background: var(--wit);
}
.checkregel { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--grijs); }
.checkregel input { width: auto; }

/* ---------- focus-blok bovenaan de checklist ---------- */
.focus-banner {
  background: var(--blauw-licht); border-left: 4px solid #38bdf8;
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px;
  display: flex; flex-direction: column; gap: 3px;
}
.focus-eyebrow {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--grijs); font-weight: 700;
}
.focus-banner strong { font-size: 1rem; color: var(--blauw); }
.focus-banner small { color: var(--grijs); font-size: 0.82rem; }
.rest-scheiding {
  text-align: center; color: var(--grijs); font-size: 0.78rem;
  margin: 20px 0 10px; text-transform: uppercase; letter-spacing: 0.05em;
}

/* ---------- knoppen ---------- */
.btn {
  border: none; border-radius: 12px; padding: 13px 16px;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
}
.btn.klein { padding: 9px 12px; font-size: 0.8rem; border-radius: 999px; white-space: nowrap; }
.btn.primair { background: var(--blauw); color: #fff; }
.btn.secundair { background: var(--achtergrond); color: #1a1a1a; border: 1px solid var(--rand); }
.btn.gevaar { background: #fdecea; color: var(--rood); }
.btn:disabled { opacity: 0.6; }

/* ---------- tabbar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: space-around;
  background: var(--wit); border-top: 1px solid var(--rand);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tab {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 0.7rem; color: var(--grijs); padding: 6px 14px; border-radius: 10px;
}
.tab-icoon { font-size: 1.25rem; }
.tab.actief { color: var(--blauw); font-weight: 700; background: var(--blauw-licht); }

/* ---------- afgekeurd ---------- */
.taak.afgekeurd { background: #fdecea; border-color: #f5c6c0; }
.taak.afgekeurd .taak-check { background: var(--rood); border-color: var(--rood); font-size: 0.8rem; }
.taak.afgekeurd .taak-tekst small { color: var(--rood); }
.taak-actie.rood { background: var(--rood); }

/* ---------- subnav (controle) ---------- */
.subnav {
  display: flex; gap: 6px; background: var(--wit);
  border: 1px solid var(--rand); border-radius: 999px; padding: 4px; margin-bottom: 12px;
}
.subnav button {
  flex: 1; border: none; background: none; padding: 9px 0; border-radius: 999px;
  font-size: 0.9rem; font-weight: 600; color: var(--grijs); cursor: pointer;
}
.subnav button.actief { background: var(--blauw); color: #fff; }

/* ---------- rapport ---------- */
.knoppenrij { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.rapport-dag { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.rapport-dag .voortgang { flex: 1; margin: 0; }
.rapport-dag-label { width: 84px; font-size: 0.82rem; color: var(--grijs); }
.rapport-dag-score { width: 52px; text-align: right; font-size: 0.85rem; font-weight: 700; }
.rapport-dag-score.groen { color: var(--groen); }
.roodtekst { color: var(--rood); }
.voortgang-balk.matig { background: #e6a817; }
.voortgang-balk.slecht { background: var(--rood); }
.rapport-tabel { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.rapport-tabel th, .rapport-tabel td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--rand); }
.rapport-tabel th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--grijs); }
.controle-gedaan { font-size: 0.9rem; color: var(--groen); padding: 5px 2px; }
.controle-gedaan small { color: var(--grijs); }
.breed { width: 100%; margin-bottom: 10px; }
.alleen-print { display: none; }

/* ---------- temperaturen ---------- */
.temp-waarde {
  min-width: 52px; text-align: center; font-weight: 800; font-size: 1.05rem;
  padding: 6px 4px; border-radius: 10px; background: var(--achtergrond);
}
.temp-waarde.groen { color: var(--groen); background: var(--groen-licht); }
.temp-waarde.rood { color: var(--rood); background: #fdecea; }
.temp-waarde.leeg { color: var(--grijs); }
.taak.temp-afwijking { background: #fff7f6; border-color: #f5c6c0; }
.temp-input {
  width: 100%; border: 1px solid var(--rand); border-radius: 12px;
  padding: 14px; font-size: 1.5rem; text-align: center; font-weight: 700; margin: 12px 0;
}
.temp-waarschuwing { color: var(--rood); font-weight: 700; font-size: 0.9rem; margin-bottom: 6px; }
.temp-tabel { margin-top: 8px; }
.temp-tabel .temp-cel { text-align: center; font-weight: 700; }
.temp-tabel .temp-cel.leeg { color: var(--grijs); font-weight: 400; }

/* ---------- print (FAVV-rapport) ---------- */
@media print {
  body { background: #fff; }
  .demo-banner, .app-header, .tabbar, .subnav, .controle-datum, .knoppenrij, .niet-printen { display: none !important; }
  main { max-width: none; padding: 0; }
  .alleen-print { display: block; margin-bottom: 16px; }
  .alleen-print h2 { color: #000; font-size: 1.3rem; }
  .sectie { border: 1px solid #ccc; break-inside: avoid; }
}

/* ---------- sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 60;
}
.sheet {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 61;
  background: var(--wit); border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  max-width: 640px; margin: 0 auto;
  max-height: 86dvh; overflow-y: auto;
}
.sheet h3 { color: var(--blauw); font-size: 1.1rem; margin-bottom: 4px; }
.sheet-foto {
  width: 100%; border-radius: 12px; margin: 12px 0; max-height: 45dvh; object-fit: contain; background: #000;
}
.sheet textarea {
  width: 100%; border: 1px solid var(--rand); border-radius: 10px;
  padding: 10px; font-size: 0.9rem; font-family: inherit; min-height: 60px; margin-bottom: 12px;
}
.sheet-knoppen { display: flex; gap: 8px; }
.sheet-knoppen .btn { flex: 1; }
.opmerking { font-style: italic; color: var(--grijs); margin: 6px 0; }
