/* ============================================================
   REGIETAFEL WONINGBOUWOPGAVE — style.css
   Gemeente Apeldoorn Huisstijl
   ============================================================ */

/* --- DESIGN TOKENS --- */
:root {
  --bg-neutral: #f7f9fa;
  --panel-white: #ffffff;
  --primary-cyan: #00a4c4;
  --primary-dark: #1a2b32;
  --accent-green: #4caf50;
  --accent-amber: #ff9800;
  --accent-blue: #2196f3;
  --accent-red: #ef4444;
  --border-radius: 8px;
  --shadow-subtle: 0 4px 12px rgba(0, 0, 0, 0.05);
  --border-light: #e2e8f0;
}

/* --- RESET & BASE --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-neutral);
  color: var(--primary-dark);
  height: 100vh;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* ============================================================
   APPLICATIE SHELL
   ============================================================ */
.app-container {
  display: flex;
  height: 100vh;
}

/* --- LINKER ZIJBALK --- */
.sidebar {
  width: 280px;
  background-color: var(--panel-white);
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  padding: 20px;
  transition: width 0.3s ease;
  overflow: hidden;
}

.brand-container {
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0f0;
}

.logo-placeholder {
  font-size: 1.1rem;
  color: var(--primary-dark);
  white-space: nowrap;
}

.steps-nav {
  margin-top: 20px;
}
.steps-nav ul {
  list-style: none;
}

.step {
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #666;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.step.completed {
  color: var(--accent-green);
  font-weight: 500;
}
.step.active {
  background-color: #e6f6f9;
  color: var(--primary-cyan);
  font-weight: 600;
}
.step:hover:not(.active) {
  background-color: #f5f5f5;
}

/* --- HOOFDINHOUD --- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* --- PERMANENTE TABBAR --- */
.permanent-tabbar {
  height: 60px;
  flex-shrink: 0;
  background-color: var(--panel-white);
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
}

.tab-btn {
  padding: 8px 18px;
  border: 1px solid #dce2e6;
  background-color: #f8fafc;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.tab-btn.active {
  background-color: var(--primary-cyan);
  color: white;
  border-color: var(--primary-cyan);
}
.tab-btn:hover:not(.active) {
  background-color: #e6f6f9;
}

.sandbox-badge-container {
  margin-left: auto;
}
#sandbox-badge {
  background-color: var(--accent-amber);
  color: white;
  padding: 4px 10px;
  font-size: 0.78rem;
  border-radius: 4px;
  font-weight: 700;
}

/* --- CONTENT WRAPPER --- */
.content-wrapper {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* --- SIDE BAR --- */

/* sidebar collapse */
.sidebar {
  transition:
    width 0.25s ease,
    padding 0.25s ease;
  overflow: hidden;
}
.sidebar.collapsed {
  width: 52px;
  padding: 15px 6px;
  align-items: center;
}
.sidebar.collapsed .brand-container strong,
.sidebar.collapsed .menu-category-header,
.sidebar.collapsed .step {
  overflow: hidden;
  white-space: nowrap;
}
/* Styling wanneer de sidebar is ingeklapt */
.collapsed .menu-category-header {
  font-size: 0; /* Verbergt de volledige tekst 'Prototype X' */
  letter-spacing: 0;
  padding: 0;
  margin-top: 16px;
  margin-bottom: 8px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* De divider-lijn zelf */
.collapsed .menu-category-header::before {
  content: "";
  position: absolute;
  left: 10%; /* Zorgt dat de lijn niet strak tegen de randen aanplakt */
  right: 10%;
  top: 50%;
  height: 2px;
  background-color: #e9eef4;
  z-index: 1;
}

/* De gecentreerde badge met het nummer */
.collapsed .menu-category-header::after {
  content: attr(
    data-number
  ); /* Haalt het nummer op uit het HTML data-attribuut */
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8; /* Subtiele kleur voor het nummer */
  background-color: #ffffff; /* Matcht met de achtergrond van de sidebar om de lijn te 'snijden' */
  border: 2px solid #e9eef4;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2; /* Zorgt dat de badge bovenop de lijn ligt */
}

.collapsed .steps-nav .menu-category-header:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.sidebar.collapsed .step {
  font-size: 0;
  padding: 10px 6px;
  justify-content: center;
  display: flex;
}
/* .sidebar.collapsed .step-number {
  font-size: 1.1rem;
} */
.sidebar-toggle-btn {
  background: none;
  border: 0.5px solid #e2e8f0;
  border-radius: 5px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  flex-shrink: 0;
  margin-left: auto;
  transition: background 0.15s;
}
.sidebar-toggle-btn:hover {
  background: #f1f5f9;
}
.sidebar-toggle-btn i {
  font-size: 14px;
  transition: transform 0.25s;
}
.sidebar.collapsed .sidebar-toggle-btn i {
  transform: rotate(180deg);
}
.sidebar.collapsed .brand-text {
  display: none;
}

.step .ti,
.brand-text .ti {
  display: inline-block;
  width: 1.45rem;
  text-align: center;
  font-size: 1.35rem;
  vertical-align: middle;
}

/* ============================================================
   GEDEELDE COMPONENTEN
   ============================================================ */

/* Kaart */
.card {
  background: var(--panel-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-subtle);
  padding: 20px;
  border: 1px solid #eaeaea;
}

/* Visual card (paneel-widget) */
.visual-card {
  background: var(--panel-white);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  padding: 16px;
  box-shadow: var(--shadow-subtle);
}
.visual-card h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 12px;
  font-weight: 600;
}

/* Panel headers */
.panel-section-header {
  margin-bottom: 4px;
}
.panel-section-header h3 {
  font-size: 1.1rem;
  color: var(--primary-dark);
  font-weight: 700;
}
.panel-section-header .section-sub {
  font-size: 0.8rem;
  color: #64748b;
}

/* Status kleurcodering */
.status-amber {
  background-color: #fffbeb;
  border: 1px solid #fef3c7;
  border-left: 5px solid var(--accent-amber);
}
.status-amber h4 {
  color: #b45309;
}

.status-green {
  background-color: #f0fdf4;
  border: 1px solid #dcfce7;
  border-left: 5px solid var(--accent-green);
}
.status-green h4 {
  color: #15803d;
}

.status-blue {
  background-color: #eff6ff;
  border: 1px solid #dbeafe;
  border-left: 5px solid var(--accent-blue);
}

.status-red {
  background-color: rgba(239, 68, 68, 0.1);
}

/* Alert popups */
.alert-popup {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  animation: slideIn 0.2s ease-out;
}
.alert-popup.alert-blue {
  background-color: #eff6ff;
  border-left: 4px solid var(--accent-blue);
}
.alert-popup.alert-green {
  background-color: #dcfce7;
  border: 1px solid #22c55e;
  color: #15803d;
  padding: 12px;
  font-size: 0.9rem;
  text-align: center;
}

/* Knoppen */
.btn-primary-lg {
  width: 100%;
  background-color: var(--primary-cyan);
  color: white;
  border: none;
  padding: 16px;
  border-radius: var(--border-radius);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition:
    background 0.2s ease,
    transform 0.1s ease;
}
.btn-primary-lg:hover {
  background-color: #008ca7;
}
.btn-primary-lg:active {
  transform: scale(0.99);
}
.btn-primary-lg .arrow {
  transition: transform 0.2s ease;
}
.btn-primary-lg:hover .arrow {
  transform: translateX(4px);
}

/* Legenda bouwsteen */
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.legend-item:last-child {
  margin-bottom: 0;
}
.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}
.legend-text {
  font-size: 0.78rem;
  color: #334155;
}

/* GIS-kaart overlay legenda (gedeeld patroon) */
.gis-legend-box {
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
  padding: 10px 14px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-light);
  font-size: 0.75rem;
  box-shadow: var(--shadow-subtle);
  z-index: 10;
}
.gis-legend-box h4 {
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 0.75rem;
}

/* Kaart header overlay */
.map-header-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  padding: 10px 16px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-subtle);
  backdrop-filter: blur(4px);
}
.map-header-overlay h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-dark);
}
.map-scale-badge {
  font-size: 0.72rem;
  color: #64748b;
}

/* GIS kaart canvas */
.gis-map-canvas {
  width: 100%;
  height: 100%;
  background-color: #e2e8f0;
  position: relative;
}
.gis-svg-layer {
  width: 100%;
  height: 100%;
  display: block;
}

/* Animatie knipperend concept-project */
@keyframes dash-pulse {
  to {
    stroke-dashoffset: -20;
  }
}
#project-k7 {
  animation: dash-pulse 2s linear infinite;
}

/* --- UNIVERSELE LEGENDA POSITIONERING & OVERRIDES --- */

/* Basis layout-regels forceren voor de universele box */
.gis-legend-box {
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 14px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-light);
  font-size: 0.78rem; /* Gelijkgetrokken met .legend-text */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* Subtiele schaduw voor zwevende kaartelementen */
  z-index: 10;
  min-width: 180px;
}

/* Universele styling voor de legenda-koppen */
.gis-legend-box h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-dark);
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 4px;
}

/* Specifieke positionering voor Fase 1 kaart */
.gis-legend-f1-position {
  bottom: 24px;
  right: 24px;
}

/* Specifieke positionering voor Fase 2 kaart overlay */
.gis-legend-f2-position,
.gis-legend-f3-position {
  bottom: 16px;
  right: 16px;
}

/* Gekleurde indicatoren voor Fase 2 legenda overnemen in de universele structuur */
.existing-blue {
  background-color: #008ca7;
  border: 1px solid #005f73;
}
.concept-orange-dash {
  background-color: rgba(255, 152, 0, 0.2);
  border: 2px dashed #ff9800;
}
.infrastructure-gray {
  background-color: #d1d5db;
  border: 1px solid #9ca3af;
}

/* ============================================================
   FASE 1 — INTAKE SPLIT SCREEN (40% / 60%)
   ============================================================ */
.layout-fase-1 .fase-1-view {
  display: grid;
  grid-template-columns: 40% 60%;
  height: calc(100vh - 60px);
}

/* Linker dossier-paneel */
.dossier-panel {
  background: var(--panel-white);
  border-right: 1px solid var(--border-light);
  padding: 24px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  gap: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
}

.status-badge {
  background-color: #f1f5f9;
  color: #64748b;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.project-data-card h3,
.frictie-inbox-container h3 {
  font-size: 0.8rem;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  font-weight: 600;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table td {
  padding: 8px 0;
  font-size: 0.9rem;
}
.data-table td.label {
  color: #64748b;
  width: 35%;
}

.badge-type {
  background-color: #e0f2fe;
  color: #0369a1;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 500;
}

.section-desc {
  font-size: 0.83rem;
  color: #64748b;
  margin-bottom: 12px;
}

.frictie-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  border-radius: var(--border-radius);
  margin-bottom: 10px;
  background-color: #fafafa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.frictie-card h4 {
  font-size: 0.9rem;
  margin-bottom: 3px;
  font-weight: 600;
}
.frictie-card p {
  font-size: 0.82rem;
  line-height: 1.4;
  color: #4a5568;
}
.frictie-icon {
  font-size: 1.1rem;
  margin-top: 1px;
}

.action-container {
  margin-top: auto;
  padding-top: 16px;
}

/* Rechter GIS paneel fase 1 */
.gis-panel {
  position: relative;
  height: 100%;
  background-color: #e5e7eb;
  overflow: hidden;
}

.gis-legend {
  position: absolute;
  bottom: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.95);
  padding: 14px;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10;
  min-width: 180px;
  border: 1px solid var(--border-light);
}
.gis-legend h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--primary-dark);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 4px;
}

.color-project {
  background-color: rgba(239, 68, 68, 0.2);
  border: 2px solid #ef4444;
}
.color-groenvisie {
  background-color: rgba(76, 175, 80, 0.4);
  border: 2px dashed #2e7d32;
}
.color-sloop {
  background-color: rgba(33, 150, 243, 0.3);
  border: 1px solid #1976d2;
}

/* ============================================================
   FASE 2 — REGIETAFEL DRIE-KOLOMS (25% / 50% / 25%)
   ============================================================ */
.layout-fase-2 .fase-2-view {
  display: flex;
  width: 100%;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.dashboard-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  overflow-y: auto;
  height: 100%;
}
.col-left {
  flex: 0 0 25%;
  border-right: 1px solid var(--border-light);
  background-color: #f8fafc;
}
.col-center {
  flex: 0 0 50%;
  background-color: #f1f5f9;
  padding: 0;
}
.col-right {
  flex: 0 0 25%;
  border-left: 1px solid var(--border-light);
  background-color: #f8fafc;
}

/* Netto-saldo bar */
.netto-container {
  margin-bottom: 8px;
}
.netto-badge {
  background-color: rgba(76, 175, 80, 0.15);
  color: var(--accent-green);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 1.05rem;
}
.netto-badge small {
  font-size: 0.73rem;
  font-weight: 400;
}

.bar-chart-horizontal {
  display: flex;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.73rem;
  font-weight: 600;
  color: white;
  line-height: 28px;
  text-align: center;
}
.bar-sloop {
  background-color: #ef4444;
}
.bar-nieuwbouw {
  background-color: #00a4c4;
}

/* Stacked segmentatie bar */
.stacked-bar-container {
  display: flex;
  height: 24px;
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.73rem;
  color: white;
  font-weight: 600;
  line-height: 24px;
  text-align: center;
}
.seg-sociaal {
  background-color: #1e3a8a;
}
.seg-midden {
  background-color: #3b82f6;
}
.seg-vrij {
  background-color: #60a5fa;
}

.stacked-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.73rem;
  color: #475569;
}
.stacked-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}
.dot.sociaal {
  background-color: #1e3a8a;
}
.dot.midden {
  background-color: #3b82f6;
}
.dot.vrij {
  background-color: #60a5fa;
}

/* Doelgroepen */
.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.target-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}
.target-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-cyan);
}
.target-label {
  font-size: 0.73rem;
  color: #64748b;
}

/* KPI saldo */
.kpi-badge-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.kpi-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.83rem;
  font-weight: 500;
}
.kpi-row.status-amber {
  background-color: rgba(255, 152, 0, 0.1);
  border-left: 4px solid var(--accent-amber);
}
.kpi-row.status-red {
  background-color: rgba(239, 68, 68, 0.1);
  border-left: 4px solid var(--accent-red);
}
.kpi-val {
  font-weight: 700;
}
.kpi-val small {
  font-weight: 400;
  color: #64748b;
}

/* GIS kaart legenda fase 2 */
.map-container-wrapper {
  position: relative;
}

.gis-legend-f2 {
  position: absolute;
  bottom: 16px;
  left: 16px;
}

.legend-color.existing-blue {
  background-color: #008ca7;
}
.legend-color.concept-orange-dash {
  border: 2px dashed #ff9800;
  background-color: rgba(255, 152, 0, 0.15);
}
.legend-color.infrastructure-gray {
  background-color: #d1d5db;
}

/* Radar */
.radar-card .chart-container {
  position: relative;
  width: 100%;
  height: 210px;
}

/* Ambitie-meters */
.ambitie-meters-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.meter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.meter-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
}
.text-danger {
  color: var(--accent-red);
}

.progress-track {
  position: relative;
  height: 10px;
  background-color: var(--border-light);
  border-radius: 5px;
}
.progress-fill {
  height: 100%;
  border-radius: 5px;
}
.progress-fill.fill-normal {
  background-color: var(--primary-cyan);
}
.progress-fill.fill-critical {
  background-color: var(--accent-red);
}

.ceiling-marker {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 18px;
  background-color: var(--primary-dark);
  border-radius: 2px;
}
.ceiling-legend {
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ceiling-legend .line-indicator {
  display: inline-block;
  width: 3px;
  height: 12px;
  background-color: var(--primary-dark);
}

/* ============================================================
   FASE 3 — SIDEBAR INKLAPPEN
   ============================================================ */
.layout-fase-3 .sidebar {
  width: 70px;
  padding: 15px 5px;
  align-items: center;
}
.layout-fase-3 .sidebar .brand-container strong,
.layout-fase-3 .sidebar .logo-placeholder > *:not(.logo-icon) {
  display: none;
}
.layout-fase-3 .sidebar .logo-icon {
  font-size: 1.5rem;
}
.layout-fase-3 .sidebar .step {
  font-size: 0; /* Verberg tekst */
  padding: 10px;
  text-align: center;
}
/* .layout-fase-3 .sidebar .step-number {
  font-size: 1.2rem;
  display: block;
} */

/* ============================================================
   FASE 3 — SANDBOX HORIZONTALE SPLIT
   ============================================================ */
.layout-fase-3 .fase-3-view {
  display: block;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.sandbox-grid-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Bovenste helft: kaart */
.sandbox-top-map {
  flex: 0 0 58%;
  position: relative;
  background-color: #e2e8f0;
  border-bottom: 2px solid var(--border-light);
  overflow: hidden;
}

/* Zwevende radar op de kaart */
.sandbox-radar-floating {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.95);
  padding: 12px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-subtle);
  z-index: 5;
  width: 240px;
}
.sandbox-radar-floating h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  color: var(--primary-dark);
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 4px;
}
.sandbox-chart-wrapper {
  position: relative;
  height: 170px;
}

/* GIS legenda fase 3 */
.gis-legend-f3 {
  position: absolute;
  bottom: 12px;
  left: 12px;
}
.legend-color.color-blue {
  background-color: #00a4c4;
}
.legend-color.color-orange-dash {
  background-color: rgba(255, 152, 0, 0.1);
  border: 2px dashed #ff9800;
}
.legend-color.color-green-dash {
  background-color: rgba(76, 175, 80, 0.2);
  border: 1px dashed #4caf50;
}
.legend-line.line-blue-dash {
  display: inline-block;
  width: 16px;
  height: 0;
  border-top: 2px dashed #00a4c4;
}

/* Onderste helft: kneed-paneel */
.sandbox-bottom-panel {
  flex: 0 0 42%;
  background: var(--panel-white);
  padding: 20px 28px;
  display: flex;
  gap: 40px;
  justify-content: space-between;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
  overflow-y: auto;
}

.kneed-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.slider-header label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
}
.slider-value-badge {
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-cyan);
}

.html5-slider {
  width: 100%;
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  outline: none;
  accent-color: var(--primary-cyan);
  cursor: pointer;
}

/* Argumentatie popup */
.popup-content {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.popup-icon {
  font-size: 1rem;
}
.popup-text p {
  font-size: 0.78rem;
  color: #1e40af;
  margin-bottom: 4px;
  line-height: 1.3;
}
.popup-input {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  font-size: 0.75rem;
  outline: none;
  color: var(--primary-dark);
}
.popup-input:focus {
  border-color: var(--accent-blue);
}

/* Kneed-acties */
.kneed-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 260px;
  justify-content: center;
}

.btn-sandbox-action {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: var(--primary-dark);
  padding: 10px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}
.btn-sandbox-action:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-sandbox-success {
  background: var(--accent-green);
  border: none;
  color: white;
  padding: 14px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: center;
  margin-top: 5px;
  box-shadow: 0 4px 6px rgba(76, 175, 80, 0.15);
  transition: background 0.15s ease;
}
.btn-sandbox-success:hover {
  background: #43a047;
}

/* ============================================================
   FASE 4 — VARIANT VERGELIJKER MATRIX
   ============================================================ */
.layout-fase-4 .fase-4-view {
  padding: 20px;
  overflow-y: auto;
  height: calc(100vh - 60px);
}

.matrix-grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.matrix-col {
  background: var(--panel-white);
  border-radius: var(--border-radius);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.08),
    0 2px 4px -1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.matrix-col-header {
  padding: 14px 20px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.matrix-col-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.bg-variant-a {
  background-color: #16a34a;
}
.bg-variant-b {
  background-color: #2563eb;
}
.bg-notes {
  background-color: #7c3aed;
}

.variant-tag {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  font-weight: 700;
}
.text-green {
  color: #16a34a;
}
.text-blue {
  color: #2563eb;
}
.text-purple {
  color: #7c3aed;
}

.matrix-card-body {
  padding: 18px;
  flex-grow: 1;
}
.flex-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Mini kaart & radar */
.mini-map-container {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 14px;
}
.mini-map-svg {
  width: 100%;
  height: auto;
  display: block;
}
.mini-chart-container {
  height: 175px;
  margin-bottom: 18px;
  position: relative;
}

/* Delta tellers */
.delta-tellers-container h4,
.axis-scores-container h4,
.pros-cons-box h4,
.interactive-notes-area h4 {
  font-size: 0.85rem;
  color: #334155;
  margin: 0 0 8px 0;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 5px;
  font-weight: 600;
}

.delta-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}
.delta-item {
  display: flex;
  justify-content: space-between;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 0.83rem;
  font-weight: 600;
}
.delta-item.status-green {
  background-color: #dcfce7;
  color: #15803d;
}
.delta-item.status-red {
  background-color: #fee2e2;
  color: #b91c1c;
}
.delta-item.status-amber {
  background-color: #fef3c7;
  color: #b45309;
}

/* As-scores pills */
.score-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.score-pill {
  font-size: 0.72rem;
  padding: 3px 7px;
  border-radius: 4px;
  font-weight: 600;
}
.score-high {
  background-color: #15803d;
  color: white;
}
.score-mid {
  background-color: #d97706;
  color: white;
}
.score-low {
  background-color: #b91c1c;
  color: white;
}

/* Pros & cons kolom */
.text-variant-a-dark h5 {
  color: #16a34a;
  margin: 0 0 4px;
  font-size: 0.83rem;
}
.text-variant-b-dark h5 {
  color: #2563eb;
  margin: 10px 0 4px;
  font-size: 0.83rem;
}

.variant-impact-summary ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.78rem;
}
.variant-impact-summary li {
  margin-bottom: 4px;
  color: #475569;
}
.icon-pro {
  color: #16a34a;
  font-weight: bold;
  margin-right: 4px;
}
.icon-con {
  color: #dc2626;
  font-weight: bold;
  margin-right: 4px;
}

/* Notities textarea */
.interactive-notes-area textarea {
  width: 100%;
  height: 110px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px;
  font-family: inherit;
  font-size: 0.83rem;
  resize: none;
  margin-top: 6px;
}
.interactive-notes-area textarea:focus {
  outline: none;
  border-color: var(--primary-cyan);
}

.btn-secondary-sm {
  margin-top: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
}
.btn-secondary-sm:hover {
  background: var(--border-light);
}

/* Hoofd-exportknop */
.main-action-footer {
  margin-top: 24px;
  width: 100%;
}

.btn-generate-proposal {
  width: 100%;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  border: none;
  padding: 18px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--border-radius);
  cursor: pointer;
  box-shadow: 0 8px 15px -3px rgba(124, 58, 237, 0.28);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition:
    transform 0.1s ease,
    opacity 0.2s ease;
}
.btn-generate-proposal:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}
.btn-generate-proposal:active {
  transform: translateY(1px);
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s ease-in-out infinite;
}

/* ============================================================
   FASE 5 — KWALITATIEVE MONITOR ASYMMETRISCHE SPLIT (30% / 70%)
   ============================================================ */
.layout-fase-5 .fase-5-view {
  display: flex;
  height: calc(100vh - 60px);
  width: 100%;
}

/* Linker kolom: 30% */
.monitor-panel {
  width: 30%;
  min-width: 320px;
  background-color: var(--panel-white);
  border-right: 1px solid var(--border-light);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

/* Rechter kolom: 70% */
.gis-panel-f5 {
  width: 70%;
  position: relative;
  background-color: #e2e8f0;
  height: 100%;
}

.gis-map-canvas-f5 {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gis-map-canvas-f5 svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Interactieve Schakel-matrix bouwstenen */
.indicator-matrix {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.indicator-row {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.indicator-row:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.indicator-row.active {
  background: #eff6ff;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue);
}

.indicator-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.indicator-meta h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.indicator-score {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-blue);
  background: rgba(33, 150, 243, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
}

.indicator-desc {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.3;
}

/* Narratieve Verrijking Kaart */
.narrative-card {
  margin-top: auto;
  background: #fafafa;
  border-top: 2px solid var(--primary-cyan);
}

.narrative-text {
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.4;
  margin-top: 6px;
}

/* Lagen-Blender & SVG Transities (<200ms) */
.heatmap-layer {
  transition: opacity 0.18s ease-in-out;
}

.heatmap-layer.fading {
  animation: fadeInHeatmap 0.18s ease-in-out forwards;
}

@keyframes fadeInHeatmap {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.5;
  }
}

/* Interactieve Project Contour */
.interactive-contour {
  cursor: pointer;
  transition: transform 0.1s ease;
}

.interactive-contour polygon {
  transition:
    fill 0.15s ease,
    stroke-width 0.15s ease;
}

.interactive-contour:hover polygon {
  fill: rgba(0, 164, 196, 0.35);
  stroke-width: 4px;
}

/* Legenda positionering voor Fase 5 */
.gis-legend-f5-position {
  bottom: 24px;
  right: 24px;
}

/* ============================================================
   AANVULLINGEN PROTOTYPE 2 (Spoorzone-West Monitor)
   ============================================================ */

.menu-category-header {
  padding: 16px 0 8px 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: #94a3b8; /* Pas aan naar wens */
  border-top: 1px solid transparent; /* Voorkomt 'springen' van layout */
  transition: all 0.2s ease;
}

.topbar {
  background: var(--panel-white);
  border-bottom: 0.5px solid var(--border-light);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
}

.topbar-meta {
  font-size: 11px;
  color: #64748b;
}

.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  display: inline-block;
  margin-right: 8px;
  animation: pulseLive 2s infinite;
}

@keyframes pulseLive {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* Aanvullende status badges */
.status-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
}

/* ============================================================
   VERRIJKTE STIJLEN PROTOTYPE 2
   ============================================================ */

.status-badge.badge-danger {
  background: #ffeeec;
  color: var(--accent-red);
  border: 1px solid #fecaca;
}

.status-badge.badge-warning {
  background: #fff7ed;
  color: var(--accent-amber);
  border: 1px solid #ffedd5;
}

.status-badge.badge-success {
  background: #f0fdf4;
  color: var(--accent-green);
  border: 1px solid #bbf7d0;
}

.data-table th {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Zorg dat de switch-animaties vloeiend zijn */
#knelpunt-modal {
  transition: opacity 0.2s ease-in-out;
}

/* ============================================================
   GECORRIGEERDE PROTOTYPE 2 MATRIX & ACCORDEON STYLES
   ============================================================ */

/* CSS Variabele Fallbacks voor de pure HTML imports */
:root {
  --color-background-primary: #ffffff;
  --color-background-secondary: #f8fafc;
  --color-background-tertiary: #f1f5f9;
  --color-border-tertiary: #cbd5e1;
  --color-text-primary: #0f172a;
  --color-text-secondary: #64748b;
  --font-sans: "Inter", sans-serif;
  --border-radius-md: 6px;
  --border-radius-lg: 8px;
}

/* Algemene matrix tabel lay-out fix */
.matrix {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  background: var(--color-background-primary);
}

.matrix th {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-tertiary);
  background: var(--color-background-secondary);
  text-align: left;
}

.matrix td {
  padding: 14px 16px;
  border-bottom: 0.5px solid #e2e8f0;
  vertical-align: middle;
  color: var(--color-text-primary);
}

/* Hoofdprogramma Rij */
.matrix-row.parent-program {
  background-color: #f8fafc !important;
  font-weight: 600;
  border-bottom: 1px solid var(--color-border-tertiary);
}

/* Chevron rotatie fix */
.chevron-icon {
  display: inline-block;
  transition: transform 0.2s ease;
  margin-right: 8px;
  font-size: 12px;
}

/* Wanneer geopend, roteer de pijl */
.chevron-icon.open {
  transform: rotate(90deg);
}

/* Sub-rijen groepering */
.sub-rows-container {
  display: none; /* Standaard verborgen */
}

/* Wanneer de container de klasse 'open' krijgt via JS, toon de rijen */
.sub-rows-container.open {
  display: table-row-group;
}

/* Subproject styling conform screenshot */
.matrix-row.sub-project {
  background-color: #ffffff !important;
}

.matrix-row.sub-project td:first-child {
  padding-left: 32px !important;
  position: relative;
}

/* Het subtiele verticale verbindingslijntje voor de hiërarchie */
.matrix-row.sub-project td:first-child::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--color-border-tertiary);
}

/* Status Badges */
.phase-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}
.phase-badge.status-done {
  background: #eaf3de;
  color: #3b6d11;
}
.phase-badge.status-active {
  background: #e0f2fe;
  color: #0369a1;
}
.phase-badge.status-stagnant {
  background: #fef3c7;
  color: #d97706;
}
.phase-badge.status-critical {
  background: #fee2e2;
  color: #dc2626;
  border: 0.5px solid #fca5a5;
}

/* ============================================================
   FIX VOOR GEAGGREGEERDE INZICHTEN (KPI BAR)
   ============================================================ */

.kpi-bar {
  background: var(--color-background-primary, #ffffff);
  border-bottom: 0.5px solid var(--color-border-tertiary, #cbd5e1);
  padding: 16px;
  display: flex;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

/* Linker grote kaart: Woningbouwopgave */
.kpi-main {
  flex: 2;
  background: var(--color-background-secondary, #f8fafc);
  border: 0.5px solid var(--color-border-tertiary, #cbd5e1);
  border-radius: var(--border-radius-md, 6px);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-main-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.kpi-main-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text-primary, #0f172a);
  margin-bottom: 8px;
}

/* Progress bar fix */
.progress-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
  width: 100%;
}

.progress-fill {
  height: 100%;
  background: #185fa5;
  border-radius: 3px;
}

.kpi-main-sub {
  font-size: 11px;
  color: var(--color-text-secondary, #64748b);
}

/* Rechter kwaliteitskaarten (Groen, Duurzaamheid etc.) */
.kpi-quality {
  flex: 1;
  background: var(--color-background-primary, #ffffff);
  border: 0.5px solid var(--color-border-tertiary, #cbd5e1);
  border-radius: var(--border-radius-md, 6px);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 140px;
}

.kpi-q-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-primary, #0f172a);
  margin-bottom: 4px;
}

.kpi-q-score {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  margin: 6px 0;
}

.kpi-q-score span {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-secondary, #64748b);
}

/* ============================================================
   FIX VOOR MAATWERK PARKEERNORM DOSSIER
   ============================================================ */

/* Document Card Container */
.card {
  background: var(--color-background-primary, #ffffff);
  border: 0.5px solid var(--color-border-tertiary, #cbd5e1);
  border-radius: var(--border-radius-lg, 8px);
  overflow: hidden;
  font-size: 12px;
}

.card-header {
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--color-border-tertiary, #cbd5e1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-background-secondary, #f8fafc);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Status Badges */
.status-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 3px;
}
.badge-pending {
  background: #faeeda;
  color: #854f0b;
}

/* Secties in het document */
.section {
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--color-border-tertiary, #cbd5e1);
}

.section-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-secondary, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
}

/* Oud vs Nieuw Norm Matrix */
.compare-row {
  display: grid;
  grid-template-columns: 1fr 24px 1fr;
  gap: 0;
  align-items: center;
}

.norm-box {
  padding: 12px;
  border-radius: var(--border-radius-md, 6px);
  text-align: center;
}

.norm-old {
  background: #fcebeb;
  border: 0.5px solid #f7c1c1;
}

.norm-new {
  background: #eaf3de;
  border: 0.5px solid #c0dd97;
}

.norm-val {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}

.norm-old .norm-val {
  color: #a32d2d;
}

.norm-new .norm-val {
  color: #3b6d11;
}

/* Handtekeningen & Validatie */
.sig-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--color-background-secondary, #f8fafc);
  border: 0.5px solid var(--color-border-tertiary, #cbd5e1);
  border-radius: var(--border-radius-md, 6px);
  margin-bottom: 8px;
}

.sig-status {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 3px;
}

.sig-approved {
  background: #eaf3de;
  color: #3b6d11;
}

.sig-pend {
  background: #faeeda;
  color: #854f0b;
}

/* Footer actieknoppen */
.footer-actions {
  padding: 12px 16px;
  background: var(--color-background-secondary, #f8fafc);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-primary,
.btn-secondary {
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--border-radius-md, 6px);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-primary {
  background: #185fa5;
  color: #ffffff;
  border: none;
}

.btn-secondary {
  background: #ffffff;
  color: var(--color-text-primary, #0f172a);
  border: 0.5px solid var(--color-border-tertiary, #cbd5e1);
}

/* ============================================================
   ANIMATIES
   ============================================================ */
@keyframes dash-pulse {
  to {
    stroke-dashoffset: -20;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeInFast {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
