/* Household Hub — één stylesheet, geen buildstap.
   Kleur per informatiesoort: maaltijd (saffraan), agenda (blauw), afval (groen + kleur per soort),
   boodschappen (pruim), taken (petrol). Donker thema volgt het systeem en de nachtmodus van de keuken. */

:root {
  --bg: #eef1ee;
  --surface: #ffffff;
  --surface-2: #f6f8f6;
  --ink: #1b2420;
  --ink-2: #4c5852;
  --line: #d9dfdb;
  --accent: #1f6f5c;
  --on-accent: #ffffff;
  --meal: #b85f0f;
  --cal: #2f5fd0;
  --waste: #2e8a55;
  --shop: #8445b8;
  --task: #0f7f86;
  --week: #5d6b64;
  --w-rest: #59636b;
  --w-gft: #2e8a55;
  --w-papier: #2d6fc2;
  --w-pmd: #c9651a;
  --on-waste: #ffffff;
  --ok: #2e8a55;
  --warn: #a86d12;
  --bad: #c0392b;
  --tint: 13%;
  --font: "Roboto", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --r: 18px;
  --r-s: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111614; --surface: #1a211e; --surface-2: #202925; --ink: #e8eeea; --ink-2: #a9b5af;
    --line: #2e3833; --accent: #5cc3a6; --on-accent: #0d1512;
    --meal: #f0a15a; --cal: #86a6f5; --waste: #6fcf97; --shop: #c69cf0; --task: #5fc9cf; --week: #a9b5af;
    --w-rest: #a5aeb5; --w-gft: #6fcf97; --w-papier: #7fb0f0; --w-pmd: #f0a15a; --on-waste: #0d1512;
    --ok: #6fcf97; --warn: #e8b55c; --bad: #f08a7e; --tint: 20%;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111614; --surface: #1a211e; --surface-2: #202925; --ink: #e8eeea; --ink-2: #a9b5af;
  --line: #2e3833; --accent: #5cc3a6; --on-accent: #0d1512;
  --meal: #f0a15a; --cal: #86a6f5; --waste: #6fcf97; --shop: #c69cf0; --task: #5fc9cf; --week: #a9b5af;
  --w-rest: #a5aeb5; --w-gft: #6fcf97; --w-papier: #7fb0f0; --w-pmd: #f0a15a; --on-waste: #0d1512;
  --ok: #6fcf97; --warn: #e8b55c; --bad: #f08a7e; --tint: 20%;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 1.2em; height: 1.2em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
h1, h2, h3 { text-wrap: balance; line-height: 1.2; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.spacer { flex: 1; }

/* ---------- App-shell ---------- */
.shell { max-width: 1120px; margin: 0 auto; padding-inline: 16px; padding-block: 12px 110px; }
.topbar { display: flex; align-items: center; gap: 12px; padding-block: 6px 14px; }
.brand { font-weight: 800; font-size: 18px; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.brand-dot { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); display: inline-block; }
.topnav { display: none; gap: 4px; margin-left: 12px; }
.topnav a { text-decoration: none; color: var(--ink-2); padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 15px; }
.topnav a[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.topbar .spacer { flex: 1; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; flex: none; text-decoration: none; color: var(--ink); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; margin: 4px 0 16px; }
.page-head h1 { margin: 0; font-size: 28px; }
.page-head .sub { color: var(--ink-2); width: 100%; order: -1; font-size: 15px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: repeat(5, 1fr); }
.tabbar a { text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 12px; color: var(--ink-2); border-radius: 12px; min-height: 52px; justify-content: center; }
.tabbar a[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); font-weight: 700; }
.tabbar svg.i { width: 22px; height: 22px; }
@media (min-width: 900px) {
  .topnav { display: flex; }
  .tabbar { display: none; }
  .shell { padding-block-end: 40px; }
}

.flash { padding: 12px 16px; border-radius: var(--r-s); margin-bottom: 12px; font-weight: 600; background: color-mix(in srgb, var(--st, var(--ok)) var(--tint), var(--surface)); color: var(--st, var(--ok)); border: 1px solid color-mix(in srgb, var(--st, var(--ok)) 30%, transparent); }
.flash.warning { --st: var(--warn); } .flash.error { --st: var(--bad); }
.banner { padding: 12px 16px; border-radius: var(--r-s); margin-bottom: 12px; background: color-mix(in srgb, var(--warn) var(--tint), var(--surface)); color: var(--ink); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }

/* ---------- Kaarten ---------- */
.card { --c: var(--accent); background: var(--surface); border-radius: var(--r); border: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 11px 16px; background: color-mix(in srgb, var(--c) var(--tint), var(--surface)); color: var(--c); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 13px; text-decoration: none; }
.card-h .count { margin-left: auto; letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--ink-2); }
.card-b { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.meal { --c: var(--meal); } .cal { --c: var(--cal); } .waste { --c: var(--waste); }
.shop { --c: var(--shop); } .task { --c: var(--task); } .week { --c: var(--week); } .neutral { --c: var(--ink-2); }
.grid-cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .grid-cards.three { grid-template-columns: repeat(3, 1fr); } }
.big-title { font-size: 22px; font-weight: 700; line-height: 1.2; }
.label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.empty { color: var(--ink-2); }

/* ---------- Knoppen en formulieren ---------- */
.btn { --c: var(--accent); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 0; cursor: pointer; font-weight: 700; background: var(--c); color: var(--on-accent); text-decoration: none; }
.btn.ghost { background: color-mix(in srgb, var(--c) var(--tint), var(--surface)); color: var(--c); }
.btn.line { background: var(--surface); color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.btn.danger { --c: var(--bad); }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.lg { min-height: 56px; font-size: 18px; border-radius: 14px; }
.btn[disabled] { opacity: .5; cursor: default; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 600; text-decoration: underline; }
form.inline { display: inline; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label-text { font-weight: 600; font-size: 15px; }
.field .hint { font-size: 13px; color: var(--ink-2); }
.field .err { font-size: 14px; color: var(--bad); font-weight: 600; }
input[type=text], input[type=password], input[type=url], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 10px 14px; color: var(--ink);
}
textarea { min-height: 140px; line-height: 1.5; resize: vertical; }
.check-field { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check-field input { width: 22px; height: 22px; accent-color: var(--accent); }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Lijsten ---------- */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.list-row:first-child { border-top: 0; }
.list-row .main { flex: 1; min-width: 0; }
.list-row .title { font-weight: 600; overflow-wrap: anywhere; }
.list-row a.title { color: var(--ink); text-decoration: none; }
.star { color: var(--meal); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: color-mix(in srgb, var(--st, var(--ink-2)) var(--tint), var(--surface)); color: var(--st, var(--ink-2)); }
.pill.dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.ok { --st: var(--ok); } .pill.warn { --st: var(--warn); } .pill.bad { --st: var(--bad); }
table.simple { width: 100%; border-collapse: collapse; }
table.simple th, table.simple td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: top; }
table.simple th { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); border-top: 0; }
.table-wrap { overflow-x: auto; }

/* ---------- Afvinken ---------- */
.check { --c: var(--accent); display: flex; align-items: center; gap: 12px; min-height: 48px; width: 100%; text-align: left; background: none; border: 0; padding: 4px 0; cursor: pointer; }
.box { width: 28px; height: 28px; border-radius: 8px; border: 2.5px solid var(--c); flex: none; display: grid; place-items: center; }
.box svg { opacity: 0; width: 18px; height: 18px; stroke: var(--on-accent); stroke-width: 3.2; fill: none; }
.check[aria-checked="true"] .box { background: var(--c); }
.check[aria-checked="true"] .box svg { opacity: 1; }
.check[aria-checked="true"] .lbl { text-decoration: line-through; color: var(--ink-2); }
.check .lbl { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.check .qty { color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.check .src { display: block; font-size: 13px; color: var(--ink-2); text-decoration: none; }
.cat-h { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); margin-top: 10px; }
.due { font-size: 13px; font-weight: 700; color: var(--bad); white-space: nowrap; }
.due.today { color: var(--warn); }

/* ---------- Afval ---------- */
.bin { --wc: var(--w-rest); display: flex; align-items: center; gap: 10px; }
.bin-dot { width: 16px; height: 16px; border-radius: 5px; background: var(--wc); flex: none; }
.w-rest { --wc: var(--w-rest); } .w-gft { --wc: var(--w-gft); } .w-papier { --wc: var(--w-papier); } .w-pmd { --wc: var(--w-pmd); }
.bin .d { min-width: 6.6em; font-weight: 600; }
.waste-hero { --wc: var(--w-rest); border-radius: var(--r-s); padding: 14px 16px; background: var(--wc); color: var(--on-waste); display: flex; flex-direction: column; gap: 4px; }
.waste-hero .when { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .92; }
.waste-hero .what { font-size: 26px; font-weight: 800; line-height: 1.1; }
.waste-hero .btn { margin-top: 8px; background: var(--surface); color: var(--ink); }
.waste-hero.done .btn { background: transparent; color: inherit; border: 2px solid currentColor; }
.waste-soft { --wc: var(--w-rest); border-radius: var(--r-s); padding: 12px 14px; border: 2px solid var(--wc); display: flex; flex-direction: column; gap: 2px; }
.waste-soft .what { font-size: 20px; font-weight: 800; }

/* ---------- Weekmenu ---------- */
.week-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.week-nav .lbl { flex: 1; text-align: center; font-weight: 700; font-size: 18px; }
.days { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .days { grid-template-columns: 1fr 1fr; } }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: border-color .15s, box-shadow .15s, opacity .15s; }
.day.is-today { border-color: var(--meal); }
.day-h { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--line); }
.day-h .n { font-weight: 700; font-size: 17px; }
.day-h .dt { color: var(--ink-2); font-size: 15px; }
.badge { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--meal); background: color-mix(in srgb, var(--meal) var(--tint), var(--surface)); padding: 3px 8px; border-radius: 999px; }
.swap-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 0 12px; min-height: 40px; cursor: pointer; font-size: 14px; font-weight: 600; margin-left: auto; }
.slot { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; min-height: 56px; }
.slot + .slot { border-top: 1px dashed var(--line); }
.slot .mt { width: 6.4em; flex: none; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); font-weight: 700; }
.slot a.ttl { flex: 1; min-width: 0; font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.slot .ttl .sub { display: block; font-weight: 400; font-size: 13px; color: var(--ink-2); }
.slot .none { flex: 1; color: var(--ink-2); }
.add { width: 40px; height: 40px; border-radius: 10px; border: 1.5px dashed var(--line); background: none; color: var(--ink-2); display: inline-grid; place-items: center; flex: none; text-decoration: none; }
.tag { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--cal); }
.swapping .day { opacity: .55; }
.swapping .day.src { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.swapping .day.target { opacity: 1; cursor: pointer; }
.swapping .day.target .swap-btn { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.day.drop-over { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 10px 10px 18px; border-radius: 14px; display: flex; align-items: center; gap: 14px; z-index: 40; max-width: calc(100% - 32px); }
.toast button { background: none; border: 0; color: var(--bg); font-weight: 800; padding: 8px 10px; cursor: pointer; text-decoration: underline; }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* ---------- Kookmodus ---------- */
.cook { max-width: 1100px; margin: 0 auto; padding-inline: 16px; padding-block: 16px 32px; display: flex; flex-direction: column; gap: 16px; font-size: 20px; --c: var(--meal); }
.cook-h { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.cook-h h1 { margin: 0; font-size: 32px; flex: 1 1 280px; }
.serv { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 4px; }
.serv button { width: 52px; height: 52px; border-radius: 12px; border: 0; background: var(--surface-2); font-size: 26px; cursor: pointer; }
.serv span { min-width: 5.5em; text-align: center; font-weight: 700; }
.cook-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .cook-grid { grid-template-columns: 0.85fr 1.15fr; } }
.cook .card-h { font-size: 15px; }
.cook .check { --c: var(--meal); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; max-width: 62ch; }
.steps li::before { content: counter(s); width: 44px; height: 44px; border-radius: 50%; background: color-mix(in srgb, var(--meal) var(--tint), var(--surface)); color: var(--meal); display: grid; place-items: center; font-weight: 800; }
.wake { font-size: 15px; display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }

/* ---------- Keuken ---------- */
.kitchen { padding-inline: 16px; padding-block: 14px 20px; display: flex; flex-direction: column; gap: 14px; font-size: 20px; min-height: 100vh; }
.k-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.k-date { font-size: 30px; font-weight: 700; }
.k-date small { display: block; font-size: 17px; font-weight: 500; color: var(--ink-2); }
.k-clock { font-size: 56px; font-weight: 300; line-height: 1; margin-left: auto; }
.kitchen .pill { font-size: 16px; padding: 8px 14px; }
.k-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .k-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .k-grid { grid-template-columns: 1.1fr 1fr 0.9fr; } }
.kitchen .card-h { font-size: 15px; padding: 12px 18px; }
.kitchen .card-b { padding: 14px 18px 18px; gap: 10px; }
.k-meal-title { font-size: 30px; font-weight: 700; line-height: 1.15; }
.ev { display: grid; grid-template-columns: 5.4em 1fr; gap: 2px 12px; align-items: baseline; }
.ev .t { font-weight: 700; }
.kitchen .waste-hero .what { font-size: 32px; }
.kitchen .waste-hero .when { font-size: 16px; }
.kitchen .check .box { width: 30px; height: 30px; }
.wk { display: grid; grid-template-columns: 2.4em 1fr; gap: 6px 10px; align-items: baseline; }
.wk .d { font-weight: 700; color: var(--ink-2); }
.wk .today { color: var(--meal); font-weight: 700; }
.k-offline { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-s); background: color-mix(in srgb, var(--warn) var(--tint), var(--surface)); color: var(--ink); font-weight: 600; font-size: 16px; }
/* Tablet liggend: alles op één scherm, kaarten scrollen zo nodig zelf */
@media (min-width: 1000px) and (min-height: 640px) {
  .kitchen { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .k-grid { flex: 1; min-height: 0; grid-template-rows: repeat(2, minmax(0, 1fr)); }
  .k-grid > .card { min-height: 0; }
  .k-grid .card-b { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .kitchen.night .k-grid { grid-template-rows: minmax(0, 1fr); }
}
.kitchen.night .k-grid > :not(.keep-night) { display: none; }
@media (min-width: 1000px) { .kitchen.night .k-grid { grid-template-columns: 1fr 1fr; } }
.k-footer { font-size: 13px; color: var(--ink-2); display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- Installer / login ---------- */
.narrow { max-width: 560px; margin: 0 auto; padding-inline: 16px; padding-block: 32px; display: flex; flex-direction: column; gap: 16px; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; }
.check-row .st { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--on-accent); background: var(--ok); }
.check-row.warn .st { background: var(--warn); } .check-row.bad .st { background: var(--bad); }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; overflow-x: auto; white-space: pre; }
.pair-code { font-size: 40px; font-weight: 800; letter-spacing: .12em; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
