:root {
  --primary: #1f3a5f;
  --accent: #3fa38a;
  --accent-soft: #eef7f4;
  --accent-tint: #f4faf7;
  --bg: #f6f8f7;
  --card: #ffffff;
  --text: #22303f;
  --muted: #5b6875;   /* 5,3:1 op wit — lichter haalt de norm van 4,5:1 niet */
  --line: #e5e9e7;
  --danger: #c0392b;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(31, 58, 95, 0.08), 0 4px 14px rgba(31, 58, 95, 0.05);
  --font: 'Nunito', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.45; }
button { font-family: inherit; font-size: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  background: var(--primary); color: #fff;
  padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top));
}
.topbar h1 { flex: 1; font-size: 19px; font-weight: 800; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff;
}
.icon-btn:active { background: rgba(255, 255, 255, 0.15); }

.view { max-width: 1080px; margin: 0 auto; padding: 14px 14px 60px; }

/* ---------- Weekbalk ---------- */
.week-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.week-bar span { flex: 1; text-align: center; font-weight: 800; color: var(--primary); }
.week-bar button { height: 40px; min-width: 44px; }

/* ---------- Dagen ---------- */
.dag {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 10px 14px; margin-bottom: 8px;
}
.dag.vandaag { border: 2px solid var(--accent); }
.dag-kop {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 800; color: var(--primary); font-size: 14.5px; text-transform: capitalize;
}
.dag-add {
  width: 34px; height: 34px; margin: -4px -6px -4px 0; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 21px; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.dag-add:active { transform: scale(0.94); }
.dag-leeg { color: #93a0ac; font-weight: 800; padding: 4px 0; }

.bord-item { display: flex; align-items: center; gap: 8px; padding: 7px 0 3px; }
.bi-icoon { flex: none; font-size: 16px; width: 22px; text-align: center; }
.bi-tekst { flex: 1; min-width: 0; font-weight: 700; }
.bi-wie { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); }
/* Een afvinkbaar item toont een vinkje in plaats van een icoon; zonder dit
   zagen een klusje en iets van verzorging er precies hetzelfde uit. */
.bi-mini { font-size: 13px; margin-right: 5px; }
.bi-meer { flex: none; width: 36px; min-height: 36px; color: var(--muted); font-size: 18px; }
.bord-item .tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px;
  background: var(--accent-soft); color: var(--primary); font-size: 11.5px; font-weight: 800;
}

/* Afval krijgt de kleur van de bak, niet van onze huisstijl — je herkent hem
   sneller aan de kleur dan aan de tekst. */
.soort-afval .bi-icoon {
  border-radius: 8px; background: color-mix(in srgb, var(--bak, var(--muted)) 16%, white);
}
.soort-afval .bi-tekst { color: var(--bak, var(--text)); }

/* Een maaltijd die geen recept is (uit eten, restjes) mag rustiger. */
.soort-maaltijd .bi-tekst { color: var(--primary); }

.vink {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--accent); background: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 800;
}
.bord-item.klaar .vink { background: var(--accent); }
.bord-item.klaar .bi-tekst { text-decoration: line-through; color: var(--muted); }

/* ---------- Panelen en knoppen ---------- */
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 10px; }
.panel h3 {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.h3-link { color: var(--accent); font-weight: 800; font-size: 12.5px; text-transform: none; letter-spacing: 0; }
.hint { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.fout { color: var(--danger); font-weight: 700; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-primary, .btn-plain, .btn-danger {
  height: 46px; padding: 0 16px; border-radius: 12px; font-weight: 800; font-size: 15px;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-plain { background: var(--accent-soft); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }

.regel-rij { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.regel-rij:last-child { border-bottom: none; }
.regel-rij.uit { opacity: 0.5; }

/* ---------- Overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(31, 58, 95, 0.45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.overlay-card {
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow);
  padding: 24px; width: 100%; max-width: 420px; max-height: 86vh; overflow-y: auto;
}
.overlay-card h1, .overlay-card h2 { font-size: 20px; font-weight: 800; color: var(--primary); margin-bottom: 6px; }
.overlay-card p { color: var(--muted); font-weight: 600; font-size: 14.5px; }
.overlay-card input[type="text"], .overlay-card input[type="search"],
.overlay-card input[type="number"], .overlay-card input[type="date"], .overlay-card input[type="password"] {
  width: 100%; height: 46px; padding: 0 12px; margin-top: 4px;
  border: 1.5px solid var(--line); border-radius: 12px; outline: none; background: var(--card);
}
.overlay-card input:focus { border-color: var(--accent); }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; justify-content: flex-end; }
.pin-error { color: var(--danger) !important; font-weight: 700 !important; margin-top: 10px; }

.kop {
  font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin: 16px 0 8px;
}
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tab {
  flex: 1 1 auto; min-width: 92px; height: 42px; border-radius: 12px; background: var(--bg);
  color: var(--muted); font-weight: 800; font-size: 14px;
}
/* Vier tabbladen passen niet op één rij op een telefoon. Ze laten omvallen
   hangt dan van de breedte af: op 375 px werd het netjes 2+2, op 393 px viel
   "Verzorging" alleen op een rij. Een vast raster is voorspelbaar. */
.tabs-2kol { display: grid; grid-template-columns: 1fr 1fr; }
.tabs-2kol .tab { min-width: 0; }
.tab.actief { background: var(--primary); color: #fff; }

.snelrij { display: flex; flex-wrap: wrap; gap: 8px; }
.snelknop {
  flex: 1 1 calc(50% - 4px); min-height: 46px; padding: 8px 10px;
  border-radius: 12px; background: var(--accent-soft); color: var(--primary);
  font-weight: 800; font-size: 14px; text-align: left; line-height: 1.25;
  border: 1.5px solid transparent;
}
.snelknop:hover, .snelknop:active { border-color: var(--accent); }
.snelknop.actief { border-color: var(--accent); background: var(--accent); color: #fff; }
#rg-dag .snelknop { flex: 0 0 calc(25% - 6px); text-align: center; text-transform: capitalize; }

.menu-list { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.menu-list button {
  min-height: 48px; text-align: left; padding: 10px 12px; border-radius: 10px;
  font-weight: 700; font-size: 15.5px; color: var(--primary); line-height: 1.3;
}
.menu-list button:hover, .menu-list button:active { background: var(--accent-tint); }
.menu-list button.danger { color: var(--danger); }
.menu-list button[disabled] { opacity: 0.4; }
.meer { color: var(--muted); font-size: 13px; font-weight: 700; padding: 8px 12px; }

.vrij-rij { display: flex; gap: 8px; margin-top: 12px; }
.vrij-rij input { flex: 1; min-width: 0; }
.vrij-rij .btn-primary { flex: none; }

.lijst-keuze {
  width: 100%; height: 46px; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 0 12px; margin: 10px 0 4px; background: var(--card);
}
.pick-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.pick-row:last-of-type { border-bottom: none; }
.pick-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.pick-row .pick-text { flex: 1; min-width: 0; }
.pick-row .pick-note { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.warn {
  background: #fdf1dc; color: #8a5a1c; border-radius: 12px;
  padding: 10px 12px; font-size: 13.5px; font-weight: 700; margin: 10px 0;
}

/* ---------- Snackbar ---------- */
.snackbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 60;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 14.5px;
  padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow);
  max-width: calc(100vw - 32px);
}
