:root {
  --bg:             #ffffff;
  --surface:        #ffffff;
  --surface-hover:  #f1f5f9;
  --border:         #e2e8f0;
  --accent:         #4f7dff;
  --accent-hover:   #3d6bec;
  --text:           #1B3755;
  --text-muted:     #64748B;
  --success:        #008000;
  --warning:        #F59E0B;
  --danger:         #FF0000;
  --radius:         8px;
  --font:           'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Sidebar eigen palet */
  --sidebar-bg:     #F59E0B;
  --sidebar-hover:  #e08900;
  --sidebar-text:   #1B3755;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  min-height: 100vh;
}

/* Layout */
.app { display: flex; height: 100vh; overflow: hidden; visibility: hidden; }

.sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  border-right: none;
  padding: 24px 0 80px;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
  position: relative;
  top: 0;
}

.sidebar-logo {
  padding: 0 20px;
  background: #ffffff;
  margin: -24px 0 0;
  border-bottom: 3px solid var(--sidebar-bg);
  display: flex;
  align-items: center;
  min-height: 70px;
}

.sidebar-logo img {
  height: 22px;
}

.sidebar-nav a {
  display: block;
  padding: 10px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 600;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  opacity: 0.75;
}

.sidebar-nav a:hover {
  background: var(--sidebar-hover);
  opacity: 1;
}

.sidebar-nav a.active {
  background: rgba(255,255,255,0.25);
  border-left: 3px solid var(--accent);
  padding-left: 17px;
  color: var(--sidebar-text);
  opacity: 1;
}

/* Sectie-label in sidebar (tenant naam) */
.sidebar-nav #nav-tenant-label {
  color: #ffffff;
  opacity: 0.85;
}

/* Wrapper centreert main + hulppaneel in de ruimte rechts van sidebar */
.content-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  height: 100vh;
  min-width: 0;
  overflow: hidden;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 0 32px 32px;
  overflow-y: auto;
  height: 100vh;
  max-width: 860px;
}

/* Hulppaneel rechts (desktop) */
.help-panel {
  width: 280px;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 20px;
  border-left: 1px solid var(--border);
  background: var(--surface-hover, #f8fafc);
}

.help-panel-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  min-height: 70px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  margin: 0 -20px 16px;
  padding: 0 20px;
}

/* Help panel begint zonder top-padding zodat titel op 70px lijn zit */
.help-panel {
  padding-top: 0;
}

.help-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.help-card-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text);
}

.help-card-text {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

/* Highlight-variant: stip-legenda valt op met oranje accent */
.help-card--highlight {
  border: 1.5px solid #F59E0B;
  background: #FFFBEB;
}
.help-card--highlight .help-card-title { color: #B45309; }
.help-card--highlight .help-card-text  { color: var(--text); }

/* Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  padding: 12px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.sticky-top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  margin: 0 -32px 20px -32px;
  padding: 0 32px;
  display: flex;
  flex-wrap: wrap;
}

.sticky-top-bar .page-header {
  position: static;
  padding: 0;
  margin: 0;
  width: 100%;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

/* Breadcrumbs verborgen — sidebar toont al de context */
.breadcrumb { display: none; }

.page-title { font-size: 22px; font-weight: 600; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

/* Table */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

thead tr { border-bottom: 1px solid var(--border); }

th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover { background: var(--surface-hover); }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-intro    { background: #e2e8f0; color: #64748B; }
.badge-duo      { background: #dbeafe; color: #1d4ed8; }
.badge-tempo    { background: #fef3c7; color: #b45309; }
.badge-postpro  { background: #ede9fe; color: #6d28d9; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary { background: #1B3755; color: #fff; }
.btn-primary:hover { background: #152d47; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Forms */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input, select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

select option { background: var(--bg); }

/* Toggle switch */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  cursor: pointer;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* Day selector */
.day-selector { display: flex; gap: 6px; flex-wrap: wrap; }

.day-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.day-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Platform row */
.platform-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.platform-row:last-child { border-bottom: none; }

.platform-name {
  width: 100px;
  font-weight: 500;
  text-transform: capitalize;
}

.platform-controls { flex: 1; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 480px;
  max-width: 95vw;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title { font-size: 16px; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 2px 6px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Feature chips */
.feature-list { display: flex; gap: 6px; flex-wrap: wrap; }

.feature-chip {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.feature-on  { background: #e6f4ea; color: #008000; }
.feature-off { background: #f1f5f9; color: #94a3b8; }

/* AI-aanwezig indicator — donkerblauwe stip uit logo.
   Variants:
     .ai-dot           — gevuld: door AI gegenereerd / voorgesteld
     .ai-dot--ring     — open ringetje: AI + door tenant aangepast (loop werkt)
   Cursor-help + title-attr op het element geeft tooltip. */
.ai-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1B3755;
  box-shadow: 0 0 0 1.5px #F59E0B;
  animation: ai-dot-pulse 2.8s ease-in-out infinite;
  vertical-align: middle;
  cursor: help;
  flex-shrink: 0;
}
/* Tenant heeft bewerkt → vast oranje (geen pulse meer — jouw versie is "af") */
.ai-dot--ring {
  background: #F59E0B;
  box-shadow: 0 0 0 1.5px #F59E0B;
  animation: none;
}
/* Op thumbnail: extra witte halo zodat hij op elke foto leesbaar blijft */
.ai-dot--on-image {
  position: absolute;
  bottom: 6px;
  left: 6px;
  width: 9px;
  height: 9px;
  box-shadow: 0 0 0 1.5px #F59E0B, 0 0 0 3px rgba(255,255,255,.9);
}
/* Kleur-pulse binnenin: donkerblauw ↔ oranje.
   Suggereert: AI + mens werken samen, 2Post leert. */
@keyframes ai-dot-pulse {
  0%, 100% { background: #1B3755; }
  50%      { background: #F59E0B; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-dot { animation: none; }
}

/* Global spinner — full-page overlay voor acties >1.5s (beeld-generatie,
   scraping, website-analyse, post-suggesties). Grote pulserende variant van
   .ai-dot met dubbele puls: de kern wisselt kleur én er gaat een ring naar
   buiten. Toont dat 2Post aan het werk is. */
.global-spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  animation: global-spinner-fade 0.2s ease-out;
}
.global-spinner-dot {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #1B3755;
  box-shadow: 0 0 0 3px #F59E0B;
  animation: global-spinner-core 2.4s ease-in-out infinite;
}
.global-spinner-dot::before,
.global-spinner-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 3px solid #F59E0B;
  animation: global-spinner-ring 2.4s ease-out infinite;
}
.global-spinner-dot::after { animation-delay: 1.2s; }
.global-spinner-label {
  font-size: 14px;
  font-weight: 600;
  color: #1B3755;
  letter-spacing: 0.2px;
  text-align: center;
  max-width: 320px;
  padding: 0 16px;
}
@keyframes global-spinner-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes global-spinner-core {
  0%, 100% { background: #1B3755; transform: scale(1); }
  50%      { background: #F59E0B; transform: scale(0.88); }
}
@keyframes global-spinner-ring {
  0%   { transform: scale(1);   opacity: 0.9; }
  100% { transform: scale(1.9); opacity: 0;   }
}
@media (prefers-reduced-motion: reduce) {
  .global-spinner-dot,
  .global-spinner-dot::before,
  .global-spinner-dot::after { animation: none; }
}

/* 24-uurs tijd forceren op ALLE <input type="time"> — ongeacht browser/OS-taal.
   Native time-picker respecteert browser-locale, niet toLocaleTimeString-calls.
   Onthou: `lang="nl-NL"` op het input zelf is de primaire fix (Chrome/Edge/FF),
   deze CSS is de WebKit-fallback die het AM/PM-veld verbergt mocht de browser
   'm toch tonen. */
input[type="time"] {
  font-variant-numeric: tabular-nums;
}
input[type="time"]::-webkit-datetime-edit-ampm-field,
input[type="time"]::-webkit-datetime-edit-meridiem-field {
  display: none !important;
  width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Taal-toggle — 2-state pill boven user-email in sidebar.
   Beslissing apr 2026: geen vlaggetjes, pill-vorm, directe actie bij klik. */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 2px;
  margin-bottom: 10px;
  gap: 0;
  user-select: none;
}
.lang-toggle button {
  appearance: none;
  background: transparent;
  border: none;
  color: #ffffff;
  opacity: 0.75;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, color 0.15s;
  min-width: 32px;
}
.lang-toggle button:hover {
  opacity: 1;
}
.lang-toggle button.active {
  background: #ffffff;
  color: #1B3755;
  opacity: 1;
}
.lang-toggle button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* "Geleerd"-flits — oranje accent uit logo, kort moment van trots wanneer
   de Learning Engine een nieuwe regel heeft toegevoegd. */
.ai-learned-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #F59E0B;
  cursor: help;
}

/* Kennisbank: chevron draaien bij open details */
details[open] > summary .knowledge-chevron { transform: rotate(90deg); }
details > summary::-webkit-details-marker { display: none; }

/* Crop-knop pulse voor niet-ingestelde assets */
@keyframes crop-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(99, 102, 241, 0); }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 40px; margin-bottom: 12px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 13px;
  z-index: 200;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s;
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb a { color: var(--accent); cursor: pointer; text-decoration: none; }
.breadcrumb span { color: var(--text-muted); }

/* Loading */
.loading { color: var(--text-muted); padding: 32px; text-align: center; }

/* Stats row */
.stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 24px;
  flex: 1;
}

.stat-value { font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.stat-label { color: var(--text-muted); font-size: 12px; }

/* Time inputs row */
.time-row { display: flex; gap: 12px; align-items: center; }

/* Topic card */
.topic-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.topic-card:last-child { border-bottom: none; }

/* Post card — compact 3-kolom layout */
.post-card-compact {
  display: flex;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.post-card-compact:last-child { border-bottom: none; }

/* Thumbnail: langste zijde altijd 280px — landscape breed, portrait hoog */
.post-card-compact > div:first-child {
  max-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-thumb-img {
  max-width: 280px;
  max-height: 280px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.post-card-compact textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color 0.15s;
}

.post-card-compact textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* Dirty (onopgeslagen) platform row */
.platform-row.dirty {
  border-left: 3px solid var(--warning);
  padding-left: 13px;
}

.platform-row.dirty .platform-name::after {
  content: ' ●';
  color: var(--warning);
  font-size: 10px;
}
.time-row span { color: var(--text-muted); }

/* ── Dev-mode badge ──────────────────────────────────────── */
#dev-mode-badge {
  position: fixed;
  top: 12px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 6px 12px;
  z-index: 600;
  box-shadow: 0 2px 12px rgba(0,0,0,.4);
}

/* ── Mobile topbar (verborgen op desktop) ─────────────────── */
.mobile-topbar { display: none; }
.sidebar-backdrop { display: none; }

/* ── Responsive: tablet + mobiel (≤ 768px) ───────────────── */
/* Hulppaneel verbergen op tablets */
@media (max-width: 1100px) {
  .help-panel { display: none; }
  .main { max-width: none; }
}

@media (max-width: 768px) {

  /* Voorkom horizontale overflow — clip i.p.v. hidden zodat position:sticky
     niet kapotgaat in iOS Safari. */
  html, body { overflow-x: clip; max-width: 100vw; }

  /* Mobiel topbar — sticky (in flow) zodat het naadloos aansluit op de
     tenant-header eronder. Fixed gaf altijd kleine viewport-discrepanties
     met iOS Safari URL-bar inschuif. */
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0; left: 0; right: 0;
    height: 52px;
    background: #ffffff;
    border-bottom: 3px solid var(--sidebar-bg);
    padding: 0 16px;
    z-index: 400;
  }

  .hamburger {
    background: none;
    border: none;
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 6px;
    line-height: 1;
  }

  .mobile-logo {
    height: 22px;
  }

  /* Sidebar wordt overlay — app mag nu in hoogte meegroeien en scrollen. */
  .app { display: block; height: auto; min-height: 100vh; overflow: visible; }
  /* Geen geneste scroll-container op mobiel: body scrollt, géén overflow:hidden.
     Geen margin-top — mobile-topbar staat nu sticky in flow, neemt z'n eigen ruimte. */
  .content-wrapper { display: block; height: auto; overflow: visible; margin-top: 0; }
  .help-panel { display: none; }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 260px;
    height: 100vh;
    z-index: 500;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    padding-top: 24px;
  }

  .app.sidebar-open .sidebar {
    transform: translateX(0);
  }

  /* Backdrop */
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 490;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }

  .app.sidebar-open .sidebar-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  /* Main: volledige breedte. Géén eigen scroll-context — body scrollt op mobiel
     zodat position:sticky op tenant-header betrouwbaar werkt in iOS Safari. */
  .main {
    width: 100%;
    height: auto;
    margin-top: 0;
    overflow: visible;
    padding: 0 16px 24px 16px;
  }

  .sticky-top-bar {
    position: sticky;
    top: 52px;                           /* = mobile-topbar height (border-box, dus border zit erin) */
    z-index: 100;
    margin: 0 -16px 12px -16px;
    padding: 0 16px;
    min-height: auto;
    background: var(--bg);
  }
  .sticky-top-bar .page-header {
    min-height: auto;
    padding: 6px 0;
  }

  /* Page header wrapping */
  .page-header { flex-wrap: wrap; gap: 10px; }
  .page-title { font-size: 18px; }

  /* Stats-row: 2 kolommen */
  .stats-row { flex-wrap: wrap; gap: 10px; }
  .stat-card { flex: 0 0 calc(50% - 5px); padding: 14px 16px; }
  .stat-value { font-size: 22px; }

  /* Platform-row: stapelen */
  .platform-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .platform-name { width: auto; }
  .platform-controls { width: 100%; gap: 10px; }

  /* Post-kaart compact: gestapeld op mobiel */
  .post-card-compact {
    flex-direction: column !important;
  }
  .post-card-compact > div:first-child {
    width: 100% !important;
    min-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    aspect-ratio: 16 / 9;
  }
  .post-card-compact > div:first-child img,
  .post-card-compact > div:first-child .post-thumb-img {
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    aspect-ratio: 16 / 9;
  }
  .post-card-compact > div:first-child:not(:has(img)) {
    display: none !important;
  }
  .post-card-compact > div:last-child {
    flex-direction: row !important;
    width: 100% !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 8px 12px 10px !important;
  }

  /* Topic-kaart: volledig gestapeld op mobiel */
  .topic-card {
    flex-direction: column !important;
  }

  /* Thumbnail: volle breedte, landscape ratio */
  .topic-card > div:first-child {
    width: 100% !important;
    min-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 16 / 9;
  }

  .topic-card > div:first-child img {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 16 / 9;
  }

  /* Verberg lege placeholder op mobiel (neemt te veel ruimte in) */
  .topic-card > div:first-child:not(:has(img)) {
    display: none !important;
  }

  /* Acties-kolom: volle breedte, horizontaal, gecentreerd */
  .topic-card > div:last-child {
    flex-direction: row !important;
    width: 100% !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 8px 12px 10px !important;
  }

  /* Breadcrumb wrap */
  .breadcrumb { flex-wrap: wrap; }

  /* Toast: full-width onderin */
  .toast { left: 16px; right: 16px; bottom: 16px; }
}

/* ── Klein scherm (≤ 480px) ───────────────────────────────── */
@media (max-width: 480px) {
  /* padding-top:0 — mobile-topbar staat in flow, geen ruimte ervoor reserveren.
     Eerder stond hier 64px uit een tijd dat topbar fixed was. */
  .main { padding: 0 12px 20px; }
  .card { padding: 14px; }
  .stat-card { flex: 0 0 100%; }
  .day-btn { width: 32px; height: 32px; font-size: 10px; }
}

/* ===========================================================================
   2COMBINE TENANT-SCHIL — alleen actief in tenant-context (body.tenant-user).
   De platform-owner-weergave (Tenants/Pakketten/Platformkennis) blijft volledig
   ongemoeid: die verhuist later naar de engine. Spiegelt de 2Publish/engine-
   schil: navy PlatformBar boven, navy sidebar, gebruiker+uitloggen onderaan,
   Tips & hulp rechts. (Fase 3 restyle, 2026-06-15.)
   =========================================================================== */

/* ── Platform-balk (laag 1): standaard verborgen, alleen in tenant-context. ── */
.platform-bar { display: none; }

body.tenant-user .platform-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 48px;
  padding: 0 1rem;
  background: #0D1B2A;              /* Brand Guide navy — 2Combine, niet tenant */
  color: #FAF8F3;                   /* cream */
  border-bottom: 1px solid #1E3151;
  position: sticky;
  top: 0;
  z-index: 450;
}
body.tenant-user .platform-bar__module,
body.tenant-user .platform-bar__home {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  text-decoration: none;
  color: #FAF8F3;
  transition: background 0.15s;
}
body.tenant-user .platform-bar__module:hover,
body.tenant-user .platform-bar__home:hover { background: rgba(255,255,255,0.08); }
body.tenant-user .platform-bar__logo { display: block; height: 1.85rem; width: auto; }
body.tenant-user .platform-bar__spacer { flex: 1; }
body.tenant-user .platform-bar__tenant {
  font-size: 0.85rem;
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
body.tenant-user .platform-bar__home-grid { width: 1rem; height: 1rem; flex-shrink: 0; opacity: 0.8; }

/* ── Sidebar: navy 2Combine-chrome + cream tekst (spiegelt 2Publish admin). ── */
body.tenant-user .sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #0D1B2A;          /* Brand Guide navy */
  color: #FAF8F3;               /* cream */
  border-right: none;
  padding: 1.25rem 0.75rem;
}
body.tenant-user .sidebar-logo { display: none; }                     /* logo zit nu in de balk */
body.tenant-user .sidebar-nav { display: flex; flex-direction: column; gap: 0.125rem; flex: 1; }
body.tenant-user .sidebar-nav #nav-tenant-label { display: none; }    /* tenant staat al in de balk */

body.tenant-user .sidebar-nav a {
  display: block;
  padding: 0.625rem 0.75rem;
  color: #FAF8F3;
  opacity: 1;
  font-weight: 500;
  font-size: 0.875rem;
  border-left: none;
  border-radius: 6px;
}
body.tenant-user .sidebar-nav a:hover { background: rgba(255,255,255,0.08); opacity: 1; }
body.tenant-user .sidebar-nav a.active {
  background: rgba(255,255,255,0.08);
  box-shadow: inset 3px 0 0 #F59E0B;   /* oranje active-balk, exact als 2Publish */
  border-left: none;
  padding-left: 0.75rem;
  color: #FAF8F3;
  font-weight: 600;
}

/* "Terug naar platform" (alleen bij "Als tenant"-preview): zelfde plek als
   "Website bewerken" bij 2Publish — onderaan de nav, boven de footer. De
   #dev-mode-badge stond als zwevende pil rechtsboven (overlapte de stippen);
   hier neutraliseren we die fixed-positionering. */
body.tenant-user #dev-mode-badge {
  position: static;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0.625rem 0.75rem;
  font-size: 0.8125rem;
}
body.tenant-user #dev-mode-badge > span:first-child { opacity: 0.7; }
body.tenant-user #dev-mode-badge #dev-badge-tenant { color: #FAF8F3; }
body.tenant-user #dev-mode-badge button {
  background: transparent;
  color: #FAF8F3;
  border: 1px solid #2a3a50;
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
body.tenant-user #dev-mode-badge button:hover { background: rgba(255,255,255,0.1); }

/* Gebruiker + uitloggen onderaan — cream op navy (overschrijft de inline witte
   kleuren). Gecentreerde uitlog-pil met smalle rand, exact als 2Publish. */
body.tenant-user #sidebar-user {
  position: static !important;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 1rem 0.25rem 0 !important;
}
body.tenant-user #sidebar-user-email {
  color: #FAF8F3 !important;
  opacity: 0.7 !important;
  font-size: 0.6875rem !important;
}
body.tenant-user #sidebar-user .btn-ghost {
  width: auto !important;
  padding: 0.5rem 0.9rem;
  color: #FAF8F3 !important;
  border-color: #2a3a50 !important;
  background: transparent;
}
body.tenant-user #sidebar-user .btn-ghost:hover {
  background: rgba(255,255,255,0.1) !important;
  color: #FAF8F3 !important;
}

/* ── Statblokjes op de Overzicht-pagina (zoals 2Publish-dashboard). ── */
body.tenant-user .tenant-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}
body.tenant-user .tenant-stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
}
body.tenant-user .tenant-stat__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}
body.tenant-user .tenant-stat__num { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; }
body.tenant-user .tenant-stat__sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ── Desktop-layout: balk full-width boven, sidebar + content eronder. ── */
@media (min-width: 769px) {
  body.tenant-user .app {
    display: grid;
    grid-template-columns: 16rem 1fr;   /* = 2Publish admin-sidebar */
    grid-template-rows: 48px minmax(0, 1fr);
    grid-template-areas:
      "bar  bar"
      "side main";
    height: 100vh;
  }
  body.tenant-user .platform-bar   { grid-area: bar; position: static; }
  body.tenant-user .sidebar        { grid-area: side; height: auto; min-height: 0; overflow-y: auto; }
  body.tenant-user .content-wrapper{ grid-area: main; height: auto; min-height: 0; }
  body.tenant-user .main           { height: auto; min-height: 0; }
  body.tenant-user .help-panel     { height: auto; min-height: 0; }
}

/* ── Mobiel: navy balk boven, navy hamburger-balk eronder, sidebar als drawer. ── */
@media (max-width: 768px) {
  body.tenant-user .platform-bar { position: sticky; top: 0; z-index: 450; }
  body.tenant-user .mobile-topbar {
    top: 48px;                                       /* onder de platform-balk */
    background: #0D1B2A;                             /* navy, zoals 2Publish admin-topbar */
    border-bottom: 1px solid rgba(255,255,255,0.12);
  }
  body.tenant-user .hamburger { color: #FAF8F3; }
  body.tenant-user .mobile-logo { display: none; }  /* logo zit al in de platform-balk */
}
