:root {
  --bg: #f6f4f0;
  --card: #ffffff;
  --ink: #2b2a28;
  --muted: #7a756c;
  --line: #e6e1d8;
  --soft: #efebe4;
  --accent: #2b2a28;
  --accent-ink: #ffffff;
  --ok: #2f6b4f;
  --ok-bg: #e7f2ec;
  --warn: #8a5a12;
  --warn-bg: #fbf1df;
  --err: #a23a2c;
  --err-bg: #fbe9e6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(40, 35, 25, .06), 0 4px 16px rgba(40, 35, 25, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
a { color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
[hidden] { display: none !important; }

/* knoppen */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; padding: .6em 1.15em; border-radius: 999px; border: 1px solid transparent; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; background: var(--soft); color: var(--ink); transition: background .15s, border-color .15s; }
.btn:hover { background: #e6e0d6; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #444240; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: var(--soft); }
.btn-danger { background: transparent; border-color: #e3c4bf; color: var(--err); }
.btn-danger:hover { background: var(--err-bg); }
.btn-sm { padding: .35em .85em; font-size: .9rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; }

/* formulieren */
.form { display: grid; gap: 14px; }
.form.compact { gap: 10px; }
.form label { display: grid; gap: 5px; font-size: .9rem; font-weight: 500; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .6em .75em; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid #c9c1b3; outline-offset: 0; border-color: #bdb4a5; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
.form label.check, label.check { display: flex; align-items: center; gap: .55em; font-weight: 400; }
.input-sm { padding: .4em .7em; width: auto; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
legend { font-weight: 700; margin-bottom: 6px; }
textarea.code { font: 12px/1.4 ui-monospace, Menlo, monospace; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.row-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hp { position: absolute; left: -9999px; }

/* meldingen */
.flash { padding: .75em 1em; border-radius: 10px; margin: 0 0 14px; background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--err-bg); color: var(--err); }
.flash-warn { background: var(--warn-bg); color: var(--warn); }

/* beheer */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1400px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 24px; }
.brand { font-weight: 700; text-decoration: none; white-space: nowrap; }
.mainnav { display: flex; gap: 4px; overflow-x: auto; }
.mainnav a { padding: .45em .9em; border-radius: 999px; text-decoration: none; color: var(--muted); white-space: nowrap; }
.mainnav a:hover { color: var(--ink); background: var(--soft); }
.mainnav a.active { color: var(--ink); background: var(--soft); font-weight: 500; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.container { max-width: 1400px; margin: 0 auto; padding: 24px 20px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card-head { margin-bottom: 8px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; align-items: start; }
.narrow { max-width: 640px; }
.stack { display: grid; gap: 8px; margin-bottom: 14px; }
.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 500; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.card .table td { padding-left: 0; }
.table-wrap .table td { padding-left: 14px; }
.clickable { cursor: pointer; }
.clickable:hover td { background: #faf8f5; }
.table a { text-decoration: none; font-weight: 500; }
.tag { display: inline-block; font-size: .75rem; padding: .1em .55em; border-radius: 999px; background: var(--soft); color: var(--muted); }
.inline-edit input { border: 0; padding: 0; font-weight: 700; font-size: 1rem; background: transparent; }
.inline-edit input:focus { outline: none; border-bottom: 1px solid var(--line); border-radius: 0; }
.pager { display: flex; gap: 16px; justify-content: center; }
.history { list-style: none; margin: 0 0 16px; padding: 0; }
.history li { display: grid; padding: 8px 0; border-bottom: 1px solid var(--line); }
.history li.status-cancelled { opacity: .55; }
.exc-list { list-style: none; padding: 0; margin: 14px 0 0; }
.exc-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.hours { border-collapse: collapse; }
.hours th { text-align: left; font-weight: 500; padding: 4px 12px 4px 0; white-space: nowrap; }
.hours td { padding: 4px 12px 4px 0; white-space: nowrap; color: var(--muted); }
.hours input { width: 6.5em; padding: .35em .5em; }

/* agenda */
.agenda-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 12px; }
.agenda-nav { display: flex; gap: 6px; align-items: center; }
.agenda-head .btn-primary { margin-left: auto; }
.agenda-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 14px; }
.agenda-title h1 { margin: 0; font-size: 1.35rem; }
.segmented { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 3px; }
.segmented a { padding: .3em .95em; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: .9rem; }
.segmented a.on { background: var(--card); color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.agenda-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 18px; align-items: start; }
.agenda-main { min-width: 0; }
.agenda { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(150px, 1fr)); background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.agenda.week { grid-template-columns: 50px repeat(7, minmax(110px, 1fr)); }
.agenda-colhead { height: 44px; display: flex; align-items: center; justify-content: center; font-weight: 700; border-bottom: 1px solid var(--line); background: var(--card); }
.agenda-colhead a { text-decoration: none; }
.agenda-colhead a:hover { text-decoration: underline; }
.agenda-colhead.today { color: var(--accent); background: var(--soft); }
.agenda-col { border-left: 1px solid var(--line); min-width: 0; }
.agenda-body { position: relative; }
.agenda-col .agenda-body { cursor: copy; }
.tick { position: absolute; right: 8px; transform: translateY(-50%); font-size: .75rem; color: var(--muted); }
.tick:first-child { transform: none; }
.hourline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.nowline { position: absolute; left: 0; right: 0; border-top: 2px solid #c0533f; z-index: 3; pointer-events: none; }
.off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, #f3f0eb 0 6px, #ece8e1 6px 12px); }
.buffer { position: absolute; left: 6px; right: 6px; background: #ece8e1; border-radius: 0 0 8px 8px; opacity: .8; }
.appt { position: absolute; left: 6px; right: 6px; background: #e9e4f2; border-radius: 8px; padding: 3px 7px; font-size: .78rem; line-height: 1.3; overflow: hidden; text-decoration: none; display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(0,0,0,.06); z-index: 1; }
.agenda.week .appt { left: 3px; right: 3px; padding: 2px 5px; font-size: .72rem; }
.appt:hover { filter: brightness(.96); z-index: 2; }
.appt strong { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt span { color: #5b5566; overflow: hidden; }
.appt.lane-1 { background: #e0ecf4; } .appt.lane-2 { background: #f4e9dc; } .appt.lane-3 { background: #e3efe2; }
.appt.lane-4 { background: #f3e1e7; } .appt.lane-5 { background: #ece9dc; }
.appt.status-done { opacity: .65; }
.appt.status-noshow { background: #f5e3df; text-decoration: line-through; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; font-size: .85rem; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: #e9e4f2; margin-right: 6px; vertical-align: -1px; }
.legend i.lane-1 { background: #e0ecf4; } .legend i.lane-2 { background: #f4e9dc; } .legend i.lane-3 { background: #e3efe2; }
.legend i.lane-4 { background: #f3e1e7; } .legend i.lane-5 { background: #ece9dc; }
.agenda-side { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow-y: auto; padding: 16px; }
.agenda-side h3 { margin-bottom: 4px; }
.up-day { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 4px; }
.up-item { display: grid; grid-template-columns: 46px 1fr; gap: 8px; padding: 8px 6px; border-radius: 8px; text-decoration: none; }
.up-item:hover { background: var(--soft); }
.up-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.up-main { display: grid; min-width: 0; }
.up-main strong, .up-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-main small { font-size: .8rem; }
.actions.center { justify-content: center; flex-wrap: wrap; }

/* klant zoeken */
.customer-pick { position: relative; }
.customer-pick .results { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 10; padding: 6px; }
.customer-pick .results button { display: block; width: 100%; text-align: left; background: none; border: 0; font: inherit; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.customer-pick .results button:hover { background: var(--soft); }
details summary { cursor: pointer; color: var(--muted); margin: 4px 0; }
.svc-pick { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.svc-cat { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 10px 0 4px; }
.svc-row { display: grid !important; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 5px 0; font-weight: 400 !important; }

/* inloggen */
.auth { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.auth-box { width: 100%; max-width: 380px; background: var(--card); padding: 32px; border-radius: 16px; box-shadow: var(--shadow); }

/* publieke boekpagina */
.public { background: var(--bg); }
.book { max-width: 640px; margin: 0 auto; padding: 28px 16px 120px; }
.embed .book { padding-top: 12px; }
.book-head { text-align: center; margin-bottom: 18px; }
.book-head h1 { margin-bottom: 4px; }
.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 20px; justify-content: center; flex-wrap: wrap; }
.steps li { font-size: .8rem; color: var(--muted); padding: .3em .8em; border-radius: 999px; background: var(--soft); }
.steps li.active { background: var(--accent); color: var(--accent-ink); }
.step h2 { text-align: center; }
.list { display: grid; gap: 10px; }
.item { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--card); border: 1px solid transparent; border-radius: var(--radius); padding: 14px 16px; font: inherit; cursor: pointer; box-shadow: var(--shadow); transition: border-color .15s; }
.item:hover { border-color: #cfc7b9; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-weight: 700; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.item-main { display: grid; flex: 1; }
.item-main small { color: var(--muted); }
.chev { font-size: 1.4rem; color: var(--muted); }
.search { margin-bottom: 14px; }
.cat { margin-bottom: 18px; }
.cat h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
.svc { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; background: var(--card); padding: 12px 14px; border-radius: 10px; margin-bottom: 6px; cursor: pointer; border: 1px solid transparent; box-shadow: 0 1px 2px rgba(40,35,25,.05); }
.svc input { margin-top: 4px; }
.svc.on { border-color: var(--accent); }
.svc-main { display: grid; }
.svc-main small { color: var(--muted); }
.svc .desc { font-size: .85rem; color: var(--muted); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.svc .price { white-space: nowrap; font-weight: 500; }
.sticky-bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; z-index: 30; }
.sticky-bar span { font-size: .9rem; }
.days-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 18px; }
.days { display: flex; gap: 6px; overflow-x: auto; flex: 1; padding: 4px 2px; scrollbar-width: thin; }
.day { flex: none; width: 54px; display: grid; justify-items: center; padding: 8px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font: inherit; cursor: pointer; }
.day small { font-size: .72rem; color: var(--muted); }
.day strong { font-size: 1.1rem; }
.day.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.day.on small { color: #d8d4cc; }
.day.full { opacity: .35; cursor: default; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.slot { padding: 10px 0; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font: inherit; font-weight: 500; cursor: pointer; }
.slot:hover { border-color: var(--accent); }
.summary { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; box-shadow: var(--shadow); display: grid; gap: 6px; }
.summary div { display: flex; justify-content: space-between; gap: 12px; }
.summary .total { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.done { text-align: center; background: var(--card); border-radius: var(--radius); padding: 32px 20px; box-shadow: var(--shadow); }
.back { display: block; margin: 20px auto 0; }
.actions { display: flex; gap: 10px; margin-bottom: 18px; }

@media (max-width: 1100px) {
  .agenda-layout { grid-template-columns: 1fr; }
  .agenda-side { position: static; max-height: none; }
}
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .topbar-inner { flex-wrap: wrap; gap: 10px; }
  .mainnav { order: 3; width: 100%; }
  .agenda-head .btn-primary { margin-left: 0; }
}
@media (max-width: 560px) {
  .row2, .row3 { grid-template-columns: 1fr; }
  h1 { font-size: 1.35rem; }
  .container { padding: 16px 12px 60px; }
}
