:root {
  --brand: #e2574c;
  --ink: #241f1c;
  --muted: #776c66;
  --line: #e9e2dc;
  --bg: #f6f2ee;
  --card: #fff;
  --ok: #2e9d5b; --ok-bg: #e5f5ec;
  --warn: #b5760a; --warn-bg: #fdf1dc;
  --bad: #c43d3d; --bad-bg: #fbe7e7;
  --info: #2f6db3; --info-bg: #e5eefa;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; }
.hidden { display: none !important; }
a { color: var(--brand); }

.login { min-height: 100vh; display: grid; place-items: center; }
.login form { background: var(--card); padding: 32px; border-radius: 16px; width: 320px; box-shadow: 0 10px 40px #0000000d; text-align: center; }
.login .logo { font-size: 22px; font-weight: 800; }
.login p { color: var(--muted); margin: 4px 0 18px; }
.login input { margin-bottom: 10px; }
.login .btn { width: 100%; }
.err { color: var(--bad); margin-top: 8px; min-height: 18px; }

.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
aside { background: #2a2320; color: #f3ece6; padding: 18px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
aside .logo { font-weight: 800; font-size: 18px; padding: 4px 10px 18px; }
aside nav { display: flex; flex-direction: column; gap: 2px; }
aside nav a { color: #e6dcd4; text-decoration: none; padding: 9px 10px; border-radius: 8px; }
aside nav a:hover { background: #ffffff12; }
aside nav a.active { background: var(--brand); color: #fff; }
.aside-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px; font-size: 13px; }
.aside-foot a, .linkbtn { color: #cbbfb6; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-align: left; text-decoration: none; }
main { padding: 24px 28px 60px; min-width: 0; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  aside { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; }
  aside nav { flex-direction: row; flex-wrap: wrap; }
  aside .logo { padding: 4px 10px; }
  .aside-foot { flex-direction: row; margin: 0; }
  main { padding: 16px; }
}

h1 { font-size: 24px; margin: 0 0 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
h1 .spacer { flex: 1; }
h1 .btn, h1 .badge { font-size: 14px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.panel { background: var(--card); border-radius: 14px; padding: 18px; box-shadow: 0 1px 2px #0000000a; margin-bottom: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .grid4 { grid-template-columns: repeat(2, 1fr); } .grid2 { grid-template-columns: 1fr; } }
.stat { background: var(--card); border-radius: 14px; padding: 16px 18px; }
.stat .k { color: var(--muted); font-size: 13px; }
.stat .v { font-size: 26px; font-weight: 800; margin-top: 4px; }
.stat .s { color: var(--muted); font-size: 12px; margin-top: 2px; }

.btn { border: 0; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; background: var(--brand); color: #fff; white-space: nowrap; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 40%, white); border-color: var(--brand); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
label.f { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
.frow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
.chk { display: inline-flex; align-items: center; gap: 6px; margin: 4px 14px 4px 0; font-size: 14px; }
.help { color: var(--muted); font-size: 12px; margin-top: 4px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.filters > * { width: auto; }
.filters input[type=search] { min-width: 240px; flex: 1; }

.tablewrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: default; }
table.t th[data-sort] { cursor: pointer; }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #fbf8f5; }
table.t td.num, table.t th.num { text-align: right; white-space: nowrap; }
.sub { color: var(--muted); font-size: 12px; }
.sumbar { display: flex; gap: 20px; flex-wrap: wrap; padding: 10px 2px 0; color: var(--muted); }
.sumbar b { color: var(--ink); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-confirmed, .b-paid, .b-open-slot, .b-active { background: var(--ok-bg); color: var(--ok); }
.b-pending, .b-partially_paid, .b-full { background: var(--warn-bg); color: var(--warn); }
.b-cancelled, .b-failed, .b-no_show { background: var(--bad-bg); color: var(--bad); }
.b-completed, .b-refunded { background: var(--info-bg); color: var(--info); }
.b-open, .b-hidden { background: #eee; color: #666; }

.modal { position: fixed; inset: 0; background: #0006; display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-box { background: #fff; border-radius: 16px; width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; }
.modal-box h2 { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.modal-actions .left { margin-right: auto; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(80px); background: #2a2320; color: #fff; padding: 10px 18px; border-radius: 10px; transition: transform .25s; z-index: 60; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--bad); }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.subtable { width: 100%; border-collapse: collapse; margin-top: 8px; }
.subtable td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.subtable input, .subtable select { padding: 6px 8px; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 11px; color: var(--muted); }
.bars .bar i { display: block; width: 100%; max-width: 34px; background: var(--brand); border-radius: 6px 6px 0 0; min-height: 2px; }
.bars .bar b { color: var(--ink); font-size: 11px; }

/* Agenda */
.week { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 8px; }
.week .col { background: var(--card); border-radius: 12px; padding: 10px; min-height: 120px; }
.week .col h4 { margin: 0 0 8px; font-size: 13px; text-transform: capitalize; }
.week .col h4.today { color: var(--brand); }
.sl { border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; cursor: pointer; font-size: 12px; background: #fff; }
.sl:hover { background: #fbf8f5; }
.sl.full { border-left-color: var(--warn); }
.sl.hidden-s { border-left-color: #aaa; opacity: .65; }
.sl b { font-size: 13px; }
.sl .meter { height: 4px; background: var(--line); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.sl .meter i { display: block; height: 100%; background: var(--brand); }
.sl input[type=checkbox] { float: right; }
.code { font-family: ui-monospace, Menlo, monospace; background: #2a2320; color: #f3ece6; padding: 12px; border-radius: 10px; white-space: pre-wrap; word-break: break-all; font-size: 12px; }
.empty { color: var(--muted); padding: 20px; text-align: center; }

/* ---------- Teksteditor ---------- */
.rte { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; background: #faf7f4; border-bottom: 1px solid var(--line); }
.rte-bar button { border: 0; background: transparent; border-radius: 6px; padding: 5px 9px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.rte-bar button:hover, .rte-bar button.on { background: #ece4dc; }
.rte-bar .sep { width: 1px; background: var(--line); margin: 3px 4px; }
.rte-area { min-height: 140px; max-height: 360px; overflow: auto; padding: 12px 14px; outline: none; line-height: 1.55; }
.rte-area:empty::before { content: attr(data-ph); color: #b5aaa2; }
.rte-area h3 { font-size: 17px; margin: 14px 0 6px; }
.rte-area p { margin: 0 0 10px; }
.rte-area ul, .rte-area ol { margin: 0 0 10px; padding-left: 22px; }
.rte-src { border: 0; border-radius: 0; min-height: 200px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

/* ---------- Foto's ---------- */
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.imgcell { position: relative; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: #f3eee9; border: 1px solid var(--line); }
.imgcell.main { outline: 2px solid var(--brand); outline-offset: 1px; }
.imgcell img { width: 100%; height: 100%; object-fit: cover; }
.imgcell .tag { position: absolute; left: 6px; top: 6px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
.imgtools { position: absolute; right: 4px; bottom: 4px; display: flex; gap: 3px; }
.imgtools button { width: 26px; height: 26px; border: 0; border-radius: 6px; background: rgba(255,255,255,.95); cursor: pointer; font-size: 12px; }
.imgadd { aspect-ratio: 4/3; border: 2px dashed var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-size: 26px; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.imgadd span { font-size: 12px; font-weight: 600; }
.imgadd:hover { border-color: var(--brand); color: var(--brand); }
.optimg { width: 92px; position: relative; }
.optimg img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; display: block; }
.optimg .rm { position: absolute; left: 54px; top: 0; width: 20px; height: 20px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 1px 4px #0003; cursor: pointer; font-size: 10px; }
.actname { display: flex; gap: 10px; align-items: center; }
.actname img { width: 48px; height: 36px; object-fit: cover; border-radius: 6px; }
.inline-row { display: flex; gap: 12px; align-items: center; }
.switch { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 14px; cursor: pointer; }
.switch input { display: none; }
.switch span { width: 40px; height: 22px; border-radius: 99px; background: #d7cec6; position: relative; transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { left: 21px; }
.modal-box { width: min(900px, 100%); }

/* ---------- Kalender ---------- */
.calbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; }
.calbar > * { width: auto; }
.seg { display: inline-flex; background: #f1ebe5; border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px #0001; }
.calnav { display: inline-flex; gap: 4px; }
.caltitle { font-size: 17px; text-transform: capitalize; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.month .mh { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; padding: 2px 6px; }
.mc { background: var(--card); border-radius: 10px; min-height: 112px; padding: 7px 8px; cursor: pointer; border: 1px solid transparent; font-size: 12px; overflow: hidden; }
.mc:hover { border-color: var(--brand); }
.mc.out { opacity: .45; }
.mc.today { border-color: var(--brand); }
.mc-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.mc .dn { font-weight: 700; font-size: 14px; }
.mc.today .dn { background: var(--brand); color: #fff; border-radius: 99px; padding: 0 7px; }
.dp { background: #2a2320; color: #fff; border-radius: 99px; padding: 1px 7px; font-size: 11px; font-weight: 600; margin-left: 6px; }
.mg { background: #f6f1ec; border-left: 3px solid var(--brand); border-radius: 5px; padding: 2px 6px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk { display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); gap: 8px; }
.wcol { background: var(--card); border-radius: 12px; padding: 8px; min-height: 260px; }
.wcol.today { box-shadow: inset 0 0 0 2px var(--brand); }
.wh { font-weight: 700; font-size: 13px; text-transform: capitalize; padding: 4px 4px 8px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.bk { display: block; width: 100%; text-align: left; border: 0; border-left: 4px solid var(--ok); background: #f6f1ec; border-radius: 7px; padding: 6px 8px; margin-bottom: 5px; font: inherit; font-size: 12px; cursor: pointer; color: var(--ink); line-height: 1.35; }
.bk:hover { background: #efe7df; }
.bk .pp { float: right; font-weight: 700; }
.bk.s-pending { border-left-color: var(--warn); }
.bk.s-cancelled { border-left-color: var(--bad); opacity: .6; text-decoration: line-through; }
.bk.s-completed { border-left-color: var(--info); }
.dayslot { padding: 14px 16px; }
.ds-h { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.ds-t { font-size: 22px; font-weight: 800; min-width: 70px; }
.meter.big { flex: 1; max-width: 240px; height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; margin-left: auto; }
.meter.big i { display: block; height: 100%; background: var(--brand); }
@media (max-width: 760px) {
  .month { gap: 3px; }
  .mc { min-height: 62px; padding: 4px; }
  .mc .mg, .mc .sub { display: none; }
  .mc-h { flex-direction: column; align-items: flex-start; gap: 2px; }
  .dp { margin: 0; font-size: 10px; padding: 0 5px; }
  .mc .dp .w { display: none; }
  .calbar .caltitle { width: 100%; order: -1; }
  .inline-row { flex-direction: column; align-items: stretch; }
  .ds-h { flex-wrap: wrap; }
  .meter.big { max-width: none; flex-basis: 100%; }
}

/* ---------- Producten ---------- */
.thumb { width: 52px; height: 40px; object-fit: cover; border-radius: 7px; display: inline-grid; place-items: center; background: #f3eee9; }
.prodpick { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pp-row { display: grid; grid-template-columns: 28px 48px 1fr auto 56px; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #fbf9f7; }
.pp-row:last-child { border-bottom: 0; }
.pp-row.on { background: #fff; }
.pp-row:not(.on) { opacity: .7; }
.pp-row.inactive .pp-name b { text-decoration: line-through; }
.pp-row img, .pp-row .noimg { width: 48px; height: 38px; object-fit: cover; border-radius: 6px; display: grid; place-items: center; background: #f0e9e2; font-size: 14px; }
.pp-row .chk { margin: 0; }
.pp-name { min-width: 0; }
.pp-name .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-price { white-space: nowrap; font-size: 13px; }
.pp-price input { width: 74px; padding: 6px 8px; }
.pp-move { display: flex; gap: 2px; justify-content: flex-end; }
.pp-move button { width: 24px; height: 24px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; }
.prodimg { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.prodimg img { width: 160px; height: 120px; object-fit: cover; border-radius: 10px; }
@media (max-width: 600px) { .pp-row { grid-template-columns: 28px 40px 1fr; } .pp-price, .pp-move, .pp-row > .sub, .pp-row > span:empty { grid-column: 3; } }

/* ---------- Slepen ---------- */
.drag { cursor: grab; color: #a99d94; font-size: 16px; letter-spacing: -3px; padding: 4px 6px; user-select: none; touch-action: none; border-radius: 6px; display: inline-block; line-height: 1; }
.drag:hover { background: #efe7df; color: var(--ink); }
.dragging { opacity: .6; background: #fff7e6 !important; box-shadow: 0 4px 14px #0002; }
.dragging .drag { cursor: grabbing; }
.dragcell { width: 30px; }
.pp-row { grid-template-columns: 26px 28px 48px 1fr auto 20px; }
.bulkbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #fff7e6; border: 1px solid #f3dfb3; border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
.selcell { width: 32px; }

/* ---------- Tijdsloten maandoverzicht ---------- */
.bulkbar.sticky { position: sticky; top: 8px; z-index: 5; box-shadow: 0 4px 14px #0001; }
.smonth .mc { cursor: default; min-height: 118px; }
.smonth .mc:hover { border-color: transparent; }
.smonth .mc.dsel { border-color: var(--brand); background: #fff8f6; }
.smonth .mh { cursor: pointer; border-radius: 6px; text-align: center; }
.smonth .mh:hover { background: #ece4dc; color: var(--ink); }
.dchk { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.dchk input { width: 14px; height: 14px; }
.schip { display: flex; align-items: center; gap: 4px; border-left: 3px solid var(--ok); background: #f6f1ec; border-radius: 5px; padding: 2px 4px 2px 6px; margin-bottom: 3px; cursor: pointer; font-size: 12px; user-select: none; }
.schip .cap { margin-left: auto; color: var(--muted); font-size: 11px; }
.schip .ed { border: 0; background: transparent; cursor: pointer; padding: 0 2px; font-size: 11px; opacity: 0; color: var(--muted); }
.schip:hover .ed { opacity: 1; }
.schip.full { border-left-color: var(--warn); }
.schip.hidden-s { border-left-color: #aaa; opacity: .6; }
.schip.ssel { background: #2a2320; color: #fff; }
.schip.ssel .cap, .schip.ssel .ed { color: #e8ddd3; }
@media (max-width: 760px) {
  .smonth .mc { min-height: 70px; }
  .schip .cap, .schip .ed { display: none; }
  .schip { font-size: 10px; padding: 1px 3px; }
  .pp-row { grid-template-columns: 26px 28px 40px 1fr; }
}
.is-dragging, .is-dragging * { cursor: grabbing !important; user-select: none !important; }
.presult { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-top: 6px; cursor: pointer; }
.presult:hover { border-color: var(--brand); }
.note-box { background: #fff7e6; border: 1px solid #f3dfb3; border-radius: 10px; padding: 10px 12px; margin-top: 12px; font-size: 13px; }

/* ---- Accounts / 2FA ---- */
.login .linkbtn { color: var(--muted); display: block; width: 100%; text-align: center; margin-top: 12px; font-size: 13px; }
.login .linkbtn:hover { color: var(--ink); text-decoration: underline; }
.login .ok { color: var(--ok); margin-top: 8px; }
.qrbox { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.qrbox .qr { background: #fff; padding: 10px; border-radius: 10px; border: 1px solid var(--line); line-height: 0; }
.qrbox .qr svg, .qrbox .qr img { width: 180px; height: 180px; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 2px; background: var(--bg); padding: 6px 10px; border-radius: 6px; word-break: break-all; display: inline-block; }
.perm-list { display: grid; gap: 8px; margin: 6px 0 4px; }
.perm-list label { display: flex; gap: 8px; align-items: center; font-weight: normal; }
.perm-list input { width: auto; margin: 0; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--bg); margin: 1px 2px; white-space: nowrap; }
.pill.admin { background: #fdb02233; }
.pill.off { background: var(--bad-bg); color: var(--bad); }
.pill.on { background: var(--ok-bg); color: var(--ok); }
.notice { background: #fdb0221f; border: 1px solid #fdb02266; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }
