/* ==========================================================================
   VergunningKompas — Portal Components
   Depends on: marketing.css (tokens + base)
   ========================================================================== */

/* Portal-specific local tokens (portal color aliases) */
:root {
  --portal-bg: #eef5ff;
  --portal-surface: var(--white);
  --portal-surface-alt: #f8fbff;
  --portal-text: var(--ink-900);
  --portal-muted: #5f6b7d;
  --portal-border: #d8e3f2;
  --portal-success: #16a34a;
  --portal-warning: #d97706;
  --portal-danger: #dc2626;
  --portal-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

html { scroll-behavior: smooth; }

main {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 28px 20px 80px;
}

/* ---- Portal shell / layout ---- */

.portal-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: var(--gap-6);
  align-items: start;
}

.portal-sidebar {
  position: sticky;
  top: 96px;
}

/* ---- Sidebar ---- */

.sidebar-card {
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: linear-gradient(180deg, rgba(30, 58, 138, 0.96), rgba(29, 78, 216, 0.92));
  box-shadow: 0 18px 42px rgba(30, 58, 138, 0.2);
}

.sidebar-card + .sidebar-card {
  margin-top: 14px;
}

.sidebar-group + .sidebar-group {
  margin-top: var(--gap-4);
}

.sidebar-title {
  display: block;
  margin-bottom: var(--gap-2);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.74);
}

.sidebar-nav {
  display: grid;
  gap: var(--gap-2);
}

.sidebar-nav a {
  display: block;
  padding: 6px 0 6px 10px;
  border-radius: var(--radius-sm);
  border: 0;
  border-left: 3px solid transparent;
  color: rgba(248, 251, 255, 0.88);
  font-weight: 600;
  font-size: 0.94rem;
  background: transparent;
  transition: border-left-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.sidebar-nav a:hover {
  text-decoration: none;
  border-left-color: var(--accent);
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-helper {
  margin: 0;
  font-size: 0.88rem;
  color: var(--portal-muted);
}

/* ---- Hero / access strip ---- */

.hero-section {
  padding: 24px 0 8px;
}

.portal-access-strip {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 18px;
}

.portal-access-card {
  border: 1px solid var(--portal-border);
  border-radius: 18px;
  padding: var(--gap-4);
  background: var(--white);
  box-shadow: var(--portal-shadow);
}

.portal-access-card h3 {
  margin: 0 0 var(--gap-2);
  font-size: 1rem;
}

.portal-access-card.indigo {
  border-color: rgba(147, 197, 253, 0.95);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.98));
}

.portal-access-card.teal {
  border-color: rgba(249, 115, 22, 0.3);
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.98), rgba(255, 255, 255, 0.98));
}

.portal-access-card.sky {
  border-color: rgba(96, 165, 250, 0.72);
  background: linear-gradient(180deg, rgba(243, 248, 255, 0.98), rgba(255, 255, 255, 0.98));
}

.access-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-2);
  margin-top: var(--gap-3);
}

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-1) + 2px;
  padding: 7px 11px;
  border-radius: var(--radius-md);
  border: 1px solid var(--portal-border);
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink-900);
  font-size: 0.84rem;
  font-weight: 700;
}

.pill-link:hover {
  text-decoration: none;
  border-color: rgba(147, 197, 253, 0.9);
  background: rgba(239, 246, 255, 0.94);
}

.hero {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
}

.hero h1 {
  font-size: 2.3rem;
  margin: 12px 0 10px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.hero-card {
  border: 1px solid var(--portal-border);
  border-radius: 20px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(243, 248, 255, 0.98));
  box-shadow: var(--portal-shadow);
}

.stat-grid {
  display: grid;
  gap: var(--gap-3);
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: 18px;
}

.stat-card {
  border: 1px solid var(--portal-border);
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--white);
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 700;
}

/* ---- Section ---- */

.section {
  margin-top: 36px;
  scroll-margin-top: 100px;
}

#assistant {
  scroll-margin-top: 100px;
}

.section-title {
  margin-bottom: var(--gap-3);
}

.module-grid {
  display: grid;
  gap: var(--gap-4);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.module-card {
  border: 1px solid var(--portal-border);
  border-radius: 18px;
  padding: 18px;
  background: var(--white);
  box-shadow: var(--portal-shadow);
}

.module-card.primary {
  border: 1px solid rgba(147, 197, 253, 0.95);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.98));
}

.module-card h3 {
  margin-top: var(--gap-1) + 2px;
}

.module-meta {
  color: var(--portal-muted);
  font-size: 0.9rem;
}

.module-actions {
  margin-top: var(--gap-3);
}

.portal-grid {
  margin: var(--gap-4) 0 var(--gap-6);
}

.overview-strip {
  display: grid;
  gap: var(--gap-3);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* ---- Card ---- */

.card {
  border: 1px solid var(--portal-border);
  padding: 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  background: var(--portal-surface);
  box-shadow: var(--portal-shadow);
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 16px;
  width: 6px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--gap-3);
  padding-left: var(--gap-4);
}

.card-header h2 {
  margin: 0;
  padding: 0;
  border: 0;
  text-transform: none;
  font-size: 1.25rem;
}

.card.collapsible summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.card.collapsible summary::-webkit-details-marker {
  display: none;
}

.card.collapsible summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--portal-muted);
  font-size: 1rem;
}

.card.collapsible[open] summary::after {
  content: "▴";
}

.card.collapsible summary.card-header {
  margin-bottom: 0;
}

.card.collapsible[open] summary.card-header {
  margin-bottom: var(--gap-3);
}

.step-badge {
  background: rgba(219, 234, 254, 0.92);
  color: var(--primary-600);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---- Form inputs ---- */

label {
  display: block;
  font-weight: 600;
  margin-top: var(--gap-3);
  font-size: 0.92rem;
}

small {
  display: block;
  color: var(--portal-muted);
  margin-top: var(--gap-1) + 2px;
  line-height: 1.4;
}

input,
select,
textarea {
  width: 100%;
  margin-top: var(--gap-1) + 2px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--portal-border);
  background: var(--white);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(29, 78, 216, 0.45);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

input.field-error,
select.field-error,
textarea.field-error {
  border-color: var(--accent);
  background: #fff7ed;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

/* ---- Buttons ---- */

button {
  width: 100%;
  margin-top: var(--gap-2);
  padding: 10px 14px;
  border-radius: var(--radius-md) + 2px;
  background: var(--primary);
  color: var(--white);
  border: 1px solid rgba(29, 78, 216, 0.35);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-sans);
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.16);
}

button:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
}

button.secondary {
  background: rgba(255, 237, 213, 0.94);
  color: #c2410c;
  border-color: rgba(249, 115, 22, 0.24);
  box-shadow: 0 6px 16px rgba(249, 115, 22, 0.08);
}

button.secondary:hover {
  background: rgba(255, 224, 178, 0.96);
}

button.ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--portal-border);
  box-shadow: none;
}

button.ghost:hover {
  background: rgba(239, 246, 255, 0.9);
}

button:disabled {
  background: var(--ink-200);
  color: var(--ink-500);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---- Grids ---- */

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.section-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.section-card {
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-lg);
  padding: var(--gap-3);
  background: var(--white);
  box-shadow: 0 10px 20px rgba(30, 64, 175, 0.06);
}

.section-card h4 {
  margin: 0 0 var(--gap-2);
  font-size: 0.98rem;
}

.advice-grid {
  display: grid;
  gap: var(--gap-3);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.advice-list {
  margin: 0;
  padding-left: 18px;
}

.attachment-card {
  border: 1px dashed var(--portal-border);
  border-radius: var(--radius-md) + 2px;
  padding: 10px;
  background: #f8fbff;
}

.workflow-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.workflow-panel {
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-md) + 2px;
  padding: var(--gap-3);
  background: var(--white);
}

.workflow-panel h4 {
  margin: 0 0 var(--gap-2);
  font-size: 1rem;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: var(--gap-2);
  padding: var(--gap-1) + 2px 0;
  border-bottom: 1px dashed var(--portal-border);
}

.task-item:last-child {
  border-bottom: none;
}

/* ---- Layout / workflow ---- */

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

.workflow {
  display: none;
}

.workflow-card {
  border: 1px solid var(--portal-border);
  border-radius: 16px;
  padding: var(--gap-4);
  background: var(--portal-surface);
  box-shadow: var(--portal-shadow);
}

.workflow-title {
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--portal-muted);
  margin-bottom: var(--gap-3);
}

.step-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--gap-4);
  padding-left: var(--gap-1) + 2px;
}

.step-line {
  position: absolute;
  left: 13px;
  top: 14px;
  bottom: 12px;
  width: 2px;
  background: var(--portal-border);
}

.step-item {
  display: flex;
  gap: var(--gap-3);
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  background: rgba(219, 234, 254, 0.94);
  color: var(--primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  border: 1px solid rgba(147, 197, 253, 0.9);
}

.step-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.step-desc {
  font-size: 0.8rem;
  color: var(--portal-muted);
  margin-top: 2px;
}

.plan-card {
  margin-top: var(--gap-4);
}

.marketing-card {
  margin-top: var(--gap-4);
}

.plan-change-status {
  margin-top: var(--gap-2);
  font-size: 0.85rem;
  color: var(--portal-muted);
}

/* ---- CTA Button ---- */

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-2);
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md) + 2px;
  background: var(--primary);
  color: var(--white);
  border: 1px solid rgba(29, 78, 216, 0.35);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.16);
}

.cta-button:hover {
  filter: brightness(0.98);
}

.hero-actions .cta-button {
  width: auto;
}

/* ---- Plan ---- */

.plan-select {
  margin-bottom: var(--gap-3);
}

.plan-select select {
  margin-top: var(--gap-1) + 2px;
}

.plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--gap-2);
}

.plan-list li {
  display: flex;
  gap: var(--gap-2);
  align-items: flex-start;
  font-size: 0.85rem;
}

.plan-list li::before {
  content: "●";
  color: var(--accent);
  font-size: 0.6rem;
  margin-top: 4px;
}

.plan-locked {
  border: 1px dashed var(--portal-warning);
  background: rgba(255, 237, 213, 0.92);
  color: #c2410c;
  padding: var(--gap-3);
  border-radius: var(--radius-md) + 2px;
  margin-top: 10px;
}

/* ---- Project ---- */

.project-block {
  grid-column: 1 / -1;
}

.flow-group {
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-lg);
  background: #f8fbff;
  padding: 14px;
}

.flow-group + .flow-group {
  margin-top: 14px;
}

.flow-group-header {
  margin-bottom: var(--gap-3);
}

.flow-group-header strong {
  display: block;
  font-size: 0.95rem;
}

.flow-group-grid {
  display: grid;
  gap: var(--gap-3);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: flex-start;
}

.product-location-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  align-items: start;
}

.location-box {
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-md) + 2px;
  padding: var(--gap-3);
  background: var(--white);
  align-self: start;
  height: fit-content;
  display: grid;
  gap: 10px;
}

.location-guide {
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-md);
  padding: 10px;
  background: rgba(248, 251, 255, 0.95);
}

.location-guide ol {
  margin: var(--gap-2) 0 0;
  padding-left: 18px;
  display: grid;
  gap: var(--gap-1);
}

.location-guide li {
  color: var(--portal-muted);
  font-size: 0.83rem;
}

.project-box {
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-md) + 2px;
  padding: 14px;
  background: #f8fbff;
  border-left: 4px solid var(--portal-border);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.project-box.saved {
  border-left-color: var(--portal-success);
}

.project-box.dirty {
  border-left-color: var(--portal-warning);
  background: rgba(255, 237, 213, 0.92);
}

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gap-3);
  flex-wrap: wrap;
}

.project-subheader {
  display: flex;
  align-items: center;
  gap: var(--gap-2);
  flex-wrap: wrap;
}

.project-fields {
  display: grid;
  gap: var(--gap-3);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: var(--gap-3);
}

.project-actions {
  display: flex;
  gap: var(--gap-2);
  flex-wrap: wrap;
}

.project-actions button {
  padding: var(--gap-2) var(--gap-3);
  font-size: 0.9rem;
}

.project-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.project-filter-bar input,
.project-filter-bar select {
  width: auto;
  min-width: 180px;
}

.project-meta {
  margin-top: var(--gap-1) + 2px;
}

/* ---- Dashboard ---- */

.dashboard-grid {
  display: grid;
  gap: var(--gap-3);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.dashboard-card {
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-lg);
  background: #f8fbff;
  padding: 12px 14px;
}

.dashboard-card strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--portal-muted);
}

.dashboard-card span {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  margin-top: var(--gap-1);
}

/* ---- Request list ---- */

.request-list {
  display: grid;
  gap: var(--gap-2);
  margin-top: 10px;
}

.request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--portal-border);
  background: var(--white);
  border-radius: var(--radius-md) + 2px;
  padding: var(--gap-2) 10px;
}

.request-item small {
  margin-top: 0;
}

.request-item button {
  width: auto;
  margin-top: 0;
  padding: var(--gap-1) + 2px 10px;
  font-size: 0.85rem;
}

/* ---- Product ---- */

.product-box {
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-md) + 2px;
  padding: var(--gap-3);
  background: #f8fbff;
}

.product-box h4 {
  margin: 0 0 var(--gap-2);
  font-size: 1rem;
}

.product-fields {
  display: grid;
  gap: var(--gap-3);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.product-layout {
  min-width: 0;
}

.product-box {
  display: grid;
  gap: var(--gap-3);
}

.product-details {
  display: grid;
  gap: var(--gap-3);
  grid-template-columns: 1fr;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.product-list {
  display: grid;
  gap: var(--gap-2);
  margin-top: var(--gap-2);
  max-height: 240px;
  min-height: 120px;
  overflow: auto;
  padding: var(--gap-1) + 2px;
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-md);
  background: var(--white);
}

.product-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--gap-2);
  padding: var(--gap-2) 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--portal-border);
  background: var(--white);
  color: var(--ink-900);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.product-item:hover {
  border-color: rgba(147, 197, 253, 0.9);
  background: rgba(239, 246, 255, 0.94);
}

.product-item.active {
  border-color: var(--primary);
  background: rgba(219, 234, 254, 0.94);
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.12);
}

.product-item small {
  display: block;
  color: var(--portal-muted);
  font-size: 0.78rem;
}

.product-group {
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-md) + 2px;
  background: #f8fbff;
  padding: var(--gap-2);
}

.product-group + .product-group {
  margin-top: var(--gap-2);
}

.product-group-title {
  display: block;
  margin: 2px 2px var(--gap-2);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--primary-600);
}

/* ---- Result stages ---- */

.result-stage-grid {
  display: grid;
  gap: var(--gap-3);
}

.result-stage {
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-lg);
  background: #f8fbff;
  padding: var(--gap-3);
}

.result-panel-section + .result-panel-section {
  margin-top: 14px;
}

.result-panel-section h4 {
  margin: 0 0 var(--gap-2);
  font-size: 0.96rem;
}

.result-stage + .result-stage {
  margin-top: var(--gap-1);
}

.result-stage-label {
  display: block;
  margin-bottom: var(--gap-2);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--portal-muted);
}

/* ---- Product info card ---- */

.product-info-card {
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: var(--white);
  box-shadow: 0 10px 20px rgba(29, 78, 216, 0.06);
}

.product-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-3);
  margin-bottom: 10px;
}

.product-info-grid {
  display: grid;
  gap: var(--gap-3);
  grid-template-columns: 1fr;
}

.product-info-block {
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-md) + 2px;
  padding: 10px;
  background: #f8fbff;
}

.product-info-block h5 {
  margin: 0 0 var(--gap-1) + 2px;
  font-size: 0.95rem;
}

.product-info-block ul {
  margin: 0;
  padding-left: 18px;
}

/* ---- Completion bar ---- */

.completion-card {
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-md);
  padding: var(--gap-2) 10px;
  background: var(--white);
  box-shadow: none;
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: var(--gap-2);
}

.completion-card strong {
  display: block;
  font-size: 0.78rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--portal-muted);
}

.completion-card .muted.small {
  margin-top: 3px;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.completion-bar {
  height: 6px;
  flex: 1;
  min-width: 120px;
  background: var(--ink-200);
  border-radius: 999px;
  overflow: hidden;
}

.completion-card .badge {
  min-width: 48px;
  justify-content: center;
  font-size: 0.75rem;
}

.completion-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.25s ease;
}

/* ---- Form stepper ---- */

.field.field-required {
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}

.rule-grid {
  display: grid;
  gap: var(--gap-3);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.rule-stack {
  display: grid;
  gap: 14px;
  margin-top: var(--gap-3);
}

.rule-card {
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-md) + 2px;
  padding: 14px;
  background: var(--white);
  border-left: 4px solid rgba(147, 197, 253, 0.7);
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.06);
}

.rule-card summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.rule-card summary::-webkit-details-marker {
  display: none;
}

.rule-card summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--portal-muted);
}

.rule-card[open] summary::after {
  content: "▴";
}

/* ---- Tags / badges ---- */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(219, 234, 254, 0.92);
  margin-right: var(--gap-2);
  font-size: 12px;
  color: var(--primary-600);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-1) + 2px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge.success {
  background: rgba(220, 252, 231, 0.96);
  color: #15803d;
  border: 1px solid rgba(134, 239, 172, 0.6);
}
.badge.warning {
  background: rgba(254, 243, 199, 0.96);
  color: #92400e;
  border: 1px solid rgba(251, 191, 36, 0.4);
}
.badge.danger {
  background: rgba(254, 226, 226, 0.96);
  color: #991b1b;
  border: 1px solid rgba(252, 165, 165, 0.5);
}
.badge.info {
  background: rgba(219, 234, 254, 0.96);
  color: var(--primary-600);
  border: 1px solid rgba(147, 197, 253, 0.4);
}

/* ---- Summary ---- */

.summary-top {
  display: grid;
  gap: var(--gap-3);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: var(--gap-2);
}

.decision-card {
  border-radius: 16px;
  padding: 14px var(--gap-4);
  color: var(--ink-900);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.98));
  border: 1px solid rgba(147, 197, 253, 0.95);
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.08);
}

.decision-card .decision-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  opacity: 0.8;
}

.decision-card .decision-value {
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: var(--gap-1) + 2px;
}

.decision-card .decision-sub {
  margin-top: var(--gap-1) + 2px;
  font-size: 0.85rem;
  opacity: 0.9;
}

.metric-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.metric-card {
  border-radius: var(--radius-md) + 2px;
  border: 1px solid var(--portal-border);
  background: var(--white);
  padding: 10px 12px;
}

.metric-card strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--portal-muted);
}

.metric-card span {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  margin-top: var(--gap-1);
}

.summary-grid {
  display: grid;
  gap: var(--gap-3);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: var(--gap-3);
}

.summary-panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--portal-border);
  background: #f8fbff;
  padding: 12px 14px;
}

.summary-panel.summary-panel-primary {
  border-left: 4px solid var(--primary);
}

.summary-panel h4 {
  margin: 0 0 var(--gap-1) + 2px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-600);
}

.summary-detail {
  margin-top: 10px;
}

.summary-detail summary {
  cursor: pointer;
  font-weight: 600;
}

.summary-actions {
  margin-top: 10px;
  font-size: 0.95rem;
}

.result-overview {
  display: grid;
  gap: var(--gap-3);
  margin-bottom: 14px;
}

.result-lead {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink-900);
}

.result-meta {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.drawing-check-grid {
  display: grid;
  gap: var(--gap-3);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: var(--gap-3) 0 14px;
}

.drawing-check-card {
  border: 1px solid var(--portal-border);
  border-left: 4px solid var(--portal-border);
  border-radius: var(--radius-md) + 2px;
  padding: 12px 14px;
  background: var(--white);
}

.drawing-check-card.is-good {
  border-left-color: var(--primary);
  background: rgba(239, 246, 255, 0.94);
}

.drawing-check-card.is-warn {
  border-left-color: var(--accent);
  background: rgba(255, 247, 237, 0.94);
}

.drawing-check-card.is-empty {
  border-left-color: var(--ink-500);
  background: #f8fbff;
}

.drawing-check-list {
  margin: var(--gap-2) 0 0 18px;
  padding: 0;
}

/* ---- Utility ---- */

.muted {
  color: var(--portal-muted);
}

.small {
  font-size: 12px;
}

.notice {
  background: #f8fbff;
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-md) + 2px;
  padding: 12px 14px;
}

.progress {
  display: flex;
  gap: var(--gap-2);
  flex-wrap: wrap;
}

.pill {
  padding: var(--gap-1) + 2px var(--gap-3);
  border-radius: var(--radius-md);
  background: rgba(219, 234, 254, 0.92);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-600);
}

.progress .pill {
  border: 1px solid rgba(29, 78, 216, 0.18);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.actions button {
  width: auto;
}

.error {
  color: var(--portal-danger);
  font-weight: 600;
  margin-top: var(--gap-2);
}

ul {
  margin: var(--gap-2) 0 0 18px;
}

#resultBox,
#applicationBox {
  line-height: 1.6;
  background: #f8fbff;
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-md) + 2px;
  padding: var(--gap-3);
}

#dynamicForm,
#attachmentsSection {
  margin-top: 18px;
  padding-top: var(--gap-3);
  border-top: 1px dashed var(--portal-border);
}

#dynamicForm.form-container {
  margin-top: var(--gap-3);
  padding-top: 0;
  border-top: none;
}

/* ---- Form container / stepper ---- */

.form-container {
  display: flex;
  flex-direction: column;
  gap: var(--gap-4);
}

.form-section {
  background: var(--white);
  border: 1px solid var(--portal-border);
  border-radius: 16px;
  padding: 14px var(--gap-4);
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.06);
}

.form-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-2);
  margin-bottom: 10px;
}

.form-section-header strong {
  font-size: 1rem;
}

.form-section-grid {
  display: grid;
  gap: var(--gap-4);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-section-grid .field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--portal-muted);
  margin-top: 2px;
  margin-bottom: var(--gap-1);
  line-height: 1.4;
}

.form-stepper {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: var(--gap-3);
  flex-wrap: wrap;
  padding: 10px var(--gap-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--portal-border);
  background: var(--ink-50);
}

.form-stepper button {
  width: auto;
  min-width: 120px;
  margin-top: 0;
  padding: var(--gap-2) 14px;
}

.stepper-info {
  flex: 1;
  min-width: 180px;
}

.stepper-progress {
  flex-basis: 100%;
  height: 6px;
  background: var(--ink-200);
  border-radius: 999px;
  overflow: hidden;
}

.stepper-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.25s ease;
}

/* ---- Address dropdown ---- */

.address-field {
  position: relative;
}

.address-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-md) + 2px;
  box-shadow: 0 12px 28px rgba(29, 78, 216, 0.12);
  max-height: 240px;
  overflow-y: auto;
  z-index: 20;
}

.address-item {
  padding: 10px var(--gap-3);
  cursor: pointer;
  border-bottom: 1px solid var(--ink-200);
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-2);
}

.address-item:last-child {
  border-bottom: none;
}

.address-item small {
  color: var(--portal-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.address-item.active,
.address-item:hover {
  background: rgba(239, 246, 255, 0.94);
}

/* ---- App header ---- */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-4);
  padding: 18px 22px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.99), rgba(255, 247, 237, 0.96));
  border: 1px solid rgba(147, 197, 253, 0.5);
  box-shadow: 0 4px 6px rgba(29, 78, 216, 0.04), 0 20px 45px rgba(15, 23, 42, 0.08);
  margin-bottom: var(--gap-4);
  color: var(--ink-900);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--gap-3);
}

.brand h1 {
  color: var(--ink-900);
}

.brand .muted {
  color: var(--portal-muted);
}

/* app-header badges erven de global badge kleuren (success=groen, info=blauw) */

.app-header a {
  color: var(--primary);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-3);
  flex-wrap: wrap;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-2);
  font-weight: 600;
  font-size: 0.82rem;
  padding: var(--gap-1) + 2px 10px;
  border-radius: var(--radius-md);
  background: rgba(239, 246, 255, 0.9);
  border: 1px solid var(--portal-border);
  color: var(--primary-600);
}

.toggle input {
  width: auto;
  margin: 0;
  accent-color: var(--primary);
}

/* ---- Outcome banners ---- */

.outcome-banner {
  display: flex; align-items: center; gap: var(--gap-4);
  border-radius: 18px; padding: 20px var(--gap-6); margin-bottom: var(--gap-4);
  border: 1.5px solid transparent;
}
.outcome-icon {
  font-size: 1.5rem; font-weight: 800; line-height: 1; flex-shrink: 0;
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.outcome-text { flex: 1; }
.outcome-headline { font-size: 1.25rem; font-weight: 800; }
.outcome-summary { font-size: 0.88rem; margin-top: 5px; opacity: 0.88; line-height: 1.5; }
.outcome-readiness {
  font-size: 0.76rem; font-weight: 700; padding: 5px 11px;
  border-radius: 20px; white-space: nowrap; flex-shrink: 0;
}
.outcome-free { background: linear-gradient(135deg, #f0fdf4, #dcfce7); border-color: #86efac; color: #14532d; }
.outcome-free .outcome-icon { background: #16a34a; color: var(--white); }
.outcome-free .outcome-readiness { background: #dcfce7; color: #15803d; }
.outcome-required { background: linear-gradient(135deg, #fffbeb, #fef3c7); border-color: #fcd34d; color: #78350f; }
.outcome-required .outcome-icon { background: #d97706; color: var(--white); }
.outcome-required .outcome-readiness { background: #fef3c7; color: #b45309; }
.outcome-unclear { background: linear-gradient(135deg, #f5f3ff, #ede9fe); border-color: #c4b5fd; color: #4c1d95; }
.outcome-unclear .outcome-icon { background: #7c3aed; color: var(--white); }
.outcome-unclear .outcome-readiness { background: #ede9fe; color: #6d28d9; }
.outcome-stop { background: linear-gradient(135deg, #fef2f2, #fee2e2); border-color: #fca5a5; color: #7f1d1d; }
.outcome-stop .outcome-icon { background: #dc2626; color: var(--white); }
.outcome-stop .outcome-readiness { background: #fee2e2; color: #b91c1c; }

/* ---- Product category tabs ---- */

.product-cat-tabs { display: flex; gap: var(--gap-1) + 2px; margin-bottom: var(--gap-2); flex-wrap: wrap; }

/* ---- Nieuwbouw procesgids tabs ---- */

.nieuwbouw-tabs-container {
  margin-top: 18px;
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--portal-surface);
}

.nieuwbouw-tab-bar {
  display: flex;
  background: var(--portal-surface-alt);
  border-bottom: 1px solid var(--portal-border);
  gap: 0;
  overflow-x: auto;
}

.nieuwbouw-tab-btn {
  padding: 10px 18px;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--portal-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.nieuwbouw-tab-btn:hover {
  color: var(--primary);
}

.nieuwbouw-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--portal-surface);
}

.nieuwbouw-tab-panel {
  display: none;
  padding: 18px 20px;
}

.nieuwbouw-tab-panel.active {
  display: block;
}

.nieuwbouw-tab-panel h5 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-900);
  margin: 0 0 10px;
}

.nieuwbouw-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nieuwbouw-checklist li {
  display: flex;
  align-items: flex-start;
  gap: var(--gap-2);
  padding: var(--gap-1) + 2px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--portal-border);
}

.nieuwbouw-checklist li:last-child {
  border-bottom: none;
}

.nieuwbouw-checklist input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.nieuwbouw-fase-item {
  display: flex;
  align-items: flex-start;
  gap: var(--gap-3);
  padding: var(--gap-2) 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--portal-border);
}

.nieuwbouw-fase-item:last-child { border-bottom: none; }

.nieuwbouw-fase-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 4px;
  flex-shrink: 0;
}

.nieuwbouw-fase-label {
  font-weight: 600;
  color: var(--ink-900);
}

.nieuwbouw-fase-duur {
  font-size: 0.78rem;
  color: var(--portal-muted);
}

.pcat-tab {
  padding: 5px 14px; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; border: 1.5px solid var(--portal-border); background: var(--white);
  color: var(--portal-muted); width: auto; margin-top: 0; transition: all 0.12s;
}
.pcat-tab.active { background: var(--primary); color: var(--white); border-color: var(--primary); }
.pcat-tab:hover:not(.active) { background: #eff6ff; border-color: #93c5fd; color: var(--primary); }

/* ---- Popular product chips ---- */

.popular-chips { display: flex; flex-wrap: wrap; gap: var(--gap-1) + 2px; margin-bottom: 10px; }
.pop-chip {
  padding: var(--gap-1) var(--gap-3); border-radius: 999px; border: 1px solid var(--portal-border);
  background: var(--ink-50); font-size: 0.78rem; font-weight: 600;
  cursor: pointer; color: var(--ink-900); width: auto; margin-top: 0;
}
.pop-chip:hover { background: #dbeafe; border-color: #93c5fd; color: var(--primary); }

/* ---- Readiness bar ---- */

.readiness-bar {
  display: flex; gap: var(--gap-1) + 2px; flex-wrap: wrap;
  padding: 10px var(--gap-3); background: var(--ink-50);
  border-radius: var(--radius-md); border: 1px solid var(--portal-border); margin-bottom: 10px;
}
.readiness-step {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.8rem; font-weight: 600; color: var(--portal-muted);
  padding: 3px var(--gap-2); border-radius: var(--radius-sm);
}
.readiness-step.done { color: var(--portal-success); background: #f0fdf4; }
.readiness-step.partial { color: var(--portal-warning); background: #fffbeb; }

/* ---- Next steps bar ---- */

.next-steps-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: var(--gap-4); }
.next-step-btn {
  flex: 1; min-width: 150px; padding: 10px var(--gap-4); border-radius: var(--radius-md);
  font-size: 0.88rem; font-weight: 700; cursor: pointer;
  border: 1.5px solid var(--portal-border); background: var(--white); text-align: center;
}
.next-step-btn.primary-action { background: var(--primary); color: var(--white); border-color: var(--primary); }
.next-step-btn.secondary-action { background: var(--ink-100); color: var(--ink-900); }
.next-step-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

/* ---- Responsive ---- */

@media (max-width: 1180px) {
  .product-location-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    position: static;
  }

  .sidebar-nav {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .product-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  body {
    padding: 0;
  }

  main {
    padding: 20px 14px 64px;
  }

  .hero h1 {
    font-size: 1.9rem;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .workflow {
    position: static;
  }

  .grid,
  .columns {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions button {
    width: 100%;
  }
}
