:root {
  --bg: #0D1210; --card: #161D1A; --card2: #1F2824; --line: #2A332F;
  --text: #f2f4f7; --muted: #9aa3b2; --accent: #C6F432; --accent-ink: #0D1210;
  --danger: #ff6b6b; --warn: #ffb84d; --ok: #5ee0a0;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 1.5rem; margin: 0 0 .75rem; }
h2 { font-size: 1.05rem; margin: 1.4rem 0 .5rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px; padding-top: calc(16px + env(safe-area-inset-top)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.card.link { display: block; color: inherit; }
.card.overdue { border-color: var(--danger); }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap-r { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); font-size: .9rem; }
.small { font-size: .85rem; }
.title { font-weight: 600; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; background: var(--card2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.s-nieuw { color: var(--accent); border-color: var(--accent); }
.pill.s-onboarding, .pill.s-follow_up { color: var(--warn); border-color: var(--warn); }
.pill.s-klant { color: var(--ok); border-color: var(--ok); }
.pill.s-verloren { color: var(--danger); border-color: var(--danger); }
.late { color: var(--danger); }
input, select, textarea, button { font: inherit; color: var(--text); }
input, select, textarea { width: 100%; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin: 4px 0 8px; }
textarea { min-height: 96px; resize: vertical; }
label { font-size: .85rem; color: var(--muted); }
button { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 700; cursor: pointer; }
button.ghost { background: var(--card2); color: var(--text); border: 1px solid var(--line); font-weight: 500; }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); font-weight: 500; }
button.small { padding: 6px 10px; font-size: .85rem; }
button:disabled { opacity: .5; }
details > summary { cursor: pointer; color: var(--muted); padding: 6px 0; }
details.sec > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 0; margin: 1.4rem 0 .5rem; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary h2 { margin: 0; }
details.sec > summary::after { content: '▸'; margin-left: auto; color: var(--muted); font-size: 1.1rem; transition: transform .15s; }
details.sec[open] > summary::after { transform: rotate(90deg); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; }
.check.done .t { text-decoration: line-through; color: var(--muted); }
.note { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; margin: 10px 0; white-space: pre-wrap; }
.note .meta { color: var(--muted); font-size: .8rem; margin-bottom: 2px; }
.answers { margin: 8px 0 0; white-space: normal; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card2); }
.answers .qa { padding: 10px 12px; }
.answers .qa + .qa { border-top: 1px solid var(--line); }
.answers .q { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.answers .a { margin-top: 3px; font-size: .95rem; font-weight: 500; line-height: 1.4; color: var(--text); }
.answers .a.good { color: var(--ok); font-weight: 600; }
.answers .a.warn { color: var(--warn); font-weight: 600; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav a { flex: 1; text-align: center; padding: 12px 4px; color: var(--muted); font-size: .8rem; }
.nav a.on { color: var(--accent); }
.nav a b { display: block; font-size: 1.2rem; }
.fab { position: fixed; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); width: 54px; height: 54px; border-radius: 50%; font-size: 1.8rem; line-height: 1; padding: 0; box-shadow: 0 6px 20px #0008; }
#toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--card2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10; }
#toast.show { opacity: 1; }
.login { max-width: 380px; margin: 14vh auto 0; padding: 16px; }
.empty { text-align: center; color: var(--muted); padding: 28px 8px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.chips button { white-space: nowrap; background: var(--card2); color: var(--muted); border: 1px solid var(--line); font-weight: 500; padding: 6px 12px; }
.chips button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
code { background: var(--card2); padding: 2px 6px; border-radius: 6px; word-break: break-all; font-size: .85rem; }

.wa { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.btn-link { display: block; text-align: center; margin-top: 8px; padding: 11px 16px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.hl { border-color: var(--accent) !important; color: var(--accent) !important; }
.chip-link { display: inline-block; padding: 6px 10px; font-size: .85rem; border-radius: 10px; background: var(--card2); border: 1px solid var(--line); color: var(--text); }
.hint { border-color: var(--accent); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.tile .tl { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tile .tv { font-size: 1.45rem; font-weight: 700; margin-top: 2px; }
.tile .ts { font-size: .78rem; color: var(--muted); }
.fn { margin: 8px 0 12px; }
.fl { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 4px; }
.fb { background: var(--card2); border-radius: 4px; height: 12px; overflow: hidden; }
.fb i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 150px; padding-top: 18px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; outline: none; }
.bar i { display: block; width: 70%; background: var(--accent); border-radius: 4px 4px 0 0; }
.bar:hover i, .bar:focus i { background: #E3FF7A; }
.bar .bv { position: absolute; top: -16px; font-size: .62rem; color: var(--text); white-space: nowrap; }
.bar .bl { font-size: .62rem; color: var(--muted); margin-top: 4px; height: 14px; }
.scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 6px 6px 0; white-space: nowrap; }
.tbl td { padding: 7px 6px 7px 0; border-top: 1px solid var(--line); white-space: nowrap; }

/* Producten */
.card.prod { display: flex; gap: 12px; align-items: center; }
.pthumb { border-radius: 12px; object-fit: cover; background: #fff; flex: 0 0 auto; display: block; }
.pthumb.ph { display: flex; align-items: center; justify-content: center; background: var(--card2); border: 1px solid var(--line); color: var(--accent); font-weight: 800; font-size: 1.2rem; }
.pill.ok { color: var(--ok); border-color: var(--ok); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.card.notice { border-color: var(--accent); }
label.check { display: flex; align-items: center; gap: 8px; margin: 6px 0; color: var(--text); font-size: .95rem; }
label.check input { width: auto; margin: 0; }
.scanner { position: fixed; inset: 0; background: #000; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; }
.scanner video { width: 100%; max-width: 520px; border-radius: 14px; }
.scanner .scanframe { position: absolute; width: min(70vw, 360px); height: 120px; border: 3px solid var(--accent); border-radius: 12px; pointer-events: none; }
.scanner p { color: #fff; margin: 0; }
.seg { display: flex; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.seg a { flex: 1; text-align: center; padding: 8px; border-radius: 9px; color: var(--muted); font-weight: 600; }
.seg a.on { background: var(--accent); color: var(--accent-ink); }
.presult { display: block; width: 100%; text-align: left; margin: 4px 0; }
.card.totals { border-color: var(--accent); }
table.scaled { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: .9rem; }
table.scaled th, table.scaled td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.scaled th { color: var(--muted); font-weight: 600; }
.plan-link { border-color: var(--accent); }
.plan-head .big { font-size: 1.9rem; font-weight: 800; color: var(--accent); }
.macros { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 12px 0 6px; }
.bar { height: 6px; background: var(--card2); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 6px; background: var(--accent); border-radius: 3px; }
.macros .bar { display: block; flex: none; }
.warn { color: var(--warn); margin-top: 6px; }
.slot .alt { padding: 4px 0; border-bottom: 1px solid var(--line); }
details.card > summary { color: var(--text); font-weight: 600; }
.plan-head .big { white-space: nowrap; font-size: 1.7rem; }
.macros > div { white-space: nowrap; min-width: 0; }
@media (max-width: 560px) { .macros { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.slot .wrap-r { flex-wrap: wrap; gap: 8px; }
.slot .wrap-r .title { flex-basis: 100%; }
.plan-head > .row { flex-wrap: wrap; }
.head-side { text-align: right; }
@media (max-width: 420px) { .head-side { text-align: left; flex-basis: 100%; } }
a.btn.ghost { background: var(--card2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 11px 16px; white-space: nowrap; }
.card.notice.pending { border-color: var(--warn); }

/* iOS: alleen de inhoud scrolt, de onderbalk staat vast in de opbouw (schuift niet meer mee) */
html, body { overscroll-behavior: none; }
#app:has(> .nav) { position: fixed; inset: 0; display: flex; flex-direction: column; }
#app:has(> .nav) > .wrap { flex: 1 1 auto; min-height: 0; width: 100%; max-width: none; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding-left: max(16px, calc((100% - 720px) / 2 + 16px)); padding-right: max(16px, calc((100% - 720px) / 2 + 16px)); padding-bottom: 24px; }
#app:has(> .nav) > .nav { position: relative; flex: 0 0 auto; }
body:has(#app > .nav) { padding-bottom: 0; }
.card.ai > summary { color: var(--accent); }
.cand { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--card2); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-top: 8px; font-weight: 400; }
.cand img, .cand .ph { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 10px; flex: 0 0 auto; }
.cand .ph { display: flex; align-items: center; justify-content: center; color: #999; }
label.btn.filebtn { display: block; text-align: center; cursor: pointer; margin-top: 4px; background: var(--card2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 11px 16px; }
.ok-text { color: var(--ok); margin-top: 4px; }
.pill.warnpill { background: transparent; color: var(--warn); border: 1px solid var(--warn); }
.card.draft { background: var(--card2); margin-top: 8px; border-color: var(--accent); }
details.prefs .row button { white-space: nowrap; }
.usebox { margin-top: 6px; } .usebox .row span { white-space: nowrap; }
.meal-card .row { align-items: flex-start; }
.mthumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex: 0 0 auto; background: var(--card2); }
.mhero { width: 100%; max-height: 260px; object-fit: cover; border-radius: 14px; margin-bottom: 10px; }
.slot-img { max-height: 180px; margin: 6px 0; }
.mthumb.small-thumb { width: 44px; height: 44px; border-radius: 8px; }
.slot .alt { align-items: center; gap: 10px; }
.pthumb.ph.emoji { display: inline-flex; align-items: center; justify-content: center; background: var(--card2); line-height: 1; }
.checkrow { cursor: pointer; }
.checkrow input[type=checkbox] { width: 22px; height: 22px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); }
details.altpick { margin-top: 8px; }
details.altpick > summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 6px 0; }
.xhidden { opacity: .6; }

.col-btns { display: flex; flex-direction: column; gap: 6px; }
.variants { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 8px; }
.variant { position: relative; display: flex; flex-direction: column; gap: 4px; font-size: .75rem; color: var(--muted); }
.variant img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.variant button { position: absolute; top: 4px; right: 4px; padding: 2px 7px; background: rgba(13,18,16,.75); }

/* ---------- Desktop: menu links, breder werkvlak, voedingsplan in kolommen met live voorbeeld ---------- */
.nav-brand { display: none; }
.prevbox { display: none; }
@media (min-width: 1024px) {
  #app:has(> .nav) { flex-direction: row; }
  #app:has(> .nav) > .nav { order: -1; width: 184px; flex: 0 0 184px; flex-direction: column; gap: 2px; border-top: 0; border-right: 1px solid var(--line);
    padding: calc(22px + env(safe-area-inset-top)) 12px 20px; overflow-y: auto; }
  .nav-brand { display: block; font-weight: 800; font-size: 1.15rem; color: var(--accent); padding: 2px 14px 20px; letter-spacing: .01em; }
  .nav-brand small { display: block; color: var(--muted); font-weight: 500; font-size: .78rem; margin-top: 2px; }
  .nav a { flex: none; display: flex; align-items: center; gap: 10px; text-align: left; padding: 11px 14px; border-radius: 10px; font-size: .95rem; color: var(--text); }
  .nav a b { display: inline; font-size: 1.1rem; }
  .nav a:hover { background: var(--card2); }
  .nav a.on { background: var(--card2); color: var(--accent); font-weight: 600; }
  #app:has(> .nav) > .wrap { padding: 28px max(32px, calc((100% - 1040px) / 2)); }
  #app:has(> .nav) > .wrap.wide { padding: 24px 32px; }
  h1 { font-size: 1.7rem; }
  .plan-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 24px; align-items: start; }
  .plan-left .macros { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plan-left .head-side { text-align: left; flex-basis: 100%; }
  .plan-left .plan-head > .row { flex-wrap: wrap; }
  .plan-left { position: sticky; top: 0; max-height: calc(100vh - 48px); overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
  .plan-mid > h2:first-child { margin-top: 12px; }
}
@media (min-width: 1280px) {
  body.has-preview #app:has(> .nav) > .wrap.wide { padding-right: 412px; }
  .prevbox { position: fixed; right: 24px; top: 20px; bottom: 20px; width: 364px; display: flex; flex-direction: column; gap: 10px; z-index: 5; }
  .prevbox[hidden] { display: none; }
  .prevhead { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .85rem; padding: 0 6px; }
  .prevphone { flex: 1 1 auto; min-height: 0; max-height: 800px; border: 9px solid #000; border-radius: 38px; overflow: hidden; background: #f3f5ef; box-shadow: 0 10px 40px rgba(0,0,0,.45); }
  .prevphone iframe { width: 100%; height: 100%; border: 0; display: block; }
}

/* ---------- Kalender ---------- */
.cal-top { margin-bottom: 10px; gap: 10px; }
.cal-seg { margin: 0; }
.cal-nav { gap: 8px; margin: 6px 0 12px; }
.cal-nav b { text-transform: capitalize; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.cal-chip { display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 999px; border-left: 3px solid; background: var(--card2); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.k-taak { border-left-color: var(--accent); } .k-lead { border-left-color: var(--warn); } .k-contact { border-left-color: #5aa9ff; } .k-start { border-left-color: var(--ok); } .k-einde { border-left-color: #c084fc; }
.cal-ev { display: flex; gap: 8px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-left: 4px solid; border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; }
.cal-ev a { color: inherit; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cal-ev b { font-size: .9rem; } .cal-t { font-size: .75rem; color: var(--muted); } .cal-d { font-size: .82rem; color: var(--text); overflow-wrap: anywhere; } .cal-c { font-size: .72rem; color: var(--muted); }
.cal-ev input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.cal-ev.done { opacity: .5; } .cal-ev.done b { text-decoration: line-through; }
.cal-ev.late { border-color: var(--danger); background: rgba(255,107,107,.06); }
.cal-chip.late { border-color: var(--danger); }
.cal-today-h { color: var(--accent); }
.cal-week { display: grid; grid-template-columns: 1fr; gap: 10px; }
.cal-day { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 60px; }
.cal-day.today { border-color: var(--accent); }
.cal-dh { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: capitalize; margin: 2px 2px 8px; }
.cal-day.today .cal-dh { color: var(--accent); }
.cal-empty { padding: 4px; }
.cal-mh, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-mh div { font-size: .75rem; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-cell { display: flex; flex-direction: column; gap: 3px; align-items: stretch; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 5px; min-height: 64px; color: var(--text); font: inherit; cursor: pointer; min-width: 0; }
.cal-cell.other { opacity: .45; } .cal-cell.today { border-color: var(--accent); }
.cal-n { font-size: .8rem; font-weight: 600; }
@media (min-width: 1024px) {
  .cal-week { grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: start; }
  .cal-day { min-height: 320px; }
  .cal-cell { min-height: 108px; }
}
@media (max-width: 560px) { .cal-cell .cal-chip { font-size: 0; padding: 0; height: 6px; border-left-width: 0; } .cal-cell .cal-chip.k-taak { background: var(--accent); } .cal-cell .cal-chip.k-lead { background: var(--warn); } .cal-cell .cal-chip.k-contact { background: #5aa9ff; } .cal-cell .cal-chip.k-start { background: var(--ok); } .cal-cell .cal-chip.k-einde { background: #c084fc; } .cal-cell .cal-chip.late { background: var(--danger); } }
.cal-ev.k-taak, .cal-chip.k-taak { border-left-color: var(--accent); } .cal-ev.k-lead, .cal-chip.k-lead { border-left-color: var(--warn); } .cal-ev.k-contact, .cal-chip.k-contact { border-left-color: #5aa9ff; }
.cal-ev.k-start, .cal-chip.k-start { border-left-color: var(--ok); } .cal-ev.k-einde, .cal-chip.k-einde { border-left-color: #c084fc; }
.cal-ev.late { border-color: var(--danger); }
.cal-nav b { text-transform: none; }
@media (max-width: 560px) { .cal-nav b { order: 5; flex-basis: 100%; } }

/* ---------- Leads: bord en tabel ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; scroll-snap-type: x proximity; }
.bcol { flex: 0 0 236px; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 140px; scroll-snap-align: start; transition: border-color .15s, background .15s; }
.bcol.over { border-color: var(--accent); background: rgba(198,244,50,.06); }
.bcol-h { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: .85rem; color: var(--muted); padding: 2px 4px 8px; text-transform: uppercase; letter-spacing: .03em; }
.bcard { display: flex; flex-direction: column; gap: 3px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; margin-bottom: 7px; color: inherit; cursor: grab; }
.bcard:hover { border-color: var(--muted); }
.bcard.dragging { opacity: .4; }
.bcard b { font-size: .92rem; }
.bmeta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.bmeta .pill { font-size: .7rem; }
.bempty { border: 1px dashed var(--line); border-radius: 10px; padding: 14px 8px; text-align: center; }
.tblwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.ltable { width: 100%; border-collapse: collapse; font-size: .88rem; }
.ltable th { position: sticky; top: 0; background: var(--card2); text-align: left; white-space: nowrap; }
.ltable th button { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; padding: 10px 12px; cursor: pointer; }
.ltable td { padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.ltable td a { color: var(--text); }
.ltable tr:hover td { background: rgba(255,255,255,.02); }
.ltable select { margin: 0; padding: 6px 8px; width: auto; font-size: .85rem; }
.late { color: var(--danger); }

/* Product- en maaltijdtabel */
.dtable td.num, .dtable th.num { text-align: right; }
.dtable th.num button { padding-right: 12px; }
.dtable .thl { display: inline-block; padding: 10px 12px; }
.dtable tr.clickrow { cursor: pointer; }
.dtable tr.clickrow:hover td { background: rgba(199, 244, 100, .06); }
.dtable td .pthumb { width: 32px; height: 32px; border-radius: 8px; }
.dtable .tthumb { width: 40px; height: 40px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.dtable .tclip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.dtable td .pill { margin: 0 0 0 4px; }
.dtable td:nth-child(2), .dtable td:nth-child(3) { white-space: normal; min-width: 150px; }
.dtable td:nth-child(2) { min-width: 240px; }

/* ---- Voedingsplan: rustige opbouw (1 kolom) ---- */
.planx { max-width: 1240px; margin: 0 auto; }
.px-client .avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--card2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--accent); flex: 0 0 auto; }
.mgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.mi { display: flex; flex-direction: column; gap: 4px; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.mi input { background: transparent; border: none; padding: 0; font-size: 1.15rem; font-weight: 600; width: 100%; }
.mi input::placeholder { color: var(--text); opacity: .55; }
.mi input:focus { outline: none; }
.mi:focus-within { border-color: var(--accent); }
.mstatic { font-size: 1.15rem; font-weight: 600; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); vertical-align: 1px; margin-left: 2px; }
.ok-text { color: var(--ok); }
.sharerow { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(0, 3fr) 48px 84px; gap: 12px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.sharerow input[type=range] { margin: 0; padding: 0; background: none; border: none; accent-color: var(--accent); }
.sharerow .shk { text-align: right; }
.sharetot { font-weight: 600; font-size: .85rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--ok); color: var(--ok); }
.sharetot.badb { background: var(--danger); border-color: var(--danger); color: #fff; }
details.moment > summary.momhead { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; flex-wrap: wrap; }
details.moment > summary::-webkit-details-marker { display: none; }
details.moment > summary::before { content: '▸'; color: var(--muted); }
details.moment[open] > summary::before { content: '▾'; }
.momname { color: var(--muted); font-size: .9rem; }
details.moment[open] .momname { visibility: hidden; }
.momgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr); gap: 18px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.momimg { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.ptab { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .88rem; }
.ptab td { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: right; }
.ptab td:first-child { text-align: left; }
.ptab tr:last-child td { border-bottom: none; }
.altcol { border-left: 1px solid var(--line); padding-left: 18px; }
.altc { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 10px; margin: 0 0 6px; cursor: pointer; background: var(--card2); }
.altc.on { border-color: var(--accent); }
.altc input[type=checkbox] { width: 20px; height: 20px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); }
.altc img, .altc .noimg { width: 52px; height: 40px; border-radius: 7px; object-fit: cover; flex: 0 0 auto; background: var(--card); }
.altc .grow { display: flex; flex-direction: column; min-width: 0; }
.altn { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seen { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); white-space: nowrap; }
.px-total { background: var(--card2); }
@media (max-width: 760px) {
  .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .momgrid { grid-template-columns: 1fr; }
  .altcol { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; }
  .sharerow { grid-template-columns: minmax(80px, 1fr) minmax(0, 2fr) 44px; }
  .sharerow .shk { display: none; }
}

/* ---- Lichte weergave (keuze per apparaat, onder Instellingen) ---- */
html[data-theme="light"] {
  --bg: #f3f5ef; --card: #ffffff; --card2: #f7f9f4; --line: #e1e7dc;
  --text: #0f3b2e; --muted: #5b6b62; --accent: #2f6b1f; --accent-ink: #ffffff;
  --danger: #c0392b; --warn: #b26a00; --ok: #2f7a3a;
}
.altc .grow > .muted { white-space: normal; }

.sharerow .shp { display: flex; align-items: center; gap: 2px; font-weight: 600; }
.sharerow .shp input { width: 52px; margin: 0; padding: 4px 6px; text-align: right; font-weight: 600; }
.sharerow { grid-template-columns: minmax(90px, 1fr) minmax(0, 3fr) 70px 84px; }

/* Aanpasbare hoeveelheden in het plan */
.ptab .amt { display:inline-flex; align-items:center; gap:4px; }
.ptab .amt input { width:64px; margin:0; padding:4px 6px; font-weight:700; text-align:right; }
.ptab tr.chg td:first-child { box-shadow: inset 3px 0 0 var(--accent); padding-left:6px; }
.ptab tr.chg .amt input { border-color: var(--accent); }
.altwrap { margin-bottom:8px; }
.altwrap .altc { margin-bottom:0; }
.altadj { margin:2px 0 0 4px; }
.altadj > summary { cursor:pointer; color: var(--muted); padding:4px 0; }
.ptabwrap { overflow-x:auto; }
.ptabwrap .ptab { min-width:380px; }
.ptab .amt { white-space:nowrap; }
.altadj .ptab { font-size:12.5px; }
.altadj .ptab .amt input { width:52px; padding:3px 5px; }
@media (min-width: 900px) {
  #app:has(> .nav) > .wrap:has(.planx) { padding-left: 24px; padding-right: 24px; }
}
.altc .altm { white-space: nowrap; }
.altc img, .altc .noimg { width: 46px; height: 36px; }
.altadj .ptab { min-width: 0; }
.altadj .ptab .amt { flex-wrap: wrap; gap: 0 4px; }
.altc .altn { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
.altadj .ptab td:first-child { word-break: break-word; }
.momgrid > * { min-width: 0; }
@media (max-width: 760px) { .momgrid { grid-template-columns: minmax(0, 1fr); } .ptabwrap .ptab { min-width: 0; font-size: 12.5px; } .ptab .amt input { width: 50px; padding: 3px 4px; } .ptab td { padding-left: 3px; padding-right: 3px; } }

/* Rondleiding planscherm */
.tourspot { position: fixed; z-index: 9998; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,.55); outline: 2px solid var(--accent); pointer-events: none; transition: all .2s ease; }
.tourcard { position: fixed; z-index: 9999; width: 340px; max-width: calc(100vw - 24px); background: var(--card); color: var(--text); border: 1px solid var(--accent); border-radius: 14px; padding: 14px 16px; box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.tourcard.center { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 420px; }
.tourcard.bottom { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; max-height: 48vh; overflow-y: auto; }
.tourtop { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.tourtitle { font-weight: 800; font-size: 1.05rem; margin-bottom: 6px; color: var(--accent); }
.tourtext { font-size: .92rem; line-height: 1.45; }
.tourtask { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--card2); border: 1px dashed var(--line); font-size: .9rem; }
.tourtask.ok { border-style: solid; border-color: var(--ok); }
.tourbtns { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.tourban { gap: 10px; border-color: var(--accent); }
.altc .fixb { color: var(--muted); }
.altwrap.hid .altc { opacity: .55; border-style: dashed; border-color: var(--line); }

/* Ruilproducten per product */
.swb { background: none; border: 1px solid transparent; color: var(--muted); padding: 0 4px; margin: 0; font-size: .82rem; border-radius: 6px; cursor: pointer; width: auto; min-height: 0; }
.swb:hover, .swb.on { border-color: var(--line); color: var(--text); background: var(--card2); }
.swb.part { color: var(--warn); }
.ptab tr.swrow td { background: var(--card2); padding: 8px 10px; }
.swlist { display: flex; flex-wrap: wrap; gap: 6px; }
.swc { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: .82rem; cursor: pointer; background: var(--card); }
.swc input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.swc.off { opacity: .6; text-decoration: line-through; }
.swc.off input:checked + span { text-decoration: none; }

/* Doel tegenover plan */
.mplan { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 5px; margin-top: 2px; }
.mplan b { color: var(--text); }
.mdiff, .dchip { font-weight: 700; font-size: .78rem; padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.mplan.ok .mdiff, .dchip.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 16%, transparent); }
.mplan.mid .mdiff, .dchip.mid { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.mplan.bad .mdiff, .dchip.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 16%, transparent); }
.mplan.bad { border-top-color: color-mix(in srgb, var(--danger) 50%, var(--line)); }
.daytab td { padding-top: 7px; padding-bottom: 7px; }
.daytab tr.dayplan td { font-weight: 700; font-size: 1.02rem; }
/* Tijd in de kop van een moment */
.momhead .momtime { width: auto; margin: 0; padding: 3px 6px; font-size: .85rem; background: var(--card2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); }

/* Balk onderin: plan tegenover doel, blijft in beeld */
.pxbar { position: sticky; bottom: 0; z-index: 20; display: grid; grid-template-columns: auto repeat(5, minmax(0, 1fr)); gap: 8px; align-items: stretch;
  margin: 16px -4px 0; padding: 8px 10px; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 14px 14px 0 0; box-shadow: 0 -8px 24px rgba(0,0,0,.25); }
.pxbar { transition: opacity .2s ease, transform .2s ease; }
.pxbar.gone { opacity: 0; transform: translateY(12px); pointer-events: none; }
.pxbar-l { align-self: center; line-height: 1.2; padding-right: 2px; }
.pxb { display: flex; flex-direction: column; gap: 3px; padding: 5px 8px; border-radius: 9px; background: var(--card2); border: 1px solid var(--line); min-width: 0; }
.pxb-top { display: flex; justify-content: space-between; gap: 4px; font-size: .74rem; white-space: nowrap; }
.pxb-w { font-weight: 700; }
.pxb-num { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pxb-num .muted { font-size: .78rem; }
.pxb-bar { height: 4px; border-radius: 3px; background: var(--line); overflow: hidden; }
.pxb-bar i { display: block; height: 100%; border-radius: 3px; }
.pxb.ok .pxb-w { color: var(--ok); } .pxb.ok .pxb-bar i { background: var(--ok); }
.pxb.mid .pxb-w { color: var(--warn); } .pxb.mid .pxb-bar i { background: var(--warn); } .pxb.mid { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.pxb.bad .pxb-w { color: var(--danger); } .pxb.bad .pxb-bar i { background: var(--danger); } .pxb.bad { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
@media (max-width: 760px) {
  .pxbar { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 6px; margin: 12px -8px 0; }
  .pxbar-l { display: none; }
  .pxb { padding: 4px 5px; }
  .pxb-top { flex-direction: column; font-size: .68rem; gap: 0; }
  .pxb-num .muted { display: none; }
}

/* Cockpit-logo */
.loginlogo { width: 132px; margin: 0 auto 10px; color: var(--text); }
.loginlogo svg { width: 100%; height: auto; display: block; }
.lplane { transform-box: view-box; transform-origin: 440px 440px; }
.fly .lplane { animation: lplane-loop 2.4s cubic-bezier(.45,.05,.3,1) .4s 1 both; }
@keyframes lplane-loop { from { transform: rotate(-360deg); } to { transform: rotate(0deg); } }
@media (prefers-reduced-motion: reduce) { .fly .lplane { animation: none; } }
.brandrow { display: flex; align-items: center; gap: 8px; }
.navlogo { width: 30px; height: 30px; flex: 0 0 auto; color: var(--text); }
.brandrow > span { font-size: .98rem; white-space: nowrap; }
.nav-brand { padding-left: 10px; padding-right: 6px; }
.navlogo { width: 28px; height: 28px; }

/* Optelsom onder de producten */
.ptab tr.ptot td { border-top: 2px solid var(--line); border-bottom: none; font-weight: 800; padding-top: 10px; }
.ptab tr.ptot td:first-child { color: var(--muted); font-weight: 700; }

/* Product toevoegen en vervangen in het plan */
.linkbtn { background: none; border: none; padding: 0 2px; margin: 0; width: auto; min-height: 0; color: var(--accent); font-size: .85rem; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.ptab tr.addrow td { border-bottom: none; padding-top: 8px; }
.swc .swrepl { background: var(--card2); border: 1px solid var(--line); color: var(--accent); padding: 0 6px; margin: 0 0 0 2px; width: auto; min-height: 0; font-size: .85rem; border-radius: 6px; cursor: pointer; line-height: 1.4; }
.swc .swrepl:hover { border-color: var(--accent); }

/* Eigen zoeklijst voor producten */
.plwrap { position: relative; flex: 1 1 220px; min-width: 200px; }
.plpick { position: fixed; z-index: 60; max-height: 300px; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.35); padding: 4px; }
.plopt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.plopt .pln { font-weight: 600; }
.plopt .plk { width: 100%; font-size: .75rem; }
.plopt:hover, .plopt.on { background: var(--card2); box-shadow: inset 3px 0 0 var(--accent); }
.plnone { padding: 10px; }
/* Product weghalen */
.rmx { background: none; border: none; color: var(--muted); opacity: .45; padding: 0 6px 0 0; margin: 0; width: auto; min-height: 0; font-size: .8rem; cursor: pointer; }
.rmx:hover, .rmx:focus-visible { opacity: 1; color: var(--danger); }
.ptab tr.rmv td { color: var(--muted); }
.ptab tr.rmv .rmvname { text-decoration: line-through; }

/* Concept en versies */
.pubbar { border-left: 4px solid var(--line); }
.pubbar.draft { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--card)); }
.pubbar.ok { border-left-color: var(--ok); }
.verrow { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.verrow .vername { margin: 0 0 2px; padding: 4px 8px; font-weight: 600; background: transparent; border: 1px solid transparent; }
.verrow .vername:hover, .verrow .vername:focus { border-color: var(--line); background: var(--card2); }
.verdlg { width: min(720px, calc(100vw - 32px)); max-height: 86vh; overflow-y: auto; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.verdlg::backdrop { background: rgba(0,0,0,.55); }
.vslot { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.vopt { margin-top: 6px; }
.vopt.alt { padding-left: 10px; border-left: 2px solid var(--line); }

/* Momenten weghalen, toevoegen en slepen in de verdeling */
.sharerow { grid-template-columns: 22px minmax(90px, 1fr) minmax(0, 3fr) 70px 84px 28px; }
.shdrag { background: none; border: none; color: var(--muted); padding: 2px 0; margin: 0; width: auto; min-height: 0; cursor: grab; touch-action: none; font-size: 1rem; letter-spacing: -2px; line-height: 1; }
.shdrag:hover, .shdrag:focus-visible { color: var(--text); }
.shdel { background: none; border: none; color: var(--muted); opacity: .6; padding: 2px; margin: 0; width: auto; min-height: 0; cursor: pointer; }
.shdel:hover, .shdel:focus-visible { opacity: 1; color: var(--danger); }
.sharerow.dragging { background: var(--card2); border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.3); cursor: grabbing; position: relative; z-index: 2; }
.sharerow.dragging .shdrag { cursor: grabbing; color: var(--accent); }
.shadd { gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 2px; }
@media (max-width: 760px) {
  .sharerow { grid-template-columns: 20px minmax(70px, 1fr) minmax(0, 2fr) 60px 26px; gap: 8px; }
}
@media (max-width: 760px) {
  .sharerow { grid-template-columns: 18px 88px minmax(50px, 1fr) 58px 24px; gap: 6px; }
  .sharerow > .grow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #pxshare > .row:first-child > .title { flex-basis: 100%; }
  .shadd .muted { display: none; }
}

/* Verdeling niet op 100% */
#pxshare.off100 { border-color: var(--warn); box-shadow: inset 4px 0 0 var(--warn); }
.shwarn { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; margin: 4px 0 8px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 14%, var(--card)); color: var(--text); font-size: .9rem; }
.shwarn[hidden] { display: none; }
.shwarn span { flex: 1 1 220px; }

/* ▲▼ in de balk van een maaltijdmoment */
.mommove { display: inline-flex; flex-direction: column; gap: 1px; margin-right: 2px; }
.mommove button { background: var(--card2); border: 1px solid var(--line); color: var(--muted); width: 22px; height: 15px; min-height: 0; padding: 0; margin: 0; font-size: 8px; line-height: 1; border-radius: 4px; cursor: pointer; }
.mommove button:hover:not([disabled]), .mommove button:focus-visible { color: var(--accent); border-color: var(--accent); }
.mommove button[disabled] { opacity: .3; cursor: default; }
.mommove button { width: 26px; height: 18px; font-size: 9px; }

/* Telefoon: niets mag buiten beeld lopen */
@media (max-width: 760px) {
  .momhead { overflow: hidden; row-gap: 6px; }
  .momhead .momname { flex: 1 1 100%; order: 9; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .moment { max-width: 100%; }
  /* Titel en knoppen bovenaan: titel op een eigen regel */
  .planx > .row:first-of-type { flex-wrap: wrap; }
  .planx > .row:first-of-type > h1 { flex: 1 1 100%; }
  /* Klantkaart: avatar en naam naast elkaar, de knoppen eronder */
  .px-client > .row { flex-wrap: wrap; gap: 8px; }
  .px-client > .row > .grow { flex: 1 1 calc(100% - 64px); min-width: 0; }
  .px-client > .row > .btn, .px-client > .row > button { flex: 1 1 auto; text-align: center; }
}
@media (max-width: 760px) { details.moment[open] .momname { display: none; } }
