:root {
  --head-h: 62px;
  --bg: #FBF7F2;
  --card: #FFFFFF;
  --ink: #23211F;
  --muted: #7A746C;
  --line: #ECE5DB;
  --accent: #E0673A;
  --accent-soft: #FCE9E0;
  --radius: 16px;
  --hour: 48px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

#app { display: flex; min-height: 100%; }
main { flex: 1; min-width: 0; padding: 16px 16px calc(var(--nav-h) + var(--safe-b) + 24px); max-width: 1400px; margin: 0 auto; width: 100%; }

/* Navigatie: onderbalk op gsm, zijbalk op tablet/desktop */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + var(--safe-b)); }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted);
  font-size: 11px; padding: 4px 6px; border-radius: 12px; min-width: 56px; }
.nav a .ico { font-size: 20px; line-height: 1; }
.nav a.active { color: var(--accent); background: var(--accent-soft); }
.nav .brand, .nav .only-wide { display: none; }

@media (min-width: 768px) {
  .nav { position: sticky; top: 0; height: 100vh; flex-direction: column; justify-content: flex-start; gap: 4px;
    width: 210px; border-top: 0; border-right: 1px solid var(--line); padding: 20px 12px; }
  .nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; padding: 0 10px 18px; }
  .nav .only-wide { display: flex; }
  .nav a { flex-direction: row; gap: 12px; font-size: 15px; padding: 10px 12px; }
  main { padding: 24px 28px 40px; }
}
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(#3B6FD8 0 20%, #D9467A 0 40%, #2E9E6A 0 60%, #8A5CD6 0 80%, #F08A24 0); }

h1 { font-size: 26px; margin: 4px 0 14px; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 10px; }
.sub { color: var(--muted); font-size: 14px; margin: -8px 0 14px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }

.btn { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; font-size: 14px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; }
.icon-btn { border: 0; background: transparent; font-size: 18px; padding: 6px; border-radius: 10px; color: var(--muted); }

.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 5px 11px 5px 7px; font-size: 13px; user-select: none; }
.chip .dot, .dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.chip.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, white); font-weight: 600; }
.chip.off { opacity: .45; }

input[type=text], input[type=date], input[type=time], input[type=email], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; font-size: 16px; }
label.f { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.add-row { display: flex; gap: 8px; margin-bottom: 10px; }
.add-row input { flex: 1; }

/* Agenda */
.week-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.week-head h1 { margin: 0; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 230px); position: relative; }
.cal { display: grid; grid-template-columns: 44px repeat(7, minmax(118px, 1fr)); min-width: calc(44px + 7 * 118px); }
.cal .corner, .cal .dayhead { position: sticky; top: 0; z-index: 4; background: var(--card); border-bottom: 1px solid var(--line); }
.cal .corner { left: 0; z-index: 5; }
.dayhead { padding: 8px 6px; text-align: center; font-size: 13px; border-left: 1px solid var(--line); height: var(--head-h); }
.dayhead b { display: block; font-size: 18px; }
.dayhead.today b { color: #fff; background: var(--accent); border-radius: 999px; width: 32px; height: 32px; line-height: 32px; margin: 2px auto 0; }
.allday { position: sticky; top: var(--head-h); z-index: 4; background: var(--card); border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 3px; min-height: 8px; display: flex; flex-direction: column; gap: 3px; box-shadow: 0 2px 0 var(--line); }
.allday-label { position: sticky; left: 0; top: var(--head-h); background: var(--card); z-index: 5; font-size: 10px; color: var(--muted); padding: 6px 4px; border-bottom: 1px solid var(--line); }
.hours { position: sticky; left: 0; z-index: 3; background: var(--card); }
.hours div { height: var(--hour); font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-7px); }
.daycol { position: relative; border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--hour)); }
.daycol.today { background-color: #FFFBF6; }
.nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--accent); z-index: 2; }
.nowline::before { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.ev { position: absolute; border-radius: 8px; padding: 3px 6px; font-size: 12px; line-height: 1.25; overflow: hidden;
  background: color-mix(in srgb, var(--c) 16%, white); border-left: 4px solid var(--c); color: var(--ink); cursor: pointer; }
.ev .t { font-weight: 600; }
.ev .m { color: var(--muted); font-size: 11px; }
.ev.multi { border-left-width: 0; padding-left: 9px; }
.ev.multi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--stripe); }
.pill { border-radius: 6px; padding: 2px 6px; font-size: 11px; background: color-mix(in srgb, var(--c) 20%, white); border-left: 3px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.banner { background: var(--accent-soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }

/* Lijsten */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list li.done .txt { text-decoration: line-through; color: var(--muted); }
.check { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line); background: #fff; flex: none; display: grid; place-items: center; font-size: 14px; color: #fff; }
.done .check { background: #2E9E6A; border-color: #2E9E6A; }
.txt { flex: 1; min-width: 0; }
.meta { font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; }
.tab { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 14px; white-space: nowrap; font-size: 14px; }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab .n { opacity: .6; margin-left: 4px; }
.empty { color: var(--muted); font-size: 14px; padding: 14px 2px; }

/* Menu */
.menu-day { display: grid; grid-template-columns: 74px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.menu-day:last-child { border-bottom: 0; }
.menu-day .d { font-weight: 600; font-size: 14px; }
.menu-day .d small { display: block; font-weight: 400; color: var(--muted); }
.menu-day.today .d { color: var(--accent); }
.menu-day input { padding: 8px 10px; }

/* Keukenscherm */
.kitchen { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .kitchen { grid-template-columns: 1.3fr 1fr; } }
.clock { font-size: 48px; font-weight: 700; letter-spacing: -.02em; }
.k-ev { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.k-ev:last-child { border-bottom: 0; }
.k-ev .time { width: 124px; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.big-menu { font-size: 24px; font-weight: 600; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(30,25,20,.35); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--card); width: 100%; max-width: 520px; border-radius: 20px 20px 0 0; padding: 18px 18px calc(18px + var(--safe-b)); max-height: 92vh; overflow: auto; }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 20px; } }
.modal h2 { font-size: 19px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + 16px); background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 60; }

/* Login */
.login { max-width: 420px; margin: 12vh auto 0; text-align: center; }
.login .logo { width: 88px; height: 88px; border-radius: 24px; margin-bottom: 12px; }
.login .btn { padding: 12px 18px; font-size: 16px; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.member-row:last-child { border-bottom: 0; }
.member-row input[type=color] { width: 36px; height: 36px; border: 0; background: none; padding: 0; }

@media (max-width: 767px) {
  .cal { grid-template-columns: 44px repeat(7, minmax(150px, 1fr)); min-width: calc(44px + 7 * 150px); }
  .week-head h1 { font-size: 22px; }
  .cal-wrap { max-height: calc(100vh - 250px); }
}
