/* Centric Objectdetectie — Thema Centric overlay
   App-specific styles layered on top of colors_and_type.css + kit.css
*/

html, body, #app { height: 100%; }
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface-app);
  color: var(--text-body);
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  overflow: hidden;
}

#app { display: flex; height: 100vh; overflow: hidden; }
.bd-app { display: flex; height: 100vh; width: 100%; overflow: hidden; }

/* ---------- Sidebar (BAG variant — compact) ---------- */
.bd-sidebar {
  width: var(--sidebar-width);
  background: var(--surface-sidebar);
  border-right: 1px solid var(--color-border-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
}

.bd-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5);
  border-bottom: 1px solid var(--color-border-light);
}
.bd-brand-mark {
  width: 40px; height: 40px;
  background: var(--color-primary);
  color: var(--color-fg-inverse);
  display: flex; align-items: center; justify-content: center;
  font-weight: var(--font-weight-semibold);
  font-size: 13px;
  letter-spacing: 0.04em;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  position: relative;
}
.bd-brand-mark::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--color-primary-dark);
}
.bd-brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; gap: 3px; }
.bd-brand-name {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text-body);
}
.bd-brand-logo { height: 22px; width: auto; display: block; }
.bd-brand-mark-img { width: 40px; height: 40px; flex-shrink: 0; display: none; }
.bd-brand-sub {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-body);
  letter-spacing: 0.01em;
}

.bd-nav { padding: var(--space-3) 0; flex: 1; }
.bd-nav-section {
  padding: var(--space-3) var(--space-5) var(--space-1);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.bd-nav-footer {
  border-top: 1px solid var(--color-border-light);
  padding: var(--space-2) 0;
}

/* Override tc-nav-item slightly for density and icon sizing */
.bd-sidebar .tc-nav-item { font-size: var(--font-size-sm); }
.bd-sidebar .tc-nav-item svg { width: 16px; height: 16px; }

/* Ingeklapte sidebar — alleen iconen */
.bd-sidebar { transition: width var(--duration-fast) var(--ease-standard); }
.bd-sidebar.is-ingeklapt { width: 64px; overflow-x: hidden; }
.bd-sidebar.is-ingeklapt .bd-brand { padding: var(--space-4) 0; justify-content: center; }
.bd-sidebar.is-ingeklapt .bd-brand-text { display: none; }
.bd-sidebar.is-ingeklapt .bd-brand-mark-img { display: block; }
.bd-sidebar.is-ingeklapt .tc-nav-label,
.bd-sidebar.is-ingeklapt .tc-nav-badge { display: none; }
.bd-sidebar.is-ingeklapt .tc-nav-item { justify-content: center; padding: 9px 0; }
.bd-sidebar.is-ingeklapt .bd-nav-section {
  font-size: 0; padding: 0; margin: var(--space-2) var(--space-3);
  border-top: 1px solid var(--color-border-light);
}

/* ---------- Main shell ---------- */
.bd-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.bd-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: var(--surface-card);
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
  min-height: 56px;
}
.bd-topbar-crumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}
.bd-topbar-crumbs .tc-crumb--current { color: var(--text-body); }
.bd-topbar-actions { display: flex; align-items: center; gap: var(--space-2); }

.bd-env-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}
.bd-env-pill-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-success);
}

.bd-main-scroll {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.bd-page {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.bd-page > * { flex-shrink: 0; }
.bd-page--flush {
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.bd-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
/* Compacte paginakop: titel klein op één regel, beschrijving verborgen — de
   sidebar toont al welke pagina actief is. Bespaart verticale ruimte (m.n. review). */
.bd-page-head h1 {
  margin: 0;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  letter-spacing: -0.01em;
}
.bd-page-head p {
  display: none;
}
.bd-page-head-actions { display: flex; gap: var(--space-2); align-items: center; }

/* ---------- Card ---------- */
.bd-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
}
.bd-card--flush { padding: 0; overflow: hidden; }
.bd-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.bd-card-head h2 {
  margin: 0;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-body);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.bd-card-head h2 svg { width: 16px; height: 16px; color: var(--color-primary); }
.bd-card-sub {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin: -12px 0 var(--space-4);
}

/* ---------- Buttons (extend tc-btn) ---------- */
.tc-btn { line-height: 1; font-weight: var(--font-weight-semibold); }
.tc-btn--sm { padding: 6px 10px; font-size: var(--font-size-sm); }
.tc-btn--danger {
  background: var(--surface-card);
  color: var(--color-error);
  border-color: var(--color-error);
}
.tc-btn--danger:hover { background: var(--color-error-bg); }
.tc-btn--danger-solid {
  background: var(--color-error);
  color: var(--color-fg-inverse);
}
.tc-btn--danger-solid:hover { background: #c0392b; }
.tc-btn[disabled], .tc-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.tc-btn--icon-only { padding: 6px; width: 32px; height: 32px; justify-content: center; }
.tc-btn--icon-only svg { width: 16px; height: 16px; }

/* ---------- Inputs ---------- */
.bd-input, .bd-select, .bd-textarea {
  width: 100%;
  font: 400 var(--font-size-sm)/1.4 var(--font-family-base);
  color: var(--text-body);
  background: var(--surface-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  outline: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.bd-input:focus, .bd-select:focus, .bd-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus-ring);
}
.bd-select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='none' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}
.bd-textarea { font-family: var(--font-family-mono); font-size: var(--font-size-xs); resize: vertical; min-height: 100px; }
.bd-label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.bd-field { margin-bottom: var(--space-4); }
.bd-checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--text-body);
  cursor: pointer;
}
.bd-checkbox input { accent-color: var(--color-primary); width: 16px; height: 16px; }

/* ---------- Alerts / inline messages ---------- */
.bd-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-3);
  border: 1px solid transparent;
}
.bd-alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.bd-alert--error   { background: var(--color-error-bg);   color: #a63226; border-color: #f5c6be; }
.bd-alert--success { background: var(--color-success-bg); color: #1c7a44; border-color: #b8e8cc; }
.bd-alert--info    { background: var(--color-primary-light); color: var(--color-primary-dark); border-color: #cfe0f4; }
.bd-alert--warning { background: var(--color-warning-bg); color: #8a6d0b; border-color: #f2e3a1; }

/* ---------- Tabs (pill style) ---------- */
.bd-pill-tabs {
  display: inline-flex;
  background: var(--surface-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}
.bd-pill-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: var(--font-weight-semibold) var(--font-size-sm)/1 var(--font-family-base);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.bd-pill-tab svg { width: 14px; height: 14px; }
.bd-pill-tab:hover { color: var(--color-primary); }
.bd-pill-tab.is-active { background: var(--color-primary); color: var(--color-fg-inverse); }

/* ---------- Upload dropzone ---------- */
.bd-dropzone {
  border: 2px dashed var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  background: var(--surface-app);
  transition: background var(--duration-fast), border-color var(--duration-fast);
}
.bd-dropzone:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}
.bd-dropzone.is-active {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  cursor: wait;
}
.bd-dropzone svg { width: 28px; height: 28px; color: var(--color-primary); margin-bottom: 8px; }
.bd-dropzone-title { font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); color: var(--text-body); }
.bd-dropzone-hint  { font-size: var(--font-size-xs); margin-top: 4px; }

/* ---------- Table: extend tc-table for density in BAG ---------- */
.bd-table-wrap { overflow-x: auto; }
.bd-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
.bd-table thead th {
  text-align: left;
  font: var(--font-weight-semibold) var(--font-size-xs)/1 var(--font-family-base);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: var(--space-3) var(--space-4);
  background: #fafcfe;
  border-bottom: 1px solid var(--color-border-light);
  white-space: nowrap;
}
.bd-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}
.bd-table tbody tr:last-child td { border-bottom: 0; }
.bd-table tbody tr:hover { background: #fafcfe; }
.bd-table tbody tr.is-selected { background: var(--color-primary-light); }
.bd-table-main { font-weight: var(--font-weight-semibold); color: var(--text-body); }
.bd-table-sub  { color: var(--text-muted); font-size: var(--font-size-xs); margin-top: 2px; }
.bd-mono { font-family: var(--font-family-mono); font-size: var(--font-size-xs); color: var(--text-muted); }

/* ---------- Progress bar ---------- */
.bd-progress {
  width: 100%;
  height: 6px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.bd-progress-bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-standard);
}

/* ---------- Stat card ---------- */
.bd-stat {
  background: var(--surface-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
}
.bd-stat::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--color-primary);
}
.bd-stat-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: var(--font-weight-semibold);
  display: flex; align-items: center; gap: 6px;
}
.bd-stat-label svg { width: 14px; height: 14px; }
.bd-stat-value {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-semibold);
  color: var(--text-body);
  line-height: 1.1;
  margin-top: 4px;
  letter-spacing: -0.02em;
}
.bd-stat-sub { font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 4px; }

/* ---------- Grid utilities ---------- */
.bd-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--grid-gap); }
.bd-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--grid-gap); }
.bd-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--grid-gap); }
.bd-grid-sidebar { display: grid; grid-template-columns: 3fr 1fr; gap: var(--grid-gap); align-items: start; }
.bd-row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }

/* ---------- Empty state ---------- */
.bd-empty {
  text-align: center;
  padding: var(--space-10) var(--space-6);
  color: var(--text-muted);
}
.bd-empty svg {
  width: 48px; height: 48px;
  margin-bottom: var(--space-3);
  color: var(--color-border-light);
  stroke-width: 1.25;
}
.bd-empty-title { font-size: var(--font-size-base); color: var(--text-body); font-weight: var(--font-weight-semibold); margin-bottom: 4px; }
.bd-empty-hint  { font-size: var(--font-size-sm); }

/* ---------- Badges (override tc-badge for BAG iconography) ---------- */
.tc-badge svg { width: 12px; height: 12px; }
.tc-badge-dot { flex-shrink: 0; }

/* ---------- Map page ---------- */

/* Toolbar */
.bd-map-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 var(--space-3);
  height: 44px;
  background: var(--surface-card);
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
}
.bd-map-toolbar-sep {
  width: 1px; height: 20px;
  background: var(--color-border-light);
  margin: 0 var(--space-2);
  flex-shrink: 0;
}
.bd-map-toolbar-spacer { flex: 1; }

/* Gemeente-selector in toolbar */
.bd-map-gemeente-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  white-space: nowrap;
  margin-right: 4px;
}
.bd-map-gemeente-select {
  appearance: none;
  background: var(--surface-card) 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='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 8px center;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: 4px 26px 4px 9px;
  font: 600 var(--font-size-sm) var(--font-family-base);
  color: var(--color-primary);
  cursor: pointer;
  min-width: 160px;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.bd-map-gemeente-select:hover { border-color: var(--color-primary); }
.bd-map-gemeente-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus-ring);
}

/* Tool buttons */
.bd-tool-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
  position: relative;
  flex-shrink: 0;
}
.bd-tool-btn svg { width: 17px; height: 17px; stroke-width: 1.75; pointer-events: none; }
.bd-tool-btn:hover { background: var(--color-primary-light); color: var(--color-primary); }
.bd-tool-btn.is-active { background: var(--color-primary); color: #fff; }
.bd-tool-btn.is-active:hover { background: var(--color-primary-dark); }
.bd-tool-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%; transform: translateX(-50%);
  background: #222; color: #fff;
  font-size: 11px; white-space: nowrap;
  padding: 3px 8px; border-radius: 3px;
  pointer-events: none; opacity: 0;
  transition: opacity var(--duration-fast);
  z-index: 9999;
}
.bd-tool-btn[data-tip]:hover::after { opacity: 1; }

/* Search in toolbar */
.bd-map-search {
  position: relative;
  width: 220px;
  flex-shrink: 0;
}
.bd-map-search input {
  width: 100%;
  height: 30px;
  padding: 0 28px 0 30px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  font: var(--font-size-sm) var(--font-family-base);
  color: var(--text-body);
  background: var(--color-bg-app);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.bd-map-search input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus-ring);
  background: var(--surface-card);
}
.bd-map-search-icon {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.bd-map-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
}
.bd-map-search-result {
  padding: 8px 12px;
  font-size: var(--font-size-sm);
  border-bottom: 1px solid var(--color-border-light);
  cursor: pointer;
}
.bd-map-search-result:last-child { border-bottom: 0; }
.bd-map-search-result:hover { background: var(--color-primary-light); color: var(--color-primary-dark); }

/* Map body */
.bd-map-stage {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}
.bd-map-canvas { flex: 1; position: relative; }

/* Layers panel — right sidebar */
.bd-layers-panel {
  width: 250px;
  background: var(--surface-card);
  border-left: 1px solid var(--color-border-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width var(--duration-base) var(--ease-standard);
  z-index: 2;
  position: relative;
}
.bd-layers-panel.is-collapsed { width: 0; border-left: none; }

.bd-layers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 14px;
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
}
.bd-layers-title {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-body);
}
.bd-layers-title svg { width: 15px; height: 15px; color: var(--color-primary); }
.bd-layers-close {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  border-radius: var(--radius-sm); cursor: pointer; color: var(--text-muted);
  transition: background var(--duration-fast);
}
.bd-layers-close:hover { background: var(--color-bg-app); color: var(--text-body); }

.bd-layers-list {
  overflow-y: auto;
  flex: 1;
  padding: 4px 0;
}

/* Layer row */
.bd-layer-item { border-bottom: 1px solid #f0f4f8; }
.bd-layer-item.drag-over { border-top: 2px solid var(--color-primary); }

/* Resize handle */
.bd-layers-resize-handle {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  cursor: col-resize;
  z-index: 10;
  transition: background var(--duration-fast);
}
.bd-layers-resize-handle:hover { background: var(--color-primary-light); }

/* Zoom-to-extent knop per laag */
.bd-layer-zoom-btn {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  border-radius: 3px; cursor: pointer;
  color: var(--text-muted); flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--duration-fast), background var(--duration-fast), color var(--duration-fast);
}
.bd-layer-row:hover .bd-layer-zoom-btn { opacity: 1; }
.bd-layer-zoom-btn:hover { background: var(--color-primary-light); color: var(--color-primary); }
.bd-layer-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px 6px 8px;
  cursor: pointer;
  transition: background var(--duration-fast);
  user-select: none;
}
.bd-layer-row:hover { background: #f8fafc; }

.bd-layer-drag {
  width: 14px; height: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #ccc; cursor: grab; flex-shrink: 0;
  transition: color var(--duration-fast);
}
.bd-layer-drag svg { width: 11px; height: 11px; }
.bd-layer-row:hover .bd-layer-drag { color: #999; }

.bd-layer-chevron {
  width: 13px; height: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: #aaa;
  transition: transform 150ms;
}
.bd-layer-chevron svg { width: 9px; height: 9px; }
.bd-layer-chevron.is-open { transform: rotate(90deg); }
.bd-layer-chevron.is-hidden { opacity: 0; pointer-events: none; }

.bd-layer-check {
  width: 14px; height: 14px;
  border: 1.5px solid #aabbd0;
  border-radius: 3px;
  background: var(--surface-card);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}
.bd-layer-check.is-on { background: var(--color-primary); border-color: var(--color-primary); }

.bd-layer-swatch {
  width: 13px; height: 13px;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.12);
  flex-shrink: 0;
}
.bd-layer-name {
  flex: 1;
  font-size: 12.5px;
  color: var(--text-body);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bd-layer-name.is-off { color: var(--text-muted); }

/* Layer expand area */
.bd-layer-expand {
  padding: 2px 12px 8px 34px;
}

/* Opacity control */
.bd-layer-opacity {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}
.bd-layer-opacity-label {
  font-size: 11px; color: var(--text-muted); white-space: nowrap;
}
.bd-layer-opacity-btn {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-border-light);
  border-radius: 3px; background: var(--surface-card);
  color: var(--color-primary); cursor: pointer; font-size: 10px; flex-shrink: 0;
  transition: background var(--duration-fast);
}
.bd-layer-opacity-btn:hover { background: var(--color-primary-light); }
.bd-layer-opacity-track {
  flex: 1; height: 3px;
  background: #e0e8f0; border-radius: 9999px; overflow: hidden;
}
.bd-layer-opacity-fill {
  height: 100%; background: var(--color-primary);
  border-radius: 9999px; transition: width var(--duration-fast);
}
.bd-layer-opacity-val {
  font-size: 11px; font-weight: 600; color: var(--text-body);
  min-width: 28px; text-align: right;
}

/* Legend items */
.bd-layer-legend-item {
  display: flex; align-items: center; gap: 6px;
  padding: 2px 0;
}
.bd-layer-legend-swatch {
  width: 11px; height: 11px;
  border-radius: 50%; flex-shrink: 0;
}
.bd-layer-legend-label { font-size: 11.5px; color: #555; }

/* Inactief panden section */
.bd-layers-section {
  padding: 6px 0 0;
  border-top: 1px solid var(--color-border-light);
  margin-top: 2px;
}

.bd-map-legend {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--surface-card);
  border-top: 1px solid var(--color-border-light);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  flex-shrink: 0;
}
.bd-map-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.bd-map-legend-swatch { width: 10px; height: 10px; border-radius: 2px; }

.bd-detail-panel {
  width: 320px;
  background: var(--surface-card);
  border-left: 1px solid var(--color-border-light);
  overflow-y: auto;
  padding: var(--space-5);
  flex-shrink: 0;
}
.bd-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}
.bd-detail-head h3 { margin: 0; font-size: var(--font-size-md); font-weight: var(--font-weight-semibold); color: var(--text-body); }

/* ---------- Review card ---------- */
.bd-review-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--space-5);
  align-items: start;
}
.bd-review-photo {
  width: 180px; height: 180px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--color-border-light);
}
.bd-review-photo-empty {
  width: 180px; height: 180px;
  border-radius: var(--radius-md);
  background: var(--surface-app);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  border: 1px solid var(--color-border-light);
}

/* ---------- Log viewer ---------- */
.bd-log {
  background: #0f172a;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
  line-height: 1.7;
  color: #cbd5e1;
  overflow-y: auto;
  min-height: 400px;
}
.bd-log-line { white-space: pre-wrap; word-break: break-word; }
.bd-log-ts { color: #64748b; margin-right: 8px; }
.bd-log-lvl { font-weight: 600; margin-right: 8px; }
.bd-log-lvl--DEBUG   { color: #93c5fd; }
.bd-log-lvl--INFO    { color: #86efac; }
.bd-log-lvl--WARNING { color: #fde68a; }
.bd-log-lvl--ERROR   { color: #fca5a5; }

/* ---------- Code block ---------- */
.bd-code {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
  background: var(--surface-app);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow: auto;
  border: 1px solid var(--color-border-light);
}

/* ---------- Prompt card ---------- */
.bd-prompt-card {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: var(--surface-card);
}
.bd-prompt-card.is-default {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}

/* ---------- Page tabs (underline) ---------- */
.bd-page-tabs {
  display: flex;
  gap: var(--space-6);
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: var(--space-1);
}
.bd-page-tab {
  background: transparent;
  border: 0;
  padding: var(--space-3) 0;
  font: var(--font-weight-medium) var(--font-size-base)/1 var(--font-family-base);
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color var(--duration-fast), border-color var(--duration-fast);
}
.bd-page-tab:hover { color: var(--color-primary); }
.bd-page-tab.is-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .bd-grid-2, .bd-grid-3, .bd-grid-4, .bd-grid-sidebar { grid-template-columns: 1fr; }
}

/* ---------- Stat card (Resultaten screen) ---------- */
.bd-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gap);
}
.bd-stat-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.bd-stat-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.bd-stat-icon--success { background: var(--color-success-bg); color: #1c7a44; }
.bd-stat-icon--warning { background: var(--color-warning-bg); color: #8a6d0b; }
.bd-stat-icon--error   { background: var(--color-error-bg);   color: #a63226; }
.bd-stat-icon--neutral { background: #eef2f7; color: #475569; }
.bd-stat-icon svg { width: 18px; height: 18px; }
.bd-stat-hint  { font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 2px; }

/* ---------- Review layout ---------- */
.bd-review-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--grid-gap);
  align-items: start;
}
.bd-review-preview { overflow: hidden; }
.bd-review-image { width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-md) var(--radius-md) 0 0; }
.bd-review-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bd-review-placeholder {
  width: 100%; height: 100%; aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-3);
  background: var(--surface-app);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}
.bd-review-placeholder svg { width: 48px; height: 48px; color: var(--color-border-light); stroke-width: 1.25; }
.bd-review-decision { display: flex; flex-direction: column; }

@media (max-width: 960px) {
  .bd-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .bd-review-layout { grid-template-columns: 1fr; }
}

/* ---------- Review Fullscreen ---------- */
.bd-review-fs {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  flex-direction: column;
}

.bd-review-fs-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
  color: #fff;
}

.bd-review-fs-topbar-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  opacity: 0.9;
  letter-spacing: 0.02em;
}

.bd-review-fs-topbar-counter {
  font-size: var(--font-size-sm);
  font-family: var(--font-family-mono);
  opacity: 0.7;
}

.bd-review-fs-topbar-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: var(--space-1);
  opacity: 0.8;
  transition: opacity var(--duration-fast);
  display: flex;
  align-items: center;
}
.bd-review-fs-topbar-close:hover { opacity: 1; }

.bd-review-fs-img {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bd-review-fs-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.bd-review-fs-img-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  color: rgba(255,255,255,0.3);
  font-size: var(--font-size-sm);
}

.bd-review-fs-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.bd-review-fs-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,0.5);
  font-family: var(--font-family-mono);
}

.bd-review-fs-oordeel {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: #fff;
  text-align: center;
}

.bd-review-fs-toelichting {
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,0.6);
  text-align: center;
  max-width: 600px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.bd-review-fs-knoppen {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.bd-review-fs-hint {
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.04em;
}

/* ---------- ReviewCanvas ---------- */
.review-canvas { padding: 12px; }
.review-canvas .rc-toolbar { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; flex-wrap: wrap; }
.review-canvas .rc-stage { position: relative; display: inline-block; }
.review-canvas .rc-stage img { display: block; max-width: 100%; }
.review-canvas .rc-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.review-canvas .rc-stage circle:hover { fill: #fbbf24; }
.review-canvas .rc-rij { display: flex; gap: 8px; padding: 4px 8px; align-items: center; border-bottom: 1px solid var(--border-subtle, #e5e7eb); }
.review-canvas .rc-rij.is-akkoord { background: rgba(34,197,94,0.07); }
.review-canvas .rc-rij.is-verwijderd { opacity: 0.45; text-decoration: line-through; }
.review-canvas .rc-rij.is-hover { background: var(--surface-app, #eef2f7); outline: 1px solid var(--color-primary, #004494); outline-offset: -1px; }
.review-canvas .rc-rij-label { flex: 1; font-size: var(--font-size-sm); }
.review-canvas .rc-list { margin-top: 8px; border: 1px solid var(--border-subtle, #e5e7eb); border-radius: 6px; overflow: hidden; }
.review-canvas .rc-empty { padding: 12px; color: var(--text-muted); font-size: var(--font-size-sm); }
.review-canvas .rc-hint { font-size: var(--font-size-sm); color: var(--text-muted); }
.review-canvas .rc-btn { padding: 4px 10px; border: 1px solid var(--border-subtle, #d1d5db); border-radius: 4px; background: var(--surface-card, #fff); cursor: pointer; font-size: var(--font-size-sm); }
.review-canvas .rc-btn:hover { background: var(--surface-hover, #f3f4f6); }
.review-canvas .rc-btn-icon { padding: 4px 8px; min-width: 28px; }
.review-canvas .rc-btn-danger { color: var(--color-danger, #dc2626); }
.review-canvas .rc-btn-cancel { color: var(--text-muted); }
.review-canvas .rc-select { font-size: var(--font-size-sm); border: 1px solid var(--border-subtle, #d1d5db); border-radius: 4px; padding: 2px 4px; background: var(--surface-card, #fff); }

/* ---------- Review workbench ---------- */
.bd-review-page {
  overflow: hidden;
}
.bd-review-filters {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(360px, 1fr) minmax(160px, 220px);
  gap: var(--space-4);
  align-items: end;
}
.bd-review-workbench {
  flex: 1;
  flex-shrink: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(480px, 1fr) 340px;
  gap: var(--space-4);
}
.bd-review-main {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(360px, 1fr) auto;
  gap: var(--space-3);
}
.bd-review-viewport {
  min-height: 0;
  border: 1px solid var(--color-border-light);
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
}
.bd-review-image-empty {
  flex: 1;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  color: var(--text-muted);
  background: var(--surface-app);
}
.bd-review-actionbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-3);
  background: var(--surface-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.bd-review-actionbar .tc-btn {
  min-width: 132px;
  justify-content: center;
}
.bd-review-side {
  min-height: 0;
  overflow-y: auto;
  background: var(--surface-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.bd-review-side-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: flex-start;
}
.bd-review-side-head h2 {
  margin: 2px 0 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  word-break: break-word;
}
.bd-review-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.bd-review-fact {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: var(--space-3);
  align-items: start;
  font-size: var(--font-size-sm);
}
.bd-review-fact span {
  color: var(--text-muted);
}
.bd-review-fact strong {
  font-weight: var(--font-weight-semibold);
  color: var(--text-body);
  word-break: break-word;
}
.bd-review-panel {
  border-top: 1px solid var(--color-border-light);
  padding-top: var(--space-4);
}
.bd-review-panel h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}
.bd-review-panel p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  line-height: 1.5;
}
.bd-review-muted {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}
.bd-review-history {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.bd-review-history-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-2);
  align-items: center;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}
.bd-review-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.bd-review-shortcuts span {
  padding: 4px 8px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  background: var(--surface-app);
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-family: var(--font-family-mono);
}
.bd-review-queue-panel {
  min-height: 0;
}
.bd-review-queue {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.bd-review-queue-item {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  padding: var(--space-2);
  color: var(--text-body);
  text-align: left;
  cursor: pointer;
}
.bd-review-queue-item:hover,
.bd-review-queue-item.is-active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}
.bd-review-queue-index {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface-app);
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-family: var(--font-family-mono);
}
.bd-review-queue-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bd-review-queue-title,
.bd-review-queue-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bd-review-queue-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}
.bd-review-queue-sub {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.bd-review-pandlijst {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.bd-review-pand-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  padding: var(--space-2);
  color: var(--text-body);
  text-align: left;
  cursor: pointer;
}
.bd-review-pand-row:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}
.bd-review-pand-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.bd-review-pand-main .bd-mono {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bd-review-viewport .review-canvas {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.bd-review-viewport .review-canvas .rc-zoom-controls {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 4;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  box-shadow: var(--shadow-card);
}
.bd-review-viewport .review-canvas .rc-zoom-btn {
  min-width: 32px;
  height: 30px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-body);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
}
.bd-review-viewport .review-canvas .rc-zoom-btn:hover {
  background: var(--surface-app);
  border-color: var(--color-primary);
}
.bd-review-viewport .review-canvas .rc-zoom-btn.is-active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.bd-review-viewport .review-canvas .rc-toolbar {
  margin: 0;
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border-light);
  background: var(--surface-card);
}
.bd-review-viewport .review-canvas .rc-stage-wrap {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-app);
  overflow: hidden;
  padding: var(--space-3);
  cursor: zoom-in;
  user-select: none;
}
.bd-review-viewport .review-canvas .rc-stage-wrap.is-zoomed {
  cursor: grab;
}
.bd-review-viewport .review-canvas .rc-stage-wrap.is-panning {
  cursor: grabbing;
}
.bd-review-viewport .review-canvas .rc-stage {
  position: relative;
  display: block;
  max-width: 100%;
  max-height: 100%;
  flex: 0 1 auto;
  overflow: visible;
  transform-origin: 0 0;
  will-change: transform;
}
.bd-review-viewport .review-canvas .rc-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.bd-review-viewport .review-canvas .rc-stage svg {
  pointer-events: none;
}
.bd-review-viewport .review-canvas.is-editing .rc-stage svg {
  pointer-events: auto;
}
.bd-review-viewport .review-canvas .rc-list {
  margin: 0;
  border-width: 1px 0 0;
  border-radius: 0;
  max-height: 156px;
  overflow-y: auto;
}
.bd-review-viewport .review-canvas .rc-view-summary {
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--color-border-light);
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  background: var(--surface-card);
}

@media (max-width: 1180px) {
  .bd-review-workbench {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .bd-review-side {
    max-height: none;
  }
}

@media (max-width: 900px) {
  .bd-review-page {
    overflow-y: auto;
  }
  .bd-review-filters {
    grid-template-columns: 1fr;
  }
  .bd-review-main {
    grid-template-rows: minmax(320px, 58vh) auto;
  }
  .bd-review-actionbar .tc-btn {
    min-width: 116px;
  }
}

/* Flow explorer */
.bd-flow-shell {
  display: grid;
  grid-template-columns: 220px minmax(420px, 1fr) 380px;
  min-height: 680px;
  border: 1px solid var(--color-border-light);
  background: var(--surface-card);
}
.bd-flow-groups {
  border-right: 1px solid var(--color-border-light);
  background: var(--surface-raised-hover);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.bd-flow-groups button,
.bd-flow-tabs button {
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.bd-flow-groups button {
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: var(--font-weight-semibold);
}
.bd-flow-groups button.is-active {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  box-shadow: inset 3px 0 0 var(--color-primary);
}
.bd-flow-canvas {
  padding: var(--space-5);
  background: var(--surface-app);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  align-content: start;
  gap: var(--space-3);
  overflow: auto;
}
.bd-flow-node {
  min-height: 118px;
  border: 2px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  padding: var(--space-3);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}
.bd-flow-node:hover,
.bd-flow-node.is-selected {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus-ring);
}
.bd-flow-node-kind {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  font-weight: var(--font-weight-bold);
}
.bd-flow-node span:last-child,
.bd-flow-node em {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-style: normal;
}
.bd-flow-node.is-fout { border-color: var(--color-error); }
.bd-flow-node.is-klaar { border-color: var(--color-success); }
.bd-flow-node.is-bezig { border-color: var(--color-warning); }
.bd-flow-detail {
  border-left: 1px solid var(--color-border-light);
  background: var(--surface-card);
  min-width: 0;
}
.bd-flow-detail-head {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
}
.bd-flow-detail-head span {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  font-weight: var(--font-weight-bold);
}
.bd-flow-detail-head h2 {
  margin: 4px 0;
  font-size: var(--font-size-lg);
}
.bd-flow-detail-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}
.bd-flow-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border-light);
  overflow-x: auto;
}
.bd-flow-tabs button {
  padding: 10px 12px;
  font-weight: var(--font-weight-bold);
  color: var(--text-muted);
}
.bd-flow-tabs button.is-active {
  color: var(--color-primary-dark);
  box-shadow: inset 0 -3px 0 var(--color-primary);
}
.bd-flow-detail-body {
  padding: var(--space-4);
  font-size: var(--font-size-sm);
}
.bd-flow-detail-body h3 {
  margin: var(--space-4) 0 var(--space-2);
  font-size: var(--font-size-sm);
}
.bd-flow-kv {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: var(--space-2);
}
.bd-flow-kv dt {
  color: var(--text-muted);
  font-weight: var(--font-weight-bold);
}
.bd-flow-kv dd {
  margin: 0;
  font-family: var(--font-family-mono);
}
.bd-flow-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.bd-flow-data-grid section,
.bd-flow-artifact,
.bd-flow-runtime-row {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  background: var(--surface-raised-hover);
}
.bd-flow-runtime {
  display: grid;
  gap: var(--space-2);
}
.bd-flow-runtime-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.bd-flow-trace-controls {
  align-items: end;
}
.bd-flow-trace-controls .bd-field {
  margin: 0;
  min-width: 150px;
}

@media (max-width: 1100px) {
  .bd-flow-shell {
    grid-template-columns: 1fr;
  }
  .bd-flow-groups {
    border-right: 0;
    border-bottom: 1px solid var(--color-border-light);
    flex-direction: row;
    overflow-x: auto;
  }
  .bd-flow-detail {
    border-left: 0;
    border-top: 1px solid var(--color-border-light);
  }
}
