/* TWB Websitebeheer: bewerken op de pagina. Eigen code van The Wise Builder. */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/admin/fonts/inter/inter-v20-latin-regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("/admin/fonts/inter/inter-v20-latin-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/admin/fonts/inter/inter-v20-latin-600.woff2") format("woff2"); }

:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --page: #f5f5f7;
  --accent: #0071e3;
  --accent-hover: #0062c4;
  --ok: #1a7f37;
  --warn: #b25000;
  --error: #c62828;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
  font-size: 14px;
}
[hidden] { display: none !important; }

/* Inlogscherm */
.login {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 32px rgba(0,0,0,.06);
  padding: 36px 32px;
  text-align: center;
}
.login-card img { width: 64px; height: 64px; }
.login-card h1 { font-size: 22px; font-weight: 600; margin: 16px 0 6px; letter-spacing: -0.01em; }
.login-card p { color: var(--muted); margin: 0 0 24px; line-height: 1.5; }
.login-card .error { color: var(--error); margin-top: 16px; }

/* Knoppen */
.btn {
  font: inherit;
  font-weight: 500;
  border-radius: 980px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn:hover { background: var(--page); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.wide { width: 100%; justify-content: center; padding: 12px 16px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--page); }

/* Editor */
.editor { height: 100%; display: flex; flex-direction: column; }
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 30px; height: 30px; flex: none; }
.brand strong { font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.brand span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }
.page-select {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 980px;
  padding: 7px 14px;
  background: #fff;
  color: var(--ink);
  max-width: 220px;
}
.status { color: var(--muted); white-space: nowrap; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.status:empty { display: none; }
.status.dirty { color: var(--warn); }
.status.ok { color: var(--ok); }
.status.error { color: var(--error); }

.hint {
  background: #eef5ff;
  color: #0b4a8f;
  border-bottom: 1px solid #d6e6fb;
  padding: 8px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hint .btn { padding: 4px 10px; font-size: 12px; }

.stage { flex: 1; position: relative; background: var(--page); }
.stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(245,245,247,.85);
  color: var(--muted);
  font-weight: 500;
}

.bar > .btn, .bar > select, .bar > .view-switch { flex-shrink: 0; }
@media (max-width: 1600px) {
  .brand span { display: none; }
}
.lbl-short { display: none; }
@media (max-width: 1360px) {
  /* Middelgrote schermen: kortere balk, zodat alles op één regel blijft. */
  .brand strong { display: none; }
  .bar .lbl-long { display: none; }
  .bar .lbl-short { display: inline; }
  .bar { gap: 8px 8px; }
  .bar > .btn { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 760px) {
  /* Op de gsm een compacte balk in drie regels, zodat de website zelf zo veel mogelijk plaats krijgt:
     (1) logo en weergave, (2) pagina, annuleren en opslaan, (3) de rest. */
  .bar { padding: 8px 12px; gap: 6px; }
  .bar > * { order: 6; }
  .brand { order: 0; }
  .brand strong { display: none; }
  .view-switch { order: 1; }
  .view-switch button { padding: 6px 11px; }
  .spacer { order: 2; flex: 0 0 100%; height: 0; }
  .page-select { order: 3; flex: 1 1 0; min-width: 0; max-width: none; }
  #discard, #save { order: 4; }
  .bar::after { content: ''; order: 5; flex: 0 0 100%; height: 0; }
  /* Zonder modules (geen keuze Website/Bestellingen/Workshops): het logo mee op de regel van de pagina. */
  .bar:has(.view-switch[hidden]) .spacer { display: none; }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  .bar > .btn { padding: 7px 12px; font-size: 13px; }
  .bar > .btn.ghost { padding: 6px 10px; }

  /* Op de gsm: meldingen (Opgeslagen, fouten) op een eigen regel onder de knoppen in plaats van verborgen. */
  .status { order: 20; flex-basis: 100%; white-space: normal; }
  .hint { padding: 6px 12px; font-size: 12px; }
}
@media (max-width: 360px) {
  /* Heel smalle gsm: geen logo naast de keuze Website/Bestellingen/Workshops, zodat die op één regel past. */
  .bar:has(.view-switch:not([hidden])) .brand { display: none; }
  .bar > .btn { padding: 7px 10px; }
}

/* Invoervelden op het inlogscherm */
.field { display: grid; gap: 6px; text-align: left; margin-bottom: 14px; }
.field span { font-weight: 500; font-size: 13px; color: var(--ink); }
.field input, .modal input {
  font: inherit;
  font-size: 15px;
  padding: 11px 14px;
  border: 1px solid #d2d2d7;
  border-radius: 10px;
  outline: none;
  width: 100%;
}
.field input:focus, .modal input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,113,227,.15); }
#login-code { font-size: 22px; letter-spacing: 4px; text-align: center; }
.login-info { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.login-card .login-privacy { font-size: 12px; margin: 20px 0 0; }
.login-privacy a { color: inherit; text-decoration: underline; }
#step-code .btn.ghost { margin-top: 8px; }

/* Venster voor de paginatitel */
.modal {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  width: min(480px, calc(100% - 32px));
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal::backdrop { background: rgba(0,0,0,.3); }
.modal h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.modal p { margin: 0 0 14px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.replace-list { margin: 0; padding-left: 18px; max-height: 50vh; overflow: auto; font-size: 14px; }
.replace-list > li { margin-bottom: 10px; }
.replace-list ul { margin: 4px 0 0; padding-left: 16px; color: var(--muted); font-size: 13px; }

/* ---------- Weergaven en dialogen van de modules ---------- */
.view-switch { display: inline-flex; background: var(--page); border: 1px solid var(--line); border-radius: 980px; padding: 3px; margin-left: 12px; }
.view-switch button { border: 0; background: transparent; padding: 6px 14px; border-radius: 980px; font: 500 13px/1 inherit; font-family: inherit; color: var(--muted); cursor: pointer; }
.view-switch button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.editor.tool-mode .site-only { display: none !important; }
.lg-pending { background: #fff4e5; border: 1px solid #f0a040; }
.lg-confirmed { background: #e8f5ec; border: 1px solid #34a853; }
.lg-closed { background: repeating-linear-gradient(45deg, #ececf0, #ececf0 3px, #f7f7f9 3px, #f7f7f9 6px); border: 1px solid var(--line); }
.modal-wide { width: min(640px, calc(100vw - 32px)); }
.modal select, .modal textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.modal textarea { resize: vertical; }
.btn.danger { background: var(--error); border-color: var(--error); color: #fff; font-weight: 600; }
.btn.danger-ghost { border-color: transparent; background: transparent; color: var(--error); }
.btn.danger-ghost:hover { background: #fdecec; }
.modal-actions .spacer { flex: 1; }
@media (max-width: 700px) {
  .view-switch { margin-left: 0; }
}

/* ---------- Bestellingen en Workshops (modules.js) ---------- */
.tool { flex: 1; overflow: auto; padding: 22px 28px 40px; background: var(--page); }
.tw-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.tw-title h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.tw-title p { margin: 4px 0 0; color: var(--muted); }
.tw-tools, .tw-nav, .tw-inline, .tw-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tw-nav { margin: 6px 0 8px; }
.tw-nav input[type="date"] { font: inherit; border: 1px solid var(--line); border-radius: 980px; padding: 6px 12px; background: #fff; color: var(--ink); }
.tw-label { font-size: 17px; font-weight: 600; margin: 0 8px; }
.tw-label::first-letter { text-transform: uppercase; }
.tw-help { display: flex; align-items: center; gap: 14px; background: #eef5ff; border: 1px solid #d6e6fb; color: #0b3d75; border-radius: 12px; padding: 12px 14px; margin: 0 0 12px; }
.tw-help p { margin: 0; line-height: 1.5; flex: 1; }
.btn.small { padding: 5px 11px; font-size: 12.5px; }
.btn.danger, .btn.danger:hover { background: var(--error); border-color: var(--error); color: #fff; }
.btn.danger-ghost { border-color: transparent; background: transparent; color: var(--error); }
.btn.danger-ghost:hover { background: #fdecec; }
.btn.ghost.small { color: var(--accent); }
.tw-status { min-height: 18px; margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.tw-status.ok { color: var(--ok); }
.tw-status.error { color: var(--error); }
.tw-status.warn { color: #7a4a00; background: #fff4e5; border: 1px solid #f0c080; border-radius: 10px; padding: 8px 12px; }
.tw-muted { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.segmented { display: inline-flex; background: #ececf0; border-radius: 980px; padding: 3px; gap: 2px; }
.segmented .btn { border: 0; background: transparent; padding: 5px 12px; font-size: 12.5px; color: var(--muted); }
.segmented .btn.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.segmented-status .btn.active.s-besteld { background: #fff4e5; color: #8a4b00; }
.segmented-status .btn.active.s-klaar { background: #e8f5ec; color: #1a7f37; }
.segmented-status .btn.active.s-afgehaald { background: #e9e9ee; color: #3a3a3c; }
.tw-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.tw-stats div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; }
.tw-stats strong { font-size: 20px; letter-spacing: -0.01em; }
.tw-stats span { color: var(--muted); font-size: 12px; }
.tw-empty { background: #fff; border: 1px dashed #d2d2d7; border-radius: 14px; padding: 28px; text-align: center; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.tw-empty strong { color: var(--ink); font-size: 15px; }
.tw-orders { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; align-items: start; }
.tw-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.tw-card h2 { margin: 0 0 2px; font-size: 16px; }
.tw-production { position: sticky; top: 0; }
.tw-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tw-table td { padding: 6px 0; border-bottom: 1px solid #f0f0f2; }
.tw-table .num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.tw-table .tw-cat th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 0 4px; }
.tw-table tr.is-done td { color: var(--muted); text-decoration: line-through; }
.tw-order-list { display: flex; flex-direction: column; gap: 10px; }
.tw-order { display: grid; grid-template-columns: 86px minmax(0, 1fr) auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.tw-order.is-besteld { border-left: 4px solid #f0a040; }
.tw-order.is-klaar { border-left: 4px solid #34a853; }
.tw-order.is-afgehaald { border-left: 4px solid #c7c7cc; opacity: .75; }
.tw-order-time { background: #fafafb; display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 1px solid var(--line); padding: 10px 4px; }
.tw-order-time strong { font-size: 22px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tw-order-time span { color: var(--muted); font-size: 11px; }
.tw-order-body { padding: 12px 14px; min-width: 0; }
.tw-order-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.tw-order-head h3 { margin: 0; font-size: 15px; }
.tw-code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.tw-tag { font-size: 11px; background: #f2f2f5; border-radius: 980px; padding: 2px 8px; color: var(--muted); }
.tw-items { list-style: none; margin: 8px 0 6px; padding: 0; font-size: 13.5px; }
.tw-items li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.tw-items .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tw-items .tw-total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; font-weight: 600; }
.tw-remark { margin: 6px 0 0; font-size: 13px; background: #fff8e1; border-radius: 8px; padding: 6px 9px; }
.tw-note { margin: 6px 0 0; font-size: 13px; color: #5a3fbf; }
.tw-warn { margin: 6px 0 10px; padding: 10px 12px; border-radius: 10px; background: #fff4e5; border: 1px solid #f0c080; color: #7a4a00; font-size: 13px; line-height: 1.45; }
.tw-contact { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.tw-contact a { color: var(--accent); text-decoration: none; }
.tw-order-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 12px; }
.tw-week-scroll { overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding-bottom: 6px; }
.tw-week-scroll .tw-week-day, .tw-week-scroll .tw-ws-day { scroll-snap-align: start; }
.tw-week { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 10px; min-width: 980px; }
.tw-week-day { text-align: left; font: inherit; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 5px; cursor: pointer; min-height: 160px; color: var(--ink); }
.tw-week-day:hover { border-color: var(--accent); }
.tw-week-day.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tw-week-head { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.tw-week-head strong { text-transform: capitalize; }
.tw-week-head span { color: var(--muted); font-size: 12px; }
.tw-week-count { margin: 0; font-size: 12px; color: var(--muted); }
.tw-week-row { font-size: 12.5px; border-radius: 6px; padding: 3px 6px; background: #fff4e5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-week-row.is-klaar { background: #e8f5ec; }
.tw-week-row.is-afgehaald { background: #f2f2f5; color: var(--muted); }
.tw-legend { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; margin-left: auto; }
.tw-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.tw-legend .lg-window { background: #eef5ff; border: 1px solid #9cc3f0; }
.tw-legend .lg-pending { background: #fff4e5; border: 1px solid #f0a040; }
.tw-legend .lg-confirmed { background: #e8f5ec; border: 1px solid #34a853; }
.tw-pending { background: #fff4e5; border: 1px solid #f0c080; border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.tw-pending strong { color: #7a4a00; }
.tw-pending-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tw-ws-grid { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 10px; min-width: 1080px; }
.tw-ws-day { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 180px; }
.tw-ws-day.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tw-ws-day.is-past { background: #fafafb; }
.tw-ws-day.is-past .tw-window { opacity: .7; }
.tw-ws-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.tw-ws-head div { display: flex; flex-direction: column; }
.tw-ws-head strong { text-transform: capitalize; font-size: 14px; }
.tw-ws-head span { color: var(--muted); font-size: 12px; }
.tw-ws-empty { color: var(--muted); font-size: 12px; text-align: center; margin: 10px 0; }
.tw-window { border: 1px solid #9cc3f0; background: #f4f9ff; border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.tw-window.is-private { border-style: dashed; }
.tw-window.is-auto { border-color: #b9d8c2; background: #f3faf5; }
.tw-window-head { text-align: left; font: inherit; background: none; border: 0; padding: 2px 3px; cursor: pointer; display: flex; flex-direction: column; color: var(--ink); border-radius: 8px; }
.tw-window-head:hover { background: #e6f0fd; }
.tw-window-head strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.tw-window-head span { font-size: 12.5px; }
.tw-window-head small { font-size: 11px; color: var(--muted); }
.tw-window-free { margin: 0 3px; font-size: 12px; color: var(--muted); }
.tw-session { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.tw-session-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; font-size: 12px; line-height: 1.35; }
.tw-cap { flex: none; background: #e8f5ec; color: #1a7f37; border-radius: 980px; padding: 1px 7px; font-weight: 600; font-size: 11px; line-height: 16px; white-space: nowrap; }
.tw-cap.is-full { background: #f2f2f5; color: var(--muted); }
.btn.tw-booking { justify-content: space-between; border-radius: 8px; padding: 5px 8px; font-size: 12.5px; width: 100%; }
.btn.tw-booking .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.btn.tw-booking .pp { color: var(--muted); }
.btn.tw-booking.is-pending { background: #fff4e5; border-color: #f0a040; }
.btn.tw-booking.is-confirmed { background: #e8f5ec; border-color: #34a853; }
.tw-add-booking { align-self: flex-start; }
.modal.tw-dialog { width: min(720px, calc(100% - 32px)); max-height: calc(100vh - 40px); }
.modal.tw-dialog.modal-narrow { width: min(460px, calc(100% - 32px)); }
.tw-intro { line-height: 1.5; }
.tw-dialog-body { display: flex; flex-direction: column; gap: 6px; }
.tw-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin-top: 6px; }
.tw-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tw-grid .field { margin: 0; }
.tw-grid .span { grid-column: 1 / -1; }
.tw-grid .span2 { grid-column: span 2; }
.field .help { color: var(--muted); font-size: 12px; line-height: 1.4; font-weight: 400; }
.field select, .field textarea, .modal select, .modal textarea { font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid #d2d2d7; border-radius: 10px; background: #fff; width: 100%; color: var(--ink); }
.field textarea { resize: vertical; }
.tw-sub { font-size: 14px; margin: 16px 0 2px; }
.tw-check { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafafb; cursor: pointer; margin: 4px 0; }
.tw-check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--accent); }
.tw-check strong { display: block; font-weight: 600; }
.tw-check small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.4; }
.tw-hours { display: grid; gap: 6px; }
.tw-hours-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; }
.tw-hours-row input { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.tw-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.tw-chip { display: inline-flex; align-items: center; gap: 4px; background: #f2f2f5; border-radius: 980px; padding: 3px 4px 3px 11px; font-size: 13px; }
.tw-items-edit { display: flex; flex-direction: column; gap: 6px; }
.tw-item-row { display: grid; grid-template-columns: 70px auto minmax(0, 1fr) auto 90px auto; gap: 6px; align-items: center; }
.tw-item-row input { font: inherit; padding: 8px 10px; border: 1px solid #d2d2d7; border-radius: 8px; width: 100%; }
.tw-item-row .x, .tw-item-row .eur { color: var(--muted); }
.tw-item-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.tw-item-add select { flex: 1; min-width: 220px; font: inherit; padding: 8px 10px; border: 1px solid #d2d2d7; border-radius: 10px; }
.tw-items-total { font-weight: 600; text-align: right; margin: 6px 0 0; }
.tw-modes { border: 0; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tw-modes legend { font-weight: 500; font-size: 13px; margin-bottom: 6px; }
.tw-mode { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.tw-mode:has(input:checked) { border-color: var(--accent); background: #f2f8ff; }
.tw-mode strong { display: block; }
.tw-mode small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.tw-mode input { margin-top: 3px; accent-color: var(--accent); }
.tw-types { display: flex; flex-direction: column; gap: 10px; }
.tw-type { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fafafb; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.tw-type .tw-grid { width: 100%; }
.modal-actions .spacer { flex: 1; }
.modal .error { color: var(--error); min-height: 1px; margin: 8px 0 0; }
@media (max-width: 900px) {
  .tool { padding: 14px; }
  .tw-orders { grid-template-columns: minmax(0, 1fr); }
  .tw-production { position: static; }
  .tw-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tw-order { grid-template-columns: 70px minmax(0, 1fr); }
  .tw-order-side { grid-column: 1 / -1; flex-direction: row; align-items: center; border-top: 1px solid var(--line); }
  .tw-grid, .tw-grid-4, .tw-modes { grid-template-columns: minmax(0, 1fr); }
  .tw-grid .span2 { grid-column: auto; }
  .tw-item-row { grid-template-columns: 56px auto minmax(0, 1fr) auto; }
  .tw-legend { margin-left: 0; }
}

/* ---------- Geavanceerd en de aan/uit-knop (modules.js) ---------- */
.btn.tw-toggle { gap: 8px; }
.btn.tw-toggle .dot { width: 9px; height: 9px; border-radius: 50%; background: #c7c7cc; flex: none; }
.btn.tw-toggle .dot.on { background: #34a853; box-shadow: 0 0 0 3px rgba(52,168,83,.18); }
.btn.tw-toggle.is-off { border-color: #f0c080; background: #fff8ec; color: #7a4a00; }
.modal.tw-dialog.modal-xl { width: min(980px, calc(100% - 32px)); height: min(760px, calc(100vh - 40px)); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.modal.tw-dialog.modal-xl > form { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.modal.tw-dialog.modal-xl > form > h2 { padding: 20px 24px 0; }
.modal.tw-dialog.modal-xl > form > .tw-intro { padding: 0 24px; margin-bottom: 10px; }
.modal.tw-dialog.modal-xl > form > .error { padding: 0 24px; }
.modal.tw-dialog.modal-xl .modal-actions { padding: 12px 24px 18px; margin: 0; border-top: 1px solid var(--line); background: #fff; }
.tw-dialog-body.tw-adv { flex: 1; min-height: 0; display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 0; border-top: 1px solid var(--line); }
.tw-adv-nav { display: flex; flex-direction: column; gap: 2px; padding: 12px; background: #fafafb; border-right: 1px solid var(--line); overflow: auto; }
.tw-adv-nav .btn { justify-content: flex-start; border: 0; border-radius: 10px; background: transparent; color: var(--ink); padding: 9px 12px; white-space: normal; text-align: left; }
.tw-adv-nav .btn:hover { background: #ececf0; }
.tw-adv-nav .btn.active { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1); color: var(--accent); font-weight: 600; }
.tw-adv-panels { overflow: auto; padding: 16px 24px 24px; min-width: 0; }
.tw-adv-panel { display: flex; flex-direction: column; gap: 8px; }
.tw-adv-title { font-size: 18px; margin: 0; }
.tw-tpl { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; background: #fafafb; margin-bottom: 8px; }
.tw-tpl > strong { font-size: 14px; }
.tw-tpl .field { margin: 0; }
.tw-tpl textarea { font-size: 14px; line-height: 1.5; }
.tw-tpl .btn { align-self: flex-start; }
@media (max-width: 760px) {
  .tw-dialog-body.tw-adv { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .tw-adv-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .tw-adv-nav .btn { white-space: nowrap; }
  .tw-adv-panels { padding: 14px; }
}

/* ---------- Toegang en meldingen (toegang.js) ---------- */
.tw-access { width: min(720px, calc(100vw - 32px)); overflow-x: hidden; }
.tw-access.is-busy { cursor: progress; }
.tw-access.is-busy .acc-list, .tw-access.is-busy .acc-add { opacity: .6; pointer-events: none; }
.acc-list { display: grid; gap: 8px; margin: 4px 0 6px; }
.acc-locks { display: grid; gap: 8px; margin: 14px 0 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.acc-locks h3 { margin: 0; font-size: 15px; }
.acc-locks > .btn { justify-self: start; }
.acc-locks .acc-row input { min-width: 0; width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.acc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.acc-who { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.acc-who strong { font-size: 14px; overflow-wrap: anywhere; }
.acc-state { font-size: 12px; font-weight: 600; justify-self: start; border-radius: 999px; padding: 2px 9px; }
.acc-state.is-fixed { background: #f0f0f3; color: var(--muted); }
.acc-state.is-ok { background: #e7f6ec; color: #1e7b3c; }
.acc-state.is-wait { background: #fff4e0; color: #8a5300; }
.acc-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.acc-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.acc-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.acc-check input:disabled + span { color: var(--muted); }
.acc-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.acc-del { color: #c0392b; }
.acc-count { font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.acc-add { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 10px; }
.acc-add h3 { margin: 0; font-size: 15px; }
.acc-add .field { margin: 0; }
.acc-add .btn { justify-self: start; }
.acc-note { font-size: 12px; margin: 0 !important; }
.acc-readonly { font-size: 13px; }
.acc-msg { min-height: 1em; margin: 12px 0 0 !important; font-size: 13px; }
.acc-msg.is-error { color: #c0392b; }
.acc-msg.is-ok { color: #1e7b3c; }
.acc-msg.is-warn { color: #8a5300; }
@media (max-width: 640px) {
  .acc-row { grid-template-columns: minmax(0, 1fr); }
  .acc-actions { justify-content: flex-start; }
}

/* Voorraad (Bestellingen) */
.tw-subtitle { margin: 6px 0 4px; font-size: 15px; font-weight: 700; }
.tw-soldout { margin-bottom: 18px; }
.tw-soldout-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 8px; }
.tw-soldout-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafafb; cursor: pointer; font-size: 14px; min-width: 0; }
.tw-soldout-item input { width: 18px; height: 18px; flex: none; accent-color: #b42318; }
.tw-soldout-item span { min-width: 0; overflow-wrap: anywhere; }
.tw-soldout-item.is-on { border-color: #f1b5ae; background: #fef3f2; color: #b42318; font-weight: 600; }
.tw-stock { margin-bottom: 14px; }
.tw-stock .tw-table td.num { white-space: nowrap; }
.tw-stock tr.is-soldout td { color: #b42318; font-weight: 600; }
.tw-stock-row { width: 100%; align-items: center; }
.tw-stock-qty { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; margin-right: 8px; }
.tw-stock-qty input { width: 90px; }
.tw-stock-row .tw-push { margin-left: auto; }
.tw-stock-summary { margin: 2px 0 0; font-size: 13px; color: var(--muted, #6e6e73); }

/* Een gesloten venster is altijd onzichtbaar, ook als een regel hierboven display zet (bv. de brede vensters met display:flex).
   Zonder deze regel bleef bv. "Geavanceerd" na sluiten met Escape als los blok onderaan de pagina staan. */
dialog:not([open]) { display: none !important; }
.tw-ws-day.is-clickable { cursor: pointer; }
.tw-ws-day.is-clickable:hover { border-color: #b9d5f7; box-shadow: 0 0 0 3px rgba(0,113,227,.08); }
.tw-ws-day.is-clickable .tw-window, .tw-ws-day.is-clickable .tw-booking { cursor: auto; }

/* Toegang: hoofdadres */
.acc-state.is-fixed { background: #e8f1fc; color: #0058b0; }
/* Gedimde knop bij een hoofdadres (kan alleen The Wise Builder): uitleg pas bij erover gaan, focus of tikken. */
.acc-row { position: relative; }
.btn.acc-locked, .btn.acc-locked:hover { color: #a1a1a6; background: #f5f5f7; border-color: #e5e5ea; cursor: not-allowed; }
.acc-tip { position: absolute; left: 10px; right: 10px; bottom: calc(100% - 6px); z-index: 2; padding: 8px 11px; border-radius: 9px; background: #1d1d1f; color: #fff; font-size: 12.5px; line-height: 1.45; box-shadow: 0 6px 18px rgba(0,0,0,.18); opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s, transform .15s, visibility .15s; pointer-events: none; }
.acc-row:has(.acc-locked:hover) .acc-tip, .acc-row:has(.acc-locked:focus-visible) .acc-tip, .acc-row.show-tip .acc-tip { opacity: 1; visibility: visible; transform: none; }
.acc-me { font-weight: 400; color: var(--muted); }

/* Info-knopje (i): uitleg bij erover gaan, Tab of tikken (bewerken.js, TWB_ADMIN.info) */
.tw-info { display: inline-grid; place-items: center; width: 18px; height: 18px; margin: 0 0 0 6px; padding: 0; border: 1.5px solid currentColor; border-radius: 50%; background: transparent; color: #8a8a8f; font: italic 700 11px/1 Georgia, 'Times New Roman', serif; cursor: help; vertical-align: -3px; flex: none; }
.tw-info:hover, .tw-info:focus-visible, .tw-info[aria-expanded="true"] { color: var(--accent, #0071e3); outline: none; }
.tw-info:focus-visible { box-shadow: 0 0 0 3px rgba(0,113,227,.25); }
@media (pointer: coarse) { .tw-info { width: 22px; height: 22px; font-size: 12px; } }
.tw-tipbox { position: fixed; z-index: 2147483000; max-width: min(340px, calc(100vw - 24px)); padding: 10px 13px; border-radius: 10px; background: #1d1d1f; color: #fff; font: 400 13px/1.5 Inter, system-ui, sans-serif; white-space: pre-line; box-shadow: 0 8px 24px rgba(0,0,0,.22); pointer-events: none; }
.tw-tipbox[hidden] { display: none; }
.tw-headline { display: flex; align-items: center; flex-wrap: wrap; gap: 0; }
.modal p.tw-field-label, .tw-field-label { margin: 12px 0 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.tw-to-list { margin-bottom: 8px; }
.acc-state-row { display: inline-flex; align-items: center; }
.acc-check span .tw-info, .acc-state-row .tw-info { color: #8a8a8f; }
.tw-to-item input { accent-color: var(--accent, #0071e3); }
.tw-to-item.is-on, .tw-to-item:has(input:checked) { border-color: #b9d6f7; background: #eef5ff; color: var(--ink); font-weight: 600; }
