@font-face {
  font-family: "Poppins";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("assets/poppins-400.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("assets/poppins-500.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("assets/poppins-600.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("assets/poppins-700.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  src: url("assets/poppins-800.woff2") format("woff2");
}

:root {
  /* — Vetts-huisstijl (uit shopify-theme/v2-dev/hero-chat.css) — */
  --vp: #00bf63;
  --vpd: #00a654;
  --vpl: #e6f9ef;
  --purple: #a78bfa;
  --purplel: #ede9fe;
  --w: #fff;
  --b: #1d1d1f;
  --g9: #242424;
  --g6: #6e6e73;
  --g4: #969696;
  --g2: #e9e9e9;
  --g1: #f3f3f3;
  --g0: #f8f8f8;
  --red: #ef4444;
  --redl: #fef2f2;
  /* warning-palet + tekstpaars uit hero-chat.css; --amber verdonkerd naar
     #8a5606 voor AA-contrast op 12px tekst (#d97706 haalt maar ~3,2:1) */
  --purpled: #6d28d9;
  --amber: #8a5606;
  --amberl: #fff8eb;
  --amber-line: #f3d599;

  --bg: var(--g0);
  --panel: var(--w);
  --panel2: var(--g0);
  --line: var(--g2);
  --text: var(--b);
  --muted: var(--g6);
  --green: var(--vp);
  --green-d: var(--vpd);
  /* AA-conforme tekstvarianten voor kleine status-pills op de lichte tint-
     achtergrond (--vpl/--redl). --green-d (#00a654) haalt maar 2,91:1 en --red
     (#ef4444) 3,44:1 op 10–12px; deze donkerdere tinten halen ~5,5:1. Bewust
     APART van het brand-groen/rood (dat op knoppen/switches blijft staan). */
  --green-dd: #00713a;
  --danger: var(--red);
  --red-d: #c0271f;
  --radius: 18px;
  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(560px 360px at 8% -8%, rgba(0, 191, 99, 0.09), transparent 60%),
    radial-gradient(520px 340px at 108% 8%, rgba(167, 139, 250, 0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
code { font: 12px/1 ui-monospace, Menlo, monospace; color: var(--muted); background: var(--g1); padding: 2px 5px; border-radius: 5px; }
.err { color: var(--danger); font-size: 13px; margin-top: 4px; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.brand { font-weight: 700; letter-spacing: 0.1px; display: flex; align-items: center; gap: 10px; color: var(--g9); }
.brand .logo { height: 26px; width: auto; display: block; }
.brand-text { display: flex; align-items: baseline; gap: 6px; }
.brand-text .sep { color: var(--g4); font-weight: 400; }

/* ── Login ── */
.login {
  min-height: 100%; display: grid; place-items: center; padding: 24px;
}
.login-card {
  width: 360px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; padding: 32px 30px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 20px 48px rgba(29, 29, 31, 0.08);
}
/* align-self voorkomt dat de flex-column het logo tot kaartbreedte uitrekt */
.login-card .logo { height: 30px; width: auto; align-self: center; margin: 4px 0 2px; }
.login-card .sub { margin: -6px 0 6px; color: var(--muted); font-size: 13px; text-align: center; }
.totp-title { margin: 6px 0 -6px; font-size: 18px; font-weight: 700; text-align: center; color: var(--g9); }
.center { text-align: center; }

/* Verplicht 2FA-instellen bij de EERSTE login (zie server.js totpSetupRequired) —
   QR gecentreerd in een lichte kaart boven de code-invoer, zodat scannen met
   de telefoon en de handmatige secret duidelijk bij elkaar staan. */
.totp-setup-block {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--g0); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; margin: 2px 0 4px;
}
.totp-setup-qr { width: 176px; height: 176px; border-radius: 8px; background: #fff; padding: 8px; }
.totp-setup-block .tab-panel-hint { margin: 0; }

/* ── Licht modal (bv. "Gebruiker toevoegen") — geen volle drawer nodig ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 30; display: flex; align-items: center;
  justify-content: center; padding: 24px;
  background: rgba(29, 29, 31, 0.36); backdrop-filter: blur(2px);
}
.modal-overlay .login-card { width: 400px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--g9); }
#user-form, #user-created-panel, #password-form, #password-changed-panel {
  display: flex; flex-direction: column; gap: 14px;
}

/* ── Side-drawer (bv. Beveiliging-detail) — schuift van rechts in, laat
   (i.t.t. de fullscreen partner-editor) een stuk van de pagina links
   zichtbaar/gedimd. NIET de .hidden-utility gebruiken voor open/dicht
   (display:none kan niet animeren) — .open regelt zichtbaarheid + schuif. ── */
.side-drawer {
  position: fixed; inset: 0; z-index: 25;
  visibility: hidden; pointer-events: none;
}
.side-drawer-back {
  position: absolute; inset: 0; background: rgba(29, 29, 31, 0.36); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity 0.2s ease;
}
.side-drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(860px, 94vw);
  background: var(--panel); display: flex; flex-direction: column;
  box-shadow: -12px 0 40px rgba(29, 29, 31, 0.18);
  transform: translateX(100%); transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.side-drawer.open { visibility: visible; pointer-events: auto; }
.side-drawer.open .side-drawer-back { opacity: 1; }
.side-drawer.open .side-drawer-panel { transform: translateX(0); }
@media (prefers-reduced-motion: reduce) {
  .side-drawer-back, .side-drawer-panel { transition: none; }
}
.side-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.side-drawer-head h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--g9); }
.side-drawer-body { padding: 22px 24px 28px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 22px; }
.side-drawer-section-h { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.side-drawer-mode-row { display: flex; align-items: center; gap: 10px; }
.side-drawer-mode-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700; border: 1px solid var(--line); background: var(--g1); color: var(--muted);
}
.side-drawer-mode-badge.mode-warn { background: var(--amberl); color: var(--amber); border-color: var(--amber-line); }
.side-drawer-mode-badge.mode-enforce { background: var(--vpl); color: var(--green-d); border-color: rgba(0, 191, 99, 0.3); }
.side-drawer-mode-explain { font-size: 13px; line-height: 1.55; color: var(--muted); margin: 8px 0 0; }
.side-drawer-origins { display: flex; flex-direction: column; gap: 6px; }
.side-drawer-origin-chip {
  font: 12.5px/1 ui-monospace, Menlo, monospace; background: var(--g0); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; color: var(--text); word-break: break-all;
}
.side-drawer-origins-empty { font-size: 13px; color: var(--muted); margin: 0; }
.side-drawer-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.side-drawer-stat { background: var(--g0); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.side-drawer-stat .stat-value { display: block; font-size: 20px; font-weight: 800; color: var(--g9); }
.side-drawer-stat.stat-danger .stat-value { color: var(--red-d); }
.side-drawer-stat .stat-label { font-size: 11.5px; color: var(--muted); }

/* ── 2FA-cijferblokjes ── */
.otp-row { display: flex; gap: 8px; justify-content: center; margin: 8px 0 2px; }
.login-card .otp-box {
  width: 42px; height: 52px; padding: 0; text-align: center;
  font: 700 20px/1 var(--font); color: var(--text);
  background: var(--g0); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.login-card .otp-box:focus {
  border-color: var(--green); background: var(--w);
  box-shadow: 0 0 0 3px var(--vpl);
}
.login-card .otp-box.filled { border-color: var(--green-d); background: var(--w); }
.otp-row.shake { animation: otp-shake 0.4s ease; }
@keyframes otp-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .otp-row.shake { animation: none; }
}
.btn-link {
  background: none; border: none; color: var(--muted); font-size: 13px; font-weight: 600;
  padding: 4px; align-self: center; transition: color 0.15s;
}
.btn-link:hover { color: var(--text); }
.login-card label, .drawer-body label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
/* Wachtwoord-invoer + "Genereer"/"Kopieer" op één rij (Gebruiker toevoegen /
   Wachtwoord wijzigen) — het input krimpt/groeit, de knoppen houden hun
   natuurlijke breedte. */
.password-field-row { display: flex; gap: 6px; }
.password-field-row input { flex: 1; min-width: 0; }
.password-field-row .btn-sm { flex: 0 0 auto; white-space: nowrap; }
.login-card input, .drawer-body input:not([type=checkbox]):not([type=color]), .drawer-body select, .drawer-body textarea {
  background: var(--g0); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 11px 13px; font: 14px/1.4 var(--font); outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.login-card input:focus, .drawer-body input:focus, .drawer-body select:focus, .drawer-body textarea:focus {
  border-color: var(--green); background: var(--w);
  box-shadow: 0 0 0 3px var(--vpl);
}
button { cursor: pointer; font: inherit; border: none; border-radius: 999px; font-family: var(--font); }
.login-card button[type=submit], .btn-primary {
  background: var(--green); color: #fff; font-weight: 700; padding: 12px 18px;
  box-shadow: 0 8px 20px rgba(0, 191, 99, 0.28);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.login-card button[type=submit]:hover, .btn-primary:hover { background: var(--green-d); box-shadow: 0 10px 24px rgba(0, 191, 99, 0.36); }
.login-card button[type=submit]:active, .btn-primary:active { transform: scale(0.98); }
.btn-ghost {
  background: var(--w); color: var(--g6); border: 1px solid var(--line); padding: 9px 16px; border-radius: 999px;
  font-weight: 600; transition: color 0.15s, border-color 0.15s, background 0.15s;
  text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.btn-ghost:hover { color: var(--text); border-color: var(--g4); background: var(--g1); }
/* danger-patroon conform .vh-wc-cancel: rood op wit, hover vult met --redl */
.btn-danger {
  background: var(--w); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.35); padding: 9px 16px; border-radius: 999px;
  font-weight: 600; transition: background 0.15s, border-color 0.15s;
}
.btn-danger:hover { background: var(--redl); border-color: var(--red); }
.btn-danger:disabled, .btn-primary:disabled { opacity: 0.55; cursor: default; }
/* Verwijder-icoon in de drawer-header — stil/grijs in rust, rood bij hover,
   zodat 'ie niet de hele tijd om aandacht schreeuwt naast Opslaan/Sluiten
   maar wel duidelijk "destructief" oogt zodra je 'm nadert. */
.btn-icon-danger:hover { color: var(--red); border-color: rgba(239, 68, 68, 0.35); background: var(--redl); }

/* ── Topbar ── */
/* 3-koloms grid (1fr auto 1fr) zodat de tabnav ECHT in het midden van de
   viewport staat, los van de breedte van het merk links of de iconen rechts. */
.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 14px 28px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 5;
}
.topbar .brand { justify-self: start; }
.topbar .tabnav { justify-self: center; }
.topbar-right { justify-self: end; display: flex; align-items: center; gap: 10px; }
.topbar-right .btn-primary,
.topbar-right .btn-ghost {
  height: 42px; display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap;
}
.topbar-right .btn-icon { width: 42px; padding: 0; }
@media (max-width: 640px) {
  /* Terug naar wrap-flow op smal scherm: merk + iconen op één rij, tabs eronder. */
  .topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; }
  .topbar-right { flex-wrap: wrap; gap: 8px; }
}

/* ── Tab-navigatie ── */
.tabnav { display: flex; gap: 3px; background: var(--g1); padding: 4px; border-radius: 999px; }
.tab-btn {
  background: transparent; color: var(--muted); font-weight: 600; font-size: 13px;
  padding: 8px 16px; border-radius: 999px; transition: background 0.15s ease, color 0.15s ease;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  background: var(--w); color: var(--g9);
  box-shadow: 0 1px 2px rgba(29, 29, 31, 0.08), 0 4px 10px rgba(29, 29, 31, 0.06);
}
/* Gebruikers-icoon rechts (naast Uitloggen): zelfde active-signaal als een tab,
   maar als icoon-highlight i.p.v. een pill. */
.nav-icon-btn.active {
  color: var(--green-dd); background: var(--vpl); border-color: rgba(0, 191, 99, 0.3);
}
@media (max-width: 640px) {
  .tabnav { order: 3; width: 100%; justify-content: center; }
}

/* ── Layout ── */
.wrap { max-width: 1080px; margin: 0 auto; padding: 32px 28px 80px; }
h1 { font-size: 24px; font-weight: 800; margin: 8px 0 4px; letter-spacing: -0.5px; color: var(--g9); }
.lead { color: var(--muted); margin: 0 0 24px; }
.empty {
  color: var(--muted); text-align: center; padding: 48px 24px; border: 1px dashed var(--line);
  border-radius: var(--radius); background: var(--w);
}

/* Pagina-header met titel/subtitel links en een primaire actie rechts
   (Integraties → "+ Partner toevoegen", Gebruikers → "+ Gebruiker toevoegen"). */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 24px;
}
/* flex-basis 0 (i.p.v. auto): de tekst start op 0 en groeit om de ruimte te
   vullen, i.p.v. z'n volle content-breedte te claimen — anders duwt een lange
   lead de actie-knoppen naar een nieuwe regel i.p.v. ze rechts te houden. */
.page-head-text { flex: 1 1 0; min-width: 0; }
.page-head-text .lead { margin-bottom: 0; }
.page-head .btn-primary { flex: 0 0 auto; }

/* ── Gebruikers-kaarten ── */
.user-list { display: flex; flex-direction: column; gap: 12px; }
.user-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--w); border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 16px; box-shadow: 0 1px 2px rgba(29, 29, 31, 0.04);
}
.user-avatar {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 16px;
  background: var(--vpl); color: var(--green-dd);
}
.user-info { flex: 1 1 auto; min-width: 0; }
.user-email {
  font-weight: 600; color: var(--g9); font-size: 14.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.you-tag {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase; color: var(--green-dd); background: var(--vpl);
  border: 1px solid rgba(0, 191, 99, 0.25); padding: 1px 7px; border-radius: 999px;
  margin-left: 6px; vertical-align: middle;
}

/* ── Statistieken ── */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: 0 1px 2px rgba(29, 29, 31, 0.03), 0 10px 24px rgba(29, 29, 31, 0.04);
}
.kpi-value { font-size: 26px; font-weight: 800; color: var(--g9); letter-spacing: -0.5px; }
.kpi-value .kpi-of { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.kpi-label { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 600; }

.table-wrap {
  overflow-x: auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(29, 29, 31, 0.03), 0 10px 24px rgba(29, 29, 31, 0.04);
}
.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 680px; }
.stats-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); font-weight: 700; padding: 13px 16px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.stats-table td { padding: 12px 16px; border-bottom: 1px solid var(--g1); color: var(--text); white-space: nowrap; }
.stats-table tr:last-child td { border-bottom: none; }
.stats-table tr.off { color: var(--muted); }
.stats-table tr.off td:first-child { color: var(--g6); }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--g4); margin-right: 6px; }
.status-dot.on { background: var(--green); }

/* ── Overzicht: groep-roll-up-rij (2026-07, zie app.js groupItems()) ── */
.stats-group-row { font-weight: 700; background: var(--g0); }
.stats-subrow td:first-child { padding-left: 32px; }

/* ── Partner-rijen (volledig-breedte, meer detail per rij) ── */
.partner-list { display: flex; flex-direction: column; gap: 14px; }
.row-card {
  display: flex; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 2px rgba(29, 29, 31, 0.03), 0 10px 24px rgba(29, 29, 31, 0.04);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.row-card:hover { border-color: var(--g4); box-shadow: 0 4px 10px rgba(29, 29, 31, 0.05), 0 16px 32px rgba(29, 29, 31, 0.08); }
.row-card.off { opacity: 0.6; filter: grayscale(0.25); }
.row-accent { width: 6px; flex: 0 0 6px; }
.row-main {
  flex: 1; min-width: 0; padding: 18px 24px; display: grid; align-items: center; gap: 18px;
  /* Naam hugt links (max-content, niet groeiend), swatches + badges er direct
     achteraan, en de acties in de laatste (flexibele) kolom rechts uitgelijnd.
     Voorheen liet 1.1fr de naamkolom meegroeien → een grote lege ruimte na de
     naam op brede schermen. */
  grid-template-columns: minmax(150px, max-content) auto minmax(190px, 340px) 1fr;
}
.row-identity { min-width: 0; }
.row-name { font-weight: 700; font-size: 16px; color: var(--g9); display: flex; align-items: center; gap: 8px; }
.row-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
/* Omgeving-badge (Overzicht/Beveiliging-kaarten): dev = amber (rustig,
   normale testomgeving), prod = rood + iets zwaarder — moet in de lijst
   meteen opvallen dat deze partner ECHTE productie-traffic stuurt. */
.env-badge { color: var(--amber); font-weight: 600; }
.env-badge.prod { color: var(--red-d); font-weight: 700; }
.row-swatches { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.sw { width: 18px; height: 18px; border-radius: 6px; border: 1px solid rgba(29, 29, 31, 0.08); }
.row-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 11px; font-weight: 600; color: var(--g6); background: var(--g1);
  border: 1px solid var(--line); padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
/* domeinbeveiliging op "afdwingen" — enige tag-status die echt bescherming
   betekent (warn/off geven alleen zichtbaarheid, geen afdwinging). */
.tag-good { color: var(--green-dd); background: var(--vpl); border-color: rgba(0, 191, 99, 0.25); }
/* Beveiligingslog-uitkomsten: waarschuwing (amber) vs geblokkeerd (rood). */
.tag-warn { color: var(--amber); background: var(--amberl); border-color: var(--amber-line); }
.tag-danger { color: var(--red-d); background: var(--redl); border-color: rgba(239, 68, 68, 0.25); }
.empty-cell { color: var(--muted); font-style: italic; }
.row-actions { display: flex; align-items: center; gap: 14px; justify-self: end; flex: 0 0 auto; }
.row-actions .btn-ghost { padding: 7px 14px; font-size: 13px; white-space: nowrap; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; font-size: 13px; flex: 0 0 auto; }
.off-pill {
  font-size: 10px; font-weight: 700; color: var(--red-d); letter-spacing: 0.4px;
  background: var(--redl); border: 1px solid rgba(239, 68, 68, 0.3); padding: 2px 7px; border-radius: 999px;
}

/* ── Groep-koptekst (2026-07, zie app.js groupItems()/renderGroupedList()) ──
   Gedeeld tussen Integraties- en Beveiliging-kaarten: meerdere klinieken van
   hetzelfde merk (bv. Evidensia NL) onder één inklapbare koptekst. */
.group-header {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px; cursor: pointer;
  user-select: none; border-radius: 8px; -webkit-tap-highlight-color: transparent;
}
.group-header:hover { background: var(--g0); }
.group-header:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.group-chevron-wrap { display: flex; color: var(--muted); transition: transform 0.15s ease; }
.group-chevron-wrap.collapsed { transform: rotate(-90deg); }
.group-header-name { font-weight: 700; font-size: 15px; color: var(--g9); }
.group-header-count { font-size: 12px; color: var(--muted); font-weight: 600; }
.group-body {
  display: flex; flex-direction: column; gap: 14px;
  padding-left: 18px; margin-left: 9px; border-left: 2px solid var(--line);
}

/* ── Beveiliging-kaarten (verkeer + domein-status per partner) ── */
/* Zelfde .row-card-schaal als de Partners-tab, maar identity | stats | icoon
   i.p.v. identity | swatches | badges | acties — andere inhoud, dus eigen
   kolom-verdeling nodig. */
.row-main-security { grid-template-columns: minmax(150px, max-content) 1fr auto; }
.row-stats { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 2px; min-width: 64px; }
.stat-value { font-size: 18px; font-weight: 800; color: var(--g9); line-height: 1; }
.stat-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.stat-danger .stat-value { color: var(--red); }

/* Statusicoon = domeinbeveiliging-modus in één oogopslag; telbadge = hoeveel
   waarschuwingen/blokkades er in de log staan (alleen tonen als > 0, anders
   ruis bij een schone partner). */
.security-status-btn {
  position: relative; width: 42px; height: 42px; padding: 0; flex: 0 0 auto;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--g1); color: var(--muted); border: 1px solid var(--line);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.security-status-btn:hover { transform: scale(1.06); }
.security-status-btn.mode-warn { background: var(--amberl); color: var(--amber); border-color: var(--amber-line); }
.security-status-btn.mode-enforce { background: var(--vpl); color: var(--green-d); border-color: rgba(0, 191, 99, 0.3); }
.security-count-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-weight: 800;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--panel);
}
/* Wrapper om het statusicoon + de "Bekijk chats"-link, zodat beide samen
   als één grid-item in .row-main-security uitgelijnd blijven. */
.row-actions-col { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 0 0 auto; }
.security-details-empty { color: var(--muted); font-size: 13px; margin: 0; }
/* Switcher tussen "Chat-pogingen" (het signaal dat ertoe doet) en "Widget-
   laden" (pure paginaload-ruis) — zelfde pil-stijl als .device-switch, i.p.v.
   het vorige lange-tekst-toggle-linkje (feedback 2026-07: "gekke lange label"). */
.security-event-switch { display: inline-flex; gap: 2px; background: var(--g1); padding: 3px; border-radius: 999px; margin-bottom: 14px; }
.security-event-switch-btn {
  background: transparent; color: var(--muted); font-weight: 600; font-size: 12.5px;
  padding: 7px 14px; border-radius: 999px; transition: background 0.15s ease, color 0.15s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.security-event-switch-btn:hover { color: var(--text); }
.security-event-switch-btn.active { background: var(--w); color: var(--g9); box-shadow: 0 1px 2px rgba(29, 29, 31, 0.08), 0 3px 8px rgba(29, 29, 31, 0.06); }
.security-event-switch-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--red); color: #fff; font-weight: 700; font-size: 10.5px;
}
.security-event-switch-btn:not(.active) .security-event-switch-count { background: var(--g4); }

@media (max-width: 1080px) {
  .row-main {
    grid-template-columns: 1fr auto;
    grid-template-areas: "identity actions" "badges badges";
    row-gap: 12px;
  }
  .row-identity { grid-area: identity; }
  .row-actions { grid-area: actions; }
  .row-swatches { display: none; }
  .row-badges { grid-area: badges; }
  /* .row-main-security gebruikt geen identity/actions/badges-areas (eigen
     kolomindeling, geen .row-badges/.row-actions) — de generieke .row-main-
     override hierboven zou 'm anders half toepassen. Na, dus wint. */
  .row-main-security {
    grid-template-columns: 1fr auto;
    grid-template-areas: "identity icon" "stats stats";
    row-gap: 12px;
  }
  .row-main-security .row-identity { grid-area: identity; }
  .row-main-security .row-stats { grid-area: stats; }
  .row-main-security .row-actions-col { grid-area: icon; justify-self: end; }
}
@media (max-width: 560px) {
  .row-main { padding: 16px 18px; }
  .row-actions { flex-direction: row-reverse; justify-content: flex-end; }
}

/* ── Chats-tab (chat-detail-log: metadata per aanvraag, geen inhoud) ── */
/* Secundaire actie-knoppen rechts in een page-head (bv. Chats-export) — zelfde
   slot als de primaire "+ toevoegen"-knop op de andere pagina's, zodat de
   pagina's hetzelfde mentale model volgen: titel/subtitel links, acties rechts. */
.page-head-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; flex-wrap: wrap; }
.page-head-actions .btn-ghost { height: 40px; padding: 0 16px; font-size: 13px; text-decoration: none; }

/* Filterbalk als subtiel paneel — dezelfde kaart-taal als de rest, als nette
   "toolbar" boven de tabel. */
.chat-filters {
  display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap;
  margin-bottom: 22px; padding: 14px 16px;
  background: var(--w); border: 1px solid var(--line); border-radius: 14px;
}
.chat-filters label {
  display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.chat-filters select {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 13px;
  background: var(--g0); color: var(--text); min-width: 180px;
}
.chat-filters select:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--vpl); outline: none; }

/* switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--g2); border: 1px solid rgba(29, 29, 31, 0.2); border-radius: 24px; transition: 0.2s; }
.slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.switch input:focus-visible + .slider { outline: 2px solid var(--green); outline-offset: 2px; }
.switch input:checked + .slider { background: var(--green); border-color: var(--green-d); }
.switch input:checked + .slider::before { transform: translateX(18px); }
/* Pending-state tijdens de in-flight PATCH van een partner-toggle: gedimd +
   wait-cursor zodat het niet "bevroren" oogt op een traag netwerk. */
.switch--busy { opacity: 0.55; cursor: progress; }
.switch--busy .slider { cursor: progress; }

/* ── Drawer ── */
.drawer { position: fixed; inset: 0; z-index: 20; }
.drawer-back { position: absolute; inset: 0; background: rgba(29, 29, 31, 0.36); backdrop-filter: blur(2px); }
.drawer-panel {
  /* Schermvullend (i.p.v. een side-panel) — geeft de live preview veel meer
     ruimte. Sluiten kan alleen nog via het kruisje of Escape. */
  position: absolute; inset: 0; width: 100%; height: 100%;
  background: var(--panel); display: flex; flex-direction: column;
}
/* Zelfde styling als de overzicht-topbar (.topbar): dezelfde hoogte, padding,
   translucent achtergrond en knop-afmetingen rechts — zodat de header op de
   overview- en bewerk-pagina identiek aanvoelen. */
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(10px);
}
.drawer-head-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.drawer-head h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--g9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-head-right { display: flex; align-items: center; gap: 10px; }
/* Alle header-knoppen op dezelfde hoogte (42px, gelijk aan .topbar-right),
   ongeacht of het een <a>, <button type=submit> of icon-only sluitknop is. */
.drawer-head-right .pill-link,
.drawer-head-right #drawer-save-btn,
.drawer-head-right .btn-ghost {
  height: 42px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
}
.drawer-head-right #drawer-save-btn { padding: 0 20px; }
.drawer-head-right .btn-ghost { width: 42px; padding: 0; }

/* ── "Chats toestaan"-schakelaar in de header (zelfde aan/uit als op de kaart) ── */
.head-switch { display: inline-flex; align-items: center; gap: 9px; }
.head-switch-label { font-size: 13.5px; font-weight: 600; color: var(--g6); white-space: nowrap; }

.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ── "Live pagina"-pill in de drawer-header, naast de sluitknop ── */
.pill-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--vpl); color: var(--green-dd); border: 1px solid rgba(0, 191, 99, 0.25);
  padding: 0 14px; border-radius: 999px; font-size: 12px; font-weight: 700;
  text-decoration: none; white-space: nowrap; transition: background 0.15s ease;
}
.pill-link:hover { background: #d3f4e2; }
@media (max-width: 640px) {
  .drawer-head { padding: 14px 18px; }
  .drawer-head h2 { font-size: 15px; }
  .drawer-head-left { gap: 10px; }
  .head-switch-label { display: none; }
  .drawer-head-right { gap: 8px; }
  .pill-link-text { display: none; }
  .pill-link { padding: 0 10px; }
  .drawer-head-right #drawer-save-btn { padding: 0 14px; font-size: 13px; }
}

.drawer-columns { flex: 1; display: flex; min-height: 0; }

/* ── Live preview (links) — schermvullend, dus flink wat ruimte ── */
.drawer-preview {
  flex: 1 1 60%; border-right: 1px solid var(--line); background: var(--g0);
  padding: 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
}
.preview-label-row { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.preview-toolbar { display: flex; align-items: center; gap: 10px; }
.preview-stale-badge {
  margin-right: auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: #fff4e0; color: #9a5b00; border: 1px solid #f3d9a8;
}

/* Aftel-badge na opslaan (proxy-cache ~15s): telt af tot de preview zichzelf
   ververst. Links, zelfde hoogte als de switcher-knoppen. */
.preview-countdown {
  margin-right: auto; display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 12px 4px 5px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--vpl); color: var(--green-dd); border: 1px solid rgba(0, 191, 99, 0.25);
}
.preview-countdown-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px;
  background: var(--green); color: #fff; font-weight: 700; font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

/* ── Desktop/mobiel device-switch ── */
.device-switch { display: flex; gap: 2px; background: var(--g1); padding: 3px; border-radius: 999px; }
.device-switch-btn {
  background: transparent; color: var(--muted); font-weight: 600; font-size: 11px;
  padding: 6px 12px; border-radius: 999px; transition: background 0.15s ease, color 0.15s ease;
}
.device-switch-btn:hover { color: var(--text); }
.device-switch-btn.active { background: var(--w); color: var(--g9); box-shadow: 0 1px 2px rgba(29, 29, 31, 0.08), 0 3px 8px rgba(29, 29, 31, 0.06); }

/* ── Device-frame: geen kaart-omhulsel meer — leeft los in de linkerkolom.
   Puur een centrerende container; fitDeviceFrame() gebruikt clientWidth/
   -Height hiervan om het frame te schalen. */
.preview-real {
  display: flex; align-items: center; justify-content: center;
  /* Vaste hoogte (i.p.v. min-height) zodat fitDeviceFrame() een echte
     clientHeight heeft om op te schalen. Schermvullende drawer geeft hier
     veel meer ruimte dan de oude side-panel-versie. */
  height: min(800px, 78vh);
}
.device-wrap { position: relative; }
.device-frame {
  position: relative; box-sizing: content-box; transform-origin: top left;
  background: linear-gradient(160deg, #3a3a3d, #19191b);
}
.device-screen { position: absolute; overflow: hidden; background: #fff; }
.device-screen iframe { width: 100%; height: 100%; border: 0; display: block; }
.device-cam, .device-island, .device-side { display: none; position: absolute; }

/* Desktop — MacBook-achtige bezel: dunne rand + camera-dot boven het scherm */
.device-frame.mode-desktop { border-radius: 13px; box-shadow: 0 30px 70px rgba(20, 20, 22, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05) inset; }
.device-frame.mode-desktop .device-screen { inset: 14px 14px 14px 14px; border-radius: 3px; }
.device-frame.mode-desktop .device-cam {
  display: block; top: 5px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: #57575a;
}

/* Mobiel — moderne iPhone-Pro-achtige bezel: dynamic island + zijknoppen */
.device-frame.mode-mobile { border-radius: 64px; box-shadow: 0 24px 54px rgba(20, 20, 22, 0.4), 0 0 0 2px rgba(255, 255, 255, 0.07) inset; }
.device-frame.mode-mobile .device-screen {
  inset: 12px; border-radius: 52px; box-sizing: border-box;
  /* Simuleer de echte iOS safe-area: op een echt toestel begint de pagina
     altijd ONDER de dynamic island en EINDIGT ze BOVEN de home-indicator
     (viewport-fit=cover staat niet aan, dus dit gebeurt sowieso al op een
     echte iPhone) — zonder deze padding denkt de preview-iframe hier dat ze
     tot de randen mag lopen en botst content zichtbaar met onze bezel-
     illustratie. Waarden = Apple's eigen safe-area-inset-top/bottom voor
     Dynamic-Island-toestellen. */
  padding: 59px 0 34px;
}
.device-frame.mode-mobile .device-island {
  /* top begint pas ná de bezel (12px inset van .device-screen) + een
     zichtbare marge, anders "plakt" de island tegen de rand i.p.v. binnen
     het scherm te zweven zoals op een echte iPhone. */
  display: block; top: 26px; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 90px; height: 28px; border-radius: 16px; background: #000;
}
.device-frame.mode-mobile .device-side { display: block; background: #2c2c2e; }
.device-frame.mode-mobile .device-side-action { left: -3px; top: 118px; width: 3px; height: 30px; border-radius: 2px 0 0 2px; }
.device-frame.mode-mobile .device-side-vol { left: -3px; top: 168px; width: 3px; height: 58px; border-radius: 2px 0 0 2px; }
.device-frame.mode-mobile .device-side-power { right: -3px; top: 150px; width: 3px; height: 78px; border-radius: 0 2px 2px 0; }
/* ── Lege staat: vervangt de oude cosmetische mock-preview. Getoond zolang
   er niks zinnigs te tonen valt — nieuwe (nog niet opgeslagen) partner, of
   een bestaande partner zonder een enkele surface (Webportal/iFrame) aan. ── */
.preview-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; padding: 40px; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 16px; background: var(--g0);
  min-height: 260px;
}
.preview-empty svg { color: var(--g4); }
.preview-empty p { margin: 0; font-size: 13.5px; line-height: 1.6; max-width: 340px; }
.preview-empty b { color: var(--text); }

@media (max-width: 860px) {
  .drawer-columns { flex-direction: column; overflow-y: auto; }
  .drawer-preview { flex: 0 0 auto; border-right: none; border-bottom: 1px solid var(--line); overflow-y: visible; }
  .drawer-body { overflow-y: visible; max-width: none; min-width: 0; }
  /* Gestackt: de preview mag niet bijna het hele eerste scherm vullen (78vh)
     met het formulier onder de vouw — kleiner hoogte-budget, fitDeviceFrame()
     herschaalt automatisch (ResizeObserver op .drawer-preview). */
  .preview-real { height: min(360px, 45vh); }
}

.drawer-body {
  padding: 28px 32px 40px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px;
  flex: 1 1 40%; min-width: 340px; max-width: 640px;
}
.drawer-body fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 15px; }

/* ── Tab-rail: "file cabinet"-tabjes links langs de instellingen ──
   Idee: de rail zit tegen een lichtgrijze achtergrond (--g0) aan; de ACTIEVE
   tab krijgt de kleur van het content-paneel zelf (--panel, wit) en schuift
   iets naar rechts uit — daardoor lijkt hij "verbonden" met de content, alsof
   hij ervoor uit steekt. Inactieve tabs blijven grijs en liggen "erachter". */
/* min-height:0 hier zou .tab-shell (een flex-item van .drawer-body) tot 0
   laten inklappen zodra de inhoud de beschikbare ruimte overschrijdt — de
   rail/panels renderen dan zichtbaar BUITEN hun eigen ouder, waardoor
   .drawer-actions erna in de flow er middenin lijkt te vallen. */
.tab-shell { display: flex; align-items: flex-start; gap: 0; }
.tab-rail {
  display: flex; flex-direction: column; gap: 4px; flex: 0 0 108px; width: 108px;
  position: sticky; top: 0;
}
.tab-rail-btn {
  text-align: left; padding: 9px 8px 9px 12px; border-radius: 9px 0 0 9px;
  background: var(--g0); color: var(--muted); font-weight: 600; font-size: 12.5px;
  border: 1px solid var(--line); border-right: none; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tab-rail-btn:hover { background: var(--g2); color: var(--text); }
.tab-rail-btn.active {
  background: var(--panel); color: var(--vpd); font-weight: 700;
  /* Géén blur-shadow hier — die legde een zachte gradient over de naad heen
     waardoor tab en paneel niet 100% dezelfde kleur LEKEN te hebben, terwijl
     de achtergrondkleur zelf al identiek was (beide var(--panel)). */
  box-shadow: -1px 0 0 var(--line);
  /* steekt uit naar rechts, overlapt het paneel z'n linkerrand zodat de naad
     verdwijnt en de actieve tab er visueel "aan vast" zit */
  margin-right: -1px; padding-left: 15px;
  position: relative; z-index: 1;
}
.tab-rail-btn.hidden { display: none; }
.tab-panels {
  flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: 0 14px 14px 14px; padding: 22px; display: flex; flex-direction: column; gap: 15px;
}
.tab-panel { display: flex; flex-direction: column; gap: 15px; }
.tab-panel.hidden { display: none; }
.tab-panel-hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: -6px 0 2px; }
/* Zelfde breakpoint als .drawer-columns hierboven (860px) — anders wisselt de
   tab-rail op een ANDER moment dan de rest van de drawer omschakelt, en zit
   de verticale rail dan een tijdje geperst in een net-versmalde kolom. */
@media (max-width: 860px) {
  .tab-shell { flex-direction: column; }
  .tab-rail { position: static; flex-direction: row; flex-wrap: wrap; width: auto; gap: 6px; }
  .tab-rail-btn {
    border-radius: 999px; border-right: 1px solid var(--line); padding: 8px 14px;
  }
  .tab-rail-btn.active { margin-right: 0; padding-left: 14px; box-shadow: none; border-color: var(--vpd); }
  .tab-panels { border-radius: 14px; }
}

/* ── Webportal-tab: live URL-weergave ── */
.url-display {
  display: flex; align-items: center; gap: 8px; background: var(--g0);
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 12px;
}
.url-display code {
  flex: 1; min-width: 0; font-size: 12.5px; color: var(--text); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ── Styling-tab: verticale logo-uitlijning (px) ──
   Mini-preview van de ECHTE co-brand pill (VETTS × partner-logo) zodat je
   direct ziet wat de offset doet, + een stepper voor px-precisie. */
.logo-offset-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-offset-preview {
  display: inline-flex; align-items: center; gap: 10px; background: #fff;
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px;
  box-shadow: 0 1px 2px rgba(29, 29, 31, 0.04);
}
/* Zelfde hoogte (24px) als .pp-l-vetts/.pp-l-partner op de ECHTE portal-
   pagina (renderPortal.ts) — anders oogt dezelfde px-offset in deze kleine
   preview groter/kleiner dan 'ie werkelijk op de live pagina is. */
.logo-offset-preview-vetts { height: 24px; width: auto; display: block; }
.logo-offset-preview-x { color: #9b9b9b; font-size: 13px; font-weight: 600; }
.logo-offset-preview-partner {
  height: 24px; width: auto; max-width: 90px; object-fit: contain; display: block;
  transition: transform 0.1s ease;
}
.stepper {
  display: inline-flex; align-items: center; gap: 0; background: var(--g0);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.stepper-btn {
  width: 34px; height: 38px; background: transparent; color: var(--g9);
  font-size: 16px; font-weight: 700; border-radius: 0; flex-shrink: 0;
}
.stepper-btn:hover { background: var(--g2); }
.stepper input[type=number] {
  width: 56px; text-align: center; border: 0; border-left: 1px solid var(--line);
  border-right: 1px solid var(--line); border-radius: 0; background: var(--w);
  padding: 8px 4px; font: 13.5px/1.4 var(--font); -moz-appearance: textfield;
}
.stepper input[type=number]::-webkit-inner-spin-button,
.stepper input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ── iFrame-tab: embed-snippet ── */
.snippet-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  background: var(--g9); color: #d7f5e3; border-radius: 12px; padding: 12px 14px;
  border: 0; line-height: 1.6; white-space: pre; overflow-x: auto;
}
.section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px; color: var(--vpd);
  margin-top: 10px; border-top: 1px solid var(--line); padding-top: 16px;
}
.drawer-body legend.section-label { width: 100%; margin-bottom: 15px; }
/* Eerste sectie bovenaan een tab-panel krijgt GEEN scheidingslijn erboven —
   er staat niets boven om van te scheiden (bv. "Verificatie" in Connectors). */
.tab-panel > fieldset:first-child > legend.section-label,
.tab-panel > details:first-child > summary.section-label,
.tab-panel > .section-label:first-child {
  border-top: 0; padding-top: 0; margin-top: 0;
}

/* ── In/uitklapbare onderwerpen binnen een tabje (2026-07) — native
   <details>/<summary>, geen eigen JS nodig. Zelfde .section-label-look als
   voorheen op een <fieldset><legend>, nu ook klikbaar. Standaard open (de
   inhoud verdwijnt niet uit het zicht, je kan 'm alleen wegklappen). ── */
.drawer-body details { border: 0; padding: 0; margin: 0; min-width: 0; }
.drawer-body details[open] { display: flex; flex-direction: column; gap: 15px; }
.drawer-body summary.section-label {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; margin-bottom: 15px; cursor: pointer; user-select: none; list-style: none;
}
.drawer-body summary.section-label::-webkit-details-marker { display: none; }
.drawer-body summary.section-label::marker { content: ""; }
.accordion-chevron { color: var(--muted); flex-shrink: 0; transition: transform 0.15s ease; }
.drawer-body details[open] > summary .accordion-chevron { transform: rotate(180deg); }

/* ── Slider (bv. "padding rondom" van de co-brand-pill) ── */
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] {
  flex: 1; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 999px;
  background: var(--g2); outline: none; cursor: pointer;
}
.range-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--green); border: 3px solid #fff; box-shadow: 0 1px 3px rgba(29, 29, 31, 0.3); cursor: pointer;
}
.range-row input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--green); border: 3px solid #fff;
  box-shadow: 0 1px 3px rgba(29, 29, 31, 0.3); cursor: pointer;
}
.range-value {
  min-width: 42px; text-align: right; font-size: 13px; font-weight: 700; color: var(--g9);
  font-variant-numeric: tabular-nums;
}
.subsection-label {
  font-size: 12px; font-weight: 700; color: var(--g9); margin-top: 4px;
  border-top: 1px dashed var(--line); padding-top: 14px;
}
.optional-tag { font-size: 11px; font-weight: 500; color: var(--muted); text-transform: none; letter-spacing: 0; }
.drawer-body .row { display: flex; gap: 12px; }
.drawer-body .row > label { flex: 1; min-width: 0; }
.drawer-body input[type=color] { width: 100%; height: 40px; background: var(--g0); border: 1px solid var(--line); border-radius: 12px; padding: 3px; cursor: pointer; }
.drawer-body textarea { resize: vertical; font-family: var(--font); }
.fieldset-details { display: flex; flex-direction: column; gap: 15px; }

/* ── Pagina-URL slug-veld ── */
.slug-field {
  display: flex; align-items: stretch; border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; background: var(--g0);
}
.slug-field:focus-within { border-color: var(--vp); box-shadow: 0 0 0 3px var(--vpl); }
.slug-prefix {
  display: flex; align-items: center; padding: 0 10px; font-size: 13px;
  color: var(--muted); background: var(--g1); border-right: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap;
}
/* #slug-input (ID, niet de klasse) — de generieke ".drawer-body input"-regel
   hierboven gebruikt :not()-selectors en heeft daardoor HOGERE specificiteit
   dan ".slug-field input" alleen; die won dus altijd, met een eigen rand +
   achtergrond + border-radius bovenop de buitenste pil als gevolg (de
   "dubbele border"). Een ID-selector wint altijd, ongeacht het aantal
   klassen elders. */
#slug-input {
  flex: 1; min-width: 0; border: 0; background: transparent; border-radius: 0;
  padding: 11px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px;
}
#slug-input:focus { outline: none; box-shadow: none; background: transparent; border-color: transparent; }

/* ── Gebruik-standaardwaarden-knop ── */
#use-defaults-btn { align-self: flex-start; }

/* ── Rich-text editor (Titel / Ondertitel) ── */
.rte { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--w); }
.rte:focus-within { border-color: var(--vp); box-shadow: 0 0 0 3px var(--vpl); }
.rte-toolbar {
  display: flex; align-items: center; gap: 2px; padding: 5px 6px;
  background: var(--g0); border-bottom: 1px solid var(--line);
}
.rte-btn {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px; background: transparent; color: var(--g9); font-size: 14px; line-height: 1;
  border: 0; cursor: pointer;
}
.rte-btn:hover { background: var(--g2); }
.rte-color {
  position: relative; width: 28px; height: 28px; display: inline-flex; align-items: center;
  justify-content: center; border-radius: 7px; cursor: pointer; overflow: hidden;
}
.rte-color:hover { background: var(--g2); }
.rte-color-a { font-size: 14px; font-weight: 800; border-bottom: 3px solid currentColor; line-height: 1.1; pointer-events: none; }
.rte-color input[type=color] {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; border: 0;
}
.rte-area {
  min-height: 44px; padding: 11px 12px; font-family: var(--font); font-size: 14px;
  line-height: 1.5; color: var(--text); outline: none; word-break: break-word;
}
.rte-area:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.rte.is-empty .rte-area::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }

/* ── Instelling-rij: label links, toggle-switch rechts (Verificatie/Payments/
   Mailing/"Powered by") ── */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; }
.setting-row-label { font-size: 14px; font-weight: 500; color: var(--text); }

/* ── Blokken-configurator: zichtbaarheids-matrix per blok — rijen = surface
   (Webportal / iFrame-widget), kolommen = device (Desktop / Mobiel). ── */
.block-matrix {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 8px 22px; align-items: center; padding: 2px 0 4px;
}
.block-matrix .bm-head {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted); text-align: center; justify-self: center;
}
.block-matrix .bm-rowlabel { font-size: 13.5px; font-weight: 500; color: var(--text); }
.block-matrix .bm-cell { justify-self: center; }
/* Verwijzing "waar pas je de inhoud van dit blok aan" onder de matrix. */
.field-hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 2px 0 0; }
.field-hint strong { color: var(--text); font-weight: 600; }

/* ── Weergave-type: segmented switcher i.p.v. dropdown ── */
.field-block { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.segmented { display: flex; gap: 3px; background: var(--g1); padding: 3px; border-radius: 12px; }
.segmented-btn {
  flex: 1; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px;
  padding: 9px 12px; border-radius: 9px; transition: background 0.15s ease, color 0.15s ease;
}
.segmented-btn:hover { color: var(--text); }
.segmented-btn.active { background: var(--w); color: var(--g9); box-shadow: 0 1px 2px rgba(29, 29, 31, 0.08), 0 3px 8px rgba(29, 29, 31, 0.06); }

/* ── Hero-afbeelding: upload + bibliotheek i.p.v. kale URL-tekstveld ── */
.image-picker { display: flex; flex-direction: column; gap: 10px; }
.image-picker-preview {
  width: 100%; height: 120px; border-radius: 12px; overflow: hidden;
  background: var(--g1); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.image-picker-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-picker-empty { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.image-picker-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.image-picker-library {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px;
  padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--g0);
  max-height: 200px; overflow-y: auto;
}
.image-picker-library-item {
  width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden; padding: 0;
  border: 2px solid transparent; cursor: pointer; background: var(--g1);
}
.image-picker-library-item:hover { border-color: var(--vp); }
.image-picker-library-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-picker-library-empty { font-size: 12.5px; color: var(--muted); padding: 6px; }

/* ── Toast (foutmelding bij b.v. mislukte toggle) ── */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--g9); color: var(--w); font-size: 13px; font-weight: 600;
  padding: 10px 18px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 50; opacity: 0; transition: opacity 0.2s; pointer-events: none;
  max-width: min(90vw, 480px); text-align: center;
}
.toast.show { opacity: 1; }
