/* Gedeelde, minimale basisstijl - elke pagina laadt dit ene bestand. */
:root {
  --blauw: #1d4ed8;
  --rood: #dc2626;
  --grijs: #64748b;
  --rand: #d9dee6;
  --achtergrond: #f4f6f9;
  /* Huisstijl, overgenomen van de bestaande (live) app */
  --topbar-blauw: #1e88e5;
  --topbar-groen: #43a047;
  --tegel-rood: #e53935;
  --tegel-paars: #8e24aa;
  --tegel-oranje: #fb8c00;
  --tegel-groen: #43a047;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--achtergrond);
  color: #1a2233;
}
header.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--topbar-blauw);
  border-bottom: 4px solid var(--topbar-groen);
}
header.topbar .logo-icoon {
  display: flex;
  flex-shrink: 0;
}
header.topbar .logo {
  font-weight: 700;
  font-size: 17px;
  color: #14213d;
}
header.topbar .gebruiker-info {
  margin-left: auto;
  font-size: 13px;
  color: #fff;
}
header.topbar .topbar-terug {
  margin-left: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  opacity: 0.9;
}
header.topbar .topbar-terug:hover { opacity: 1; text-decoration: underline; }
header.topbar button.klein.secundair {
  background: #fff;
  color: #1a2233;
  border: none;
}
main {
  max-width: 480px;
  margin: 40px auto;
  padding: 0 16px;
}
.kaart {
  background: #fff;
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 24px;
}
h1 { font-size: 20px; margin: 0 0 16px; }
label { display: block; font-size: 13px; color: var(--grijs); margin: 12px 0 4px; }
input[type="text"], input[type="password"], input[type="tel"], input[type="time"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--rand);
  border-radius: 8px;
  font-size: 16px;
}
button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 13px 18px;
  font-size: 16px;
  font-weight: 600;
  background: var(--blauw);
  color: #fff;
  min-height: 44px;
}
button.secundair {
  background: #fff;
  color: var(--blauw);
  border: 1px solid var(--blauw);
}
button.klein { padding: 9px 14px; font-size: 14px; min-height: 38px; }
button:disabled { opacity: 0.6; cursor: default; }
.knoprij { margin-top: 20px; display: flex; gap: 10px; }
.fout {
  background: #fef2f2;
  color: var(--rood);
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  margin-top: 12px;
  display: none;
}
.fout.zichtbaar { display: block; }
.tegel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
@media (max-width: 640px) {
  .tegel-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .tegel { padding: 16px 8px; min-height: 90px; font-size: 13px; }
}
.tegel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--grijs);
  border: none;
  border-radius: 12px;
  padding: 24px 14px;
  min-height: 110px;
  min-width: 0;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}
.tegel .tegel-icoon { font-size: 34px; line-height: 1; }
.tegel.rood { background: var(--tegel-rood); }
.tegel.paars { background: var(--tegel-paars); }
.tegel.oranje { background: var(--tegel-oranje); }
.tegel.groen { background: var(--tegel-groen); }
.tegel { position: relative; }
.tegel-badge {
  position: absolute; top: -8px; right: -8px;
  background: var(--tegel-rood); color: #fff;
  border-radius: 999px; min-width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; padding: 0 5px;
  border: 2px solid #fff;
}
.status-chip.wachtend { background: #dbeafe; color: #1d4ed8; }
.status-chip.te-laat { background: #fee2e2; color: #b91c1c; }

/* ---------- Patiëntenregistratie ---------- */
.main-breed { max-width: 720px; }
.main-vol { max-width: 1400px; }
textarea, select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--rand);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  min-height: 44px;
}
label { font-size: 14px; }
.veld-rij { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .veld-rij { grid-template-columns: 1fr; } }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tabs button { background: #fff; color: var(--blauw); border: 1px solid var(--rand); }
.tabs button.actief-tab { background: var(--blauw); color: #fff; border-color: var(--blauw); }
.patient-lijst { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.patient-rij {
  background: #fff;
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
}
.patient-rij-boven { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.patient-naam { font-weight: 600; }
.patient-meta { font-size: 13px; color: var(--grijs); margin-top: 2px; }
.status-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #e2e8f0;
  color: #334155;
  white-space: nowrap;
}
.status-chip.actief { background: #dbeafe; color: #1d4ed8; }
.status-chip.uitslaapzone { background: #ede9fe; color: #6d28d9; }
.status-chip.ziekenwagen { background: #fee2e2; color: #b91c1c; }
.status-chip.arts { background: #fef3c7; color: #92400e; }
.status-chip.doorverwezen { background: #ffedd5; color: #c2410c; }
.status-chip.afgerond { background: #dcfce7; color: #15803d; }
.detail-paneel { margin-top: 12px; border-top: 1px solid var(--rand); padding-top: 12px; }
.behandeling-item { font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--rand); }
.behandeling-item:last-child { border-bottom: none; }
.status-knoppen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.status-knoppen button { font-size: 12px; padding: 6px 10px; }
.gevaar { background: var(--rood); }

/* ---------- Behandeling-kiezen popup ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 100;
}
.modal-doos {
  background: #fff; border-radius: 14px; padding: 24px;
  max-width: 640px; width: 100%; max-height: 85vh; overflow-y: auto;
}
.modal-doos h2 { margin: 0 0 16px; font-size: 20px; }
.checklist-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px 20px;
}
@media (max-width: 600px) { .checklist-grid { grid-template-columns: 1fr; } }
.checklist-grid label {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 500; color: #1a2233;
  padding: 7px 6px; margin: 1px 0; cursor: pointer;
  border-radius: 8px;
}
.checklist-grid label:active { background: var(--achtergrond); }
.checklist-grid input[type="checkbox"] {
  width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--blauw); cursor: pointer;
}

/* ---------- Sub-secties in het detailpaneel ---------- */
.subsectie { margin-top: 14px; }
.subsectie-kop { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.subsectie-kop strong { font-size: 13px; }
.subsectie-leeg { color: var(--grijs); font-size: 13px; margin: 4px 0; }
.parameter-item, .abcde-item { font-size: 13px; padding: 4px 0; border-bottom: 1px dashed var(--rand); }
.parameter-item:last-child, .abcde-item:last-child { border-bottom: none; }
.abcde-grid { display: grid; grid-template-columns: 24px 1fr; gap: 6px 10px; align-items: center; margin-top: 8px; }
.abcde-grid label { font-weight: 700; }

.triage-badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: #fff;
}
.triage-badge.rood { background: #dc2626; }
.triage-badge.geel { background: #ca8a04; }
.triage-badge.groen { background: #16a34a; }
.triage-badge.blauw { background: #2563eb; }
