* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Prevent pinch-to-zoom in PWA */
html, body {
  touch-action: manipulation;
}

:root {
  /* VWA Light Theme - Volvo Blue */
  --primary: #1c6bba;
  --primary-dark: #155a9e;
  --primary-light: #3d8fd4;
  --bg-page: #f5f5f5;
  --bg-white: #ffffff;
  --bg-gray-50: #f9fafb;
  --bg-gray-100: #f5f5f5;
  --bg-gray-200: #e5e5e5;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #8a8a8a;
  --border-color: #e5e5e5;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);

  /* Message colors */
  --incoming-bg: #ffffff;
  --outgoing-bg: #1c6bba;
  --outgoing-text: #ffffff;
}

body {
  /* Inter eerst (VWA Design System), met system-stack als fallback voor als
     Google Fonts traag/onbereikbaar is. Op iOS toont de browser kortstondig
     -apple-system tot Inter binnen is (font-display: swap). Visueel verschil
     is minimaal omdat Inter is ontworpen om op SF Pro te lijken. */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

.screen {
  height: 100vh;
}

.hidden {
  display: none !important;
}

/* ==================== LOGIN SCREEN ==================== */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-gray-100);
}

.login-box {
  background: var(--bg-white);
  padding: 48px 40px;
  border-radius: 12px;
  text-align: center;
  min-width: 420px;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-box .logo {
  margin-bottom: 24px;
}

.login-box .logo img {
  height: 48px;
}

.login-box h1 {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 28px;
  font-weight: 600;
}

.login-box .subtitle {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 14px;
}

.login-box .form-group {
  text-align: left;
  margin-bottom: 20px;
}

.login-box label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.login-box input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-white);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(28, 107, 186, 0.1);
}

.login-box input::placeholder {
  color: var(--text-muted);
}

.login-box button[type="submit"] {
  width: 100%;
  padding: 14px;
  background: #25D366;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-box button[type="submit"]:hover {
  background: #128C7E;
}

.login-box button[type="submit"]:active {
  transform: scale(0.98);
}

.login-box .security-note {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.login-box .security-note .shield {
  font-size: 14px;
}

/* Login Tabs */
.login-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: #f5f5f5;
  padding: 4px;
  border-radius: 8px;
}

.login-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.login-tab:hover {
  color: var(--text-primary);
}

.login-tab.active {
  background: white;
  color: var(--primary-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.login-tab-content {
  display: none;
}

.login-tab-content.active {
  display: block;
}

.error {
  color: #ef4444;
  margin-top: 12px;
  font-size: 14px;
}

.success {
  color: #10b981;
  margin-top: 12px;
  font-size: 14px;
}

/* ==================== APP LAYOUT ==================== */
#app-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.app-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ==================== ICON SIDEBAR ==================== */
.icon-sidebar {
  width: 64px;
  background: #f0f2f5;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 0;
}

/* ============================================================
   DESKTOP SIDEBAR (VWA Design System — Inter, 240px breed)
   Vervangt de .icon-sidebar boven 768px. Onder die breedte
   blijft .icon-sidebar als floating bottom-nav zichtbaar.
   ============================================================ */
.desktop-sidebar {
  /* Standaard verborgen — wordt zichtbaar in de media-query onderaan dit blok. */
  display: none;
}
@media (min-width: 769px) {
  /* Verberg de bestaande icon-sidebar op desktop, zodat alleen de nieuwe
     VWA-stijl sidebar zichtbaar is. Mobile-rules (max-width: 768px) blijven
     volledig intact. */
  .icon-sidebar {
    display: none;
  }
  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    width: 240px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    padding: 24px 16px;
    overflow-y: auto;
    /* Voorkom horizontale scrollbar onderin (lange item-namen / icons die
       net iets te breed worden door padding+gap). */
    overflow-x: hidden;
    min-width: 0;
    /* Vult 100% van de parent .app-layout (die zelf onder de topbar zit).
       Niet 100vh — dat zou de topbar overlappen. */
    height: 100%;
    /* Inter is al via body geërfd; expliciet voor zekerheid */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  }

  /* Brand-header */
  .desktop-sidebar .ds-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
    margin-bottom: 24px;
  }
  .desktop-sidebar .ds-brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb, #9333ea);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
  }
  .desktop-sidebar .ds-brand-meta { line-height: 1.2; }
  .desktop-sidebar .ds-brand-title {
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
  }
  .desktop-sidebar .ds-brand-sub {
    font-size: 10px;
    color: #64748b;
    margin: 2px 0 0;
  }

  /* Sectie-label (BEHEER / ANALYSE / TOOLS) */
  .desktop-sidebar .ds-section-label {
    padding: 0 12px;
    margin: 16px 0 4px;
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .desktop-sidebar .ds-section-label:first-of-type {
    margin-top: 0;
  }

  /* Nav-lijst */
  .desktop-sidebar .ds-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
  }

  /* Nav-item */
  .desktop-sidebar .ds-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: #475569;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    transition: background 0.12s, color 0.12s;
    width: 100%;
  }
  .desktop-sidebar .ds-nav-item:hover {
    background: #f1f5f9;
    color: #0f172a;
  }
  .desktop-sidebar .ds-nav-item.active {
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
  }

  /* Lucide icons */
  .desktop-sidebar .ds-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: currentColor;
  }
  .desktop-sidebar .ds-label {
    flex: 1;
    min-width: 0;
  }

  /* Badge (chats-aantal, etc.) */
  .desktop-sidebar .ds-badge {
    background: #f1f5f9;
    color: #475569;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
  }
  .desktop-sidebar .ds-nav-item.active .ds-badge {
    background: #dbeafe;
    color: #1d4ed8;
  }

  /* Footer */
  .desktop-sidebar .ds-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .desktop-sidebar .ds-footer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: #64748b;
    transition: background 0.12s, color 0.12s;
  }
  .desktop-sidebar .ds-footer-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
  }
  .desktop-sidebar .ds-version {
    margin-left: auto;
    font-size: 10px;
    color: #94a3b8;
    letter-spacing: 0.02em;
  }

  /* Notification bell extra accent */
  .desktop-sidebar #notification-bell-desktop:not(.hidden) {
    color: #f59e0b;
  }
}
/* === einde desktop-sidebar === */

/* ============================================================
   KENNISBANK V2 PANEL (VWA Design System)
   Vervangt op desktop de bestaande .wiki-panel wanneer
   localStorage.kbv2_disabled !== '1'. Op mobile blijft de
   klassieke wiki-panel actief.
   ============================================================ */
.kbv2-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f8fafc; /* slate-50 */
  min-width: 0;
  overflow: hidden;
}
.kbv2-panel.hidden {
  display: none;
}
.kbv2-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 40px;
  /* Inter expliciet zodat lettertype overal in v2 consistent is */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.kbv2-inner {
  /* Volle breedte zoals dashboard.vwa.nu — geen centrale kolom.
     Voorkomt alleen dat content op extreem brede schermen oneindig
     uitrekt. */
  max-width: 1600px;
  margin: 0;
  width: 100%;
}
@media (min-width: 1280px) {
  .kbv2-scroll { padding: 28px 40px 48px; }
}
@media (max-width: 1024px) {
  .kbv2-scroll { padding: 20px 24px; }
}
@media (max-width: 768px) {
  /* Kbv2 (Kennisbank + Auto-antwoorden) is nu óók op mobiel actief — zelfde
     pagina als desktop. Geen display:none meer; .hidden regelt zichtbaarheid. */
  /* Extra ruimte onderaan voor de floating bottom-nav (anders verdwijnen
     de laatste knoppen/inhoud erachter). */
  .kbv2-scroll { padding: 16px 16px 120px; }
  .kbv2-inner { max-width: 100%; }
  /* Kanaalswitcher (Ordergo/VWA) staat normaal in de topbar, maar die is op
     mobiel verborgen — toon de interne kbv2-switcher, gestyled IDENTIEK aan de
     segmented pill boven de Chats-lijst (.channel-tabs) voor consistentie. */
  #kbv2-channel-switch {
    display: flex !important;
    width: 100%;
    gap: 4px;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 9999px !important;
    padding: 4px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  }
  #kbv2-channel-switch .kbv2-ch {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    background: transparent !important;
    color: var(--text-secondary) !important;
  }
  /* Paginatitel exact als Chats .sidebar-header-top h2 (22px) i.p.v. 24px */
  #kennisbank-v2-panel .kbv2-inner header h1,
  #auto-reply-panel .kbv2-inner header h1 {
    font-size: 22px !important;
  }
  #kbv2-channel-switch .kbv2-ch .whatsapp-icon { flex-shrink: 0; }
  #kbv2-channel-switch .kbv2-ch.bg-slate-900 { /* actief (JS zet bg-slate-900) */
    background: var(--bg-white) !important;
    color: var(--primary) !important;
    box-shadow: var(--shadow-sm) !important;
  }
}
/* === einde kennisbank-v2 panel === */

/* ============================================================
   APP TOPBAR (VWA Design System — global desktop header)
   Verschijnt boven .app-layout op desktop (>=769px). Op mobile
   verborgen — bestaande mobile chat-headers blijven leidend.
   ============================================================ */
.app-topbar {
  /* Standaard verborgen — wordt zichtbaar op desktop hieronder. */
  display: none;
}
@media (min-width: 769px) {
  .app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    flex-shrink: 0;
    padding: 0 24px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 50;
  }
  .app-topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .app-topbar-logo {
    height: 24px;
    width: auto;
  }
  .app-topbar-divider {
    width: 1px;
    height: 24px;
    background: #e2e8f0;
  }
  .app-topbar-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.01em;
  }
  .app-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  /* Globale kanaal-switcher midden in de topbar */
  .app-topbar-channel {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: #f1f5f9;
    border-radius: 999px;
  }
  .app-topbar-channel.hidden { display: none !important; }
  .topbar-ch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 0;
    background: transparent;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, box-shadow 0.12s;
    font-family: inherit;
  }
  .topbar-ch:hover { color: #0f172a; }
  .topbar-ch.active {
    background: #0f172a;
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
  }
  .topbar-ch-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
  }
  .app-topbar-bell {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
  }
  .app-topbar-bell:hover { background: #f1f5f9; color: #0f172a; }
  .app-topbar-bell.bell-enabled { color: #2563eb; }
  /* Globale Handleiding-knop links van het belletje (opent guide van actieve view) */
  .app-topbar-help {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
  }
  .app-topbar-help:hover { background: #eff6ff; color: #2563eb; }
  .app-topbar-help.hidden { display: none !important; }
  .app-topbar-bell-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
  }
  .app-topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
  }
  .app-topbar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #9333ea);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
  }
  .app-topbar-user-meta { line-height: 1.2; min-width: 0; }
  .app-topbar-user-name {
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
  }
  .app-topbar-user-email {
    font-size: 10px;
    color: #64748b;
    margin: 1px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
  }
  .app-topbar-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    color: #475569;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.12s;
  }
  .app-topbar-logout:hover { border-color: #cbd5e1; color: #0f172a; background: #f8fafc; }

  /* Login-screen heeft geen topbar nodig (gebruiker niet ingelogd).
     We gebruiken :has() — als login-screen NIET hidden is, verberg topbar.
     LET OP: selector mag NIET puur structureel zijn (anders altijd hidden). */
  body:has(#login-screen:not(.hidden)) .app-topbar { display: none; }
}
/* === einde app topbar === */

/* ============================================================
   KENNISBANK V2 — Tab-pill (VWA TabPill stijl)
   Inactive: alleen icoon (compact). Active: icoon + label,
   bg-slate-900 wit. forceLabel-tabs (Beheer): altijd icoon + label.
   ============================================================ */
.kbv2-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: none;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  color: #64748b;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s, padding 0.12s;
}
.kbv2-tab:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.kbv2-tab .kbv2-tab-label {
  display: none;
}
.kbv2-tab.kbv2-tab-force-label {
  padding: 6px 14px;
}
.kbv2-tab.kbv2-tab-force-label .kbv2-tab-label,
.kbv2-tab.kbv2-tab-active .kbv2-tab-label {
  display: inline;
}
.kbv2-tab.kbv2-tab-active {
  background: #0f172a;
  color: #ffffff;
  padding: 6px 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.kbv2-tab.kbv2-tab-active:hover {
  background: #1e293b;
  color: #ffffff;
}
/* Generieke pagina-tabbar (Instellingen-stijl) — herbruikbaar op
   Gebruikers/Weekoverzicht/etc. Zelfde witte segmented pill-bar. */
.page-tabbar {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 9999px;
  padding: 4px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  margin: 0 0 16px;
}

/* Gebruikers-pagina: header-band (settings-panel-header) + grijze body, exact
   als Instellingen. De band staat boven .users-page; geen dubbele top-padding. */
.users-panel { background: #f8fafc !important; }
.users-panel .users-page { padding-top: 18px; }
.users-panel #users-tabbar.page-tabbar { margin: 0 0 16px; }
/* Visuele divider tussen content-tabs en admin-tab */
.kbv2-tab-divider {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: #e2e8f0;
  margin: 0 4px 0 auto;
  flex-shrink: 0;
}
/* Channel switcher pill (secundair, klein) */
#kbv2-channel-switch .kbv2-ch {
  border: none;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
/* === einde kennisbank-v2 tabs === */

/* ============================================================
   VWA HUISSTIJL POLISH (desktop only)
   Past de bestaande view-panels visueel aan op het VWA Design
   System: slate-50 pagina-achtergrond, witte kaarten met
   slate-200 borders, Inter-typografie, blauwe primary-buttons.
   Layout-structuur blijft ongemoeid; alleen visuele tokens.
   ============================================================ */
@media (min-width: 769px) {
  /* --- Settings panel --- */
  .settings-panel {
    background: #f8fafc !important;
  }
  .settings-panel-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 20px 32px !important;
  }
  .settings-panel-header h2 {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.01em !important;
  }
  .settings-panel-subtitle {
    color: #64748b !important;
    font-size: 13px !important;
    margin-top: 2px !important;
  }
  .settings-panel-body {
    background: #f8fafc !important;
  }
  .settings-categories {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
    padding: 16px !important;
  }
  .settings-cat-title {
    font-size: 10px !important;
    font-weight: 600 !important;
    color: #94a3b8 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    margin: 4px 0 6px 12px !important;
  }
  .settings-cat-btn {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    border: none !important;
    background: transparent !important;
    color: #475569 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    width: 100% !important;
    text-align: left !important;
    cursor: pointer !important;
    transition: background 0.12s, color 0.12s !important;
  }
  .settings-cat-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
  }
  .settings-cat-btn.active {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    font-weight: 600 !important;
  }
  .settings-cat-btn svg {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
  }
  .settings-content {
    padding: 28px 32px !important;
    background: #f8fafc !important;
  }
  .settings-section-h {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin-bottom: 16px !important;
    letter-spacing: -0.01em !important;
  }
  /* Channel-tabs binnen settings → VWA segmented pill */
  .settings-panel .settings-channel-tabs {
    display: inline-flex !important;
    align-items: center !important;
    gap: 2px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 999px !important;
    padding: 3px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
  }
  .settings-panel .automation-channel-tab,
  .settings-panel .autoreply-channel-tab {
    padding: 5px 14px !important;
    border-radius: 999px !important;
    border: none !important;
    background: transparent !important;
    color: #64748b !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.12s, color 0.12s !important;
  }
  .settings-panel .automation-channel-tab:hover,
  .settings-panel .autoreply-channel-tab:hover {
    color: #0f172a !important;
  }
  .settings-panel .automation-channel-tab.active,
  .settings-panel .autoreply-channel-tab.active {
    background: #0f172a !important;
    color: #ffffff !important;
  }

  /* --- Summary (Weekoverzicht) panel --- */
  .summary-panel {
    background: #f8fafc !important;
  }
  .summary-sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
  }
  .summary-sidebar-header h2 {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.01em !important;
  }
  .summary-content {
    background: #f8fafc !important;
    padding: 28px 32px !important;
  }
  .summary-empty-state h3 {
    color: #0f172a !important;
    font-weight: 700 !important;
  }
  .summary-empty-state p {
    color: #64748b !important;
  }
  .summary-result-header h3 {
    color: #0f172a !important;
    font-weight: 700 !important;
  }
  .summary-btn-primary {
    background: #2563eb !important;
    border-color: #2563eb !important;
  }
  .summary-btn-primary:hover {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
  }

  /* --- Auto-Reply panel --- */
  .ar-panel {
    background: #f8fafc !important;
  }
  .ar-panel-sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
  }
  .ar-sidebar-header h2 {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.01em !important;
  }

  /* --- Kennisbank cards (gedeeld) — kleine polish --- */
  .kb-card {
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
    padding: 18px 22px !important;
  }
  .kb-card h3 {
    color: #0f172a !important;
    font-weight: 600 !important;
    font-size: 15px !important;
  }
  .kb-muted {
    color: #64748b !important;
    font-size: 13px !important;
    line-height: 1.55 !important;
  }

  /* --- Global button polish (primaire intent) --- */
  .btn-primary,
  button.btn-primary {
    background: #2563eb !important;
    border-color: #2563eb !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
  }
  .btn-primary:hover,
  button.btn-primary:hover {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
  }

  /* --- Login screen (alleen kleine touch zodat het ook bij VWA past) --- */
  .login-box {
    border-radius: 16px !important;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06) !important;
  }
}
/* === einde VWA huisstijl polish === */

/* ============================================================
   VRAAG STELLEN — Response-type badges (3 staten)
   - is-answer:   sluitend antwoord met bronnen   (geen badge, witte kaart)
   - is-question: bot vraagt door                  (paarse badge + paarse tint)
   - is-no-answer: geen match in Kennisbank        (amber badge + amber tint)
   ============================================================ */

/* Alle AI-bubbles krijgen een lichte border + kaart-achtige uitstraling */
.wiki-sim-bubble.ai {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  max-width: 720px;
}

/* Top-badge container (gedeelde stijl) */
.wiki-sim-response-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  border: 1px solid transparent;
}
.wiki-sim-response-badge svg {
  flex-shrink: 0;
}

/* Verhelderingsvraag — paars */
.wiki-sim-response-badge.is-question {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.10), rgba(139, 92, 246, 0.08));
  border-color: rgba(168, 85, 247, 0.25);
  color: #7c3aed;
}
.wiki-sim-bubble.ai.is-question {
  background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
  border-color: rgba(168, 85, 247, 0.20);
}

/* Geen match in Kennisbank — amber/oranje */
.wiki-sim-response-badge.is-no-answer {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.10), rgba(217, 119, 6, 0.08));
  border-color: rgba(245, 158, 11, 0.30);
  color: #b45309;
}
.wiki-sim-bubble.ai.is-no-answer {
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
  border-color: rgba(245, 158, 11, 0.20);
}
/* === einde response-type badges === */

/* ============================================================
   VRAAG STELLEN — Antwoord polish v3
   - Inline cite als superscript-chip (Perplexity stijl)
   - Action-row (Kopieer + Stuur naar klant)
   - Confidence badge
   - Source-count badge (×N) bij gedupliceerde bronnen
   ============================================================ */

/* Inline citatie-chip — superscript-stijl, klikbaar */
.wiki-sim-cite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin: 0 2px;
  padding: 0 5px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  vertical-align: super;
  line-height: 1;
  transition: background 0.12s, color 0.12s, transform 0.12s;
}
.wiki-sim-cite:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  transform: translateY(-1px);
}

/* Paginalabel (p.N) op een PDF-bron-tag */
.wiki-sim-source-page {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  background: #eff6ff;
  color: #2563eb;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Source-count badge (×N) wanneer een bron meerdere keren is geciteerd */
.wiki-sim-source-count {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  background: #f1f5f9;
  color: #475569;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Confidence-indicator */
.wiki-sim-confidence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}
.wiki-sim-confidence-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

/* Action-row (Kopieer + Stuur naar klant) */
.wiki-sim-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
}
.wiki-sim-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 8px;
  color: #475569;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}
.wiki-sim-action-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
}
.wiki-sim-action-btn.is-success {
  background: #dcfce7;
  border-color: #86efac;
  color: #16a34a;
}
.wiki-sim-action-btn.wiki-sim-action-send {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}
.wiki-sim-action-btn.wiki-sim-action-send:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

/* Zorg dat .wiki-sim-bubble.ai z'n witte kaart-omlijning HEEFT, ongeacht
   eerdere CSS-overrides. Specifieker dan de basis-regels. */
.wiki-sim-chat .wiki-sim-bubble.ai {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  max-width: 760px;
}
/* === einde antwoord polish v3 === */

/* ============================================================
   STUUR NAAR KLANT — modal
   ============================================================ */
.vraag-send-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vraag-send-modal.hidden { display: none; }
.vraag-send-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.40);
  backdrop-filter: blur(2px);
}
.vraag-send-dialog {
  position: relative;
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.20);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', -apple-system, sans-serif;
}
.vraag-send-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #f1f5f9;
}
.vraag-send-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}
.vraag-send-close-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.vraag-send-close-btn:hover { background: #f1f5f9; color: #0f172a; }
.vraag-send-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 14px 0;
  border-bottom: 1px solid #f1f5f9;
}
.vraag-send-tab {
  background: transparent;
  border: 0;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}
.vraag-send-tab:hover { color: #0f172a; }
.vraag-send-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}
.vraag-send-tab-content.hidden { display: none; }
.vraag-send-mode-help {
  font-size: 12px;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 12px;
  margin: 0 0 4px;
  line-height: 1.5;
}
.vraag-send-mode-help strong { color: #0f172a; }
.vraag-send-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: white;
  color: #0f172a;
  box-sizing: border-box;
}
.vraag-send-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.vraag-send-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.vraag-send-section { display: flex; flex-direction: column; gap: 8px; }
.vraag-send-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.vraag-send-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
}
.vraag-send-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: #0f172a;
  font-family: inherit;
}
.vraag-send-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  padding: 4px;
}
.vraag-send-loading {
  padding: 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}
.vraag-send-conv {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.12s;
}
.vraag-send-conv:hover { background: #f8fafc; }
.vraag-send-conv.is-selected { background: #eff6ff; border: 1px solid #bfdbfe; }
.vraag-send-conv-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #9333ea);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.vraag-send-conv-body { flex: 1; min-width: 0; }
.vraag-send-conv-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}
.vraag-send-conv-channel {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.vraag-send-conv-channel.is-ordergo { background: #dcfce7; color: #16a34a; }
.vraag-send-conv-channel.is-vwa { background: #dbeafe; color: #2563eb; }
.vraag-send-conv-preview {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vraag-send-conv-time {
  font-size: 10px;
  color: #cbd5e1;
  flex-shrink: 0;
  margin-left: 8px;
}
.vraag-send-preview-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.vraag-send-clean-opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #64748b;
  cursor: pointer;
}
.vraag-send-clean-opt input { accent-color: #2563eb; }
.vraag-send-text {
  width: 100%;
  min-height: 110px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: #0f172a;
  resize: vertical;
  outline: none;
}
.vraag-send-text:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.10); }
.vraag-send-info {
  font-size: 11px;
  color: #94a3b8;
  margin: 0;
}
.vraag-send-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
}
.vraag-send-cancel {
  padding: 8px 14px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 8px;
  color: #475569;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.vraag-send-cancel:hover { background: #f1f5f9; color: #0f172a; }
.vraag-send-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  background: #2563eb;
  color: #ffffff;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.vraag-send-go:hover:not(:disabled) { background: #1d4ed8; }
.vraag-send-go:disabled { opacity: 0.5; cursor: not-allowed; }
.vraag-send-go.is-sending { background: #16a34a; }
/* === einde stuur-naar-klant modal === */

/* ============================================================
   MOBILE GUARD — verbergen desktop-only Vraag-stellen componenten
   op mobiel zodat de bestaande mobile-ask-panel UX onaangetast blijft.
   ============================================================ */
@media (max-width: 768px) {
  /* Vraag stellen — desktop-only componenten weg op mobiel */
  .vraag-tabbar-row,
  .vraag-faq-panel,
  .vraag-mijn-panel,
  .vraag-settings-panel,
  .vraag-tiles-row {
    display: none !important;
  }
  /* wiki-panel-sidebar in ask-mode: GEEN floating-card op mobiel */
  .wiki-panel.ask-mode .wiki-panel-sidebar {
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    border-right: 1px solid #e2e8f0 !important;
    max-height: none !important;
  }
  .wiki-panel.ask-mode {
    background: var(--bg-white) !important;
    padding: 0 !important;
  }
  /* Stuur-naar-klant modal: full-screen op mobiel */
  .vraag-send-dialog {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
  }
  /* App-topbar al hidden via :hover en de container — extra zekerheid: */
  .app-topbar { display: none !important; }
}

/* ============================================================
   Chat-bubble wrappers + tijdstempels
   Tijd verschijnt KLEIN en SUBTIEL onder elke bubble.
   User-bubbles tijd rechts uitgelijnd, AI links.
   ============================================================ */
.wiki-sim-bubble-wrap {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
  max-width: 100%;
}
.wiki-sim-bubble-wrap.user {
  align-items: flex-end;
}
.wiki-sim-bubble-wrap.ai {
  align-items: flex-start;
}
.wiki-sim-time {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
  padding: 0 8px;
  letter-spacing: 0.01em;
  user-select: none;
}
.wiki-sim-bubble-wrap.user .wiki-sim-time {
  text-align: right;
}
/* === einde chat-tijdstempels === */

/* ============================================================
   VRAAG STELLEN — Sidebar Zonneplan-style restyle
   1. Kanaal-wissel als segmented tabs (witte container, shadow op active)
   2. Filter-pills als compacte chips (donker active, neutraal inactive)
   3. Vraag-kaarten met chevron, hover-lift, blauwe active-rand
   4. FAQ-cluster items als kaarten met grijze achtergrond
   ============================================================ */

/* 1. Kanaal-wissel container (segmented Zonneplan-tabs) */
.ka-ask-channel-wrap {
  display: flex;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  margin-top: 10px;
}
/* mobile-only-channel: alleen tonen op mobile (≤768px) want topbar is daar verborgen.
   Desktop heeft al de globale topbar-switcher → duplicaat voorkomen. */
@media (min-width: 769px) {
  .ka-ask-channel-wrap.mobile-only-channel { display: none !important; }
}
.ka-ask-ch-btn {
  flex: 1;
  padding: 8px 14px;
  border: none;
  background: transparent;
  border-radius: 999px;
  color: #64748b;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.ka-ask-ch-btn:hover {
  color: #0f172a;
}
.ka-ask-ch-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10), 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* 2. Filter-chips (Alles / Open / Geverifieerd / Archief / 🗑) */
.ka-ask-filter-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}
.ka-ask-filter-btn {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ka-ask-filter-btn:hover {
  border-color: #cbd5e1;
  color: #0f172a;
}
.ka-ask-filter-btn.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

/* 3. Vraag-kaarten (Mijn eerdere vragen) */
.ka-ask-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin: 6px 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.15s, transform 0.12s;
  position: relative;
}
.ka-ask-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.ka-ask-item.is-active,
.ka-ask-item[data-active="1"] {
  border-color: #2563eb;
  background: #eff6ff;
}
.ka-ask-item.is-trashed {
  opacity: 0.78;
}
.ka-ask-item .ka-ask-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.ka-ask-item .ka-ask-item-body {
  flex: 1;
  min-width: 0;
}
.ka-ask-item .ka-ask-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  line-height: 1.35;
}
.ka-ask-item .ka-ask-item-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 3px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.ka-ask-item .ka-ask-item-chevron {
  flex-shrink: 0;
  color: #cbd5e1;
  margin-top: 4px;
  transition: color 0.15s, transform 0.15s;
}
.ka-ask-item:hover .ka-ask-item-chevron {
  color: #64748b;
  transform: translateX(2px);
}
.ka-ask-item.is-active .ka-ask-item-chevron {
  color: #2563eb;
}
.ka-ask-item .ka-ask-trash-badge {
  font-size: 11px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 4. FAQ-cluster items */
.ka-ask-faq-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  margin: 4px 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.ka-ask-faq-item:hover {
  background: #f1f5f9;
}
.ka-ask-faq-rank {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  margin-top: 1px;
}
.ka-ask-faq-rank.is-ordergo {
  background: #dcfce7;
  color: #16a34a;
}
.ka-ask-faq-rank.is-vwa {
  background: #dbeafe;
  color: #2563eb;
}
.ka-ask-faq-text {
  flex: 1;
  min-width: 0;
}
.ka-ask-faq-question {
  font-size: 12.5px;
  color: #111827;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-weight: 500;
}
.ka-ask-faq-meta {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 3px;
  font-weight: 500;
}

/* === einde vraag-stellen sidebar restyle === */

/* ============================================================
   VRAAG STELLEN — Tab-bar (VWA Dashboards stijl)
   Rounded-full pill container met border + shadow.
   Active = zwarte pill met label. Inactive op de linkergroep =
   icon-only. Rechtergroep (na spacer) = altijd label (forceLabel).
   ============================================================ */
/* Base layout — gets overridden in ask-mode by .vraag-tabbar-row being een pill zelf */
.vraag-tabbar-row {
  flex-shrink: 0;
}
.vraag-tabbar {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  width: 100%;
}
.vraag-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 999px;
  color: #64748b;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.vraag-tab:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.vraag-tab .vraag-tab-label {
  display: inline;
}
.vraag-tab.vraag-tab-active {
  background: #0f172a;
  color: #ffffff;
  font-weight: 600;
  padding: 6px 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.vraag-tab.vraag-tab-active:hover {
  background: #1e293b;
  color: #ffffff;
}
.vraag-tab svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
/* Visuele divider tussen kanaal- en view-tabs */
.vraag-tab-divider {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: #e2e8f0;
  margin: 0 6px;
  flex-shrink: 0;
}
/* Spacer duwt rechterkant-tabs (Instellingen) naar rechts */
.vraag-tab-spacer {
  flex: 1;
  min-width: 12px;
}
/* Icon-only tab — verbergt het label, alleen icoon */
.vraag-tab.vraag-tab-icon-only {
  padding: 6px 8px;
}
.vraag-tab.vraag-tab-icon-only .vraag-tab-label {
  display: none;
}
.vraag-tabbar {
  display: flex;
  width: 100%;
}

/* ============================================================
   VRAAG STELLEN — Tiles strip (VWA Dashboards stijl)
   4 tegels boven de tabbar met live data.
   ============================================================ */
.vraag-tiles-row {
  padding: 18px 20px 0;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  overflow-x: hidden;
}
.vraag-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 18px;
  width: 100%;
}
.vraag-tile {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.vraag-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  min-height: 38px;
}
.vraag-tile-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vraag-tile-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.vraag-tile-badge-actief {
  background: #dcfce7;
  color: #16a34a;
}
.vraag-tile-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16a34a;
}
.vraag-tile-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 2px;
}
.vraag-tile-value {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.vraag-tile-value.vraag-tile-value-sm {
  font-size: 14px;
  font-weight: 600;
}
.vraag-tile-sub {
  font-size: 11px;
  color: #64748b;
  margin: 4px 0 0;
}
@media (max-width: 1100px) {
  .vraag-tiles { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   VRAAG STELLEN — Mijn vragen panel
   Vervangt de oude secondary sidebar. Volle breedte content.
   ============================================================ */
.vraag-mijn-panel {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  background: #f8fafc;
}
.vraag-mijn-panel.hidden { display: none; }
.vraag-mijn-header {
  max-width: 920px;
  margin: 0 auto 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.vraag-mijn-h {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}
.vraag-mijn-sub {
  font-size: 13px;
  color: #64748b;
  margin: 4px 0 0;
}
.vraag-mijn-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  min-width: 280px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.vraag-mijn-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
  background: transparent;
  color: #0f172a;
  font-family: inherit;
}
.vraag-mijn-filters {
  max-width: 920px;
  margin: 0 auto 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.vraag-mijn-list {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vraag-mijn-loading {
  padding: 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

/* Vraag-sidebar is in ask-mode juist ZICHTBAAR (Chats-stijl kolom).
   Geen hide-regel meer — was eerder experiment. */

/* ============================================================
   VRAAG STELLEN — Vraag-sidebar (Chats-stijl, kolom 2)
   In ask-mode: zwevend als losse kaart met margin + radius + shadow.
   ============================================================ */
.wiki-panel-sidebar {
  background: #ffffff;
  display: flex;
  flex-direction: column;
}
/* In ask-mode (Vraag stellen): sidebar is transparent — geen witte kaart-wrapper
   meer, de vraag-cards staan direct op de grijze achtergrond. */
@media (min-width: 769px) {
  .wiki-panel.ask-mode .wiki-panel-sidebar {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    max-height: none;
    overflow: hidden;
    border-right: none !important;
  }
  .wiki-panel.ask-mode {
    background: #f8fafc !important;
    padding: 0;
  }
  /* Verberg de wiki-sim-panel-header in ask-mode — de titel staat al in de topbar,
     en de Auto-chip + Nieuwe vraag-knop worden via JS verplaatst naar de tabbar-row. */
  .wiki-panel.ask-mode .wiki-sim-panel-header {
    display: none;
  }
  /* Tabbar-row krijgt zelfde top-margin als sidebar (14px) zodat ze horizontaal
     uitlijnen met de top van de Vraag-sidebar-kaart. Plus 14px links voor
     ademruimte. */
  .wiki-panel.ask-mode .vraag-tabbar-row {
    margin: 14px 14px 0 14px !important;
  }
  /* === Chat-paneel rechts: doorlopende slate-grijs achtergrond ===
     BRUTAL FORCE: alle witte achtergronden binnen ask-mode worden hard naar
     transparent gezet. Alleen de bubbles + sidebar-kaart + input-textarea
     houden hun eigen kleur. */
  .wiki-panel.ask-mode #wiki-sim-panel,
  .wiki-panel.ask-mode #wiki-sim-panel > *,
  .wiki-panel.ask-mode #wiki-sim-chat,
  .wiki-panel.ask-mode .wiki-sim-chat,
  .wiki-panel.ask-mode .wiki-sim-input-area,
  .wiki-panel.ask-mode .wiki-sim-empty,
  .wiki-panel.ask-mode .wiki-sim-input-stack,
  .wiki-panel.ask-mode .wiki-sim-attach-wrap,
  .wiki-panel.ask-mode .vraag-faq-panel,
  .wiki-panel.ask-mode .vraag-mijn-panel,
  .wiki-panel.ask-mode .vraag-settings-panel {
    background: transparent !important;
    background-color: transparent !important;
  }
  .wiki-panel.ask-mode #wiki-sim-panel {
    padding: 0 !important;
    box-sizing: border-box;
  }
  .wiki-panel.ask-mode #wiki-sim-chat,
  .wiki-panel.ask-mode .wiki-sim-chat {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 auto;
    padding: 8px 24px 12px !important;
    max-width: none;
    width: 100%;
  }
  .wiki-panel.ask-mode .wiki-sim-input-area {
    border: none !important;
    border-top: 1px solid rgba(203, 213, 225, 0.5) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0;
    padding: 12px 24px 14px;
    max-width: none;
  }
}

/* Tabbar-row = ÉÉN rounded-pill container (VWA Dashboards stijl), VOLLE BREEDTE.
   Bevat: links de tabs (Chat/FAQ/Instellingen), divider, rechts de actions
   (Auto-chip + Nieuwe vraag). Alles in dezelfde witte pill met border. */
.vraag-tabbar-row {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 4px 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  width: auto;
  align-self: stretch;
}
/* De inner .vraag-tabbar verliest zijn eigen container — wordt onderdeel van outer pill.
   Flex:1 zodat de inner het volledige rij vult, en de inner-spacer kan dan
   Brein + ⚙ Instellingen daadwerkelijk naar rechts duwen. */
.vraag-tabbar-row .vraag-tabbar {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  width: auto;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
/* Auto-model-chip krijgt dezelfde tab-stijl als zustertabs */
.vraag-tabbar-row .wiki-sim-model-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: 999px;
  color: #64748b;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
  height: auto;
  margin: 0;
}
.vraag-tabbar-row .wiki-sim-model-chip:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.vraag-tabbar-row .wiki-sim-model-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
}
.vraag-tabbar-row .wiki-sim-model-caret {
  width: 12px;
  height: 12px;
  opacity: 0.6;
}
/* Nieuwe vraag-knop krijgt dezelfde tab-stijl */
.vraag-tabbar-row .wiki-sim-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: 999px;
  color: #64748b;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
  margin: 0;
}
.vraag-tabbar-row .wiki-sim-clear-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.vraag-tabbar-row .wiki-sim-clear-btn svg {
  width: 14px;
  height: 14px;
}
/* Actions-container rechts — duwt naar rechts via margin-left:auto.
   Geen verticale divider (zoals VWA Dashboards) — alleen ruimte. */
.vraag-tabbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex-shrink: 0;
}
.vraag-side-header {
  padding: 18px 16px 14px;
  border-bottom: 1px solid #f1f5f9;
}
.vraag-side-titlerow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.vraag-side-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  letter-spacing: -0.01em;
}
.vraag-side-user {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}
.vraag-side-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 8px 14px;
  margin-top: 10px;
}
.vraag-side-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
  background: transparent;
  color: #0f172a;
  font-family: inherit;
}
.vraag-side-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.vraag-side-loading {
  padding: 24px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

/* Date-group headers (ChatGPT-stijl) */
.vraag-side-group-h {
  padding: 14px 18px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.vraag-side-group-body {
  padding: 0 8px;
}

/* Vraag-card geavanceerd: titel + preview + confidence-bar */
.ka-ask-item-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.ka-ask-item-title-row .ka-ask-item-title {
  flex: 1;
  -webkit-line-clamp: 2;
}
.ka-ask-item-time {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
}
.ka-ask-item-preview {
  font-size: 12px;
  color: #64748b;
  margin-top: 5px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ka-ask-item-confrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}
.ka-ask-item-confbar {
  flex: 1;
  height: 4px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}
.ka-ask-item-confbar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}
.ka-ask-item-conftxt {
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 28px;
  text-align: right;
}
.ka-ask-item.is-starred .ka-ask-item-title::before {
  content: '★ ';
  color: #f59e0b;
}
/* Chevron weghalen — niet meer nodig met de richere card-layout */
.ka-ask-item .ka-ask-item-chevron { display: none; }
/* === einde Vraag-sidebar Chats-stijl === */

/* ============================================================
   HOOFDSIDEBAR — Gemini-stijl inklap (collapse)
   Toggle linksboven. Ingeklapt: ~56px, icon-only met tooltips.
   ============================================================ */
.desktop-sidebar {
  transition: width 0.2s ease;
  position: relative;
}
.desktop-sidebar-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #94a3b8;
  z-index: 50;
  transition: background 0.12s, color 0.12s;
  opacity: 0;
}
.desktop-sidebar:hover .desktop-sidebar-toggle,
.desktop-sidebar.is-collapsed .desktop-sidebar-toggle {
  opacity: 1;
}
.desktop-sidebar-toggle:hover {
  background: #eef2f7;
  color: #2563eb;
}
/* Eigen tooltip RECHTS van de knop (zodat die niet over de icoon-kolom valt) */
.desktop-sidebar-toggle[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%;
  left: calc(100% + 10px);
  right: auto;
  transform: translateY(-50%);
  background: #0f172a;
  color: #ffffff;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  z-index: 200;
}
.desktop-sidebar-toggle svg {
  transition: transform 0.2s ease;
}

/* Ingeklapte staat */
@media (min-width: 769px) {
  .desktop-sidebar.is-collapsed {
    width: 56px !important;
    /* Extra bovenruimte: de gecentreerde "»"-toggle (top:10px, ~28px hoog) zou
       anders de eerste (actieve) icoon-pill overlappen. */
    padding: 46px 8px 24px;
  }
  .desktop-sidebar.is-collapsed .ds-section-label,
  .desktop-sidebar.is-collapsed .ds-label,
  .desktop-sidebar.is-collapsed .ds-badge,
  .desktop-sidebar.is-collapsed .ds-version {
    display: none;
  }
  .desktop-sidebar.is-collapsed .ds-nav-item {
    justify-content: center;
    padding: 9px 0;
    position: relative;
  }
  .desktop-sidebar.is-collapsed .ds-nav-item .ds-icon {
    margin: 0;
  }
  .desktop-sidebar.is-collapsed .ds-nav {
    margin-bottom: 4px;
  }
  .desktop-sidebar.is-collapsed .ds-footer {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding-top: 12px;
  }
  /* Tooltip op hover */
  .desktop-sidebar.is-collapsed .ds-nav-item:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #0f172a;
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 100;
  }
  .desktop-sidebar.is-collapsed .desktop-sidebar-toggle svg {
    transform: rotate(180deg);
  }
  /* In ingeklapte staat: toggle horizontaal centreren in de 56px balk */
  .desktop-sidebar.is-collapsed .desktop-sidebar-toggle {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
  /* Behoud centrering bij hover (geen scale-sprong meer). */
  .desktop-sidebar.is-collapsed .desktop-sidebar-toggle:hover {
    transform: translateX(-50%);
  }
}
/* === einde sidebar-collapse === */

/* ============================================================
   VRAAG STELLEN — Instellingen panel
   Bronnen + AI-modellen + gedrag, allemaal toggleable.
   ============================================================ */
.vraag-settings-panel {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  background: #f8fafc;
}
.vraag-settings-panel.hidden { display: none; }
.vraag-settings-inner {
  max-width: 920px;
  margin: 0 auto;
}
.vraag-settings-header { margin-bottom: 20px; }
.vraag-settings-h {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}
.vraag-settings-sub {
  font-size: 13px;
  color: #64748b;
  margin: 4px 0 0;
}
.vraag-settings-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.vraag-settings-card-h {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.vraag-settings-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.vraag-settings-card-h h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}
.vraag-settings-card-h p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}
.vraag-settings-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vraag-settings-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.vraag-settings-option:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.vraag-settings-option input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
  flex-shrink: 0;
}
.vraag-settings-option input[type="checkbox"]:checked + .vraag-settings-opt-body .vraag-settings-opt-title {
  color: #0f172a;
}
.vraag-settings-opt-body {
  flex: 1;
  min-width: 0;
}
.vraag-settings-opt-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.vraag-settings-opt-desc {
  font-size: 12px;
  color: #64748b;
  margin-top: 3px;
  line-height: 1.45;
}
.vraag-settings-tag {
  display: inline-block;
  padding: 1px 6px;
  background: #f1f5f9;
  color: #475569;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.vraag-settings-opt-count {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  flex-shrink: 0;
  margin-top: 2px;
}
.vraag-settings-option-segmented {
  cursor: default;
  flex-wrap: wrap;
  row-gap: 10px;
}
.vraag-settings-option-segmented:hover {
  background: transparent;
  border-color: #e2e8f0;
}
.vraag-settings-segmented {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}
.vraag-settings-seg-btn {
  background: transparent;
  border: 0;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
.vraag-settings-seg-btn:hover { color: #0f172a; }
.vraag-settings-seg-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.vraag-settings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  gap: 14px;
}
.vraag-settings-saved-info {
  font-size: 11px;
  color: #94a3b8;
}
.vraag-settings-save-btn {
  padding: 8px 16px;
  border: none;
  background: #2563eb;
  color: #fff;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.vraag-settings-save-btn:hover { background: #1d4ed8; }
.vraag-settings-save-btn.is-saved {
  background: #16a34a;
}

/* FAQ-paneel in chat-area (vervangt chat-content wanneer tab=faq) */
.vraag-faq-panel {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  background: #f8fafc;
}
.vraag-faq-panel.hidden { display: none; }
.vraag-faq-header {
  max-width: 920px;
  margin: 0 auto 18px;
}
.vraag-faq-h {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}
.vraag-faq-sub {
  font-size: 13px;
  color: #64748b;
  margin: 4px 0 0;
}
.vraag-faq-list {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vraag-faq-loading {
  padding: 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}
.vraag-faq-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.15s, transform 0.12s;
}
.vraag-faq-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.vraag-faq-card-rank {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  margin-top: 1px;
}
.vraag-faq-card-rank.is-ordergo { background: #dcfce7; color: #16a34a; }
.vraag-faq-card-rank.is-vwa { background: #dbeafe; color: #2563eb; }
.vraag-faq-card-body { flex: 1; min-width: 0; }
.vraag-faq-card-q {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.45;
}
.vraag-faq-card-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
  font-weight: 500;
}
.vraag-faq-card-chevron {
  flex-shrink: 0;
  color: #cbd5e1;
  margin-top: 8px;
  transition: color 0.15s, transform 0.15s;
}
.vraag-faq-card:hover .vraag-faq-card-chevron {
  color: #64748b;
  transform: translateX(2px);
}
/* === einde vraag-stellen tabs + FAQ-paneel === */

.icon-sidebar-top,
.icon-sidebar-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.sidebar-version {
  font-size: 10px;
  color: #9ca3af;
  letter-spacing: 0.02em;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.04);
  font-weight: 600;
  user-select: none;
  cursor: default;
  transition: background .15s, color .15s;
}
.sidebar-version:hover { color: #374151; background: rgba(0,0,0,0.08); }
@media (max-width: 768px) {
  .sidebar-version { display: none; }
}

.sidebar-icon {
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s;
  position: relative;
}

.sidebar-icon:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.sidebar-icon.active {
  background: rgba(37, 211, 102, 0.1);
  color: #25D366;
}

.sidebar-icon svg {
  width: 26px;
  height: 26px;
}

.sidebar-icon-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #25D366;
  color: white;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-icon-badge.hidden {
  display: none;
}

/* Sidebar Logo */
.sidebar-logo {
  width: 48px;
  height: 48px;
  background: #25D366;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 8px;
}

/* ==================== SIDEBAR HEADER ==================== */
.sidebar-header {
  padding: 0;
  border-bottom: none;
}

.sidebar-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px 12px 16px;
}

.sidebar-header-top h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.sidebar-header-top .user-name {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

/* Notification bell - header (mobile only, hidden on desktop) */
.notification-bell {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s;
  display: none; /* Desktop: always hidden, mobile override below */
  flex-shrink: 0;
}

.notification-bell.bell-disabled {
  color: #9ca3af;
  opacity: 0.7;
}

.notification-bell.bell-disabled:hover {
  opacity: 1;
  color: #6b7280;
}

.notification-bell.bell-enabled {
  color: #16a34a;
  opacity: 1;
}

/* Sidebar bell (desktop only) */
.notification-bell-sidebar.bell-disabled {
  color: #9ca3af !important;
  opacity: 0.7;
}

.notification-bell-sidebar.bell-disabled:hover {
  opacity: 1;
  color: #6b7280 !important;
}

.notification-bell-sidebar.bell-enabled {
  color: #16a34a !important;
  opacity: 1;
}

.notification-bell-sidebar.hidden {
  display: none !important;
}

/* Bell-off dot removed — grey icon is subtle enough */

/* Channel Tabs - Inside Sidebar */
.channel-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-gray-100);
  padding: 4px;
  border-radius: 8px;
  margin: 0 16px 12px 16px;
}

.channel-tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.channel-tab:hover {
  color: var(--text-primary);
}

.channel-tab.active {
  background: var(--bg-white);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Channel Tab Icons and Badges */
.channel-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

/* Generieke mobiele kanaal-pill (Vraag-stellen + Auto-antwoorden) — identiek
   aan de .channel-tabs boven de Chats-lijst. Eigen class zodat de Chats-handler
   (querySelectorAll('.channel-tab')) deze knoppen niet oppakt. */
.mch-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid #e2e8f0;   /* zichtbaar op elke achtergrond (ook grijze header) */
  border-radius: 9999px;       /* volledig rond, als Instellingen-pill */
  padding: 4px;
  width: 100%;                 /* placeholder-breedte: volle balk */
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.mch-tab {
  /* Exact als .channel-tab op mobiel: 12px, padding 6px 10px. Natuurlijke
     breedte, links uitgelijnd → rechts ruimte voor andere functies. */
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.mch-tab .whatsapp-icon { flex-shrink: 0; }
/* Generieke kanaal-dot (desktop-conventie): groen=Ordergo, blauw=VWA */
.mch-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
/* In-header pills (Kennisbank/Auto) tussen titel en beschrijving: wat lucht */
#kbv2-channel-switch, #ar-ch-pill { margin: 6px 0; }
/* Rechts in de balk: extra controls (bv. AI-model-chip bij Vraag stellen) */
.mch-pill .mobile-ask-model-chip { margin-left: auto; }
.mch-tab:hover { color: #0f172a; background: #f1f5f9; }
.mch-tab.active {
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15);
}
/* Auto-antwoorden: pill alleen op mobiel (desktop heeft topbar-switcher) */
.ar-ch-pill-mobile { display: none; }
@media (max-width: 768px) { .ar-ch-pill-mobile { display: flex; } }

.channel-tab .whatsapp-icon {
  flex-shrink: 0;
}

.channel-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #25D366;
  color: white;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 2px;
}

.channel-badge.hidden {
  display: none;
}

/* Header User & Logout */
.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user .user-name {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.logout-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.logout-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: 350px;
  background: var(--bg-white);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

/* Search Box */
.search-box {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.search-box input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-gray-50);
  font-size: 14px;
  color: var(--text-primary);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

/* Filter Tabs - WhatsApp style */
.filter-tabs {
  display: flex;
  padding: 8px 12px;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
}

.filter-tab {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--bg-white);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab:hover {
  background: var(--bg-gray-50);
}

.filter-tab.active {
  background: #e7f3e9;
  border-color: #25D366;
  color: #128C7E;
}

/* Legacy filters - hidden */
.filters {
  display: none;
}

.filter-btn {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-gray-100);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s;
}

.filter-btn:hover {
  background: var(--bg-gray-200);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--primary);
  color: white;
}

/* Conversation List */
.conversation-list {
  flex: 1;
  overflow-y: auto;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s;
}

.conversation-item:hover {
  background: var(--bg-gray-50);
}

.conversation-item.active {
  background: rgba(28, 107, 186, 0.08);
  border-left: 3px solid var(--primary);
}

.conversation-item .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  font-size: 16px;
  flex-shrink: 0;
}

.conversation-item .conversation-content {
  flex: 1;
  min-width: 0;
}

.conversation-item .conversation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.conversation-item .name {
  font-weight: 400;
  color: var(--text-primary);
  font-size: 14px;
}

.conversation-item .time {
  font-size: 12px;
  color: var(--text-muted);
}

.conversation-item .conversation-preview {
  display: flex;
  align-items: center;
  gap: 8px;
}

.conversation-item .preview-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-item .preview-icon {
  font-size: 14px;
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.status-badge.open {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.in_progress {
  background: #dbeafe;
  color: #1e40af;
}

.status-badge.closed {
  background: #d1fae5;
  color: #065f46;
}

/* Unread badge */
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #25D366;
  color: white;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.conversation-item.has-unread .name {
  font-weight: 600;
}

.conversation-item.has-unread .preview-text {
  color: var(--text-primary);
  font-weight: 500;
}

/* ==================== CHAT AREA ==================== */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-gray-100);
}

.no-conversation {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.no-conversation .icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.chat-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-header {
  padding: 16px 20px;
  background: var(--bg-white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.contact-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-info .contact-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  font-size: 14px;
}

.contact-info h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.contact-info span {
  font-size: 13px;
  color: var(--text-secondary);
}

.chat-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Status Buttons */
.status-buttons {
  display: flex;
  gap: 4px;
}

.status-btn {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: var(--bg-white);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-icon {
  flex-shrink: 0;
}

.status-btn:hover {
  background: var(--bg-gray-100);
  transform: translateY(-1px);
}

.status-btn.active {
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.status-btn.active[data-status="open"] {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #f59e0b;
  color: #92400e;
}

.status-btn.active[data-status="in_progress"] {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #3b82f6;
  color: #1e40af;
}

.status-btn.active[data-status="closed"] {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-color: #10b981;
  color: #065f46;
}

.assigned-user {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 4px 10px;
  background: var(--bg-gray-100);
  border-radius: 12px;
}

#select-mode-btn {
  padding: 8px 16px;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

#select-mode-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

#select-mode-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ==================== SELECTION TOOLBAR ==================== */
.selection-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: linear-gradient(135deg, #1c6bba 0%, #1557a0 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(28, 107, 186, 0.25);
}

.selection-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.selection-info .select-btn {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  color: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.selection-info .select-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

#selection-count {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.9;
}

.selection-actions {
  display: flex;
  gap: 12px;
}

.selection-actions .action-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.selection-actions .action-btn.primary {
  background: white;
  color: var(--primary);
}

.selection-actions .action-btn.primary:hover:not(:disabled) {
  background: var(--bg-gray-100);
}

.selection-actions .action-btn.primary:disabled {
  background: rgba(255, 255, 255, 0.5);
  color: rgba(28, 107, 186, 0.5);
  cursor: not-allowed;
}

.selection-actions .action-btn:not(.primary) {
  background: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.selection-actions .action-btn:not(.primary):hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ==================== MESSAGE SELECTION ==================== */
.message.selectable {
  cursor: pointer;
  position: relative;
  padding-left: 40px;
}

.message.selectable::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 12px;
  width: 22px;
  height: 22px;
  border: 2px solid #c5c5c5;
  border-radius: 50%;
  background: white;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message.selectable.selected {
  background: rgba(37, 211, 102, 0.15);
  border-radius: 8px;
}

.message.selectable.selected::before {
  background: #25D366;
  border-color: #25D366;
  box-shadow: 0 2px 4px rgba(37, 211, 102, 0.3);
}

.message.selectable.selected::after {
  content: '✓';
  position: absolute;
  left: 13px;
  top: 12px;
  color: white;
  font-size: 13px;
  font-weight: 600;
}

.message.selectable:hover:not(.selected)::before {
  border-color: #25D366;
  background: rgba(37, 211, 102, 0.08);
}

.message.incoming.selectable {
  padding-left: 40px;
}

.message.outgoing.selectable {
  padding-right: 40px;
  padding-left: 16px;
}

.message.outgoing.selectable::before {
  left: auto;
  right: 8px;
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.15);
}

.message.outgoing.selectable::after {
  left: auto;
  right: 13px;
}

.message.outgoing.selectable:hover:not(.selected)::before {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
}

.message.outgoing.selectable.selected::before {
  background: white;
  border-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.message.outgoing.selectable.selected::after {
  color: #25D366;
}

/* ==================== MESSAGES ==================== */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  max-width: 65%;
  padding: 12px 16px;
  border-radius: 16px;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.message.incoming {
  background: var(--bg-white);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  color: var(--text-primary);
}

.message.outgoing {
  background: var(--primary);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  color: white;
}

.message .content {
  word-wrap: break-word;
  line-height: 1.5;
}

.message .content ul {
  list-style: none;
  margin: 2px 0;
  padding: 0 0 0 8px;
}

.message .content ul li {
  padding: 1px 0;
}

.message .content ul li::before {
  content: '·';
  margin-right: 6px;
  font-weight: bold;
}

.message .meta {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 6px;
  font-size: 11px;
  opacity: 0.7;
}

.message.incoming .meta {
  color: var(--text-secondary);
}

.mail-indicator {
  font-size: 10px;
  margin-right: 6px;
  cursor: help;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.mail-indicator-email {
  color: #2196F3;
}
.mail-indicator-redmine {
  color: #e00;
}
.redmine-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: #e00;
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: 3px;
  margin-right: 2px;
}

.message-star {
  font-size: 10px;
  opacity: 1;
}

.message .sender {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.2px;
}

.message.incoming .sender {
  color: #1e88e5;
}

/* Inline sender name (WhatsApp style: "Naam: bericht") */
.sender-inline {
  font-weight: 600;
  color: #06cf9c;
}

.message.incoming .sender-inline {
  color: #1e88e5;
}

/* Message dropdown button (appears on hover) */
.message-dropdown-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  color: var(--text-muted);
  z-index: 2;
}

.message:hover .message-dropdown-btn {
  opacity: 1;
}

.message-dropdown-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.message.outgoing .message-dropdown-btn {
  left: 4px;
  right: auto;
  color: rgba(255, 255, 255, 0.7);
}

.message.outgoing .message-dropdown-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

/* ==================== MESSAGE INPUT ==================== */
.message-input {
  padding: 12px 16px;
  background: var(--bg-white);
  display: flex;
  gap: 10px;
  align-items: flex-end;
  border-top: 1px solid var(--border-color);
}

.message-input.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.message-input textarea {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: 28px;
  background: var(--bg-gray-50);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.4;
  resize: none;
  max-height: 140px;
  font-family: inherit;
  transition: border-color 0.2s;
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.message-input textarea::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.message-input textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.message-input textarea::placeholder {
  color: var(--text-muted);
}

#send-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}

#send-btn svg {
  margin-left: 2px; /* optisch centreren */
}

#send-btn:hover {
  background: var(--primary-dark);
}

#send-btn:active {
  transform: scale(0.9);
}

#send-btn:disabled {
  background: var(--bg-gray-200);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ==================== REACTION BADGES ==================== */
.reaction-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.reaction-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2px 6px;
  font-size: 15px;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  cursor: default;
  user-select: none;
}

.reaction-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: inherit;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-gray-200);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==================== MEDIA GRID (WhatsApp style image grouping) ==================== */
.message.media-group {
  padding: 4px;
}

.message.selectable.media-group {
  padding-left: 40px;
}

.media-grid {
  display: grid;
  gap: 2px;
  border-radius: 12px;
  overflow: hidden;
  max-width: 320px;
}

.media-grid.grid-2 {
  grid-template-columns: 1fr 1fr;
}

.media-grid.grid-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.media-grid.grid-3 .media-grid-item:first-child {
  grid-row: span 2;
}

.media-grid.grid-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.media-grid.grid-many {
  grid-template-columns: 1fr 1fr;
}

.media-grid-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
}

.media-grid.grid-3 .media-grid-item:first-child {
  aspect-ratio: auto;
}

.media-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s, transform 0.2s;
}

.media-grid-item:hover img {
  opacity: 0.9;
  transform: scale(1.02);
}

.message.media-group .content {
  padding: 8px 8px 0;
}

.message.media-group .meta {
  padding: 4px 8px;
}

/* ==================== MEDIA CONTENT ==================== */
.media-content {
  margin-bottom: 4px;
  position: relative;
}

.media-content img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.media-content img:hover {
  opacity: 0.9;
}

.media-content .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  pointer-events: none;
}

.media-content.video-container {
  cursor: pointer;
  display: inline-block;
}

.media-content video.video-thumbnail {
  max-width: 100%;
  max-height: 300px;
  border-radius: 12px;
  filter: brightness(0.85);
  pointer-events: none;
  display: block;
}

.media-content.video-container:hover video.video-thumbnail {
  filter: brightness(0.75);
}

.media-content video {
  max-width: 100%;
  max-height: 300px;
  border-radius: 12px;
}

.media-content audio {
  width: 100%;
  min-width: 200px;
}

.media-content.document a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-gray-100);
  border-radius: 12px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.2s;
}

.message.outgoing .media-content.document a {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.media-content.document a:hover {
  background: var(--bg-gray-200);
}

/* Sticker */
.media-content.sticker {
  background: transparent;
}

.media-content.sticker .sticker-image {
  max-width: 180px;
  max-height: 180px;
  border-radius: 0;
}

/* Location */
.media-content.location {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-gray-100);
  border-radius: 12px;
}

.message.outgoing .media-content.location {
  background: rgba(255, 255, 255, 0.2);
}

.media-content.location .location-icon {
  font-size: 24px;
}

/* Contacts */
.media-content.contacts {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-gray-100);
  border-radius: 12px;
}

.message.outgoing .media-content.contacts {
  background: rgba(255, 255, 255, 0.2);
}

.media-content.contacts .contacts-icon {
  font-size: 24px;
}

.media-unavailable {
  display: inline-block;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  color: #888;
  font-size: 13px;
  font-style: italic;
}

.message.outgoing .media-unavailable {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
}

/* ==================== MEDIA VIEWER MODAL ==================== */
.media-viewer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.media-viewer-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
}

.media-viewer-content {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 1;
}

.media-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.5);
}

.media-viewer-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.media-viewer-info span:first-child {
  font-weight: 500;
  color: white;
}

.media-viewer-info span:last-child {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.media-viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.media-viewer-actions button {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: white;
  font-size: 20px;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-viewer-actions button:hover {
  background: rgba(255, 255, 255, 0.1);
}

#media-zoom-level {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  min-width: 50px;
  text-align: center;
}

.media-viewer-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.media-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 32px;
  cursor: pointer;
  border-radius: 50%;
  z-index: 10;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.media-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

#media-prev {
  left: 20px;
}

#media-next {
  right: 20px;
}

.media-viewer-container {
  max-width: calc(100% - 140px);
  max-height: calc(100vh - 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: pinch-zoom;
}

.media-viewer-container:active {
  cursor: grabbing;
}

.media-viewer-container img,
.media-viewer-container video {
  max-width: 100%;
  max-height: calc(100vh - 180px);
  object-fit: contain;
  transition: transform 0.1s ease-out;
}

.media-viewer-footer {
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.media-thumbnails {
  display: flex;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px;
}

.media-thumbnails img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.media-thumbnails img:hover {
  opacity: 0.8;
}

.media-thumbnails img.active {
  opacity: 1;
  border-color: var(--primary);
}

#media-counter {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

/* ==================== USER MANAGEMENT ==================== */
.admin-panel {
  padding: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.admin-panel h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.user-table {
  width: 100%;
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.user-table th,
.user-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.user-table th {
  background: var(--bg-gray-50);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 13px;
  text-transform: uppercase;
}

.user-table td {
  font-size: 14px;
  color: var(--text-primary);
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-danger {
  background: #fee2e2;
  color: #dc2626;
}

.btn-danger:hover {
  background: #fecaca;
}

/* ==================== MODAL ==================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-content.modal-small {
  max-width: 400px;
  text-align: center;
  padding: 30px;
}

.modal-content.modal-wide {
  max-width: 1100px;
  max-height: 92vh;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
}

.settings-column {
  min-width: 0;
}

/* Notification Prompt Modal */
.notification-prompt-icon {
  margin-bottom: 16px;
}

.notification-prompt-icon svg {
  animation: bellRing 2s ease-in-out infinite;
}

@keyframes bellRing {
  0%, 100% { transform: rotate(0); }
  5%, 15% { transform: rotate(-15deg); }
  10%, 20% { transform: rotate(15deg); }
  25% { transform: rotate(0); }
}

#notification-prompt-modal h2 {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.notification-prompt-text {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 16px 0;
}

.notification-prompt-hint {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  color: #856404;
  margin-bottom: 20px;
  text-align: left;
}

.notification-prompt-hint.hidden {
  display: none;
}

.pwa-install-instructions.hidden {
  display: none;
}

.notification-prompt-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.notification-prompt-actions .btn {
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg-gray-100);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Settings help button */
.settings-help-btn {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border-color);
  background: transparent;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-help-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(79, 70, 229, 0.05);
}

/* Settings help slide-in panel */
.settings-help-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 520px;
  max-width: 100%;
  background: var(--bg-primary, #fff);
  border-left: 1px solid var(--border-color);
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 10;
  display: flex;
  flex-direction: column;
  border-radius: 0 12px 12px 0;
}
.settings-help-panel.open {
  transform: translateX(0);
}
.settings-help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}
.settings-help-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.settings-help-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.help-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}
.help-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
.help-section h4 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.help-section p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.help-section ul {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ==================== USER MANAGEMENT ==================== */
.user-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.user-list-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-gray-50);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.user-item.inactive {
  opacity: 0.5;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-details .name {
  font-weight: 500;
  color: var(--text-primary);
}

.user-details .email {
  font-size: 13px;
  color: var(--text-muted);
}

.user-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  margin-left: 8px;
}

.user-badge.admin {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.user-badge.inactive {
  background: #fee2e2;
  color: #dc2626;
}

.user-actions {
  display: flex;
  gap: 8px;
}

.user-actions button {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  background: white;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.user-actions button:hover {
  background: var(--bg-gray-100);
}

.user-actions button.delete:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #dc2626;
}

/* ==================== FORM STYLES ==================== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-primary);
  background: white;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(28, 107, 186, 0.1);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* ==================== SETTINGS MODAL ==================== */

/* Main Settings Tabs (Kanalen / Automatisering) */
.settings-main-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
}

.settings-main-tab {
  padding: 12px 24px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.settings-main-tab:hover {
  color: var(--text-primary);
}

.settings-main-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.settings-tab-content {
  animation: fadeIn 0.2s ease;
}

.settings-tab-content.hidden {
  display: none;
}

/* Automation channel tabs (smaller) */
.automation-channel-tab,
.autoreply-channel-tab {
  padding: 8px 16px;
  border: none;
  background: var(--bg-gray-100);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.automation-channel-tab:hover,
.autoreply-channel-tab:hover {
  color: var(--text-primary);
}

.automation-channel-tab.active,
.autoreply-channel-tab.active {
  background: var(--primary);
  color: white;
}

.settings-channel-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-gray-100);
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.settings-channel-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-channel-tab:hover {
  color: var(--text-primary);
}

.settings-channel-tab.active {
  background: var(--bg-white);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.settings-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.settings-description {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.settings-section {
  margin-bottom: 20px;
}

.settings-section-title svg {
  color: var(--primary);
}

.settings-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* Knowledge Engine Status */
.ke-status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.ke-status-card {
  background: var(--bg-secondary, #f5f5f5);
  border-radius: 8px;
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ke-status-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}

.ke-status-label {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.ke-sync-info {
  margin-bottom: 16px;
  font-size: 13px;
}

.ke-sync-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.ke-sync-label {
  color: var(--text-secondary);
}

.ke-sync-value {
  color: var(--text-primary);
  font-weight: 500;
}

.wiki-dashboard-admin {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.ke-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ke-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.ke-actions .btn svg {
  flex-shrink: 0;
}

.ke-sync-progress {
  margin-top: 12px;
}
.ke-sync-progress.hidden { display: none; }
.ke-batch-live {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.ke-batch-live.hidden { display: none; }
.ke-batch-live-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}
@keyframes normalize-pulse {
  0%, 100% { width: 30%; opacity: 0.6; }
  50% { width: 70%; opacity: 1; }
}
.normalize-row:hover {
  background: var(--bg-hover, #f5f5f5);
}
.normalize-row:last-child {
  border-bottom: none;
}
.ke-sync-progress-text {
  font-size: 13px;
  font-weight: 500;
  margin-top: 6px;
}
.ke-sync-progress-current {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-secondary {
  background: var(--bg-secondary, #f5f5f5);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}

.btn-secondary:hover {
  background: var(--border);
}

/* Notification Status */
.notification-status {
  margin-bottom: 16px;
}

.notification-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-light);
  border-radius: 8px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.status-enabled {
  background: #25D366;
  box-shadow: 0 0 6px rgba(37, 211, 102, 0.5);
}

.status-dot.status-disabled {
  background: var(--text-muted);
}

.status-dot.status-blocked {
  background: #dc3545;
}

.status-dot.status-unsupported {
  background: #ffc107;
}

.btn-notification {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-notification:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-notification.btn-enabled {
  background: var(--bg-gray-200);
  color: var(--text-primary);
}

.btn-notification.btn-enabled:hover:not(:disabled) {
  background: var(--bg-gray-300);
}

.btn-notification.btn-disabled {
  background: var(--bg-gray-200);
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-notification .bell-icon {
  width: 18px;
  height: 18px;
}

/* Toggle Switch */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: normal !important;
  position: relative;
}

.toggle-label > span:last-child {
  flex: 1;
}

.toggle-label input {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 44px;
  min-width: 44px;
  height: 24px;
  background: var(--bg-gray-200);
  border-radius: 12px;
  transition: background 0.2s;
  flex-shrink: 0;
  display: inline-block;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-label input:checked + .toggle-switch {
  background: #25D366;
}

.toggle-label input:checked + .toggle-switch::after {
  transform: translateX(20px);
}

/* Textarea in settings */
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  resize: vertical;
  min-height: 100px;
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(28, 107, 186, 0.1);
}

.form-group textarea::placeholder {
  color: var(--text-muted);
}

/* ==================== CONTEXT MENU ==================== */
.context-menu {
  position: fixed;
  z-index: 2000;
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  overflow: hidden;
  animation: contextMenuIn 0.12s ease-out;
}
#conversation-context-menu {
  max-height: calc(100vh - 20px);
  overflow-y: auto;
}

@keyframes contextMenuIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.context-menu.hidden {
  display: none;
}

/* Emoji reactions row */
.context-menu-emojis {
  display: flex;
  gap: 2px;
  padding: 12px 10px;
  border-bottom: 1px solid #f0f0f0;
  justify-content: flex-start;
}

.emoji-reaction {
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emoji-reaction:hover {
  background: #f5f5f5;
  transform: scale(1.1);
}

.emoji-reaction.emoji-more {
  font-size: 20px;
  color: #8696a0;
  font-weight: 300;
  border: 1.5px solid #d1d7db;
}

.emoji-reaction.emoji-more:hover {
  background: #f5f5f5;
  border-color: #c0c6ca;
}

/* Menu items */
.context-menu-items {
  padding: 8px 0;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 10px 20px;
  border: none;
  background: transparent;
  font-size: 15px;
  color: #3b4a54;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s ease;
}

.context-menu-item:hover {
  background: #f5f5f5;
}

.context-menu-item svg {
  flex-shrink: 0;
  color: #8696a0;
}

.context-menu-item-danger {
  color: #3b4a54;
}

.context-menu-item-danger svg {
  color: #8696a0;
}

.context-menu-item-danger:hover {
  background: #f5f5f5;
}

/* ==================== EMOJI PICKER (WhatsApp Style) ==================== */
.emoji-picker {
  position: fixed;
  z-index: 2000;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  width: 360px;
  height: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: contextMenuIn 0.15s ease-out;
}

.emoji-picker.hidden {
  display: none;
}

/* Category tabs at top */
.emoji-picker-categories {
  display: flex;
  padding: 0;
  background: #f0f2f5;
  border-bottom: 1px solid #e9edef;
  flex-shrink: 0;
}

.emoji-category {
  flex: 1;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8696a0;
  border-bottom: 2px solid transparent;
}

.emoji-category svg {
  width: 22px;
  height: 22px;
}

.emoji-category:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #54656f;
}

.emoji-category.active {
  color: #00a884;
  border-bottom-color: #00a884;
  background: #fff;
}

/* Search header */
.emoji-picker-header {
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid #e9edef;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.emoji-search-icon {
  color: #8696a0;
  flex-shrink: 0;
}

.emoji-picker-header input {
  flex: 1;
  padding: 8px 0;
  border: none;
  font-size: 14px;
  background: transparent;
  color: #3b4a54;
}

.emoji-picker-header input::placeholder {
  color: #8696a0;
}

.emoji-picker-header input:focus {
  outline: none;
}

/* Emoji content area */
.emoji-picker-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px 6px;
  background: #fff;
}

/* Section headers */
.emoji-section-header {
  font-size: 13px;
  color: #667781;
  padding: 8px 6px 4px;
  font-weight: 500;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

/* Emoji grid */
.emoji-grid-section {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding-bottom: 8px;
}

.emoji-item {
  width: 100%;
  aspect-ratio: 1;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 26px;
  cursor: pointer;
  transition: all 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emoji-item:hover {
  background: #f0f2f5;
  transform: scale(1.15);
}

/* Emoji button in message input */
.emoji-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.emoji-btn:hover {
  background: var(--bg-gray-100);
}

/* Attachment button */
.attach-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.15s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.attach-btn:hover {
  background: var(--bg-gray-100);
  color: var(--text-secondary);
}

.attach-btn svg {
  width: 22px;
  height: 22px;
}

/* Message reactions — WhatsApp stijl: badge zweeft buiten de bubble */
.message {
  position: relative;
  overflow: visible;
}

.message.has-reactions {
  margin-bottom: 14px;
}

.message-reactions {
  position: absolute;
  bottom: -13px;
  right: 6px;
  display: flex;
  gap: 3px;
  z-index: 1;
}

.message.incoming .message-reactions {
  right: auto;
  left: 6px;
}

.message-reaction {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  font-size: 15px;
  cursor: default;
  white-space: nowrap;
}

.message-reaction-count {
  font-size: 12px;
  font-weight: 600;
  color: #555;
}

/* Reply preview in message input */
.reply-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-gray-100);
  border-left: 3px solid var(--primary);
  margin-bottom: 8px;
  border-radius: 0 8px 8px 0;
}

.reply-preview-content {
  flex: 1;
  min-width: 0;
}

.reply-preview-sender {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}

.reply-preview-text {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-preview-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  font-size: 18px;
  transition: all 0.1s ease;
}

.reply-preview-close:hover {
  background: var(--bg-gray-200);
  color: var(--text-primary);
}

/* Image preview before sending */
.image-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-gray-100);
  border-left: 3px solid var(--primary);
  margin-bottom: 8px;
  border-radius: 0 8px 8px 0;
}

.image-preview-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.image-preview-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.image-preview-info {
  min-width: 0;
}

.image-preview-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-preview-size {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.image-preview-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  font-size: 18px;
  transition: all 0.1s ease;
  flex-shrink: 0;
}

.image-preview-close:hover {
  background: var(--bg-gray-200);
  color: var(--text-primary);
}

/* Confirm modal */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.confirm-overlay.visible {
  opacity: 1;
}

.confirm-modal {
  background: white;
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.confirm-overlay.visible .confirm-modal {
  transform: scale(1);
}

.confirm-image {
  margin-bottom: 14px;
}

.confirm-image img {
  max-width: 100%;
  max-height: 180px;
  border-radius: 10px;
  object-fit: contain;
}

.confirm-icon {
  color: #f59e0b;
  margin-bottom: 12px;
}

.confirm-message {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 6px;
}

.confirm-subtext {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.confirm-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-btn {
  padding: 10px 24px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.confirm-btn-cancel {
  background: var(--bg-gray-100);
  color: var(--text-secondary);
}

.confirm-btn-cancel:hover {
  background: var(--bg-gray-200);
}

.confirm-btn-ok {
  background: var(--primary);
  color: white;
}

.confirm-btn-ok:hover {
  opacity: 0.9;
}

/* Reply quote inside message (WhatsApp style) */
.message-reply-quote {
  background: rgba(0, 0, 0, 0.06);
  border-left: 4px solid #06cf9c;
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 6px;
  cursor: pointer;
}

.message.outgoing .message-reply-quote {
  background: rgba(0, 0, 0, 0.08);
  border-left-color: #06cf9c;
}

.reply-quote-sender {
  font-size: 13px;
  font-weight: 600;
  color: #06cf9c;
  margin-bottom: 2px;
}

.message.incoming .reply-quote-sender {
  color: #1e88e5;
}

.message.incoming .message-reply-quote {
  border-left-color: #1e88e5;
}

.reply-quote-text {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.message.outgoing .reply-quote-text {
  color: rgba(255, 255, 255, 0.7);
}

.reply-quote-body {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reply-quote-thumb {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.message-reply-quote:hover {
  background: rgba(0, 0, 0, 0.1);
}

.message.outgoing .message-reply-quote:hover {
  background: rgba(0, 0, 0, 0.12);
}

/* Starred message indicator */
.message-starred {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 12px;
}

.message.outgoing .message-starred {
  right: auto;
  left: 8px;
}

/* Pinned message banner */
.pinned-message-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #fef3c7;
  border-bottom: 1px solid #fcd34d;
  cursor: pointer;
  transition: background 0.1s ease;
}

.pinned-message-banner:hover {
  background: #fde68a;
}

.pinned-message-icon {
  font-size: 16px;
}

.pinned-message-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pinned-message-close {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  font-size: 14px;
}

.pinned-message-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* Pinned and muted conversation indicators */
.conversation-item.pinned {
  background: #f0fdf4;
}

.conversation-item.pinned:hover {
  background: #dcfce7;
}

.pinned-icon {
  font-size: 12px;
  margin-right: 4px;
}

.muted-icon {
  font-size: 11px;
  margin-left: 4px;
  opacity: 0.6;
}

.favorite-icon {
  font-size: 12px;
  margin-right: 4px;
}

/* Conversation dropdown button */
.conversation-dropdown {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 24px;
  height: 24px;
  border: none;
  background: var(--bg-white);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  opacity: 0;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.conversation-item {
  position: relative;
}

.conversation-item:hover .conversation-dropdown,
.conversation-dropdown.active {
  opacity: 1;
}

.conversation-dropdown:hover {
  background: var(--bg-gray-100);
  color: var(--text-primary);
}

.conversation-dropdown svg {
  width: 16px;
  height: 16px;
}

.conversation-item.pinned .conversation-dropdown {
  background: #dcfce7;
}

.conversation-item.pinned .conversation-dropdown:hover {
  background: #bbf7d0;
}

/* ==================== MOBILE BACK BUTTON ==================== */
.mobile-back-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 4px;
}

.mobile-back-btn:hover {
  background: var(--bg-gray-100);
}

/* ==================== MOBILE RESPONSIVE ==================== */
@media (max-width: 768px) {
  /* Notification bell: show header version on mobile, hide sidebar version */
  .notification-bell {
    display: inline-flex !important;
  }
  .notification-bell.hidden {
    display: none !important;
  }
  .notification-bell-sidebar {
    display: none !important;
  }

  /* App layout - stack vertically */
  .app-layout {
    flex-direction: column;
    position: relative;
  }

  .app-container {
    flex-direction: column;
    position: relative;
    flex: 1;
    overflow: hidden;
  }

  /* Icon sidebar = Zonneplan-stijl floating pill nav (zwevende tegels)
     Hoge pill met icoon + label gestapeld per tegel, gelijkmatig verdeeld. */
  .icon-sidebar {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
    left: 12px;
    right: 12px;
    width: auto;
    height: 76px;
    flex-direction: row;
    justify-content: space-around;
    align-items: stretch;
    padding: 6px 8px;
    z-index: 9999; /* boven elke wiki-/chat-overlay; was 100 maar werd door wiki-content-area afgevangen */
    border-right: none;
    border-top: none;
    background: var(--zp-card, #fff);
    border-radius: 28px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
    transition: transform .2s ease-out, opacity .2s ease-out;
    pointer-events: auto !important;
    isolation: isolate; /* eigen stacking-context — clicks landen niet meer per ongeluk op zusters eronder */
  }
  .icon-sidebar .sidebar-icon {
    position: relative;
    pointer-events: auto !important;
    z-index: 1;
  }

  /* Verberg de bottom-nav als het toetsenbord open is.
     Voorheen scope: alleen mobile-ask-panel. Nu ook in chat-view en wiki-sim-panel,
     omdat de nav anders het chat-input-veld overlapt (verzendknop verdwijnt erachter).
     De gebruiker kan het toetsenbord dismissen om weer te navigeren — type-actie =
     nav weg, klaar met typen = nav terug. */
  body.keyboard-open .icon-sidebar,
  body:has(#mobile-ask-panel:not(.hidden) textarea:focus) .icon-sidebar,
  body:has(#mobile-ask-panel:not(.hidden) input:focus) .icon-sidebar,
  body:has(.chat-area.mobile-active textarea:focus) .icon-sidebar,
  body:has(.chat-area.mobile-active input:focus) .icon-sidebar,
  body:has(.chat-area.mobile-active [contenteditable="true"]:focus) .icon-sidebar {
    display: none !important;
  }

  /* Wrappers verdwijnen: alle .sidebar-icon worden directe kinderen van
     .icon-sidebar, waardoor space-around alle 6 tegels gelijkmatig verdeelt. */
  .icon-sidebar-top,
  .icon-sidebar-bottom {
    display: contents;
  }

  .sidebar-icon {
    flex: 1 1 0;
    min-width: 0;
    max-width: 80px;
    width: auto;
    height: auto;
    padding: 8px 4px 6px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #667781; /* WhatsApp inactief-grijs */
    background: transparent;
    position: relative;
  }
  /* Outline-icoon = inactief, gevuld icoon = actief (WhatsApp-stijl). */
  .icon-sidebar .nav-ic-solid { display: none; }
  .icon-sidebar .sidebar-icon.active .nav-ic-line { display: none; }
  .icon-sidebar .sidebar-icon.active .nav-ic-solid { display: block; }
  /* Achterliggende "tablet" achter het icoon (WhatsApp: neutrale grijze pill). */
  .sidebar-icon::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 54px;
    height: 30px;
    border-radius: 15px;
    background: transparent;
    transition: background .15s ease-out;
    z-index: 0;
  }
  .sidebar-icon svg {
    width: 22px;
    height: 22px;
    position: relative;
    z-index: 1;
  }
  /* Label onder het icoon — uit data-label attribuut.
     Volledige namen (Kennisbank, Vraag stellen, Secure Share) mogen over max
     2 regels breken zodat ze consistent zijn met de desktop-sidebar én passen. */
  .sidebar-icon::after {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    color: #667781; /* WhatsApp inactief-grijs label */
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Active state: donker icoon + donker label + neutraal-grijze pill rond
     de HELE tegel (icoon + tekst), niet alleen achter het icoon. */
  .sidebar-icon.active {
    color: #111b21;
    background: #e9edef;
  }
  .sidebar-icon.active::before {
    background: transparent;
  }
  .sidebar-icon.active::after {
    color: #111b21;
    font-weight: 600;
  }
  /* Badge: bovenop het icoon ipv hele button */
  .sidebar-icon .sidebar-icon-badge {
    top: 2px;
    right: 6px;
  }

  /* Mobiel: max 5 tegels (als WhatsApp) — Chats, Archief, Kennis, Vraag, Meer.
     De rest (incl. Secure Share) zit onder "Meer". */
  .icon-sidebar [data-view="auto-reply"],
  .icon-sidebar [data-view="summary"],
  .icon-sidebar [data-view="secure-share"],
  .icon-sidebar [data-action="users"],
  .icon-sidebar [data-action="help"],
  .icon-sidebar #logout-btn,
  .icon-sidebar .notification-bell-sidebar {
    display: none !important;
  }

  /* Settings popup menu */
  .settings-popup-menu {
    position: fixed;
    bottom: 62px;
    right: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 6px;
    z-index: 200;
    min-width: 180px;
  }
  .settings-popup-menu.hidden { display: none; }
  .settings-popup-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
  }
  .settings-popup-item:hover { background: var(--bg-gray-100); }
  .settings-popup-item svg { width: 20px; height: 20px; flex-shrink: 0; }

  /* Wiki and ask-ai visible on mobile — auto-reply hidden via earlier rule */

  /* Sidebar (conversation list) - full width */
  .sidebar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    border-right: none;
    z-index: 10;
    padding-bottom: calc(112px + env(safe-area-inset-bottom)); /* Space for floating nav pill */
  }

  /* Chat area - slides in from right */
  .chat-area {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    z-index: 20;
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
    background: var(--bg-gray-100);
  }

  .chat-area.mobile-active {
    transform: translateX(0);
  }

  /* Hide "no conversation" on mobile */
  .no-conversation {
    display: none;
  }

  /* Chat view fills screen */
  .chat-view {
    height: 100%;
    padding-bottom: calc(112px + env(safe-area-inset-bottom)); /* Space for floating nav pill */
  }

  /* Wanneer toetsenbord open is: nav is verborgen via display:none, dus de
     padding-bottom voor de nav-area moet ook weg — anders wit vlak onderaan.
     Geldt voor chat-list (sidebar) én chat-view (open conversatie). */
  body.keyboard-open .sidebar {
    padding-bottom: 0 !important;
  }
  body.keyboard-open .chat-view {
    padding-bottom: 0 !important;
  }

  /* Show mobile back button */
  .mobile-back-btn {
    display: flex;
  }

  /* Adjust chat header */
  .chat-header {
    padding: 6px 8px;
    flex-wrap: wrap;
    gap: 0;
  }

  .contact-info {
    gap: 8px;
    flex: 1;
    min-width: 0;
  }

  .contact-avatar {
    width: 34px;
    height: 34px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .contact-info h3 {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .contact-info span {
    font-size: 11px;
  }

  /* Actions bar on second row */
  .chat-actions {
    width: 100%;
    margin-top: 4px;
    padding: 6px 10px;
    gap: 8px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-gray-50, #f9fafb);
    justify-content: flex-start;
    align-items: center;
  }

  .mail-messages-btn {
    padding: 0 !important;
    width: 32px;
    height: 32px;
    border-radius: 50% !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .mail-messages-btn .btn-text {
    display: none;
  }

  .mail-messages-btn svg {
    width: 16px !important;
    height: 16px !important;
  }

  /* In selectie-modus: compact pill-button met tekst op mobiel */
  .mail-messages-btn.active {
    width: auto !important;
    height: 30px !important;
    padding: 0 10px !important;
    border-radius: 15px !important;
    gap: 4px;
  }

  .mail-messages-btn.active .btn-text {
    display: inline !important;
    font-size: 12px;
  }

  .mail-messages-btn.active svg {
    width: 13px !important;
    height: 13px !important;
  }

  .cancel-mail-btn svg {
    width: 14px !important;
    height: 14px !important;
  }

  .cancel-mail-label {
    display: none;
  }

  .status-buttons {
    flex: 1;
    gap: 4px;
    justify-content: flex-end;
  }

  .status-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .status-label {
    display: none;
  }

  /* Messages area */
  .messages {
    padding: 12px;
  }

  .message {
    max-width: 85%;
    padding: 10px 12px;
  }

  /* Message dropdown always visible on mobile (no hover) */
  .message-dropdown-btn {
    opacity: 0.6;
  }

  .message:hover .message-dropdown-btn {
    opacity: 0.6;
  }

  .message-dropdown-btn:active {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
  }

  /* Message input */
  .message-input {
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0));
  }

  .message-input textarea {
    padding: 12px 14px;
    font-size: 16px; /* Prevent zoom on iOS */
  }

  #send-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .attach-btn {
    width: 38px;
    height: 38px;
  }

  .attach-btn svg {
    width: 20px;
    height: 20px;
  }

  .emoji-btn {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }

  .image-preview {
    padding: 8px 12px;
    gap: 8px;
  }

  .image-preview-thumb {
    width: 48px;
    height: 48px;
  }

  .confirm-modal {
    padding: 20px 24px;
    max-width: 320px;
  }

  .confirm-image img {
    max-height: 140px;
  }

  .confirm-message {
    font-size: 14px;
  }

  .confirm-btn {
    padding: 10px 20px;
    font-size: 13px;
  }

  /* Emoji picker - full width at bottom */
  .emoji-picker {
    position: fixed;
    bottom: 110px; /* Above input bar + bottom nav */
    left: 4px;
    right: 4px;
    width: auto;
    height: 45vh;
    max-height: 300px;
    border-radius: 12px;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.2);
    animation: slideUpIn 0.2s ease-out;
  }

  @keyframes slideUpIn {
    from {
      transform: translateY(100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .emoji-grid-section {
    grid-template-columns: repeat(7, 1fr);
  }

  .emoji-item {
    font-size: 24px;
  }

  /* Context menu - bottom sheet style */
  .context-menu {
    position: fixed;
    bottom: 56px;
    left: 8px;
    right: 8px;
    width: auto;
    min-width: auto;
    max-height: 70vh;
    border-radius: 16px 16px 0 0;
    animation: slideUpIn 0.2s ease-out;
  }

  .context-menu-item {
    padding: 14px 20px;
    font-size: 16px;
  }

  .emoji-reaction {
    width: 44px;
    height: 44px;
  }

  /* Modals - fullscreen on mobile */
  .modal-content {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    margin: 0;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .modal-content.modal-small {
    width: 100%;
    max-width: 100%;
  }

  /* Conversation items - larger touch targets */
  .conversation-item {
    padding: 14px 16px;
  }

  .conversation-dropdown {
    width: 32px;
    height: 32px;
    opacity: 0.6;
  }

  .conversation-item:hover .conversation-dropdown {
    opacity: 0.6;
  }

  /* Search box */
  .search-box input {
    font-size: 16px; /* Prevent zoom on iOS */
  }

  /* Filter tabs */
  .filter-tabs {
    padding: 8px 12px;
  }

  .filter-tab {
    padding: 6px 14px;
    font-size: 13px;
  }

  /* Channel tabs in header */
  .channel-tabs {
    gap: 4px;
  }

  .channel-tab {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* Hide assigned user on mobile to save space */
  .assigned-user {
    display: none;
  }

  /* Media viewer */
  .media-viewer-header {
    padding: 12px;
  }

  .media-nav-btn {
    width: 36px;
    height: 36px;
  }
}

/* Extra small devices */
@media (max-width: 380px) {
  .status-buttons {
    flex-wrap: wrap;
  }

  .status-btn {
    padding: 3px 6px;
    font-size: 10px;
  }

  .message {
    max-width: 90%;
  }

  .emoji-grid-section {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* Touch device specific */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .context-menu-item {
    min-height: 48px;
  }

  .emoji-reaction {
    min-width: 44px;
    min-height: 44px;
  }

  /* Remove hover effects that don't work on touch */
  .conversation-item:hover {
    background: transparent;
  }

  .conversation-item:active {
    background: var(--bg-gray-100);
  }

  .message-dropdown-btn:hover {
    background: transparent;
  }
}

/* ==================== MAIL MESSAGES BUTTON & MODAL ==================== */

/* Mail Messages Button in chat header */
.mail-messages-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--bg-white);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.mail-messages-btn:hover {
  background: var(--bg-gray-100);
  transform: translateY(-1px);
}

.mail-messages-btn:active {
  transform: translateY(0);
}

.mail-messages-btn svg {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
}

.mail-messages-btn.active {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #3b82f6;
  color: #1e40af;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Mail button group (mail + cancel side by side) */
.mail-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Cancel mail selection button - prominent red circle */
.cancel-mail-btn {
  padding: 0;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #dc2626;
  color: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
}

.cancel-mail-btn svg {
  width: 16px;
  height: 16px;
  stroke: white;
}

.cancel-mail-btn:hover {
  background: #b91c1c;
  box-shadow: 0 3px 8px rgba(220, 38, 38, 0.5);
  transform: scale(1.05);
}

.cancel-mail-btn.hidden {
  display: none;
}

/* Mail Modal Content */
.mail-modal-content {
  max-width: 600px;
}

/* Recipient options (quick select) */
.mail-recipient-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.mail-recipient-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-gray-50);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 13px;
}

.mail-recipient-option:hover {
  background: var(--bg-gray-100);
}

.mail-recipient-option:has(input:checked) {
  background: rgba(0, 120, 212, 0.1);
  border-color: #0078d4;
}

.mail-recipient-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0078d4;
}

/* Custom recipient input */
.mail-custom-recipient {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.mail-custom-recipient input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
}

.mail-custom-recipient .btn-small {
  padding: 8px 14px;
  font-size: 16px;
  font-weight: bold;
  min-width: 40px;
}

/* Custom recipients list (tags) */
.mail-recipients-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.mail-recipient-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #e3f2fd;
  border-radius: 16px;
  font-size: 12px;
  color: #0078d4;
}

.mail-recipient-tag button {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

.mail-recipient-tag button:hover {
  color: #c00;
}

/* Content summary */
.mail-content-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  background: var(--bg-gray-50);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.mail-content-summary .summary-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: white;
  border-radius: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mail-content-summary .summary-empty {
  color: var(--text-light);
  font-style: italic;
}

/* Mail Messages List in Modal */
.mail-messages-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-gray-50);
}

.mail-message-item {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s ease;
}

.mail-message-item:last-child {
  border-bottom: none;
}

.mail-message-item:hover {
  background: var(--bg-gray-100);
}

.mail-message-item.selected {
  background: rgba(0, 120, 212, 0.1);
}

.mail-message-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.mail-message-checkbox input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: #0078d4;
  flex-shrink: 0;
}

.mail-message-content {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  flex: 1;
  min-width: 0;
}

.mail-message-time {
  color: var(--text-light);
  font-size: 11px;
  font-family: monospace;
}

.mail-message-sender {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
}

.mail-message-text {
  font-size: 13px;
  color: var(--text-primary);
  word-break: break-word;
}

.mail-message-attachment {
  font-size: 12px;
}

/* Extra options accordion */
.mail-extra-options {
  margin-top: 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.mail-extra-options summary {
  padding: 12px 16px;
  background: var(--bg-gray-50);
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mail-extra-options summary::-webkit-details-marker {
  display: none;
}

.mail-extra-options summary::before {
  content: '▶';
  font-size: 10px;
  transition: transform 0.2s ease;
}

.mail-extra-options[open] summary::before {
  transform: rotate(90deg);
}

.mail-extra-options[open] summary {
  border-bottom: 1px solid var(--border-color);
}

.mail-extra-options .form-group {
  padding: 0 16px;
}

.mail-extra-options .form-group:last-child {
  padding-bottom: 16px;
}

/* Autocomplete suggestions */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
}

.autocomplete-suggestion {
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.autocomplete-suggestion:hover {
  background: var(--bg-gray-100);
}

.autocomplete-suggestion small {
  color: var(--text-light);
  font-size: 11px;
}

/* Form hint text */
.form-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-light);
}

/* Mobile responsive for mail feature */
@media (max-width: 768px) {

  /* Reserveer ruimte onderaan voor de floating bottom-nav (76px + 22px offset
     + safe-area). Voorkomt dat actieknoppen (verzenden e.d.) achter de nav
     verdwijnen — de modal-content wordt boven de nav gecentreerd. */
  .modal {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 110px);
  }

  .mail-modal-content {
    max-width: 100%;
    margin: 10px;
    max-height: calc(100vh - env(safe-area-inset-bottom, 0px) - 130px);
  }

  /* Mail cancel button on mobile */
  .cancel-mail-btn {
    padding: 4px 10px;
    font-size: 12px;
    padding: 12px;
  }

  .mail-selection-info {
    text-align: center;
  }

  .mail-selection-actions {
    width: 100%;
    justify-content: stretch;
  }

  .mail-selection-actions .btn {
    flex: 1;
    justify-content: center;
  }

  /* Recipient options stack on mobile */
  .mail-recipient-options {
    flex-direction: column;
  }

  .mail-recipient-option {
    justify-content: flex-start;
  }

  .mail-content-summary {
    flex-direction: column;
    gap: 6px;
  }

  .mail-content-summary .summary-item {
    justify-content: flex-start;
  }
}

/* Small mobile screens */
@media (max-width: 480px) {

  .mail-selection-actions .btn {
    padding: 10px 12px;
    font-size: 12px;
  }
}

/* ==================== WIKI PANEL ==================== */

.wiki-panel {
  display: flex;
  flex: 1;
  overflow: hidden;
  /* min-height:0 is essentieel: zonder dit wordt de hoogte van dit flex-item
     'indefinite' voor het interne grid (ask-mode), waardoor de 1fr-rij meegroeit
     met de volledige inhoud i.p.v. te klemmen. Gevolg: de sidebar-lijst
     (#ka-ask-scroll) werd 6000px+ hoog, overflow-y:auto triggerde nooit en alles
     onder de fold werd door #wiki-panel (overflow:hidden) afgeknipt → niet scrollbaar. */
  min-height: 0;
}

.wiki-panel.hidden {
  display: none;
}

/* Wiki Sidebar */
.wiki-panel-sidebar {
  width: 380px;
  background: var(--bg-white);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Kennisbank (klassiek) op mobiel: sidebar = volle breedte i.p.v. 380px (anders
   loopt 'ie over de schermrand), en ruimte onderaan voor de floating bottom-nav.
   Kanaal-/bron-tabs mogen horizontaal scrollen i.p.v. samengeperst worden. */
@media (max-width: 768px) {
  .wiki-panel-sidebar {
    width: 100% !important;
    overflow-y: auto;
    padding-bottom: 120px;
  }
  .wiki-channel-tabs,
  .wiki-source-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .wiki-channel-tabs::-webkit-scrollbar,
  .wiki-source-tabs::-webkit-scrollbar { display: none; }
  .wiki-channel-tab,
  .wiki-source-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

.wiki-sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 6px;
}

.wiki-sidebar-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.wiki-search-box {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.wiki-search-box input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-gray-50);
  font-size: 14px;
  color: var(--text-primary);
}

.wiki-search-box input:focus {
  outline: none;
  border-color: var(--primary);
}

.wiki-search-box input::placeholder {
  color: var(--text-muted);
}

.wiki-project-selector {
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-color);
}

.wiki-project-selector select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-gray-50);
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
}

.wiki-project-selector select:focus {
  outline: none;
  border-color: var(--primary);
}

.wiki-mode-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* Wiki Page List */
.wiki-page-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.wiki-page-item {
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--bg-gray-100);
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wiki-page-item:hover {
  background: var(--bg-gray-50);
}

.wiki-page-item.active {
  background: #e8f0fe;
  border-left: 3px solid var(--primary);
}

.wiki-page-item.child {
  padding-left: 32px;
}

.wiki-page-item.grandchild {
  padding-left: 48px;
}

.wiki-page-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.wiki-page-icon.has-children {
  color: var(--primary);
}

.wiki-folder-toggle {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
  color: var(--text-muted);
  transition: transform 0.15s;
  margin-left: -4px;
}

.wiki-folder-toggle.collapsed {
  transform: rotate(-90deg);
}

.wiki-folder-children {
  overflow: hidden;
}

.wiki-folder-children.collapsed {
  display: none;
}

.wiki-page-title-wrap {
  min-width: 0;
  flex: 1;
}

.wiki-page-title {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wiki-sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 2px;
}

.wiki-page-item.active .wiki-page-title {
  font-weight: 600;
  color: var(--primary);
}

/* Wiki Content Area */
.wiki-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-white);
}

.wiki-no-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 16px;
}

.wiki-no-page p {
  font-size: 15px;
}

.wiki-page-view {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
}

.wiki-page-view.hidden {
  display: none;
}

.wiki-page-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.wiki-breadcrumbs {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.wiki-breadcrumbs a {
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
}

.wiki-breadcrumbs a:hover {
  text-decoration: underline;
}

.wiki-breadcrumbs .separator {
  color: var(--text-muted);
}

#wiki-page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.wiki-page-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.wiki-article-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.wiki-article-actions.hidden { display: none; }

.wiki-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: white;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.wiki-action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0f7ff;
}
.wiki-action-btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.wiki-action-btn-primary:hover {
  background: #1a73c7;
  color: white;
}
.wiki-action-btn-danger:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: #fef2f2;
}

.wiki-page-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Wiki article tags */
.wiki-page-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 0 24px 8px;
  margin-top: 8px;
}
.wiki-page-tags.hidden { display: none; }

.wiki-article-tag {
  display: inline-block;
  padding: 2px 10px;
  background: #f0fdf4;
  color: #166534;
  border-radius: 12px;
  transition: background 0.15s, color 0.15s;
  font-size: 11px;
  font-weight: 500;
}
.wiki-article-tag.clickable {
  cursor: pointer;
}
.wiki-article-tag.clickable:hover {
  background: #166534;
  color: #fff;
}

.wiki-tag-regen-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: white;
  color: #6b7280;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.wiki-tag-regen-btn:hover {
  background: #eff6ff;
  color: #2563eb;
  border-color: #93c5fd;
}

.tag-search-result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 14px;
}
.tag-search-result:hover {
  background: var(--bg-secondary, #f5f5f5);
}
@keyframes spin-tag { to { transform: rotate(360deg); } }
.spin-icon { animation: spin-tag 1s linear infinite; }

.wiki-tag-edit-btn {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  padding: 0 4px;
  opacity: 0.6;
}
.wiki-tag-edit-btn:hover { opacity: 1; }

.wiki-tags-pending {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.wiki-tag-editor {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.wiki-tag-input {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
  outline: none;
}
.wiki-tag-input:focus {
  border-color: var(--primary);
}

/* Sidebar mini-tags */
.wiki-local-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.wiki-local-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.wiki-sidebar-tag {
  display: inline-block;
  padding: 0 5px;
  background: #f3f4f6;
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 9px;
  line-height: 16px;
}

/* Local article badge */
.wiki-local-badge {
  display: inline-block;
  padding: 1px 6px;
  background: #dbeafe;
  color: #1e40af;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Batch tag modal */
.batch-tag-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.2s;
}
.batch-tag-overlay.visible {
  opacity: 1;
}
.batch-tag-modal {
  background: var(--bg-primary, #fff);
  border-radius: 16px;
  padding: 32px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  text-align: center;
  transform: scale(0.95);
  transition: transform 0.2s;
}
.batch-tag-overlay.visible .batch-tag-modal {
  transform: scale(1);
}
.batch-tag-modal-icon {
  font-size: 40px;
  margin-bottom: 8px;
}
/* Wizard step indicators */
.wizard-step {
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 20px;
  background: #f0f0f0;
  color: #888;
  font-weight: 600;
  transition: all 0.3s;
}
.wizard-step.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* === Wizard issue list — mockup-stijl badges en cards === */
.wiz-issue-row {
  border-radius: 10px;
  transition: background 0.12s;
}
.wiz-issue-row:hover { background: #fafbfc; }
.wiz-issue-row.is-selected { background: #eff6ff; border-left: 3px solid #2563eb; }

/* Relevantie-badges (Hoog/Midden/Laag) */
.wiz-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.wiz-badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.wiz-badge-hoog { color: #047857; background: #d1fae5; border: 1px solid #a7f3d0; }
.wiz-badge-hoog .dot { background: #047857; }
.wiz-badge-midden { color: #b45309; background: #fef3c7; border: 1px solid #fde68a; }
.wiz-badge-midden .dot { background: #b45309; }
.wiz-badge-laag { color: #64748b; background: #f1f5f9; border: 1px solid #e5e7eb; }
.wiz-badge-laag .dot { background: #94a3b8; }

/* Audience pills (Intern/Extern) */
.wiz-audience {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.wiz-audience-intern { color: #7c3aed; background: #f5f3ff; border: 1px solid #ddd6fe; }
.wiz-audience-extern { color: #2563eb; background: #eff6ff; border: 1px solid #bfdbfe; }

/* Scope-stats (stap 1) */
.wiz-scope-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.wiz-scope-stat {
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: 10px;
  padding: 10px 12px;
}
.wiz-scope-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #7c3aed;
  line-height: 1.2;
}
.wiz-scope-stat-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  margin-top: 2px;
}

/* Stap 3 — summary big card */
.wiz-summary-card {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.wiz-summary-big {
  font-size: 32px;
  font-weight: 700;
  color: #2563eb;
  letter-spacing: -0.02em;
  line-height: 1;
}
.wiz-summary-label {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.batch-tag-modal h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}
.batch-tag-modal p {
  margin: 0 0 24px;
  color: var(--text-secondary, #555);
  font-size: 14px;
  line-height: 1.5;
}
.batch-tag-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.batch-tag-cancel {
  padding: 10px 24px;
  border: 1px solid var(--border-color, #ddd);
  background: transparent;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background 0.15s;
}
.batch-tag-cancel:hover {
  background: var(--bg-secondary, #f5f5f5);
}
.batch-tag-start {
  padding: 10px 24px;
  border: none;
  background: var(--primary, #4f46e5);
  color: #fff;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.batch-tag-start:hover {
  opacity: 0.9;
}
.batch-tag-progress {
  margin: 0 0 16px;
}
.batch-tag-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary, #f0f0f0);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}
.batch-tag-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary, #4f46e5);
  border-radius: 4px;
  transition: width 0.5s ease, background 0.3s;
}
.batch-tag-progress-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.batch-tag-progress-current {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Browse toolbar (channel tabs + project selector + new article btn) */
.wiki-browse-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

/* Source tabs (Wiki | Support) */
.wiki-source-tabs {
  display: flex;
  border-bottom: 2px solid var(--bg-gray-100, #e5e7eb);
  padding: 0 12px;
}
.wiki-source-tab {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}
.wiki-source-tab:hover {
  color: var(--text-primary);
}
.wiki-source-tab.active {
  color: var(--primary, #25D366);
  border-bottom-color: var(--primary, #25D366);
  font-weight: 600;
}
.wiki-source-tab svg {
  opacity: 0.6;
}
.wiki-source-tab.active svg {
  opacity: 1;
}
.wiki-source-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.wiki-source-content.hidden {
  display: none;
}
.wiki-browse-toolbar-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 4px;
}
.wiki-support-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Wiki Channel Tabs */
.wiki-channel-tabs {
  display: flex;
  gap: 3px;
  background: var(--bg-gray-100, #f3f4f6);
  border-radius: 10px;
  padding: 3px;
  margin: 8px 12px 4px;
}
.wiki-channel-tab {
  flex: 1;
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
  text-align: center;
}
.wiki-channel-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.wiki-channel-tab:hover:not(.active) {
  background: var(--bg-gray-200, #e5e7eb);
  color: var(--text-primary);
}

/* Compact project selector within toolbar */
.wiki-project-select-small {
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-gray-50);
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
}
.wiki-project-select-small:focus {
  outline: none;
  border-color: var(--primary);
}

.wiki-new-article-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 10px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.wiki-new-article-btn:hover {
  background: #1a73c7;
}

/* Local articles section in sidebar */
.wiki-local-section {
  border-top: 1px solid var(--border-color);
  margin-top: 8px;
  padding-top: 4px;
}

.wiki-local-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wiki-local-category-name {
  padding: 6px 16px 2px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.wiki-local-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.wiki-local-item .wiki-local-badge,
.wiki-local-item .wiki-issue-badge {
  flex-shrink: 0;
}

.ke-pill {
  display: inline-block;
  padding: 1px 6px;
  background: #f1f5f9;
  color: #475569;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  font-family: 'SF Mono', 'Consolas', monospace;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.ke-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 3px;
}

.wiki-issue-badge {
  display: inline-block;
  padding: 1px 6px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.wiki-local-empty {
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Wiki editor panel */
.wiki-editor-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wiki-editor-panel.hidden { display: none; }

.wiki-editor-header {
  padding: 16px 24px 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wiki-editor-title {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
}
.wiki-editor-title:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

.wiki-editor-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wiki-category-combobox {
  position: relative;
  z-index: 10001;
}

.wiki-editor-category {
  padding: 5px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  outline: none;
  width: 200px;
  background: var(--bg-primary);
}

.wiki-editor-category:focus {
  border-color: var(--primary);
}

.wiki-category-dropdown {
  position: fixed;
  min-width: 260px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  z-index: 99999;
  max-height: 250px;
  overflow-y: auto;
}

.wiki-category-option {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-primary);
  white-space: nowrap;
  background: var(--bg-primary);
}

.wiki-category-option:hover,
.wiki-category-option.active {
  background: #e8f0fe;
  color: #1a73e8;
}

.wiki-category-option.new-category {
  color: var(--primary);
  font-style: italic;
  border-top: 1px solid var(--border-color);
}

.wiki-editor-index-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.wiki-editor-index-label input[type="checkbox"] {
  accent-color: var(--primary);
}

/* Wiki Index View */
.wiki-index-view {
  padding: 24px 32px;
  overflow-y: auto;
  max-height: 100%;
}

.wiki-index-header {
  margin-bottom: 24px;
}

.wiki-index-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.wiki-index-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.wiki-index-category {
  margin-bottom: 20px;
}

.wiki-index-category-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--primary);
  cursor: pointer;
}

.wiki-index-category-title.wiki-index-local {
  border-bottom-color: #f59e0b;
}

.wiki-index-category-title:hover {
  color: var(--primary);
}

.wiki-index-category-title .wiki-index-count {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: 6px;
}

.wiki-index-items {
  padding-left: 8px;
  line-height: 1.8;
}

.wiki-index-link {
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
}

.wiki-index-link:hover {
  text-decoration: underline;
}

.wiki-index-pipe,
.wiki-pipe {
  color: var(--text-secondary);
  margin: 0 2px;
  font-size: 12px;
}

.wiki-index-content {
  margin-top: 8px;
}

.wiki-index-item-title {
  flex: 1;
}

.wiki-index-item .wiki-sidebar-tag {
  font-size: 9px;
}

.wiki-editor-buttons {
  display: flex;
  gap: 8px;
}

.wiki-editor-container {
  flex: 1;
  overflow: auto;
  padding: 0;
  min-height: 0;
}
.wiki-editor-container .tox-tinymce {
  border: none !important;
  border-radius: 0 !important;
  height: 100% !important;
}

/* Wiki Content Styling */
.wiki-page-content {
  line-height: 1.7;
  color: var(--text-primary);
  font-size: 14px;
}

.wiki-page-content h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.wiki-page-content h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--text-primary);
}

.wiki-page-content h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--text-primary);
}

.wiki-page-content p {
  margin: 8px 0;
}

.wiki-page-content ul, .wiki-page-content ol {
  padding-left: 24px;
  margin: 8px 0;
}

.wiki-page-content li {
  margin: 4px 0;
}

.wiki-page-content code {
  background: var(--bg-gray-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'Consolas', 'Monaco', monospace;
}

.wiki-page-content pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.5;
}

.wiki-page-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.wiki-page-content img.wiki-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 12px 0;
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.wiki-page-content .wiki-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}

.wiki-page-content .wiki-table th,
.wiki-page-content .wiki-table td {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  text-align: left;
}

.wiki-page-content .wiki-table th {
  background: var(--bg-gray-100);
  font-weight: 600;
}

.wiki-page-content .wiki-table tr:hover {
  background: var(--bg-gray-50);
}

.wiki-page-content a {
  color: var(--primary);
  text-decoration: none;
}

.wiki-page-content a:hover {
  text-decoration: underline;
}

.wiki-page-content a.wiki-link {
  color: var(--primary);
  cursor: pointer;
  border-bottom: 1px dashed var(--primary-light);
}

.wiki-page-content strong {
  font-weight: 600;
}

.wiki-page-content blockquote {
  border-left: 3px solid var(--primary);
  padding: 8px 16px;
  margin: 12px 0;
  background: var(--bg-gray-50);
  color: var(--text-secondary);
}

/* Wiki search results */
.wiki-search-result {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--bg-gray-100);
  transition: background 0.15s;
}

.wiki-search-result:hover {
  background: var(--bg-gray-50);
}

.wiki-search-result-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}

.wiki-search-result-project {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.wiki-search-result-snippet {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Wiki mode tabs */
.wiki-mode-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-gray-100);
  border-radius: 8px;
  padding: 3px;
}

.wiki-mode-tab {
  flex: 1;
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.wiki-mode-tab.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Wiki ask mode */
.wiki-ask-input-area {
  padding: 12px;
  border-bottom: 1px solid var(--bg-gray-100);
}

.wiki-ask-input-area textarea {
  width: 100%;
  border: 1px solid var(--bg-gray-200);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  max-height: 120px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.wiki-ask-input-area textarea:focus {
  border-color: var(--primary);
}

.wiki-ask-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.wiki-ask-btn:hover {
  background: var(--primary-dark, #128C7E);
}

.wiki-ask-btn:disabled {
  background: var(--bg-gray-200);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Ask history */
.wiki-ask-history {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.wiki-ask-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.wiki-ask-empty p {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.4;
}

.wiki-ask-history-item {
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid var(--bg-gray-100);
}

.wiki-ask-history-item:hover {
  background: var(--bg-gray-50);
}

.wiki-ask-history-item.active {
  background: var(--bg-gray-50);
  border-color: var(--primary);
}

.wiki-ask-history-question {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.wiki-ask-history-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* Simulator panel (full-width right content area) */
.wiki-sim-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.wiki-sim-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
}

.wiki-sim-clear-btn {
  margin-left: auto;
  padding: 4px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: white;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.wiki-sim-clear-btn:hover {
  background: var(--bg-gray-50);
  border-color: var(--primary);
  color: var(--primary);
}

/* Simulator sidebar (ask + history) */
.wiki-sim-sidebar-ask {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}

.wiki-sim-sidebar-ask textarea {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  min-height: 36px;
  max-height: 80px;
  line-height: 1.4;
  box-sizing: border-box;
  outline: none;
}

.wiki-sim-sidebar-ask textarea:focus {
  border-color: var(--primary);
}

.wiki-sim-sidebar-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.wiki-sim-sidebar-send-btn:hover {
  background: #1565c0;
}

/* Ask filter tabs */
.wiki-ask-filters {
  display: flex;
  gap: 0;
  padding: 0 8px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.wiki-ask-filter {
  flex: 1;
  padding: 8px 4px;
  border: none;
  background: none;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  text-align: center;
}

.wiki-ask-filter:hover {
  color: var(--text-primary);
}

.wiki-ask-filter.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Ask history context menu */
.wiki-ask-context-menu {
  position: fixed;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
  min-width: 180px;
  padding: 4px 0;
}

.wiki-ask-context-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.wiki-ask-context-item:hover {
  background: var(--bg-gray-50);
}

.wiki-ask-context-item.danger {
  color: #dc2626;
}

.wiki-ask-context-item svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Status dot in history */
.wiki-ask-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.wiki-ask-status-dot.open { background: #3b82f6; }
.wiki-ask-status-dot.correct { background: #22c55e; }
.wiki-ask-status-dot.improved { background: #a855f7; }
.wiki-ask-status-dot.rejected { background: #ef4444; }

.wiki-sim-history {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.wiki-sim-history-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.wiki-sim-history-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--bg-gray-50);
  cursor: pointer;
  transition: background 0.15s;
}

.wiki-sim-history-item:hover {
  background: var(--bg-gray-50);
}

.wiki-sim-history-item.active {
  background: #e3f2fd;
  border-left: 3px solid var(--primary);
}

.wiki-sim-history-item-question {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wiki-sim-history-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}
.wiki-sim-history-verified {
  color: #16a34a;
  font-weight: 600;
  font-size: 10px;
}

/* Simulator chat */
.wiki-sim-chat {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.wiki-sim-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-align: center;
  gap: 8px;
}

.wiki-sim-empty p {
  font-size: 13px;
}

.wiki-sim-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
}

.wiki-sim-bubble.user {
  align-self: flex-end;
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.wiki-sim-bubble.ai {
  align-self: flex-start;
  background: var(--bg-gray-50);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--bg-gray-100);
}

.wiki-sim-bubble.ai p { margin: 0 0 8px 0; }
.wiki-sim-bubble.ai p:last-of-type { margin-bottom: 0; }
.wiki-sim-bubble.ai ul, .wiki-sim-bubble.ai ol { margin: 8px 0; padding-left: 20px; }
.wiki-sim-bubble.ai ul.nested { margin: 4px 0 4px 12px; padding-left: 16px; list-style-type: disc; }
.wiki-sim-bubble.ai li { margin-bottom: 4px; }

.wiki-sim-bubble.ai .wiki-sim-sources {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--bg-gray-200);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.wiki-sim-bubble.ai .wiki-sim-source-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: white;
  border: 1px solid var(--bg-gray-100);
  border-radius: 4px;
  font-size: 10px;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.wiki-sim-bubble.ai .wiki-sim-source-tag:hover {
  border-color: var(--primary);
  background: #f0f7ff;
  color: var(--primary);
}

/* Inline [Bron X] links in AI answers */
.wiki-source-link:not(.wiki-sim-source-tag) {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 1px dotted var(--primary);
}
.wiki-source-link:not(.wiki-sim-source-tag):hover {
  border-bottom-style: solid;
}

.wiki-sim-issue-link {
  color: var(--primary);
  font-weight: 700;
  font-size: 10px;
  text-decoration: none;
  margin-left: 2px;
}
.wiki-sim-issue-link:hover {
  text-decoration: underline;
}

.wiki-sim-validation {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.wiki-sim-val-btn {
  padding: 4px 10px;
  border: 1px solid var(--bg-gray-200);
  border-radius: 4px;
  background: white;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.wiki-sim-val-btn.correct:hover { background: #dcfce7; border-color: #22c55e; }
.wiki-sim-val-btn.improve:hover { background: #dbeafe; border-color: #3b82f6; }
.wiki-sim-val-btn.wrong:hover { background: #fecaca; border-color: #ef4444; }
.wiki-sim-val-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.wiki-sim-status {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
}
.wiki-sim-status.correct { background: #dcfce7; color: #166534; }
.wiki-sim-status.improved { background: #dbeafe; color: #1e40af; }
.wiki-sim-status.rejected { background: #fecaca; color: #991b1b; }

.wiki-sim-verified-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}
.wiki-sim-verified-badge i { font-size: 14px; }
.wiki-sim-verified-badge.correct { background: #dcfce7; color: #166534; }
.wiki-sim-verified-badge.improved { background: #ede9fe; color: #6b21a8; }
.wiki-sim-verified-badge.rejected { background: #fef2f2; color: #991b1b; }

.wiki-sim-bubble.ai.editing {
  max-width: 100%;
  width: 100%;
}
.wiki-sim-bubble.ai .wiki-sim-improve-form {
  margin-top: 8px;
}
.wiki-sim-improve-form {
  width: 100%;
}
.wiki-sim-improve-editor-wrap {
  border-radius: 6px;
  overflow: hidden;
  min-height: 450px;
  width: 100%;
}
.wiki-sim-improve-editor-wrap .tox,
.wiki-sim-improve-editor-wrap .tox-tinymce,
.wiki-sim-improve-editor-wrap .tox .tox-editor-container,
.wiki-sim-improve-editor-wrap .tox .tox-editor-header {
  width: 100% !important;
}
.wiki-sim-improve-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.wiki-sim-improve-actions button {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  border: none;
}
.wiki-sim-improve-actions .save {
  background: #1e40af;
  color: white;
}
.wiki-sim-improve-actions .cancel {
  background: var(--bg-gray-100);
  color: var(--text-secondary);
}

.wiki-sim-typing {
  align-self: flex-start;
  padding: 10px 14px;
  background: var(--bg-gray-50);
  border: 1px solid var(--bg-gray-100);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 4px;
  align-items: center;
}

.wiki-sim-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: simTyping 1.2s infinite;
}
.wiki-sim-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.wiki-sim-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes simTyping {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}

/* Kennisbank-v2 CTA-knop ("Open Vraag stellen") — override anchor-defaults.
   Tailwind preflight staat uit, dus anchor onderstreping moet expliciet weg.
   Pijltje schuift bij hover voor een fijne micro-interactie. */
.kbv2-cta-btn { text-decoration: none !important; color: inherit; }
.kbv2-cta-btn:hover svg { transform: translateX(3px); }
.kbv2-cta-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.kbv2-cta-card:hover .kbv2-cta-arrow {
  background: #2563eb;
  color: #ffffff;
}

/* Kennisbank-v2 stat-grid — eigen grid (geen afhankelijkheid van Tailwind gap-N).
   4 kolommen op desktop, 2 op tablet/kleinere desktop, 1 op mobile. */
.kbv2-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
@media (max-width: 1280px) {
  .kbv2-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}
@media (max-width: 540px) {
  .kbv2-stat-grid { grid-template-columns: 1fr; gap: 14px; }
}

/* Generieke kbv2-kaart (o.a. WhatsApp-analyse landing) */
.kbv2-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px;
}

/* ===== WhatsApp-analyse (FAQ-detectie) ===== */
.wa-faq-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.wa-faq-period {
  display: inline-flex;
  gap: 2px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 3px;
}
.wa-faq-period-btn {
  padding: 5px 12px;
  border: none;
  background: transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.wa-faq-period-btn.active { background: #0f172a; color: #fff; }
.wa-faq-status { font-size: 12px; color: #64748b; }

.wa-faq-list { display: flex; flex-direction: column; gap: 8px; }
.wa-faq-empty {
  text-align: center;
  color: #64748b;
  font-size: 14px;
  padding: 40px 16px;
  background: #fff;
  border: 1px dashed #e2e8f0;
  border-radius: 12px;
}
.wa-faq-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}
.wa-faq-item.open { border-color: #cbd5e1; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.wa-faq-item-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
}
.wa-faq-item-head:hover { background: #f8fafc; }
.wa-faq-item-main { flex: 1; min-width: 0; }
.wa-faq-item-q {
  font-size: 14px;
  font-weight: 400;
  color: #1e293b;
  line-height: 1.45;
  /* Lange feedback-berichten niet de hele lijst laten domineren */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wa-faq-item.open .wa-faq-item-q {
  -webkit-line-clamp: unset;
  overflow: visible;
}
.wa-faq-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}
.wa-faq-count { font-size: 12px; font-weight: 600; color: #16a34a; }
.wa-faq-count-blue { color: #2563eb; }
.wa-faq-sub { font-size: 12px; color: #94a3b8; }
.wa-faq-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.wa-faq-badge-green { background: #dcfce7; color: #15803d; }
.wa-faq-badge-amber { background: #fef3c7; color: #92400e; }

/* Mobiel: Vraag-analyse-rij stapelt — vraag/meta + sparkline + chevron
   bovenaan, de actie-knoppen (Genereer / Naar KB) op een eigen volle-breedte
   regel eronder die zelf wrapt. (DOM-volgorde: main, row-actions, sparkline,
   chevron — met `order` herschikt zodat de knoppen onderaan komen.) */
@media (max-width: 768px) {
  .wa-faq-item-head { flex-wrap: wrap; column-gap: 10px; }
  .wa-faq-item-head .wa-faq-item-main { order: 0; }
  .wa-faq-item-head .wa-faq-spark { order: 1; }
  .wa-faq-item-head .wa-faq-chevron { order: 2; margin-left: auto; }
  .wa-faq-item-head .wa-faq-row-actions {
    order: 3;
    flex-basis: 100%;
    width: 100%;
    flex-wrap: wrap;
    margin-top: 8px;
  }
  .wa-faq-row-actions .ri-act-btn { min-height: 32px; padding: 6px 10px; }
}

/* ---- KB-provenance: harde "IN KENNISBANK"-pill + herkomst-chips ---- */
/* Inline zichtbaarheid-pill (Intern/Extern) op de artikel-rij */
.kb-vis-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  white-space: nowrap;
}
.kb-vis-badge svg { flex-shrink: 0; }
.kb-vis-toggle { cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.kb-vis-toggle:disabled { opacity: .6; cursor: default; }
.kb-vis-extern { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.kb-vis-toggle.kb-vis-extern:hover { background: #bbf7d0; }
.kb-vis-intern { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.kb-vis-toggle.kb-vis-intern:hover { background: #e2e8f0; color: #475569; }

/* "+ Nieuw artikel" — schone primaire create-knop met +-icoon */
.kb-new-article-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 8px 14px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  border: 1px solid #0f172a;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.kb-new-article-btn:hover { background: #1e293b; border-color: #1e293b; box-shadow: 0 2px 8px rgba(15,23,42,.18); }
.kb-new-article-btn svg { flex-shrink: 0; }

.kb-prov-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
  cursor: pointer;
  line-height: 1.4;
  transition: background .12s ease, border-color .12s ease;
}
.kb-prov-badge:hover { background: #bbf7d0; border-color: #86efac; }
.kb-prov-badge .kb-prov-arrow {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  opacity: .75;
}
.kb-prov-hint {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}
.kb-prov-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 5px;
}
.kb-prov-chip {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.kb-prov-chip-redmine { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.kb-prov-chip-faq     { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.kb-prov-chip-wa      { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.kb-prov-chip-manual  { background: #f8fafc; color: #94a3b8; border-color: #e2e8f0; }
.kb-prov-highlight {
  animation: kbProvFlash 2s ease;
}
@keyframes kbProvFlash {
  0%, 30% { background: #fef9c3; box-shadow: 0 0 0 2px #fde047; }
  100% { background: transparent; box-shadow: none; }
}
.wa-faq-spark {
  display: inline-flex;
  align-items: flex-end;
  gap: 1px;
  height: 18px;
  flex-shrink: 0;
}
.wa-faq-spark span {
  width: 3px;
  background: #25D366;
  border-radius: 1px;
  opacity: .75;
}
.wa-faq-chevron { color: #94a3b8; flex-shrink: 0; transition: transform .15s; }
.wa-faq-item.open .wa-faq-chevron { transform: rotate(90deg); }

.wa-faq-item-detail { padding: 0 16px 16px; border-top: 1px solid #f1f5f9; }

/* Uitklapbare Redmine-issues zoekrij (accordion, mirror van wa-faq-item) */
.ri-row-detail {
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}
.ri-row-detail-body { padding: 14px 16px; font-size: 13px; color: #334155; line-height: 1.55; }
.ri-row-chev { transition: transform .18s ease; }

/* Rechter actie-toolbar per Redmine-issue-rij (consistent over alle subtabs) */
.ri-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
  margin-top: 1px;
}
.ri-act-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: #475569;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 4px 9px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  text-decoration: none;
  transition: background .12s, border-color .12s, color .12s;
}
.ri-act-btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.ri-act-btn:disabled { opacity: .5; cursor: default; }
.ri-act-analyze { color: #b45309; border-color: #fde68a; }
.ri-act-analyze:hover { background: #fffbeb; border-color: #fcd34d; }
.ri-act-generate { color: #c2410c; border-color: #fed7aa; }
.ri-act-generate:hover { background: #fff7ed; border-color: #fdba74; }
.ri-act-reject { color: #dc2626; border-color: #fecaca; }
.ri-act-reject:hover { background: #fef2f2; border-color: #fca5a5; }
.ri-act-link { color: #2563eb; border-color: #dbeafe; }
.ri-act-link:hover { background: #eff6ff; border-color: #bfdbfe; }
.ri-act-promote { color: #15803d; border-color: #bbf7d0; }
.ri-act-promote:hover { background: #f0fdf4; border-color: #86efac; }
/* Filters niet-relevant in archief-weergave (Afgekeurd) → gedimd + inert. */
.wa-faq-dim { opacity: .4; pointer-events: none; }

/* ── Vooranalyse (pre-scan triage) ── */
.wa-prescan-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding: 14px 16px; margin-bottom: 10px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
}
.wa-prescan-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.wa-prescan-stat {
  font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  background: #f1f5f9; color: #475569; white-space: nowrap;
}
.wa-prescan-stat.total { background: #0f172a; color: #fff; }
.wa-prescan-stat.ok { background: #dcfce7; color: #15803d; }
.wa-prescan-stat.maybe { background: #fef3c7; color: #b45309; }
.wa-prescan-stat.no { background: #f1f5f9; color: #64748b; }
/* Klikbare verdict-filters */
.wa-prescan-stat[data-ps-filter] { cursor: pointer; transition: box-shadow .12s, opacity .12s; }
.wa-prescan-stat[data-ps-filter]:not(.ps-active) { opacity: .5; }
.wa-prescan-stat[data-ps-filter]:hover { opacity: .85; }
.wa-prescan-stat.ps-active { opacity: 1; box-shadow: 0 0 0 2px rgba(15,23,42,.14); }
/* Filter-wrap: toon/verberg rijen per verdict */
.wa-prescan-wrap.ps-geschikt .wa-prescan-item:not(.wa-prescan-geschikt),
.wa-prescan-wrap.ps-twijfel .wa-prescan-item:not(.wa-prescan-twijfel),
.wa-prescan-wrap.ps-niet .wa-prescan-item:not(.wa-prescan-niet),
.wa-prescan-wrap.ps-todo .wa-prescan-item.wa-prescan-niet { display: none; }
.wa-prescan-dup {
  font-size: 11px; font-weight: 600; color: #7c3aed; background: #f3e8ff;
  padding: 1px 7px; border-radius: 999px; white-space: nowrap;
}
.wa-prescan-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; background: #fff; border: 1px solid #eef2f7;
  border-radius: 10px; margin-bottom: 8px; cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.wa-prescan-item:hover { border-color: #dbe3ec; box-shadow: 0 1px 3px rgba(15,23,42,0.05); }
.wa-prescan-chevron { flex-shrink: 0; color: #cbd5e1; margin-top: 4px; transition: transform 0.15s; }
.wa-prescan-item.open .wa-prescan-chevron { transform: rotate(90deg); }
.wa-prescan-item.open .wa-prescan-text { -webkit-line-clamp: unset; display: block; }
.wa-prescan-detail { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #e2e8f0; }
.wa-prescan-item.open .wa-prescan-detail { display: block; }
.wa-prescan-detail-block { margin-bottom: 8px; }
.wa-prescan-detail-block:last-child { margin-bottom: 0; }
.wa-prescan-detail-label {
  display: block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: #94a3b8; margin-bottom: 2px;
}
.wa-prescan-detail-block > div { font-size: 13px; color: #334155; line-height: 1.5; white-space: pre-wrap; }
.wa-prescan-muted { color: #94a3b8; }
.wa-prescan-ico {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
}
.wa-prescan-geschikt .wa-prescan-ico { background: #dcfce7; color: #16a34a; }
.wa-prescan-twijfel .wa-prescan-ico { background: #fef3c7; color: #d97706; }
.wa-prescan-niet .wa-prescan-ico { background: #f1f5f9; color: #94a3b8; }
.wa-prescan-main { flex: 1; min-width: 0; }
.wa-prescan-text {
  font-size: 14px; color: #0f172a; line-height: 1.4;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.wa-prescan-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.wa-prescan-reason { font-size: 12px; color: #64748b; }
.wa-prescan-by {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: #94a3b8; background: #f1f5f9; padding: 1px 6px; border-radius: 4px;
}
.wa-prescan-lead { font-size: 13px; color: #64748b; font-weight: 500; }
.wa-prescan-scanbtns { display: inline-flex; align-items: center; gap: 8px; }
.wa-prescan-force {
  background: transparent; border: 1px solid #e2e8f0; color: #64748b;
  font-family: inherit; font-size: 12px; font-weight: 500; padding: 7px 12px;
  border-radius: 8px; cursor: pointer; transition: all 0.12s;
}
.wa-prescan-force:hover { border-color: #cbd5e1; color: #0f172a; background: #f8fafc; }
/* Laad-staat tijdens scannen */
.wa-prescan-loading {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center; padding: 56px 20px;
}
.wa-prescan-spinner { width: 32px; height: 32px; color: #2563eb; }
.wa-prescan-loading-title { font-size: 15px; font-weight: 600; color: #0f172a; }
.wa-prescan-loading-sub { font-size: 13px; color: #94a3b8; max-width: 380px; line-height: 1.5; }
/* Lege staat (nog niet gescand) */
.wa-prescan-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; padding: 48px 20px; color: #94a3b8;
}
.wa-prescan-empty svg { color: #cbd5e1; }
.wa-prescan-empty-title { font-size: 15px; font-weight: 600; color: #475569; }
.wa-prescan-empty-sub { font-size: 13px; color: #94a3b8; max-width: 420px; line-height: 1.5; }
.wa-prescan-empty-sub strong { color: #0f172a; }
@media (max-width: 768px) {
  .wa-prescan-item { flex-wrap: wrap; }
  .wa-prescan-item .wa-faq-row-actions { width: 100%; margin-top: 6px; }
}
/* Rechts-uitgelijnde acties op een Vraag-analyse-clusterrij */
.wa-faq-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
/* Beslis-knoppen op de analyse-kaart (Goedkeuren / Bewerken / Afwijzen) —
   groter dan de rij-pills, vlak (geen schaduw), met semantische kleur. */
.ri-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background .12s, border-color .12s, color .12s;
}
.ri-cta-btn svg { flex-shrink: 0; }
.ri-cta-approve { background: #16a34a; border-color: #16a34a; color: #fff; }
.ri-cta-approve:hover { background: #15803d; border-color: #15803d; }
.ri-cta-edit:hover { background: #f8fafc; border-color: #cbd5e1; color: #0f172a; }
.ri-cta-reject { color: #dc2626; border-color: #fecaca; }
.ri-cta-reject:hover { background: #fef2f2; border-color: #fca5a5; }
/* Sectie-labels op de beoordelings-kaart (Vraag / Antwoord / AI-beoordeling) */
.ri-cand-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #94a3b8;
  margin-bottom: 4px;
}
.ri-cand-label span {
  text-transform: none;
  font-weight: 500;
  letter-spacing: 0;
  color: #cbd5e1;
}
/* Beoordeel-instructie boven de kandidatenlijst */
.ri-cand-howto {
  font-size: 12px;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 12px;
  line-height: 1.5;
}
.ri-cand-howto b { color: #0f172a; }
/* Mobiel: laat de Redmine-issue-rij netjes stapelen i.p.v. de titel te
   verdringen. Titel/meta + chevron blijven op de bovenste regel; de
   knoppen-toolbar breekt naar een eigen volle-breedte regel eronder en
   wrapt daar zelf. (DOM-volgorde: checkbox, .ri-row-expand, .ri-row-actions,
   .ri-row-chev — daarom met `order` herschikt.) */
@media (max-width: 768px) {
  .ri-row-head { flex-wrap: wrap; }
  .ri-row-head .ri-row-check { order: 0; }
  .ri-row-head .ri-row-expand { order: 1; }
  .ri-row-head .ri-row-chev { order: 2; }
  .ri-row-head .ri-row-actions {
    order: 3;
    flex-basis: 100%;
    width: 100%;
    margin-top: 8px;
  }
  .ri-row-actions .ri-act-btn { min-height: 32px; padding: 6px 10px; }
  /* Beoordeel-kaart CTA's iets ruimer als touch-target */
  .ri-cta-btn { min-height: 40px; }
}

/* Redmine-issue image-attachments in de accordion */
.ri-att-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ri-att-thumb {
  display: block;
  width: 120px;
  height: 90px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  transition: border-color .15s, box-shadow .15s;
}
.ri-att-thumb:hover {
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
}
.ri-att-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Genereer AI-antwoord blok */
.ri-gen-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed #e2e8f0;
}
.ri-gen-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ri-gen-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ea580c;
  color: #fff !important;
  border: none;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  font-family: inherit;
}
.ri-gen-btn:hover { background: #c2410c; }
.ri-gen-btn:disabled { opacity: .6; cursor: default; }
.ri-gen-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, .5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: riGenSpin .7s linear infinite;
}
@keyframes riGenSpin { to { transform: rotate(360deg); } }
.ri-gen-result { margin-top: 12px; }
.ri-gen-card {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  border-radius: 10px;
  padding: 12px 14px;
}
.ri-gen-card-loading,
.ri-gen-card-empty {
  font-size: 12px;
  color: #9a3412;
  border-color: #fed7aa;
  background: #fff7ed;
}
.ri-gen-q {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}
.ri-gen-a { font-size: 13px; color: #334155; }
.ri-gen-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}
.ri-gen-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
}
.ri-gen-chip-img { background: #dbeafe; color: #1e40af; }
.ri-gen-model {
  font-size: 10px;
  color: #94a3b8;
  margin-left: auto;
}
.wa-faq-block { margin-top: 14px; }
.wa-faq-detail-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #94a3b8;
  margin-bottom: 8px;
}
.wa-faq-example {
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 6px;
}
.wa-faq-example-q { font-size: 13px; color: #334155; }
.wa-faq-example-answer { font-size: 12px; color: #16a34a; margin-top: 4px; }
.wa-faq-answer-body {
  font-size: 13px;
  color: #0f172a;
  line-height: 1.5;
  white-space: pre-wrap;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 12px;
}
.wa-faq-answer-empty { font-size: 13px; color: #94a3b8; margin-top: 14px; font-style: italic; }
.wa-faq-actions { margin-top: 14px; display: flex; gap: 8px; }
.wa-faq-link { font-size: 13px; color: #334155; }
.wa-faq-link-a { color: #2563eb; font-weight: 600; text-decoration: none; }
.wa-faq-link-a:hover { text-decoration: underline; }
.wa-faq-issues { display: flex; flex-wrap: wrap; gap: 6px; }
.wa-faq-issue {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 2px 8px;
  text-decoration: none;
}
.wa-faq-issue:hover { background: #fee2e2; }

/* Kennisbank-v2 stat-tegels — uniforme layout: label·icon header,
   prominente waarde, subtitel. Lichtere borders en kleinere padding
   dan v1 voor minder visuele drukte. */
.kbv2-stat-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  min-height: 138px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  text-align: left;
  font-family: inherit;
}
/* Klikbare variant — wanneer een tile naar een view linkt (Geverifieerd → Vraag stellen) */
.kbv2-stat-tile-link {
  cursor: pointer;
}
.kbv2-stat-tile-link:hover {
  border-color: #7c3aed;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.12);
  transform: translateY(-1px);
}
.kbv2-stat-tile-link:active { transform: translateY(0); }
/* Oude beheer-dashboard ke-status-card link variant */
button.ke-status-card-link {
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s, background 0.15s;
}
button.ke-status-card-link:hover {
  border-color: #7c3aed;
  background: #faf5ff;
}
.kbv2-stat-tile:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}
.kbv2-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
}
.kbv2-stat-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0;
  /* Lange labels netjes afkappen i.p.v. naar nieuwe regel laten gaan,
     zodat alle 4 de tegels exact dezelfde header-hoogte hebben. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}
.kbv2-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
}
.kbv2-stat-icon svg { width: 14px; height: 14px; }
.kbv2-stat-icon-blue { background: #eff6ff; color: #2563eb; }
.kbv2-stat-icon-amber { background: #fffbeb; color: #d97706; }
.kbv2-stat-icon-emerald { background: #ecfdf5; color: #059669; }
.kbv2-stat-icon-violet { background: #f5f3ff; color: #7c3aed; }

.kbv2-stat-value {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  margin-top: 2px;
}
/* Lege waarde (alleen "—") krijgt zachtere kleur zodat het niet domineert
   wanneer er nog geen data is. */
.kbv2-stat-value:not(:has(span)):empty,
.kbv2-stat-value[data-empty="true"] {
  color: #cbd5e1;
}
.kbv2-stat-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-top: auto;
  line-height: 1.4;
}
.kbv2-stat-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  margin-top: 2px;
}
.kbv2-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #334155;
}
.kbv2-stat-row > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.kbv2-stat-row .tabular-nums { font-weight: 600; color: #0f172a; }
.kbv2-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

/* ===== Kennisbank-v2 BEHEER-tab — strakke layout zonder uppercase ===== */
.kbv2-beheer-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.kbv2-beheer-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  overflow: hidden;
}
.kbv2-beheer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid #f1f5f9;
}
.kbv2-beheer-header > div { min-width: 0; flex: 1; }
.kbv2-beheer-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}
.kbv2-beheer-header p {
  font-size: 12px;
  color: #64748b;
  margin: 2px 0 0;
}
.kbv2-beheer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
}
.kbv2-beheer-icon svg { width: 16px; height: 16px; }
.kbv2-beheer-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Sync-cards: 2-koloms grid met inline-stats ipv gecentreerde 3-koloms */
.kbv2-sync-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 768px) {
  .kbv2-sync-cards { grid-template-columns: 1fr; }
}
.kbv2-sync-empty {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  font-size: 13px;
  color: #94a3b8;
  grid-column: 1 / -1;
}
.kbv2-sync-card {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px 16px;
}
.kbv2-sync-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.kbv2-sync-card-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}
.kbv2-sync-card-name .kbv2-dot { width: 8px; height: 8px; border-radius: 50%; }
.kbv2-sync-card-age {
  font-size: 11px;
  color: #94a3b8;
}
.kbv2-sync-card-stats {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-size: 13px;
}
.kbv2-sync-card-stats strong {
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  margin-right: 4px;
}
.kbv2-sync-card-stats span { color: #64748b; }

/* Handmatige sync-actie + knoppen */
.kbv2-sync-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px 16px;
}
@media (max-width: 640px) {
  .kbv2-sync-actions { flex-direction: column; align-items: stretch; }
}
.kbv2-sync-btns {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.kbv2-btn-primary {
  background: #0f172a;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.kbv2-btn-primary:hover:not(:disabled) { background: #334155; }
.kbv2-btn-primary:disabled { opacity: 0.6; cursor: wait; }
.kbv2-btn-outline {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.kbv2-btn-outline:hover { background: #f8fafc; border-color: #94a3b8; }

/* Live progress */
.kbv2-sync-progress {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: #1e40af;
}
.kbv2-sync-bar-wrap {
  height: 6px;
  background: #dbeafe;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.kbv2-sync-bar {
  height: 100%;
  background: #2563eb;
  border-radius: 999px;
  transition: width 0.3s;
}
.kbv2-sync-current {
  font-size: 11px;
  color: #2563eb;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Row title/sub — generieke labels binnen Beheer-rijen */
.kbv2-row-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}
.kbv2-row-sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

/* AI keys */
.kbv2-key-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 768px) { .kbv2-key-grid { grid-template-columns: 1fr; } }
.kbv2-key-card {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px 16px;
}
.kbv2-key-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.kbv2-key-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}
.kbv2-key-badge { font-size: 11px; }
.kbv2-key-meta {
  font-size: 11px;
  color: #94a3b8;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Form fields */
.kbv2-field-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kbv2-field-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 768px) { .kbv2-field-grid-3 { grid-template-columns: 1fr; } }
.kbv2-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  margin-bottom: 6px;
}
.kbv2-field-hint {
  font-weight: 400;
  color: #94a3b8;
  font-size: 12px;
}
.kbv2-select {
  width: 100%;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: #0f172a;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}
.kbv2-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Scheduler toggle-rijen */
.kbv2-sched-list {
  gap: 8px;
}
.kbv2-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.kbv2-toggle-row:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.kbv2-toggle-row input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
  flex-shrink: 0;
  cursor: pointer;
}
.kbv2-toggle-row > div { flex: 1; min-width: 0; }

/* Prompts collapsible */
.kbv2-prompt-list { display: flex; flex-direction: column; }
.kbv2-prompt-row {
  border-top: 1px solid #f1f5f9;
}
.kbv2-prompt-row:first-child { border-top: none; }
.kbv2-prompt-row summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
  transition: background 0.15s;
}
.kbv2-prompt-row summary::-webkit-details-marker { display: none; }
.kbv2-prompt-row summary:hover { background: #f8fafc; }
.kbv2-prompt-chev {
  width: 14px;
  height: 14px;
  color: #94a3b8;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.kbv2-prompt-row[open] .kbv2-prompt-chev { transform: rotate(90deg); }
.kbv2-prompt-reset {
  margin-left: auto;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s;
}
.kbv2-prompt-reset:hover { background: #f8fafc; color: #0f172a; }
.kbv2-prompt-body {
  padding: 0 20px 16px;
}
.kbv2-prompt-textarea {
  width: 100%;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.6;
  color: #0f172a;
  resize: vertical;
}
.kbv2-prompt-textarea:focus {
  outline: none;
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Sticky savebar */
.kbv2-savebar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}
.kbv2-savebar-meta { font-size: 12px; color: #94a3b8; }
.kbv2-savebar-right { display: flex; align-items: center; gap: 10px; }
.kbv2-savebar-state { font-size: 12px; }

/* === MOBILE TWEAKS voor Overzicht-tab === */
@media (max-width: 640px) {
  .kbv2-stat-tile {
    padding: 14px 14px;
    min-height: 116px;
    border-radius: 14px;
  }
  .kbv2-stat-value { font-size: 24px; }
  .kbv2-stat-label { font-size: 12px; }
  .kbv2-stat-icon { width: 24px; height: 24px; }
  .kbv2-stat-icon svg { width: 12px; height: 12px; }
  /* CTA-kaart: laat pijltje compacter zodat content niet overflow */
  .kbv2-cta-card { padding: 14px !important; gap: 12px !important; }
}

/* Streaming cursor — dun verticaal lijntje dat zacht pulseert aan het eind
   van groeiende AI-tekst. Soepele fade i.p.v. hard knipperen. */
.wiki-sim-stream-cursor {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: -0.15em;
  background: currentColor;
  opacity: 0.85;
  border-radius: 1px;
  animation: simStreamBlink 1.15s ease-in-out infinite;
}
@keyframes simStreamBlink {
  0%   { opacity: 0.9; }
  50%  { opacity: 0.15; }
  100% { opacity: 0.9; }
}

.wiki-sim-input-area {
  padding: 12px 24px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.wiki-sim-input-area textarea {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  line-height: 1.4;
  box-sizing: border-box;
}

.wiki-sim-input-area textarea:focus {
  border-color: var(--primary);
}

.wiki-sim-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.wiki-sim-send-btn:hover {
  background: #1565c0;
}

.wiki-sim-send-btn:disabled {
  background: var(--bg-gray-200);
  cursor: not-allowed;
}

/* AI Answer panel */
.wiki-ai-answer {
  padding: 24px;
  max-width: 800px;
}

.wiki-ai-answer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--bg-gray-100);
}

.wiki-ai-answer-header span {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.wiki-ai-confidence {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.wiki-ai-confidence.high {
  background: #dcfce7;
  color: #166534;
}

.wiki-ai-confidence.medium {
  background: #fef9c3;
  color: #854d0e;
}

.wiki-ai-confidence.low {
  background: #fecaca;
  color: #991b1b;
}

.wiki-ai-answer-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
}

.wiki-ai-answer-content h1,
.wiki-ai-answer-content h2,
.wiki-ai-answer-content h3 {
  margin-top: 20px;
  margin-bottom: 8px;
}

.wiki-ai-answer-content p {
  margin-bottom: 12px;
}

.wiki-ai-answer-content ul,
.wiki-ai-answer-content ol {
  margin-bottom: 12px;
  padding-left: 24px;
}

.wiki-ai-answer-content li {
  margin-bottom: 4px;
}

.wiki-ai-answer-content code {
  background: var(--bg-gray-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.wiki-ai-answer-content pre {
  background: var(--bg-gray-50);
  padding: 12px 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 12px;
}

.wiki-ai-answer-content pre code {
  background: none;
  padding: 0;
}

/* AI Sources */
.wiki-ai-sources {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--bg-gray-100);
}

.wiki-ai-sources-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.wiki-ai-source-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  margin: 0 6px 6px 0;
  background: var(--bg-gray-50);
  border: 1px solid var(--bg-gray-100);
  border-radius: 6px;
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.15s;
}

.wiki-ai-source-item:hover {
  background: white;
  border-color: var(--primary);
}

/* AI Loading */
.wiki-ai-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.wiki-ai-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: wiki-spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes wiki-spin {
  to { transform: rotate(360deg); }
}

.wiki-ai-loading p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ==================== WIKI DASHBOARD ==================== */
.wiki-dashboard {
  overflow-y: auto;
  padding: 32px 40px;
  align-items: stretch;
  justify-content: flex-start;
}
.wiki-dashboard-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  flex: 1;
}
.wiki-dashboard-loading p {
  font-size: 14px;
  color: var(--text-secondary);
}
.wiki-dashboard-content {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}
.wiki-dashboard-section {
  margin-bottom: 24px;
}
.wiki-dashboard-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.wiki-dashboard-ask {
  display: flex;
  gap: 8px;
}
.wiki-dashboard-ask-input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-gray-50);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
}
.wiki-dashboard-ask-input:focus {
  border-color: var(--primary);
}
.wiki-dashboard-ask-input::placeholder {
  color: var(--text-muted);
}
.wiki-dashboard-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.wiki-dashboard-list {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}
.wiki-dashboard-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--bg-gray-100);
  transition: background 0.15s;
  gap: 12px;
}
.wiki-dashboard-list-item:last-child {
  border-bottom: none;
}
.wiki-dashboard-list-item:hover {
  background: var(--bg-gray-50);
}
.wiki-dashboard-list-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.wiki-dashboard-list-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wiki-dashboard-list-item:hover .wiki-dashboard-list-item-title {
  color: var(--primary);
}
.wiki-dashboard-list-item-project {
  font-size: 11px;
  color: var(--text-muted);
}
.wiki-dashboard-list-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.wiki-dashboard-verified-badge {
  background: #dbeafe;
  color: #1e40af;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.wiki-dashboard-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
/* Project tree */
.wiki-dashboard-section-collapsible {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.wiki-dashboard-chevron {
  margin-left: auto;
  transition: transform 0.2s;
}
.wiki-dashboard-section-collapsible.collapsed .wiki-dashboard-chevron {
  transform: rotate(-90deg);
}
.wiki-dashboard-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wiki-dashboard-tree.hidden {
  display: none;
}
.wiki-dashboard-tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  transition: background 0.15s;
}
.wiki-dashboard-tree-item:hover {
  background: var(--bg-hover, rgba(0,0,0,0.04));
}
.wiki-dashboard-tree-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
}
a.wiki-dashboard-tree-name:hover {
  color: var(--primary);
  text-decoration: underline;
}
.wiki-dashboard-tree-count {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  text-decoration: none;
}
a.wiki-dashboard-tree-count:hover {
  color: var(--primary);
  text-decoration: underline;
}
.wiki-dashboard-tree-progress {
  width: 60px;
  height: 6px;
  background: var(--bg-tertiary, #e5e7eb);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}
.wiki-dashboard-tree-progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}
.wiki-dashboard-tree-progress-bar.complete {
  background: #22c55e;
}
.wiki-dashboard-tree-progress-bar.partial {
  background: #f59e0b;
}
.wiki-dashboard-tree-progress-bar.none {
  background: #e5e7eb;
}
.wiki-dashboard-tree-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.wiki-dashboard-tree-badge.complete {
  background: #dcfce7;
  color: #166534;
}
.wiki-dashboard-tree-badge.sync-needed {
  background: #fef3c7;
  color: #92400e;
}
.wiki-dashboard-tree-badge.no-issues {
  background: var(--bg-tertiary, #f3f4f6);
  color: var(--text-muted);
}
.wiki-dashboard-tree-btn {
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid var(--primary);
  color: var(--primary);
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.wiki-dashboard-tree-btn:hover {
  background: var(--primary);
  color: white;
}
.wiki-dashboard-tree-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.wiki-dashboard-tree-btn.extracting {
  border-color: #f59e0b;
  color: #92400e;
  background: #fef3c7;
}
.wiki-dashboard-tree-children {
  padding-left: 20px;
}
.wiki-dashboard-tree-parent > .wiki-dashboard-tree-item {
  font-weight: 600;
}
/* 5-kolom stats grid */
.wiki-dashboard-stats-5 {
  grid-template-columns: repeat(5, 1fr);
}
.wiki-dashboard-stats-totals {
  grid-template-columns: repeat(2, 1fr);
  max-width: 300px;
}
/* Channel stats side by side */
.wiki-dashboard-channels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.wiki-dashboard-channel {
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 10px;
  padding: 12px;
}
.wiki-dashboard-channel-header {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid;
  display: flex;
  align-items: center;
  gap: 6px;
}
.wiki-dashboard-channel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.wiki-dashboard-channel-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.wiki-dashboard-channel-stat {
  text-align: center;
}
.wiki-dashboard-channel-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}
.wiki-dashboard-channel-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
/* Issue channel tabs */
.wiki-dashboard-issue-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
  background: var(--bg-gray-100, #f3f4f6);
  border-radius: 6px;
  padding: 2px;
  width: fit-content;
}
.wiki-issue-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 14px;
  border: none;
  background: transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}
.wiki-issue-tab.active {
  background: #fff;
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
/* AI model info */
.wiki-dashboard-ai-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 11px;
  color: var(--text-muted);
}
.wiki-dashboard-ai-info svg {
  flex-shrink: 0;
}
.wiki-dashboard-ai-info .ai-model-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-tertiary, #f3f4f6);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 10px;
}
.wiki-dashboard-ai-info .ai-tier-badge {
  padding: 1px 5px;
  border-radius: 3px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}
@media (max-width: 768px) {
  .wiki-dashboard { padding: 16px; }
  .wiki-dashboard-columns { grid-template-columns: 1fr; }
  .wiki-dashboard-stats { grid-template-columns: repeat(2, 1fr); }
  .wiki-dashboard-stats-5 { grid-template-columns: repeat(3, 1fr); }
  .wiki-dashboard-channels { grid-template-columns: 1fr; }
  .wiki-dashboard-stats-totals { max-width: 100%; }
  .wiki-dashboard-tree-progress { width: 40px; }
  .wiki-dashboard-tree-badge { display: none; }
}

/* Verified badge */
.wiki-ai-confidence.verified {
  background: #dbeafe;
  color: #1e40af;
  font-weight: 700;
}

/* Feedback / Improve button */
.wiki-ai-feedback {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--bg-gray-100);
}

.wiki-improve-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--bg-gray-200);
  border-radius: 6px;
  background: white;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.wiki-improve-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.wiki-improve-form {
  margin-top: 12px;
}

.wiki-improve-form textarea {
  width: 100%;
  border: 1px solid var(--bg-gray-200);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  outline: none;
  box-sizing: border-box;
}

.wiki-improve-form textarea:focus {
  border-color: var(--primary);
}

.wiki-improve-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.wiki-improve-save {
  padding: 8px 16px;
  background: #1e40af;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.wiki-improve-save:hover {
  background: #1e3a8a;
}

.wiki-improve-save:disabled {
  background: var(--bg-gray-200);
  color: var(--text-muted);
  cursor: not-allowed;
}

.wiki-improve-cancel {
  padding: 8px 16px;
  background: var(--bg-gray-100);
  color: var(--text-secondary);
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.wiki-improve-cancel:hover {
  background: var(--bg-gray-200);
}

/* 3-button validation */
.wiki-ai-validation-buttons {
  display: flex;
  gap: 8px;
}

.wiki-validate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1px solid var(--bg-gray-200);
  border-radius: 6px;
  background: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.wiki-validate-btn.correct {
  color: #166534;
}
.wiki-validate-btn.correct:hover {
  background: #dcfce7;
  border-color: #22c55e;
}

.wiki-validate-btn.improve {
  color: #1e40af;
}
.wiki-validate-btn.improve:hover {
  background: #dbeafe;
  border-color: #3b82f6;
}

.wiki-validate-btn.wrong {
  color: #991b1b;
}
.wiki-validate-btn.wrong:hover {
  background: #fecaca;
  border-color: #ef4444;
}

.wiki-validate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wiki-validation-status {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}
.wiki-validation-status.status-correct {
  background: #dcfce7;
  color: #166534;
}
.wiki-validation-status.status-improved {
  background: #dbeafe;
  color: #1e40af;
}
.wiki-validation-status.status-rejected {
  background: #fecaca;
  color: #991b1b;
}

/* Knowledge Base status dots */
.kb-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kb-dot-ai { background: #3b82f6; }
.kb-dot-verified { background: #22c55e; }
.kb-dot-enriched { background: #a855f7; }
.kb-dot-chat { background: #f97316; }

/* PDF + WhatsApp gebruiken SVG icoon i.p.v. gekleurde dot — width auto en
   transparent zodat het icoon zelf de visuele aanwezigheid is */
.kb-dot-pdf,
.kb-dot-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  background: transparent;
  border-radius: 0;
  color: #64748b;
}
.kb-dot-pdf svg,
.kb-dot-whatsapp svg {
  display: block;
}
.kb-dot-pdf { color: #ef4444; }       /* rood voor PDF */
.kb-dot-whatsapp { color: #10b981; }  /* groen voor chat — past bij WhatsApp/Chats */

/* Dashboard legend */
.wiki-dashboard-legend {
  display: flex;
  gap: 16px;
  padding: 8px 0 4px;
  flex-wrap: wrap;
}
.wiki-dashboard-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Wiki mobile */
@media (max-width: 768px) {
  .wiki-panel {
    flex-direction: column;
  }

  .wiki-panel-sidebar {
    width: 100%;
    max-height: none;
    height: 100%;
    overflow-y: auto;
  }

  .wiki-page-view {
    padding: 16px;
  }

  #wiki-page-title {
    font-size: 20px;
  }
}

/* ==================== AUTO-REPLY PANEL ==================== */

.ar-panel {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.ar-panel.hidden {
  display: none;
}

/* Sidebar */
.ar-panel-sidebar {
  width: 340px;
  background: var(--bg-white);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ar-sidebar-header {
  padding: 20px 16px 12px;
  border-bottom: 1px solid var(--border-color);
}

.ar-sidebar-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* Mode tabs */
.ar-mode-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-gray-100);
  border-radius: 8px;
  padding: 3px;
}

.ar-mode-tab {
  flex: 1;
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.ar-mode-tab.active {
  background: white;
  color: #25D366;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ar-callback-badge {
  display: inline-block;
  min-width: 16px;
  padding: 1px 5px;
  margin-left: 4px;
  border-radius: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}
.ar-callback-badge.hidden { display: none; }

.ar-callback-filter {
  padding: 4px 10px;
  border: 1px solid var(--border-color);
  background: white;
  border-radius: 14px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.ar-callback-filter.active {
  background: #f59e0b;
  color: white;
  border-color: #f59e0b;
}
.ar-callback-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.15s;
}
.ar-callback-item:hover { background: var(--bg-gray-100); }
.ar-callback-item .ar-cb-head {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; font-size: 13px; color: var(--text-primary);
}
.ar-callback-item .ar-cb-type {
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
  background: #f59e0b; color: white; text-transform: uppercase;
}
.ar-callback-item .ar-cb-type.callback { background: #3b82f6; }
.ar-callback-item .ar-cb-type.escape_word { background: #ef4444; }
.ar-callback-item .ar-cb-note { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.ar-callback-item .ar-cb-meta { font-size: 11px; color: var(--text-muted); margin-top: 6px; display: flex; justify-content: space-between; }
.ar-callback-item .ar-cb-actions { margin-top: 8px; display: flex; gap: 6px; }
.ar-callback-item.handled { opacity: 0.55; }
.ar-callback-item.handled .ar-cb-actions { display: none; }

.ar-mode-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
}

/* Filters */
.ar-filters {
  display: flex;
  gap: 4px;
  padding: 12px 16px 8px;
  flex-wrap: wrap;
}

.ar-filter {
  padding: 4px 10px;
  border: 1px solid var(--border-color);
  background: white;
  border-radius: 14px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.ar-filter.active {
  background: #25D366;
  color: white;
  border-color: #25D366;
}

.ar-filter:hover:not(.active) {
  background: var(--bg-gray-100);
}

/* Log list in sidebar */
.ar-log-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.ar-log-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.ar-log-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--bg-gray-100);
  transition: background 0.15s;
}

.ar-log-item:hover {
  background: var(--bg-gray-100);
}

.ar-log-item.active {
  background: rgba(37, 211, 102, 0.08);
  border-left: 3px solid #25D366;
  padding-left: 13px;
}

.ar-log-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

.ar-log-icon.sent { background: #e8f5e9; }
.ar-log-icon.cancelled { background: #fff3e0; }
.ar-log-icon.error { background: #ffebee; }
.ar-log-icon.pending { background: #e3f2fd; }
.ar-log-icon.classified { background: #f3e5f5; }
.ar-log-icon.scheduled { background: #e8f5e9; }
.ar-log-icon.general { background: #f5f5f5; }

.ar-log-info {
  flex: 1;
  min-width: 0;
}

.ar-log-text {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.ar-log-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-secondary);
  flex-wrap: wrap; /* voorkomt overflow op smalle schermen */
  row-gap: 4px;
}
/* Mobile: log-items krijgen meer ademruimte + tekst mag 2 regels */
@media (max-width: 768px) {
  .ar-log-item {
    padding: 12px 14px;
    gap: 11px;
  }
  .ar-log-text {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
  }
  .ar-log-icon { width: 30px; height: 30px; }
}

.ar-log-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.ar-log-badge.sent { background: #e8f5e9; color: #2e7d32; }
.ar-log-badge.cancelled { background: #fff3e0; color: #e65100; }
.ar-log-badge.error { background: #ffebee; color: #c62828; }
.ar-log-badge.pending { background: #e3f2fd; color: #1565c0; }
.ar-log-badge.scheduled { background: #e8f5e9; color: #2e7d32; }
.ar-log-badge.classified { background: #f3e5f5; color: #7b1fa2; }
.ar-log-badge.general { background: #f5f5f5; color: #757575; }

/* Settings form in sidebar */
.ar-settings-form {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ar-setting-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ar-setting-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.ar-setting-group small {
  font-size: 11px;
  color: var(--text-secondary);
}

.ar-setting-group input[type="number"],
.ar-setting-group textarea {
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}

.ar-setting-group textarea {
  resize: vertical;
}

/* Toggle switch */
.ar-toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
}

.ar-toggle-label span:first-child {
  font-size: 13px;
  font-weight: 600;
}

.ar-toggle {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.ar-toggle-slider {
  width: 40px;
  height: 22px;
  background: #ccc;
  border-radius: 11px;
  position: relative;
  transition: background 0.3s;
  flex-shrink: 0;
}

.ar-toggle-slider::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.ar-toggle:checked + .ar-toggle-slider {
  background: #25D366;
}

.ar-toggle:checked + .ar-toggle-slider::after {
  transform: translateX(18px);
}

.ar-setting-actions {
  padding-top: 4px;
}

/* Buttons */
.ar-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.ar-btn-primary {
  background: #25D366;
  color: white;
  width: 100%;
}

.ar-btn-primary:hover {
  background: #1da851;
}

.ar-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 12px;
}

.ar-btn-ghost:hover {
  background: var(--bg-gray-100);
  color: var(--text-primary);
}

/* Content area */
.ar-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: #f8f9fa;
}

/* Dashboard */
.ar-dashboard {
  padding: 24px;
  max-width: 900px;
}

.ar-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.ar-dash-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.ar-dash-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.ar-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccc;
}

.ar-status-dot.on {
  background: #25D366;
  box-shadow: 0 0 6px rgba(37, 211, 102, 0.4);
  animation: ar-pulse 2s infinite;
}

.ar-status-dot.off {
  background: #ccc;
}

@keyframes ar-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Stats grid */
.ar-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.ar-stats-grid-secondary {
  margin-bottom: 24px;
}

.ar-stat-card {
  background: white;
  border-radius: 10px;
  padding: 16px;
  border: 1px solid var(--border-color);
  text-align: center;
}

/* Doorklikbare dashboard-tegels → Logboek met filter */
.ar-stat-clickable { cursor: pointer; }
.ar-stat-clickable:hover {
  border-color: #cbd5e1 !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08) !important;
  transform: translateY(-1px);
}

.ar-stat-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.ar-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

.ar-stat-sent .ar-stat-number { color: #2e7d32; }
.ar-stat-cancelled .ar-stat-number { color: #e65100; }
.ar-stat-error .ar-stat-number { color: #c62828; }
.ar-stat-content .ar-stat-number { color: #1565c0; }
.ar-stat-urgent .ar-stat-number { color: #d32f2f; }
.ar-stat-general .ar-stat-number { color: #757575; }
.ar-stat-pending .ar-stat-number { color: #1565c0; }

/* Recent activity list */
.ar-recent-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.ar-recent-list {
  background: white;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.ar-recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bg-gray-100);
  cursor: pointer;
  transition: background 0.15s;
}

.ar-recent-item:last-child {
  border-bottom: none;
}

.ar-recent-item:hover {
  background: var(--bg-gray-100);
}

.ar-recent-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.ar-recent-info {
  flex: 1;
  min-width: 0;
}

.ar-recent-text {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ar-recent-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.ar-recent-status {
  flex-shrink: 0;
}

/* Detail view */
.ar-detail {
  padding: 24px;
}

.ar-detail.hidden {
  display: none;
}

.ar-detail-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

.ar-detail-col-left,
.ar-detail-col-right {
  min-width: 0;
}

.ar-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.ar-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.ar-badge.sent { background: #e8f5e9; color: #2e7d32; }
.ar-badge.cancelled { background: #fff3e0; color: #e65100; }
.ar-badge.error { background: #ffebee; color: #c62828; }
.ar-badge.pending { background: #e3f2fd; color: #1565c0; }
.ar-badge.scheduled { background: #e8f5e9; color: #2e7d32; }

.ar-detail-section {
  margin-bottom: 20px;
}

.ar-detail-section h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.ar-detail-bubble {
  background: white;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid var(--border-color);
  white-space: pre-wrap;
  word-break: break-word;
}

.ar-detail-incoming {
  border-left: 3px solid #e0e0e0;
}

.ar-detail-reply {
  border-left: 3px solid #25D366;
  background: #f0faf4;
}

.ar-detail-meta {
  background: white;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
  overflow: hidden;
}

.ar-detail-meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--bg-gray-100);
}

.ar-detail-meta-item:last-child {
  border-bottom: none;
}

.ar-meta-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.ar-meta-value {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

.ar-detail-sources {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ar-source-item {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ar-source-clickable {
  cursor: pointer;
  transition: all 0.15s;
}

.ar-source-clickable:hover {
  border-color: var(--primary);
  background: var(--bg-gray-50);
}

.ar-source-arrow {
  margin-left: auto;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ar-source-clickable:hover .ar-source-arrow {
  color: var(--primary);
}

.ar-source-score {
  background: var(--bg-gray-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
}

/* === Feedback Stats Bar === */
.ar-feedback-stats-bar {
  margin-bottom: 16px;
}

.ar-feedback-stats-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-gray-50);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 13px;
}

.ar-feedback-counts {
  margin-left: auto;
  display: flex;
  gap: 14px;
  font-size: 13px;
  font-weight: 500;
}

.ar-feedback-counts i {
  margin-right: 3px;
}

/* === AI Processing Steps === */
.ar-ai-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ar-ai-step {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  padding: 8px 0;
}

.ar-ai-step-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.ar-ai-step-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.ar-ai-step-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.ar-ai-step-detail {
  font-size: 12px;
  color: var(--text-secondary);
}

.ar-ai-step-line {
  position: absolute;
  left: 16px;
  top: 42px;
  width: 2px;
  height: 16px;
  background: var(--border-color);
}

/* === Feedback Section === */
.ar-feedback-buttons {
  display: flex;
  gap: 10px;
}

.ar-feedback-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.ar-feedback-btn.good:hover {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #16a34a;
}

.ar-feedback-btn.bad:hover {
  background: #fef2f2;
  border-color: #ef4444;
  color: #dc2626;
}

.ar-feedback-status {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ar-feedback-status i {
  margin-right: 4px;
}

.ar-feedback-improved-preview {
  margin-top: 6px;
  padding: 10px 14px;
  background: var(--bg-gray-50);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-primary);
  border-left: 3px solid #22c55e;
}

.ar-feedback-improve {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ar-feedback-improve label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.ar-feedback-improve textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  line-height: 1.5;
  box-sizing: border-box;
}

.ar-feedback-improve textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ar-feedback-actions {
  display: flex;
  gap: 8px;
}

/* === AR Channel Tabs === */
.ar-channel-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-gray-100);
  padding: 4px;
  border-radius: 8px;
  margin: 8px 16px 4px;
}

.ar-channel-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.ar-channel-tab:hover {
  color: var(--text-primary);
}

.ar-channel-tab.active {
  background: var(--bg-white);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* === Flow List (sidebar) === */
.ar-flows-header {
  padding: 12px 16px 8px;
}

.ar-btn-block {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ar-flow-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px;
}

.ar-flow-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 2px;
}

.ar-flow-item:hover {
  background: var(--bg-gray-100);
}

.ar-flow-item-info {
  flex: 1;
  min-width: 0;
}

.ar-flow-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ar-flow-item-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.ar-flow-item-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.ar-flow-item-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ar-flow-item-toggle .ar-toggle-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 20px;
  cursor: pointer;
  transition: 0.2s;
}

.ar-flow-item-toggle .ar-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}

.ar-flow-item-toggle .ar-toggle-slider::after {
  display: none;
}

.ar-flow-item-toggle input:checked + .ar-toggle-slider {
  background: #25D366;
}

.ar-flow-item-toggle input:checked + .ar-toggle-slider::before {
  transform: translateX(16px);
}

.ar-flow-item-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.ar-flow-item:hover .ar-flow-item-actions {
  opacity: 1;
}

.ar-flow-item-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 14px;
}

.ar-flow-item-btn:hover {
  background: var(--bg-gray-100);
  color: var(--text-primary);
}

.ar-flow-item-btn.delete:hover {
  color: #F44336;
}

/* === Flow Editor === */
.ar-flow-editor {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  position: relative; /* offset-parent voor de node-config popover */
}

.ar-flow-editor.hidden {
  display: none;
}

/* Auto-antwoorden mag de volle schermbreedte gebruiken — geen 1600px cap zoals Kennisbank. */
#auto-reply-panel .kbv2-inner {
  max-width: none;
}

/* ============================================================
   VRAAG STELLEN v2 — Kennisbank-stijl header + horizontale tabbar
   FULL-WIDTH boven beide kolommen (sidebar + chat).
   ============================================================ */

/* Default verbergen — alleen in ask-mode tonen. */
#vraag-v2-header,
#vraag-v2-tabbar { display: none; }

/* Header-styling */
#wiki-panel .vraag-v2-header {
  /* Padding-left = 16px om uit te lijnen met sidebar-cards + tabbar (allen 16px).
     Rechts mag royaler want geen uitlijnings-aanknooppunt. */
  padding: 24px 32px 8px 16px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  grid-area: vraag-header;
}
@media (min-width: 1280px) {
  #wiki-panel .vraag-v2-header { padding: 28px 40px 8px 16px; }
}
@media (max-width: 1024px) {
  #wiki-panel .vraag-v2-header { padding: 20px 24px 8px 12px; }
}
#wiki-panel .vraag-v2-h1 {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}
#wiki-panel .vraag-v2-sub {
  font-size: 14px;
  color: #64748b;
  margin: 4px 0 0;
}
#wiki-panel .vraag-v2-tabbar {
  display: flex;
  align-items: center;
  gap: 4px;
  /* Links-margin 16px → uitgelijnd met header h1 + sidebar-cards. Rechts royaler. */
  margin: 16px 32px 24px 16px;
  padding: 4px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  overflow-x: auto;
  grid-area: vraag-tabbar;
}
@media (min-width: 1280px) {
  #wiki-panel .vraag-v2-tabbar { margin: 16px 40px 24px 16px; }
}
@media (max-width: 1024px) {
  #wiki-panel .vraag-v2-tabbar { margin: 12px 24px 16px 12px; }
}

/* In ask-mode: grid-layout zodat header + tabbar full-width boven beide kolommen staan.
   .wiki-panel had default flex; in ask-mode wordt het een 2-koloms grid met 4 rijen.
   :not(.hidden) zodat de hidden-class voorrang behoudt bij view-switch. */
.wiki-panel.ask-mode:not(.hidden) {
  display: grid !important;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  /* minmax(0,1fr) i.p.v. 1fr: een kale '1fr' is 'minmax(auto,1fr)' en de
     auto-minimum = max-content, waardoor de rij meegroeit met de volledige
     lijst (6000px+) en de interne overflow-y:auto nooit triggert. minmax(0,1fr)
     laat de rij krimpen tot de beschikbare hoogte → sidebar/list scrollen weer. */
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas:
    "vraag-header  vraag-header"
    "vraag-tabbar  vraag-tabbar"
    "vraag-sidebar vraag-chat";
  overflow: hidden;
  /* Doorlopende slate-50 achtergrond over de volle breedte — exact dezelfde
     kleur als Kennisbank's .kbv2-panel (#f8fafc). */
  background: #f8fafc !important;
}
/* Zorg dat hidden NOOIT door grid-display wordt overruled — voorkomt dat het
   wiki-panel zichtbaar blijft bij switch naar Secure Share / Auto-antwoorden / etc. */
.wiki-panel.hidden { display: none !important; }

.wiki-panel.ask-mode:not(.hidden) #vraag-v2-header,
.wiki-panel.ask-mode:not(.hidden) #vraag-v2-tabbar { display: flex; }
.wiki-panel.ask-mode:not(.hidden) #vraag-v2-header { display: block; }
.wiki-panel.ask-mode:not(.hidden) .wiki-panel-sidebar {
  grid-area: vraag-sidebar;
  min-height: 0;
  overflow-y: auto;
  background: transparent !important;
}
/* HARDE FIX voor doorlopende slate-50 over volle breedte:
   Force #f8fafc op het wiki-panel zelf (ID-selector = hoge specificity) EN op alle
   direct children, behalve de tabbar pill (die moet wit blijven met border). */
#wiki-panel.wiki-panel.ask-mode:not(.hidden) {
  background: #f8fafc !important;
  background-color: #f8fafc !important;
}
/* Linker vraag-kolom: compacte padding — dicht tegen de app-sidebar voor een
   "natuurlijkere" visuele verbinding. Padding-top = 0, eerste-child margin reset.
   align-self MOET stretch zijn: met 'start' rekt dit grid-item niet mee met de
   591px-rij maar wordt het content-hoogte (6000px+) → overflow-y:auto triggert
   nooit en de lijst is niet scrollbaar. stretch klemt 'm op de track-hoogte. */
.wiki-panel.ask-mode:not(.hidden) .wiki-panel-sidebar {
  padding-left: 16px;
  padding-right: 8px;
  padding-top: 0 !important;
  margin-top: 0 !important;
  align-self: stretch !important;
}
.wiki-panel.ask-mode:not(.hidden) .wiki-panel-sidebar > *:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
/* Forceer eventuele wiki-sidebar-header (binnen .wiki-panel-sidebar) padding-top weg
   zodat de zoekbalk direct onder de tabbar zit. */
.wiki-panel.ask-mode:not(.hidden) .wiki-sidebar-header,
.wiki-panel.ask-mode:not(.hidden) .vraag-mijn-search,
.wiki-panel.ask-mode:not(.hidden) .vraag-mijn-filters {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
@media (max-width: 1024px) {
  .wiki-panel.ask-mode:not(.hidden) .wiki-panel-sidebar {
    padding-left: 12px;
    padding-right: 6px;
  }
}

/* Chat-content: breed, links uitgelijnd (geen centering). De bubbles gebruiken
   de hele beschikbare ruimte tot een redelijke max — niet gecentreerd zodat het
   geheel niet "weeskind" aandoet maar natuurlijk links-uitgelijnd.
   padding-top zorgt dat de eerste user-bubble + AI-antwoord op gelijke Y staan
   met de eerste vraag-card in de sidebar (= visueel aligned). */
.wiki-panel.ask-mode:not(.hidden) #wiki-sim-chat,
.wiki-panel.ask-mode:not(.hidden) .wiki-sim-chat {
  max-width: none !important;
  width: 100%;
  align-self: stretch !important;
  padding-left: 24px;
  padding-right: 32px;
  padding-top: 12px;
  box-sizing: border-box;
}
.wiki-panel.ask-mode:not(.hidden) .wiki-sim-input-area,
.wiki-panel.ask-mode:not(.hidden) .wiki-sim-input-stack {
  max-width: none !important;
  width: 100%;
  align-self: stretch !important;
  padding-left: 24px;
  padding-right: 32px;
  box-sizing: border-box;
}

/* Verberg de eerste "Vandaag"-group-header in ask-mode zodat de eerste vraag-card
   direct onder de filter-pills komt — op gelijke Y-hoogte als de eerste AI-bubble
   in de chat-kolom. Andere group-headers (Gisteren / Deze week / Ouder) blijven.
   Triple-coverage selector: alle paden waar VANDAAG kan worden gerenderd. */
.wiki-panel.ask-mode:not(.hidden) .vraag-mijn-list > .vraag-side-group-h:first-child,
.wiki-panel.ask-mode:not(.hidden) .vraag-side-group-h:first-child,
.wiki-panel.ask-mode:not(.hidden) #vraag-mijn-list > .vraag-side-group-h:nth-of-type(1) {
  display: none !important;
}

/* AI-antwoord als nette kaart — force witte background + border + rounded corners +
   royale padding binnen Vraag-stellen v2 (overschrijft eventueel transparente regels). */
.wiki-panel.ask-mode:not(.hidden) .wiki-sim-bubble-wrap.ai {
  background: transparent !important;
  background-color: transparent !important;
}
.wiki-panel.ask-mode:not(.hidden) .wiki-sim-bubble.ai {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  padding: 20px 24px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
  /* Geen rigide max-width — bubble vult de beschikbare chat-kolom op zodat hij
     niet als smal blok in een te brede kolom hangt. */
  max-width: none !important;
  width: 100%;
}
/* Modifiers behouden hun gekleurde tint maar mét forced border + radius + padding. */
.wiki-panel.ask-mode:not(.hidden) .wiki-sim-bubble.ai.is-question {
  background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%) !important;
  border-color: rgba(168, 85, 247, 0.20) !important;
}
.wiki-panel.ask-mode:not(.hidden) .wiki-sim-bubble.ai.is-no-answer {
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%) !important;
  border-color: rgba(245, 158, 11, 0.20) !important;
}
.wiki-panel.ask-mode:not(.hidden) > div,
.wiki-panel.ask-mode:not(.hidden) > section,
.wiki-panel.ask-mode:not(.hidden) > header,
.wiki-panel.ask-mode:not(.hidden) .wiki-panel-sidebar,
.wiki-panel.ask-mode:not(.hidden) .wiki-content-area,
.wiki-panel.ask-mode:not(.hidden) .wiki-panel-content {
  background: #f8fafc !important;
  background-color: #f8fafc !important;
}
/* Uitzondering: tabbar pill houdt witte achtergrond (border + shadow design). */
.wiki-panel.ask-mode:not(.hidden) > #vraag-v2-tabbar {
  background: #ffffff !important;
  background-color: #ffffff !important;
}

.wiki-panel.ask-mode:not(.hidden) #wiki-sim-panel {
  grid-area: vraag-chat;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #f8fafc !important;
}
/* Force-transparent op alle bekende child-containers; chat-bubbles + input-veld
   houden hun eigen kleur (die we hier expliciet uitzonderen via specifieke selectors
   elders). */
.wiki-panel.ask-mode:not(.hidden) #wiki-sim-panel > *,
.wiki-panel.ask-mode:not(.hidden) #wiki-sim-chat,
.wiki-panel.ask-mode:not(.hidden) .wiki-sim-chat,
.wiki-panel.ask-mode:not(.hidden) .wiki-sim-empty,
.wiki-panel.ask-mode:not(.hidden) .wiki-sim-panel-header,
.wiki-panel.ask-mode:not(.hidden) .wiki-sim-input-area,
.wiki-panel.ask-mode:not(.hidden) .wiki-sim-input-stack,
.wiki-panel.ask-mode:not(.hidden) .vraag-faq-panel,
.wiki-panel.ask-mode:not(.hidden) .vraag-mijn-panel,
.wiki-panel.ask-mode:not(.hidden) .vraag-settings-panel {
  background: transparent !important;
  background-color: transparent !important;
}

/* Verberg oude tab-row + dubbele titel + back-knop binnen ask-mode. */
.wiki-panel.ask-mode .vraag-tabbar-row { display: none !important; }
.wiki-panel.ask-mode #wiki-sim-panel .wiki-sim-title { display: none !important; }
.wiki-panel.ask-mode #wiki-sim-panel .wiki-sim-back-btn { display: none !important; }
.wiki-panel.ask-mode #wiki-sim-panel #wiki-sim-clear { display: none !important; }

/* Op mobile: 1-kolom stack. Specificity matched aan desktop-regel
   (#wiki-panel.wiki-panel.ask-mode:not(.hidden)) zodat deze regel wint. */
@media (max-width: 768px) {
  #wiki-panel.wiki-panel.ask-mode:not(.hidden) {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "vraag-header"
      "vraag-tabbar"
      "vraag-sidebar"
      "vraag-chat" !important;
    grid-template-rows: auto auto auto 1fr !important;
  }
  /* grid-template-areas !important verplaatst — `!important` valt op laatste regel
     in deze multi-line value, dat is geldig syntax. */
  #wiki-panel .vraag-v2-header { padding: 14px 16px 4px; }
  #wiki-panel .vraag-v2-h1 { font-size: 20px; }
  #wiki-panel .vraag-v2-sub { font-size: 12px; }
  #wiki-panel .vraag-v2-tabbar { margin: 10px 16px; max-width: calc(100% - 32px); }
  /* Op mobile: chat-content kleine padding, geen 24/32 zoals desktop. */
  .wiki-panel.ask-mode:not(.hidden) #wiki-sim-chat,
  .wiki-panel.ask-mode:not(.hidden) .wiki-sim-chat,
  .wiki-panel.ask-mode:not(.hidden) .wiki-sim-input-area,
  .wiki-panel.ask-mode:not(.hidden) .wiki-sim-input-stack {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

/* ============================================================
   AUTO-ANTWOORDEN — 2-koloms lay-out (Vraag-stellen-stijl)
   Voor Logboek / Terugbel / Flows: lijst links, detail rechts.
   ============================================================ */
#auto-reply-panel .ar-2col {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 16px;
  height: calc(100vh - 260px);
  min-height: 540px;
}

/* Flows: lijst-kolom smaller dan log/terugbel — flow-kaartjes zijn smal,
   de canvas verdient de ruimte. */
#auto-reply-panel #ar-flows-2col {
  grid-template-columns: 260px minmax(0, 1fr);
}

#auto-reply-panel .ar-list-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: transparent;
}

#auto-reply-panel .ar-list-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  margin-bottom: 10px;
}
#auto-reply-panel .ar-list-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
  background: transparent;
  color: #0f172a;
  font-family: inherit;
}

#auto-reply-panel .ar-list-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

#auto-reply-panel .ar-list-items {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}
#auto-reply-panel .ar-list-items::-webkit-scrollbar { width: 6px; }
#auto-reply-panel .ar-list-items::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

#auto-reply-panel .ar-list-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-size: 13px;
}
#auto-reply-panel .ar-list-item:hover {
  background: #f8fafc;
}
#auto-reply-panel .ar-list-item.active {
  background: #f0f9ff;
  border-left-color: #0ea5e9;
  box-shadow: inset 0 0 0 1px rgba(14,165,233,0.25);
}
#auto-reply-panel .ar-list-item.status-sent { border-left-color: #22c55e; }
#auto-reply-panel .ar-list-item.status-error { border-left-color: #ef4444; }
#auto-reply-panel .ar-list-item.status-cancelled { border-left-color: #f59e0b; }

#auto-reply-panel .ar-list-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
#auto-reply-panel .ar-list-item-title {
  font-weight: 600;
  color: #0f172a;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#auto-reply-panel .ar-list-item-time {
  font-size: 11px;
  color: #94a3b8;
  flex-shrink: 0;
}
#auto-reply-panel .ar-list-item-preview {
  font-size: 12px;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
#auto-reply-panel .ar-list-item-meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 6px;
  display: flex;
  gap: 6px;
  align-items: center;
}
#auto-reply-panel .ar-list-item-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #475569;
  font-weight: 600;
  text-transform: uppercase;
}
#auto-reply-panel .ar-list-item-confidence {
  height: 3px;
  background: #f1f5f9;
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
#auto-reply-panel .ar-list-item-confidence-bar {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #f97316);
  border-radius: 2px;
}

#auto-reply-panel .ar-detail-col {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 22px 24px;
  overflow-y: auto;
  min-height: 0;
}
#auto-reply-panel .ar-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  gap: 8px;
  text-align: center;
}
#auto-reply-panel .ar-detail-empty svg { opacity: 0.4; }

/* Mobile: 1-koloms stack, detail-col verbergt zich tot een item is gekozen.
   Bij actief item krijgt de wrapper class 'ar-2col-detail-mode' → lijst verbergt
   en de detail-col toont met een back-knop. */
@media (max-width: 900px) {
  #auto-reply-panel .ar-2col {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
  }
  #auto-reply-panel .ar-2col.ar-2col-detail-mode .ar-list-col { display: none; }
  #auto-reply-panel .ar-2col:not(.ar-2col-detail-mode) .ar-detail-col { display: none; }
  #auto-reply-panel .ar-detail-back-mobile { display: inline-flex !important; }
}
#auto-reply-panel .ar-detail-back-mobile {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  background: white;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  margin-bottom: 12px;
  color: #475569;
}

/* In de nieuwe Kennisbank-stijl tab-panel context heeft .ar-flow-editor geen
   flex-parent, dus expliciete hoogte zodat het canvas zichtbaar is. */
#auto-reply-panel [data-ar-tab-panel="flows"] .ar-flow-editor:not(.hidden) {
  display: flex;
  height: calc(100vh - 260px);
  min-height: 520px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: white;
  overflow: hidden;
}
#auto-reply-panel [data-ar-tab-panel="flows"] .ar-flow-workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  position: relative;
}
#auto-reply-panel [data-ar-tab-panel="flows"] .ar-drawflow-canvas {
  flex: 1 1 auto;
  min-height: 100%;
  position: relative;
  overflow: hidden;
}

.ar-flow-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-white);
}

.ar-flow-name-input {
  flex: 1;
  border: 1px solid transparent;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 6px;
  outline: none;
}

.ar-flow-name-input:hover,
.ar-flow-name-input:focus {
  border-color: var(--border-color);
  background: var(--bg-gray-100);
}

.ar-flow-toolbar-actions {
  display: flex;
  gap: 8px;
}

.ar-flow-workspace {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Drawflow canvas */
.ar-drawflow-canvas {
  flex: 1;
  background: #f8f9fa;
  background-image: radial-gradient(circle, #ddd 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Override Drawflow default styles */
.ar-drawflow-canvas .drawflow .drawflow-node {
  border-radius: 10px;
  border: 2px solid #ddd;
  background: white;
  min-width: 220px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 0;
  overflow: visible;
  box-sizing: border-box;
}

.ar-drawflow-canvas .drawflow .drawflow-node[data-type="classificeer"],
.ar-drawflow-canvas .drawflow .drawflow-node[data-type="wiki_antwoord"],
.ar-drawflow-canvas .drawflow .drawflow-node[data-type="conditie"] {
  min-width: 340px;
}

.ar-drawflow-canvas .drawflow .drawflow-node.selected {
  background: white;
  border-color: #25D366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2);
}

.ar-drawflow-canvas .drawflow .drawflow-node .drawflow_content_node {
  padding: 0;
}

.ar-drawflow-canvas .drawflow .drawflow-node .inputs {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: -7px;
}

.ar-drawflow-canvas .drawflow .drawflow-node .outputs {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: -7px;
}

.ar-drawflow-canvas .drawflow .drawflow-node .input,
.ar-drawflow-canvas .drawflow .drawflow-node .output {
  width: 14px;
  height: 14px;
  border: 2px solid #999;
  background: white;
  left: 0;
  right: auto;
  position: relative;
}

.ar-drawflow-canvas .drawflow .connection .main-path {
  stroke: #999;
  stroke-width: 2px;
}

.ar-drawflow-canvas .drawflow .connection .main-path.selected {
  stroke: #25D366;
}

/* Node content inside Drawflow */
.df-node-content {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: grab;
  user-select: none;
}

.df-node-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #64748b;
}

.df-node-body {
  flex: 1;
  min-width: 0;
}

.df-node-label {
  display: block;
  white-space: nowrap;
}

/* Node description below label */
.df-node-desc {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: #94a3b8;
  line-height: 1.35;
  margin-top: 3px;
  white-space: normal;
}

/* Output labels — inside tile, right side, aligned with output circles */
.df-output-labels {
  position: absolute;
  right: 8px;
  top: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  pointer-events: none;
}

.df-output-label {
  font-size: 9px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
  line-height: 1.4;
}

/* Config balloon below node */
.df-config-balloon {
  position: absolute;
  left: 4px;
  right: 4px;
  top: calc(100% + 6px);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 10px;
  color: #64748b;
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  pointer-events: none;
  z-index: 1;
}

.df-config-balloon::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 16px;
  width: 8px;
  height: 8px;
  background: #f8fafc;
  border-left: 1px solid #e2e8f0;
  border-top: 1px solid #e2e8f0;
  transform: rotate(45deg);
}

.df-config-balloon strong {
  color: #475569;
  font-weight: 600;
}

/* Node type colors — border-left only */
.drawflow-node[data-type="trigger"] { border-left: 4px solid #22c55e; }
.drawflow-node[data-type="detecteer_taal"] { border-left: 4px solid #10b981; }
.drawflow-node[data-type="classificeer"] { border-left: 4px solid #f59e0b; }
.drawflow-node[data-type="conditie"] { border-left: 4px solid #3b82f6; }
.drawflow-node[data-type="wiki_antwoord"] { border-left: 4px solid #8b5cf6; }
.drawflow-node[data-type="vertraging"] { border-left: 4px solid #64748b; }
.drawflow-node[data-type="verstuur_bericht"] { border-left: 4px solid #0ea5e9; }
.drawflow-node[data-type="notificeer_team"] { border-left: 4px solid #ef4444; }

/* === Node Palette === */
.ar-node-palette {
  width: 180px;
  background: var(--bg-white);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.ar-palette-title {
  padding: 12px 14px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ar-palette-nodes {
  padding: 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ar-palette-node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: grab;
  border: 2px solid transparent;
  border-left: 3px solid var(--node-color, #ccc);
  background: var(--bg-gray-100);
  transition: all 0.15s;
  user-select: none;
}

.ar-palette-node:hover {
  background: white;
  border-color: var(--node-color, #ccc);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.ar-palette-node:active {
  cursor: grabbing;
  transform: scale(0.96);
}

.ar-palette-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #64748b;
  flex-shrink: 0;
  width: 20px;
}

.ar-palette-label {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === Node Config Popover === (zweeft naast de aangeklikte node) */
.ar-node-config {
  position: absolute;
  left: 0;
  top: 0;
  width: 400px;
  max-height: calc(100% - 24px);
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.20);
  z-index: 20;
  overflow: hidden;
  animation: np-pop 0.12s ease-out;
}
@keyframes np-pop {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* Config-paneel is een absolute overlay (z-index:10) — workspace NIET inkrimpen.
   Eerder schoof margin-right:380px de canvas weg op het moment dat drawflow bij
   mousedown 'nodeSelected' vuurt + drag=true zet → node sprong weg, drag onbruikbaar.
   Overlay laten staan houdt de canvas-coördinaten stabiel tijdens het slepen. */
.ar-flow-editor.cfg-open .ar-flow-workspace {
  margin-right: 0;
}

.ar-node-config.hidden {
  display: none;
}

.ar-node-config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}

.ar-node-config-header h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.ar-node-config-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.ar-node-config-body .ar-setting-group {
  margin-bottom: 14px;
}

.ar-node-config-body label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.ar-node-config-body input,
.ar-node-config-body select,
.ar-node-config-body textarea {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg-gray-100);
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
}

.ar-node-config-body input:focus,
.ar-node-config-body select:focus,
.ar-node-config-body textarea:focus {
  border-color: #25D366;
  background: white;
}

.ar-node-config-body small {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.ar-node-config-body .ar-config-hint {
  background: #f0f7ff;
  border: 1px solid #c8e1ff;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
  color: #555;
  margin-bottom: 14px;
}

/* Variabele-chips (klik = invoegen) */
.ar-var-chips {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 16px;
}
.ar-var-chips-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.ar-var-chips-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ar-var-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.ar-var-desc {
  flex: 1;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-secondary);
  padding-top: 3px;
}
/* Instructieblok bovenaan de node-config: wat doet deze node. */
.ar-node-help {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 9px 11px;
  margin-bottom: 14px;
}
.ar-node-help strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 3px;
}
.ar-node-help span {
  display: block;
  font-size: 11px;
  line-height: 1.4;
  color: #475569;
}
.ar-var-chip {
  flex-shrink: 0;
  min-width: 128px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.12s ease;
}
.ar-var-chip code {
  font-size: 11px;
  color: #0ea5e9;
  background: #eff6ff;
  padding: 1px 4px;
  border-radius: 4px;
}
.ar-var-chip:hover {
  border-color: #0ea5e9;
  background: #f0f9ff;
}

/* Live preview-bubble onder bericht-template */
.ar-tpl-preview {
  margin-top: 8px;
}
.ar-tpl-preview-cap {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.ar-tpl-bubble {
  background: #dcf8c6;
  border-radius: 8px 8px 8px 2px;
  padding: 8px 11px;
  font-size: 13px;
  line-height: 1.45;
  color: #111;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 1px rgba(0,0,0,0.08);
}
.ar-prev-var {
  background: rgba(14,165,233,0.14);
  border-radius: 3px;
  padding: 0 2px;
}

/* Gestructureerde per-taal editor */
.ar-tr-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ar-tr-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 6px;
  align-items: start;
}
.ar-tr-lang {
  font-size: 12px !important;
  padding: 6px 4px !important;
}
.ar-tr-text {
  resize: vertical;
}
.ar-tr-del {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: white;
  color: #94a3b8;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transition: all 0.12s ease;
}
.ar-tr-del:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: #fef2f2;
}
.ar-tr-add {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: white;
  border: 1px dashed var(--border-color);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s ease;
}
.ar-tr-add:hover {
  border-color: #0ea5e9;
  color: #0ea5e9;
  border-style: solid;
}
.ar-tr-hint {
  margin-top: 8px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .ar-panel {
    flex-direction: column;
  }
  .ar-panel-sidebar {
    width: 100%;
    max-height: 40vh;
  }
  .ar-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  /* Flow-editor mobiel: canvas boven, palette als horizontale tik-strip eronder */
  .ar-flow-workspace {
    flex-direction: column;
  }
  .ar-node-palette {
    width: 100%;
    flex-direction: column;
    border-left: none;
    border-top: 1px solid var(--border-color);
    max-height: 132px;
    flex-shrink: 0;
  }
  .ar-palette-title {
    padding: 8px 12px 4px;
  }
  .ar-palette-nodes {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .ar-palette-node {
    flex-shrink: 0;
    cursor: pointer;
  }
  /* Mobiel: popover wordt een bottom-sheet (naast-node heeft geen ruimte). */
  .ar-node-config {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 8px;
    width: auto;
    max-height: 72vh;
    border-radius: 14px;
  }
  .ar-flow-editor.cfg-open .ar-flow-workspace {
    margin-right: 0;
  }
  .ar-detail-columns {
    grid-template-columns: 1fr;
  }
}

/* === Custom Input Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
  display: none;
}

.modal-dialog {
  background: white;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0,0,0,0.04);
  padding: 32px 32px 24px;
  width: 400px;
  max-width: 90vw;
  text-align: center;
  animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-dialog-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #25D366 0%, #1da851 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 22px;
  color: white;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.modal-dialog-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.modal-dialog-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 20px;
}

.modal-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.15s;
  text-align: center;
}

.modal-input::placeholder {
  color: #bbb;
}

.modal-input:focus {
  border-color: #25D366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.12);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.modal-btn {
  flex: 1;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-btn-cancel {
  background: #f5f5f5;
  color: var(--text-secondary);
}

.modal-btn-cancel:hover {
  background: #eaeaea;
  color: var(--text-primary);
}

.modal-btn-ok {
  background: #25D366;
  color: white;
}

.modal-btn-ok:hover {
  background: #1da851;
}

/* ==================== HELP POPUP (CRM STYLE) ==================== */
.help-popup-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1499;
}

.help-popup-backdrop.active {
  display: block;
}

.help-popup {
  position: fixed;
  top: 12px;
  left: 68px;
  width: 660px;
  max-height: calc(100vh - 40px);
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  z-index: 1500;
  overflow: hidden;
  animation: helpPopupSlideIn 0.2s ease-out;
}

@keyframes helpPopupSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.help-popup.active {
  display: flex;
}

.help-popup-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(28, 107, 186, 0.08) 0%, rgba(61, 139, 61, 0.05) 100%);
}

.help-popup-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.help-popup-title i {
  color: var(--primary);
  font-size: 20px;
}

.help-popup-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--bg-gray-100);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.help-popup-close:hover {
  background: var(--bg-gray-200);
  color: var(--text-primary);
}

.help-popup-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.help-section {
  margin-bottom: 20px;
}

.help-section:last-child {
  margin-bottom: 0;
}

.help-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.help-section-title i {
  color: var(--primary);
  font-size: 14px;
  width: 20px;
}

.help-source-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-gray-100);
  color: var(--text-secondary);
  white-space: nowrap;
}

.help-section-content {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: 28px;
}

.help-section-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.help-section-content ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.help-section-content ul li {
  margin-bottom: 3px;
}

.help-section-content code {
  background: var(--bg-gray-100);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'SF Mono', 'Consolas', monospace;
}

.help-tips {
  background: var(--bg-gray-50);
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}

.help-tips-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.help-tip {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  padding-left: 8px;
}

.help-tip:last-child {
  margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .help-popup {
    width: calc(100vw - 20px);
    left: 10px;
    right: auto;
  }
}

/* ===== Mobile Ask AI Panel — Zonneplan-stijl =====
   Zelfde design tokens als desktop (--zp-* — gedefinieerd lager in dit bestand).
   iOS keyboard-fix:
   - Paneel blijft volle viewport-hoogte (anders bleed body-content er onderdoor).
   - Body wordt gelocked met position:fixed (scrollpositie wordt in JS bewaard).
   - --mobile-ask-kb wordt door JS geset op de keyboard-hoogte; input-area
     gebruikt het als margin-bottom om boven het toetsenbord te zweven. */
.mobile-ask-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* Default state (geen keyboard): paneel eindigt boven de bottom-nav.
     Wanneer kb open is, schakelt body.keyboard-open de regel onderin. */
  bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  z-index: 90; /* lager dan nav (z-index:100) zodat nav erboven zichtbaar is */
  display: flex;
  flex-direction: column;
  background: #f1f3f4;
  background: var(--zp-bg, #f1f3f4);
  overflow: hidden;
  overscroll-behavior: contain;
  transition: bottom .2s ease-out, height .2s ease-out;
}
/* Keyboard open: gebruik 100dvh (dynamic viewport height) — iOS Safari 15.4+
   shrinkt dvh automatisch met de toetsenbord-hoogte, dus paneel past exact
   in de zichtbare ruimte boven het kb, geen bleed-through, geen witruimte. */
body.keyboard-open .mobile-ask-panel {
  bottom: auto !important;
  height: 100vh !important;  /* fallback voor oudere browsers */
  height: 100dvh !important; /* modern: dynamic viewport */
}
/* HTML/Body achtergrond gelijktrekken aan paneel-bg zodat IF er ooit een
   gat zichtbaar wordt boven of onder het paneel, je gewoon de zelfde grijze
   tint ziet, geen chat-list bleed-through. */
html.mobile-ask-bg-lock,
body.mobile-ask-open {
  background: var(--zp-bg, #f1f3f4) !important;
}
.mobile-ask-panel.hidden {
  display: none;
}
/* Body-lock voor scroll-preventie. position:fixed + overflow:hidden is op iOS
   voldoende; touch-action:none op body blokkeert óók taps op fixed-positioned
   children (zoals .icon-sidebar) en breekt daarmee de bottom-nav. */
body.mobile-ask-open {
  position: fixed;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
/* Body-siblings BEHALVE het paneel: niet aanraakbaar + onzichtbaar zodat
   chat-lijst etc. niet door het paneel heen kan lekken. */
body.mobile-ask-open > *:not(#mobile-ask-panel) {
  pointer-events: none !important;
  visibility: hidden !important;
}
body.mobile-ask-open #mobile-ask-panel,
body.mobile-ask-open #mobile-ask-panel * {
  pointer-events: auto;
  visibility: visible;
}
/* Bottom-nav blijft INTERACTIEF + zichtbaar wanneer paneel open is (Zonneplan-
   pattern: gebruiker kan ook met paneel open naar andere views switchen).
   Wordt uitgeschakeld wanneer keyboard-open ook actief is (zie elders). */
body.mobile-ask-open .icon-sidebar,
body.mobile-ask-open .icon-sidebar * {
  pointer-events: auto !important;
  visibility: visible !important;
  touch-action: auto !important; /* iOS: anders erft 'none' van body en doven de taps */
}
.mobile-ask-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 6px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: var(--zp-bg, #f1f3f4);
  flex-shrink: 0;
}
.mobile-ask-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mobile-ask-header-row-tools {
  gap: 8px;
  padding-left: 0; /* pill links uitlijnen (consistent met andere views) */
}
/* Kanaal-wissel pill */
.mobile-ask-channel-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--zp-card, #fff);
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--zp-text, #1a1a1a);
  box-shadow: var(--zp-shadow, 0 1px 3px rgba(0,0,0,0.04));
  font-family: inherit;
  cursor: pointer;
}
.mobile-ask-channel-btn svg {
  fill: var(--zp-green, #2ecc71);
}
/* Model chip — zelfde patroon als desktop maar mobiel-compacter */
.mobile-ask-model-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--zp-card, #fff);
  border-radius: 999px;
  padding: 6px 10px 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--zp-text, #1a1a1a);
  box-shadow: var(--zp-shadow, 0 1px 3px rgba(0,0,0,0.04));
  cursor: pointer;
  user-select: none;
}
.mobile-ask-model-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--zp-green, #2ecc71);
  flex-shrink: 0;
}
.mobile-ask-model-chip[data-value="gemini"] .mobile-ask-model-dot { background: #4285F4; }
.mobile-ask-model-chip[data-value="claude-sonnet"] .mobile-ask-model-dot { background: #C8744E; }
.mobile-ask-model-chip[data-value="claude-opus"] .mobile-ask-model-dot { background: #8B4FBF; }
.mobile-ask-model-caret {
  transition: transform .15s;
  opacity: .6;
}
.mobile-ask-model-chip[aria-expanded="true"] .mobile-ask-model-caret {
  transform: rotate(180deg);
}
.mobile-ask-model-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--zp-card, #fff);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  display: none;
  z-index: 20;
}
.mobile-ask-model-chip[aria-expanded="true"] .mobile-ask-model-popover {
  display: block;
}
.mobile-ask-model-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: none;
  padding: 8px 10px;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.mobile-ask-model-option:hover {
  background: rgba(0,0,0,0.04);
}
.mobile-ask-model-option .mobile-ask-model-check {
  fill: var(--zp-green, #2ecc71);
  opacity: 0;
  flex-shrink: 0;
  margin-top: 2px;
}
.mobile-ask-model-option.is-selected .mobile-ask-model-check {
  opacity: 1;
}
.mobile-ask-model-option strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--zp-text, #1a1a1a);
}
.mobile-ask-model-option small {
  display: block;
  font-size: 11px;
  color: var(--zp-muted, #7a8089);
  margin-top: 1px;
}
.mobile-ask-back {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--zp-card, #fff);
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--zp-text, #1a1a1a);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--zp-shadow, 0 1px 3px rgba(0,0,0,0.04));
  flex-shrink: 0;
}
.mobile-ask-back svg {
  width: 20px;
  height: 20px;
}
.mobile-ask-title {
  font-weight: 700;
  font-size: 22px;
  color: var(--zp-text, #1a1a1a);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-ask-new {
  background: var(--zp-card, #fff);
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--zp-text, #1a1a1a);
  cursor: pointer;
  box-shadow: var(--zp-shadow, 0 1px 3px rgba(0,0,0,0.04));
  font-family: inherit;
  flex-shrink: 0;
}
.mobile-ask-new:hover {
  box-shadow: var(--zp-shadow-h, 0 6px 18px rgba(0,0,0,0.06));
}
.mobile-ask-chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  /* padding-bottom = ruimte voor de fixed dock (134px) zodat laatste
     items niet onder de dock vallen. */
  padding: 12px 16px 150px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: transparent;
}
/* User message: green pill, right-aligned */
.mobile-ask-chat .wiki-sim-bubble.user {
  background: var(--zp-green-bub, #6ec88a);
  color: white;
  border-radius: 18px;
  padding: 11px 16px;
  font-size: 14.5px;
  line-height: 1.45;
  max-width: 78%;
  align-self: flex-end;
  box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}
/* AI message: no bubble, just text */
.mobile-ask-chat .wiki-sim-bubble.ai {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 2px 4px 0 4px;
  max-width: 92%;
  color: var(--zp-text, #1a1a1a);
  font-size: 14.5px;
  line-height: 1.65;
  align-self: flex-start;
}
.mobile-ask-chat .wiki-sim-bubble.ai p { margin: 0 0 10px; }
.mobile-ask-chat .wiki-sim-bubble.ai p:last-of-type { margin-bottom: 0; }
.mobile-ask-chat .wiki-sim-sources {
  border-top: 1px solid var(--zp-divider, rgba(0,0,0,0.06));
  margin-top: 12px;
  padding-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mobile-ask-chat .wiki-sim-source-tag {
  background: var(--zp-card, #fff);
  border: 1px solid var(--zp-divider, rgba(0,0,0,0.06));
  border-radius: 10px;
  padding: 5px 10px;
  font-size: 11px;
  box-shadow: var(--zp-shadow, 0 1px 3px rgba(0,0,0,0.04));
  color: var(--zp-muted, #7a8089);
}
.mobile-ask-chat .wiki-sim-typing {
  background: var(--zp-card, #fff);
  border: 1px solid var(--zp-divider, rgba(0,0,0,0.06));
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: var(--zp-shadow, 0 1px 3px rgba(0,0,0,0.04));
  align-self: flex-start;
  display: inline-flex;
  gap: 4px;
}
/* History-cards in de chat-area (Zonneplan-stijl Q&A historie list). */
.mobile-ask-history-item {
  background: transparent;
  padding: 14px 0;
  border-bottom: 1px solid var(--zp-divider, rgba(0,0,0,0.06));
  cursor: pointer;
  transition: opacity .15s;
}
.mobile-ask-history-item:active {
  opacity: 0.6;
}
.mobile-ask-history-item:last-child {
  border-bottom: none;
}
.mobile-ask-history-question {
  font-size: 15px;
  font-weight: 700;
  color: var(--zp-text, #1a1a1a);
  line-height: 1.3;
  margin-bottom: 4px;
}
.mobile-ask-history-preview {
  font-size: 13px;
  color: var(--zp-muted, #7a8089);
  line-height: 1.45;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mobile-ask-history-date {
  font-size: 12px;
  color: #aab0b6;
}

/* Dock-kaart: groepeert greeting + input visueel zoals Zonneplan's "Vraag Kiki".
   Iets donkerder grijze achtergrond dan zp-bg, afgeronde bovenhoeken, plakt aan
   onderkant. Krijgt margin-bottom = keyboard-hoogte zodat de hele dock boven
   het toetsenbord zweeft (greeting + input bewegen samen). */
.mobile-ask-dock {
  /* Dock is een SEPARATE position:fixed element bovenop het paneel.
     Default (kb closed): boven de bottom-nav.
     Keyboard open: bottom:0 → iOS' smart-keyboard-avoidance lift hem
     automatisch boven het toetsenbord (zoals dat met fixed-elementen gebeurt). */
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  z-index: 95;
  background: #e7eaec;
  border-radius: 20px 20px 0 0;
  padding: 12px 12px 14px;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.04);
  transition: bottom .2s ease-out;
}
body.keyboard-open .mobile-ask-dock {
  bottom: 0 !important;
}

/* Greeting bovenin de dock — wordt verborgen zodra er messages zijn */
.mobile-ask-greeting {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--zp-card, #fff);
  border-radius: 999px;
  padding: 8px 18px 8px 8px;
  width: fit-content;
  max-width: 100%;
  box-shadow: var(--zp-shadow, 0 1px 3px rgba(0,0,0,0.04));
  margin-bottom: 8px;
}
.mobile-ask-greeting.hidden {
  display: none;
}
.mobile-ask-greeting .zp-greeting-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--zp-green, #2ecc71);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mobile-ask-greeting .zp-greeting-avatar svg {
  width: 18px;
  height: 18px;
  fill: white;
}
.mobile-ask-greeting .zp-greeting-text {
  font-size: 14px;
  color: var(--zp-text, #1a1a1a);
  line-height: 1.35;
}
.mobile-ask-greeting .zp-greeting-text strong {
  font-weight: 700;
}
.mobile-ask-greeting .zp-greeting-text small {
  display: block;
  color: var(--zp-muted, #7a8089);
  font-size: 12px;
  margin-top: 2px;
}

/* Input-area binnen de dock — send-knop ZIT IN de pill (rechts), groene rand */
.mobile-ask-input-area {
  position: relative;
  display: block;
  padding: 0;
  background: transparent;
  border-top: none;
  flex-shrink: 0;
}
.mobile-ask-input-area textarea {
  width: 100%;
  border: 1.5px solid var(--zp-green, #2ecc71);
  border-radius: 26px;
  padding: 12px 56px 12px 18px;
  font-size: 15px;
  resize: none;
  outline: none;
  font-family: inherit;
  max-height: 100px;
  background: var(--zp-card, #fff);
  color: var(--zp-text, #1a1a1a);
  box-sizing: border-box;
  display: block;
  line-height: 1.4;
}
.mobile-ask-input-area textarea:focus {
  border-color: var(--zp-green-dk, #27ae60);
}
.mobile-ask-send {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--zp-green, #2ecc71);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.mobile-ask-send:hover:not(:disabled) {
  background: var(--zp-green-dk, #27ae60);
}
.mobile-ask-send:disabled {
  opacity: 0.5;
}

/* ==================== WEEKLY SUMMARY PANEL ==================== */
.summary-panel {
  display: flex;
  height: 100%;
  flex: 1;
  background: var(--bg-primary, #fff);
}
/* Gebruikers-paneel — full-width tabel-layout met inline uitklap-rij */
.users-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
  background: #f5f5f5;
  overflow-y: auto;
}
.users-panel.hidden { display: none !important; }
.users-page {
  padding: 24px 32px 40px;
  max-width: 1600px;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
@media (min-width: 1280px) {
  .users-page { padding: 28px 40px 48px; }
}
@media (max-width: 1024px) {
  .users-page { padding: 20px 24px; }
}
@media (max-width: 768px) {
  .users-page { padding: 16px; max-width: 100%; }

  /* === Generieke responsive-table: elke rij wordt op mobile een card === */
  /* Werkt op elke <table class="responsive-table"> met thead+tbody + data-label op td's */
  .responsive-table {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    overflow: visible !important;
    width: 100%;
  }
  /* Header onzichtbaar maar accessible voor screen-readers */
  .responsive-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }
  .responsive-table tbody tr {
    display: block;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 10px;
  }
  .responsive-table tbody tr:hover td { background: transparent !important; }
  .responsive-table tbody tr td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    text-align: right;
  }
  .responsive-table tbody tr td:last-child { border-bottom: 0; }
  .responsive-table tbody tr td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    text-align: left;
  }
  /* td zonder data-label heeft geen prefix */
  .responsive-table tbody tr td:not([data-label])::before,
  .responsive-table tbody tr td[data-label=""]::before { content: none; }

  /* === Users-table specifieke override (naam + email als card-titel, actie boven) === */
  .users-table tbody tr.users-row td.users-cell-name,
  .users-table tbody tr.users-row td.users-cell-email {
    display: block;
    text-align: left;
    padding: 4px 0;
    font-size: 14px;
    border-bottom: 0;
  }
  .users-table tbody tr.users-row td.users-cell-name { font-weight: 600; font-size: 15px; padding-top: 2px; }
  .users-table tbody tr.users-row td.users-cell-name::before,
  .users-table tbody tr.users-row td.users-cell-email::before { display: none; }
  .users-table tbody tr.users-row td.users-cell-email {
    color: #64748b;
    font-size: 12.5px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 4px;
  }
  .users-table tbody tr.users-row td.users-cell-actie {
    padding: 0 0 8px;
    justify-content: flex-end;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 4px;
  }
  .users-table tbody tr.users-row td.users-cell-actie::before { display: none; }
  /* Uitklap-edit rij voor users-table: full width binnen card */
  .users-table tbody tr.users-row-edit,
  .users-table tbody tr.users-row-add {
    display: block;
    padding: 0;
    margin-bottom: 12px;
    border: 1px solid #2563eb;
    border-radius: 12px;
    overflow: hidden;
  }
  .users-table tbody tr.users-row-edit td,
  .users-table tbody tr.users-row-add td { display: block; padding: 0; }
  .users-row-edit-grid { grid-template-columns: 1fr !important; }
}
.users-page-header { margin-bottom: 18px; }
.users-page-h {
  font-size: 26px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.users-page-sub {
  font-size: 13px;
  color: #64748b;
  margin: 6px 0 0;
  line-height: 1.5;
}
.users-page-actionbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 14px;
}
.users-page-count {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}
.users-page-add-btn {
  background: #0f172a;
  color: #ffffff;
  border: 0;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.users-page-add-btn:hover { background: #1e293b; }
.users-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  table-layout: auto;
}
.users-table thead th {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.08em;
  text-align: left;
  padding: 14px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
  text-transform: uppercase;
}
.users-table-actie { text-align: right !important; }
.users-table th.users-sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.12s;
}
.users-table th.users-sortable:hover { color: #475569; }
.users-table th.users-sort-active { color: #0f172a; }
.users-table .users-sort-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  color: #2563eb;
  font-weight: 700;
}
.users-table tbody td {
  padding: 18px 20px;
  font-size: 14px;
  color: #0f172a;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.users-table tbody tr:last-child td { border-bottom: 0; }
.users-table .users-row { transition: background 0.1s; }
.users-table .users-row:hover td { background: #fafbfc; }
.users-table .users-row.is-expanded td { background: #f8fafc; }
.users-table .users-row.is-inactive td { color: #94a3b8; }
.users-cell-email {
  color: #0f172a;
  font-weight: 500;
}
.users-cell-name { color: #334155; font-weight: 500; }
.users-cell-date {
  color: #64748b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 13.5px;
}
.users-cell-actie { text-align: right; white-space: nowrap; }
/* Rol-pill — exact mockup: witte pill, dunne border, circle-icoon vooraan */
.users-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: #334155;
  background: #ffffff;
  line-height: 1;
}
.users-role-pill svg { color: #94a3b8; flex-shrink: 0; }
/* "jij" badge — kleine licht-blauwe pill achter het eigen e-mailadres */
.users-jij-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 600;
  color: #1d4ed8;
  background: #eff6ff;
  border-radius: 5px;
  letter-spacing: 0.01em;
  vertical-align: 2px;
}
/* Actie-icoonknoppen — light tinted box (rood = delete, blauw = edit) */
.users-row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  margin-left: 6px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.users-row-icon:first-child { margin-left: 0; }
.users-row-icon-edit {
  background: #eff6ff;
  color: #2563eb;
  border-color: #dbeafe;
}
.users-row-icon-edit:hover { background: #dbeafe; }
.users-row-icon-delete {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fee2e2;
}
.users-row-icon-delete:hover { background: #fee2e2; }
.users-row-icon-reactivate {
  background: #ecfdf5;
  color: #059669;
  border-color: #d1fae5;
}
.users-row-icon-reactivate:hover { background: #d1fae5; }
/* "Hoe werkt het?" help-blok onderaan */
.users-page-help {
  margin-top: 22px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px 22px;
}
.users-page-help h4 {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.users-page-help ul {
  margin: 0;
  padding-left: 20px;
  color: #475569;
  font-size: 13px;
  line-height: 1.7;
}
.users-page-help li { margin: 2px 0; }

/* === Auto-reply whitelist sectie === */
.users-page-whitelist {
  margin-top: 22px;
}
.users-whitelist-h {
  margin-bottom: 14px;
}
.users-whitelist-h h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.users-whitelist-h p {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}
.users-whitelist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.users-whitelist-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 18px;
}
.users-whitelist-card-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.users-whitelist-card-h strong {
  font-size: 14px;
  color: #0f172a;
  font-weight: 600;
}
.users-whitelist-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.users-whitelist-count {
  margin-left: auto;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}
.users-whitelist-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
  margin-bottom: 12px;
}
.users-whitelist-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 10px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: #1e3a8a;
  font-variant-numeric: tabular-nums;
}
.users-whitelist-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 0;
  background: transparent;
  border-radius: 50%;
  color: #1e3a8a;
  cursor: pointer;
  transition: background 0.12s;
}
.users-whitelist-chip button:hover { background: #dbeafe; }
.users-whitelist-empty {
  font-size: 12px;
  color: #94a3b8;
  font-style: italic;
  padding: 6px 0;
}
.users-whitelist-add {
  display: flex;
  gap: 6px;
}
.users-whitelist-add input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #ffffff;
  font-variant-numeric: tabular-nums;
}
.users-whitelist-add input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.users-whitelist-add button {
  padding: 7px 14px;
  background: #0f172a;
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.users-whitelist-add button:hover { background: #1e293b; }
.users-whitelist-status {
  font-size: 11px;
  color: #64748b;
  margin: 6px 0 0;
  min-height: 14px;
}
/* Uitklap-rij: zelfde brede td, inline form */
.users-row-edit.hidden,
.users-row-add.hidden { display: none; }
.users-row-edit td,
.users-row-add td {
  background: #f8fafc;
  padding: 0;
  border-bottom: 1px solid #e2e8f0;
}
.users-row-edit-inner {
  padding: 18px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.users-row-edit-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr;
  gap: 14px;
}
.users-row-edit-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}
.users-row-edit-grid input,
.users-row-edit-grid select {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #ffffff;
  color: #0f172a;
}
.users-row-edit-grid input:focus,
.users-row-edit-grid select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.users-row-edit-grid input:disabled { background: #f8fafc; color: #94a3b8; }
.users-row-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.users-panel-sidebar {
  width: 460px;
  min-width: 460px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.users-panel-list-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 4px 18px 22px;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
}
.users-panel-list-wrap #user-list {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 12px 0 0;
  box-shadow: none;
}
.users-panel-sidebar-header {
  padding: 22px 18px 14px;
  border-bottom: 1px solid #f1f5f9;
}
.users-panel-sidebar-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.users-panel-sidebar-header p {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}
.users-panel-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
}
.users-panel-add-btn { width: 100%; justify-content: center; }
.users-panel-search {
  position: relative;
  display: flex;
  align-items: center;
}
.users-panel-search svg {
  position: absolute;
  left: 11px;
  pointer-events: none;
}
.users-panel-search input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  background: #ffffff;
  color: #0f172a;
  box-sizing: border-box;
  font-family: inherit;
}
.users-panel-search input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.users-panel-filters {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.users-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
.users-filter:hover { background: #f1f5f9; color: #0f172a; }
.users-filter.active {
  background: #0f172a;
  color: #ffffff;
}
.users-filter-count {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
  color: inherit;
  opacity: 0.85;
}
.users-filter:not(.active) .users-filter-count {
  background: #e2e8f0;
  color: #475569;
}
.users-panel-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: #f5f5f5;
  overflow-y: auto;
}
.users-panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #94a3b8;
}
.users-panel-empty.hidden { display: none; }
.users-panel-empty p { font-size: 13px; margin: 0; }
/* Inline editor — vervangt de oude user-form-modal popup */
.users-panel-editor {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  width: 100%;
  max-width: 480px;
  align-self: flex-start;
  margin-top: 12px;
  overflow: hidden;
}
.users-panel-editor.hidden { display: none; }
.users-panel-editor-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #f1f5f9;
}
.users-panel-editor-h h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.users-panel-editor-close {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.users-panel-editor-close:hover { background: #f1f5f9; color: #0f172a; }
.users-panel-editor-form {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* Actieve gebruiker in de lijst tijdens bewerken */
.user-item.is-active {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}
.summary-sidebar {
  width: 320px;
  min-width: 320px;
  border-right: 1px solid var(--border-color, #e5e7eb);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg-secondary, #f9fafb);
}
.summary-sidebar-header {
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}
.summary-sidebar-header h2 {
  margin: 0;
  font-size: 18px;
  color: var(--text-primary, #111);
}
.summary-controls {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}
.summary-group-select label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.summary-group-select select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #111);
  font-size: 14px;
}
.summary-week-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.summary-nav-btn {
  background: none;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--text-primary, #111);
  display: flex;
  align-items: center;
}
.summary-nav-btn:hover {
  background: var(--bg-hover, #f3f4f6);
}
#summary-week-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #111);
  min-width: 120px;
  text-align: center;
}
.summary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #111);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.summary-btn:hover {
  background: var(--bg-hover, #f3f4f6);
}
.summary-btn-primary {
  background: #f97316;
  color: white;
  border-color: #f97316;
}
.summary-btn-primary:hover {
  background: #ea580c;
  border-color: #ea580c;
}
.summary-btn-outline {
  width: 100%;
}
.summary-history {
  padding: 16px 20px;
  flex: 1;
  overflow-y: auto;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}
.summary-history h4 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.summary-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.summary-history-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.summary-history-item-content { flex: 1; }
.summary-history-delete {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  color: var(--text-muted, #9ca3af);
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
  margin-top: 2px;
}
.summary-history-item:hover .summary-history-delete { opacity: 1; }
.summary-history-delete:hover { color: #dc2626; background: #fef2f2; }
.summary-history-deleting {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
}
.summary-history-deleting .summary-history-delete { opacity: 1; color: #dc2626; }
.summary-delete-label {
  font-size: 12px;
  color: #dc2626;
  font-weight: 600;
}
.summary-history-item:hover {
  background: var(--bg-hover, #f3f4f6);
}
.summary-history-item.active {
  background: #fff7ed;
  border-color: #f97316;
}
.summary-history-item-week {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #111);
}
.summary-history-item-meta {
  font-size: 11px;
  color: var(--text-muted, #6b7280);
  margin-top: 2px;
}
.summary-history-item-sent {
  font-size: 10px;
  color: #16a34a;
  margin-top: 2px;
}
.summary-contact-mgmt {
  padding: 16px 20px;
}
.summary-contact-mgmt h4 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.summary-content {
  flex: 1;
  overflow-y: auto;
  position: relative;
}
.summary-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted, #6b7280);
  text-align: center;
  padding: 40px;
}
.summary-empty-state h3 {
  margin: 16px 0 8px;
  color: var(--text-primary, #111);
}
.summary-empty-state p {
  max-width: 400px;
  line-height: 1.5;
  font-size: 14px;
}
.summary-empty {
  padding: 12px;
  color: var(--text-muted, #6b7280);
  font-size: 13px;
  text-align: center;
}

/* Summary Result */
.summary-result {
  padding: 24px 32px;
}
.summary-result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}
.summary-result-title h3 {
  margin: 0;
  font-size: 20px;
  color: var(--text-primary, #111);
}
.summary-result-meta {
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  margin-top: 4px;
  display: block;
}
/* Issue selector */
.summary-issue-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
}
.issue-selector-card {
  max-width: 700px;
  width: 100%;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.issue-selector-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.issue-selector-header h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.issue-selector-header p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  line-height: 1.4;
}
.issue-selector-actions-top {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.issue-selector-list {
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  max-height: 320px;
  overflow-y: auto;
}
.issue-selector-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  cursor: pointer;
  font-size: 13px;
  transition: background 0.1s;
}
.issue-selector-row:last-child { border-bottom: none; }
.issue-selector-row:hover { background: #f9fafb; }
.issue-selector-cb {
  width: 18px;
  height: 18px;
  accent-color: #f97316;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}
.issue-selector-info {
  flex: 1;
  min-width: 0;
}
.issue-selector-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.issue-selector-id {
  font-weight: 600;
  color: #f97316;
  white-space: nowrap;
}
.issue-selector-title {
  flex: 1;
  color: var(--text-primary, #111);
}
.issue-selector-meta {
  font-size: 11px;
  color: var(--text-muted, #9ca3af);
  white-space: nowrap;
}
.issue-selector-desc {
  font-size: 11px;
  color: var(--text-muted, #6b7280);
  margin-top: 3px;
  line-height: 1.4;
}
.issue-selector-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.summary-regen-bar {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.summary-regen-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}
.summary-regen-field {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  color: var(--text-primary, #111);
  font-family: inherit;
}
.summary-regen-field:focus {
  outline: none;
  border-color: #f97316;
}
.summary-regen-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: var(--text-muted, #9ca3af);
  display: flex;
}
.summary-regen-close:hover { color: #dc2626; }
.summary-result-body {
  line-height: 1.7;
  color: #2d3748;
  font-size: 15px;
  letter-spacing: 0.01em;
}
.summary-result-body p {
  margin: 0 0 14px;
}
.summary-result-body h3 {
  font-size: 18px;
  margin: 32px 0 12px;
  color: #111;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0f0f0;
}
.summary-result-body h4 {
  font-size: 15px;
  margin: 20px 0 8px;
  color: #1a202c;
}
.summary-result-body ul {
  padding-left: 20px;
  margin: 8px 0;
}
.summary-result-body li {
  margin: 6px 0;
}
.summary-result-body .badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.summary-result-body .badge-generic {
  background: #fef3c7;
  color: #92400e;
}
.summary-result-body .badge-local {
  background: #dbeafe;
  color: #1e40af;
}
.summary-result-body .summary-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}
.summary-result-body .summary-table th {
  background: #f3f4f6;
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #e5e7eb;
}
.summary-result-body .summary-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
}
.summary-result-body .summary-table tr:hover td {
  background: #f9fafb;
}
@media (max-width: 768px) {
  .summary-result-body .summary-table,
  .summary-result-body .summary-table thead,
  .summary-result-body .summary-table tbody,
  .summary-result-body .summary-table th,
  .summary-result-body .summary-table td,
  .summary-result-body .summary-table tr {
    display: block;
  }
  .summary-result-body .summary-table thead {
    display: none;
  }
  .summary-result-body .summary-table tr {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 10px 14px;
    background: #f9fafb;
  }
  .summary-result-body .summary-table td {
    padding: 3px 0;
    border: none;
    font-size: 13px;
  }
  .summary-result-body .summary-table td {
    display: flex;
    padding: 3px 0;
    border: none;
    font-size: 13px;
  }
  .summary-result-body .summary-table td::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    min-width: 90px;
    font-size: 12px;
    flex-shrink: 0;
  }
  /* Bullets op mobiel */
  .summary-result-body ul {
    padding-left: 16px;
  }
  .summary-result-body li {
    margin: 8px 0;
    line-height: 1.5;
  }
  .summary-result-body ul ul {
    padding-left: 12px;
  }
  .summary-result {
    padding: 16px;
  }
}

/* Summary Loading */
.summary-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.summary-loading-card {
  text-align: center;
  max-width: 360px;
  padding: 40px;
}
.summary-loading-icon {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.summary-loading-icon .summary-spinner {
  position: absolute;
  inset: 0;
}
.summary-loading-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--text-primary, #111);
}
.summary-loading-card p {
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  line-height: 1.5;
  margin: 0 0 20px;
}
.summary-loading-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
}
.loading-step {
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--bg-secondary, #f3f4f6);
  color: var(--text-muted, #6b7280);
}
.loading-step.active {
  background: #fff7ed;
  color: #f97316;
  font-weight: 600;
}
.loading-step-arrow {
  color: var(--border-color, #d1d5db);
}
.summary-spinner {
  width: 80px;
  height: 80px;
  border: 3px solid var(--border-color, #e5e7eb);
  border-top-color: #f97316;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Summary Modals */
.summary-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.summary-modal-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
}
.summary-modal-content {
  position: relative;
  background: var(--bg-primary, #fff);
  border-radius: 12px;
  padding: 24px;
  width: 420px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.summary-modal-content h3 {
  margin: 0 0 16px;
  font-size: 16px;
}
.summary-modal-wide {
  width: 600px;
}
.summary-form-group {
  margin-bottom: 16px;
}
.summary-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary, #111);
}
.summary-form-group select {
  width: 100%;
  padding: 10px 36px 10px 14px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #111);
  font-size: 14px;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.summary-form-group select:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}
.summary-form-group textarea,
.summary-form-group input[type="text"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  font-size: 13px;
  resize: vertical;
  box-sizing: border-box;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #111);
}
.summary-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* Contact tagging */
.summary-contacts-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.summary-search-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #111);
}
.summary-contacts-toolbar select {
  padding: 8px 12px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #111);
}
.summary-contacts-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
}
.summary-contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  font-size: 13px;
}
.summary-contact-row:last-child {
  border-bottom: none;
}
.summary-contact-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #f97316;
}
.summary-contact-name {
  flex: 1;
  font-weight: 500;
}
.summary-contact-phone {
  color: var(--text-muted, #6b7280);
  font-size: 12px;
}
.summary-contact-badge {
  background: #fed7aa;
  color: #9a3412;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

@media (max-width: 768px) {
  .summary-panel {
    flex-direction: column;
  }
  .summary-sidebar {
    width: 100%;
    min-width: 0;
    max-height: 45vh;
  }
  /* Ruimte onderaan voor de floating bottom-nav */
  .summary-content {
    padding: 16px 16px 120px !important;
    overflow-y: auto;
  }
  /* Secure Share: inline padding 32/40 is te royaal op telefoon + nav-clearance */
  #secure-share-scroll {
    padding: 16px 16px 120px !important;
  }
  /* Instellingen: lange formulieren — laatste Opslaan-knop niet achter nav */
  #settings-panel .settings-content {
    padding-bottom: 120px !important;
  }
}

/* ==================== CUSTOMER GROUP (Klantengroep) ==================== */
.contact-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.contact-group-badge {
  background: #fed7aa;
  color: #9a3412;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.conversation-group-label {
  font-size: 10px;
  color: #9a3412;
  background: #fed7aa;
  padding: 0 5px;
  border-radius: 3px;
  font-weight: 600;
  margin-left: 4px;
  white-space: nowrap;
}

/* Context menu submenu */
.ctx-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 6px;
  border-top: 1px solid var(--border-color, #e5e7eb);
}
.ctx-group-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #111);
}
.ctx-value-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 16px;
  background: #f0fdf4;
  border-radius: 4px;
  margin: 2px 12px;
}
.ctx-value-name {
  font-size: 13px;
  font-weight: 600;
  color: #16a34a;
  flex: 1;
}
.ctx-value-unlink {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  opacity: 0.5;
}
.ctx-value-unlink:hover {
  background: #fef2f2;
  opacity: 1;
}
.ctx-submenu {
  padding: 0 0 4px;
}
.ctx-submenu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 16px;
  border: none;
  background: none;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-primary, #111);
  text-align: left;
}
.ctx-submenu-item:hover {
  background: var(--bg-hover, #f3f4f6);
}
.ctx-submenu-remove {
  color: #dc2626;
}
.ctx-submenu-custom {
  color: var(--text-muted, #6b7280);
}
.ctx-submenu-section {
  padding: 4px 0;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}
.ctx-submenu-section:last-of-type {
  border-bottom: none;
}
.ctx-submenu-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #6b7280);
  padding: 4px 16px 2px;
}
.ctx-location-input {
  display: flex;
  gap: 4px;
  padding: 4px 12px 8px;
}
.ctx-location-text {
  flex: 1;
  padding: 5px 8px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 5px;
  font-size: 13px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #111);
}
.ctx-location-btn {
  padding: 5px 10px;
  border: none;
  border-radius: 5px;
  background: #f97316;
  color: white;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ctx-location-btn:hover {
  background: #ea580c;
}
.ctx-location-list {
  max-height: 120px;
  overflow-y: auto;
}
.ctx-location-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 6px 16px;
  border: none;
  background: none;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-primary, #111);
  text-align: left;
  gap: 6px;
}
.ctx-location-item:hover {
  background: var(--bg-hover, #f3f4f6);
}
.ctx-location-item.active {
  color: #f97316;
  font-weight: 600;
}
.ctx-location-item .loc-count {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-muted, #6b7280);
}
/* Location manage modal */
.loc-manage-list {
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  max-height: 300px;
  overflow-y: auto;
}
.loc-manage-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  font-size: 13px;
}
.loc-manage-row:last-child { border-bottom: none; }
.loc-manage-name { flex: 1; font-weight: 500; }
.loc-manage-count { font-size: 11px; color: var(--text-muted, #6b7280); }
.loc-manage-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-muted, #6b7280);
}
.loc-manage-btn:hover { background: var(--bg-hover, #f3f4f6); }
.loc-manage-btn.danger { color: #dc2626; }
.loc-manage-btn.danger:hover { background: #fef2f2; }
.loc-manage-add {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.loc-manage-add input { flex: 1; }
.loc-manage-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-muted, #6b7280);
  font-size: 13px;
}

/* ==================== Settings-paneel (sidebar + content) ==================== */
.settings-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: #f7f8fa;
}
.settings-panel.hidden { display: none; }

.settings-panel-header {
  padding: 24px 32px 16px 32px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
.settings-panel-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}
.settings-panel-subtitle {
  margin: 4px 0 0 0;
  color: #6b7280;
  font-size: 13px;
}

.settings-panel-body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.settings-categories {
  width: 230px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
  padding: 14px 10px;
}
.settings-cat-group + .settings-cat-group { margin-top: 18px; }
.settings-cat-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #9ca3af;
  padding: 0 12px 6px 12px;
}
.settings-cat-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.12s;
}
.settings-cat-btn svg { color: #6b7280; flex-shrink: 0; }
.settings-cat-btn:hover { background: #f3f4f6; }
.settings-cat-btn.active {
  background: #eff6ff;
  color: #1e40af;
}
.settings-cat-btn.active svg { color: #1e40af; }

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  min-width: 0;
}
.settings-cat-section { display: none; max-width: 760px; }
.settings-cat-section.active { display: block; }
.settings-section-h {
  margin: 0 0 18px 0;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

/* Mobiel: zijbalk boven */
@media (max-width: 768px) {
  .settings-panel-body { flex-direction: column; }
  .settings-categories {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 10px 12px;
  }
  .settings-cat-group { display: flex; gap: 6px; align-items: center; }
  .settings-cat-group + .settings-cat-group { margin-top: 0; }
  .settings-cat-title { display: none; }
  .settings-cat-btn { width: auto; flex-shrink: 0; }
  .settings-cat-btn span { white-space: nowrap; }
  .settings-content { padding: 16px; }
}

/* ==================== Kennisbank Admin Panel ==================== */
.kb-admin-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: #f7f8fa;
}
.kb-admin-panel.hidden { display: none; }

.kb-admin-header {
  padding: 24px 32px 0 32px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
.kb-admin-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}
.kb-admin-subtitle {
  margin: 4px 0 16px 0;
  color: #6b7280;
  font-size: 13px;
}
.kb-admin-tabs { display: flex; gap: 2px; }
.kb-tab {
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.kb-tab:hover:not(:disabled) { color: #111827; }
.kb-tab.active {
  color: #111827;
  border-bottom-color: #25D366;
}
.kb-tab:disabled { opacity: 0.5; cursor: not-allowed; }

.kb-admin-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}
.kb-tab-content { display: none; max-width: 720px; }
.kb-tab-content.active { display: block; }

.kb-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 18px;
}
.kb-card h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}
.kb-muted {
  color: #6b7280;
  font-size: 13px;
  margin: 0 0 16px 0;
  line-height: 1.5;
}
.kb-muted code {
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
  font-family: ui-monospace, monospace;
}

.kb-field { margin-bottom: 16px; }
.kb-field:last-child { margin-bottom: 0; }
.kb-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.kb-field-row { display: flex; gap: 8px; align-items: center; }
.kb-field input[type="password"],
.kb-field input[type="text"],
.kb-field select {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  color: #111827;
  font-family: inherit;
}
.kb-field input:focus, .kb-field select:focus {
  outline: none;
  border-color: #25D366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}
.kb-field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
}
.kb-field-hint.ok { color: #059669; }
.kb-field-hint.warn { color: #d97706; }
.kb-field-hint.err { color: #dc2626; }

.kb-btn {
  padding: 9px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.kb-btn-primary { background: #25D366; color: #fff; }
.kb-btn-primary:hover { background: #1dbf5a; }
.kb-btn-ghost {
  background: #fff;
  color: #6b7280;
  border-color: #e5e7eb;
}
.kb-btn-ghost:hover { background: #f9fafb; color: #111827; }

.kb-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-top: 4px;
}
.kb-save-status { font-size: 13px; }
.kb-save-status.ok { color: #059669; }
.kb-save-status.err { color: #dc2626; }
.kb-updated-meta {
  margin-left: auto;
  font-size: 12px;
  color: #9ca3af;
}

/* Agent cards */
.kb-agent-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}
.kb-agent-card[open] { border-color: #25D366; }
.kb-agent-card summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.kb-agent-card summary::-webkit-details-marker { display: none; }
.kb-agent-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kb-agent-dot-docs { background: #3b82f6; }
.kb-agent-dot-tickets { background: #f59e0b; }
.kb-agent-dot-practice { background: #10b981; }
.kb-agent-dot-synthesizer { background: #8b5cf6; }
.kb-agent-meta { flex: 1; min-width: 0; }
.kb-agent-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}
.kb-agent-domain {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}
.kb-agent-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  flex-shrink: 0;
}
.kb-agent-badge.default {
  background: #f3f4f6;
  color: #6b7280;
}
.kb-agent-badge.custom {
  background: #ecfdf5;
  color: #059669;
}
.kb-agent-body {
  padding: 0 16px 16px 16px;
  border-top: 1px solid #f3f4f6;
}
.kb-agent-model {
  margin: 12px 0;
}
.kb-agent-model label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}
.kb-agent-model select {
  width: 100%;
  max-width: 360px;
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: #111827;
}
.kb-agent-model-note {
  font-size: 12px;
  color: #6b7280;
  font-style: italic;
  padding: 8px 10px;
  background: #f9fafb;
  border-radius: 6px;
}
.kb-agent-prompt label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin: 12px 0 4px 0;
}
.kb-agent-prompt textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 12.5px;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  line-height: 1.55;
  background: #fafbfc;
  color: #111827;
  resize: vertical;
  box-sizing: border-box;
}
.kb-agent-prompt textarea:focus {
  outline: none;
  border-color: #25D366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
  background: #fff;
}
.kb-btn-small {
  padding: 6px 10px;
  font-size: 12px;
  margin-top: 8px;
}

.kb-toggle-field label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.kb-toggle-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #25D366;
  cursor: pointer;
}
.kb-toggle-field span {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

/* Per-call synthesizer provider dropdown in ask UI */
.wiki-sim-provider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 2px 12px;
  border-top: 1px solid #f3f4f6;
}
.wiki-sim-provider-label {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
}
.wiki-sim-provider-select {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  background: #fff;
  color: #374151;
  font-family: inherit;
  cursor: pointer;
}
.wiki-sim-provider-select:hover { border-color: #d1d5db; }
.wiki-sim-provider-select:focus {
  outline: none;
  border-color: #25D366;
}

/* ============================================================
   ZONNEPLAN-STYLE ASK UI (Kennisbank > Vraag stellen)
   Inspired by Zonneplan app: light gray background, floating
   white cards, green accents, no harsh panel borders.
   Scope: #wiki-sim-panel + #wiki-ask-mode + .wiki-sim-history.
   ============================================================ */
:root {
  --zp-bg:        #f1f3f4;
  --zp-card:      #ffffff;
  --zp-green:     #2ecc71;
  --zp-green-dk:  #27ae60;
  --zp-green-bub: #6ec88a;
  --zp-text:      #1a1a1a;
  --zp-muted:     #7a8089;
  --zp-divider:   rgba(0,0,0,0.06);
  --zp-shadow:    0 1px 3px rgba(0,0,0,0.04);
  --zp-shadow-h:  0 6px 18px rgba(0,0,0,0.06);
}

/* --- Sidebar background when ask-mode is active --- */
.wiki-panel-sidebar:has(#wiki-ask-mode:not(.hidden)) {
  background: var(--zp-bg);
}
.wiki-panel-sidebar:has(#wiki-ask-mode:not(.hidden)) .wiki-sidebar-header {
  background: transparent;
  border-bottom: none;
  padding-bottom: 8px;
}

/* --- Mode tabs become Zonneplan-style segmented pill --- */
.wiki-panel-sidebar:has(#wiki-ask-mode:not(.hidden)) .wiki-mode-tabs,
.wiki-panel-sidebar:has(#wiki-ask-mode:not(.hidden)) .wiki-source-tabs {
  background: #e7eaec;
  border-radius: 999px;
  padding: 4px;
  border: none;
  gap: 0;
}
.wiki-panel-sidebar:has(#wiki-ask-mode:not(.hidden)) .wiki-mode-tab,
.wiki-panel-sidebar:has(#wiki-ask-mode:not(.hidden)) .wiki-source-tab {
  border-radius: 999px;
  border: none;
  background: transparent;
  font-weight: 600;
  color: var(--zp-muted);
  padding: 8px 12px;
}
.wiki-panel-sidebar:has(#wiki-ask-mode:not(.hidden)) .wiki-mode-tab.active,
.wiki-panel-sidebar:has(#wiki-ask-mode:not(.hidden)) .wiki-source-tab.active {
  background: var(--zp-card);
  color: var(--zp-text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* --- Ask filters: keep but flatten --- */
#wiki-ask-mode .wiki-ask-filters {
  background: var(--zp-bg);
  border-bottom: none;
  padding: 4px 12px 8px;
  gap: 6px;
}
#wiki-ask-mode .wiki-ask-filter {
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  background: var(--zp-card);
  border: 1px solid var(--zp-divider);
  color: var(--zp-muted);
  flex: 0 1 auto;
}
#wiki-ask-mode .wiki-ask-filter.active {
  background: var(--zp-text);
  color: white;
  border-color: var(--zp-text);
}

/* --- History list: cards with chevron --- */
#wiki-ask-mode { background: var(--zp-bg); }
#wiki-sim-history {
  padding: 4px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--zp-bg);
}
#wiki-sim-history .wiki-sim-history-empty {
  background: var(--zp-card);
  border-radius: 14px;
  padding: 28px 16px;
  margin-top: 8px;
}
#wiki-sim-history .wiki-sim-history-item {
  background: var(--zp-card);
  border: none;
  border-bottom: none !important;
  border-radius: 14px;
  padding: 14px 38px 14px 18px;
  box-shadow: var(--zp-shadow);
  position: relative;
  transition: box-shadow .15s, transform .15s;
}
#wiki-sim-history .wiki-sim-history-item:hover {
  background: var(--zp-card);
  box-shadow: var(--zp-shadow-h);
}
#wiki-sim-history .wiki-sim-history-item.active {
  background: var(--zp-card);
  border-left: none;
  outline: 2px solid var(--zp-green);
  outline-offset: -2px;
}
/* Chevron */
#wiki-sim-history .wiki-sim-history-item::after {
  content: '';
  position: absolute;
  right: 18px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #c4c8cd;
  border-bottom: 2px solid #c4c8cd;
  transform: translateY(-50%) rotate(-45deg);
  pointer-events: none;
}
#wiki-sim-history .wiki-sim-history-item-question {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--zp-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 8px;
}
#wiki-sim-history .wiki-sim-history-item-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--zp-muted);
}

/* --- Chat panel: full Zonneplan look --- */
#wiki-sim-panel {
  background: var(--zp-bg);
}
#wiki-sim-panel .wiki-sim-panel-header {
  background: transparent;
  border-bottom: none;
  padding: 16px 20px;
  font-size: 17px;
  font-weight: 600;
  color: var(--zp-text);
  gap: 12px;
}
#wiki-sim-panel .wiki-sim-panel-header > svg:first-of-type {
  display: none;
}
#wiki-sim-panel .wiki-sim-back-btn {
  display: none; /* hidden on desktop, shown on mobile widths */
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--zp-card);
  border: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--zp-text);
  box-shadow: var(--zp-shadow);
  flex-shrink: 0;
}
#wiki-sim-panel .wiki-sim-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--zp-text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#wiki-sim-panel .wiki-sim-clear-btn {
  background: var(--zp-card) !important;
  border: none !important;
  border-radius: 999px;
  padding: 8px 16px !important;
  font-size: 12px;
  font-weight: 600;
  color: var(--zp-text) !important;
  box-shadow: var(--zp-shadow);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-family: inherit;
  margin-left: auto;
}
#wiki-sim-panel .wiki-sim-clear-btn:hover {
  background: var(--zp-card) !important;
  box-shadow: var(--zp-shadow-h);
  color: var(--zp-text) !important;
}
#wiki-sim-panel .wiki-sim-clear-btn svg {
  fill: var(--zp-green);
}
@media (max-width: 720px) {
  #wiki-sim-panel .wiki-sim-back-btn { display: inline-flex; }
}

/* --- Chat container --- */
#wiki-sim-chat {
  background: var(--zp-bg);
  padding: 16px 16px 20px !important;
  gap: 14px !important;
}

/* User message: green pill, right-aligned */
#wiki-sim-chat .wiki-sim-bubble.user {
  background: var(--zp-green-bub);
  color: white;
  border-radius: 18px;
  border-bottom-right-radius: 18px;
  padding: 11px 16px;
  font-size: 14.5px;
  line-height: 1.45;
  max-width: 78%;
  box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}

/* AI message: NO bubble, just text on background */
#wiki-sim-chat .wiki-sim-bubble.ai {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 2px 4px 0 4px;
  max-width: 92%;
  color: var(--zp-text);
  font-size: 14.5px;
  line-height: 1.65;
  align-self: flex-start;
}
#wiki-sim-chat .wiki-sim-bubble.ai p { margin: 0 0 10px; }
#wiki-sim-chat .wiki-sim-bubble.ai p:last-of-type { margin-bottom: 0; }

/* Sources within AI message: white chip cards */
#wiki-sim-chat .wiki-sim-bubble.ai .wiki-sim-sources {
  border-top: 1px solid var(--zp-divider);
  margin-top: 12px;
  padding-top: 10px;
}
#wiki-sim-chat .wiki-sim-bubble.ai .wiki-sim-source-tag {
  background: var(--zp-card);
  border: 1px solid var(--zp-divider);
  border-radius: 10px;
  padding: 5px 10px;
  font-size: 11px;
  box-shadow: var(--zp-shadow);
  color: var(--zp-muted);
}

/* Validation buttons: pill style */
#wiki-sim-chat .wiki-sim-validation { gap: 8px; margin-top: 12px; }
#wiki-sim-chat .wiki-sim-val-btn {
  background: var(--zp-card);
  border: 1px solid var(--zp-divider);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--zp-shadow);
}

/* Verified badge: rounded pill */
#wiki-sim-chat .wiki-sim-verified-badge {
  border-radius: 999px;
  padding: 6px 14px;
  width: fit-content;
}

/* Typing indicator: light card without bubble border */
#wiki-sim-chat .wiki-sim-typing {
  background: var(--zp-card);
  border: 1px solid var(--zp-divider);
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: var(--zp-shadow);
}

/* --- Date pill (added by JS for empty state / day separator) --- */
.wiki-sim-day-pill {
  align-self: center;
  background: #d9dde1;
  color: #5a6168;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 999px;
  margin: 4px 0;
}

/* --- Empty state: Zonneplan greeting card sits at the BOTTOM, just above the input --- */
#wiki-sim-chat .wiki-sim-empty {
  background: transparent;
  flex: 1 1 auto;
  align-items: flex-start;
  justify-content: flex-end;
  text-align: left;
  padding: 0;
  gap: 0;
}
#wiki-sim-chat .wiki-sim-empty .zp-greeting {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--zp-card);
  border-radius: 999px;
  padding: 10px 18px 10px 10px;
  width: fit-content;
  max-width: 100%;
  box-shadow: var(--zp-shadow);
  margin-top: auto;
}
#wiki-sim-chat .wiki-sim-empty .zp-greeting-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--zp-green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#wiki-sim-chat .wiki-sim-empty .zp-greeting-avatar svg { width: 20px; height: 20px; fill: white; }
#wiki-sim-chat .wiki-sim-empty .zp-greeting-text {
  font-size: 14px;
  color: var(--zp-text);
  line-height: 1.35;
}
#wiki-sim-chat .wiki-sim-empty .zp-greeting-text strong { font-weight: 700; }
#wiki-sim-chat .wiki-sim-empty .zp-greeting-text small {
  display: block;
  color: var(--zp-muted);
  font-size: 12px;
  margin-top: 2px;
}

/* --- Bijlage-paperclip + popup-menu (Zonneplan-stijl, links van invoer) --- */
#wiki-sim-panel .wiki-sim-attach-wrap {
  position: relative;
  flex-shrink: 0;
}
#wiki-sim-panel .wiki-sim-attach-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--zp-card);
  border: 1px solid var(--zp-divider);
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, border-color .15s, transform .05s;
  box-shadow: var(--zp-shadow);
}
#wiki-sim-panel .wiki-sim-attach-btn:hover {
  background: #f9fafb;
  color: var(--zp-green-dk);
  border-color: var(--zp-green);
}
#wiki-sim-panel .wiki-sim-attach-btn:active { transform: scale(0.96); }
#wiki-sim-panel .wiki-sim-attach-btn[aria-expanded="true"] {
  background: var(--zp-green);
  color: white;
  border-color: var(--zp-green);
}

#wiki-sim-panel .wiki-sim-attach-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 30;
  animation: zpAttachPop .15s ease-out;
}
#wiki-sim-panel .wiki-sim-attach-btn[aria-expanded="true"] + .wiki-sim-attach-menu {
  display: flex;
}
@keyframes zpAttachPop {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
#wiki-sim-panel .wiki-sim-attach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  border: none;
  border-radius: 999px;
  background: var(--zp-card);
  color: var(--zp-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  white-space: nowrap;
  transition: background .12s, transform .05s;
}
#wiki-sim-panel .wiki-sim-attach-item:hover {
  background: #f0fdf4;
  color: var(--zp-green-dk);
}
#wiki-sim-panel .wiki-sim-attach-item:active { transform: scale(0.97); }
#wiki-sim-panel .wiki-sim-attach-item svg {
  flex-shrink: 0;
  fill: var(--zp-green);
}

/* Stack: attachments-strip boven, textarea daaronder */
#wiki-sim-panel .wiki-sim-input-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

/* Bijlage-chips (boven textarea) */
#wiki-sim-panel .wiki-sim-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
#wiki-sim-panel .wiki-sim-attachments:empty { display: none; }
#wiki-sim-panel .wiki-sim-att-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--zp-card);
  border: 1px solid var(--zp-divider);
  border-radius: 12px;
  padding: 4px 8px 4px 4px;
  font-size: 11px;
  color: var(--zp-text);
  box-shadow: var(--zp-shadow);
  max-width: 220px;
}
#wiki-sim-panel .wiki-sim-att-chip img,
#wiki-sim-panel .wiki-sim-att-chip .wiki-sim-att-thumb-fallback {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #6b7280;
}
#wiki-sim-panel .wiki-sim-att-chip .wiki-sim-att-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
#wiki-sim-panel .wiki-sim-att-chip .wiki-sim-att-remove {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.06);
  color: #6b7280;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  margin-left: 4px;
  transition: background .12s, color .12s;
}
#wiki-sim-panel .wiki-sim-att-chip .wiki-sim-att-remove:hover {
  background: #fecaca;
  color: #b91c1c;
}

/* Bubble: image-bijlage gerendered in user-bericht */
#wiki-sim-chat .wiki-sim-bubble.user .wiki-sim-bubble-imgs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
#wiki-sim-chat .wiki-sim-bubble.user .wiki-sim-bubble-imgs img {
  max-width: 220px;
  max-height: 180px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(255,255,255,0.2);
}

/* --- Hidden native provider select (driven by the model-chip) --- */
.wiki-sim-provider-hidden { display: none !important; }

/* --- Model chip: rests in the header, opens a popover with checkmarks --- */
#wiki-sim-panel .wiki-sim-model-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 14px;
  border-radius: 999px;
  background: var(--zp-card);
  box-shadow: var(--zp-shadow);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--zp-text);
  user-select: none;
  margin-left: auto;
  outline: none;
  transition: box-shadow .15s, transform .05s;
}
#wiki-sim-panel .wiki-sim-model-chip:hover { box-shadow: var(--zp-shadow-h); }
#wiki-sim-panel .wiki-sim-model-chip:active { transform: scale(0.98); }
#wiki-sim-panel .wiki-sim-model-chip:focus-visible { box-shadow: 0 0 0 3px rgba(46,204,113,0.2), var(--zp-shadow); }

#wiki-sim-panel .wiki-sim-model-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--zp-green);
  flex-shrink: 0;
}
#wiki-sim-panel .wiki-sim-model-chip[data-value="gemini"] .wiki-sim-model-dot { background: #4285F4; }
#wiki-sim-panel .wiki-sim-model-chip[data-value="claude-sonnet"] .wiki-sim-model-dot { background: #C8744E; }
#wiki-sim-panel .wiki-sim-model-chip[data-value="claude-opus"] .wiki-sim-model-dot { background: #8B4FBF; }

#wiki-sim-panel .wiki-sim-model-caret {
  opacity: 0.55;
  transition: transform .15s;
}
#wiki-sim-panel .wiki-sim-model-chip[aria-expanded="true"] .wiki-sim-model-caret {
  transform: rotate(180deg);
}

/* The popover */
#wiki-sim-panel .wiki-sim-model-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--zp-card);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
  padding: 6px;
  display: none;
  flex-direction: column;
  z-index: 50;
  cursor: default;
}
#wiki-sim-panel .wiki-sim-model-chip[aria-expanded="true"] .wiki-sim-model-popover {
  display: flex;
  animation: zpModelPop .14s ease-out;
}
@keyframes zpModelPop {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

#wiki-sim-panel .wiki-sim-model-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  color: var(--zp-text);
  transition: background .12s;
}
#wiki-sim-panel .wiki-sim-model-option:hover { background: rgba(0,0,0,0.04); }

#wiki-sim-panel .wiki-sim-model-check {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--zp-green);
  visibility: hidden;
}
#wiki-sim-panel .wiki-sim-model-option.is-selected .wiki-sim-model-check {
  visibility: visible;
}
#wiki-sim-panel .wiki-sim-model-option.is-selected {
  background: rgba(46,204,113,0.06);
}

#wiki-sim-panel .wiki-sim-model-option-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  flex: 1;
}
#wiki-sim-panel .wiki-sim-model-option-text strong {
  font-size: 13px;
  font-weight: 600;
}
#wiki-sim-panel .wiki-sim-model-option-text small {
  font-size: 11px;
  color: var(--zp-muted);
  margin-top: 1px;
}

/* --- Input area: white floating capsule --- */
#wiki-sim-panel .wiki-sim-input-area {
  background: var(--zp-bg);
  border-top: none;
  padding: 8px 14px 16px !important;
  align-items: center;
  gap: 8px;
  max-width: 800px;
}
#wiki-sim-panel .wiki-sim-input-area textarea {
  background: var(--zp-card);
  border: 1.5px solid var(--zp-green);
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 14px;
  min-height: 44px;
  max-height: 120px;
  box-shadow: var(--zp-shadow);
}
#wiki-sim-panel .wiki-sim-input-area textarea:focus {
  border-color: var(--zp-green-dk);
  box-shadow: 0 0 0 3px rgba(46,204,113,0.12);
}
#wiki-sim-panel .wiki-sim-send-btn {
  background: var(--zp-green);
  width: 40px;
  height: 40px;
  box-shadow: var(--zp-shadow);
}
#wiki-sim-panel .wiki-sim-send-btn:hover {
  background: var(--zp-green-dk);
}

/* --- Status dots inside history (open/correct/etc) — keep --- */
#wiki-sim-history .wiki-ask-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* On smaller widths, give the chat full breathing room */
@media (max-width: 720px) {
  #wiki-sim-panel .wiki-sim-input-area { padding: 8px 10px 14px !important; }
  #wiki-sim-chat { padding: 12px 12px 16px !important; }
  #wiki-sim-chat .wiki-sim-bubble.user { max-width: 84%; }
  #wiki-sim-chat .wiki-sim-bubble.ai { max-width: 100%; }
}

/* === Instellingen pagina — horizontale pill-tabbar IDENTIEK aan Kennisbank ===
   Match exact Kennisbank-tabbar: één rounded-full witte pill container met
   border rondom, kleine padding (4px), tabs als pills binnen, dark active. */
@media (min-width: 769px) {
  .settings-panel-body {
    flex-direction: column !important;
    overflow: hidden;
    background: #f8fafc;
  }
  .settings-categories {
    /* Eén rounded-full pill container — EXACT zelfde stijl als #kbv2-tabbar */
    width: auto !important;
    margin: 18px 24px 4px 24px !important;
    border: 1px solid #e2e8f0 !important;
    border-right: 1px solid #e2e8f0 !important;
    border-radius: 9999px !important;
    padding: 4px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
  }
  /* "Persoonlijk" / "Beheer" group-titel weg */
  .settings-categories .settings-cat-title { display: none !important; }
  .settings-categories .settings-cat-group {
    display: flex;
    gap: 2px;
    margin: 0 !important;
  }
  /* Geen divider tussen groepen — net als Kennisbank-tabbar, één doorlopende rij */
  .settings-categories .settings-cat-group + .settings-cat-group {
    margin-left: 0 !important;
    padding-left: 0 !important;
    border-left: none !important;
  }
  .settings-categories .settings-cat-btn {
    width: auto !important;
    padding: 6px 14px !important;
    border-radius: 9999px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    background: transparent !important;
    border: none !important;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
  }
  .settings-categories .settings-cat-btn svg { color: currentColor !important; }
  .settings-categories .settings-cat-btn:hover:not(.active) {
    background: #f1f5f9 !important;
    color: #0f172a !important;
  }
  .settings-categories .settings-cat-btn.active {
    background: #0f172a !important;
    color: #ffffff !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15);
  }
  .settings-categories .settings-cat-btn.active svg { color: #ffffff !important; }
  /* Header en content blijven hun normale layout */
  .settings-panel-header {
    background: #ffffff;
    padding: 24px 32px 16px !important;
  }
  .settings-content {
    padding: 18px 32px 32px !important;
    background: #f8fafc;
  }
}

/* === Kennisbank v2 → Wiki-tab layout ===
   Twee-koloms: projecten links (260px), pagina-list + content rechts.
   Beide in afzonderlijke kaarten op de grijze surface. */
.kbv2-wiki-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 14px;
  min-height: 480px;
}
@media (max-width: 900px) {
  .kbv2-wiki-layout { grid-template-columns: 1fr; }
}
.kbv2-wiki-projects {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}
.kbv2-wiki-projects-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
}
.kbv2-wiki-projects-head h3 {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}
.kbv2-wiki-projects-count {
  font-size: 11px;
  color: #94a3b8;
}
.kbv2-wiki-projects-list {
  overflow-y: auto;
  padding: 6px;
  flex: 1;
}
.kbv2-wiki-loading {
  padding: 20px;
  font-size: 13px;
  color: #94a3b8;
  text-align: center;
}
.kbv2-wiki-proj-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #334155;
  transition: background 0.12s, color 0.12s;
  user-select: none;
}
.kbv2-wiki-proj-item:hover {
  background: #f8fafc;
  color: #0f172a;
}
.kbv2-wiki-proj-item.is-active {
  background: #eff6ff;
  color: #1e40af;
  font-weight: 600;
}
.kbv2-wiki-proj-item-pages {
  margin-left: auto;
  font-size: 11px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

/* Pages pane (rechter kolom) */
.kbv2-wiki-main {
  display: flex;
  min-height: 480px;
}
.kbv2-wiki-pages {
  flex: 1;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.kbv2-wiki-pages-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  gap: 12px;
}
.kbv2-wiki-pages-head h3 {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kbv2-wiki-pages-list {
  overflow-y: auto;
  padding: 8px;
}
.kbv2-wiki-page-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #334155;
  transition: background 0.12s, color 0.12s;
}
.kbv2-wiki-page-row:hover {
  background: #f8fafc;
  color: #0f172a;
}
.kbv2-wiki-page-row svg { color: #94a3b8; flex-shrink: 0; }

/* Empty-state */
.kbv2-wiki-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 20px;
  text-align: center;
  flex: 1;
}
.kbv2-wiki-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #f5f3ff;
  color: #7c3aed;
}
.kbv2-wiki-empty-title {
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  margin: 0;
}
.kbv2-wiki-empty-sub {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

/* Page content view */
.kbv2-wiki-content {
  padding: 28px 36px 48px;
  overflow-y: auto;
  flex: 1;
  font-size: 14px;
  line-height: 1.7;
  color: #1e293b;
  max-width: 920px; /* leesbaarheid: voorkomt te lange regels op brede schermen */
}
.kbv2-wiki-content h1, .kbv2-wiki-content h2, .kbv2-wiki-content h3 {
  color: #0f172a;
  font-weight: 700;
  margin: 1.5em 0 0.5em;
}
.kbv2-wiki-content h1 { font-size: 22px; }
.kbv2-wiki-content h2 { font-size: 18px; }
.kbv2-wiki-content h3 { font-size: 15px; }
.kbv2-wiki-content p { margin: 0.5em 0; }
.kbv2-wiki-content a { color: #2563eb; }
.kbv2-wiki-content ul, .kbv2-wiki-content ol { margin: 0.5em 0; padding-left: 22px; }
.kbv2-wiki-content pre {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  overflow-x: auto;
}
.kbv2-wiki-content code { font-size: 12px; background: #f1f5f9; padding: 1px 4px; border-radius: 3px; color: #be185d; }
.kbv2-wiki-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 12px 0;
  border: 1px solid #e5e7eb;
  background: #fafbfc;
  display: block;
}
.kbv2-wiki-content img.wiki-image-missing {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
  padding: 14px;
  font-size: 12px;
}
.kbv2-wiki-content table.wiki-table {
  width: auto;
  min-width: 50%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 13px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}
.kbv2-wiki-content table.wiki-table th,
.kbv2-wiki-content table.wiki-table td {
  padding: 8px 14px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  vertical-align: top;
}
.kbv2-wiki-content table.wiki-table tr:last-child th,
.kbv2-wiki-content table.wiki-table tr:last-child td { border-bottom: 0; }
.kbv2-wiki-content table.wiki-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #0f172a;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e5e7eb;
}
.kbv2-wiki-content table.wiki-table tr:hover td { background: #fafbfc; }
.kbv2-wiki-content blockquote {
  border-left: 3px solid #2563eb;
  background: #eff6ff;
  margin: 12px 0;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  color: #1e3a8a;
  font-style: italic;
}
.kbv2-wiki-content .wiki-link {
  color: #2563eb;
  text-decoration: none;
  border-bottom: 1px dotted #93c5fd;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.kbv2-wiki-content .wiki-link:hover {
  color: #1d4ed8;
  border-bottom-color: #2563eb;
}
.kbv2-wiki-content .wiki-pipe { color: #cbd5e1; }
.kbv2-wiki-content hr {
  border: 0;
  height: 1px;
  background: #e5e7eb;
  margin: 20px 0;
}
.kbv2-wiki-content ul li::marker,
.kbv2-wiki-content ol li::marker { color: #94a3b8; }

.kbv2-wiki-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: background 0.12s;
}
.kbv2-wiki-back-btn:hover { background: #f8fafc; }

.kbv2-wiki-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s;
}
.kbv2-wiki-edit-btn:hover { background: #eff6ff; border-color: #bfdbfe; }
.kbv2-wiki-edit-btn:disabled { opacity: 0.5; cursor: default; }

/* === Wiki editor (split-view Textile source + live preview) === */
.wedit-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #fafbfc;
  flex-wrap: wrap;
}
.wedit-toolbar button {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  color: #475569;
  font-family: inherit;
  min-width: 30px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.wedit-toolbar button:hover { background: #f1f5f9; color: #0f172a; }
.wedit-toolbar .wedit-sep {
  width: 1px;
  height: 18px;
  background: #e5e7eb;
  margin: 0 4px;
}
.wedit-toolbar .wedit-spacer { flex: 1; }
.wedit-toolbar .wedit-hint {
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
}
/* Single-column edit-mode (geen split-view) */
.wedit-single {
  flex: 1;
  overflow: auto;
  background: #fafbfc;
  min-height: 400px;
}
.wedit-textarea-single {
  width: 100%;
  height: 100%;
  min-height: 400px;
  border: 0;
  outline: 0;
  padding: 28px 36px 48px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.7;
  background: transparent;
  resize: none;
  color: #0f172a;
  box-sizing: border-box;
  max-width: 920px;
  display: block;
}
.wedit-textarea-single.wedit-dragover {
  background: #eff6ff;
  box-shadow: inset 0 0 0 2px #2563eb;
}
.wedit-status {
  padding: 8px 16px;
  font-size: 12px;
  border-top: 1px solid #e5e7eb;
  background: #fafbfc;
  min-height: 32px;
  color: #64748b;
}
.wiki-image-pending {
  border-color: #fde68a !important;
  background: #fef3c7 !important;
}

/* === Server-logs viewer (admin Beheer) === */
.logs-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  align-items: center;
}
.logs-select {
  flex: 1;
  min-width: 260px;
  padding: 7px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 12.5px;
  font-family: inherit;
  background: #ffffff;
}
.logs-select-small {
  padding: 7px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 12.5px;
  font-family: inherit;
  background: #ffffff;
}
.logs-filter {
  flex: 1;
  min-width: 180px;
  padding: 7px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 12.5px;
  font-family: inherit;
  background: #ffffff;
}
.logs-filter:focus,
.logs-select:focus,
.logs-select-small:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.logs-output {
  background: #0f172a;
  color: #e2e8f0;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.55;
  padding: 14px 16px;
  border-radius: 10px;
  max-height: 480px;
  min-height: 200px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
@media (max-width: 900px) {
  .wedit-split { grid-template-columns: 1fr; }
  .wedit-source { border-right: 0; border-bottom: 1px solid #e5e7eb; }
}

/* === Documenten-lijst card === */
.kbv2-pdf-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  overflow: hidden;
}
.kbv2-pdf-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid #f1f5f9;
}
.kbv2-pdf-card-titlerow {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.kbv2-pdf-card-titlerow h3 {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}
.kbv2-pdf-card-count {
  font-size: 12px;
  color: #94a3b8;
}

.kbv2-pdf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 44px 20px;
  text-align: center;
}
.kbv2-pdf-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #94a3b8;
}
.kbv2-pdf-empty-title {
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  margin: 0;
}
.kbv2-pdf-empty-sub {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

/* === Documenten-lijst row layout — strakke uitlijning + nette knoppen === */
.kbv2-pdf-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: start;
  gap: 14px;
  padding: 12px 20px;
  transition: background 0.12s;
  border-top: 1px solid #f1f5f9;
}
.kbv2-pdf-row:first-child { border-top: none; }
.kbv2-pdf-row:hover { background: #f8fafc; }

/* Artikel-rijen hebben geen thumbnail-kolom → 2-koloms grid, anders valt de
   content in de 32px-kolom en breekt de tekst per woord af. */
.kbv2-pdf-row[data-article-row] { grid-template-columns: 1fr auto; }
/* Artikel-titel minder zwaar (zoals Vraag-analyse), niet de PDF-titels. */
.kbv2-pdf-row[data-article-row] .kbv2-pdf-title { font-weight: 500; }
/* In de Artikelen-lijst is er al een potlood-knop op de rij → de Bewerken-knop
   in het groene analyse-vlak is dubbel. Alleen hier verbergen (niet in Vraag-stellen). */
#kbv2-articles-list .ka-edit-btn { display: none !important; }

/* PDF-thumbnail: realistische witte sheet met rode PDF-badge.
   Centeert visueel op de title-row (eerste tekstregel). */
.kbv2-pdf-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.08));
  /* lijn-uit met title-row baseline (titel = ~20px hoog) */
  padding-top: 3px;
  width: 32px;
}

.kbv2-pdf-main { min-width: 0; }
.kbv2-pdf-titlerow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 24px;
}
.kbv2-pdf-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.kbv2-pdf-title:hover { color: #2563eb; }
.kbv2-pdf-meta {
  margin-top: 2px;
  font-size: 12px;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kbv2-pdf-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 2px;
}

/* Mobiel: tightere rij-padding/gap zodat de titel + badges + actie-iconen
   passen op 390px (grid + min-width:0 voorkomt overflow; title truncate al). */
@media (max-width: 768px) {
  .kbv2-pdf-row { padding: 12px 14px; gap: 10px; }
  .kbv2-pdf-actions { gap: 2px; }
}

/* Icon-only buttons — geen border, geen focus-outline, alleen zachte hover */
.kbv2-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  outline: none;
  transition: background 0.12s, color 0.12s;
  padding: 0;
}
.kbv2-icon-btn:hover { background: #f1f5f9; color: #334155; }
.kbv2-icon-btn:focus { outline: none; box-shadow: none; }
.kbv2-icon-btn:focus-visible { box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3); }
.kbv2-icon-btn-danger:hover { background: #fef2f2; color: #dc2626; }

/* OCR-badge: laat zien dat PDF via Gemini Vision OCR is geïndexeerd
   (i.p.v. native tekstlaag). Subtiele paarse pill. */
.kbv2-pdf-ocr-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #7c3aed;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: 6px;
  padding: 2px 6px;
  text-transform: uppercase;
}

/* PDF zichtbaarheid-toggle: extern (klant-antwoorden) vs intern (alleen medewerkers) */
.kbv2-pdf-vis {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  transition: filter 0.12s;
}
.kbv2-pdf-vis:hover { filter: brightness(0.96); }
.kbv2-pdf-vis.is-extern {
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.kbv2-pdf-vis.is-intern {
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

/* Message highlight wanneer je via een WhatsApp-source-tag naar dit
   exacte bericht in de chat-view springt. Tijdelijke gele gloed (~2s). */
@keyframes message-jump-pulse {
  0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.55); background-color: rgba(254, 243, 199, 0.7); }
  50% { box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.15); background-color: rgba(254, 243, 199, 0.4); }
  100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); background-color: transparent; }
}
.message.message-jump-highlight {
  animation: message-jump-pulse 2.1s ease-out;
  border-radius: 8px;
  position: relative;
  z-index: 1;
}

/* === FINAL OVERRIDE — NUKE-FROM-ORBIT (laatste woord in cascade) ===
   Ask-mode: maak ALLES binnen #wiki-sim-panel + de container transparent,
   met één duidelijke grijze achtergrond op de root. Pure JS-zekere selectors. */

/* 1. De ROOT-container krijgt slate-50 (#f8fafc) — exact gelijk aan Kennisbank
   en de Vraag-stellen v2 layout. Eerder was dit #f5f5f5 (Chats-pagina kleur),
   maar v2 sluit aan op Kennisbank-stijl. */
#wiki-panel.wiki-panel.ask-mode {
  background: #f8fafc !important;
  background-color: #f8fafc !important;
}

/* 2. ALLES binnen #wiki-sim-panel wordt transparent, behalve specifieke
   elementen die hun eigen kleur NODIG hebben (bubbles, textarea, buttons). */
#wiki-panel.wiki-panel.ask-mode #wiki-sim-panel,
#wiki-panel.wiki-panel.ask-mode #wiki-sim-panel #wiki-sim-chat,
#wiki-panel.wiki-panel.ask-mode #wiki-sim-panel .wiki-sim-chat,
#wiki-panel.wiki-panel.ask-mode #wiki-sim-panel .wiki-sim-empty,
#wiki-panel.wiki-panel.ask-mode #wiki-sim-panel .wiki-sim-input-area,
#wiki-panel.wiki-panel.ask-mode #wiki-sim-panel .wiki-sim-input-stack,
#wiki-panel.wiki-panel.ask-mode #wiki-sim-panel .wiki-sim-attach-wrap,
#wiki-panel.wiki-panel.ask-mode #wiki-sim-panel .vraag-faq-panel,
#wiki-panel.wiki-panel.ask-mode #wiki-sim-panel .vraag-mijn-panel,
#wiki-panel.wiki-panel.ask-mode #wiki-sim-panel .vraag-settings-panel {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* 3. Behoud bubbles wel hun kleur (AI-bericht = wit, user = groen pill) */
#wiki-panel.wiki-panel.ask-mode .wiki-sim-bubble.ai {
  background: #ffffff !important;
  background-color: #ffffff !important;
}

/* ==========================================================================
   AUTO-ANTWOORDEN restyle — overrides om in lijn te brengen met
   Vraag-stellen / Kennisbank-v2 design system.
   - Root panel: lichtgrijs (#f5f5f5) zoals Chats + Vraag-stellen
   - Sidebar links: floating witte kaart met margin/radius/shadow
   - Content area rechts: transparent op grijs, padding rondom
   - Mode-tabs (Flows/Logboek/Instellingen) → segmented pill
   - Channel-tabs (Ordergo/VWA) → idem
   - Stat-tiles → uniforme layout met label-top + grote waarde + accent-bar
   - Dashboard-header + recent-list → modernere typografie
   ========================================================================== */

@media (min-width: 769px) {
  /* Root: grijs surround zodat sidebar én content op één lichtgrijs vlak liggen */
  .ar-panel {
    background: #f5f5f5 !important;
    padding: 0 !important;
  }
  /* Sidebar links: platte kolom (geen tegel/kaart-uiterlijk) — alleen border-right scheidt 'm */
  .ar-panel-sidebar {
    background: #ffffff !important;
    border: 0 !important;
    border-right: 1px solid #e2e8f0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
  }
  /* Content area rechts: transparent (laat grijs doorzien), met padding */
  .ar-content-area {
    background: transparent !important;
    padding: 18px 18px 14px !important;
    overflow-y: auto !important;
  }
  /* Dashboard zelf: geen extra achtergrond, alleen layout */
  .ar-dashboard {
    background: transparent !important;
    padding: 0 !important;
  }
}

/* Mode tabs (Flows/Logboek/Instellingen) — segmented pill VWA-stijl */
.ar-mode-tabs {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 999px !important;
  padding: 4px !important;
  gap: 2px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.ar-mode-tab {
  flex: 1;
  padding: 7px 14px !important;
  border-radius: 999px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ar-mode-tab:hover:not(.active) {
  background: #f8fafc !important;
  color: #334155 !important;
}
.ar-mode-tab.active {
  background: #0f172a !important;
  color: #ffffff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15) !important;
}

/* Channel-tabs (Ordergo/VWA) — segmented pill in dezelfde stijl */
.ar-channel-tabs {
  background: #f1f5f9 !important;
  border-radius: 999px !important;
  padding: 4px !important;
  gap: 2px !important;
  margin: 12px 16px 6px !important;
}
.ar-channel-tab {
  flex: 1;
  padding: 7px 12px !important;
  border-radius: 999px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  background: transparent !important;
  border: none !important;
  transition: all 0.15s;
}
.ar-channel-tab:hover:not(.active) { color: #0f172a !important; background: #ffffff !important; }
.ar-channel-tab.active {
  background: #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

/* Dashboard header — moderner */
.ar-dash-header {
  margin-bottom: 22px !important;
  padding-bottom: 0 !important;
  border: none !important;
}
.ar-dash-header h3 {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: -0.01em;
}
.ar-dash-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b !important;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 5px 12px 5px 10px;
}

/* Stat-grid: meer ruimte tussen tegels (24px ipv 12px), uniforme layout */
.ar-stats-grid {
  gap: 18px !important;
  margin-bottom: 18px !important;
}
@media (max-width: 1200px) {
  .ar-stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Stat-card EXACT zoals kbv2-stat-tile: 16px border-radius, soft shadow,
   uniforme typografie label/waarde, subtle hover. Geen accent-bar meer —
   te druk voor uniforme look. Indien onderscheidt nodig: kleur via icon-dot. */
.ar-stat-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  padding: 16px 18px !important;
  text-align: left !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 110px;
  position: relative;
  overflow: hidden;
}
.ar-stat-card:hover {
  border-color: #cbd5e1 !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}
.ar-stat-label {
  order: -1;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #334155 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  margin-top: 0 !important;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Kleine gekleurde dot links naast de label, soort visuele "icon" zonder
   svg per tegel. Per-type kleur via :before pseudo-class op label. */
.ar-stat-label::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}
.ar-stat-sent .ar-stat-label::before { background: #10b981; }
.ar-stat-cancelled .ar-stat-label::before { background: #f59e0b; }
.ar-stat-error .ar-stat-label::before { background: #ef4444; }
.ar-stat-content .ar-stat-label::before { background: #3b82f6; }
.ar-stat-urgent .ar-stat-label::before { background: #ef4444; }
.ar-stat-general .ar-stat-label::before { background: #94a3b8; }
.ar-stat-pending .ar-stat-label::before { background: #6366f1; }
.ar-stat-number {
  font-size: 30px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  color: #0f172a !important;
  font-variant-numeric: tabular-nums;
  line-height: 1.1 !important;
}
/* Reset originele number-color overrides (alle cijfers zelfde donker) */
.ar-stat-sent .ar-stat-number,
.ar-stat-cancelled .ar-stat-number,
.ar-stat-error .ar-stat-number,
.ar-stat-content .ar-stat-number,
.ar-stat-urgent .ar-stat-number,
.ar-stat-general .ar-stat-number,
.ar-stat-pending .ar-stat-number {
  color: #0f172a !important;
}

/* Recent activity-list moderner — kbv2 kaart-stijl */
.ar-recent-section h4 {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  margin-bottom: 12px !important;
}
.ar-recent-list {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
  overflow: hidden;
}
.ar-recent-item {
  border-bottom: 1px solid #f1f5f9 !important;
  padding: 14px 18px !important;
  transition: background 0.12s;
}
.ar-recent-item:hover {
  background: #f8fafc !important;
}
.ar-recent-icon {
  width: 32px !important;
  height: 32px !important;
  background: #f1f5f9;
  color: #64748b;
  font-size: 14px !important;
}

/* Flow-list (sidebar) — kbv2-stat-tile-achtige row-stijl */
.ar-flow-item {
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  padding: 10px 12px !important;
  margin: 4px 8px !important;
  box-shadow: none !important;
  transition: border-color 0.12s, background 0.12s;
}
.ar-flow-item:hover {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
}
.ar-flow-item-name {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
}
.ar-flow-item-meta {
  font-size: 11px !important;
  color: #94a3b8 !important;
}

/* "Nieuwe Flow"-knop in sidebar: zelfde dark pill als andere primary CTAs */
.ar-flows-header .ar-btn-primary {
  background: #0f172a !important;
  border-color: #0f172a !important;
  border-radius: 9999px !important;
  font-weight: 600 !important;
  padding: 9px 16px !important;
  font-size: 13px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: background 0.12s;
}
.ar-flows-header .ar-btn-primary:hover {
  background: #1e293b !important;
}

/* Sidebar header h2 "Auto-antwoorden": iets moderner spacing */
.ar-sidebar-header {
  padding: 18px 16px 14px !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

/* Sidebar header titel iets aanpassen voor consistentie */
.ar-sidebar-header h2 {
  font-size: 17px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: -0.01em;
  margin-bottom: 12px !important;
}

/* Feedback-stats bar zachter */
.ar-feedback-stats-bar {
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
}

/* ============================================================
   DATASCHEMA (Instellingen → Dataschema)
   Override de smalle 760px max-width van .settings-cat-section
   zodat de domein-grid kan ademen op grote schermen.
   ============================================================ */
.settings-cat-section[data-settings-cat-content="dataschema"] {
  max-width: 1400px;
}
.settings-cat-section[data-settings-cat-content="dataschema"] .kb-card {
  padding: 14px 16px;
}
.ds-toolbar {
  display: flex !important;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.ds-toolbar input[type="text"] {
  flex: 0 1 280px;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
}
.ds-toolbar input[type="text"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.ds-toolbar .toggle-label {
  margin: 0;
  font-size: 13px;
  color: #475569;
}
.ds-stats {
  display: flex !important;
  gap: 8px !important;
  flex-wrap: wrap;
  font-size: 13px;
  color: #475569;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid #e2e8f0;
}
#ds-refresh.ds-refreshing svg { animation: spin-tag .8s linear infinite; }
#ds-refresh:disabled { opacity: .6; cursor: default; }
/* "X niet-ingedeeld — AI-classificeer" knop in de stats-rij */
.ds-classify-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  color: #b45309;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s, border-color .12s;
}
.ds-classify-btn:hover { background: #fef3c7; border-color: #fbbf24; }
.ds-classify-btn:disabled { opacity: .7; cursor: default; }
/* AI-beschrijving op tabel-kaart + in detail */
.ds-card-desc {
  font-size: 11px;
  line-height: 1.4;
  color: #64748b;
  margin-top: 4px;
}
.ds-detail-desc {
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
  margin: 4px 0 10px;
  font-style: italic;
}
.ds-stats > span {
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.ds-stats > span strong {
  color: #0f172a;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ds-stats > span.ds-stats-meta {
  background: transparent;
  color: #94a3b8;
  margin-left: auto;
  font-size: 12px;
  padding: 4px 0;
}

.ds-viewport {
  display: flex !important;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}
.ds-loading {
  padding: 32px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}
.ds-loading.ds-error { color: #dc2626; }

.ds-domain {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--ds-color, #94a3b8);
  border-radius: 10px;
  padding: 14px 16px;
}
.ds-domain-head {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.ds-domain-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}
.ds-domain-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ds-color, #94a3b8);
}
.ds-domain-count {
  margin-left: auto;
  font-size: 12px;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 10px;
}
.ds-domain-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
@media (min-width: 1100px) {
  .ds-domain-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

.ds-table-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.ds-table-card:hover {
  background: #fff;
  border-color: var(--ds-color, #94a3b8);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.ds-table-card.ds-empty { opacity: 0.55; }
.ds-table-card.ds-highlight {
  background: #fff7ed;
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}
.ds-card-head {
  display: flex !important;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.ds-card-head strong {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
}
.ds-rowcount {
  font-size: 11px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.ds-card-meta {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 6px;
}
.ds-card-rels {
  display: flex !important;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.ds-rel {
  display: inline-block;
  font-size: 10px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  padding: 2px 6px;
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #bae6fd;
}
.ds-rel:hover { background: #bae6fd; }
.ds-rel.ds-rel-implicit {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.ds-rel.ds-rel-implicit:hover { background: #fde68a; }

/* Detail-card */
.ds-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.ds-detail-head h3 {
  margin: 0;
  font-size: 16px;
  display: flex;
  align-items: center;
}
.ds-detail-head h3 code {
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 14px;
}
.ds-detail-domain {
  font-size: 13px;
  color: #475569;
  margin-bottom: 14px;
}
#ds-detail-body h4 {
  margin: 18px 0 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ds-cols-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}
.ds-cols-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.ds-cols-table th,
.ds-cols-table td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid #f1f5f9;
}
.ds-cols-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
}
.ds-cols-table tr:last-child td { border-bottom: none; }
.ds-cols-table code {
  background: transparent;
  font-size: 12px;
  color: #0f172a;
}
.ds-rel-list, .ds-index-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ds-rel-list li, .ds-index-list li {
  font-size: 12px;
  padding: 6px 10px;
  background: #f8fafc;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ds-rel-link {
  color: #0369a1;
  text-decoration: none;
}
.ds-rel-link:hover { text-decoration: underline; }
.ds-rel-tag {
  font-size: 10px;
  padding: 2px 6px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.ds-rel-tag.ds-rel-tag-fk {
  background: #dcfce7;
  color: #166534;
}

/* ============================================================
   DATASCHEMA — Diagram subtab (Mermaid ER)
   ============================================================ */
.ds-view-pane.hidden { display: none !important; }
.ds-diagram-toolbar {
  display: flex !important;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ds-diagram-label {
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}
.ds-diagram-domains {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
}
.ds-domain-btn {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ds-domain-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}
.ds-domain-btn.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.ds-domain-btn-all {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
  font-weight: 600;
}
.ds-domain-btn-all:hover {
  background: #1e293b;
  border-color: #1e293b;
}
.ds-domain-btn-all.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.15);
}

/* Legenda */
.ds-diagram-legend {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
  color: #475569;
}
.ds-legend-title {
  font-weight: 600;
  color: #334155;
}
.ds-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.ds-legend-box {
  display: inline-block;
  width: 28px;
  height: 14px;
  border-radius: 3px;
  background: #fff;
}
.ds-legend-box-main { border: 1px solid #475569; }
.ds-legend-box-ext  { border: 1px dashed #475569; }
.ds-legend-arrow { display: inline-block; vertical-align: middle; }
.ds-legend-item-color {
  background: linear-gradient(90deg, #2563eb, #f59e0b, #8b5cf6, #0ea5e9, #10b981, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 600;
}
.ds-diagram-host {
  margin-top: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 28px 24px;
  min-height: 200px;
  overflow: auto;
}
.ds-diagram-host .nodeLabel,
.ds-diagram-host .edgeLabel {
  font-family: 'Inter', system-ui, sans-serif;
}
/* Mermaid HTML-labels worden in een foreignObject getekend; bij bold-tekst
   berekent Mermaid soms een te krappe rect. nowrap + visible overflow
   voorkomt dat tabel-namen worden afgeknipt. */
.ds-diagram-host .nodeLabel {
  white-space: nowrap !important;
  padding: 4px 6px;
}
.ds-diagram-host .nodeLabel b,
.ds-diagram-host .nodeLabel small {
  white-space: nowrap;
}
.ds-diagram-host foreignObject {
  overflow: visible;
}
.ds-diagram-host .edgeLabel {
  background: #fff;
  padding: 1px 6px;
}
.ds-diagram-host .edgeLabel rect {
  fill: #fff;
}
.ds-diagram-meta {
  font-size: 13px;
  color: #475569;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}
.ds-diagram-meta strong { color: #0f172a; }
.ds-diagram-svg {
  text-align: center;
  overflow-x: auto;
}
.ds-diagram-svg svg {
  max-width: 100%;
  height: auto;
}

/* ==========================================================
   IN-APP HELPLAAG — page-help + help-info ⓘ + help-popover
   Één component, overal hergebruikt. Versie 1.0 (2026-06-07)
   ========================================================== */

/* Per-pagina helpblok — lichtblauw kader, stijl van .ar-node-help */
.page-help {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 13px;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.page-help-icon {
  flex-shrink: 0;
  margin-top: 1px;
  color: #2563eb;
  opacity: 0.7;
}
.page-help-body strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 2px;
}
.page-help-body span {
  display: block;
  font-size: 12px;
  line-height: 1.45;
  color: #475569;
}

/* ⓘ help-info knop — subtiel grijs, klikbaar */
.help-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: #94a3b8;
  border-radius: 50%;
  flex-shrink: 0;
  vertical-align: middle;
  margin-left: 5px;
  transition: color 0.15s, background 0.15s;
  /* Touch-target vergroten zonder layout te verstoren */
  position: relative;
}
.help-info::before {
  content: '';
  position: absolute;
  inset: -7px;
}
.help-info:hover,
.help-info:focus-visible {
  color: #2563eb;
  background: #dbeafe;
  outline: none;
}
.help-info svg {
  display: block;
}

/* Globale help-popover — één element, JS positioneert het */
#help-popover {
  position: fixed;
  z-index: 9000;
  max-width: 300px;
  min-width: 180px;
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.13);
  padding: 13px 15px 12px;
  display: none;
  font-family: 'Inter', sans-serif;
}
#help-popover.is-open {
  display: block;
}
#help-popover-title {
  font-size: 12px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 5px;
}
#help-popover-text {
  font-size: 12px;
  line-height: 1.5;
  color: #475569;
}
#help-popover-close {
  position: absolute;
  top: 8px;
  right: 9px;
  border: none;
  background: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  border-radius: 4px;
}
#help-popover-close:hover { color: #334155; }

/* Backdrop voor mobiele bottom-sheet — alleen zichtbaar op <=640px */
#help-backdrop {
  display: none;
}
@media (max-width: 640px) {
  #help-backdrop.is-open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 8999; /* onder #help-popover (9000) */
  }
}

/* Mobiel: popover als bottom-sheet — niet achter toetsenbord, niet buiten beeld */
@media (max-width: 640px) {
  #help-popover {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    max-height: 60vh;
    overflow-y: auto;
    border-radius: 16px 16px 0 0;
    padding: 20px 20px 28px;
    box-shadow: 0 -4px 32px rgba(0,0,0,0.18);
    /* Ruimte voor safe-area (iOS notch onderaan) */
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }
  #help-popover-title {
    font-size: 14px;
    margin-bottom: 8px;
    padding-right: 28px; /* ruimte voor sluitknop */
  }
  #help-popover-text {
    font-size: 13px;
    line-height: 1.55;
  }
  #help-popover-close {
    top: 16px;
    right: 16px;
    font-size: 22px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
  }
  /* Vergroot het tikdoel van ⓘ op touch */
  .help-info {
    width: 24px;
    height: 24px;
  }
  .help-info::before {
    inset: -4px;
  }
}

/* ============ RI DATE-RANGE PICKER (Redmine-issues filterbalk) ============ */
.ri-dr-wrap { position: relative; display: inline-block; }

.ri-dr-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px; color: #334155; font-weight: 500;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 8px 12px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
  transition: border-color .12s, box-shadow .12s;
}
.ri-dr-btn:hover { border-color: #cbd5e1; }
.ri-dr-btn[aria-expanded="true"] { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.ri-dr-btn svg:first-child { color: #64748b; flex: none; }
.ri-dr-caret { color: #94a3b8; flex: none; }

.ri-dr-pop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 70;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 16px;
  box-shadow: 0 16px 48px rgba(15,23,42,.18);
  font-family: 'Inter', system-ui, sans-serif;
  width: 540px; max-width: calc(100vw - 32px);
  overflow: hidden;
}
.ri-dr-pop.hidden { display: none; }

.ri-dr-body { display: flex; }

.ri-dr-cal { flex: 1; padding: 14px 16px; border-right: 1px solid #f1f5f9; min-width: 0; }
.ri-dr-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ri-dr-month { font-size: 14px; font-weight: 600; color: #0f172a; text-transform: capitalize; }
.ri-dr-nav {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px; border: 1px solid #e2e8f0;
  background: #fff; color: #475569; cursor: pointer; transition: background .12s, border-color .12s;
}
.ri-dr-nav:hover { background: #f8fafc; border-color: #cbd5e1; }

.ri-dr-dow { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }
.ri-dr-dow span { text-align: center; font-size: 11px; font-weight: 600; color: #94a3b8; padding: 4px 0; text-transform: uppercase; letter-spacing: .03em; }

.ri-dr-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ri-dr-cell { aspect-ratio: 1 / 1; min-height: 34px; }
.ri-dr-empty { background: transparent; }
.ri-dr-day {
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer;
  font-size: 13px; color: #334155; border-radius: 9px;
  font-family: inherit; padding: 0; position: relative;
  transition: background .1s, color .1s;
}
.ri-dr-day:hover { background: #eff6ff; }
.ri-dr-today { font-weight: 700; color: #2563eb; }
.ri-dr-today::after { content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: #2563eb; }
.ri-dr-in { background: #dbeafe; border-radius: 0; color: #1e3a8a; }
.ri-dr-sel { background: #2563eb !important; color: #fff !important; font-weight: 600; }
.ri-dr-sel.ri-dr-today::after { background: #fff; }
.ri-dr-sel-start { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ri-dr-sel-end { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.ri-dr-sel-single { border-radius: 9px !important; }

.ri-dr-quick {
  width: 180px; flex: none; padding: 12px 10px;
  display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
}
.ri-dr-quick button {
  text-align: left; border: none; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 13px; color: #475569; font-weight: 500;
  padding: 7px 10px; border-radius: 8px; transition: background .1s, color .1s;
}
.ri-dr-quick button:hover { background: #f1f5f9; color: #0f172a; }

.ri-dr-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-top: 1px solid #f1f5f9; background: #f8fafc; flex-wrap: wrap;
}
.ri-dr-fields { display: flex; align-items: center; gap: 8px; }
.ri-dr-fields label { display: flex; flex-direction: column; gap: 3px; font-size: 10px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .03em; }
.ri-dr-fields input {
  border: 1px solid #e2e8f0; border-radius: 9px; background: #fff;
  padding: 6px 9px; font-size: 13px; color: #0f172a; font-family: inherit;
  width: 120px; outline: none;
}
.ri-dr-dash { align-self: flex-end; padding-bottom: 7px; color: #cbd5e1; }
.ri-dr-apply {
  border: none; background: #2563eb; color: #fff; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 9px 16px; border-radius: 10px; white-space: nowrap;
  transition: background .12s;
}
.ri-dr-apply:hover { background: #1d4ed8; }

@media (max-width: 640px) {
  .ri-dr-pop {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; max-width: 100%;
    border-radius: 18px 18px 0 0; box-shadow: 0 -8px 40px rgba(15,23,42,.25);
  }
  .ri-dr-body { flex-direction: column; }
  .ri-dr-cal { border-right: none; border-bottom: 1px solid #f1f5f9; }
  .ri-dr-quick {
    width: 100%; flex-direction: row; flex-wrap: wrap;
    gap: 6px; padding: 10px 14px; max-height: 120px;
  }
  .ri-dr-quick button { background: #f1f5f9; border-radius: 999px; padding: 6px 12px; font-size: 12px; }
  .ri-dr-cell { min-height: 40px; }
}

/* ==========================================================
   HANDLEIDING-PANEL — rijke per-pagina handleiding (v1.0, 2026-06-07)
   Één #page-guide overlay + .page-guide-btn "?"-knop in de paginakop.
   Bouwt bovenop de bestaande helplaag (page-help + help-info).
   ========================================================== */

/* "?"-knop in paginakop — rechts naast de titel */
.page-guide-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s, box-shadow .15s;
  flex-shrink: 0;
}
.page-guide-btn:hover,
.page-guide-btn:focus-visible {
  border-color: #3b82f6;
  color: #2563eb;
  background: #eff6ff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.page-guide-btn svg {
  flex-shrink: 0;
}

/* Overlay + modal */
#page-guide-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  z-index: 9100;
  overflow: hidden;
}
#page-guide-overlay.is-open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px 24px;
}
#page-guide-modal {
  position: relative;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(15,23,42,.22);
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pgSlideIn .18s ease;
}
@keyframes pgSlideIn {
  from { opacity: 0; transform: translateY(-10px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modal-header */
.pg-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(28,107,186,.08) 0%, rgba(61,139,61,.05) 100%);
}
.pg-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #dbeafe;
  color: #2563eb;
  flex-shrink: 0;
}
.pg-header-title {
  flex: 1;
  min-width: 0;
}
.pg-header-title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}
.pg-header-title p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #64748b;
}
.pg-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  transition: background .12s, color .12s;
}
.pg-close:hover { background: rgba(0,0,0,.06); color: #334155; }

/* Scrollbaar content-gebied */
.pg-body {
  overflow-y: auto;
  padding: 20px 20px 24px;
  flex: 1;
}

/* Secties */
.pg-section {
  margin-bottom: 20px;
}
.pg-section:last-child { margin-bottom: 0; }
.pg-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.pg-section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex-shrink: 0;
  font-size: 14px;
}
.pg-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #1e3a8a;
}
/* Bron-badge rechts in de sectie-header */
.pg-source-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  background: #f0f0f0;
  color: #666;
  white-space: nowrap;
  margin-left: auto;
  flex-shrink: 0;
}
.pg-section-body {
  padding-left: 38px;
}
.pg-section-desc {
  font-size: 13px;
  line-height: 1.6;
  color: #475569;
  margin: 0 0 6px;
  white-space: pre-line;
}
.pg-bullets {
  margin: 0;
  padding: 0 0 0 14px;
  list-style: disc;
}
.pg-bullets li {
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
  margin-bottom: 3px;
}
.pg-bullets li:last-child { margin-bottom: 0; }

/* Divider tussen secties */
.pg-divider {
  border: none;
  border-top: 1px solid #f1f5f9;
  margin: 0 0 20px;
}

/* Mobiel: full-screen / bottom-sheet */
@media (max-width: 640px) {
  #page-guide-overlay {
    align-items: flex-end;
    padding: 0;
  }
  #page-guide-modal {
    border-radius: 20px 20px 0 0;
    max-height: 88vh;
    max-width: 100%;
  }
  .pg-body {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
}


/* ── Systeemlogboek (event_log viewer) ── */
.evlog-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.evlog-filters { display: inline-flex; gap: 4px; background: #f1f5f9; padding: 3px; border-radius: 999px; }
.evlog-filter-btn { border: 0; background: transparent; color: #475569; font-family: inherit; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.evlog-filter-btn.active { background: #0f172a; color: #fff; }
.evlog-list { max-height: 60vh; overflow-y: auto; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.evlog-empty { padding: 28px 16px; text-align: center; color: #94a3b8; font-size: 13px; }
.evlog-row { display: flex; gap: 10px; padding: 9px 12px; border-bottom: 1px solid #f1f5f9; align-items: flex-start; }
.evlog-row:last-child { border-bottom: 0; }
.evlog-lvl { flex-shrink: 0; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 5px; margin-top: 1px; }
.evlog-error .evlog-lvl { background: #fee2e2; color: #b91c1c; }
.evlog-warn .evlog-lvl { background: #fef3c7; color: #b45309; }
.evlog-info .evlog-lvl { background: #e0e7ff; color: #4338ca; }
.evlog-main { flex: 1; min-width: 0; }
.evlog-msg { font-size: 13px; color: #0f172a; line-height: 1.4; word-break: break-word; }
.evlog-sub { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 3px; }
.evlog-src { font-size: 11px; font-weight: 600; color: #64748b; background: #f1f5f9; padding: 1px 6px; border-radius: 4px; }
.evlog-time { font-size: 11px; color: #94a3b8; font-variant-numeric: tabular-nums; }
.evlog-meta { font-size: 11px; color: #94a3b8; font-family: ui-monospace, monospace; word-break: break-all; }
.evlog-search-wrap { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #e2e8f0; border-radius: 999px; padding: 7px 14px; max-width: 220px; transition: border-color .12s, box-shadow .12s; }
.evlog-search-wrap:focus-within { border-color: #cbd5e1; box-shadow: 0 0 0 3px rgba(15,23,42,.05); }
.evlog-search-wrap svg { flex-shrink: 0; color: #94a3b8; }
.evlog-search-wrap input { border: 0; outline: 0; background: transparent; font-family: inherit; font-size: 13px; color: #0f172a; width: 100%; }

/* ── Klantgroep-koppeling in conversatie-menu: breder + opgeschoond (Optie A) ── */
#conversation-context-menu { min-width: min(344px, calc(100vw - 24px)); }
/* Huidige koppeling als chips */
.ctx-current { padding: 8px 16px 10px; border-bottom: 1px solid #eef2f7; }
.ctx-current.hidden { display: none; }
.ctx-current-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #94a3b8; }
.ctx-current-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ctx-chip { display: inline-flex; align-items: center; gap: 5px; background: #f1f5f9; color: #0f172a; border-radius: 999px; padding: 4px 5px 4px 10px; font-size: 12.5px; font-weight: 600; max-width: 100%; }
.ctx-chip.hidden { display: none; }
.ctx-chip > svg { color: #64748b; flex-shrink: 0; }
.ctx-chip .ctx-value-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.ctx-chip-x { display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; border: 0; background: transparent; color: #94a3b8; border-radius: 999px; cursor: pointer; flex-shrink: 0; }
.ctx-chip-x:hover { background: #e2e8f0; color: #dc2626; }
/* Zoek-pill in de organisatie-sectie */
.ctx-search-wrap { display: flex; align-items: center; gap: 7px; margin: 2px 12px 6px; padding: 6px 11px; border: 1px solid #e2e8f0; border-radius: 999px; background: #fff; }
.ctx-search-wrap:focus-within { border-color: #cbd5e1; box-shadow: 0 0 0 3px rgba(15,23,42,.05); }
.ctx-search-wrap svg { color: #94a3b8; flex-shrink: 0; }
.ctx-search-wrap input { border: 0; outline: 0; background: transparent; font-family: inherit; font-size: 13px; width: 100%; color: #0f172a; }
/* Vestiging-context-hint naast het label */
.ctx-loc-hint { text-transform: none; letter-spacing: 0; font-weight: 600; color: #94a3b8; }
.ctx-list-empty { padding: 8px 16px; font-size: 12px; color: #94a3b8; }
/* Grotere, beter tikbare lijst-rijen + afgeronde inputs */
#ctx-customer-group-submenu .ctx-location-list { max-height: 200px; padding: 2px 0; }
#ctx-customer-group-submenu .ctx-location-item { width: auto; margin: 0 8px; padding: 9px 12px; font-size: 14px; border-radius: 8px; min-height: 40px; }
#ctx-customer-group-submenu .ctx-location-item.active { background: #fff7ed; }
#ctx-customer-group-submenu .ctx-location-item .loc-count { background: #f1f5f9; border-radius: 999px; padding: 1px 7px; }
#ctx-customer-group-submenu .ctx-location-text { border-radius: 999px; padding: 8px 13px; }
#ctx-customer-group-submenu .ctx-location-text:disabled { background: #f8fafc; color: #94a3b8; }
#ctx-customer-group-submenu .ctx-location-btn { border-radius: 999px; min-width: 34px; }
