/*
 * Growth Partner — application styles
 * Built on Pico CSS 2 with custom overrides
 */

/* ── Brand font: Montserrat for headings (self-hosted, CSP-safe) ──
   Body/table text keeps the system stack — Montserrat is headings-only. */
@font-face {
  font-family: "Montserrat";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fonts/montserrat-600.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("/fonts/montserrat-700.woff2") format("woff2");
}

/* Pico variable overrides */
:root {
  --pico-font-size: 93.75%;
  --pico-border-radius: 0.5rem;
  --pico-background-color: #f8fafc;
  --pico-color: #1e293b;
  --pico-muted-color: #5b6675;
  --pico-muted-border-color: #e2e8f0;
  --pico-primary: #0E3A5A;
  --pico-primary-hover: #0a2c45;
  --pico-primary-focus: rgba(14, 58, 90, 0.15);
  --pico-primary-inverse: #ffffff;
  --pico-secondary: #64748b;
  --pico-secondary-hover: #475569;
  --pico-card-background-color: #ffffff;
  --pico-card-border-color: #e2e8f0;
  --pico-card-sectioning-background-color: #f8fafc;
  --pico-table-border-color: #e2e8f0;
  --pico-form-element-border-color: #cbd5e1;
  --pico-form-element-focus-color: #0E3A5A;

  /* App tokens */
  --gp-danger: #dc2626;
  --gp-danger-hover: #b91c1c;

  /* Semantic TEXT colours. Each clears the WCAG AA 4.5:1 minimum on white, on
     the page background AND on --gp-panel-bg — the three surfaces our text
     actually lands on. The brighter #059669 / #d97706 / #dc2626 tints stay in
     use for BORDERS and FILLS, where the 4.5:1 text rule does not apply.
     Guarded by test/assets/color_contrast_test.rb — do not lighten these. */
  --gp-text-success: #047857;
  --gp-text-warning: #9a5b00;
  --gp-text-danger:  #b91c1c;

  /* Subtle inline panels (drawers, kanban columns, hover surfaces). Pico's
     --pico-secondary-background is a dark slate intended for SECONDARY BUTTON
     fills; do not use it as a panel tone or text on it goes unreadable. */
  --gp-panel-bg:        #EBF0F1;
  --gp-panel-bg-hover:  #e2e8f0;
  --gp-panel-border:    #e2e8f0;
}

/* Small text-only "delete" affordance used by inline rows + activity entries. */
.btn-danger-link {
  all: unset;
  cursor: pointer;
  color: var(--gp-danger);
  font-size: 0.75rem;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  transition: background 0.1s ease, color 0.1s ease;
}
.btn-danger-link:hover {
  color: var(--gp-danger-hover);
  background: rgba(220, 38, 38, 0.08);
}

/* ── Layout ── */
.app-layout { display: flex; min-height: 100vh; }
.main-wrap { margin-left: 13rem; flex: 1; min-width: 0; }
main.container { padding-top: 1.5rem; }

/* ── Sidebar ── */
.sidebar {
  width: 13rem;
  background: linear-gradient(180deg, #0E3A5A, #07263c);
  position: fixed; top: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 100; overflow-y: auto;
}
.sidebar-brand { padding: 1.25rem 1rem; font-size: 1.1rem; font-weight: 700; color: #fff; border-bottom: 1px solid #1c4a6e; letter-spacing: -0.02em; font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.sidebar-nav { padding: 0.5rem 0; }
.sidebar-nav-main { flex: 1; }
.sidebar-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 1rem; color: #AFC3CE;
  text-decoration: none; font-size: 0.85rem; font-weight: 500;
  border-left: 3px solid transparent; transition: all 0.15s;
}
.sidebar-link:hover { color: #e2e8f0; background: rgba(255,255,255,0.05); }
.sidebar-link.active { color: #fff; border-left-color: #6ea8d4; background: rgba(255,255,255,0.08); }
.sidebar-icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.sidebar-icon svg { width: 100%; height: 100%; }
.sidebar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.sidebar-badge {
  background: #ef4444; color: #fff; font-size: 0.7rem; font-weight: 700;
  padding: 0.1rem 0.45rem; border-radius: 999px; min-width: 1.25rem;
  text-align: center; line-height: 1.2;
}

/* ── Mention autocomplete dropdown ── */
.mention-autocomplete-wrapper { position: relative; }
.mention-autocomplete-dropdown {
  position: absolute; top: 0.25rem; left: 0; right: 0;
  z-index: 50; background: #fff; border: 1px solid #cbd5e1;
  border-radius: 6px; box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
  max-height: 220px; overflow-y: auto;
}
.mention-autocomplete-option {
  display: flex; align-items: baseline; gap: 0.5rem;
  padding: 0.45rem 0.75rem; font-size: 0.85rem; cursor: pointer;
  color: #1e293b;
}
.mention-autocomplete-option.is-active,
.mention-autocomplete-option:hover { background: #e7edf2; }
.mention-autocomplete-option strong { color: #0E3A5A; font-weight: 600; }
.mention-autocomplete-name { color: #475569; }
.mention-autocomplete-role { margin-left: auto; color: var(--pico-muted-color); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.mention-autocomplete-empty {
  padding: 0.5rem 0.75rem;
  color: var(--pico-muted-color);
  font-size: 0.85rem;
  font-style: italic;
  cursor: default;
}

/* ── Mentions inbox ── */
.mentions-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.mentions-tab {
  padding: 0.35rem 0.85rem; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600; text-decoration: none;
  color: #64748b; background: #f1f5f9; border: 1px solid transparent;
}
.mentions-tab.active { color: #0E3A5A; background: #e7edf2; border-color: #b9ccd8; }
.mention-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.75rem;
  align-items: start; padding: 0.85rem 1rem; border-bottom: 1px solid #e2e8f0;
}
.mention-row.unread { background: #fefce8; }
.mention-dot { width: 0.55rem; height: 0.55rem; border-radius: 999px; background: #ef4444; margin-top: 0.5rem; }
.mention-dot.read { background: transparent; }
.mention-body { font-size: 0.85rem; color: #334155; }
.mention-body .mention-meta { color: #64748b; font-size: 0.75rem; margin-bottom: 0.25rem; }
.mention-body .mention-excerpt { color: #475569; margin-top: 0.25rem; white-space: pre-wrap; }
.mention-actions { display: flex; align-items: center; gap: 0.5rem; }
/* ── Country Switcher ── */
.country-switcher {
  display: flex; gap: 0; border-bottom: 1px solid #1c4a6e;
}
.country-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem 0.5rem; color: #AFC3CE; text-decoration: none;
  font-size: 0.8rem; font-weight: 600; transition: all 0.15s;
  border-bottom: 2px solid transparent;
}
.country-tab:hover { color: #cbd5e1; background: rgba(255,255,255,0.04); }
.country-tab.active { color: #fff; background: rgba(255,255,255,0.06); border-bottom-color: #6ea8d4; }
.country-flag { font-size: 1rem; }

.sidebar-admin { border-top: 1px solid #1c4a6e; padding-top: 0.5rem; }
.sidebar-admin .sidebar-link { font-size: 0.8rem; color: #8aa6b5; padding: 0.4rem 1rem; }
.sidebar-admin .sidebar-link:hover { color: #cbd5e1; }
.sidebar-admin .sidebar-link.active { color: #cbd5e1; border-left-color: #64748b; }
.sidebar-toggle { display: none; }

/* ── Typography ── */
/* Headings use Montserrat; body/tables stay on Pico's system stack. */
h1, h2, h3, h4, h5, h6 {
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
h1 { color: #1e293b; font-weight: 700; letter-spacing: -0.02em; }
h2 { color: #334155; font-weight: 600; }
h3, h4 { color: #475569; font-weight: 600; }

/* ── KPI Cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.kpi-grid-primary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.kpi-grid-secondary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem; margin-bottom: 2rem;
}
.kpi-card {
  text-align: center; padding: 1.25rem 1rem;
  border-left: 3px solid #0E3A5A;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s, transform 0.2s;
}
.kpi-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-1px); }
.kpi-card h2 { margin-bottom: 0.25rem; color: #0E3A5A; font-size: 1.75rem; }
.kpi-card small { color: var(--pico-muted-color); }
.kpi-card a { color: inherit; text-decoration: none; }
.kpi-card a:hover { text-decoration: none; opacity: 1; }
.kpi-card-primary {
  border-left-width: 4px;
  padding: 1.5rem 1rem;
}
.kpi-card-primary h2 { font-size: 2rem; }
.kpi-card-secondary {
  padding: 0.75rem 0.5rem;
  border-left-width: 2px;
  border-left-color: #e2e8f0;
}
.kpi-card-secondary h2 { font-size: 1.35rem; color: #475569; }

/* KPI delta badges */
.kpi-delta {
  display: inline-block; font-size: 0.7rem; font-weight: 600;
  padding: 0.1rem 0.4rem; border-radius: 9999px;
  margin-left: 0.3rem; vertical-align: super;
}
.kpi-delta-up { background: #d1fae5; color: #065f46; }
.kpi-delta-down { background: #fee2e2; color: #991b1b; }
.kpi-delta-neutral { background: #f1f5f9; color: #64748b; }

/* ── Next Action CTA ── */

/* ── Dashboard Actions Row ── */
.dashboard-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap;
}
.dashboard-stats {
  display: flex; gap: 1rem; flex-wrap: wrap;
}
.dashboard-stats .kpi-card {
  min-width: 120px;
}
.dashboard-import {
  display: flex; align-items: center; gap: 0.75rem;
}
.dashboard-import button, .dashboard-import input[type="submit"] {
  margin: 0; white-space: nowrap;
}

/* ── Pipeline Funnel ── */
.pipeline {
  display: flex; gap: 0; margin-bottom: 2rem;
  border-radius: 0.5rem; overflow: hidden;
  border: 1px solid #e2e8f0;
}
.pipeline-stage {
  flex: 1; text-align: center; padding: 0.6rem 0.5rem;
  text-decoration: none; transition: opacity 0.15s;
  position: relative;
}
.pipeline-stage:hover { opacity: 0.85; }
.pipeline-stage-count { display: block; font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.pipeline-stage-label { display: block; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.pipeline-new { background: #dbeafe; color: #1e40af; }
.pipeline-contacted { background: #fef3c7; color: #92400e; }
.pipeline-approved { background: #d1fae5; color: #065f46; }
.pipeline-rejected { background: #fee2e2; color: #991b1b; }
/* Klanten filter chip — navy like the badge, tinted for the tab context. */
.pipeline-client { background: #dbe7f0; color: #0E3A5A; }

/* ── Badges (status) ── */
.badge {
  display: inline-block; padding: 0.2rem 0.6rem;
  border-radius: 9999px; font-size: 0.75rem;
  font-weight: 600; letter-spacing: 0.02em;
}
.badge-new { background: #dbeafe; color: #1e40af; }
.badge-contacted { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
/* Gebeld (call_logged) — violet, deliberately outside the status hues so a
   call entry scans differently from any lead-status badge. 7.5:1 on its fill. */
.badge-call { background: #ede9fe; color: #5b21b6; }
/* Klant — filled navy ("ours", the same lane as the active follow pill), never
   green: the approved status badge sits next to it on rows and in the cockpit. */
.badge-client { background: #0E3A5A; color: #fff; }
/* Inline phone glyph inside a badge or pill; the SVG is decorative. */
.badge-icon { display: inline-block; vertical-align: -0.1em; margin-right: 0.28em; }
.badge-icon svg { width: 0.85em; height: 0.85em; display: inline-block; }

/* Badges (lead type — distinct from status) */
.badge-type-permit { background: #f1f5f9; color: #475569; }
.badge-type-company { background: #ede9fe; color: #5b21b6; }
.badge-type-industrial-site { background: #ccfbf1; color: #0f766e; }

/* Badges (feedback status) */
.badge-feedback-open { background: #dbeafe; color: #1e40af; }
.badge-feedback-planned { background: #ede9fe; color: #5b21b6; }
.badge-feedback-in_progress { background: #fef3c7; color: #92400e; }
.badge-feedback-done { background: #d1fae5; color: #065f46; }
.badge-feedback-wontfix { background: #f1f5f9; color: #475569; }

/* Badges (feedback priority) */
.badge-priority-low { background: #f1f5f9; color: #475569; }
.badge-priority-medium { background: #fef3c7; color: #92400e; }
.badge-priority-high { background: #fee2e2; color: #991b1b; }

/* ── Feedback page ── */
.feedback-submit {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.5rem;
  padding: 1rem; margin-bottom: 1.5rem;
}
.feedback-form textarea { margin-bottom: 0.25rem; }
.feedback-filters {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem;
}
.filter-chip {
  padding: 0.25rem 0.75rem; border-radius: 9999px;
  background: #f1f5f9; color: #475569; font-size: 0.8rem;
  text-decoration: none; border: 1px solid transparent;
}
.filter-chip:hover { background: #e2e8f0; }
.filter-chip.active { background: #0E3A5A; color: #fff; }
.feedback-list { display: flex; flex-direction: column; gap: 0.75rem; }
.feedback-card-inner { padding: 1rem; margin-bottom: 0; }
.feedback-card-header {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  align-items: center; margin-bottom: 0.5rem;
}
.feedback-meta { color: #64748b; font-size: 0.8rem; }
.feedback-body { margin: 0.25rem 0 0.5rem; white-space: pre-wrap; }
.feedback-admin-note {
  background: #e7edf2; border-left: 3px solid #0E3A5A;
  padding: 0.5rem 0.75rem; border-radius: 0.25rem;
  margin-top: 0.5rem; font-size: 0.88rem;
}
.feedback-admin-form {
  margin-top: 0.75rem; padding-top: 0.75rem;
  border-top: 1px dashed #e2e8f0;
}
.feedback-admin-form textarea { margin-bottom: 0.25rem; }
.muted { color: var(--pico-muted-color); }

/* ── Relevance Scores ── */
.score-high { color: var(--gp-text-success); font-weight: 700; }
.score-medium { color: var(--gp-text-warning); font-weight: 600; }
.score-low { color: var(--pico-muted-color); }
.score-blocked { color: var(--gp-text-danger); font-weight: 600; }

/* ── Tables ── */
table { font-size: 0.9rem; }
thead th {
  background: #f1f5f9; color: #475569; font-weight: 600;
  text-transform: uppercase; font-size: 0.72rem;
  letter-spacing: 0.05em; border-bottom: 2px solid #e2e8f0;
}
tbody tr { transition: background-color 0.1s; }
tbody tr:hover { background-color: #f8fafc; }
td { vertical-align: middle; }

/* ── Filter bar ── */
.filters {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  align-items: end; margin-bottom: 1rem;
  padding: 0.75rem; background: #f1f5f9;
  border-radius: 0.5rem; border: 1px solid #e2e8f0;
}
.filters input, .filters select { margin-bottom: 0; font-size: 0.85rem; }

/* ── Flash messages ── */
.flash-notice {
  padding: 0.75rem 1rem; border-radius: 0.5rem; margin-bottom: 1.5rem;
  font-size: 0.9rem; border-left: 4px solid #0E3A5A;
  background: #e7edf2; color: #0a2c45;
}
.flash-alert {
  padding: 0.75rem 1rem; border-radius: 0.5rem; margin-bottom: 1.5rem;
  font-size: 0.9rem; border-left: 4px solid #dc2626;
  background: #fef2f2; color: #991b1b;
}

/* ── Cards ── */
article { box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #e2e8f0; }

/* ── Collapsible sections ── */
details summary .badge { vertical-align: middle; margin-left: 0.5rem; }

/* ── Definition lists (show pages) ── */
dt { color: #64748b; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
dd { color: #1e293b; margin-bottom: 0.75rem; }

/* ── Outline buttons ── */
button.outline, [type="submit"].outline, [role="button"].outline { border-color: #cbd5e1; color: #475569; }
button.outline:hover, [type="submit"].outline:hover, [role="button"].outline:hover { border-color: #0E3A5A; color: #0E3A5A; background: #e7edf2; }

/* ── Scrape status bar ── */
.scrape-status { padding: 0.5rem 1rem; margin-bottom: 2rem; background: #f1f5f9; border: 1px solid #e2e8f0; }

/* ── Pagination (Pagy) ── */
nav.pagy { background: transparent; box-shadow: none; }

/* ── Footer ── */
.attribution { text-align: center; font-size: 0.75rem; color: var(--pico-muted-color); padding: 2rem 0 1rem; border-top: 1px solid #e2e8f0; margin-top: 3rem; }

/* ── Signal chips ── */
.signal-bar {
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
  padding: 0.6rem 0.75rem; background: #f1f5f9;
  border-radius: 0.5rem; border: 1px solid #e2e8f0; margin-bottom: 1.5rem;
}
.signal-chip {
  display: inline-block; padding: 0.2rem 0.6rem;
  border-radius: 9999px; font-size: 0.75rem;
  font-weight: 600; letter-spacing: 0.02em;
}
/* Color palettes shared with .prospect-tag-* (same semantics, different shape/size base class). */
.signal-chip-score { background: #0E3A5A; color: #fff; }
.signal-chip-red, .prospect-tag-hot { background: #fee2e2; color: #991b1b; }
.signal-chip-amber, .prospect-tag-warm { background: #fef3c7; color: #92400e; }
.signal-chip-green { background: #d1fae5; color: #065f46; }
.signal-chip-blue { background: #dbeafe; color: #1e40af; }
.signal-chip-muted, .prospect-tag-muted { background: #f1f5f9; color: #64748b; }
.signal-chip-muted { border: 1px solid #e2e8f0; }

/* ── Score help tooltip ── */
.score-help { cursor: help; color: var(--pico-muted-color); font-size: 0.7rem; text-decoration: none; border-bottom: 1px dashed #94a3b8; }

/* ── Loading spinner ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block; width: 0.9rem; height: 0.9rem;
  border: 2px solid #e2e8f0; border-top-color: #0E3A5A;
  border-radius: 50%; animation: spin 0.6s linear infinite; vertical-align: middle;
}
.btn-loading { pointer-events: none; opacity: 0.7; }

/* ── Filter count badge ── */
.filter-count {
  display: inline-block; background: #0E3A5A; color: #fff;
  font-size: 0.65rem; font-weight: 700;
  padding: 0.1rem 0.4rem; border-radius: 9999px;
  margin-left: 0.3rem; vertical-align: middle;
}

/* ── Email draft ── */
.email-draft {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 0.5rem; padding: 1rem;
  font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap;
}
.copy-btn { cursor: pointer; }
.copy-btn.copied { color: var(--gp-text-success); }

/* ── Show page utilities ── */
/* Back navigation: a real (subtle) button with breathing room below, so the
   page title doesn't sit glued to it. Used on all show pages. */
.back-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.8rem; font-weight: 500;
  color: var(--pico-muted-color); text-decoration: none;
  padding: 0.3rem 0.8rem; margin-bottom: 1rem;
  border: 1px solid var(--pico-muted-border-color); border-radius: 999px;
  background: var(--pico-card-background-color);
  transition: color 0.15s, border-color 0.15s;
}
.back-link:hover { color: var(--pico-primary); border-color: var(--pico-primary); }
.show-header { margin-bottom: 1.5rem; }
.show-header h1 { margin-bottom: 0.25rem; }
.show-subtitle { color: var(--pico-muted-color); margin-bottom: 0.25rem; }
.section-title { margin-top: 1.5rem; margin-bottom: 0.75rem; }
.action-group { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* Collapsible sections: the summary renders as a clickable panel bar with its
   own chevron, so it's obviously interactive (plain-text summaries weren't). */
.details-section { margin-top: 1rem; }
.details-section > summary {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.9rem; font-weight: 600; color: #475569;
  background: var(--gp-panel-bg);
  border: 1px solid var(--gp-panel-border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.details-section > summary:hover {
  background: var(--gp-panel-bg-hover);
  border-color: #cbd5e1;
  color: var(--pico-color);
}
/* Pico injects its own chevron via summary::after (background-image); ours is
   a rotating ::before marker on the left. */
.details-section > summary::after { display: none; }
.details-section > summary::before {
  content: "\25B8";
  color: var(--pico-muted-color);
  font-size: 0.8rem;
  transition: transform 0.15s ease;
}
.details-section[open] > summary::before { transform: rotate(90deg); }
.details-section[open] > summary { margin-bottom: 0.75rem; }

/* ── Filter bar enhancements ── */
.filters-search { flex: 2; min-width: 200px; }
.filters-wide { flex: 2; min-width: 300px; }

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 3rem 1.5rem;
  color: var(--pico-muted-color);
}
.empty-state p { margin-bottom: 0; font-size: 0.95rem; }

/* ── Results count ── */
.results-count { font-size: 0.82rem; color: var(--pico-muted-color); margin-bottom: 0.75rem; }

/* ── Score breakdown ── */
.score-breakdown {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  align-items: center; margin-top: 0.5rem;
}
.score-breakdown-item {
  display: flex; flex-direction: column; align-items: center;
  padding: 0.4rem 0.6rem; background: #f8fafc;
  border-radius: 0.375rem; border: 1px solid #e2e8f0;
  min-width: 70px; cursor: help;
}
.score-breakdown-value { font-size: 1rem; font-weight: 700; color: #475569; }
.score-breakdown-value.has-score { color: #0E3A5A; }
.score-breakdown-label { font-size: 0.65rem; color: var(--pico-muted-color); text-transform: uppercase; letter-spacing: 0.03em; }

/* ── Card section header ── */
.card-header { font-size: 0.82rem; font-weight: 600; color: #475569; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.75rem; }
/* Brand kicker: small green square before section labels (decorative only —
   green stays out of text/interactive roles). */
.card-header::before {
  content: ""; display: inline-block; vertical-align: middle;
  width: 0.5rem; height: 0.5rem; margin-right: 0.5rem;
  background: #74BE00; border-radius: 1px;
}

/* ── Page header with count ── */
.page-header { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.page-header h1 { margin-bottom: 0; }
.page-header .count { font-size: 1rem; color: var(--pico-muted-color); font-weight: 400; }

/* ── KPI card type-color variants ── */
.kpi-card-permit { border-left-color: #475569; }
.kpi-card-permit h2 { color: #475569; }
.kpi-card-company { border-left-color: #5b21b6; }
.kpi-card-company h2 { color: #5b21b6; }
.kpi-card-industrial-site { border-left-color: #0f766e; }
.kpi-card-industrial-site h2 { color: #0f766e; }
.kpi-card-amber { border-left-color: #d97706; }
.kpi-card-amber h2 { color: var(--gp-text-warning); }
.kpi-card-green { border-left-color: #059669; }
.kpi-card-green h2 { color: var(--gp-text-success); }
.kpi-card-blue { border-left-color: #2563eb; }
.kpi-card-blue h2 { color: #2563eb; }
.kpi-card-red { border-left-color: #dc2626; }
.kpi-card-red h2 { color: var(--gp-text-danger); }

/* Priority row highlight */
.row-high-priority { border-left: 3px solid #059669; }

/* ── Checkbox in filter bar ── */
.filters-checkbox { font-size: 0.82rem; display: flex; align-items: center; gap: 0.3rem; margin: 0; white-space: nowrap; }
.filters-checkbox input[type="checkbox"] { margin: 0; width: auto; }

/* ── Collapsible filters ── */
.filters-more { margin-top: 0; }
.filters-more summary { font-size: 0.82rem; color: var(--pico-muted-color); cursor: pointer; margin-bottom: 0.5rem; }
.filters-more .filters { margin-top: 0.5rem; }

/* ── ICP segment chips ──
   The primary sector lens (companies / permits / nearby leads). The <input> is
   .visually-hidden so it keeps its accessible name and focus behaviour; the
   sibling <span> is the pill. `input:checked + span` gives the active state
   without JS or an inline style (CSP blocks both). */
.icp-chips {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.3rem; width: 100%;
}
.icp-chips-legend {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--pico-muted-color);
  margin-right: 0.15rem;
}
.icp-chip { margin: 0; cursor: pointer; }
.icp-chip > span {
  display: inline-block;
  padding: 0.22rem 0.6rem;
  font-size: 0.8rem; line-height: 1.3;
  background: #fff;
  color: var(--pico-color);
  border: 1px solid var(--gp-panel-border);
  border-radius: 9999px;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.icp-chip:hover > span { background: var(--gp-panel-bg-hover); }
.icp-chip > input:checked + span {
  background: var(--pico-primary);
  border-color: var(--pico-primary);
  color: #fff;
  font-weight: 600;
}
.icp-chip > input:focus-visible + span {
  outline: 2px solid var(--pico-primary);
  outline-offset: 2px;
}
/* Sits on its own line under the chips (the chip row is width:100%, so the
   flex container wraps here). Permits only — see Permit.by_icp_segments. */
.icp-unlinked-toggle { width: 100%; margin-top: 0.1rem; }

/* ── Active filter chips ──
   One removable chip per active filter, so a filter set inside a collapsed
   "Meer filters" can never be silently in effect. */
.filter-chips {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.35rem; margin: -0.5rem 0 1rem;
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.18rem 0.5rem;
  font-size: 0.78rem; text-decoration: none;
  background: var(--gp-panel-bg);
  color: var(--pico-color);
  border: 1px solid var(--gp-panel-border);
  border-radius: 9999px;
}
.filter-chip:hover { background: var(--gp-panel-bg-hover); }
.filter-chip-x { font-size: 0.95rem; line-height: 1; color: var(--pico-muted-color); }
.filter-chip:hover .filter-chip-x { color: var(--gp-text-danger); }
.filter-chips-clear {
  font-size: 0.78rem; color: var(--pico-muted-color); margin-left: 0.25rem;
}

/* Sorting lives on the table headers. Was an inline style= (CSP-blocked), so
   these rendered as default blue underlined links. */
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover { color: var(--pico-primary); }

/* ══ Company cockpit (sticky show-page header) ══════════════════════════════
   Holds the decision-making context that must stay on screen while tabbing:
   identity, score, rooftop link, activity, cooling, and the lead actions. */
.cockpit {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--pico-background-color);
  padding: 0.6rem 0 0;
  margin-bottom: 1rem;
}
.cockpit-identity {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem;
}
.cockpit-name { margin: 0; font-size: 1.45rem; line-height: 1.2; }
.cockpit-identity .show-score { margin-left: auto; }

/* Vertical rhythm: identity → address → activity → chips each get real
   separation. The activity description previously shared a flex row with the
   chips and sat 0.3rem under the address, so all three ran together. */
.cockpit-address {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 0.5rem; font-size: 0.88rem;
}
.cockpit-activity-row {
  margin-top: 0.8rem;
  font-size: 0.88rem; line-height: 1.45;
}
.cockpit-chips {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem;
  margin-top: 0.8rem;
}
/* Klant cockpit chip — filled navy like the active follow pill. */
.client-chip {
  display: inline-flex; align-items: center;
  padding: 0.15rem 0.6rem;
  font-size: 0.78rem; font-weight: 600;
  background: #0E3A5A; color: #fff;
  border: 1px solid #0E3A5A;
  border-radius: 9999px;
}
/* "Klant sinds" date corrector — CSS-only details popover next to the chip.
   Pico injects a chevron on every summary; suppress it (frontend.md).
   **Never set `display` on a <details> element**: Chrome renders its content
   through a UA slot that assumes the default display, and ANY override
   (inline-flex, inline-block) stops it hiding the non-summary children — the
   form then shows permanently and the popover cannot be closed (dev bug,
   2026-08-13). Put the layout on the WRAPPER instead; the details itself only
   gets `position` so the popover can anchor to it.
   Guard: test/system/client_toggle_test.rb. */
.client-chip-wrap { display: inline-flex; align-items: center; gap: 0.15rem; }
.client-date-edit { position: relative; margin: 0; padding: 0; }
.client-date-edit > summary {
  list-style: none; cursor: pointer;
  padding: 0 0.3rem; line-height: 1.4;
  color: var(--pico-muted-color);
}
.client-date-edit > summary::after { display: none; }
.client-date-edit > summary::-webkit-details-marker { display: none; }
.client-date-edit > summary:hover { color: var(--pico-primary); }
/* Hide/show EXPLICITLY rather than leaning on the UA's details-content slot —
   that is what made this popover un-closable. */
.client-date-edit > .client-date-form { display: none; }
.client-date-edit[open] > .client-date-form {
  position: absolute; top: 100%; left: 0; z-index: 30;
  display: flex; gap: 0.3rem; align-items: center;
  margin-top: 0.3rem; padding: 0.5rem;
  background: #fff; border: 1px solid var(--gp-panel-border);
  border-radius: 8px; box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  width: max-content;
}
/* Same metrics as .todo-composer-date: a squeezed date input shrinks Chrome's
   calendar icon to an unhittable sliver, which is what made picking a date
   painful here while the to-do form felt fine. */
.client-date-form input[type="date"] { margin: 0; font-size: 0.85rem; width: auto; min-width: 150px; }
.client-date-form button { margin: 0; width: auto; }
/* Flag 1 (UrgentLeads.urgent?): approved + fresh relevant permit, no call
   logged yet. Red-tinted pill, badge-rejected pair (9.7:1 on its fill). */
.urgent-chip {
  display: inline-flex; align-items: center;
  padding: 0.15rem 0.6rem;
  font-size: 0.78rem; font-weight: 600;
  background: #fee2e2; color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 9999px;
}
.cockpit-address-link {
  display: inline-flex; align-items: center; gap: 0.3rem;
  color: var(--pico-color); text-decoration: none;
}
.cockpit-address-link:hover { color: var(--pico-primary); text-decoration: underline; }
.cockpit-address-link svg { width: 1em; height: 1em; flex: none; color: var(--pico-muted-color); }

/* Rooftop recon (scanning for condensers on satellite view) is a core ritual —
   it was a 9-character text link after a middot. */
.rooftop-btn {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  font-size: 0.78rem; font-weight: 600; text-decoration: none;
  color: var(--pico-primary);
  background: #fff;
  border: 1px solid var(--pico-primary);
  border-radius: 9999px;
}
.rooftop-btn:hover { background: var(--pico-primary); color: #fff; }

.cockpit-activity { color: var(--pico-color); }
.activity-source-ai { margin-right: 0.15rem; }

.permit-recency {
  display: inline-block; padding: 0.12rem 0.5rem;
  font-size: 0.75rem; font-weight: 600; border-radius: 9999px;
  border: 1px solid transparent;
}
.permit-recency-fresh  { background: #dcfce7; color: var(--gp-text-success); border-color: #86efac; }
.permit-recency-recent { background: #fef3c7; color: var(--gp-text-warning); border-color: #fcd34d; }
.permit-recency-stale  { background: var(--gp-panel-bg); color: var(--pico-muted-color); border-color: var(--gp-panel-border); }

/* Tiered actions: status is the classification decision and carries the weight;
   volgen / lijst / herbenaderen are secondary. They used to be one flat row
   nested inside the "Reacties" card. */
/* Lead actions — lives above the Reacties composer, not in the cockpit.
   Kwalificatie left · Opvolging centre · Planning right: space-between spreads
   the groups instead of stacking them. nowrap is load-bearing — `form_with`
   renders a <form>, which Pico styles as a full-width block, so without the
   inline-flex reset below each group claimed 100% width and they wrapped onto
   separate lines. */
.action-bar {
  display: flex; align-items: stretch; flex-wrap: nowrap;
  justify-content: space-between; gap: 0.75rem;
  margin-bottom: 0.75rem; padding: 0.6rem 0.9rem;
  background: var(--gp-panel-bg);
  border: 1px solid var(--gp-panel-border);
  border-radius: 0.5rem;
}

/* Purpose groups: judge / follow / schedule are different verbs, so they get
   captions and dividing rules rather than sitting in one flat toolbar. */
.action-group {
  display: flex; flex-direction: column; gap: 0.25rem;
  flex: 0 1 auto; min-width: 0;
  padding: 0 0.9rem;
}
.action-group:first-child { padding-left: 0; }
.action-group:last-child { padding-right: 0; }
.action-group + .action-group { border-left: 1px solid var(--gp-panel-border); }
.action-group-label {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--pico-muted-color);
  line-height: 1; white-space: nowrap;
}
.action-group-body {
  display: flex; align-items: center; gap: 0.4rem;
  min-height: 1.9rem;
}
/* Pico makes <form> a full-width block; inside an action group it must be an
   inline box or it forces the whole row to wrap. */
.action-group-body form { margin: 0; width: auto; display: inline-flex; align-items: center; }
.action-group-body button { width: auto; }
.action-group-body input[type="date"] { margin: 0; font-size: 0.8rem; padding: 0.2rem 0.4rem; }

/* Follow toggle — filled = on. Navy, not green: the green "Goedgekeurd" badge
   sits in the same cockpit and green is reserved for semantic status. */
/* .client-btn shares the exact pill language (a Klant toggle IS a watch-level
   verb like Volgen) but keeps its own class — the company_show_tabs guard
   asserts exactly one .follow-btn per page. */
.follow-btn, .client-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.25rem 0.7rem; margin: 0;
  font-size: 0.8rem; font-weight: 600; line-height: 1.4;
  background: #fff; color: var(--pico-primary);
  border: 1px solid var(--gp-panel-border); border-radius: 9999px;
  width: auto;
}
.follow-btn:hover, .client-btn:hover { border-color: var(--pico-primary); background: var(--gp-panel-bg-hover); }
.follow-btn-on, .client-btn-on {
  background: var(--pico-primary); color: #fff; border-color: var(--pico-primary);
}
.follow-btn-on:hover, .client-btn-on:hover { background: var(--pico-primary-hover); color: #fff; }
.follow-check { font-weight: 700; }

/* ══ Show-page tabs ═════════════════════════════════════════════════════════
   The bar is the cockpit's bottom edge: it stays pinned with the sticky header
   AND sits immediately above the panel it controls, so the tab→content link
   stays intact. */
.tab-bar {
  display: flex; gap: 0.15rem; flex-wrap: wrap;
  border-bottom: 2px solid var(--gp-panel-border);
  margin: 0.75rem 0 0;
}
.tab {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.5rem 0.9rem; margin: 0 0 -2px;
  width: auto;
  font-size: 0.9rem; font-weight: 600; line-height: 1.3;
  color: var(--pico-muted-color);
  background: none; border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
}
.tab:hover { color: var(--pico-primary); background: none; }
.tab-active { color: var(--pico-primary); border-bottom-color: var(--pico-primary); }
.tab:focus-visible { outline: 2px solid var(--pico-primary); outline-offset: -2px; }
.tab-count {
  display: inline-block; min-width: 1.1rem; padding: 0 0.3rem;
  font-size: 0.7rem; font-weight: 700; text-align: center;
  background: var(--gp-panel-bg); color: var(--pico-muted-color);
  border-radius: 9999px;
}
.tab-active .tab-count { background: var(--pico-primary); color: #fff; }
.tab-panel:focus-visible { outline: 2px solid var(--pico-primary); outline-offset: 4px; }
.tab-loading { padding: 1.5rem 0; }

/* Admin panel sub-navigation. Pills rather than tabs: every /admin section is a
   real page with its own URL, so these are links and carry aria-current="page",
   not role="tab"/aria-selected. Wraps to a second row on narrow viewports; the
   dividers group Team / Data / Systeem and are decorative only. */
.admin-nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem;
  padding-bottom: 0.9rem; margin-bottom: 0.4rem;
  border-bottom: 1px solid var(--gp-panel-border);
}
.admin-nav-link {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem; font-weight: 600; line-height: 1.3;
  color: var(--pico-muted-color); text-decoration: none;
  background: var(--gp-panel-bg);
  border: 1px solid transparent; border-radius: 9999px;
}
.admin-nav-link:hover {
  color: var(--pico-primary); background: var(--gp-panel-bg-hover); text-decoration: none;
}
.admin-nav-link.active {
  color: #fff; background: var(--pico-primary); border-color: var(--pico-primary);
}
.admin-nav-link:focus-visible { outline: 2px solid var(--pico-primary); outline-offset: 2px; }
.admin-nav-divider {
  width: 1px; height: 1.1rem; margin: 0 0.35rem;
  background: var(--gp-panel-border);
}

/* Pico makes every <button> and submit full-width, and styles <form> as a block.
   In a table cell that renders the action as a full-bleed bar spanning the
   column, and it stretched "+ Toevoegen" across the whole add-row. */
.admin-table td form { display: inline-flex; width: auto; margin: 0; }
.admin-table td button,
.admin-table td input[type="submit"],
.admin-table td [role="button"] { width: auto; }
.admin-inline-form input[type="submit"] { width: auto; }

/* Koeltype tagger — subordinate to the AI analysis it is paired with, not a
   peer card. Pico makes every <button> full-width, which turned "Opslaan" into
   a full-bleed primary bar that dominated the whole tab. */
.cooling-card { margin-top: -0.5rem; border-top-left-radius: 0; border-top-right-radius: 0; }
.cooling-card button[type="submit"] {
  width: auto; margin: 0;
  padding: 0.3rem 0.9rem; font-size: 0.82rem;
}
.cooling-card fieldset { margin-bottom: 0.6rem; }

/* Empty-state analysis card: the WHOLE card is the click target. This is one of
   the most-used actions on the page and used to be its smallest hit area — a
   btn-xs in the corner. */
.analysis-cta {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.2rem; width: 100%; margin: 0;
  padding: 1.4rem 1rem;
  background: #fff;
  border: 1px dashed var(--gp-panel-border);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.analysis-cta:hover {
  background: var(--gp-panel-bg);
  border-color: var(--pico-primary);
  border-style: solid;
}
.analysis-cta:focus-visible { outline: 2px solid var(--pico-primary); outline-offset: 2px; }
.analysis-cta-title {
  font-family: "Montserrat", sans-serif;
  font-size: 1.05rem; font-weight: 600; color: var(--pico-primary);
}
.analysis-cta-hint { font-size: 0.82rem; color: var(--pico-muted-color); }
.analysis-cta:hover .analysis-cta-hint { color: var(--pico-primary); }

/* Permits (left, needs table width) beside the koeltype tagger (right). */
.overzicht-split {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}
.overzicht-split .section-head { margin-top: 0; }
.overzicht-split th, .overzicht-split td { padding: 0.4rem 0.5rem; font-size: 0.85rem; }

/* ══ Permit show page ═══════════════════════════════════════════════════════
   "Wat is dit?" (left, prose) beside the map (right). Same 900px collapse as
   .overzicht-split: a half-width map stops being usable well before the phone
   breakpoint. */
.permit-split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.permit-split > article { margin-bottom: 0; }

/* Locatie card: address, rooftop button and the map, stacked. */
.location-card { display: flex; flex-direction: column; }
.location-address { font-size: 0.88rem; margin-bottom: 0.5rem; }
.location-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.location-card .map-embed { height: 280px; }

/* The dossier number. It stops being the <h1> as soon as a company is linked,
   but the team still cross-references it with the Omgevingsloket. */
.permit-ref {
  display: inline-block; padding: 0.12rem 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem; color: var(--pico-muted-color);
  background: var(--gp-panel-bg); border: 1px solid var(--gp-panel-border);
  border-radius: 0.25rem;
}

.narrative-headline {
  margin: 0 0 0.25rem;
  font-size: 1.02rem; font-weight: 600; line-height: 1.4;
}
.narrative-meta {
  margin: 0 0 0.75rem;
  font-size: 0.8rem; color: var(--pico-muted-color);
}
.narrative-quote {
  margin: 0.75rem 0; padding: 0.5rem 0.75rem;
  font-size: 0.88rem; font-style: normal; line-height: 1.5;
  background: var(--gp-panel-bg);
  border-left: 3px solid var(--gp-panel-border);
  border-radius: 0 0.25rem 0.25rem 0;
}
.narrative-section { margin-top: 1rem; }
.narrative-section-label {
  display: block; margin-bottom: 0.35rem;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--pico-muted-color);
}
.narrative-explainer {
  margin: 0 0 0.5rem;
  font-size: 0.86rem; line-height: 1.55;
}
.narrative-explainer-strong { font-weight: 600; }
.narrative-handelingen {
  margin: 0; padding-left: 1.1rem;
  font-size: 0.86rem; line-height: 1.5;
}

/* Notes carry a judgement about the dossier, so they are tinted — but only with
   the text tokens that clear 4.5:1 on a panel. */
.narrative-note {
  margin: 0 0 0.5rem; padding-left: 0.6rem;
  font-size: 0.84rem; line-height: 1.5;
  border-left: 3px solid var(--gp-panel-border);
}
.narrative-note-open { border-left-color: #059669; color: var(--gp-text-success); }
.narrative-note-granted { border-left-color: var(--pico-primary); }
.narrative-note-closed { border-left-color: #dc2626; color: var(--gp-text-danger); }
.narrative-note-neutral, .narrative-note-caveat, .narrative-note-action {
  color: var(--pico-muted-color);
}
.narrative-note-action { border-left-color: #d97706; }

.narrative-footer {
  margin-top: 1rem; padding-top: 0.6rem;
  border-top: 1px solid var(--gp-panel-border);
}
.narrative-block-link { font-size: 0.8rem; color: var(--gp-text-danger); }

/* The permit's own location differs from the registered seat — a second site or
   a new build, which is exactly what the rooftop check is for. */
.location-diff-chip {
  display: inline-block; padding: 0.15rem 0.55rem;
  font-size: 0.75rem; font-weight: 600;
  background: #fef3c7; color: var(--gp-text-warning);
  border: 1px solid #fcd34d; border-radius: 9999px;
}

/* Dossier state, tinted by what it means for a caller. */
.permit-state {
  display: inline-block; padding: 0.12rem 0.5rem;
  font-size: 0.75rem; font-weight: 600; border-radius: 9999px;
  border: 1px solid transparent;
}
.permit-state-open { background: #dcfce7; color: var(--gp-text-success); border-color: #86efac; }
.permit-state-granted { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.permit-state-closed { background: #fee2e2; color: var(--gp-text-danger); border-color: #fca5a5; }
.permit-state-neutral { background: var(--gp-panel-bg); color: var(--pico-muted-color); border-color: var(--gp-panel-border); }

/* The linked KBO company, as a card instead of a six-column table. */
.permit-company {
  padding: 0.75rem 0.9rem;
  background: var(--gp-panel-bg);
  border: 1px solid var(--gp-panel-border);
  border-radius: 0.5rem;
}
.permit-company-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem;
}
.permit-company-name { font-size: 1rem; font-weight: 600; margin-right: 0.4rem; }
.permit-company-score {
  font-size: 1.6rem; font-weight: 700; line-height: 1; flex: none;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.permit-company-chips {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
  margin-top: 0.5rem;
}
.permit-company-facts {
  display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.75rem;
  margin: 0.75rem 0 0; font-size: 0.84rem;
}
.permit-company-facts dt { font-weight: 600; color: var(--pico-muted-color); }
.permit-company-facts dd { margin: 0; }
.permit-company-actions {
  display: flex; align-items: center; gap: 0.5rem; margin-top: 0.75rem;
}
.permit-company-actions form { margin: 0; }
.permit-company-actions button { width: auto; }

.verdict-chip-ja { background: #dcfce7; color: var(--gp-text-success); }
.verdict-chip-onzeker { background: #fef3c7; color: var(--gp-text-warning); }
.verdict-chip-nee { background: #fee2e2; color: var(--gp-text-danger); }

@media (max-width: 900px) {
  .permit-split { grid-template-columns: 1fr; }
}

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; margin: 1.25rem 0 0.5rem;
}
.link-btn {
  width: auto; margin: 0; padding: 0;
  background: none; border: none;
  color: var(--pico-primary); font-size: 0.82rem; font-weight: 600;
  cursor: pointer;
}
.link-btn:hover { background: none; text-decoration: underline; }
.data-tab .details-section { margin-bottom: 0.35rem; }

/* ── Smooth transitions ── */
a { transition: color 0.15s; }

/* ── Prospect List (Followed page) ── */
.prospect-pipeline {
  display: flex; gap: 0; margin-bottom: 1.5rem;
  border-radius: 0.5rem; overflow: hidden;
  border: 1px solid #e2e8f0;
}
.prospect-pipeline .pipeline-stage { cursor: pointer; }
.prospect-pipeline .pipeline-active { box-shadow: inset 0 -3px 0 currentColor; }
.pipeline-clear {
  padding: 0.6rem 0.75rem; display: flex; align-items: center; justify-content: center;
  background: #f1f5f9; color: #64748b; text-decoration: none; font-size: 0.75rem; font-weight: 600;
  border-left: 1px solid #e2e8f0; transition: background 0.15s;
}
.pipeline-clear:hover { background: #e2e8f0; color: #475569; }

.prospect-list { display: flex; flex-direction: column; gap: 0; }

.prospect-card {
  border: 1px solid #e2e8f0;
  border-bottom: none;
  background: #fff;
  transition: box-shadow 0.15s;
}
.prospect-card:first-child { border-radius: 0.5rem 0.5rem 0 0; }
.prospect-card:last-child { border-bottom: 1px solid #e2e8f0; border-radius: 0 0 0.5rem 0.5rem; }
.prospect-card:only-child { border-radius: 0.5rem; border-bottom: 1px solid #e2e8f0; }
.prospect-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); z-index: 1; position: relative; }

.prospect-summary {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.65rem 1rem; cursor: pointer;
  transition: background 0.1s;
}
.prospect-summary:hover { background: #f8fafc; }

.prospect-score {
  flex-shrink: 0; width: 2.5rem; text-align: center;
  font-size: 1.05rem; font-weight: 700;
}

.prospect-main { flex: 2; min-width: 0; }
.prospect-name { font-weight: 600; font-size: 0.88rem; line-height: 1.3; }
.prospect-name a { color: inherit; text-decoration: none; }
.prospect-name a:hover { color: var(--pico-primary); }
.prospect-meta {
  display: flex; gap: 0.5rem; font-size: 0.72rem; color: var(--pico-muted-color);
  margin-top: 0.1rem;
}
.prospect-meta span:not(:last-child)::after { content: "·"; margin-left: 0.5rem; }

.prospect-signals { flex: 1; display: flex; gap: 0.3rem; flex-wrap: wrap; justify-content: flex-start; }

.prospect-tag {
  display: inline-block; padding: 0.1rem 0.45rem;
  border-radius: 0.25rem; font-size: 0.68rem;
  font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
}
/* Color values for -hot/-warm/-muted live grouped with .signal-chip-* above. */
.prospect-tag-permit { background: #f1f5f9; color: #475569; }
.prospect-tag-site { background: #ccfbf1; color: #0f766e; }

.prospect-contact-preview { flex: 1; font-size: 0.8rem; min-width: 0; }
.prospect-contact-name { color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.prospect-contact-empty { color: #cbd5e1; font-style: italic; font-size: 0.75rem; }

.prospect-status { flex-shrink: 0; }
.prospect-expand-icon {
  flex-shrink: 0; width: 1.25rem; text-align: center;
  color: #cbd5e1; font-size: 0.7rem; transition: transform 0.2s;
}

/* Expanded detail panel */
.prospect-detail {
  max-height: 0; overflow: hidden;
  transition: max-height 0.25s ease-out, padding 0.25s ease-out;
  background: #f8fafc; border-top: none;
}
.prospect-detail-open {
  max-height: 500px; padding: 1rem;
  border-top: 1px solid #e2e8f0;
  transition: max-height 0.35s ease-in, padding 0.2s ease-in;
}
.prospect-detail-open + .prospect-summary .prospect-expand-icon,
.prospect-card:has(.prospect-detail-open) .prospect-expand-icon {
  transform: rotate(180deg);
}

.prospect-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
}

.prospect-detail-col { min-width: 0; }

.prospect-detail-header {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: #64748b;
  margin-bottom: 0.5rem; padding-bottom: 0.3rem;
  border-bottom: 1px solid #e2e8f0;
}

.prospect-dl { margin: 0; }
.prospect-dl dt {
  font-size: 0.68rem; color: var(--pico-muted-color); font-weight: 500;
  text-transform: none; letter-spacing: 0; margin-top: 0.35rem;
}
.prospect-dl dd { font-size: 0.82rem; margin-bottom: 0.15rem; margin-left: 0; }

.prospect-contact-card {
  padding: 0.4rem 0; border-bottom: 1px solid #e2e8f0;
}
.prospect-contact-card:last-of-type { border-bottom: none; }
.prospect-contact-card-name { font-weight: 600; font-size: 0.82rem; color: #1e293b; }
.prospect-contact-card-role { font-size: 0.72rem; color: #64748b; }
.prospect-contact-card-channels { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.2rem; }
.prospect-channel {
  font-size: 0.72rem; color: var(--pico-primary);
  text-decoration: none; white-space: nowrap;
}
.prospect-channel:hover { text-decoration: underline; }

.prospect-activity-item { margin-bottom: 0.4rem; font-size: 0.82rem; }
.prospect-activity-label {
  display: block; font-size: 0.68rem; color: var(--pico-muted-color); font-weight: 500;
}

.prospect-detail-empty { font-size: 0.8rem; color: var(--pico-muted-color); margin: 0; display: flex; align-items: center; }

.prospect-actions {
  display: flex; gap: 0.5rem; align-items: center;
  margin-top: 0.75rem; padding-top: 0.5rem; border-top: 1px solid #e2e8f0;
}

/* ── Responsive (layout/sidebar breakpoints) ──
   Page/widget mobile overrides live in the "Mobile overrides" section at the
   BOTTOM of this file, so they win the cascade over base rules defined after
   this point. Keep them there. */

@media (max-width: 768px) {
  .sidebar { width: 3.5rem; }
  .sidebar-brand { padding: 1rem 0.5rem; font-size: 0; }
  .sidebar-brand::first-letter { font-size: 1.1rem; }
  .sidebar-link { padding: 0.5rem; justify-content: center; gap: 0; border-left: none; }
  .sidebar-icon { width: 1.35rem; height: 1.35rem; }
  .sidebar-admin .sidebar-link { padding: 0.4rem; justify-content: center; }
  .main-wrap { margin-left: 3.5rem; }
  .kpi-grid-primary { grid-template-columns: 1fr 1fr; }
  .pipeline { flex-wrap: wrap; }
  .pipeline-stage { flex: 1 1 45%; }
}

/* Icon rail (481–768px): the labels are hidden VISUALLY only. `display: none`
   drops a node from the accessibility tree, which left every nav link with an
   empty accessible name — a screen reader read "link" eleven times (#86).
   Mirrors `.visually-hidden`; scoped with a min-width so the ≤480px off-canvas
   drawer needs no reset. */
@media (min-width: 481px) and (max-width: 768px) {
  .sidebar-label {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s; width: 13rem; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-link { padding: 0.7rem 1rem; justify-content: flex-start; gap: 0.75rem; border-left: 3px solid transparent; }
  .sidebar-admin .sidebar-link { padding: 0.55rem 1rem; justify-content: flex-start; }
  .main-wrap { margin-left: 0; }
  .sidebar-toggle {
    display: flex; align-items: center; justify-content: center;
    position: fixed; top: 0.75rem; left: 0.75rem; z-index: 101;
    width: 2.25rem; height: 2.25rem; border-radius: 0.375rem;
    background: #1e293b; color: #fff; border: none; cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  }
  .sidebar-toggle svg { width: 1.25rem; height: 1.25rem; }
  .sidebar-backdrop {
    display: none; position: fixed; inset: 0; z-index: 99;
    background: rgba(0,0,0,0.4);
  }
  .sidebar.open ~ .sidebar-backdrop { display: block; }
  body.sidebar-locked { overflow: hidden; }
  main.container { padding-top: 3.5rem; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-grid-primary { grid-template-columns: 1fr; }
  .kpi-grid-secondary { grid-template-columns: 1fr 1fr; }
}

/* ── Lists ── */
.list-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.list-card {
  display: flex; border: 1px solid #e2e8f0; border-radius: 0.5rem;
  background: #fff; text-decoration: none; color: inherit;
  transition: box-shadow 0.2s, transform 0.2s; overflow: hidden;
}
.list-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-1px); }
.list-card-color { width: 4px; flex-shrink: 0; }
.list-card-body { padding: 1rem; flex: 1; }
.list-card-name { font-weight: 600; font-size: 0.95rem; color: #1e293b; margin-bottom: 0.25rem; }
.list-card-desc { font-size: 0.8rem; color: #64748b; margin-bottom: 0.5rem; }
.list-card-meta { font-size: 0.72rem; color: var(--pico-muted-color); display: flex; gap: 0.75rem; }
.list-card-color-dot {
  display: inline-block; width: 0.75rem; height: 0.75rem;
  border-radius: 50%; vertical-align: middle; margin-right: 0.4rem;
}

/* Add-to-list button */
.list-add-btn {
  all: unset; cursor: pointer; font-size: 1rem; line-height: 1;
  color: var(--pico-muted-color); width: 1.5rem; height: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 0.25rem; transition: background 0.1s, color 0.1s;
}
.list-add-btn:hover { background: #e7edf2; color: var(--pico-primary); }

/* Popover dropdown — fixed-positioned (placed by JS) so it escapes the
   action-bar / table-cell clipping context and never hides behind the
   z-index:100 sidebar. */
.list-popover {
  display: none; position: fixed; z-index: 200;
  min-width: 220px; max-width: calc(100vw - 1rem); background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  font-size: 0.82rem;
}
.list-popover-open { display: block; }
.list-popover-loading { padding: 0.75rem; color: var(--pico-muted-color); text-align: center; }
.list-popover-empty { padding: 0.75rem; color: var(--pico-muted-color); font-style: italic; }
.list-popover-search {
  width: 100%; padding: 0.5rem; border: none;
  border-bottom: 1px solid #e2e8f0; font-size: 0.85rem;
  box-sizing: border-box;
}
.list-popover-search:focus {
  outline: none; border-bottom-color: var(--pico-primary);
}
.list-popover-search::placeholder {
  color: var(--pico-muted-color);
}
.list-popover-items { max-height: 350px; overflow-y: auto; padding: 0.25rem 0; }
.list-popover-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.75rem; cursor: pointer; font-size: 0.85rem;
  transition: background 0.1s;
  min-height: 2.25rem;
}
.list-popover-item:hover { background: #f8fafc; }
.list-popover-item input[type="checkbox"] { margin: 0 0.25rem 0 0; width: 1.1rem; height: 1.1rem; flex-shrink: 0; cursor: pointer; }
.list-popover-color {
  display: inline-block; width: 0.5rem; height: 0.5rem;
  border-radius: 50%; flex-shrink: 0;
}
.list-popover-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-popover-new {
  display: block; padding: 0.5rem 0.75rem; border-top: 1px solid #e2e8f0;
  color: var(--pico-primary); font-size: 0.78rem; text-decoration: none;
  font-weight: 500;
}
.list-popover-new:hover { background: #e7edf2; }

/* ── Searchable Select ── */
.searchable-select { position: relative; }
.searchable-select-input {
  width: 100%; font-size: 0.85rem; margin: 0;
  padding: 0.4rem 0.5rem;
}
.searchable-select-dropdown {
  display: none; position: absolute; top: 100%; left: 0;
  z-index: 60; background: #fff; border: 1px solid #e2e8f0;
  border-radius: 0 0 0.5rem 0.5rem; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  max-height: 260px; overflow-y: auto; min-width: 100%; width: max-content; max-width: 500px;
}
.searchable-select-open { display: block; }
.searchable-select-option {
  padding: 0.4rem 0.75rem; font-size: 0.8rem; cursor: pointer;
  transition: background 0.1s;
}
.searchable-select-option:hover { background: #f1f5f9; }
/* The keyboard highlight IS the pointer for arrow-key users, so it needs to be
   visible on its own — #f1f5f9 on white was ~1.03:1 against the other rows. */
.searchable-select-highlighted {
  background: var(--gp-panel-bg-hover);
  box-shadow: inset 3px 0 0 var(--pico-primary);
}
.searchable-select-option mark { background: #fef3c7; color: inherit; padding: 0; border-radius: 2px; }
.searchable-select-empty { padding: 0.5rem 0.75rem; font-size: 0.78rem; color: var(--pico-muted-color); font-style: italic; }

/* Table cell overflow for popover */
td { overflow: visible; }

/* ── Bulk Select ── */
.bulk-th, .bulk-td { width: 3rem; text-align: center; padding: 0.4rem 0.6rem !important; }
.bulk-th input[type="checkbox"], .bulk-td input[type="checkbox"] { margin: 0; width: 1.1rem; height: 1.1rem; cursor: pointer; }

/* Floating action bar */
.bulk-bar {
  position: fixed; bottom: -4rem; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 1rem; background: #1e293b; color: #fff;
  border-radius: 0.75rem; box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  font-size: 0.85rem; transition: bottom 0.25s ease;
  white-space: nowrap;
}
.bulk-bar-visible { bottom: 1.5rem; }
.bulk-bar-count { font-weight: 600; }
.bulk-bar-actions { display: flex; align-items: center; gap: 0.5rem; }
.bulk-bar-select {
  background: #334155; border: 1px solid #475569; color: #e2e8f0;
  font-size: 0.82rem; padding: 0.3rem 0.5rem; border-radius: 0.375rem;
  margin: 0; min-width: 160px;
}
.bulk-bar-select:focus { border-color: #6ea8d4; outline: none; }
.bulk-bar-submit {
  background: #0E3A5A; color: #fff; border: none; padding: 0.35rem 0.75rem;
  font-size: 0.82rem; font-weight: 600; border-radius: 0.375rem;
  cursor: pointer; transition: background 0.15s; margin: 0;
}
.bulk-bar-submit:hover { background: #0a2c45; }
.bulk-bar-submit:disabled { opacity: 0.7; cursor: wait; }
.bulk-bar-success { background: #059669 !important; }
.bulk-bar-clear {
  background: none; border: none; color: var(--pico-muted-color); font-size: 1.1rem;
  cursor: pointer; padding: 0 0.25rem; line-height: 1; margin: 0;
}
.bulk-bar-clear:hover { color: #fff; }

/* ── Login page ──────────────────────────────────────────────── */
.login-layout {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--pico-background-color);
  padding: 1rem;
}
.login-card {
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  padding: 2.5rem 2rem; width: 100%; max-width: 24rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.login-card h2 { margin-bottom: 0.25rem; text-align: center; }
.login-subtitle { text-align: center; color: var(--pico-muted-color); margin-bottom: 1.5rem; }

/* ── Sidebar user section ────────────────────────────────────── */
.sidebar-user {
  margin-top: auto; padding: 0.75rem 1rem;
  border-top: 1px solid var(--pico-muted-border-color);
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.sidebar-user-info { display: flex; flex-direction: column; }
.sidebar-user-name { font-size: 0.8rem; font-weight: 600; color: #e2e8f0; }
.sidebar-user-role { font-size: 0.7rem; color: #AFC3CE; text-transform: uppercase; letter-spacing: 0.05em; }
.sidebar-logout-btn {
  background: transparent; border: 1px solid #1c4a6e; color: #AFC3CE;
  font-size: 0.7rem; padding: 0.25rem 0.5rem; border-radius: 0.25rem;
  cursor: pointer; white-space: nowrap;
}
.sidebar-logout-btn:hover { background: #1c4a6e; color: #fff; }

/* ── Nearby leads ── */
.nearby-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 960px) {
  .nearby-layout { grid-template-columns: 1fr; }
}
.nearby-controls { min-width: 0; }
.nearby-map-container { position: sticky; top: 1rem; }
#nearby-map { height: 500px; border-radius: 8px; border: 1px solid var(--pico-muted-border-color); }
.origin-marker { background: transparent !important; border: none !important; }
/* Leaflet marker/popup content is injected as innerHTML, so inline styles there
   are CSP-blocked — these classes replace them (set in nearby_map_controller.js). */
.nearby-origin-dot {
  background: #dc2626; width: 14px; height: 14px; border-radius: 50%;
  border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.nearby-popup-title { font-weight: 600; }
.nearby-popup-followed { color: #16a34a; }
/* === Pipeline (Lijsten mini-CRM) === */

.pipeline-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}
@media (max-width: 800px) {
  .pipeline-kpis { grid-template-columns: repeat(3, 1fr); }
}
.pipeline-kpi {
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  margin: 0;
}
.pipeline-kpi h2 { margin: 0; font-size: 1.4rem; }
.pipeline-kpi small { color: var(--pico-muted-color); font-size: 0.75rem; }
.pipeline-kpi-uncontacted { border-left: 3px solid #94a3b8; }
.pipeline-kpi-contacted   { border-left: 3px solid #fbbf24; }
.pipeline-kpi-qualified   { border-left: 3px solid #60a5fa; }
.pipeline-kpi-proposal    { border-left: 3px solid #a78bfa; }
.pipeline-kpi-won         { border-left: 3px solid #10b981; }
.pipeline-kpi-lost        { border-left: 3px solid #ef4444; }

.view-toggle { display: flex; gap: 0.25rem; }
.view-toggle a { margin: 0; }

/* Shared header action cluster — replaces ad-hoc inline styles. */
.page-header-actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.page-header-actions [role="button"],
.page-header-actions button,
.page-header-actions form { margin: 0; }
.page-header-actions [role="button"],
.page-header-actions button {
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
}
.page-header-desc {
  color: var(--pico-muted-color);
  margin-bottom: 1.5rem;
}

/* Archived lists block in lists#index */
.archived-heading {
  margin-top: 2rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pico-muted-color);
}
.list-card-archived { opacity: 0.65; }
.list-card-archived:hover { opacity: 1; }

.add-row-block {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--pico-muted-border-color);
  border-radius: 6px;
}
.add-row-block summary { cursor: pointer; padding: 0; }
.add-row-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
@media (max-width: 800px) { .add-row-grid { grid-template-columns: 1fr 1fr; } }

/* Kanban toolbar (lost-toggle, future filters) */
.kanban-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.4rem;
}
.kanban-toggle-lost {
  color: var(--pico-muted-color);
  font-size: 0.8rem;
  text-decoration: none;
}
.kanban-toggle-lost:hover {
  color: var(--pico-color);
  text-decoration: underline;
}

/* Kanban board — column count is rendered dynamically. */
.kanban-board {
  display: grid;
  gap: 0.5rem;
  overflow-x: auto;
}
.kanban-board-5 { grid-template-columns: repeat(5, minmax(240px, 1fr)); }
.kanban-board-6 { grid-template-columns: repeat(6, minmax(220px, 1fr)); }
/* The "drop a deal here" placeholder ships in every column and is revealed only
   when it is the column's only child, so Turbo Stream card appends/removals
   never leave it stale (a stream can add a node but not delete a sibling). */
.kanban-column-empty {
  display: none;
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--pico-muted-color);
  font-style: italic;
  border: 1px dashed var(--pico-muted-border-color);
  border-radius: 6px;
  background: transparent;
}
.kanban-column-cards > .kanban-column-empty:only-child {
  display: block;
}
.kanban-column {
  background: var(--gp-panel-bg);
  border: 1px solid var(--gp-panel-border);
  border-radius: 6px;
  padding: 0.5rem;
  min-height: 200px;
}
.kanban-column.drag-over { background: #e0e7ff; }
.kanban-column-header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  padding: 0 0.25rem;
  color: var(--pico-muted-color);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.kanban-column-count {
  background: var(--pico-card-background-color);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  font-size: 0.75rem;
}
.kanban-column-cards { display: flex; flex-direction: column; gap: 0.4rem; min-height: 60px; }
.kanban-card {
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 6px;
  padding: 0.6rem 0.7rem;
  cursor: grab;
  margin: 0;
  position: relative;
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: 0.4; }
.kanban-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.kanban-card-contact { font-size: 0.8rem; line-height: 1.3; margin-bottom: 0.3rem; }
.kanban-card-contact small { color: var(--pico-muted-color); display: block; }
.kanban-card-meta {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; color: var(--pico-muted-color);
}
.kanban-card-staleness {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
}
.kanban-card-staleness small { font-size: 0.7rem; }
.kanban-card-staleness.is-stale small { color: #b91c1c; font-weight: 600; }
.kanban-card-open {
  font-size: 0.7rem;
  position: absolute; top: 0.4rem; right: 0.5rem;
  color: var(--pico-muted-color);
}
/* Stage select on kanban cards: HTML5 drag-and-drop never fires on touch
   devices, so touch users get an explicit select instead. Hidden wherever a
   mouse is available so the desktop kanban stays drag-first. */
.kanban-card-stage { display: none; }
@media (hover: none) and (pointer: coarse) {
  .kanban-card-stage { display: block; margin-top: 0.5rem; }
  .kanban-card-stage .pipeline-edit-cell {
    border-color: var(--pico-muted-border-color);
    background: var(--gp-panel-bg);
  }
}
.owner-chip {
  background: #ede9fe;
  color: #5b21b6;
  border-radius: 999px;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
}
.stealth-link { color: inherit; text-decoration: none; }
.stealth-link:hover { text-decoration: underline; }

/* Table view */
.pipeline-table th, .pipeline-table td { padding: 0.4rem 0.5rem; vertical-align: top; }
.pipeline-row { cursor: pointer; transition: background-color 0.1s ease; }
.pipeline-row:hover { background: var(--gp-panel-bg); }
.pipeline-row.is-open { background: var(--gp-panel-bg); }
.pipeline-row td { font-size: 0.85rem; }
.pipeline-row select, .pipeline-row input { font-size: 0.8rem; }

/* Inline-edit affordance: subtle so it doesn't shout, but unmistakably interactive on hover. */
.pipeline-edit-form { margin: 0; }
.pipeline-edit-cell {
  margin: 0;
  padding: 0.2rem 0.4rem;
  font-size: 0.8rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
}
.pipeline-edit-cell:hover {
  background: var(--gp-panel-bg-hover);
  border-color: var(--pico-muted-border-color);
}
.pipeline-edit-cell:focus {
  background: var(--pico-card-background-color);
  border-color: #0E3A5A;
  outline: none;
}

/* Stage select: borrow the kpi accent so the row carries a pipeline-stage cue. */
.pipeline-stage-form .pipeline-edit-cell { border-left-width: 3px; border-left-style: solid; }
.pipeline-stage-form[data-stage="uncontacted"] .pipeline-edit-cell { border-left-color: #94a3b8; }
.pipeline-stage-form[data-stage="contacted"]   .pipeline-edit-cell { border-left-color: #fbbf24; }
.pipeline-stage-form[data-stage="qualified"]   .pipeline-edit-cell { border-left-color: #60a5fa; }
.pipeline-stage-form[data-stage="proposal"]    .pipeline-edit-cell { border-left-color: #a78bfa; }
.pipeline-stage-form[data-stage="won"]         .pipeline-edit-cell { border-left-color: #10b981; }
.pipeline-stage-form[data-stage="lost"]        .pipeline-edit-cell { border-left-color: #ef4444; }
/* Trigger button that toggles the detail <tr>. Looks like plain text but is
   a full clickable target so the entire name cell is hit-able. */
.pipeline-row-trigger {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  width: 100%;
  text-align: left;
}
.pipeline-row-trigger:focus-visible {
  outline: 2px solid var(--pico-primary-focus);
  outline-offset: 2px;
  border-radius: 4px;
}
.pipeline-summary-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.pipeline-row-trigger .pipeline-disclosure {
  display: inline-block;
  width: 0.85rem;
  color: #646b79;
  font-size: 0.85rem;
  line-height: 1;
  transition: transform 0.12s ease;
  flex-shrink: 0;
}
.pipeline-row.is-open .pipeline-row-trigger .pipeline-disclosure {
  transform: rotate(90deg);
  color: #646b79;
}
.pipeline-row-trigger:hover .pipeline-disclosure { color: #373c44; }

/* Pico redefines --pico-color locally on buttons to var(--pico-primary-inverse)
   (white) so its filled button text reads on a coloured background. Our trigger
   is a transparent button on a white row; reset the variable + the color. */
.pipeline-row-trigger {
  --pico-color: #373c44;
  color: #373c44;
  background-color: transparent !important;
}
.pipeline-row-trigger strong,
.pipeline-row-trigger small { color: inherit; }

/* The detail <tr> sits flush against its main row: drawer carries its own
   spacing so the <td> doesn't need any. */
.pipeline-row-detail > td { padding: 0; }

.pipeline-drawer {
  background: var(--gp-panel-bg);
  border: 1px solid var(--gp-panel-border);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin: 0.25rem 0.4rem 0.6rem;
}
/* Placeholder shown while the lazy drawer frame fetches (#49). Same box as the
   drawer so expanding a row doesn't make the table jump. */
.pipeline-drawer-loading {
  background: var(--gp-panel-bg);
  border: 1px solid var(--gp-panel-border);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin: 0.25rem 0.4rem 0.6rem;
  color: var(--pico-muted-color);
  font-size: 0.85rem;
}
.pipeline-drawer-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 900px) {
  .pipeline-drawer-grid { grid-template-columns: 1fr; }
}
.pipeline-drawer-left,
.pipeline-drawer-right { min-width: 0; }
.pipeline-drawer h5 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pico-muted-color);
  margin: 0 0 0.5rem;
}
.pipeline-drawer-subhead { margin-top: 1.25rem !important; }
/* The lead's Taken block under the drawer composer: its header reads like the
   drawer's own h5 labels rather than a page-level card header. */
.pipeline-drawer .todos-section { margin-top: 1.25rem; }
.pipeline-drawer .todos-section .card-header { font-size: 0.7rem; margin-bottom: 0.5rem; }
.pipeline-drawer-contact {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem 0.75rem;
}
.pipeline-drawer-contact .span-2 { grid-column: span 3; }
.pipeline-drawer-contact label { margin: 0; font-size: 0.8rem; }
.pipeline-drawer-contact input,
.pipeline-drawer-contact select { margin-top: 0.15rem; }
@media (max-width: 700px) {
  .pipeline-drawer-contact { grid-template-columns: 1fr; }
  .pipeline-drawer-contact .span-2 { grid-column: span 1; }
}
.pipeline-drawer-link {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
}
.activity-feed-cap {
  display: block;
  margin-top: 0.5rem;
  color: var(--pico-muted-color);
  font-style: italic;
}
.activity-feed-empty {
  list-style: none;
  padding: 0.5rem 0;
  color: var(--pico-muted-color);
  font-size: 0.85rem;
  font-style: italic;
  border-bottom: none;
}

/* System-activity collapsible (stage/owner changes etc.) — collapsed by default
   so the comments feed reads clean. */
.pipeline-system-activity {
  margin-top: 1rem;
  border-top: 1px dashed var(--gp-panel-border);
  padding-top: 0.75rem;
}
.pipeline-system-activity > summary {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pico-muted-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pipeline-system-activity > summary:hover { color: var(--pico-color); }
.pipeline-system-activity[open] > summary { margin-bottom: 0.5rem; }
.pipeline-system-count {
  background: var(--gp-panel-bg-hover);
  color: var(--pico-color);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0;
  text-transform: none;
}
.pipeline-system-activity .system-feed .activity-entry { padding: 0.35rem 0; }

/* Comment composer (right column of the drawer). */
.pipeline-comment-form { margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.pipeline-comment-form textarea { margin: 0; min-height: 8rem; }
/* Notitie|Gebeld toggle — CSS-only state, same input:checked+span idiom as the
   ICP chips. The fieldset reset keeps Pico from block-stacking it. */
.comment-kind { display: flex; gap: 0.3rem; margin: 0; padding: 0; border: 0; }
.comment-kind-pill { margin: 0; cursor: pointer; }
.comment-kind-pill > span {
  display: inline-flex; align-items: center;
  padding: 0.22rem 0.7rem;
  font-size: 0.8rem; line-height: 1.3;
  background: #fff;
  color: var(--pico-color);
  border: 1px solid var(--gp-panel-border);
  border-radius: 9999px;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.comment-kind-pill:hover > span { background: var(--gp-panel-bg-hover); }
.comment-kind-pill > input:checked + span {
  background: var(--pico-primary);
  border-color: var(--pico-primary);
  color: #fff;
  font-weight: 600;
}
.comment-kind-pill > input:focus-visible + span {
  outline: 2px solid var(--pico-primary);
  outline-offset: 2px;
}
.pipeline-comment-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.pipeline-comment-tip {
  color: var(--pico-muted-color);
  font-size: 0.75rem;
  white-space: nowrap;
}
.pipeline-comment-tip kbd {
  background: var(--pico-card-background-color);
  color: var(--pico-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 3px;
  padding: 0 0.3rem;
  font-size: 0.7rem;
  font-family: inherit;
}
/* Override Pico's default full-width submit button — we want it sized to content. */
.pipeline-comment-form button[type="submit"] {
  width: auto;
  margin: 0;
  padding: 0.4rem 1.2rem;
  flex-shrink: 0;
}

/* Inspreken (dictated notes): the draft state of the composer. The mic button
   and its recording state live with the dictation Stimulus controller. */
.dictation { display: inline-flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
/* Pill button like the kind toggle. Explicit color: Pico's <button> redefines
   --pico-color to primary-inverse (frontend.md). */
.dictation-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  width: auto; margin: 0; padding: 0.25rem 0.75rem;
  font-size: 0.8rem; line-height: 1.3; font-weight: 500;
  background: #fff; color: var(--gp-text-secondary, #374151);
  border: 1px solid var(--gp-panel-border); border-radius: 9999px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.dictation-btn:hover { background: var(--gp-panel-bg-hover); color: var(--gp-text-secondary, #374151); }
.dictation-btn:focus-visible { outline: 2px solid var(--pico-primary); outline-offset: 2px; }
.dictation-btn:disabled { cursor: default; }
.dictation-btn svg { width: 1em; height: 1em; flex-shrink: 0; }
.dictation-dot { display: none; width: 0.55em; height: 0.55em; border-radius: 50%; background: var(--gp-text-danger); }
.dictation-btn.is-recording { border-color: var(--gp-text-danger); color: var(--gp-text-danger); }
.dictation-btn.is-recording .dictation-dot { display: inline-block; animation: dictation-pulse 1.2s ease-in-out infinite; }
@keyframes dictation-pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) {
  .dictation-btn.is-recording .dictation-dot { animation: none; }
}
.dictation-status { font-size: 0.8rem; color: var(--pico-muted-color); font-variant-numeric: tabular-nums; }
.dictation-status.is-error, .dictation-status .is-error { color: var(--gp-text-danger); }
.dictation-hint { margin: 0; font-size: 0.8rem; color: var(--gp-text-warning); }
/* No `display` on the <details> itself (Pico gotcha); the panel is hidden explicitly. */
.dictation-transcript { margin: 0; padding: 0; border: 0; font-size: 0.8rem; }
.dictation-transcript > summary { cursor: pointer; color: var(--pico-muted-color); }
.dictation-transcript > p { display: none; margin: 0.35rem 0 0; white-space: pre-wrap; color: var(--pico-muted-color); }
.dictation-transcript[open] > p { display: block; }
.dictation-todo {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  margin: 0; padding: 0.5rem 0.6rem;
  border: 1px dashed var(--gp-panel-border); border-radius: 6px;
}
.dictation-todo-toggle {
  display: inline-flex; align-items: center; gap: 0.35rem;
  margin: 0; font-size: 0.85rem; white-space: nowrap;
}
.dictation-todo input[type="checkbox"] { margin: 0; }
.dictation-todo input[type="text"], .dictation-todo input[type="date"] { margin: 0; font-size: 0.85rem; }
.dictation-todo-note { flex-basis: 100%; font-size: 0.75rem; color: var(--pico-muted-color); }

/* Empty-list state: centered card with the inline add-row form. */
.pipeline-empty {
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}
.pipeline-empty-inner {
  max-width: 640px;
  width: 100%;
  text-align: left;
}
.pipeline-empty-inner h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}
.pipeline-empty-inner > p {
  color: var(--pico-muted-color);
  margin-bottom: 1.25rem;
}

.activity-feed {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}
.activity-entry {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
}
.activity-entry:last-child { border-bottom: none; }
.activity-entry-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--pico-muted-color);
}
.activity-entry-head strong { color: var(--pico-color); }
.activity-entry-body { font-size: 0.85rem; margin-top: 0.25rem; }

/* Pipeline add-row picker (unified single input + segmented control) */
.pipeline-add { position: relative; margin-top: 0.5rem; }
.pipeline-add-tabs {
  display: inline-flex;
  gap: 0;
  margin-bottom: 0.6rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 6px;
  overflow: hidden;
}
.pipeline-add-tab {
  background: var(--pico-card-background-color);
  color: var(--pico-muted-color);
  border: none;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
  border-right: 1px solid var(--pico-muted-border-color);
  margin: 0;
}
.pipeline-add-tab:last-child { border-right: none; }
.pipeline-add-tab:hover { background: var(--gp-panel-bg); }
.pipeline-add-tab.active {
  background: #0E3A5A;
  color: white;
}

.pipeline-add-search { position: relative; }
.pipeline-add-search input { margin: 0; }
.pipeline-add-hint {
  display: block;
  margin-top: 0.35rem;
  color: var(--pico-muted-color);
  font-size: 0.75rem;
}

.pipeline-picker-results {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  max-height: 280px;
  overflow-y: auto;
}
.pipeline-picker-results li { border-bottom: 1px solid var(--pico-muted-border-color); }
.pipeline-picker-results li:last-child { border-bottom: none; }
.pipeline-picker-results a {
  display: block;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  text-decoration: none;
  color: inherit;
}
.pipeline-picker-results a:hover { background: var(--gp-panel-bg); }
.pipeline-picker-empty { padding: 0.5rem 0.6rem; color: var(--pico-muted-color); font-size: 0.85rem; }
.pipeline-picker-added {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.6rem; font-size: 0.85rem;
  color: var(--pico-muted-color); cursor: default;
}
.pipeline-picker-added-tag { margin-left: auto; font-size: 0.72rem; font-style: italic; white-space: nowrap; }

/* ── Kanban quick-view panel (card-click) ── */
.quickview-dialog {
  width: min(72rem, 94vw);
  max-width: 94vw;
  max-height: 90vh;
  padding: 0;
  border: none;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  overflow: hidden;
  /* Tinted canvas — content sections sit on top as white cards (3-tier depth). */
  background: var(--gp-panel-bg);
}
.quickview-dialog::backdrop { background: rgba(14, 58, 90, 0.45); }
.quickview-scroll { max-height: 90vh; overflow-y: auto; }
.quickview-loading { padding: 2rem; text-align: center; color: var(--pico-muted-color); }
.quickview-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--gp-panel-border);
  position: sticky; top: 0; z-index: 1;
  background: var(--pico-card-background-color);   /* white bar over the grey canvas */
  box-shadow: 0 1px 3px rgba(14, 58, 90, 0.06);
}
.quickview-title {
  font-weight: 700; flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--pico-primary);                      /* navy title accent */
}
.quickview-title a { color: var(--pico-primary); }
.quickview-controls { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.quickview-controls .pipeline-edit-form { margin: 0; }
.quickview-close {
  border: none; background: none; font-size: 1.5rem; line-height: 1;
  cursor: pointer; color: var(--pico-muted-color); padding: 0 0.25rem;
}
.quickview-close:hover { color: var(--pico-primary); }
/* Neutralise the drawer's own frame; the canvas comes from the dialog. */
.quickview-body .pipeline-drawer {
  border: none; margin: 0; border-radius: 0; background: transparent;
  padding: 1.1rem;
}
/* Lift the drawer's two columns into white cards on the grey canvas. */
.quickview-body .pipeline-drawer-left,
.quickview-body .pipeline-drawer-right {
  background: var(--pico-card-background-color);
  border: 1px solid var(--gp-panel-border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
}
.quickview-body .pipeline-drawer h5 { color: var(--pico-primary); }

@media (max-width: 700px) {
  .quickview-dialog {
    width: 100vw; max-width: 100vw;
    height: 100dvh; max-height: 100dvh; border-radius: 0;
  }
  .quickview-scroll { max-height: 100dvh; }
}

.pipeline-add-free .add-row-grid { margin-top: 0; }

/* Contact toevoegen — action bar with button-pill disclosure */
.contact-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.75rem 0;
}
.contact-actions-pill { padding: 0.3rem 0.85rem; font-size: 0.8rem; margin: 0 !important; }
.contact-actions-link { font-size: 0.8rem; }

.contact-form-disclosure { margin: 0; }
.contact-form-disclosure > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--pico-primary);
  background: var(--pico-background-color);
  border: 1px solid var(--pico-primary);
  border-radius: var(--pico-border-radius);
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background 120ms ease, color 120ms ease;
}
.contact-form-disclosure > summary::-webkit-details-marker { display: none; }
.contact-form-disclosure > summary::after { display: none; }
.contact-form-disclosure > summary:hover {
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
}
.contact-form-disclosure[open] > summary {
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
}
.contact-form-disclosure > summary > span { font-weight: 700; font-size: 0.95rem; line-height: 1; }
/* When opened inside the action bar, the form panel claims the full row so
   the Lusha/Telefoon links wrap below the form instead of sitting beside it. */
.contact-form-disclosure[open] { flex-basis: 100%; }
.contact-form {
  margin-top: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  background: var(--gp-panel-bg);
  border: 1px solid var(--gp-panel-border);
  border-radius: var(--pico-border-radius);
}
.contact-form .grid { margin-bottom: 0.5rem; }
.contact-form label { margin-bottom: 0.75rem; }
.contact-form small { color: var(--pico-muted-color); }
.contact-form-required {
  color: var(--pico-del-color, #c62828);
  text-decoration: none;
  margin-left: 0.1rem;
}
.contact-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.25rem;
}
.contact-form-actions input[type="submit"] { margin-bottom: 0; width: 100%; }
@media (min-width: 576px) {
  .contact-form-actions input[type="submit"] { width: auto; min-width: 9rem; }
}

/* ── Utility classes (design-system) ──
   Sizes that previously lived as repeated inline styles across views.
   Applied alongside Pico's button/badge classes, e.g. "outline secondary btn-xs". */
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.85rem; margin: 0; }
.btn-xs { padding: 0.25rem 0.6rem; font-size: 0.8rem; margin: 0; }
.badge-sm { font-size: 0.65rem; padding: 0.1rem 0.4rem; }

/* Hide from SIGHT but keep in the accessibility tree. Use this — never
   `display: none` / `visibility: hidden` — whenever text is redundant for
   sighted users but is the only thing naming a control (#86). */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── Atomic utilities (replace repeated inline style= now blocked by CSP) ──
   Numeric suffix = rem value with the decimal dropped: 05 = .5rem, 15 = 1.5rem,
   025 = .25rem, 075 = .75rem, 09 = .9rem. Compose freely, e.g. class="flex-between mb-05". */
/* margin */
.m-0 { margin: 0; }
.mt-05 { margin-top: 0.5rem; } .mt-1 { margin-top: 1rem; } .mt-15 { margin-top: 1.5rem; } .mt-2 { margin-top: 2rem; }
.mt-neg-05 { margin-top: -0.5rem; }
.mb-0 { margin-bottom: 0; } .mb-025 { margin-bottom: 0.25rem; } .mb-035 { margin-bottom: 0.35rem; }
.mb-05 { margin-bottom: 0.5rem; } .mb-075 { margin-bottom: 0.75rem; } .mb-09 { margin-bottom: 0.9rem; }
.mb-1 { margin-bottom: 1rem; } .mb-15 { margin-bottom: 1.5rem; } .mb-2 { margin-bottom: 2rem; }
.ml-02 { margin-left: 0.2rem; } .ml-025 { margin-left: 0.25rem; } .ml-05 { margin-left: 0.5rem; } .ml-auto { margin-left: auto; }
.my-015 { margin: 0.15rem 0 0; }
/* padding */
.p-05 { padding: 0.5rem; } .p-075 { padding: 0.75rem; } .p-1 { padding: 1rem; }
.py-05 { padding: 0.5rem 0; } .py-075 { padding: 0.75rem 0; }
.cell-compact { padding: 4px 8px; }
/* text */
.text-left { text-align: left; } .text-right { text-align: right; } .text-center { text-align: center; }
.text-xs { font-size: 0.8rem; } .text-sm { font-size: 0.85rem; } .text-09 { font-size: 0.9rem; }
.text-13 { font-size: 13px; } .text-14 { font-size: 14px; }
.fw-500 { font-weight: 500; } .fw-600 { font-weight: 600; } .fw-bold { font-weight: bold; } .fw-normal { font-weight: normal; }
.mt-075 { margin-top: 0.75rem; }
.text-muted { color: var(--pico-muted-color); }
.text-danger { color: var(--gp-text-danger); }
.text-warning { color: var(--gp-text-warning); }
.text-nowrap { white-space: nowrap; }
.no-underline { text-decoration: none; }
.lh-16 { line-height: 1.6; }
/* layout */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-end { display: flex; justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.inline-flex { display: inline-flex; align-items: center; }
.items-center { align-items: center; }
.items-end { align-items: end; }
.gap-03 { gap: 0.3rem; } .gap-05 { gap: 0.5rem; } .gap-075 { gap: 0.75rem; } .gap-1 { gap: 1rem; } .gap-15 { gap: 1.5rem; } .gap-2 { gap: 2rem; }
.hidden { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.mt-06 { margin-top: 0.6rem; }
.table-collapse { width: 100%; border-collapse: collapse; }
.relative { position: relative; }
.w-auto { width: auto; }
.maxw-120 { max-width: 120px; }
.flex-1 { flex: 1; } .flex-2 { flex: 2; } .flex-3 { flex: 3; }

/* Icon-only buttons that strip Pico's button chrome (follow / email-alert toggles). */
.icon-btn { all: unset; cursor: pointer; line-height: 1; font-size: 0.85rem; }
.icon-btn-muted { all: unset; cursor: pointer; line-height: 1; font-size: 0.85rem; color: var(--pico-muted-color); }
/* Extra-small delete affordance (contact rows). */
.btn-2xs { padding: 0.1rem 0.4rem; font-size: 0.7rem; margin: 0; }
/* Compact <select> (feedback status/priority). */
.select-compact { padding: 0.2rem 0.4rem; }
/* Inline checkbox in a filter bar (show-archived toggles). */
.checkbox-inline { margin: 0; width: auto; }
/* Native color picker sized down (list form). */
.color-input { width: 3rem; height: 2rem; padding: 0.2rem; }
/* Extra spacing/layout values surfaced by the inline-style sweep. */
.flex-none { flex: 0 0 auto; }
.my-025 { margin: 0.25rem 0; }
.pl-1 { padding-left: 1rem; }
/* Map container (permit show Leaflet map). */
.map-embed { height: 350px; border-radius: 4px; }
/* Micro badge (matched-KBO chip on permit rows). */
.badge-micro { font-size: 0.6rem; padding: 0.1rem 0.3rem; vertical-align: middle; }
/* Narrow modal dialog (outcome dialog). */
.dialog-narrow { min-width: min(26rem, 90vw); }
/* Remaining one-off spacing/layout from the sweep. */
.gap-035 { gap: 0.35rem; }
.maxw-600 { max-width: 600px; }
.p-05-1 { padding: 0.5rem 1rem; }
.py-01 { padding: 0.1rem 0; }
.my-05 { margin: 0.5rem 0; }
.m-0-0-075 { margin: 0 0 0.75rem; }
.flex-basis-full { flex-basis: 100%; }
.text-065 { font-size: 0.65rem; }
/* Semantic text colors (status/emphasis) used across data pages. */
.text-primary { color: var(--pico-primary); }
.text-success { color: var(--gp-text-success); }
.text-error { color: var(--gp-text-danger); }
.text-error-dark { color: #991b1b; }
.panel-box { background: #f1f5f9; padding: 0.75rem; border-radius: 0.5rem; }
.callout { padding: 0.5rem 1rem; background: var(--pico-card-background-color); border-radius: var(--pico-border-radius); }
/* Decorative left-border accent. The slate/purple/teal/gray/green variants went
   with the Info page — they were only ever used by its section cards. */
.border-l-primary { border-left: 3px solid var(--pico-primary); }
/* Type-ahead results dropdown (company-search on nearby / company / permit shows). */
.search-dropdown {
  position: absolute; z-index: 10;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 4px; list-style: none;
  padding: 0; margin: 0; width: 100%;
  max-height: 250px; overflow-y: auto;
}
/* The rows are built in JS; the CSP blocks inline style attributes, so their
   styling has to live here (company_search_controller). */
.search-dropdown-empty {
  padding: 0.5rem;
  color: var(--pico-muted-color);
}
.search-dropdown-link {
  display: block;
  padding: 0.4rem 0.5rem;
  text-decoration: none;
}
.cursor-pointer { cursor: pointer; }
.maxw-40 { max-width: 40rem; }
.w-full { width: 100%; }

/* Status <select> styled as an inline badge (EPB / FAVV / followed rows).
   Color comes from the accompanying badge badge-<status> class. */
.badge-select { padding: 0.15rem 0.5rem; margin: 0; border: none; font-size: 0.8rem; cursor: pointer; }

/* Conditional row dimming (e.g. deactivated users). */
.row-inactive { opacity: 0.5; }

/* Cooling refrigerant chips (shared/_cooling_tag). :sm reuses .badge-sm sizing. */
.cooling-tag { margin-left: 0.25rem; }
.cooling-tag-md { font-size: 0.75rem; padding: 0.2rem 0.55rem; }

/* AI cooling-verdict badge (shared/_company_analysis_body) — finite verdict set,
   so a class per verdict rather than an inline (blocked) dynamic background. */
.verdict-badge { color: #fff; }
.verdict-ja { background: #059669; }
.verdict-onzeker { background: #b45309; }
.verdict-nee { background: #b91c1c; }
.verdict-unknown { background: #64748b; }
.mt-035 { margin-top: 0.35rem; }

/* Verdict as TEXT in the score breakdown — the badge classes above paint a
   background and rely on .verdict-badge for white text, which would leave dark
   text on red here. These are the 4.5:1-on-panel text tints (see the
   text-colour contrast rule); the brighter badge fills stay for fills only. */
.score-breakdown-value.verdict-score-ja { color: var(--gp-text-success); }
.score-breakdown-value.verdict-score-onzeker { color: var(--gp-text-warning); }
.score-breakdown-value.verdict-score-nee { color: var(--gp-text-danger); }

/* "The AI changed its mind" banner — companies/_cooling_verdict_review. */
.verdict-review {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-left: 3px solid var(--gp-text-warning);
  border-radius: 0.5rem;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.75rem;
}
.verdict-review-title { margin: 0 0 0.35rem; font-size: 0.92rem; font-weight: 600; }
.verdict-review-from { color: var(--pico-muted-color); }
.verdict-review-title .verdict-badge {
  display: inline-block; padding: 0.05rem 0.45rem;
  font-size: 0.8rem; border-radius: 9999px;
}
.verdict-review-why { margin: 0 0 0.35rem; font-size: 0.86rem; line-height: 1.5; }
.verdict-review-note { margin: 0 0 0.5rem; font-size: 0.82rem; }
.verdict-review-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.verdict-review-actions form { margin: 0; width: auto; display: inline-flex; }
.verdict-review-actions button { width: auto; margin: 0; }

/* AI analysis card (shared/_company_analysis_body + analysis frames). */
.analysis-body { font-size: 0.9rem; line-height: 1.6; }
.analysis-list { margin: 0.25rem 0 0; padding-left: 1.1rem; }
.analysis-sources { margin: 0.35rem 0 0; padding-left: 1.1rem; font-size: 0.85rem; }
.chip-panel { background: var(--gp-panel-bg); border: 1px solid var(--gp-panel-border); color: var(--pico-color); }
.callout-hook { padding: 0.55rem 0.7rem; background: var(--gp-panel-bg); border-left: 3px solid #74BE00; border-radius: 4px; }

/* Busy feedback for Turbo form submissions: aria-busy is set/cleared by the
   global turbo:submit-start/-end listeners in controllers/application.js.
   pointer-events blocks double-submits while the request is in flight. */
form[aria-busy="true"] { opacity: 0.6; pointer-events: none; }

/* ── Show-page header (company cockpit) ──
   Title row: h1 + reference chips (Companyweb) side by side. The lead ACTIONS
   (status / volgen / lijst) live in .lead-action-bar above the Reacties feed,
   so changing a status sits next to writing down why. */
.show-header-row {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
}
.show-header-row h1 { margin-bottom: 0; }

/* Score block in the top-right corner of the title row. */
.show-score {
  margin-left: auto;
  display: flex; flex-direction: column; align-items: center;
  line-height: 1; flex-shrink: 0;
  padding: 0.3rem 1rem;
  background: var(--gp-panel-bg);
  border: 1px solid var(--gp-panel-border);
  border-radius: 10px;
}
.show-score-label {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--pico-muted-color);
  margin-bottom: 0.15rem;
}
.show-score-value { font-size: 2.6rem; font-weight: 700; font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

/* Chip row under the title (cooling tags + list memberships). */
.show-chips {
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
  margin: 0.5rem 0 0.75rem;
}

/* Navy reference chip next to the page title (external lookups). */
.title-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.8rem; font-weight: 600; white-space: nowrap;
  padding: 0.25rem 0.7rem; border-radius: 999px;
  background: #e7edf2; color: #0E3A5A; border: 1px solid #b9ccd8;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.title-chip:hover { background: #0E3A5A; color: #fff; border-color: #0E3A5A; }

/* Action bar above the comments feed (status select + volgen + lijst). */
.lead-action-bar {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  padding-bottom: 0.75rem; margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}
.lead-action-bar form { margin: 0; }
.lead-action-bar-label {
  font-size: 0.82rem; font-weight: 600; color: #475569;
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-right: 0.25rem;
}

/* Segmented status control (Apple HIG pattern: all options visible, current
   segment filled in its status color, one tap to switch). Radios are visually
   hidden but keyboard-focusable; outcome-guard intercepts the rejected segment. */
.status-segmented {
  display: inline-flex;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 8px;
  overflow: hidden;
  background: var(--pico-card-background-color);
}
.status-segment {
  position: relative;
  display: inline-flex; align-items: center;
  margin: 0; padding: 0.35rem 0.85rem;
  font-size: 0.8rem; font-weight: 600;
  color: var(--pico-muted-color);
  cursor: pointer; user-select: none; white-space: nowrap;
  border-right: 1px solid var(--pico-muted-border-color);
  transition: background 0.15s, color 0.15s;
}
.status-segment:last-child { border-right: none; }
.status-segment:hover { background: var(--gp-panel-bg); color: var(--pico-color); }
.status-segment input[type="radio"] {
  position: absolute; opacity: 0; pointer-events: none;
  width: 1px; height: 1px; margin: 0;
}
.status-segment:has(input:focus-visible) { outline: 2px solid var(--pico-primary); outline-offset: -2px; }
.status-segment-new:has(input:checked)      { background: #dbeafe; color: #1e40af; }
.status-segment-approved:has(input:checked) { background: #d1fae5; color: #065f46; }
.status-segment-rejected:has(input:checked) { background: #fee2e2; color: #991b1b; }

/* Quiet external link inside an action cluster (HubSpot). */
.toolbar-link {
  font-size: 0.8rem; color: var(--pico-muted-color);
  text-decoration: none; white-space: nowrap;
}
.toolbar-link:hover { color: var(--pico-primary); }

/* List-membership chips: rendered inline in the meta line under the title. */
.membership-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.15rem 0.6rem; border-radius: 9999px;
  font-size: 0.72rem; font-weight: 600; vertical-align: middle;
  background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
  text-decoration: none;
}
.membership-chip:hover { border-color: var(--pico-primary); color: var(--pico-primary); }
.membership-chip-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; flex-shrink: 0; }

/* ── Mobile overrides ──
   Kept at the END of the file: most rules below override base rules defined
   earlier with the same specificity, so they must come last in the cascade.
   Everything here is scoped to small viewports or touch-only devices and
   leaves the desktop rendering untouched. */

/* Two-column block that collapses on small screens (scrape logs, etc.). */
.grid-2col { grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .grid-2col { grid-template-columns: 1fr; } }

/* Touch devices: text fields under 16px make iOS Safari zoom in on focus and
   stay zoomed. Bump form controls to 16px wherever the primary input is touch;
   desktop (hover-capable) keeps the compact sizing. !important so this a11y
   floor also beats higher-specificity compact-font rules and inline styles. */
@media (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select, textarea {
    font-size: 16px !important;
  }
}

@media (max-width: 640px) {
  th, td { padding: 0.45rem 0.5rem; }

  /* Filter bar: tidy two-per-row controls instead of ragged intrinsic widths. */
  .filters > select, .filters > input { flex: 1 1 calc(50% - 0.25rem); min-width: 0; }
  .filters > .filters-search, .filters > .filters-wide { flex: 1 1 100%; min-width: 0; }

  /* ICP chips stay chips on mobile — they wrap to more lines rather than
     becoming a full-width list, which would push the table off-screen. */
  .icp-chips { gap: 0.25rem; }
  .icp-chip > span { font-size: 0.75rem; padding: 0.2rem 0.5rem; }

  /* Permits + koeltype stack on a phone; a half-width permits table is unusable. */
  .overzicht-split { grid-template-columns: 1fr; }

  /* Company card: the score would otherwise crowd the name on a narrow screen. */
  .permit-company-head { flex-direction: column; }
  .permit-company-score { font-size: 1.3rem; }

  /* The three action groups can't sit side by side on a phone — let them wrap
     and swap the dividing rules from vertical to horizontal. */
  .action-bar { flex-wrap: wrap; justify-content: flex-start; }
  .action-group { padding: 0.4rem 0; flex: 1 1 100%; }
  .action-group + .action-group {
    border-left: none;
    border-top: 1px solid var(--gp-panel-border);
  }

  /* Prospect rows (Gevolgd): let the summary wrap; the contact preview is
     redundant with the expanded panel, drop it to save the line. */
  .prospect-summary { flex-wrap: wrap; row-gap: 0.35rem; position: relative; padding-right: 2.25rem; }
  .prospect-expand-icon { position: absolute; right: 0.75rem; top: 0.95rem; }
  .prospect-main { flex: 1 1 calc(100% - 3.5rem); }
  .prospect-contact-preview { display: none; }
  .prospect-signals { flex: 0 1 auto; }
  .prospect-detail-grid { grid-template-columns: 1fr; gap: 1rem; }
  .prospect-detail-open { max-height: none; }

  /* Kanban: one column per swipe instead of a 1200px-wide grid. */
  .kanban-board {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 80vw;
    scroll-snap-type: x proximity;
    padding-bottom: 0.5rem;
  }
  .kanban-column { scroll-snap-align: start; }

  .add-row-grid { grid-template-columns: 1fr; }
  .pipeline-kpis { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 520px) {
  /* Bulk action bar: full-width and wrappable so it never overflows. */
  .bulk-bar {
    left: 0.75rem; right: 0.75rem; transform: none;
    white-space: normal; flex-wrap: wrap; justify-content: center;
    bottom: -12rem;
  }
  .bulk-bar-visible { bottom: 0.75rem; }
  .bulk-bar-select { min-width: 0; flex: 1 1 auto; }
}

@media (max-width: 900px) {
  /* Permits + koeltype: a half-width permits table stops being readable well
     before the 640px phone breakpoint, so this one collapses earlier. */
  .overzicht-split { grid-template-columns: 1fr; }
}

/* ── To-dos (per-lead block + "Mijn taken" inbox) ── */
/* scroll-margin clears the sticky cockpit when "+ Taak" scrolls the composer
   into view (jump_to_controller). */
.todos-section { margin-top: 1rem; scroll-margin-top: 9rem; }
.todo-composer-title { scroll-margin-top: 9rem; }
.todo-list { list-style: none; margin: 0; padding: 0; }
/* The <li> carries spacing and state; the grid lives on the view half so the
   edit form can take the full row width when it is swapped in. */
.todo-row {
  padding: 0.5rem 0; border-bottom: 1px solid var(--gp-panel-border);
}
.todo-row-view {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: start; gap: 0.5rem;
}
.todo-row:last-child { border-bottom: none; }
.todo-actions { display: flex; align-items: center; gap: 0.15rem; }
.todo-edit-btn {
  width: auto; margin: 0; padding: 0 0.2rem;
  background: none; border: none; font-size: 0.9rem; line-height: 1;
  color: var(--pico-muted-color); cursor: pointer;
}
.todo-edit-btn:hover { background: none; color: var(--pico-primary); }
/* Pico stretches every <button> to full width; the two form buttons must not. */
.todo-edit-form button { width: auto; margin: 0; }
.todo-row-done .todo-title { text-decoration: line-through; color: var(--pico-muted-color); }
.todo-row-overdue { background: #fffbeb; }
.todo-check {
  width: auto; margin: 0; padding: 0 0.15rem;
  background: none; border: none; font-size: 1.1rem; line-height: 1;
  color: var(--pico-primary); cursor: pointer;
}
.todo-check:hover { background: none; color: var(--pico-primary-hover); }
.todo-body { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.todo-title { font-size: 0.9rem; }
.todo-meta { font-size: 0.78rem; color: var(--pico-muted-color); }
.todo-due-overdue { color: var(--gp-text-danger); font-weight: 600; }
.todo-owner {
  display: inline-block; padding: 0 0.3rem; border-radius: 9999px;
  background: var(--gp-panel-bg); font-weight: 600;
}
.todo-source { color: var(--pico-muted-color); }
.todo-empty { padding: 0.75rem 0; font-size: 0.85rem; color: var(--pico-muted-color); font-style: italic; }
.todo-done > summary { font-size: 0.8rem; color: var(--pico-muted-color); cursor: pointer; padding: 0.4rem 0; }
.todo-delete { padding: 0 0.2rem; }

.todo-composer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
  margin: 0.6rem 0 0; padding-top: 0.6rem;
  border-top: 1px solid var(--gp-panel-border);
}
.todo-composer input, .todo-composer select { margin: 0; font-size: 0.85rem; }
.todo-composer button { width: auto; margin: 0; }
.todo-composer-title { flex: 3; min-width: 180px; }
.todo-composer-date { flex: 1; min-width: 140px; }
.todo-composer-owner { flex: 1; min-width: 130px; }

/* Inbox rows carry the lead name, so give them a little more air. */
.todo-inbox .todo-row { padding: 0.7rem 0; }
