/* ================================================================
   Admin panel styles
   ================================================================ */

/* admin.html laadt styles.css + shell.css mee (voor consistente CSS-vars).
   Die bestanden zetten body { height:100vh; display:flex; overflow:hidden }
   voor de modeller-canvas. Op admin-pagina willen we juist gewoon scrollen —
   we resetten body terug naar normaal block-gedrag. !important is nodig omdat
   shell.css ook !important gebruikt. */
html:has(body.admin-body) {
  height: auto !important;
  overflow: visible !important;
}
body.admin-body {
  font-family: 'Outfit', -apple-system, system-ui, sans-serif;
  background: #f8fafc;
  color: #111827;
  margin: 0;
  min-height: 100vh;
  height: auto !important;
  display: block !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.admin-topbar {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-topbar-left {
  display: flex; align-items: center; gap: 12px;
}
.admin-logo {
  width: 36px; height: 36px; border-radius: 8px;
  background: #111827; color: #fbbf24;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.admin-topbar h1 { font-size: 18px; margin: 0; font-weight: 700; }
.admin-subtitle { color: #6b7280; font-size: 12px; background: #fef3c7; padding: 2px 8px; border-radius: 4px; }
.admin-topbar-right { display: flex; align-items: center; gap: 12px; }
.admin-backlink { color: #3D2EFF; text-decoration: none; font-size: 14px; }
.admin-backlink:hover { text-decoration: underline; }
.admin-user { font-size: 14px; color: #374151; }

.admin-main {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 24px;
}

.admin-loading, .admin-unauth {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 48px; text-align: center;
}
.admin-unauth h2 { margin-top: 0; }
.admin-muted { color: #6b7280; font-size: 13px; }

.admin-header-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.admin-header-row h2 { margin: 0; font-size: 24px; }
.admin-hint { color: #6b7280; margin: 0 0 20px; font-size: 13px; }
.admin-hint code {
  background: #f3f4f6; padding: 1px 6px; border-radius: 4px;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 12px;
}

.admin-org-list {
  display: block;
}

.admin-org-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.admin-org-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.admin-org-card-header {
  display: flex; align-items: center; gap: 12px;
}
.admin-org-avatar {
  width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 18px;
  background-size: contain; background-position: center; background-repeat: no-repeat;
}
.admin-org-name { font-size: 16px; font-weight: 600; }
.admin-org-slug { font-size: 12px; color: #6b7280; font-family: ui-monospace, Consolas, monospace; }
.admin-org-meta { font-size: 12px; color: #6b7280; display: flex; gap: 8px; flex-wrap: wrap; }
.admin-org-meta span {
  background: #f3f4f6; padding: 2px 8px; border-radius: 4px;
}
.admin-org-actions {
  display: flex; gap: 6px; margin-top: auto; padding-top: 12px;
  border-top: 1px solid #f3f4f6; align-items: center; flex-wrap: wrap;
}
.admin-org-action {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: #3D2EFF; text-decoration: none;
  background: transparent; border: 1px solid transparent; cursor: pointer;
  padding: 6px 10px; border-radius: 6px; font-family: inherit;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.admin-org-action svg { flex-shrink: 0; }
.admin-org-action:hover {
  background: #EEF2FF; border-color: #C7D2FE; text-decoration: none;
}
.admin-org-action-danger {
  color: #9ca3af; margin-left: auto;
}

/* Demo-badge rechtsboven op de organisatie-kaart */
.admin-org-card { position: relative; }
.admin-org-demo-badge {
  position: absolute; top: 10px; right: 10px;
  background: #fff; border: 1px solid #e5e7eb;
  font-size: 11px; font-weight: 500; color: #6b7280;
  padding: 3px 8px; border-radius: 999px; cursor: pointer;
  font-family: inherit; line-height: 1.4;
  transition: all 0.12s;
}
.admin-org-demo-badge:hover { color: #3D2EFF; border-color: #C7D2FE; background: #EEF2FF; }
.admin-org-card-demo .admin-org-demo-badge {
  background: #fef3c7; border-color: #fcd34d; color: #92400e; font-weight: 600;
}
.admin-org-card-demo { background: #fffbeb; border-color: #fcd34d; }

/* Klanten-tabel (vervangt kaart-grid) */
.ot-filterbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.ot-search { position: relative; flex: 1; min-width: 240px; max-width: 380px; }
.ot-search-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #9ca3af; font-size: 14px; }
.ot-search input {
  width: 100%; padding: 8px 12px 8px 32px; border: 1px solid #e5e7eb;
  border-radius: 8px; font-size: 13px; background: #fff; font-family: inherit;
}
.ot-search input:focus { outline: none; border-color: #3D2EFF; box-shadow: 0 0 0 3px rgba(61,46,255,0.08); }
.ot-tabs { display: flex; gap: 4px; background: #f3f4f6; border-radius: 8px; padding: 3px; }
.ot-tab {
  padding: 6px 12px; background: transparent; border: none; border-radius: 6px;
  font-size: 13px; font-weight: 500; color: #6b7280; cursor: pointer;
  font-family: inherit; transition: all 0.15s; display: inline-flex; align-items: center; gap: 6px;
}
.ot-tab:hover { color: #111827; }
.ot-tab-active { background: #fff; color: #3D2EFF; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.ot-tab-count {
  background: #e5e7eb; color: #6b7280; padding: 0 6px; border-radius: 10px;
  font-size: 11px; font-weight: 500; min-width: 18px; text-align: center;
}
.ot-tab-active .ot-tab-count { background: #EEF2FF; color: #3D2EFF; }
.admin-org-list { overflow-x: auto; }
.ot-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  overflow: hidden; min-width: 900px;
}
.ot-table thead { background: #f9fafb; }
.ot-table th {
  text-align: left; padding: 10px 8px;
  border-bottom: 1px solid #e5e7eb; color: #6b7280;
  font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  white-space: nowrap;
}
.ot-table tbody tr { cursor: pointer; transition: background 0.12s; }
.ot-table tbody tr:hover { background: #f9fafb; }
.ot-table td { padding: 10px 8px; border-top: 1px solid #f3f4f6; vertical-align: middle; }
.ot-td-name { display: flex; align-items: center; gap: 12px; }
.ot-avatar { width: 32px; height: 32px; border-radius: 8px; font-size: 14px; flex-shrink: 0; background-size: contain; background-position: center; background-repeat: no-repeat; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; }
.ot-name { font-weight: 600; color: #111827; }
.ot-slug { font-size: 11px; color: #9ca3af; font-family: ui-monospace, Consolas, monospace; margin-top: 1px; }
.ot-num { font-variant-numeric: tabular-nums; }
.ot-mrr { font-weight: 600; color: #111827; }
.ot-plan {
  display: inline-block; padding: 3px 8px; border-radius: 6px;
  background: #f3f4f6; color: #374151; font-size: 11px; font-weight: 500;
}
.ot-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; }
.ot-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.ot-stat-active { color: #065f46; }
.ot-stat-trial { color: #92400e; }
.ot-stat-risk { color: #991b1b; }
.ot-stat-demo { color: #92400e; }
.ot-stat-muted { color: #6b7280; }
.ot-demo-pill {
  display: inline-block; background: #fef3c7; color: #92400e;
  font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 10px; margin-left: 6px;
}
.ot-actions {
  white-space: nowrap;
  text-align: right;
  width: 1%;
}
.ot-btn-icon {
  background: transparent; border: 1px solid #e5e7eb;
  width: 30px; height: 30px; border-radius: 6px; cursor: pointer;
  font-family: inherit; color: #374151;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; transition: all 0.12s; vertical-align: middle;
  flex-shrink: 0;
}
.ot-btn-icon + .ot-btn-icon { margin-left: 4px; }
.ot-btn-icon svg { display: block; }
.ot-btn-icon:hover { background: #f9fafb; border-color: #c7d2fe; color: #3D2EFF; }
.ot-btn-danger { color: #b91c1c; }
.ot-btn-danger:hover { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

/* Gebruikers & rollen */
.ug-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.ug-title { font-size: 22px; font-weight: 700; color: #111827; margin: 0 0 4px; }
.ug-subtitle { font-size: 14px; color: #6b7280; margin: 0; }
.ug-header-actions { display: flex; gap: 8px; align-items: center; }
.ug-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.ug-kpi {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 16px; display: flex; gap: 12px; align-items: flex-start;
}
.ug-kpi-ico {
  width: 36px; height: 36px; border-radius: 10px;
  background: #EEF2FF; color: #3D2EFF;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.ug-kpi-label { font-size: 12px; color: #6b7280; font-weight: 500; }
.ug-kpi-value { font-size: 24px; font-weight: 700; color: #111827; line-height: 1.2; margin-top: 2px; }
.ug-kpi-sub { font-size: 11px; color: #6b7280; margin-top: 2px; }

.ug-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ug-table thead { background: #f9fafb; }
.ug-table th {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb; color: #6b7280;
  font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
}
.ug-table tbody tr { transition: background 0.12s; }
.ug-table tbody tr:hover { background: #f9fafb; }
.ug-table td { padding: 12px; border-top: 1px solid #f3f4f6; vertical-align: middle; }
.ug-user-cell { display: flex; align-items: center; gap: 12px; }
.ug-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #EEF2FF; color: #3D2EFF;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.ug-name { font-weight: 600; color: #111827; display: inline-flex; align-items: center; gap: 6px; }
.ug-email { font-size: 12px; color: #6b7280; margin-top: 1px; }
.ug-num { font-variant-numeric: tabular-nums; color: #374151; font-size: 13px; }
.ug-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 500;
}
.ug-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.ug-pill-ok { background: #d1fae5; color: #065f46; }
.ug-pill-warn { background: #fef3c7; color: #92400e; }
.ug-pill-info { background: #dbeafe; color: #1e40af; }
.ug-pill-muted { background: #f3f4f6; color: #6b7280; }
.ug-pill-internal { background: #fef3c7; color: #92400e; margin-left: 6px; padding: 2px 7px; font-size: 10px; font-weight: 600; }
.ug-role-super { background: #ede9fe; color: #5b21b6; }
.ug-role-klant { background: #f3f4f6; color: #374151; }

/* Procesinterview detail-demo */
.iv-detail-wrap { display: flex; flex-direction: column; gap: 16px; }
.iv-breadcrumb { margin-bottom: 4px; }
.iv-header { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.iv-status-pills { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.iv-pill-live { background: #d1fae5; color: #065f46; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.iv-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; display: inline-block; box-shadow: 0 0 0 3px rgba(16,185,129,0.18); animation: ivPulse 1.4s infinite; }
@keyframes ivPulse { 0%,100% { box-shadow: 0 0 0 3px rgba(16,185,129,0.18); } 50% { box-shadow: 0 0 0 6px rgba(16,185,129,0.08); } }
.iv-pill-meta { color: #6b7280; font-size: 12px; }
.iv-title { font-size: 26px; font-weight: 700; color: #111827; margin: 0 0 6px; }
.iv-sub { display: flex; gap: 16px; color: #6b7280; font-size: 13px; flex-wrap: wrap; }
.iv-sub-ico { margin-right: 4px; }
.iv-metrics { display: flex; gap: 24px; align-items: flex-start; }
.iv-metric { text-align: left; }
.iv-metric-label { font-size: 10px; color: #6b7280; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.iv-metric-value { font-size: 22px; font-weight: 700; color: #111827; line-height: 1.2; margin-top: 2px; }

.iv-actionbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px 16px;
  flex-wrap: wrap;
}
.iv-phases { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.iv-phase {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 500;
  background: #f9fafb; color: #6b7280; border: 1px solid #f3f4f6;
}
.iv-phase-done { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.iv-phase-active { background: #EEF2FF; color: #3D2EFF; border-color: #C7D2FE; font-weight: 600; }
.iv-phase-todo { background: #f9fafb; color: #9ca3af; }
.iv-phase-mark { font-size: 11px; }
.iv-actionbar-buttons { display: flex; gap: 8px; }

.iv-main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; }
.iv-canvas { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; display: flex; flex-direction: column; }
.iv-canvas-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px; border-bottom: 1px solid #f3f4f6; }
.iv-canvas-title { font-size: 14px; font-weight: 600; color: #111827; }
.iv-canvas-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }
.iv-canvas-tabs { display: flex; background: #f3f4f6; border-radius: 8px; padding: 3px; }
.iv-tab { padding: 5px 12px; background: transparent; border: none; border-radius: 6px; font-size: 12px; font-weight: 500; color: #6b7280; cursor: pointer; }
.iv-tab-active { background: #fff; color: #3D2EFF; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.iv-canvas-body { padding: 20px; position: relative; min-height: 360px; }
.iv-zoom-ctrls { position: absolute; top: 16px; left: 16px; display: flex; flex-direction: column; gap: 4px; }
.iv-zoom-ctrls button {
  width: 28px; height: 28px; background: #fff; border: 1px solid #e5e7eb;
  border-radius: 6px; cursor: pointer; font-size: 14px; color: #6b7280;
}
.iv-bpmn-svg { width: 100%; height: auto; display: block; }
.iv-canvas-foot { position: absolute; bottom: 12px; right: 16px; }
.iv-nodes-pill {
  background: #d1fae5; color: #065f46; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
}

.iv-transcript { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; display: flex; flex-direction: column; max-height: 600px; }
.iv-transcript-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px; border-bottom: 1px solid #f3f4f6; }
.iv-transcript-title { font-size: 14px; font-weight: 600; color: #111827; }
.iv-transcript-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }
.iv-transcript-tools { display: flex; gap: 4px; }
.iv-transcript-tools button { background: transparent; border: 1px solid #e5e7eb; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; color: #6b7280; }
.iv-transcript-body { flex: 1; padding: 12px 16px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.iv-msg { display: flex; gap: 10px; align-items: flex-start; }
.iv-msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #EEF2FF; color: #3D2EFF; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
}
.iv-msg-avatar-ai { background: linear-gradient(135deg,#3D2EFF,#10b981); position: relative; }
.iv-msg-avatar-ai::after { content: ''; position: absolute; inset: 6px; background: #fff; border-radius: 50%; opacity: 0.95; }
.iv-msg-body { flex: 1; min-width: 0; }
.iv-msg-head { font-size: 11px; color: #6b7280; }
.iv-msg-name { font-weight: 600; color: #374151; }
.iv-msg-time { color: #9ca3af; }
.iv-msg-text { font-size: 13px; color: #111827; margin-top: 2px; line-height: 1.45; }
.iv-msg-italic { font-style: italic; color: #6b7280; }
.iv-typing-dots { display: inline-flex; gap: 3px; padding: 6px 0; }
.iv-typing-dots span { width: 5px; height: 5px; border-radius: 50%; background: #9ca3af; animation: ivBlink 1.2s infinite; }
.iv-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.iv-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ivBlink { 0%,80%,100% { opacity: 0.2; } 40% { opacity: 1; } }
.iv-transcript-mic { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid #f3f4f6; }
.iv-mic-ico { color: #ef4444; font-size: 14px; }
.iv-waveform { display: flex; flex: 1; gap: 2px; align-items: center; height: 28px; }
.iv-waveform span { display: inline-block; flex: 1; background: #c7d2fe; border-radius: 1px; min-height: 4px; }
.iv-mic-status { font-size: 12px; color: #6b7280; }

.iv-detect { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.iv-detect-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 14px;
}
.iv-detect-info { background: #fef2f2; border-color: #fecaca; }
.iv-detect-warn { background: #fffbeb; border-color: #fcd34d; }
.iv-detect-ok { background: #ecfdf5; border-color: #a7f3d0; }
.iv-detect-badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.iv-detect-badge-info { background: #fee2e2; color: #991b1b; }
.iv-detect-badge-warn { background: #fef3c7; color: #92400e; }
.iv-detect-badge-ok { background: #d1fae5; color: #065f46; }
.iv-detect-title { font-size: 14px; font-weight: 600; color: #111827; margin-bottom: 4px; }
.iv-detect-body { font-size: 12px; color: #6b7280; line-height: 1.45; }
.iv-empty { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 80px 24px; text-align: center; }
.iv-empty-ico { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.iv-empty-title { font-size: 18px; font-weight: 600; color: #111827; margin-bottom: 8px; }
.iv-empty-body { font-size: 13px; color: #6b7280; max-width: 480px; margin: 0 auto; line-height: 1.5; }
.iv-bpmn-placeholder { background: #f9fafb; border: 1px dashed #e5e7eb; border-radius: 8px; min-height: 280px; display: flex; align-items: center; justify-content: center; }

/* Klant-detailpagina */
.admin-org-detail .ad-detail { display: flex; flex-direction: column; gap: 20px; }
.ad-back {
  background: transparent; border: 1px solid #e5e7eb; color: #374151;
  padding: 6px 12px; border-radius: 8px; font-size: 13px; cursor: pointer;
  width: fit-content; font-family: inherit;
}
.ad-back:hover { background: #f9fafb; border-color: #c7d2fe; color: #3D2EFF; }
.ad-header { display: flex; align-items: center; gap: 16px; }
.ad-header h2 { font-size: 22px; font-weight: 700; color: #111827; }
.ad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ad-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 16px;
}
.ad-card h3 { font-size: 13px; font-weight: 600; color: #6b7280; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.ad-rows { display: flex; flex-direction: column; gap: 8px; }
.ad-rows > div { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.ad-rows strong { font-weight: 500; color: #6b7280; }
.ad-rows span { color: #111827; font-weight: 600; }
.ad-big { font-size: 24px; font-weight: 700; color: #111827; margin-bottom: 4px; }
.ad-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.ad-table th { text-align: left; padding: 8px 6px; border-bottom: 1px solid #e5e7eb; color: #6b7280; font-weight: 500; font-size: 11px; text-transform: uppercase; }
.ad-table td { padding: 8px 6px; border-bottom: 1px solid #f3f4f6; color: #374151; }
.ad-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.ad-tag-ok { background: #d1fae5; color: #065f46; }
.ad-tag-info { background: #dbeafe; color: #1e40af; }
.ad-tag-warn { background: #fef3c7; color: #92400e; }
.ad-tag-danger { background: #fee2e2; color: #991b1b; }
.ad-tag-muted { background: #f3f4f6; color: #6b7280; }
.ad-feed-row { padding: 8px 0; border-bottom: 1px solid #f3f4f6; }
.ad-feed-row:last-child { border-bottom: none; }
.ad-feed-title { font-size: 13px; font-weight: 600; color: #111827; }
.ad-feed-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }
.hidden { display: none !important; }
.admin-org-action-danger:hover {
  color: #dc2626; background: #fef2f2; border-color: #fecaca;
}

/* Modal */
.admin-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.admin-modal.hidden { display: none; }
.admin-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
}
.admin-modal-content {
  position: relative;
  background: #fff;
  border-radius: 14px;
  width: min(960px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.admin-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex; justify-content: space-between; align-items: center;
}
.admin-modal-header h2 { margin: 0; font-size: 20px; }
.admin-modal-close {
  background: transparent; border: none; font-size: 26px; cursor: pointer;
  color: #6b7280;
}
.admin-modal-body {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
}

/* Tabs inside modal */
.admin-tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  border-bottom: 1px solid #e5e7eb;
  background: #fafbfc;
}
.admin-tab {
  background: transparent;
  border: none;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.admin-tab:hover { color: #374151; }
.admin-tab.active {
  color: #3D2EFF;
  border-bottom-color: #3D2EFF;
}
.admin-tab:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-tab-pane {
  display: grid;
  grid-template-columns: 320px 1fr;
}
.admin-tab-pane.hidden { display: none; }
@media (max-width: 800px) {
  .admin-tab-pane { grid-template-columns: 1fr; }
}

/* Members tab */
.admin-members-pane {
  padding: 24px;
  grid-column: 1 / -1;  /* spans both columns when only this pane is visible */
}
.admin-members-section {
  margin-bottom: 28px;
}
.admin-members-section h3 {
  font-size: 14px; margin: 0 0 6px;
  color: #374151; text-transform: uppercase; letter-spacing: 0.04em;
}
.admin-invite-row {
  display: grid;
  grid-template-columns: 1fr 150px auto;
  gap: 8px;
  margin-top: 12px;
}
.admin-invite-row input,
.admin-invite-row select {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}
.admin-invite-row button {
  white-space: nowrap;
}
@media (max-width: 640px) {
  .admin-invite-row { grid-template-columns: 1fr; }
}

.admin-members-list,
.admin-invitations-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-member-row,
.admin-invitation-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
}
.admin-member-email { font-weight: 500; color: #111827; word-break: break-all; }
.admin-member-meta { font-size: 11px; color: #6b7280; }
.admin-invitation-row .admin-member-email { font-style: italic; color: #4b5563; }
.admin-role-select {
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
}
.admin-row-action {
  background: transparent;
  border: none;
  color: #b91c1c;
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
}
.admin-row-action:hover { text-decoration: underline; }
.admin-row-action.neutral { color: #3D2EFF; }

/* Preview */
.admin-preview {
  background: #f8fafc;
  border-right: 1px solid #e5e7eb;
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 0;
}
.admin-preview-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: #6b7280;
}
.admin-preview-topbar {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  display: flex; align-items: center; gap: 10px;
}
.admin-preview-logo {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--pv-primary, #3D2EFF);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  background-size: contain; background-position: center; background-repeat: no-repeat;
}
.admin-preview-app-name { font-weight: 600; font-size: 13px; }
.admin-preview-sub { font-size: 11px; color: #6b7280; }
.admin-preview-buttons {
  display: flex; gap: 8px;
}
.admin-preview-primary {
  background: var(--pv-primary, #3D2EFF);
  color: #fff; border: none; padding: 8px 16px; border-radius: 8px; cursor: default;
  font-family: inherit; font-size: 12px;
}
.admin-preview-accent {
  background: var(--pv-accent, #00D959);
  color: #111827; border: none; padding: 8px 16px; border-radius: 8px; cursor: default;
  font-family: inherit; font-size: 12px;
}
.admin-preview-url {
  font-size: 11px; color: #6b7280; word-break: break-all;
}
.admin-preview-url code {
  background: #fff; padding: 4px 6px; border-radius: 4px;
  border: 1px solid #e5e7eb; font-size: 11px;
}

/* Form */
.admin-form {
  padding: 20px 24px;
  overflow: auto;
}
.admin-form-section {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid #e5e7eb;
}
.admin-form-section h3 {
  font-size: 14px; margin: 0 0 14px; color: #374151; text-transform: uppercase; letter-spacing: 0.04em;
}
.admin-form-row {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 14px;
}
.admin-form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: #374151;
}
.admin-form label span:first-child { font-weight: 500; }
.admin-form-wide { grid-column: 1 / -1; }
.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="url"],
.admin-form select,
.admin-form textarea {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
}
.admin-form input[type="color"] {
  height: 38px; width: 100%; padding: 2px; cursor: pointer;
  border: 1px solid #d1d5db; border-radius: 6px;
}
.admin-form input[type="file"] {
  font-size: 12px;
}
.admin-form small { color: #6b7280; font-size: 11px; }

.admin-modal-footer {
  border-top: 1px solid #e5e7eb;
  padding: 14px 24px;
  margin: 20px -24px -20px;   /* strek tot aan de modal-rand, overschrijf form-padding */
  display: flex; justify-content: flex-end; gap: 8px;
  position: sticky;
  bottom: -20px;              /* compenseer de negatieve margin zodat hij écht onderaan plakt */
  background: #fff;
  z-index: 2;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.04);
}
.btn-primary, .btn-secondary, .btn-danger {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}
.btn-primary { background: #3D2EFF; color: #fff; }
.btn-primary:hover { background: #2418D6; }
.btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }
.btn-secondary { background: #f3f4f6; color: #111827; }
.btn-secondary:hover { background: #e5e7eb; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.hidden { display: none !important; }

/* Toast */
/* AI scan box */
.ai-scan-box {
  background: linear-gradient(135deg, #eff6ff 0%, #faf5ff 100%);
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
}
.ai-scan-header {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 10px;
}
.ai-scan-icon { font-size: 20px; line-height: 1; }
.ai-scan-title {
  font-weight: 600; font-size: 13px; color: #3730a3;
  margin-bottom: 2px;
}
.ai-scan-sub { font-size: 12px; color: #4b5563; line-height: 1.4; }
.ai-scan-row {
  display: flex; gap: 8px;
}
.ai-scan-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
}
.ai-scan-row input:focus {
  outline: none; border-color: #6366f1;
}
.ai-scan-row button {
  white-space: nowrap;
}
.ai-scan-row button:disabled {
  opacity: 0.6; cursor: progress;
}
/* Onderscheidende stijl voor de scan-knop zodat gebruikers 'm niet
   verwarren met de Opslaan-knop (beide primary waren misleidend). */
.btn-ai-scan-go {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.btn-ai-scan-go:hover { filter: brightness(1.08); }
.btn-ai-scan-go:disabled { opacity: 0.6; cursor: progress; }
.ai-scan-status {
  font-size: 12px; color: #4b5563;
  margin-top: 8px; min-height: 16px;
}
.ai-scan-status.success { color: #047857; }
.ai-scan-status.error { color: #b91c1c; }
.ai-scan-status .tone-note {
  display: block; font-style: italic; color: #6b7280; margin-top: 4px;
}

.admin-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #111827; color: #fff;
  padding: 12px 20px; border-radius: 8px;
  font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 2000;
}
.admin-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.admin-toast.error { background: #b91c1c; }
.admin-toast.ok { background: #047857; }

/* ================================================================
   AI Brand Scanner v2 — uitgebreide branding-velden (chunk 3)
   ================================================================ */

/* Sub-sectie binnen het branding-form (Kleurpalet, Vorm en sfeer) */
.admin-form-section-sub {
  margin-top: 18px;
  padding: 14px 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.admin-form-section-sub h4 {
  font-size: 12px;
  margin: 0 0 4px;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.admin-form-section-sub p.admin-muted {
  margin: 0 0 12px;
  font-size: 12px;
}

/* Kleur-grid: 7 pickers passen netjes in een responsive grid */
.admin-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}
.admin-color-grid label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px;
}

/* Range-slider voor border-radius */
.admin-form input[type="range"] {
  width: 100%;
  accent-color: #3D2EFF;
  cursor: pointer;
}
#theme-borderRadius-out {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #3D2EFF;
  margin-left: 4px;
}

/* Tweak-balk: verschijnt 60s na succesvolle scan onderaan het form,
   net boven de modal-footer. Sticky zodat hij in beeld blijft. */
.admin-tweak-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px -24px 0;
  padding: 12px 24px;
  background: linear-gradient(90deg, #ecfdf5 0%, #eff6ff 100%);
  border-top: 1px solid #a7f3d0;
  border-bottom: 1px solid #a7f3d0;
  position: sticky;
  bottom: 60px;     /* boven de footer (54px hoog + 6px lucht) */
  z-index: 3;
  animation: tweakSlideIn 0.25s ease-out;
}
@keyframes tweakSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.admin-tweak-message {
  flex: 1;
  font-size: 13px;
  color: #064e3b;
  line-height: 1.4;
}
.admin-tweak-message strong { color: #047857; margin-right: 4px; }
.admin-tweak-bar .btn-primary,
.admin-tweak-bar .btn-secondary {
  flex-shrink: 0;
}

/* Slug-input met unlock-knop ernaast */
.admin-slug-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.admin-slug-row input { flex: 1; }
.admin-slug-unlock {
  flex-shrink: 0;
  padding: 6px 12px;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  white-space: nowrap;
}
.admin-slug-unlock:hover {
  background: #fde68a;
}
