/* ==========================================================================
   Resale Partners — portal redesign overrides
   Doel: laag-hangend fruit boven op Tabler 1.4.0. Markup/grid blijft staan,
   alleen chrome (sidebar, topbar, footer) en visuele polish worden vervangen.
   Alle merkkleuren via CSS custom properties zodat whitelabel-klanten zonder
   code-wijziging hun eigen kleur draaien (--brand, --brand-soft, --brand-on).
   ========================================================================== */

:root {
  /* ── Brand source tokens (overschrijf per whitelabel met body.brand-X) ── */
  --brand-primary: #4a1d8a;   /* default: Resale Partners paars */
  --brand-secondary: #1a1622; /* default: dark sidebar bg */
  --brand-on: #ffffff;

  /* ── Neutralen (warm grijs, paars-getint, past bij brand) ───────────── */
  --ink-0: #ffffff;
  --ink-50: #faf9fb;
  --ink-100: #f5f3f7;
  --ink-200: #ebe8ee;
  --ink-300: #d8d4dd;
  --ink-400: #b3acb9;
  --ink-500: #847d8d;
  --ink-600: #5e5868;
  --ink-700: #3f3a48;
  --ink-800: #28242f;
  --ink-900: #1a171e;

  /* Status */
  --ok: #2f8f5a;
  --ok-soft: color-mix(in srgb, var(--ok) 12%, transparent);
  --warn: #c47a04;
  --warn-soft: color-mix(in srgb, var(--warn) 15%, transparent);
  --err: #c83838;
  --err-soft: color-mix(in srgb, var(--err) 12%, transparent);

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;

  /* Radius */
  --r-1: 6px;
  --r-2: 8px;
  --r-3: 10px;
  --r-4: 14px;

  /* Sidebar */
  --sb-w: 260px;
  --sb-bg: var(--ink-50);
  --sb-fg: var(--ink-700);
  --sb-fg-muted: var(--ink-500);
  --sb-border: var(--ink-200);
  --sb-item-hover: rgba(0,0,0,0.04);
  --sb-section-fg: var(--ink-800);

  /* Topbar */
  --tb-h: 60px;
  --tb-bg: var(--ink-0);
  --tb-border: var(--ink-200);

  /* Page */
  --page-bg: #f7f5f9;
  --card-bg: var(--ink-0);
  --card-border: var(--ink-200);

  /* Type */
  --font-sans: "Inter", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
}

/* ── Derived brand tokens — MUST live on body so they recompute when 
   body.brand-X overrides the source --brand-primary. Custom properties 
   inherit by computed value: if these were on :root they'd freeze with 
   the default hex and never update.                                    */
body {
  --brand-primary-light: color-mix(in srgb, var(--brand-primary) 60%, white);
  --brand-primary-dark: color-mix(in srgb, var(--brand-primary) 80%, black);
  --brand:        var(--brand-primary);
  --brand-600:    var(--brand-primary);
  --brand-700:    var(--brand-primary-dark);
  --brand-soft:   color-mix(in srgb, var(--brand-primary) 10%, transparent);
  --brand-softer: color-mix(in srgb, var(--brand-primary) 5%, transparent);
  --accent:       color-mix(in srgb, var(--brand-primary) 60%, white);

  --sb-active-bg: var(--brand-soft);
  --sb-active-fg: var(--brand-primary-dark);

  --tblr-primary: var(--brand-primary);
  --tblr-primary-fg: #ffffff;
  --tblr-link-color: var(--brand-primary-dark);
}

/* ── density tweak (compact/cozy) ──────────────────────────────────────── */
.density-compact { --sp-2: 6px; --sp-3: 10px; --sp-4: 12px; --sp-5: 16px; --sp-6: 20px; }
.density-comfy   { --sp-2: 10px; --sp-3: 14px; --sp-4: 18px; --sp-5: 24px; --sp-6: 28px; }

/* ── Body / Tabler reset ───────────────────────────────────────────────── */
html, body { background: var(--page-bg); }
body {
  font-family: var(--font-sans);
  color: var(--ink-800);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

/* ==========================================================================
   LAYOUT — page shell
   ========================================================================== */
.rp-page {
  display: grid;
  grid-template-columns: var(--sb-w) 1fr;
  min-height: 100vh;
}
.rp-page-wrapper {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.rp-sidebar {
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
}

.rp-sidebar-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--sb-border);
}
.rp-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink-900);
}
.rp-brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--brand);
  display: grid; place-items: center;
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 1px 2px rgba(0,0,0,.12);
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
}
.rp-brand-mark::before,
.rp-brand-mark::after {
  content: ""; position: absolute; inset: 0;
}
.rp-brand-mark::before {
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.35), transparent 55%);
}
.rp-brand-mark-inner {
  width: 12px; height: 12px; border-radius: 3px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: 0 0 0 3px rgba(255,255,255,.15);
}
.rp-brand-text {
  display: flex; flex-direction: column; line-height: 1.1; gap: 2px;
}
.rp-brand-text strong {
  font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: var(--brand);
}
.rp-brand-text strong span { color: var(--ink-800); font-weight: 600; }
.rp-brand-text small {
  font-size: 10.5px; color: var(--ink-500); letter-spacing: .01em;
  font-weight: 500;
}

/* nav scrolt indien lang */
.rp-nav {
  padding: 10px 10px 14px;
  display: flex; flex-direction: column; gap: 1px;
  overflow-y: auto;
  flex: 1 1 auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-300) transparent;
}
.rp-nav::-webkit-scrollbar { width: 6px; }
.rp-nav::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 3px; }

.rp-nav-section { display: flex; flex-direction: column; gap: 1px; }
.rp-nav-section-toggle {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0; background: transparent;
  border-radius: var(--r-2);
  color: var(--sb-section-fg);
  font-size: 13px; font-weight: 600;
  letter-spacing: .005em;
  cursor: pointer;
  text-align: left;
  transition: background .12s ease;
}
.rp-nav-section-toggle:hover { background: var(--sb-item-hover); }
.rp-nav-section-toggle > i:first-child {
  font-size: 17px; color: var(--ink-600); flex: 0 0 auto;
}
.rp-nav-section-toggle > span { flex: 1 1 auto; }
.rp-nav-section-toggle .rp-chev {
  font-size: 15px; color: var(--ink-400);
  transition: transform .18s ease;
}
.rp-nav-section.is-open > .rp-nav-section-toggle .rp-chev {
  transform: rotate(180deg);
}

.rp-nav-list {
  list-style: none; margin: 2px 0 6px; padding: 0;
  display: flex; flex-direction: column; gap: 1px;
}
.rp-nav-section:not(.is-open) .rp-nav-list { display: none; }

.rp-nav-list > li { position: relative; }

.rp-nav-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 7px 10px 7px 38px;
  border: 0; background: transparent;
  border-radius: var(--r-2);
  color: var(--sb-fg);
  font-size: 13.5px; font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  line-height: 1.25;
  transition: background .12s ease, color .12s ease;
}
.rp-nav-item:hover { background: var(--sb-item-hover); color: var(--ink-900); }
.rp-nav-item .rp-chev { color: var(--ink-400); font-size: 14px; flex: 0 0 auto; }
.rp-nav-item .rp-nav-label { flex: 1 1 auto; min-width: 0; }

/* sub-groep (Beheer > …) */
.rp-nav-group > .rp-nav-group-toggle {
  padding-left: 22px;
  font-weight: 600;
  color: var(--ink-700);
}
.rp-nav-group > .rp-nav-group-toggle .rp-chev { transition: transform .18s ease; }
.rp-nav-group.is-open > .rp-nav-group-toggle .rp-chev { transform: rotate(180deg); }
.rp-nav-sublist {
  list-style: none; margin: 1px 0 4px; padding: 0;
  display: flex; flex-direction: column; gap: 1px;
}
.rp-nav-group:not(.is-open) > .rp-nav-sublist { display: none; }
.rp-nav-sublist .rp-nav-item { padding-left: 38px; font-weight: 500; }

/* actief item: zachte brand-tint + bar links */
.rp-nav-item.is-active {
  background: var(--sb-active-bg);
  color: var(--sb-active-fg);
  font-weight: 600;
}
.rp-nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 6px; top: 6px; bottom: 6px;
  width: 3px; border-radius: 2px;
  background: var(--brand);
}
.rp-nav-sublist .rp-nav-item.is-active::before {
  left: 22px;
}

/* + knop in nav rij */
.rp-nav-aux {
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--ink-500);
  display: grid; place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s ease, background .12s ease, color .12s ease;
}
.rp-nav-aux i { font-size: 14px; }
.rp-nav-item:hover .rp-nav-aux,
.rp-nav-aux:focus-visible { opacity: 1; }
.rp-nav-aux:hover {
  background: rgba(0,0,0,.06);
  color: var(--ink-900);
}

/* badge in nav */
.rp-badge {
  display: inline-flex; align-items: center; justify-content: center;
  height: 18px; min-width: 18px; padding: 0 5px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.rp-badge-count { background: var(--brand); color: #fff; }
.rp-badge-warn  { background: var(--warn); color: #fff; }
.rp-badge-soft  { background: var(--brand-soft); color: var(--brand-700); }
.rp-badge-dot   { box-shadow: 0 0 0 2px var(--tb-bg); }
.rp-badge-sm    { height: 14px; min-width: 14px; font-size: 9.5px; }

/* dot in nav (Support OK) */
.rp-dot {
  width: 8px; height: 8px; border-radius: 999px; background: var(--ink-300);
  flex: 0 0 auto;
}
.rp-dot-ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }

.rp-nav-divider {
  height: 1px; background: var(--sb-border);
  margin: 8px 6px;
}

.rp-sidebar-foot {
  margin-top: auto;
  padding: 10px 14px;
  border-top: 1px solid var(--sb-border);
  background: linear-gradient(to top, var(--ink-100), transparent);
}
.rp-branch {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ink-0);
  border: 1px solid var(--sb-border);
  font-size: 11.5px;
  color: var(--ink-600);
  font-family: var(--font-mono);
}
.rp-branch i { font-size: 13px; }

/* ==========================================================================
   TOPBAR
   ========================================================================== */
.rp-topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--tb-h);
  padding: 0 22px 0 14px;
  background: var(--tb-bg);
  border-bottom: 1px solid var(--tb-border);
  gap: 14px;
}
.rp-topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.rp-topbar-right { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }

.rp-icon-btn {
  appearance: none;
  width: 36px; height: 36px;
  border-radius: var(--r-2);
  border: 0; background: transparent;
  color: var(--ink-600);
  display: inline-grid; place-items: center;
  cursor: pointer;
  position: relative;
  transition: background .12s ease, color .12s ease;
}
.rp-icon-btn:hover { background: var(--ink-100); color: var(--ink-900); }
.rp-icon-btn i { font-size: 18px; }
.rp-icon-btn .rp-badge { position: absolute; top: 5px; right: 5px; }

.rp-search {
  position: relative;
  display: flex; align-items: center;
  width: min(420px, 40vw);
  height: 38px;
  padding: 0 12px;
  background: var(--ink-100);
  border: 1px solid transparent;
  border-radius: var(--r-3);
  transition: background .12s ease, border-color .12s ease;
}
.rp-search:focus-within {
  background: var(--ink-0);
  border-color: var(--brand-soft);
  box-shadow: 0 0 0 3px var(--brand-softer);
}
.rp-search > i { color: var(--ink-500); font-size: 16px; margin-right: 8px; }
.rp-search input {
  border: 0; background: transparent;
  flex: 1 1 auto; min-width: 0;
  font: inherit; font-size: 13.5px; color: var(--ink-800);
  outline: none;
}
.rp-search input::placeholder { color: var(--ink-500); }
.rp-kbd {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--ink-500);
  background: var(--ink-0);
  border: 1px solid var(--ink-200);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
}

.rp-divider-v {
  width: 1px; height: 22px;
  background: var(--ink-200);
  margin: 0 6px;
}

/* AI button */
.rp-ai-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px;
  padding: 0 12px 0 11px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-700) 100%);
  color: #fff;
  font: inherit; font-weight: 600; font-size: 12.5px;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 1px 2px rgba(74,29,138,.4);
  transition: transform .08s ease, box-shadow .12s ease, filter .12s ease;
}
.rp-ai-btn:hover { filter: brightness(1.07); }
.rp-ai-btn:active { transform: translateY(1px); }
.rp-ai-btn i { font-size: 14px; }
.rp-ai-btn .rp-tag {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em;
  padding: 1px 5px; border-radius: 4px;
  background: rgba(255,255,255,.2);
}

/* Profile chip */
.rp-profile {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--ink-200);
  border-radius: 999px;
  background: var(--ink-0);
  cursor: pointer;
  position: relative;
  font: inherit;
  margin-left: 4px;
  transition: background .12s ease, border-color .12s ease;
}
.rp-profile:hover { background: var(--ink-50); border-color: var(--ink-300); }
.rp-avatar {
  width: 28px; height: 28px; border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  letter-spacing: .02em;
}
.rp-profile-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.rp-profile-text strong { font-size: 12.5px; color: var(--ink-900); font-weight: 600; }
.rp-profile-text small { font-size: 10.5px; color: var(--ink-500); }
.rp-profile .rp-badge { position: absolute; top: -2px; right: -2px; }

/* Popover (help/contact) */
.rp-pop { position: relative; }
.rp-pop summary {
  list-style: none;
}
.rp-pop summary::-webkit-details-marker { display: none; }
.rp-pop[open] summary { background: var(--ink-100); color: var(--ink-900); }
.rp-pop-panel {
  position: absolute; right: 0; top: calc(100% + 6px);
  width: 280px;
  background: var(--ink-0);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-3);
  box-shadow: 0 10px 30px rgba(20,16,30,.12), 0 2px 6px rgba(20,16,30,.05);
  padding: 8px;
  z-index: 100;
}
.rp-pop-title {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-500); font-weight: 600;
  padding: 6px 8px 4px;
}
.rp-pop-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 8px;
  border: 0; background: transparent;
  border-radius: var(--r-2);
  color: var(--ink-800);
  font: inherit; font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.rp-pop-row:hover { background: var(--ink-100); }
.rp-pop-row > i:first-child { color: var(--ink-500); font-size: 16px; }
.rp-pop-row > span { flex: 1; }
.rp-pop-row.is-active { color: var(--brand-700); }
.rp-pop-row.is-active > i:first-child { color: var(--brand); }
.rp-pop-row.is-active > i.ti-check { color: var(--brand); }
.rp-pop-sep { height: 1px; background: var(--ink-200); margin: 6px 4px; }

/* ==========================================================================
   PAGE BODY
   ========================================================================== */
.rp-page-body {
  flex: 1 1 auto;
  padding: 24px 0 32px;
}
.rp-page-body .container-xl {
  max-width: none;
  padding-left: 28px; padding-right: 28px;
}

/* page header */
.rp-page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--ink-200);
}
.rp-crumbs {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px;
  color: var(--ink-500);
  margin-bottom: 6px;
}
.rp-crumbs a { color: var(--ink-500); text-decoration: none; }
.rp-crumbs a:hover { color: var(--brand-700); }
.rp-crumbs i { font-size: 13px; opacity: .6; }
.rp-crumbs [aria-current="page"] { color: var(--ink-800); font-weight: 600; }
.rp-page-title {
  font-size: 22px; font-weight: 700; letter-spacing: -.015em;
  margin: 0; color: var(--ink-900);
}

.rp-page-actions { display: flex; align-items: center; gap: 8px; }
.rp-page-actions .btn {
  --tblr-btn-padding-y: 6px;
  --tblr-btn-padding-x: 12px;
  font-size: 13px;
  border-radius: var(--r-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.rp-page-actions .btn i { font-size: 15px; }
.rp-btn-primary {
  background: var(--brand); color: #fff; border: 1px solid var(--brand-700);
}
.rp-btn-primary:hover { background: var(--brand-700); color: #fff; }

/* ── Cards ────────────────────────────────────────────────────────────── */
.rp-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-4);
  box-shadow: 0 1px 0 rgba(20,16,30,.02);
}
.rp-card .card-body { padding: 20px 22px; }

.rp-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--ink-200);
}
.rp-card-title {
  font-size: 17px; font-weight: 700; margin: 0; letter-spacing: -.01em;
  color: var(--ink-900);
}
.rp-card-head-meta { display: flex; align-items: center; gap: 8px; }

.rp-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  background: var(--brand-soft);
  color: var(--brand-700);
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  letter-spacing: .005em;
}
.rp-chip i { font-size: 13px; }
.rp-chip-mono {
  background: var(--ink-100); color: var(--ink-700);
  font-family: var(--font-mono);
  letter-spacing: .04em;
}

/* Map card */
.rp-card-map .card-body { padding: 0; }
.rp-map-wrap { position: relative; border-radius: var(--r-4); overflow: hidden; }
.rp-map { height: 360px; }
.rp-map-expand {
  position: absolute; left: 10px; bottom: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--ink-200);
  border-radius: 999px;
  font: inherit; font-size: 11.5px; color: var(--ink-700);
  cursor: pointer; z-index: 500;
  backdrop-filter: blur(6px);
}
.rp-map-expand i { font-size: 14px; }

/* ── DL grid (bedrijfsgegevens / adressen / betaal info) ──────────────── */
.rp-dl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 36px;
}
.rp-dl-sect h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-500);
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--ink-200);
}
.rp-dl-sect + h3 { margin-top: 14px; }
.rp-dl-sect dl {
  display: grid;
  grid-template-columns: minmax(140px, 40%) 1fr;
  column-gap: 14px;
  row-gap: 6px;
  margin: 0 0 14px;
}
.rp-dl-sect dt {
  font-size: 12.5px; font-weight: 500; color: var(--ink-600);
  padding-top: 2px;
}
.rp-dl-sect dd {
  font-size: 13px; color: var(--ink-900);
  margin: 0;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
}
.rp-dl-sect dd .rp-muted { color: var(--ink-500); font-weight: 400; }
.rp-dd-empty { color: var(--ink-400) !important; }

.rp-x { color: var(--err); font-size: 17px; }
.rp-ok { color: var(--ok); font-size: 17px; }
.rp-muted { color: var(--ink-500); }
.rp-link { color: var(--brand-700); text-decoration: none; font-weight: 500; }
.rp-link:hover { text-decoration: underline; }
.rp-link-btn {
  appearance: none; border: 0; background: transparent;
  color: var(--brand-700); cursor: pointer; padding: 0;
  font: inherit; font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 5px;
}
.rp-link-btn i { font-size: 14px; }

.rp-alert-inline {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px;
  background: var(--err-soft);
  color: var(--err);
  border-radius: var(--r-1);
  font-size: 12.5px; font-weight: 500;
}
.rp-alert-inline i { font-size: 14px; }

.rp-soft-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-2);
  background: var(--ink-0);
  color: var(--ink-800);
  font: inherit; font-size: 12.5px; font-weight: 500;
  cursor: pointer;
}
.rp-soft-btn i { font-size: 14px; color: var(--brand); }
.rp-soft-btn:hover { background: var(--ink-50); }

.rp-addr {
  font-size: 13px; color: var(--ink-800); line-height: 1.5;
}

.rp-pill {
  display: inline-flex; padding: 2px 9px;
  background: var(--brand-soft);
  color: var(--brand-700);
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
}

.rp-collapse-btn {
  margin-top: 12px;
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: var(--ink-50);
  border: 1px dashed var(--ink-200);
  border-radius: var(--r-2);
  color: var(--ink-700);
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.rp-collapse-btn:hover { background: var(--ink-100); }
.rp-collapse-btn > i:first-child { color: var(--brand); font-size: 15px; }
.rp-collapse-btn .ms-auto { color: var(--ink-400); }

/* ── Tabs ─────────────────────────────────────────────────────────────── */
.rp-tabs-header {
  padding: 0 6px;
  border-bottom: 1px solid var(--ink-200);
}
.rp-tabs.nav-tabs {
  border-bottom: 0;
  gap: 2px;
  padding-top: 6px;
}
.rp-tabs .nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0 !important;
  padding: 10px 14px;
  margin-bottom: -1px;
  border-radius: var(--r-2) var(--r-2) 0 0;
  color: var(--ink-600);
  font-size: 13px; font-weight: 500;
  background: transparent;
  position: relative;
}
.rp-tabs .nav-link:hover { color: var(--ink-900); background: var(--ink-50); }
.rp-tabs .nav-link.active {
  color: var(--brand-700);
  background: transparent;
  font-weight: 600;
}
.rp-tabs .nav-link.active::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: -1px;
  height: 2px; border-radius: 2px 2px 0 0;
  background: var(--brand);
}
.rp-tabs .nav-link i { font-size: 15px; color: currentColor; opacity: .85; }
.rp-dot-tab {
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--brand);
  display: inline-block; margin-left: 2px;
}

/* tab-head (zoek + per-page) */
.rp-tab-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.rp-tab-head > div:first-child {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.rp-tab-title {
  font-size: 14px; font-weight: 600; color: var(--ink-800);
  margin: 0;
}
.rp-search-sm { height: 32px; padding: 0 10px; width: 240px; }
.rp-search-sm input { font-size: 12.5px; }
.rp-search-sm > i { font-size: 14px; }

.rp-tab-head-right { display: flex; align-items: center; gap: 8px; }
.rp-perpage {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink-600);
}
.rp-perpage select {
  width: 64px; height: 30px; font-size: 12px;
  border-radius: var(--r-1);
}

/* ── Table ────────────────────────────────────────────────────────────── */
.rp-table {
  --tblr-table-bg: transparent;
  margin-bottom: 0;
}
.rp-table thead th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-500);
  background: var(--ink-50);
  border-bottom: 1px solid var(--ink-200);
  padding: 10px 14px;
  vertical-align: middle;
}
.rp-table tbody td {
  padding: 12px 14px;
  font-size: 13px;
  border-top: 1px solid var(--ink-100);
  vertical-align: middle;
}
.rp-table tbody tr:hover td { background: var(--ink-50); }
.rp-th-sortable { cursor: pointer; }
.rp-th-sortable i { font-size: 13px; opacity: .6; margin-left: 2px; }
.rp-th-stack { display: flex; flex-direction: column; gap: 4px; }
.rp-th-stack .rp-th-label { font: inherit; }
.rp-th-stack select {
  font-size: 12px; height: 28px;
  border-radius: var(--r-1);
  text-transform: none; letter-spacing: 0;
  color: var(--ink-700); font-weight: 500;
}
.rp-cell-strong { font-weight: 600; }
.tabular { font-variant-numeric: tabular-nums; }

.rp-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  line-height: 1;
}
.rp-status::before {
  content: "";
  width: 6px; height: 6px; border-radius: 999px;
  background: currentColor;
}
.rp-status-ok   { background: var(--ok-soft); color: var(--ok); }
.rp-status-warn { background: var(--warn-soft); color: var(--warn); }
.rp-status-off  { background: var(--ink-100); color: var(--ink-500); }

.rp-row-actions .btn-icon {
  width: 30px; height: 30px;
  border: 0;
  color: var(--ink-500);
  background: transparent;
}
.rp-row-actions .btn-icon:hover { color: var(--brand-700); background: var(--brand-soft); }
.rp-row-actions .btn-icon i { font-size: 15px; }

/* ── Footer ───────────────────────────────────────────────────────────── */
.rp-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  border-top: 1px solid var(--ink-200);
  background: var(--tb-bg);
  font-size: 12px;
  color: var(--ink-500);
}
.rp-footer-links {
  display: flex; align-items: center; gap: 20px;
  list-style: none; margin: 0; padding: 0;
}
.rp-footer-links a {
  color: var(--ink-500); text-decoration: none;
}
.rp-footer-links a:hover { color: var(--brand-700); }

/* ==========================================================================
   THEME — Polished Light (default)
   ========================================================================== */
.theme-polished {
  --sb-bg: var(--ink-50);
  --sb-fg: var(--ink-700);
  --sb-border: var(--ink-200);
  --sb-active-bg: var(--brand-soft);
  --sb-active-fg: var(--brand-700);
}

/* ==========================================================================
   THEME — Icon-rail + panel
   Smalle iconen-rail links + sub-menu panel daarnaast.
   Pagina-inhoud krijgt meer ruimte.
   ========================================================================== */
.theme-rail { --sb-w: 64px; }
.theme-rail .rp-sidebar {
  width: 64px;
  align-items: center;
}
.theme-rail .rp-sidebar-head { padding: 18px 0 12px; border-bottom: 1px solid var(--sb-border); width: 100%; display: grid; place-items: center; }
.theme-rail .rp-brand-text { display: none; }
.theme-rail .rp-brand { gap: 0; }

.theme-rail .rp-nav { padding: 8px 0; align-items: center; width: 100%; gap: 4px; }

/* In rail-mode toggle = ronde icoonknop; tekst en sublijst verborgen */
.theme-rail .rp-nav-section-toggle {
  width: 40px; height: 40px;
  padding: 0;
  border-radius: var(--r-2);
  display: grid; place-items: center;
  position: relative;
  color: var(--ink-600);
}
.theme-rail .rp-nav-section-toggle > span,
.theme-rail .rp-nav-section-toggle > .rp-chev { display: none; }
.theme-rail .rp-nav-section-toggle > i:first-child { font-size: 19px; }
.theme-rail .rp-nav-section-toggle .rp-badge {
  position: absolute; top: 2px; right: 2px;
  height: 14px; min-width: 14px; font-size: 9.5px;
}
.theme-rail .rp-nav-section-toggle .rp-dot {
  position: absolute; bottom: 4px; right: 4px;
}
.theme-rail .rp-nav-section.is-open > .rp-nav-section-toggle {
  background: var(--brand-soft);
  color: var(--brand-700);
}
.theme-rail .rp-nav-section.is-open > .rp-nav-section-toggle::before {
  content: "";
  position: absolute; left: -10px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 2px 2px 0;
  background: var(--brand);
}

/* In rail-mode: lijsten verbergen — komen straks als hover/flyout */
.theme-rail .rp-nav-list { display: none !important; }
.theme-rail .rp-nav-divider { width: 28px; margin: 6px auto; }

/* tooltip-bubble bij hover op rail-item */
.theme-rail .rp-nav-section-toggle::after {
  content: attr(data-tip);
}
.theme-rail .rp-nav-section-toggle:hover { background: var(--ink-100); color: var(--ink-900); }

.theme-rail .rp-sidebar-foot {
  width: 100%; padding: 10px;
  display: grid; place-items: center;
}
.theme-rail .rp-branch { padding: 4px; }
.theme-rail .rp-branch span { display: none; }
.theme-rail .rp-branch i { font-size: 15px; }

/* In rail-mode tonen we het submenu rechts ernaast als "panel" */
.theme-rail .rp-page {
  grid-template-columns: 64px 240px 1fr;
}
.theme-rail::after { /* placeholder so grid 3-cols apply via .rp-rail-panel */ }
.theme-rail .rp-sidebar { grid-column: 1; }
.theme-rail .rp-page-wrapper { grid-column: 3; }

/* Inject panel via pseudo */
.theme-rail .rp-page::before {
  content: "";
  grid-column: 2;
  background: var(--ink-0);
  border-right: 1px solid var(--ink-200);
}
/* We renderen daadwerkelijke panel via JS — zie tweaks.jsx */
.rp-rail-panel {
  grid-column: 2;
  background: var(--ink-0);
  border-right: 1px solid var(--ink-200);
  padding: 18px 14px;
  min-height: 100vh;
  position: sticky; top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
}
.theme-rail .rp-page::before { display: none; } /* eat the placeholder if real panel mounted */
.rp-rail-panel-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-500);
  padding: 4px 10px 10px;
}
.rp-rail-panel ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.rp-rail-panel .rp-nav-item {
  padding: 8px 12px;
}
.rp-rail-panel .rp-nav-item.is-active::before { left: 6px; }

/* In rail-mode: page wrapper niet stretchen tot kolom 2 */
.theme-rail .rp-page { grid-template-columns: 64px 240px minmax(0,1fr); }

/* ==========================================================================
   THEME — Inkt (donkere sidebar)
   ========================================================================== */
.theme-inkt {
  --sb-bg: #1a1622;
  --sb-fg: #c8c2d4;
  --sb-fg-muted: #7d7689;
  --sb-border: #2a2335;
  --sb-section-fg: #f0ecf6;
  --sb-item-hover: rgba(255,255,255,.05);
  --sb-active-bg: color-mix(in srgb, var(--brand) 30%, transparent);
  --sb-active-fg: #ffffff;
}
.theme-inkt .rp-sidebar { color: var(--sb-fg); }
.theme-inkt .rp-brand-text strong { color: #fff; }
.theme-inkt .rp-brand-text strong span { color: #c8c2d4; }
.theme-inkt .rp-brand-text small { color: #7d7689; }
.theme-inkt .rp-nav-section-toggle { color: var(--sb-section-fg); }
.theme-inkt .rp-nav-section-toggle > i:first-child { color: #b9b1c8; }
.theme-inkt .rp-nav-section-toggle .rp-chev { color: #6d6678; }
.theme-inkt .rp-nav-section-toggle:hover { background: var(--sb-item-hover); }
.theme-inkt .rp-nav-item { color: var(--sb-fg); }
.theme-inkt .rp-nav-item:hover { background: var(--sb-item-hover); color: #fff; }
.theme-inkt .rp-nav-item.is-active { background: var(--sb-active-bg); color: #fff; }
.theme-inkt .rp-nav-item.is-active::before { background: var(--accent); }
.theme-inkt .rp-nav-aux { color: #7d7689; }
.theme-inkt .rp-nav-aux:hover { background: rgba(255,255,255,.08); color: #fff; }
.theme-inkt .rp-nav-divider { background: var(--sb-border); }
.theme-inkt .rp-sidebar-foot {
  border-top: 1px solid var(--sb-border);
  background: linear-gradient(to top, #15111c, transparent);
}
.theme-inkt .rp-branch {
  background: #221c2d;
  border-color: #2e2638;
  color: #b9b1c8;
}
.theme-inkt .rp-badge-soft { background: rgba(139,78,224,.18); color: #d3b8ff; }
.theme-inkt .rp-badge-dot { box-shadow: 0 0 0 2px var(--sb-bg); }

/* ==========================================================================
   Dark mode (full app)
   ========================================================================== */
body.is-dark {
  --page-bg: #14111a;
  --card-bg: #1c1828;
  --card-border: #2a2335;
  --ink-0: #1c1828;
  --ink-50: #221d2e;
  --ink-100: #2a2335;
  --ink-200: #342c41;
  --ink-300: #46384f;
  --ink-500: #948aa3;
  --ink-600: #b3acc0;
  --ink-700: #d4cfe0;
  --ink-800: #ece8f4;
  --ink-900: #f5f3fa;
  --tb-bg: #1c1828;
  --tb-border: #2a2335;
  color: var(--ink-800);
}
body.is-dark.theme-polished {
  --sb-bg: #1c1828;
  --sb-border: #2a2335;
}
body.is-dark .rp-brand-text strong { color: #fff; }

/* ==========================================================================
   Misc Tabler overrides — small polish
   ========================================================================== */
.btn-outline-secondary {
  --tblr-btn-color: var(--ink-700);
  --tblr-btn-border-color: var(--ink-200);
  --tblr-btn-hover-bg: var(--ink-50);
  --tblr-btn-hover-color: var(--ink-900);
  --tblr-btn-hover-border-color: var(--ink-300);
  background: var(--ink-0);
}

.form-select {
  --tblr-form-select-bg: var(--ink-0);
  border-color: var(--ink-200);
  font-size: 13px;
}

/* ==========================================================================
   BRAND PRESETS (whitelabel)
   Pas --brand-primary en --brand-secondary aan met één class op <body>.
   --brand-primary  → knoppen, actief-state, links, accenten
   --brand-secondary → donkere sidebar (design B), inkt theme
   ========================================================================== */
body.brand-rp {
  --brand-primary: #4a1d8a;
  --brand-secondary: #1a1622;
}
body.brand-aad {
  --brand-primary: #313b4a;
  --brand-secondary: #000000;
}
body.brand-blue {
  --brand-primary: #2563eb;
  --brand-secondary: #0f172a;
}
body.brand-teal {
  --brand-primary: #0e7c66;
  --brand-secondary: #0a1f1a;
}
body.brand-orange {
  --brand-primary: #c2410c;
  --brand-secondary: #1a0d08;
}
body.brand-dubline {
  --brand-primary: #1ab394;
  --brand-secondary: #0a1614;
}

/* For AAD-style brand (slate primary, black sidebar), tone down the brand-soft 
   so things don't look washed-out blue */
body.brand-aad {
  --brand-soft: color-mix(in srgb, var(--brand-primary) 14%, transparent);
}

/* ==========================================================================
   Design-A specific overrides — Page header extras
   ========================================================================== */
.rp-page-title-copy {
  appearance: none;
  border: 0; background: transparent;
  width: 24px; height: 24px;
  border-radius: 6px;
  color: var(--ink-400);
  cursor: pointer;
  display: inline-grid; place-items: center;
  vertical-align: middle;
  margin-left: 4px;
}
.rp-page-title-copy:hover { background: var(--ink-100); color: var(--ink-900); }
.rp-page-title-copy i { font-size: 14px; }

.rp-btn-danger {
  background: #fff;
  color: var(--err);
  border: 1px solid color-mix(in srgb, var(--err) 30%, var(--ink-200));
}
.rp-btn-danger:hover { background: var(--err-soft); color: var(--err); }

.rp-ai-btn-secondary {
  background: #fff;
  color: var(--ink-700);
  border: 1px solid var(--ink-200);
  box-shadow: none;
}
.rp-ai-btn-secondary:hover {
  background: var(--ink-50);
  filter: none;
  border-color: var(--ink-300);
}
.rp-ai-btn-secondary i { color: var(--brand-primary); }

.rp-pop-flag {
  width: 22px; height: 16px;
  display: inline-grid; place-items: center;
  background: var(--ink-100);
  color: var(--ink-700);
  border-radius: 3px;
  font-size: 9.5px; font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: .03em;
}

.rp-mail-row {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px 3px 9px;
  background: var(--ink-100);
  border-radius: 999px;
  font-size: 12.5px;
}
.rp-mail-row i { color: var(--ink-500); font-size: 13px; }
.rp-mail-row a { color: var(--ink-800); text-decoration: none; font-weight: 500; }
.rp-mail-row a:hover { text-decoration: underline; }
.rp-mail-copy {
  appearance: none;
  width: 18px; height: 18px;
  border: 0; background: transparent;
  border-radius: 4px;
  color: var(--ink-500); cursor: pointer;
  display: grid; place-items: center;
}
.rp-mail-copy:hover { background: var(--ink-200); color: var(--ink-900); }
.rp-mail-copy i { font-size: 11px; }

.rp-pill-muted { background: var(--ink-100); color: var(--ink-600); }

.rp-type-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand-primary-dark);
  font-size: 12px; font-weight: 600;
}
.rp-type-chip i { font-size: 13px; }

.rp-footer-link-design {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: transparent;
  color: var(--ink-600);
  border: 1px solid var(--ink-200);
  border-radius: 7px;
  text-decoration: none;
  font-size: 12px; font-weight: 700;
}
.rp-footer-link-design:hover {
  background: var(--brand-soft);
  color: var(--brand-primary-dark);
  border-color: var(--brand-soft);
}
.rp-footer-link-design-current {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
  cursor: default;
}
.rp-footer-link-design-current:hover {
  color: #fff;
  background: var(--brand-primary);
}
.rp-footer-design-links {
  display: flex; gap: 6px;
}

/* Brand-name override (replaces the hard-coded ResalePartners markup with a 
   single brand-name + tag pair driven by --brand-name / --brand-tag content) */
.rp-brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink-900);
  line-height: 1.05;
}
.rp-brand-tag {
  font-size: 10.5px;
  color: var(--ink-500);
  letter-spacing: .04em;
  text-transform: lowercase;
}
.rp-brand-mark-glyph {
  position: absolute;
  inset: 9px;
  background: rgba(255,255,255,.95);
  border-radius: 2px;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}
