@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap");

:root,
[data-theme="dark"] {
  /* Koeler donker palet: meer contrast tussen vlakken en tekst */
  --bg: #0b0f16;
  --bg-soft: #070a10;
  --panel: #151b26;
  --panel-2: #1e2636;
  --item-bg: #121821;
  --input-bg: #0b0f16;
  --sidebar-bg: #080b11;
  --ink: #f8fafc;
  --muted: #cbd5e1;
  --line: #3a4558;
  --label: #e8edf5;
  --heading: #ffffff;
  --brand: #fb923c;
  --brand-dark: #f97316;
  --accent: #c4e86a;
  --accent-light: #34d399;
  --danger: #fca5a5;
  --ok: #6ee7b7;
  --btn-text: #0b0f16;
  --nav-text: #cbd5e1;
  --badge-bg: #243041;
  --badge-text: #f1f5f9;
  --placeholder: #8b95a8;
  --auth-bg: linear-gradient(180deg, #070a10, #0b0f16 40%, #151b26);
  --page-glow: radial-gradient(ellipse 60% 40% at 50% -10%, rgba(251, 146, 60, 0.14), transparent 60%);
  --gradient: linear-gradient(90deg, var(--brand) 0%, var(--accent) 100%);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  --radius: 16px;
  --attention-title: #fff;
  --attention-text: #fdba74;
  --theme-toggle-bg: #151b26;
  font-family: Inter, system-ui, sans-serif;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f4f4f5;
  --bg-soft: #fafafa;
  --panel: #ffffff;
  --panel-2: #f4f4f5;
  --item-bg: #ffffff;
  --input-bg: #ffffff;
  --sidebar-bg: #ffffff;
  --ink: #18181b;
  --muted: #71717a;
  --line: #e4e4e7;
  --label: #52525b;
  --heading: #09090b;
  --danger: #dc2626;
  --ok: #16a34a;
  --btn-text: #09090b;
  --nav-text: #52525b;
  --badge-bg: #f4f4f5;
  --badge-text: #3f3f46;
  --placeholder: #a1a1aa;
  --auth-bg: linear-gradient(180deg, #fff7ed, #f4f4f5 45%, #ffffff);
  --page-glow: radial-gradient(ellipse 60% 40% at 50% -10%, rgba(249, 115, 22, 0.1), transparent 60%);
  --shadow: 0 18px 40px rgba(24, 24, 27, 0.08);
  --attention-title: #9a3412;
  --attention-text: #c2410c;
  --theme-toggle-bg: #ffffff;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--page-glow), var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

::placeholder {
  color: var(--placeholder);
}

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(249, 115, 22, 0.18), transparent 40%),
    radial-gradient(circle at bottom right, rgba(189, 226, 85, 0.12), transparent 35%),
    var(--auth-bg);
}

.auth-wrap {
  position: relative;
}

.auth-card,
.panel,
.stat,
.item,
.empty-box,
.pipe-stage,
.search-results {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(100%, 420px);
  padding: 28px;
  position: relative;
}

.auth-card .brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.auth-card .brand-mark {
  width: auto;
  max-width: 11rem;
  height: auto;
  max-height: 4.5rem;
  object-fit: contain;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
  min-width: 0;
}

.brand-mark {
  width: auto;
  height: 58px;
  max-width: 192px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  background: transparent;
  padding: 0;
  flex-shrink: 0;
}

.brand>div {
  min-width: 0;
}

.brand strong {
  display: block;
  letter-spacing: .12em;
  color: var(--heading);
}

.brand span {
  display: block;
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Sidebar: logo only — text overflows the 260px column next to a wide logo */
.sidebar .brand {
  width: 100%;
  gap: 0;
}

.sidebar .brand>div {
  display: none;
}

.sidebar .brand-mark {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 70px;
}

.eyebrow {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1 {
  margin: 8px 0 6px;
  font-size: 28px;
  color: var(--heading);
}

.sub {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

label {
  display: block;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--label);
}

input,
select,
textarea {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

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

textarea.note-detail-editor {
  min-height: 280px;
  white-space: pre-wrap;
  line-height: 1.5;
  font-family: inherit;
  tab-size: 2;
}

option {
  background: var(--panel);
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--gradient);
  color: var(--btn-text);
  font-weight: 800;
}

.btn:hover {
  filter: brightness(1.05);
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  filter: none;
  background: color-mix(in srgb, var(--muted, #94a3b8) 22%, var(--panel, #fff));
  color: var(--label, #e8edf5);
  border-color: var(--line);
}

[data-theme="dark"] .btn:disabled {
  opacity: .7;
  background: color-mix(in srgb, var(--panel-2) 80%, var(--line));
  color: #e2e8f0;
}

.btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn.secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn.ghost {
  background: transparent;
  color: var(--brand);
  width: auto;
  padding: 0;
  box-shadow: none;
}

.btn.small {
  width: auto;
  padding: 8px 12px;
  font-size: 13px;
}

.btn.danger {
  background: #7f1d1d;
  color: #fecaca;
}

.btn.danger:hover {
  background: #991b1b;
  filter: none;
}

[data-theme="light"] .btn.danger {
  background: #fee2e2;
  color: #991b1b;
}

[data-theme="light"] .btn.danger:hover {
  background: #fecaca;
}

.error {
  margin: 0 0 12px;
  color: var(--danger);
  font-size: 13px;
}

.ok {
  margin: 0 0 12px;
  color: var(--ok);
  font-size: 13px;
}

.invite-result {
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-2, var(--bg));
}

.invite-result.mail-ok {
  border-color: color-mix(in srgb, var(--ok) 45%, var(--line));
  background: color-mix(in srgb, var(--ok) 8%, transparent);
}

.invite-result.mail-fail {
  border-color: color-mix(in srgb, var(--warn, #d97706) 45%, var(--line));
  background: color-mix(in srgb, var(--warn, #d97706) 8%, transparent);
}

.invite-result-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.invite-link-label {
  display: block;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.invite-link-input {
  margin-top: 6px;
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--theme-toggle-bg);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.theme-toggle:hover {
  border-color: var(--brand);
}

.theme-toggle .icon {
  font-size: 14px;
  line-height: 1;
}

.auth-theme-toggle {
  position: absolute;
  top: 18px;
  right: 18px;
}

.mobile-bar,
.sidebar-backdrop,
.menu-close {
  display: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--brand) 7%, transparent), transparent 140px),
    var(--sidebar-bg);
  border-right: 1px solid var(--line);
  color: var(--ink);
  padding: 16px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  padding: 0 4px 4px;
}

.sidebar-head .brand {
  margin: 0;
}

.sidebar .brand {
  margin-bottom: 0;
}

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

.sidebar .brand-mark {
  max-height: 52px;
}

.nav {
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
  overflow-y: auto;
  align-content: start;
  min-height: 0;
  padding: 0 2px 4px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--line) 80%, transparent) transparent;
}

.nav-link {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--nav-text);
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

.nav-link .nav-link-label {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-ico {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  opacity: 0.72;
}

.nav-link:hover {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  color: var(--heading);
}

.nav-link:hover .nav-ico {
  opacity: 1;
}

.nav-link.active {
  background: color-mix(in srgb, var(--brand) 16%, var(--panel));
  color: var(--heading);
  box-shadow: inset 2px 0 0 var(--brand);
}

.nav-link.active .nav-ico {
  opacity: 1;
  color: var(--brand);
}

.nav-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--gradient);
  color: var(--btn-text);
  font-size: 10px;
  font-weight: 800;
  margin-left: auto;
  animation: pulse-badge 1.6s ease-out infinite;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  flex-shrink: 0;
  margin-top: auto;
  padding: 12px 10px 8px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--sidebar-bg) 88%, var(--panel));
  border-radius: 14px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--btn-text);
  background: var(--gradient);
}

.sidebar-user-meta {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.sidebar-user-meta strong {
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-meta span {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sidebar-footer-actions .theme-toggle,
.sidebar-footer-actions .sidebar-logout {
  width: 100%;
  justify-content: center;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.attention-banner {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(249, 115, 22, 0.45);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.18), rgba(189, 226, 85, 0.12));
  box-shadow: 0 10px 30px rgba(249, 115, 22, 0.12);
  animation: attention-glow 2s ease-in-out infinite;
}

.attention-banner strong {
  display: block;
  font-size: 16px;
  color: var(--attention-title);
}

.attention-banner p {
  margin: 4px 0 0;
  color: var(--attention-text);
  font-size: 13px;
}

.attention-banner .btn {
  width: auto;
}

.item.task-urgent {
  border: 1px solid rgba(249, 115, 22, 0.5);
  background: rgba(249, 115, 22, 0.08);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.item.task-in-progress {
  border: 1px solid rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.item[data-task-id] {
  scroll-margin-top: 88px;
}

.item.task-new {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    var(--gradient) border-box;
  box-shadow: 0 0 0 4px rgba(189, 226, 85, 0.12);
  animation: task-pulse 1.8s ease-in-out infinite;
}

.badge.new-task {
  background: var(--gradient);
  color: var(--btn-text);
  letter-spacing: .04em;
  animation: pulse-badge 1.4s ease-out infinite;
}

.badge.action-needed {
  background: var(--brand);
  color: #fff;
}

@keyframes pulse-badge {
  0% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.75);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(249, 115, 22, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
  }
}

@keyframes attention-glow {

  0%,
  100% {
    box-shadow: 0 10px 30px rgba(249, 115, 22, 0.12);
  }

  50% {
    box-shadow: 0 12px 36px rgba(189, 226, 85, 0.18);
  }
}

@keyframes task-pulse {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-1px);
    box-shadow: 0 0 0 6px rgba(249, 115, 22, 0.16);
  }
}

.main {
  padding: 22px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.userchip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.searchbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1 1 240px;
  min-width: min(100%, 220px);
  max-width: 420px;
}

.searchbar input {
  margin: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--panel);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.stats {
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
}

.grid.two {
  grid-template-columns: 1.1fr .9fr;
}

/* Klanten & leads: formulier eerst (gsm), sticky op desktop; lijst scrollt apart */
.companies-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: start;
}

.companies-form-panel {
  position: sticky;
  top: 12px;
  z-index: 2;
  /* Sticky + lang Lead-doorsturen-formulier: zonder max-height/overflow
     verdwijnen de onderste velden onder de viewport en kun je niet scrollen. */
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.companies-list-scroll {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

@media (max-width: 1100px) {
  .companies-layout {
    grid-template-columns: 1fr;
  }

  .companies-form-panel {
    position: relative;
    top: auto;
    z-index: auto;
  }

  .companies-list-scroll {
    max-height: min(55vh, 420px);
  }
}

.leads-busy {
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, #c27803 35%, var(--line));
  background: color-mix(in srgb, #c27803 8%, var(--panel));
}

.leads-busy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.company-work-line {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: color-mix(in srgb, #c27803 70%, var(--ink));
}

.company-busy {
  border-color: color-mix(in srgb, #c27803 40%, var(--line));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat,
.panel {
  padding: 18px;
}

.stat {
  --stat-accent: var(--brand);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 16px 14px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--stat-accent), color-mix(in srgb, var(--stat-accent) 30%, transparent));
}

.stat:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--stat-accent) 45%, var(--line));
  box-shadow:
    var(--shadow),
    0 0 0 1px color-mix(in srgb, var(--stat-accent) 12%, transparent);
}

.stat.tone-brand {
  --stat-accent: var(--brand);
}

.stat.tone-accent {
  --stat-accent: var(--accent-light);
}

.stat.tone-ok {
  --stat-accent: var(--ok);
}

.stat.tone-warn {
  --stat-accent: #f59e0b;
}

.stat.tone-danger {
  --stat-accent: var(--danger);
}

.stat.tone-neutral {
  --stat-accent: #94a3b8;
}

.stat.tone-info {
  --stat-accent: #3b82f6;
}

.stat.tone-violet {
  --stat-accent: #a855f7;
}

.stat.is-alert,
.stat.active {
  border-color: color-mix(in srgb, var(--stat-accent) 55%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--stat-accent) 12%, var(--panel)), var(--panel));
}

.stat.active {
  box-shadow:
    var(--shadow),
    0 0 0 1px color-mix(in srgb, var(--stat-accent) 22%, transparent);
}

button.stat {
  width: 100%;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

button.stat:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--stat-accent) 70%, transparent);
  outline-offset: 2px;
}

.stat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--stat-accent);
  background: color-mix(in srgb, var(--stat-accent) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--stat-accent) 18%, transparent);
}

.stat-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.stat strong {
  display: block;
  font-size: 1.7rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--heading);
}

.stat .stat-head>span:last-child,
.stat>span,
.stat .stat-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .02em;
  line-height: 1.3;
}

.stat .stat-hint {
  margin-top: -4px;
}

.panel h2,
.muted {
  color: var(--muted);
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.panel-head h2 {
  margin: 0;
}

.list {
  display: grid;
  gap: 10px;
}

.item {
  padding: 14px;
  box-shadow: none;
  background: var(--item-bg);
}

.item-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.activity-card {
  padding: 0;
  overflow: hidden;
}

.activity-card-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 14px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.activity-card-toggle:hover {
  background: color-mix(in srgb, var(--brand, #f97316) 6%, transparent);
}

.activity-card-toggle-main {
  min-width: 0;
  flex: 1;
}

.activity-card-toggle-main h3 {
  margin: 0;
}

.activity-card-toggle .meta {
  margin-top: 8px;
}

.activity-card-preview {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.activity-card-toggle .hub-tile-chevron {
  flex-shrink: 0;
  margin-top: 4px;
}

.activity-card.open .activity-card-toggle .hub-tile-chevron {
  transform: rotate(180deg);
}

.activity-card-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}

.activity-card-actions {
  margin-top: 4px;
}

.item h3 {
  margin: 0;
  font-size: 15px;
  color: var(--heading);
}

.item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 11px;
  font-weight: 800;
}

.badge.lifecycle-active {
  background: rgba(34, 197, 94, 0.18);
  color: #15803d;
}

[data-theme="dark"] .badge.lifecycle-active {
  color: #86efac;
}

.badge.lifecycle-completed {
  background: rgba(59, 130, 246, 0.18);
  color: #1d4ed8;
}

[data-theme="dark"] .badge.lifecycle-completed {
  color: #93c5fd;
}

.badge.lifecycle-archived {
  background: rgba(113, 113, 122, 0.2);
  color: #52525b;
}

[data-theme="dark"] .badge.lifecycle-archived {
  color: #a1a1aa;
}

.badge.open {
  background: rgba(249, 115, 22, 0.2);
  color: #c2410c;
}

[data-theme="dark"] .badge.open {
  color: #fdba74;
}

.badge.prospect {
  background: rgba(100, 116, 139, 0.22);
  color: #475569;
}

[data-theme="dark"] .badge.prospect {
  color: #cbd5e1;
}

.badge.gepland {
  background: rgba(14, 165, 233, 0.18);
  color: #0369a1;
}

[data-theme="dark"] .badge.gepland {
  color: #7dd3fc;
}

.badge.in_progress,
.badge.offerte {
  background: rgba(59, 130, 246, 0.2);
  color: #1d4ed8;
}

[data-theme="dark"] .badge.in_progress,
[data-theme="dark"] .badge.offerte {
  color: #93c5fd;
}

.badge.onderhandeling {
  background: rgba(139, 92, 246, 0.2);
  color: #6d28d9;
}

[data-theme="dark"] .badge.onderhandeling {
  color: #c4b5fd;
}

.badge.gewonnen {
  background: rgba(249, 115, 22, 0.2);
  color: #c2410c;
}

[data-theme="dark"] .badge.gewonnen {
  color: #fdba74;
}

.badge.uitvoering {
  background: rgba(20, 184, 166, 0.18);
  color: #0f766e;
}

[data-theme="dark"] .badge.uitvoering {
  color: #5eead4;
}

.badge.oplevering {
  background: rgba(52, 211, 153, 0.18);
  color: #047857;
}

[data-theme="dark"] .badge.oplevering {
  color: #6ee7b7;
}

.badge.done,
.badge.pid_compleet {
  background: rgba(189, 226, 85, 0.22);
  color: #4d7c0f;
}

[data-theme="dark"] .badge.done,
[data-theme="dark"] .badge.pid_compleet {
  color: var(--accent);
}

.badge.cancelled,
.badge.verloren,
.badge.high {
  background: rgba(248, 113, 113, 0.18);
  color: #b91c1c;
}

.badge.pid-missing {
  background: rgba(248, 113, 113, 0.16);
  color: #b91c1c;
}

.badge.pid-ok {
  background: rgba(59, 130, 246, 0.18);
  color: #1d4ed8;
}

.badge.pid-verified {
  background: rgba(189, 226, 85, 0.22);
  color: #4d7c0f;
}

[data-theme="dark"] .badge.pid-ok {
  color: #93c5fd;
}

[data-theme="dark"] .badge.pid-verified {
  color: var(--accent);
}

.badge.comm {
  background: rgba(249, 115, 22, 0.15);
  color: #c2410c;
}

[data-theme="dark"] .badge.comm {
  background: rgba(249, 115, 22, 0.22);
  color: #fdba74;
}

.quick-comm {
  display: flex;
  gap: 6px;
  align-items: center;
}

.quick-comm input {
  width: 96px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

[data-theme="dark"] .badge.cancelled,
[data-theme="dark"] .badge.verloren,
[data-theme="dark"] .badge.high {
  color: #fca5a5;
}

[data-theme="dark"] .badge.pid-missing {
  color: #fca5a5;
}

.badge.low {
  background: var(--badge-bg);
  color: var(--muted);
}

.empty-box {
  padding: 28px;
  text-align: center;
  box-shadow: none;
  background: var(--item-bg);
}

.empty-box h3 {
  margin: 0 0 8px;
  color: var(--heading);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.form-actions .btn {
  width: auto;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filters button {
  border: 1px solid var(--line);
  background: var(--input-bg);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.filters button.active {
  background: var(--gradient);
  color: var(--btn-text);
  border-color: transparent;
}

.filters-label {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  align-self: center;
}

.date-filter-input {
  border: 1px solid var(--line);
  background: var(--input-bg);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--ink);
  font-size: 12px;
  font-family: inherit;
  color-scheme: dark;
  width: auto;
}

[data-theme="light"] .date-filter-input {
  color-scheme: light;
  background: #fff;
  color: #18181b;
  border-color: #d4d4d8;
}

.delete-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* Opvolgpaneel per opdracht */
.task-workbench {
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: 12px;
  margin-top: 12px;
  background: rgba(59, 130, 246, 0.06);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.task-workbench-rep {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--brand) 8%, transparent), transparent 120px),
    var(--panel);
  box-shadow: var(--shadow);
}

.task-workbench-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.task-workbench-rep .task-workbench-head {
  border-bottom-color: var(--line);
  padding: 14px 16px;
}

.task-workbench-head strong {
  font-size: 14px;
}

.task-workbench-head-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.task-workbench-lead {
  color: var(--brand);
}

.task-work-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(280px, 1.05fr);
  grid-template-areas:
    "customer action"
    "timeline timeline";
  gap: 14px;
  align-items: start;
}

.task-work-customer {
  grid-area: customer;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--item-bg);
}

.task-work-action {
  grid-area: action;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--item-bg);
}

.task-work-timeline {
  grid-area: timeline;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--item-bg);
}

.task-work-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.task-work-section-head h3,
.task-work-section-head h4 {
  margin: 0;
  font-size: 15px;
}

.task-work-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 12px;
  font-size: 13px;
}

.task-work-link-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--brand) 45%, var(--line));
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}

.task-work-link-banner p {
  margin: 0;
  font-size: 13px;
}

.task-link-company-form {
  display: grid;
  gap: 8px;
}

.task-company-form,
.task-contact-form {
  display: grid;
  gap: 8px;
}

.task-work-contacts {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.task-work-contact-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.task-work-contact-list li {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 80%, var(--brand) 4%);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  font-size: 13px;
}

.task-work-contact-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.task-work-contact-row>div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.task-tl-list {
  display: grid;
  gap: 0;
}

.task-tl-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  padding: 0 0 14px;
}

.task-tl-item:last-child {
  padding-bottom: 0;
}

.task-tl-rail {
  position: relative;
  width: 10px;
  margin: 4px auto 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 55%, var(--line));
  min-height: 100%;
}

.task-tl-rail::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

.task-tl-item.planned .task-tl-rail {
  background: color-mix(in srgb, #f59e0b 45%, var(--line));
}

.task-tl-item.planned .task-tl-rail::before {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.task-tl-body {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
}

.task-tl-item.planned .task-tl-body {
  border-style: dashed;
  background: color-mix(in srgb, #f59e0b 8%, var(--panel));
}

.task-tl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin-bottom: 4px;
  font-size: 12px;
}

.task-tl-body strong {
  display: block;
  font-size: 14px;
}

.task-tl-body p {
  margin: 4px 0 0;
  font-size: 13px;
}

.task-work-extra {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: color-mix(in srgb, var(--item-bg) 70%, transparent);
}

.task-work-extra>summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  list-style: none;
}

.task-work-extra>summary::-webkit-details-marker {
  display: none;
}

.task-work-extra[open]>summary {
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .task-work-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "customer"
      "action"
      "timeline";
  }
}

.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.day-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.9fr);
  gap: 16px;
  align-items: start;
}

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

.day-layout-monitor .day-entry-side {
  max-width: 640px;
}

.day-entry-details>summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.day-entry-details>summary::-webkit-details-marker {
  display: none;
}

.day-entry-details>summary::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.55;
  vertical-align: 0.1em;
}

.day-entry-details[open]>summary::before {
  transform: rotate(45deg);
}

.day-toolbar {
  margin-bottom: 8px;
}

.day-hours-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 6%, var(--item-bg, #fff));
}

.day-hours-stat {
  display: grid;
  gap: 2px;
}

.day-hours-stat strong {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
}

.day-hours-hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
}

@media (max-width: 640px) {
  .day-hours-summary {
    grid-template-columns: 1fr;
  }
}

.day-timeline {
  display: grid;
  gap: 10px;
}

.day-item {
  display: grid;
  grid-template-columns: minmax(72px, 96px) 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--item-bg);
}

.day-item.planned {
  border-style: dashed;
  background: color-mix(in srgb, #1e3a5f 8%, var(--item-bg));
}

.day-time {
  font-weight: 800;
  font-size: 13px;
  line-height: 1.25;
  color: var(--ink);
}

.day-item-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}

.day-item-top strong {
  flex: 1 1 auto;
  min-width: 0;
}

.day-edit,
.day-delete {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.day-edit {
  margin-left: auto;
}

.day-edit:hover {
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  background: color-mix(in srgb, var(--brand) 8%, transparent);
}

.day-delete:hover {
  color: var(--danger, #b42318);
  border-color: color-mix(in srgb, var(--danger, #b42318) 40%, var(--line));
  background: color-mix(in srgb, var(--danger, #b42318) 8%, transparent);
}

.day-item.editing {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
}

.day-edit-form {
  display: grid;
  gap: 8px;
}

.day-detail {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  white-space: pre-wrap;
}

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

.team-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.team-status-chip {
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--item-bg);
  color: var(--ink);
  cursor: pointer;
  min-width: 120px;
}

.team-status-chip strong {
  font-size: 13px;
}

.team-status-chip span {
  font-size: 12px;
  color: var(--muted);
}

.team-status-chip:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
}

.team-status-chip.active {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  background: color-mix(in srgb, var(--brand) 10%, var(--item-bg));
}

.team-status-chip.has-late span {
  color: #b45309;
  font-weight: 600;
}

.task-admin-more {
  margin-top: 10px;
}

.task-admin-more>summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  list-style: none;
  user-select: none;
}

.task-admin-more>summary::-webkit-details-marker {
  display: none;
}

.task-admin-more>summary::after {
  content: " ▾";
}

.task-admin-more[open]>summary::after {
  content: " ▴";
}

.task-admin-more .form-actions {
  margin-top: 8px;
}

.task-last-act {
  margin: 6px 0 0;
  font-size: 13px;
}

.item.task-overdue-admin {
  border-color: color-mix(in srgb, #b45309 45%, var(--line));
}

.task-control-workbench {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
}

.task-message-form {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--brand) 6%, var(--item-bg));
}

.tasks-admin-layout.panel>.panel-head,
.tasks-admin-layout>.panel-head {
  align-items: flex-start;
  gap: 12px;
}

.tasks-admin-layout .panel-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.task-form-modal {
  max-width: min(560px, calc(100vw - 24px));
  width: 100%;
  max-height: min(90vh, 900px);
  overflow: auto;
}

@media (max-width: 720px) {
  .tasks-admin-layout>.panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .tasks-admin-layout .panel-head-actions {
    width: 100%;
  }

  .tasks-admin-layout .panel-head-actions .btn {
    flex: 1;
  }
}

.task-buckets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 10px;
}

.task-bucket-extra {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 12px;
}

.task-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.task-cards>.item:has(.task-workbench),
.task-cards>.item.task-card-expanded,
.task-cards>.empty-box {
  grid-column: 1 / -1;
}

/* Vertegenwoordiger: uitgeklapte kaarten blijven in 2 kolommen op pc */
@media (min-width: 901px) {
  .task-cards--rep>.item.task-card-expanded {
    grid-column: auto;
  }

  .task-cards--rep>.item:has(.task-workbench),
  .task-cards--rep>.empty-box {
    grid-column: 1 / -1;
  }
}

.task-card-collapsed {
  padding: 0;
  overflow: hidden;
}

.task-card-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.task-card-summary:hover {
  background: color-mix(in srgb, var(--item-bg) 70%, var(--brand) 8%);
}

.task-card-name {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  min-width: 0;
}

.task-card-summary-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.task-card-title-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.task-card-title-btn h3 {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.task-card-full-title {
  margin: 4px 0 0;
  font-size: 13px;
}

.task-card-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.55;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.task-card-chevron.open {
  transform: rotate(45deg);
}

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

.followup-help {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
}

.followup-next {
  margin: 12px 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: color-mix(in srgb, var(--item-bg) 80%, var(--panel));
  overflow: visible;
}

.lead-hub-log,
.lead-hub-accordion-body,
.followup-form {
  overflow: visible;
}

.followup-next-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
}

.followup-detail {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.followup-line {
  color: var(--ink);
}

.followup-k {
  color: var(--muted);
  font-weight: 700;
}

.followup-entry h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.followup-timeline h2 {
  margin-bottom: 8px;
}

/* Visgraat / fishbone tijdlijn — modern */
.fishbone-wrap {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, color-mix(in srgb, #2563eb 14%, transparent), transparent 55%),
    radial-gradient(ellipse 70% 45% at 95% 100%, color-mix(in srgb, #ea580c 12%, transparent), transparent 50%),
    linear-gradient(165deg, color-mix(in srgb, var(--panel) 92%, #1e3a5f) 0%, var(--panel) 55%, color-mix(in srgb, var(--panel) 94%, #ea580c) 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.fishbone-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.fishbone-head h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.fish-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 12px;
  color: var(--muted);
}

.fish-leg {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}

.fish-leg.above {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
}

.fish-leg.below {
  background: linear-gradient(135deg, #ea580c, #f97316);
}

.fish-leg.todo {
  background: linear-gradient(135deg, #0f2744, #1e3a5f);
}

.fishbone-track {
  position: relative;
  min-height: 300px;
  min-width: 0;
  padding: 4px 4px 12px;
  overflow-x: auto;
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.fishbone-track-full {
  width: 100%;
}

.fishbone-track .fish-spine-row {
  width: max(100%, 480px);
  box-sizing: border-box;
  padding-right: 8px;
}

.fish-spine-row {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  z-index: 0;
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: max(100%, 480px);
  height: 34px;
  margin-top: -17px;
  pointer-events: none;
  filter: drop-shadow(0 4px 12px color-mix(in srgb, #2563eb 22%, transparent));
}

.fish-spine-head {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0 18px 0 14px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  color: #1e3a5f;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 2;
}

[data-theme="dark"] .fish-spine-head {
  color: #93c5fd;
  background: color-mix(in srgb, #1e3a5f 55%, var(--panel));
}

.fish-spine-chevrons {
  flex: 1;
  display: flex;
  min-width: 0;
}

.fish-chevron {
  --t: 0;
  flex: 1 1 0;
  display: grid;
  place-items: center;
  min-width: 52px;
  margin-left: -12px;
  padding: 0 10px 0 18px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
  background: color-mix(in srgb,
      #1d4ed8 calc((1 - var(--t)) * 100%),
      #ea580c calc(var(--t) * 100%));
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.fish-chevron:first-child {
  margin-left: -10px;
}

.fish-chevron-tip {
  flex: 0 0 auto;
  min-width: 64px;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%, 12px 50%);
  background: #ea580c;
}

.fish-bones {
  position: relative;
  z-index: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(148px, 1fr);
  gap: 12px;
  min-height: 280px;
  min-width: max(100%, 420px);
  align-items: center;
  padding: 12px 8px 8px 132px;
}

.fish-empty {
  grid-column: 1 / -1;
  text-align: center;
  margin: 0;
  padding: 40px 12px;
}

.fish-bone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 280px;
}

.fish-bone.above {
  justify-content: flex-start;
  padding-bottom: 50%;
}

.fish-bone.below {
  justify-content: flex-end;
  padding-top: 50%;
}

.fish-rib {
  position: absolute;
  left: 50%;
  width: 2px;
  background: linear-gradient(180deg, #3b82f6, color-mix(in srgb, #3b82f6 30%, transparent));
  transform-origin: bottom center;
  z-index: 0;
  pointer-events: none;
}

.fish-bone.above .fish-rib {
  bottom: 50%;
  height: calc(50% - 56px);
  transform: translateX(-50%) skewX(-18deg);
  background: linear-gradient(180deg, #3b82f6, color-mix(in srgb, #3b82f6 20%, transparent));
}

.fish-bone.below .fish-rib {
  top: 50%;
  height: calc(50% - 56px);
  transform: translateX(-50%) skewX(18deg);
  background: linear-gradient(0deg, #ea580c, color-mix(in srgb, #ea580c 20%, transparent));
}

.fish-bone.above .fish-rib::after,
.fish-bone.below .fish-rib::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
}

.fish-bone.above .fish-rib::after {
  bottom: -1px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid #2563eb;
}

.fish-bone.below .fish-rib::after {
  top: -1px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 7px solid #ea580c;
}

.fish-joint {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--panel);
  border: 3px solid #2563eb;
  box-shadow: 0 0 0 4px color-mix(in srgb, #2563eb 18%, transparent);
  z-index: 2;
}

.fish-bone.below .fish-joint {
  border-color: #ea580c;
  box-shadow: 0 0 0 4px color-mix(in srgb, #ea580c 18%, transparent);
}

.fish-bone.planned .fish-joint {
  border-color: #1e3a5f;
  border-style: dashed;
  background: color-mix(in srgb, #1e3a5f 20%, var(--panel));
  box-shadow: 0 0 0 4px color-mix(in srgb, #1e3a5f 16%, transparent);
}

.fish-bone.planned .fish-rib {
  border-left: 2px dashed color-mix(in srgb, #1e3a5f 55%, transparent);
  background: transparent !important;
  width: 0;
}

.fish-bone.planned .fish-rib::after {
  border-top-color: #1e3a5f;
  border-bottom-color: #1e3a5f;
}

.fish-card-planned {
  border: 1px dashed color-mix(in srgb, #1e3a5f 55%, var(--line)) !important;
  background:
    linear-gradient(160deg, color-mix(in srgb, #1e3a5f 12%, var(--item-bg)), var(--item-bg) 55%) !important;
  box-shadow:
    0 10px 28px color-mix(in srgb, #1e3a5f 12%, transparent),
    0 1px 0 color-mix(in srgb, #fff 8%, transparent) inset !important;
}

.fish-planned-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1e3a5f;
  background: color-mix(in srgb, #1e3a5f 14%, var(--panel));
  border-radius: 999px;
  padding: 2px 7px;
  white-space: nowrap;
}

[data-theme="dark"] .fish-planned-badge {
  color: #93c5fd;
  background: color-mix(in srgb, #1e3a5f 40%, var(--panel));
}

.fish-bone.planned .fish-icon {
  background: color-mix(in srgb, #1e3a5f 16%, var(--panel)) !important;
  color: #1e3a5f !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #1e3a5f 28%, transparent) !important;
}

[data-theme="dark"] .fish-bone.planned .fish-icon {
  color: #93c5fd !important;
}

.fish-planned-actions {
  margin-top: 6px;
}

.fish-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 168px;
  padding: 11px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, #3b82f6 22%, var(--line));
  background:
    linear-gradient(160deg, color-mix(in srgb, #3b82f6 8%, var(--item-bg)), var(--item-bg) 55%);
  box-shadow:
    0 10px 28px color-mix(in srgb, #2563eb 12%, transparent),
    0 1px 0 color-mix(in srgb, #fff 8%, transparent) inset;
  display: grid;
  gap: 4px;
  text-align: left;
  backdrop-filter: blur(6px);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.fish-bone.below .fish-card {
  border-color: color-mix(in srgb, #ea580c 28%, var(--line));
  background:
    linear-gradient(160deg, color-mix(in srgb, #ea580c 10%, var(--item-bg)), var(--item-bg) 55%);
  box-shadow:
    0 10px 28px color-mix(in srgb, #ea580c 12%, transparent),
    0 1px 0 color-mix(in srgb, #fff 8%, transparent) inset;
}

.fish-card:hover {
  transform: translateY(-2px);
}

.fish-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fish-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, #3b82f6 16%, var(--panel));
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #3b82f6 25%, transparent);
}

.fish-bone.below .fish-icon {
  background: color-mix(in srgb, #f97316 18%, var(--panel));
  color: #c2410c;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #f97316 28%, transparent);
}

[data-theme="dark"] .fish-icon {
  color: #93c5fd;
}

[data-theme="dark"] .fish-bone.below .fish-icon {
  color: #fdba74;
}

.fish-icon svg {
  width: 16px;
  height: 16px;
}

.fish-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.fish-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  background: color-mix(in srgb, #22c55e 28%, var(--panel));
  color: #15803d;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #22c55e 35%, transparent);
}

[data-theme="dark"] .fish-check {
  color: #86efac;
}

.fish-delete {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0.55;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.fish-card:hover .fish-delete,
.fish-delete:focus-visible {
  opacity: 1;
}

.fish-delete:hover {
  background: color-mix(in srgb, #ef4444 18%, var(--panel));
  border-color: color-mix(in srgb, #ef4444 40%, var(--line));
  color: #b91c1c;
}

.fish-todo-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.fish-todo-del {
  min-width: 28px;
  padding-inline: 6px;
}

.fish-card strong {
  font-size: 12px;
  line-height: 1.3;
  font-weight: 800;
}

.fish-day {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.fish-note,
.fish-who {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

.fish-next {
  font-size: 11px;
  font-weight: 700;
  color: #1d4ed8;
  line-height: 1.35;
}

.fish-bone.below .fish-next {
  color: #c2410c;
}

.fish-todo {
  border-radius: 16px;
  padding: 16px 14px;
  background:
    linear-gradient(165deg, #1e3a5f 0%, #0f2744 55%, #122033 100%);
  color: #e8eef7;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow:
    0 14px 36px rgba(15, 39, 68, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border: 1px solid color-mix(in srgb, #3b82f6 28%, transparent);
  min-height: 100%;
}

.fish-todo h3 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 900;
  color: #fff;
}

.fish-todo-sub {
  margin: 0 0 4px;
  font-size: 11px;
  color: rgba(232, 238, 247, 0.62);
  line-height: 1.35;
}

.fish-todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.fish-todo-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.fish-todo-item:first-child {
  padding-top: 2px;
}

.fish-todo-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.fish-todo-item strong {
  display: block;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 700;
}

.fish-todo-item .muted {
  color: rgba(232, 238, 247, 0.68);
  font-size: 11px;
}

.fish-todo-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #93c5fd;
  background: rgba(147, 197, 253, 0.12);
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.22);
  margin-top: 0;
}

.fish-todo-icon svg {
  width: 15px;
  height: 15px;
}

.fish-todo-empty {
  font-size: 13px;
  color: rgba(232, 238, 247, 0.7);
  line-height: 1.4;
  margin: 4px 0 0;
}

.fish-todo .btn.small {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.fish-todo .btn.small:hover {
  background: rgba(255, 255, 255, 0.2);
}

.fish-todo .btn.ghost {
  background: transparent;
  color: rgba(232, 238, 247, 0.75);
}

@media (max-width: 900px) {
  .fishbone-track {
    min-height: auto;
    min-width: 0;
  }

  .fish-spine-row {
    display: none;
  }

  .fish-bones {
    grid-auto-flow: row;
    grid-auto-columns: unset;
    grid-template-columns: 1fr;
    min-height: 0;
    min-width: 0;
    gap: 12px;
    padding: 8px;
  }

  .fish-bone {
    height: auto;
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
    padding: 0 !important;
    justify-content: flex-start !important;
  }

  .fish-rib {
    display: none;
  }

  .fish-joint {
    position: static;
    margin: 8px 0 0;
    flex-shrink: 0;
  }

  .fish-card {
    max-width: none;
    flex: 1;
  }
}

.task-drawer {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 12px;
  background: var(--item-bg);
}

.task-drawer>summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  width: auto;
}

.task-drawer>summary::-webkit-details-marker {
  display: none;
}

.task-drawer>summary::before {
  content: "▸ ";
}

.task-drawer.open>summary::before {
  content: "▾ ";
}

.task-drawer.open>summary {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.task-drawer-body {
  padding: 14px;
  display: grid;
  gap: 4px;
}

.task-workbench-rep .task-drawer-body {
  padding: 14px 16px 16px;
}

.followup-type-row {
  align-items: center;
}

.followup-templates {
  margin: 0 0 12px;
  position: relative;
  z-index: 2;
}

.followup-templates-label {
  margin: 0 0 6px;
  font-size: 12px;
}

.followup-templates-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.followup-template-btn {
  width: auto !important;
  min-height: 36px;
  padding: 8px 12px !important;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

.list h2.late {
  color: var(--danger);
}

.pipe-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pipe-chip {
  border: 1px solid var(--line);
  background: var(--input-bg);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.pipe-chip strong {
  margin-left: 4px;
  color: var(--ink);
}

.pipe-chip.has {
  border-color: var(--brand);
  color: var(--ink);
}

.pipe-chip:hover {
  border-color: var(--brand);
}

.pipeline-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pipeline-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pipe-tab {
  border: 1px solid var(--line);
  background: var(--input-bg);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.pipe-tab strong {
  margin-left: 4px;
  color: var(--ink);
}

.pipe-tab.active {
  background: var(--gradient);
  color: var(--btn-text);
  border-color: transparent;
}

.pipe-tab.active strong {
  color: var(--btn-text);
}

.pipeline-toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pipeline-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pipeline-summary-bar h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--heading);
}

.pipeline-summary-bar>div>.muted {
  margin: 4px 0 0;
}

.pipeline-summary-stats {
  margin-bottom: 14px;
}

.pipeline-form-panel {
  margin-bottom: 14px;
}

.pipeline-deal-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.pipeline-deal-form-submit {
  display: flex;
  align-items: end;
}

.pipeline-deal-form-submit .btn {
  width: 100%;
}

.pipeline-accordion {
  display: grid;
  gap: 18px;
}

/* ── Horizontale 9-staps pipeline board ── */
.pipeline-board-wrap {
  margin-top: 4px;
}

.pipeline-board-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pipeline-board-progress {
  font-size: 13px;
  color: var(--muted);
}

.pipeline-board-progress strong {
  color: var(--heading);
  font-size: 15px;
}

.pipeline-board-hint {
  font-size: 12px;
}

.pipeline-board-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 6px 4px 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
}

.pipeline-board-scroll.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.pipeline-board-scroll.is-dragging .pipe-pillar {
  cursor: grabbing;
}

.pipeline-board-scroll .pipe-card,
.pipeline-board-scroll select,
.pipeline-board-scroll button,
.pipeline-board-scroll a,
.pipeline-board-scroll input,
.pipeline-board-scroll label,
.pipeline-board-scroll textarea {
  user-select: auto;
  cursor: auto;
}

.pipeline-board-scroll::-webkit-scrollbar {
  height: 8px;
}

.pipeline-board-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--brand) 45%, var(--line));
  border-radius: 999px;
}

.pipe-pillar {
  position: relative;
  flex: 0 0 min(220px, 78vw);
  max-width: 240px;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  cursor: grab;
  outline: none;
}

.pipe-pillar-hex {
  position: relative;
  z-index: 1;
  min-height: 3.4rem;
  padding: 0.55rem 1rem 0.55rem 2.4rem;
  clip-path: polygon(10% 0%, 90% 0%, 100% 50%, 90% 100%, 10% 100%, 0% 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16);
}

.pipe-pillar-step {
  position: absolute;
  left: 0.85rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.pipe-pillar-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
}

.pipe-pillar-body {
  flex: 1;
  margin-top: 0.5rem;
  padding: 0.65rem 0.55rem;
  background: var(--item-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.pipe-pillar-group {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pipe-pillar-empty {
  margin: 18px 4px;
  font-size: 12px;
  text-align: center;
}

.pipe-pillar-deals {
  display: grid;
  gap: 8px;
}

.pipe-pillar-deals .pipe-card {
  flex: none;
  max-width: none;
  width: 100%;
  scroll-snap-align: none;
}

.pipe-pillar-foot {
  margin-top: 0.45rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

.pipe-pillar-foot strong {
  font-size: 15px;
}

.pipe-pillar-arrow {
  display: none;
  position: absolute;
  top: 42%;
  right: -12px;
  width: 18px;
  height: 10px;
  color: color-mix(in srgb, var(--brand) 55%, var(--accent));
  z-index: 2;
  pointer-events: none;
  opacity: 0.85;
}

.pipe-pillar-arrow svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

@media (min-width: 900px) {
  .pipe-pillar-arrow {
    display: block;
  }

  .pipe-pillar {
    flex-basis: 200px;
  }
}

/* Funnel: koel → merk-oranje → accent-lime */
.pipe-pillar-slate .pipe-pillar-hex,
.pipe-pillar-slate .pipe-pillar-foot {
  background: linear-gradient(165deg, #64748b, #475569);
}

.pipe-pillar-sky .pipe-pillar-hex,
.pipe-pillar-sky .pipe-pillar-foot {
  background: linear-gradient(165deg, #38bdf8, #0284c7);
}

.pipe-pillar-blue .pipe-pillar-hex,
.pipe-pillar-blue .pipe-pillar-foot {
  background: linear-gradient(165deg, #60a5fa, #2563eb);
}

.pipe-pillar-violet .pipe-pillar-hex,
.pipe-pillar-violet .pipe-pillar-foot {
  background: linear-gradient(165deg, #a78bfa, #7c3aed);
}

.pipe-pillar-brand .pipe-pillar-hex,
.pipe-pillar-brand .pipe-pillar-foot {
  background: linear-gradient(165deg, var(--brand), var(--brand-dark));
}

.pipe-pillar-amber .pipe-pillar-hex,
.pipe-pillar-amber .pipe-pillar-foot {
  background: linear-gradient(165deg, #fbbf24, #d97706);
  color: #1c1917;
}

.pipe-pillar-amber .pipe-pillar-step {
  background: rgba(28, 25, 23, 0.18);
  color: #1c1917;
}

.pipe-pillar-teal .pipe-pillar-hex,
.pipe-pillar-teal .pipe-pillar-foot {
  background: linear-gradient(165deg, #2dd4bf, #0f766e);
}

.pipe-pillar-emerald .pipe-pillar-hex,
.pipe-pillar-emerald .pipe-pillar-foot {
  background: linear-gradient(165deg, var(--accent-light), #059669);
}

.pipe-pillar-lime .pipe-pillar-hex,
.pipe-pillar-lime .pipe-pillar-foot {
  background: linear-gradient(165deg, var(--accent), #84cc16);
  color: #0b0f16;
}

.pipe-pillar-lime .pipe-pillar-step {
  background: rgba(11, 15, 22, 0.18);
  color: #0b0f16;
}

.pipe-pillar-muted .pipe-pillar-hex,
.pipe-pillar-muted .pipe-pillar-foot {
  background: linear-gradient(165deg, #94a3b8, #64748b);
}

.pipe-pillar-orange .pipe-pillar-hex,
.pipe-pillar-orange .pipe-pillar-foot {
  background: linear-gradient(165deg, var(--brand), var(--brand-dark));
}

.pipe-pillar-purple .pipe-pillar-hex,
.pipe-pillar-purple .pipe-pillar-foot {
  background: linear-gradient(165deg, #a78bfa, #7c3aed);
}

.pipe-pillar.is-active {
  transform: translateY(-2px);
}

.pipe-pillar.is-active .pipe-pillar-body {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 35%, transparent), 0 12px 28px rgba(15, 23, 42, 0.1);
}

.pipe-pillar.has-deals .pipe-pillar-hex {
  box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 28%, transparent);
}

.pipeline-board-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.pipeline-board-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  opacity: 0.55;
  transition: width 0.15s ease, opacity 0.15s ease;
}

.pipeline-board-dot.is-active {
  width: 18px;
  opacity: 1;
}

.pipeline-board-dot.pipe-dot-slate {
  background: #64748b;
}

.pipeline-board-dot.pipe-dot-sky {
  background: #38bdf8;
}

.pipeline-board-dot.pipe-dot-blue {
  background: #60a5fa;
}

.pipeline-board-dot.pipe-dot-violet {
  background: #a78bfa;
}

.pipeline-board-dot.pipe-dot-brand {
  background: var(--brand);
}

.pipeline-board-dot.pipe-dot-amber {
  background: #f59e0b;
}

.pipeline-board-dot.pipe-dot-teal {
  background: #2dd4bf;
}

.pipeline-board-dot.pipe-dot-emerald {
  background: var(--accent-light);
}

.pipeline-board-dot.pipe-dot-lime {
  background: var(--accent);
}

.pipeline-board-dot.pipe-dot-muted {
  background: #94a3b8;
}

.pipeline-board-dot.pipe-dot-orange {
  background: var(--brand);
}

.pipeline-board-dot.pipe-dot-purple {
  background: #a78bfa;
}

.pipe-group {
  display: grid;
  gap: 10px;
}

.pipe-group-label {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pipe-stage {
  box-shadow: none;
  background: var(--item-bg);
  overflow: hidden;
}

.pipe-stage>summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  user-select: none;
}

.pipe-stage>summary::-webkit-details-marker {
  display: none;
}

.pipe-stage>summary::after {
  content: "▸";
  color: var(--muted);
  font-size: 14px;
  flex-shrink: 0;
  transition: transform .15s ease;
}

.pipe-stage[open]>summary::after {
  transform: rotate(90deg);
}

.pipe-stage.has-deals>summary {
  border-left: 3px solid var(--brand);
}

.pipe-stage-index {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--badge-bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.pipe-stage[open] .pipe-stage-index,
.pipe-stage.has-deals .pipe-stage-index {
  background: rgba(249, 115, 22, 0.18);
  color: var(--brand);
}

.pipe-stage-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--heading);
}

.pipe-stage-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  margin-right: 4px;
}

.pipe-stage-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.pipe-stage .count {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(249, 115, 22, 0.15);
  color: var(--brand);
  font-weight: 800;
  font-size: 12px;
}

.pipe-stage-body {
  border-top: 1px solid var(--line);
  padding: 12px;
}

.pipe-stage-empty {
  margin: 0;
  padding: 8px 4px 4px;
  font-size: 13px;
}

.pipe-stage-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.pipe-card {
  flex: 0 0 min(300px, 82vw);
  max-width: 340px;
  padding: 12px;
  scroll-snap-align: start;
  background: var(--panel);
}

.pipe-card-main {
  min-width: 0;
}

.pipe-card-main h3 {
  font-size: 14px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pipe-card-value {
  font-size: 13px;
  white-space: nowrap;
  color: var(--heading);
}

.pipe-stage-field {
  margin-top: 8px;
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.pipe-card-actions {
  margin-top: 10px;
}

.pipe-card-actions .btn {
  flex: 1 1 auto;
}

.deal-drawer-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
}

.deal-drawer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.45);
  padding: 0;
  cursor: pointer;
}

.deal-drawer {
  position: relative;
  width: min(520px, 100%);
  height: 100%;
  overflow: auto;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 18px;
  z-index: 1;
}

.deal-drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.deal-drawer-head h2 {
  margin: 0;
  font-size: 18px;
  text-transform: none;
  letter-spacing: -0.02em;
  color: var(--heading);
}

.pid-panel-drawer {
  margin-top: 0;
  border: 0;
  padding: 0;
  background: transparent;
}

.search-results {
  position: absolute;
  right: 22px;
  top: 78px;
  width: min(420px, calc(100% - 44px));
  max-height: 360px;
  overflow: auto;
  z-index: 20;
  padding: 10px;
}

.search-results button.search-result-goto {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px;
  border-radius: 10px;
  color: var(--ink);
}

.search-results button.search-result-goto:hover {
  background: rgba(249, 115, 22, 0.12);
}

.search-result-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-result-row .search-result-goto {
  flex: 1;
  min-width: 0;
}

.search-result-row .search-result-wipe {
  flex: 0 0 auto;
  width: auto;
}

.notice-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.notice-bar .notice-undo-btn {
  margin: 0;
}

.company-card .item-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.company-card-main {
  flex: 1;
  min-width: 0;
}

.company-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0;
  cursor: pointer;
  user-select: none;
  flex: 0 0 auto;
}

.company-select input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent, #f97316);
  cursor: pointer;
}

.company-card-selected {
  outline: 1px solid color-mix(in srgb, var(--accent, #f97316) 55%, var(--line));
  background: color-mix(in srgb, var(--accent, #f97316) 8%, var(--panel));
}

.companies-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2, color-mix(in srgb, var(--panel) 92%, var(--ink)));
}

.company-select-all {
  font-size: 13px;
  color: var(--ink);
}

.hidden {
  display: none !important;
}

hr {
  border: none;
  border-top: 1px solid var(--line);
}

/* Documenten, foto's & plannen */
.files-list .file-upload-form {
  margin: 10px 0 14px;
}

.files-list .file-upload-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.files-list .file-upload-row input[type="file"] {
  flex: 1;
  min-width: 220px;
  font-size: 12px;
  color: var(--muted);
}

.file-item .file-thumb {
  display: block;
  width: 100%;
  max-width: 320px;
  max-height: 220px;
  object-fit: cover;
  border-radius: 10px;
  margin-top: 10px;
  border: 1px solid var(--line);
}

.file-item h3 {
  word-break: break-word;
}

.file-item-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.files-photo-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.file-item-photo {
  display: flex;
  flex-direction: column;
  padding: 8px;
  min-width: 0;
}

.file-item-photo .file-thumb-link {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 70%, #000);
  aspect-ratio: 1;
}

.file-item-photo .file-thumb {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  object-fit: cover;
}

.file-item-photo-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  min-width: 0;
}

.file-item-photo h3 {
  margin: 0;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-photo p {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.file-item-photo .file-item-actions {
  margin-top: 4px;
  justify-content: flex-start;
}

.file-item-photo .file-item-actions .btn {
  padding: 4px 8px;
  font-size: 11px;
}

.files-compact .file-thumb {
  max-width: 180px;
  max-height: 120px;
}

.files-compact .file-item-photo .file-thumb {
  max-width: none;
  max-height: none;
}

@media (max-width: 1100px) {
  .files-photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .files-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Postinterventiedossier */
.pid-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-bg, var(--item-bg));
}

.pid-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.pid-head h3 {
  margin: 0;
  font-size: 14px;
}

.pid-head p {
  margin: 4px 0 0;
}

.pid-number {
  font-size: 15px;
  letter-spacing: .02em;
}

.pid-number strong {
  color: var(--brand);
}

.badge.pid-number-badge {
  background: rgba(249, 115, 22, 0.18);
  color: #c2410c;
}

[data-theme="dark"] .badge.pid-number-badge {
  color: #fdba74;
}

.pid-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.pid-mail-form {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
}

.pid-criterion {
  margin: 10px 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.pid-meta-form {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.pid-meta-form textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
}

.pid-form-heading {
  margin: 4px 0 0;
  font-size: 13px;
}

.pid-form-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.pid-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pid-form-grid label,
.pid-meta-form .pid-form-full {
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.pid-form-grid .pid-form-full,
.pid-meta-form>.pid-form-full {
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .pid-form-grid {
    grid-template-columns: 1fr;
  }
}

.pid-sections h4 {
  margin: 14px 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.pid-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--item-bg);
}

.pid-section>summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
}

.pid-section>summary::-webkit-details-marker {
  display: none;
}

.pid-section-title {
  font-weight: 700;
  font-size: 13px;
  flex: 1;
  min-width: 140px;
}

.pid-section-title em {
  font-weight: 500;
}

.pid-section-body {
  padding: 0 12px 12px;
}

.pid-launch {
  margin-top: 10px;
}

.pid-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

/* Commissie-info bij opdrachten */
.commission-info {
  font-size: 13px;
  color: var(--muted);
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  margin-bottom: 12px;
}

.commission-info strong {
  color: var(--ink);
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .grid.two,
  .grid.three,
  .form-row {
    grid-template-columns: 1fr;
  }

  .pipeline-deal-form {
    grid-template-columns: 1fr 1fr;
  }

  .pipeline-deal-form-submit {
    grid-column: 1 / -1;
  }

  .pipeline-summary-bar {
    align-items: flex-start;
  }

  .pipeline-summary-stats {
    width: 100%;
  }

  .pipe-stage>summary {
    padding: 12px;
    gap: 10px;
  }

  .pipe-stage-title {
    font-size: 13px;
  }

  .pipe-stage-value {
    display: none;
  }

  .pipe-card {
    flex-basis: min(280px, 86vw);
  }

  .mobile-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 40;
  }

  .mobile-bar .brand {
    margin: 0;
    flex: 1;
    min-width: 0;
    gap: 0;
  }

  .mobile-bar .brand>div {
    display: none;
  }

  .mobile-bar .brand-mark {
    min-width: 0;
    height: auto;
    max-height: 48px;
    max-width: min(220px, 70vw);
    padding: 0;
    width: auto;
  }

  .mobile-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .menu-btn {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 0;
    flex-shrink: 0;
  }

  .menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
  }

  .theme-toggle-mobile {
    padding: 8px 10px;
    font-size: 11px;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 45;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
  }

  .sidebar-backdrop[hidden] {
    display: none !important;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 88vw);
    height: 100vh;
    z-index: 50;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: var(--shadow);
    overflow: hidden;
    padding-bottom: 16px;
  }

  .app-shell.menu-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .sidebar-head .brand {
    margin: 0;
  }

  .menu-close {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
    border-radius: 10px;
    padding: 0;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
  }

  .theme-toggle-sidebar {
    width: 100%;
    justify-content: center;
  }

  .desktop-only {
    display: none !important;
  }

  .main {
    padding: 14px 12px 24px;
  }

  .topbar {
    gap: 10px;
    margin-bottom: 14px;
    align-items: stretch;
  }

  .topbar>div:first-child {
    flex: 1 1 100%;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .searchbar {
    flex: 1 1 100%;
    min-width: 0;
  }

  .search-results {
    right: 12px;
    left: 12px;
    top: auto;
    width: auto;
  }

  .attention-banner {
    padding: 12px 14px;
  }

  .stat,
  .panel {
    padding: 14px;
  }

  .item-top {
    flex-direction: column;
  }
}

@media (min-width: 1101px) {

  .mobile-bar,
  .sidebar-backdrop,
  .menu-close,
  .theme-toggle-mobile {
    display: none !important;
  }

  .topbar-tools .theme-toggle {
    display: none;
  }
}

/* Social + agent */
.platform-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 14px;
}

.platform-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--item-bg);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.platform-chip input {
  accent-color: var(--brand);
}

.ai-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.ai-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.ai-pill.ok {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 40%, var(--line));
}

.ai-pill.bad {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
}

.setup-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.setup-steps a {
  color: var(--brand);
}

.chat-test {
  display: grid;
  gap: 10px;
}

.chat-log {
  min-height: 180px;
  max-height: 320px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1px solid var(--line);
}

.chat-line {
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 13px;
  white-space: pre-wrap;
  max-width: 92%;
}

.chat-line.user {
  align-self: flex-end;
  background: color-mix(in srgb, var(--brand) 25%, var(--panel));
}

.chat-line.bot {
  align-self: flex-start;
  background: var(--panel-2);
}

.conv-list {
  display: grid;
  gap: 8px;
}

.conv-item {
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--item-bg);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
}

.conv-item.active {
  border-color: var(--brand);
}

.conv-item strong {
  display: block;
  margin-bottom: 4px;
}

.caption-preview {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
}

.social-history-body {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: start;
  margin: 8px 0 4px;
}

.social-history-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0f1318;
  flex-shrink: 0;
}

.social-history-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-history-thumb span {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.social-history-thumb.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 16px;
}

.social-history-item .caption-preview {
  max-height: 4.5em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  white-space: normal;
}

/* Platform tenants table */
.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table a {
  color: var(--brand);
}

.stack-form {
  display: grid;
  gap: 12px;
  max-width: 640px;
}

.stack-form label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
}

.stack-form label.check {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
}

.stack-form small.muted {
  font-size: 0.8rem;
}

.stack-form input[type="text"],
.stack-form input[type="email"],
.stack-form input:not([type]) {
  border: 1px solid var(--line);
  background: var(--input-bg);
  border-radius: 10px;
  padding: 11px 12px;
}

.logo-editor {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--item-bg);
}

.logo-preview-wrap {
  text-align: center;
  min-width: 140px;
}

.logo-preview {
  width: 120px;
  height: 120px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  border: 1px solid var(--line);
}

.logo-actions {
  display: grid;
  gap: 8px;
  align-content: start;
}

.logo-file-btn {
  display: inline-flex;
  width: fit-content;
}

.plan-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--brand) 10%, var(--panel));
}

/* Klantgoedkeuring */
.badge.approval-pending {
  background: color-mix(in srgb, var(--brand) 22%, var(--badge-bg));
  color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 45%, transparent);
}

.badge.approval-approved {
  background: color-mix(in srgb, var(--ok) 18%, var(--badge-bg));
  color: var(--ok);
}

.badge.approval-rejected {
  background: color-mix(in srgb, var(--danger) 18%, var(--badge-bg));
  color: var(--danger);
}

/* e-Procurement indieningsdeadline */
.badge.tender-deadline-ok,
.btn.tender-deadline-btn.tender-deadline-ok {
  background: color-mix(in srgb, var(--ok, #22c55e) 22%, var(--badge-bg, transparent));
  color: var(--ok, #16a34a);
  border: 1px solid color-mix(in srgb, var(--ok, #22c55e) 50%, transparent);
}

.badge.tender-deadline-warn,
.btn.tender-deadline-btn.tender-deadline-warn {
  background: color-mix(in srgb, #f59e0b 24%, var(--badge-bg, transparent));
  color: #d97706;
  border: 1px solid color-mix(in srgb, #f59e0b 55%, transparent);
}

.badge.tender-deadline-expired,
.btn.tender-deadline-btn.tender-deadline-expired {
  background: color-mix(in srgb, var(--danger, #ef4444) 22%, var(--badge-bg, transparent));
  color: var(--danger, #dc2626);
  border: 1px solid color-mix(in srgb, var(--danger, #ef4444) 50%, transparent);
}

.btn.tender-deadline-btn {
  font-weight: 700;
  white-space: nowrap;
}

.tender-deadlines-list {
  display: grid;
  gap: 8px;
}

.tender-deadline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--item-bg, transparent);
}

.tender-deadline-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tender-deadline-assignee {
  font-size: 12px;
  color: var(--text, inherit);
  opacity: 0.85;
}

.company-pending {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
}

/* Klantcontact op opdrachten */
.task-contact {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line));
  background: color-mix(in srgb, var(--brand) 8%, var(--item-bg));
  display: grid;
  gap: 4px;
}

.task-contact-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.task-contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 2px;
}

.contact-link {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.contact-link:hover {
  text-decoration: underline;
  color: var(--accent-light);
}

.maps-directions-row {
  margin: 4px 0 10px;
  font-size: 13px;
}

.maps-directions-link {
  white-space: nowrap;
}

/* Handleiding (?) */
.topbar-title {
  min-width: 0;
}

.topbar-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-heading h1 {
  margin: 0;
}

.help-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
  flex: 0 0 auto;
  padding: 0;
  cursor: pointer;
}

.help-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.settings-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--item-bg, var(--panel));
  width: fit-content;
  max-width: 100%;
}

.settings-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
}

.settings-tab:hover {
  color: var(--ink);
}

.settings-tab.active {
  background: var(--panel);
  color: var(--heading, var(--ink));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--line);
}

.label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.help-btn-inline,
.help-btn-sm {
  width: 22px;
  height: 22px;
  font-size: 12px;
}

.help-btn-green {
  border-color: color-mix(in srgb, #22c55e 55%, var(--line));
  background: color-mix(in srgb, #22c55e 18%, var(--panel));
  color: #22c55e;
}

.help-btn-green:hover {
  border-color: #22c55e;
  color: #16a34a;
  background: color-mix(in srgb, #22c55e 28%, var(--panel));
}

.nav-link-with-help {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link-with-help .nav-link {
  flex: 1;
  min-width: 0;
}

.nav-link-with-help .help-btn {
  flex: 0 0 auto;
}

.help-modal-root {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
}

.help-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
  padding: 0;
}

.help-modal {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px 22px 18px;
}

.help-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.help-modal-head h2 {
  margin: 4px 0 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--heading);
}

.help-intro {
  margin: 0 0 18px;
  color: var(--muted);
}

.help-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.help-steps li {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--item-bg);
}

.help-steps strong {
  display: block;
  margin-bottom: 4px;
  color: var(--heading);
}

.help-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.help-steps p+p {
  margin-top: 8px;
}

.help-tip+.help-steps {
  margin-top: 14px;
}

.help-steps em {
  color: var(--ink);
  font-style: normal;
  font-weight: 600;
}

.help-tip {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 12%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line));
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.4;
}

.missing-data-hint {
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, #d97706 12%, var(--panel));
  border: 1px solid color-mix(in srgb, #d97706 32%, var(--line));
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.4;
}

.missing-data-banner {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, #d97706 10%, var(--panel));
  border: 1px solid color-mix(in srgb, #d97706 28%, var(--line));
}

.missing-data-banner strong {
  color: var(--heading);
}

.missing-data-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: min(48vh, 420px);
  overflow: auto;
}

.missing-data-item {
  margin: 0;
}

.missing-data-open {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--item-bg);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}

.missing-data-open:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
}

.badge.incomplete {
  background: color-mix(in srgb, #d97706 18%, transparent);
  color: #b45309;
}

[data-theme="dark"] .badge.incomplete {
  color: #fcd34d;
}

.company-incomplete {
  border-color: color-mix(in srgb, #d97706 35%, var(--line));
}

/* Google Translate — vast op beheerder- én vertegenwoordiger-dashboard */
.crm-translate {
  position: fixed;
  z-index: 9999;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.crm-translate-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.crm-translate .goog-te-gadget {
  font-family: inherit !important;
  font-size: 0 !important;
  color: transparent !important;
}

.crm-translate .goog-te-gadget>span {
  display: none !important;
}

.crm-translate .goog-te-combo {
  font-size: 13px !important;
  font-weight: 600;
  color: var(--ink) !important;
  background: var(--input-bg) !important;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  max-width: 180px;
  cursor: pointer;
}

.crm-translate .goog-te-combo option {
  color: var(--ink);
  background: var(--panel);
}

.crm-translate .goog-te-combo:focus {
  outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent);
  outline-offset: 1px;
}

/* Google topbalk / tooltips verbergen — layout niet laten verschuiven */
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
iframe.goog-te-banner-frame,
body>.skiptranslate,
#goog-gt-tt,
.goog-te-balloon-frame,
div#goog-gt-tt {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
}

body {
  top: 0 !important;
  position: static !important;
}

.goog-text-highlight,
font>font {
  background: transparent !important;
  box-shadow: none !important;
}

@media (max-width: 600px) {
  .crm-translate {
    right: 10px;
    bottom: 10px;
    padding: 6px 8px;
    gap: 6px;
  }

  .crm-translate-label {
    display: none;
  }

  .crm-translate .goog-te-combo {
    max-width: 140px;
    font-size: 12px !important;
  }
}

/* ——— Prijsofferte module ——— */
.library-form {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--item-bg);
}

.library-inactive {
  opacity: 0.65;
}

.quote-layout {
  align-items: start;
}

.quote-editor {
  display: grid;
  gap: 14px;
}

.quote-meta-grid label.check.quote-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
}

.quote-lead-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent, #f5a623);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.quote-lead-link:hover,
.quote-lead-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.return-to-quote-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent, #f5a623) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, #f5a623) 45%, transparent);
}

.box-soft {
  background: var(--item-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.quote-schedule-panel .quote-schedule-toggle {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 12px;
  font-weight: 400;
  cursor: pointer;
}

.quote-schedule-panel .quote-schedule-toggle input[type="checkbox"] {
  width: auto !important;
  min-width: 18px;
  margin: 3px 0 0 !important;
  flex-shrink: 0;
  accent-color: var(--brand, #f97316);
}

.quote-schedule-sections {
  padding: 14px !important;
  margin: 12px 0 0;
}

.quote-schedule-sections-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.quote-schedule-section-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.quote-schedule-section-list li {
  margin: 0;
  padding: 0;
}

.quote-schedule-section-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 10px;
  margin: 0 !important;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 400;
  cursor: pointer;
}

.quote-schedule-section-row:hover {
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.quote-schedule-section-row input[type="checkbox"] {
  width: auto !important;
  min-width: 18px;
  margin: 2px 0 0 !important;
  flex-shrink: 0;
  accent-color: var(--brand, #f97316);
}

.quote-schedule-section-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  line-height: 1.35;
}

.quote-schedule-section-text strong {
  font-size: 13px;
  color: var(--ink);
}

.quote-schedule-section-text .muted {
  font-size: 12px;
  font-weight: 400;
}

.quote-sections-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.quote-section {
  margin: 0;
  transition: box-shadow .15s ease, border-color .15s ease;
}

.quote-section.dragging {
  opacity: .55;
}

.quote-section.drag-over {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent);
}

.quote-section-head {
  cursor: pointer;
  user-select: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 0;
}

.quote-section-drag {
  cursor: grab;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: -2px;
  line-height: 1;
  padding: 4px 2px;
}

.quote-section.dragging .quote-section-drag {
  cursor: grabbing;
}

.quote-section-chevron {
  width: 1em;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.quote-section-title-wrap {
  flex: 1 1 200px;
  min-width: 0;
}

.quote-section-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.quote-section-title input {
  font-weight: 600;
  cursor: text;
}

.quote-section-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.quote-section-count {
  font-size: 12px;
  white-space: nowrap;
}

.quote-section-head-actions {
  margin: 0;
  flex-wrap: wrap;
}

.quote-section-body {
  margin-top: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.quote-section-body[hidden] {
  display: none;
}

.quote-section-actions-wrap {
  margin: 8px 0 18px;
}

.quote-section-hint {
  margin: 8px 0 0;
  font-size: 12px;
}

.quote-add-saved {
  display: grid;
  gap: 4px;
  min-width: min(100%, 220px);
  margin: 0;
  font-size: 12px;
}

.library-rendement {
  margin-top: 10px;
}

.quote-rendement-preview {
  background: color-mix(in srgb, var(--brand) 6%, var(--item-bg));
}

.quote-lib-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.quote-lib-bar label {
  flex: 1 1 280px;
  margin: 0;
}

.quote-table-wrap {
  overflow-x: auto;
}

.quote-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.quote-table th,
.quote-table td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.quote-table td:has(.quote-desc-textarea) {
  vertical-align: top;
  min-width: 220px;
}

.quote-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
}

.quote-table td.num,
.quote-table th.num {
  text-align: right;
  white-space: nowrap;
}

.quote-table input,
.quote-table select,
.quote-table textarea.quote-desc-textarea {
  width: 100%;
  min-width: 0;
  font-size: 13px;
}

.quote-table textarea.quote-desc-textarea {
  min-height: 2.6em;
  max-height: 16em;
  resize: vertical;
  line-height: 1.35;
  field-sizing: content;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.quote-table input[type="number"] {
  min-width: 72px;
}

.quote-section-actions {
  justify-content: flex-start;
}

.quote-totals-panel .stat.internal-only {
  border: 1px dashed color-mix(in srgb, var(--brand) 35%, var(--line));
}

.badge.concept {
  background: color-mix(in srgb, #64748b 18%, transparent);
  color: #334155;
}

[data-theme="dark"] .badge.concept {
  color: #cbd5e1;
}

.badge.verzonden,
.badge.gewijzigd {
  background: color-mix(in srgb, #2563eb 18%, transparent);
  color: #1d4ed8;
}

[data-theme="dark"] .badge.verzonden,
[data-theme="dark"] .badge.gewijzigd {
  color: #93c5fd;
}

.badge.goedgekeurd {
  background: color-mix(in srgb, #16a34a 18%, transparent);
  color: #15803d;
}

[data-theme="dark"] .badge.goedgekeurd {
  color: #86efac;
}

.badge.geweigerd {
  background: color-mix(in srgb, #dc2626 18%, transparent);
  color: #b91c1c;
}

[data-theme="dark"] .badge.geweigerd {
  color: #fca5a5;
}

.qr-block {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
}

.qr-block img {
  flex: 0 0 auto;
  border-radius: 8px;
  background: #fff;
}

.site-pick {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 14px;
}

.site-pick legend {
  padding: 0 6px;
  color: var(--label);
  font-size: 13px;
}

.field-block {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
}

.field-label {
  color: var(--label);
  font-size: 13px;
  font-weight: 700;
}

.site-pick-dropdown {
  position: relative;
}

.site-dropdown-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 600;
  cursor: pointer;
}

.site-dropdown-toggle:hover,
.site-pick-dropdown.open .site-dropdown-toggle {
  border-color: var(--brand);
}

.site-dropdown-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .15s ease;
  flex: 0 0 auto;
  margin-top: -4px;
}

.site-pick-dropdown.open .site-dropdown-chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.site-dropdown-panel {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 260px;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 10px;
  display: grid;
  gap: 4px;
}

.site-dropdown-panel[hidden] {
  display: none !important;
}

.site-dropdown-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.site-dropdown-option {
  margin: 0;
  padding: 8px 8px;
  border-radius: 10px;
}

.site-dropdown-option:hover {
  background: rgba(249, 115, 22, 0.08);
}

.site-dropdown-chosen {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.4;
}

.nav-group {
  display: grid;
  gap: 2px;
}

.nav-group+.nav-group {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}

.nav-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--muted) 88%, var(--heading));
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-group-toggle:hover {
  color: var(--heading);
  background: color-mix(in srgb, var(--brand) 8%, transparent);
}

.nav-group.has-active .nav-group-label {
  color: var(--brand);
}

.nav-group-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-group-chevron {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform .18s ease;
  margin-top: -2px;
  opacity: 0.7;
}

.nav-group.open .nav-group-chevron {
  transform: rotate(-135deg);
  margin-top: 2px;
}

.nav-group-items {
  display: grid;
  gap: 2px;
  padding: 0 0 2px;
}

.nav-group-items[hidden] {
  display: none !important;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--ink);
}

.check-row input {
  width: auto;
  margin: 0;
}

.ok-text {
  color: var(--ok);
  font-weight: 600;
}

.grid.two.tight {
  gap: 12px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dimona-banner {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 12px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  background: var(--panel-soft, rgba(255, 255, 255, 0.03));
}

.dimona-banner.info {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
}

.dimona-banner.ok {
  border-color: var(--ok, #22c55e);
  background: rgba(34, 197, 94, 0.08);
}

.dimona-banner.warn {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.dimona-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.dimona-type-card {
  display: grid;
  gap: 8px;
  text-align: left;
  padding: 18px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--input-bg, transparent);
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.dimona-type-card:hover {
  border-color: #3b82f6;
}

.dimona-type-card.active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.dimona-type-icon {
  font-size: 1.4rem;
}

.dimona-type-card span {
  font-size: 0.9rem;
  opacity: 0.75;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.stack-form input[type="date"],
.stack-form input[type="time"],
.stack-form input[type="number"],
.stack-form select,
.stack-form textarea {
  border: 1px solid var(--line);
  background: var(--input-bg);
  border-radius: 10px;
  padding: 11px 12px;
  color: inherit;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 900px) {

  .quote-layout.grid.two,
  .quote-meta-grid.grid.three {
    grid-template-columns: 1fr;
  }

  .qr-block {
    flex-direction: column;
  }

  .form-grid-2,
  .dimona-type-grid {
    grid-template-columns: 1fr;
  }
}

.stack-gap {
  display: grid;
  gap: 16px;
}

.connect-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 4px;
}

.connect-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 132px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--chip, #888) 35%, var(--line));
  background: color-mix(in srgb, var(--chip, #888) 12%, var(--panel));
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.connect-chip span {
  font-weight: 600;
  font-size: 14px;
}

.connect-chip small {
  color: var(--muted);
  font-size: 12px;
}

.connect-chip.connected {
  border-color: color-mix(in srgb, var(--ok, #22c55e) 50%, var(--line));
  background: color-mix(in srgb, var(--ok, #22c55e) 10%, var(--panel));
}

.connect-chip.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.connect-chip .btn {
  margin-top: 6px;
}

.platform-chip.linked {
  border-color: color-mix(in srgb, var(--ok, #22c55e) 45%, var(--line));
}

/* Werf-sessie / foto's per werf */
.site-session-banner {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent, #2563eb) 35%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent, #2563eb) 8%, var(--panel));
}

.site-session-banner p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted, #64748b);
}

.site-item-open {
  outline: 2px solid color-mix(in srgb, var(--accent, #2563eb) 45%, transparent);
  outline-offset: 1px;
}

.site-dirty-hint,
.site-saved-hint {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
}

.site-dirty-hint {
  background: color-mix(in srgb, #f59e0b 14%, var(--panel));
  border: 1px solid color-mix(in srgb, #f59e0b 35%, var(--line));
}

.site-saved-hint {
  background: color-mix(in srgb, #22c55e 12%, var(--panel));
  border: 1px solid color-mix(in srgb, #22c55e 30%, var(--line));
}

.site-dirty-hint[hidden],
.site-saved-hint[hidden] {
  display: none !important;
}

.btn.site-save-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.site-photo-scope {
  margin: 0 0 10px;
  font-size: 12px;
}

/* Werf-foto's & voor/na */
.site-photos-wrap {
  margin-top: 4px;
}

.site-photo-upload .file-upload-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.site-photo-upload select {
  max-width: 140px;
}

.site-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.site-photo-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  cursor: grab;
}

.site-photo-card.dragging {
  opacity: 0.55;
}

.site-photo-card.drag-over {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.site-photo-card.is-cover {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.site-photo-drag {
  position: absolute;
  top: 4px;
  left: 6px;
  z-index: 1;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
}

.site-photo-card img,
.site-photo-card .site-video-thumb {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
}

.site-video-thumb {
  position: relative;
  background: #0a0a0a;
  overflow: hidden;
}

.site-video-thumb video {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
  pointer-events: none;
}

.site-video-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.site-photo-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px 0;
}

.site-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px 0;
}

.site-photo-actions .btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 4px 6px;
  font-size: 11px;
}

.site-gallery-hint {
  margin: 0 0 10px;
  font-size: 12px;
}

.crm-upload-progress {
  margin-top: 10px;
  width: 100%;
}

.crm-upload-progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.crm-upload-progress-bar {
  height: 100%;
  width: 0;
  background: var(--brand);
  transition: width 0.15s ease;
}

.crm-upload-progress-label {
  margin: 6px 0 0;
  font-size: 12px;
}

.site-photo-card p {
  margin: 4px 8px 8px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-pair-preview,
.social-pair-preview img,
.site-pair-item img.site-pair-preview {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-top: 8px;
  background: #0f1318;
}

.social-my-photos,
.social-werf-picker {
  margin: 10px 0 14px;
}

.social-my-photos .social-my-upload {
  margin-bottom: 10px;
}

.social-my-photos .pid-werf-check {
  position: relative;
}

.social-my-photos .pid-werf-check>label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  width: 100%;
}

.social-my-photos .pid-werf-check span {
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-my-photos .social-my-del {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  padding: 0 4px;
  line-height: 1.2;
  min-height: 0;
  background: rgba(15, 19, 24, 0.65);
  color: #fff;
  border-radius: 0 8px 0 6px;
}

.social-werf-picker>label {
  display: block;
  margin-bottom: 10px;
}

.social-werf-pick {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 2px 8px;
}

.social-pair-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.social-pair-preview img {
  width: calc(50% - 4px);
  max-height: 140px;
  margin-top: 0;
}

.social-side-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.social-preview-panel {
  position: sticky;
  top: 12px;
  z-index: 2;
}

.social-preview-hint {
  margin: 0 0 12px;
  font-size: 12px;
}

.social-live-preview {
  min-width: 0;
}

.social-preview-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2, var(--bg-elevated, #141a22));
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.social-preview-head {
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 10px;
  padding: 14px 14px 8px;
  align-items: center;
}

.social-preview-avatar {
  grid-row: 1 / span 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #2a3340;
}

.social-preview-avatar-fallback {
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
}

.social-preview-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.social-preview-who strong {
  font-size: 14px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-preview-who span {
  font-size: 12px;
  color: var(--muted);
}

.social-preview-channels {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.social-preview-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.4;
  color: #fff;
  background: var(--pill, #555);
}

.social-preview-pill.muted-pill {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.social-preview-caption {
  padding: 4px 14px 12px;
  font-size: 14px;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
}

.social-preview-placeholder {
  color: var(--muted);
  font-style: italic;
}

.social-preview-hash {
  color: #3b82f6;
}

.social-preview-media {
  display: grid;
  gap: 2px;
  background: #0b0f14;
  min-height: 160px;
}

.social-preview-media.single {
  grid-template-columns: 1fr;
}

.social-preview-media.duo {
  grid-template-columns: 1fr 1fr;
}

.social-preview-media.grid {
  grid-template-columns: 1fr 1fr;
}

.social-preview-media.empty {
  place-items: center;
  padding: 28px 16px;
  border-top: 1px dashed var(--line);
  background: transparent;
  min-height: 120px;
}

.social-preview-media.empty p {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.social-preview-shot {
  position: relative;
  min-height: 140px;
  max-height: 320px;
  overflow: hidden;
  background: #0f1318;
}

.social-preview-media.single .social-preview-shot {
  max-height: 380px;
}

.social-preview-shot img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 140px;
  max-height: inherit;
  object-fit: cover;
}

.social-preview-more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
}

.social-preview-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .social-preview-panel {
    position: static;
  }
}

.pid-from-werf {
  margin: 10px 0 12px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
}

.pid-werf-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.pid-werf-check {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 88px;
  font-size: 11px;
  color: var(--muted);
}

.pid-werf-check img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.pid-werf-check.pair img {
  width: 120px;
}

.pid-werf-check:has(input:checked) img {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.pid-site-link {
  display: block;
  margin: 0 0 12px;
}

/* Personeel foto's + werf-popup */
.meta-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--brand);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.meta-link:hover,
.meta-link:focus-visible {
  color: var(--brand-dark);
  outline: none;
}

.personnel-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.personnel-avatar.lg {
  width: 52px;
  height: 52px;
}

.personnel-avatar.xl {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  object-fit: cover;
}

.personnel-avatar.xl.is-logo {
  object-fit: contain;
  padding: 8px;
}

.personnel-item-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.personnel-photo-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--item-bg);
}

.profile-section-title {
  margin: 18px 0 8px;
  font-size: 14px;
}

.profile-cred-list {
  display: grid;
  gap: 12px;
  margin: 0 0 10px;
}

.profile-cred-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--item-bg, transparent);
}

.profile-photo,
.profile-photo-fallback {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto;
}

.profile-photo-fallback {
  display: grid;
  place-items: center;
  background: var(--accent, #0f766e);
  color: #fff;
  font-weight: 700;
  font-size: 1.4rem;
}

.profile-avatar-sm {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.profile-avatar-sm.is-fallback {
  display: grid;
  place-items: center;
  background: var(--accent, #0f766e);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}

.personnel-photo-preview {
  text-align: center;
  min-width: 110px;
}

.personnel-photo-actions {
  display: grid;
  gap: 8px;
  align-content: start;
  flex: 1;
  min-width: 180px;
}

.site-people-dialog {
  width: min(520px, 100%);
}

.site-people-list {
  display: grid;
  gap: 10px;
}

.site-people-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--item-bg);
}

.site-people-info {
  min-width: 0;
}

.site-people-info strong {
  display: block;
  color: var(--heading);
}

.site-people-info p {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.4;
}

/* —— Kalender (week/maand) + Google sync —— */
.cal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.cal-side {
  display: grid;
  gap: 16px;
}

.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cal-title {
  margin-left: 4px;
  font-size: 1.05rem;
  text-transform: capitalize;
}

.cal-filter {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  min-width: 160px;
}

.cal-mode-toggle {
  display: flex;
  gap: 6px;
}

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.cal-day {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--item-bg);
  padding: 8px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
}

.cal-day.today {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 25%, transparent);
}

.cal-day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.cal-day-name {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}

.cal-day-num,
.cal-mcell-num {
  border: none;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  border-radius: 8px;
  padding: 2px 8px;
}

.cal-day-num:hover,
.cal-mcell-num:hover {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
}

.cal-day-events,
.cal-mcell-events {
  display: grid;
  gap: 4px;
  align-content: start;
}

.cal-day-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  min-height: 36px;
  cursor: pointer;
}

.cal-day-empty:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.cal-event {
  display: grid;
  gap: 1px;
  text-align: left;
  border: none;
  border-left: 3px solid var(--cal, var(--brand));
  border-radius: 8px;
  padding: 5px 7px;
  background: color-mix(in srgb, var(--cal, var(--brand)) 12%, var(--item-bg));
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.25;
}

.cal-event:hover {
  background: color-mix(in srgb, var(--cal, var(--brand)) 22%, var(--item-bg));
}

.cal-event-time {
  font-weight: 700;
  font-size: 11px;
  opacity: 0.85;
}

.cal-event-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-month-head {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.cal-month {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.cal-mcell {
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--item-bg);
  padding: 6px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 4px;
}

.cal-mcell.outside {
  opacity: 0.45;
}

.cal-mcell.today {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
}

.cal-more {
  font-size: 11px;
  color: var(--muted);
  padding-left: 4px;
}

.cal-editor .stack-form,
.cal-gcal .stack-form {
  gap: 10px;
}

.cal-gcal code {
  font-size: 11px;
  word-break: break-all;
}

.check-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.check-row input {
  width: auto;
  margin: 0;
}

@media (max-width: 1100px) {
  .cal-layout {
    grid-template-columns: 1fr;
  }

  .cal-week {
    grid-template-columns: 1fr;
  }

  .cal-day {
    min-height: 0;
  }
}

@media (max-width: 720px) {

  .cal-month,
  .cal-month-head {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cal-month-head>div:nth-child(n+3) {
    display: none;
  }
}

/* Wagenpark */
.badge.warn {
  background: rgba(217, 119, 6, 0.15);
  color: #b45309;
}

[data-theme="dark"] .badge.warn {
  background: rgba(251, 191, 36, 0.18);
  color: #fbbf24;
}

.badge.danger {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

[data-theme="dark"] .badge.danger {
  background: rgba(248, 113, 113, 0.18);
  color: #f87171;
}

.fleet-vehicle-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.fleet-vehicle-actions>.btn {
  box-sizing: border-box;
  width: 96px;
  min-width: 96px;
  height: 44px;
  padding: 4px 8px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
}

.fleet-license-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 96px;
  line-height: 1.15;
  border: 0;
  color: #fff;
  font-weight: 700;
}

.fleet-license-btn .fleet-license-label {
  font-size: 12px;
}

.fleet-license-btn .fleet-license-until {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.92;
}

.fleet-license-btn.ok {
  background: #16a34a;
}

.fleet-license-btn.ok:hover {
  background: #15803d;
}

.fleet-license-btn.warn {
  background: #ea580c;
}

.fleet-license-btn.warn:hover {
  background: #c2410c;
}

.fleet-license-btn.danger {
  background: #dc2626;
}

.fleet-license-btn.danger:hover {
  background: #b91c1c;
}

[data-theme="dark"] .fleet-license-btn.ok {
  background: #22c55e;
  color: #052e16;
}

[data-theme="dark"] .fleet-license-btn.ok:hover {
  background: #4ade80;
}

[data-theme="dark"] .fleet-license-btn.warn {
  background: #f97316;
  color: #1c1917;
}

[data-theme="dark"] .fleet-license-btn.warn:hover {
  background: #fb923c;
}

[data-theme="dark"] .fleet-license-btn.danger {
  background: #ef4444;
  color: #fff;
}

[data-theme="dark"] .fleet-license-btn.danger:hover {
  background: #f87171;
}

.item.active {
  outline: 1px solid var(--brand, #f97316);
}

.fleet-pdf-preview-root {
  z-index: 140;
}

.fleet-pdf-preview-modal {
  width: min(920px, 100%);
  max-height: min(92vh, 960px);
  display: flex;
  flex-direction: column;
}

.fleet-pdf-preview-frame-wrap {
  flex: 1;
  min-height: min(62vh, 640px);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.fleet-pdf-preview-frame {
  display: block;
  width: 100%;
  height: min(62vh, 640px);
  border: 0;
  background: #fff;
}

.sig-pad-block {
  margin: 10px 0 14px;
}

.sig-pad-canvas {
  display: block;
  width: 100%;
  max-width: 640px;
  height: 160px;
  touch-action: none;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 12px;
  cursor: crosshair;
}

.sig-pad-preview {
  display: block;
  margin-top: 8px;
  max-height: 90px;
  max-width: 260px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
}

/* Dagkansen tabs + sociale kansen */
.dagkansen-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  width: fit-content;
  max-width: 100%;
}

.dagkansen-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
}

.dagkansen-tab:hover {
  color: var(--ink);
}

.dagkansen-tab.is-active {
  background: var(--panel);
  color: var(--heading, var(--ink));
  border-color: var(--line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .dagkansen-tab.is-active {
  background: color-mix(in srgb, var(--brand) 18%, var(--panel-2));
  color: #fff;
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
}

.sk-settings-form {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.sk-fieldset {
  border: 1px solid var(--line, var(--border, #e2e8f0));
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0;
}

.sk-fieldset legend {
  padding: 0 4px;
  font-size: 13px;
  font-weight: 600;
}

.sk-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sk-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--line, #e2e8f0);
  background: var(--panel, transparent);
  cursor: pointer;
}

.sk-settings-form textarea {
  width: 100%;
  min-height: 96px;
  font: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line, #e2e8f0);
  resize: vertical;
}

.sk-hit .omv-result-actions {
  margin-top: 4px;
}

.sk-extraction {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed var(--line, #e2e8f0);
  background: rgba(15, 23, 42, 0.03);
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.sk-extraction .sk-chip {
  margin: 2px 4px 2px 0;
}

.sk-search-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.sk-extraction-head {
  margin-bottom: 4px;
  font-size: 14px;
}

.sk-article-link {
  margin: 0 0 6px;
  font-size: 13px;
}

.sk-article-link a {
  font-weight: 600;
}

/* Dagkansen prospectie */
.omv-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 8px;
}

.omv-search-form label {
  flex: 1 1 220px;
}

.omv-results {
  display: grid;
  gap: 8px;
  margin: 12px 0 20px;
}

.omv-result {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel, transparent);
}

.omv-result-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.omv-result-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  cursor: pointer;
  flex: 1 1 220px;
  min-width: 0;
}

.omv-result-actions {
  flex: 0 0 auto;
  padding-top: 2px;
}

.omv-result.is-assigned {
  opacity: 0.72;
}

.omv-result.is-assigned .omv-result-main {
  cursor: default;
}

.omv-result.is-locked {
  border-style: dashed;
}

.omv-address-blur {
  color: var(--muted, #94a3b8);
  font-style: italic;
}

.omv-result-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.omv-procedure {
  margin-left: 30px;
  display: grid;
  gap: 8px;
}

.omv-procedure-toggle {
  justify-self: start;
}

.omv-procedure-grid {
  display: grid;
  gap: 4px;
  font-size: 0.92rem;
}

.omv-procedure-grid em {
  font-style: normal;
  color: var(--muted, #94a3b8);
  margin-right: 6px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.omv-procedure-loading {
  margin: 0;
}

.omv-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted, #94a3b8);
  font-size: 0.9rem;
}

.omv-result-fields {
  display: grid;
  gap: 2px;
  font-size: 0.95rem;
  color: var(--text, inherit);
}

.omv-result-fields em {
  font-style: normal;
  color: var(--muted, #94a3b8);
  margin-right: 6px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.omv-inzage-link {
  color: var(--accent, #0f766e);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.omv-inzage-link:hover {
  color: var(--accent-strong, #0d9488);
}

.omv-lead-source {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent, #0f766e) 35%, var(--line));
  background: color-mix(in srgb, var(--accent, #0f766e) 10%, var(--panel));
}

.omv-lead-source-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #94a3b8);
}

.lead-hub-head .omv-lead-source {
  margin-top: 8px;
}

.hub-reassign {
  border: 1px solid color-mix(in srgb, var(--accent, #f97316) 40%, var(--line));
  background: color-mix(in srgb, var(--accent, #f97316) 8%, var(--panel));
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 14px;
}

.hub-reassign-form .form-row {
  margin: 0;
}

.hub-reassign-form .btn {
  margin-bottom: 2px;
}

.omv-assign-form {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.omv-assign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.omv-assign-grid .checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
}

.omv-more {
  margin-top: 8px;
}

.omv-select-all {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.omv-select-all input {
  width: 18px;
  height: 18px;
  accent-color: #38bdf8;
}

/* Route planner */
.route-modal {
  width: min(1100px, 96vw);
  max-height: min(92vh, 900px);
  overflow: auto;
}

.route-modal-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-top: 8px;
}

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

.route-map-wrap {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.route-map {
  width: 100%;
  height: min(420px, 50vh);
  border-radius: 12px;
  border: 1px solid var(--line);
  z-index: 1;
  background: #dbe4ee;
}

.route-map-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.route-pin {
  background: transparent !important;
  border: 0 !important;
}

.route-pin-num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #14b8a6;
  color: #042f2e;
  font-weight: 800;
  font-size: 12px;
  border: 2px solid #0f766e;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.route-pin.is-clustered .route-pin-num {
  background: #fbbf24;
  border-color: #d97706;
  color: #1c1917;
}

.route-pin.is-start .route-pin-num {
  background: #1e293b;
  border-color: #0f172a;
  color: #f8fafc;
}

.route-stop-list li.is-off-map {
  opacity: 0.75;
  border-style: dashed;
}

.route-stop-list li.is-start-stop {
  border-style: dashed;
  background: rgba(15, 23, 42, 0.04);
}

.route-stop-list li.is-start-stop .route-stop-seq {
  background: #1e293b;
  color: #f8fafc;
}

.route-start-block {
  display: grid;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.route-start-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.route-start-label,
.route-start-inline {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  min-width: 0;
}

.route-start-label input,
.route-start-inline input {
  width: 100%;
  min-width: 180px;
  font-weight: 400;
}

.route-start-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.route-start-actions .route-start-inline {
  flex: 1 1 220px;
}

.task-route-bar-actions .route-start-inline {
  flex: 1 1 220px;
  min-width: 180px;
}

.route-side {
  display: grid;
  gap: 12px;
  min-width: 0;
  align-content: start;
}

.route-stop-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.route-stop-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.route-stop-seq {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: rgba(20, 184, 166, 0.18);
  color: #0f766e;
}

.route-stop-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.route-stop-actions {
  display: flex;
  gap: 2px;
}

.route-schedule-form {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.route-rep-actions {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.task-route-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line));
  background: color-mix(in srgb, var(--brand) 8%, var(--panel));
}

.task-route-bar-empty {
  border-style: dashed;
  background: color-mix(in srgb, var(--item-bg) 80%, transparent);
}

.task-route-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.task-card-summary-row {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.task-card-summary-row .task-card-summary {
  flex: 1;
  min-width: 0;
}

.task-route-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--label);
  cursor: pointer;
  user-select: none;
  border-right: 1px solid var(--line);
  flex-shrink: 0;
}

.task-route-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.task-route-check-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.task-route-check-row .task-route-check {
  border-right: 0;
  padding: 4px 0;
}

.task-route-addr {
  font-size: 12px;
  font-weight: 500;
}

.task-route-selected {
  outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent);
  outline-offset: -1px;
}

@media (max-width: 720px) {
  .task-route-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .task-route-bar-actions {
    width: 100%;
  }

  .task-route-bar-actions .btn {
    flex: 1;
  }
}

/* —— Lead hub / opvolgbal —— */
.ball-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--item-bg);
  white-space: nowrap;
}

.ball-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.ball-brand {
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}

.ball-warn {
  color: #b45309;
  border-color: color-mix(in srgb, #f59e0b 40%, var(--line));
  background: color-mix(in srgb, #f59e0b 12%, transparent);
}

.ball-ok {
  color: #047857;
  border-color: color-mix(in srgb, #10b981 40%, var(--line));
  background: color-mix(in srgb, #10b981 12%, transparent);
}

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

[data-theme="dark"] .ball-warn {
  color: #fcd34d;
  background: color-mix(in srgb, #f59e0b 18%, transparent);
}

[data-theme="dark"] .ball-ok {
  color: #6ee7b7;
  background: color-mix(in srgb, #10b981 18%, transparent);
}

.next-action-chip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--item-bg);
  border: 1px solid var(--line);
}

.next-action-chip.overdue {
  border-color: color-mix(in srgb, #ef4444 45%, var(--line));
  background: color-mix(in srgb, #ef4444 10%, transparent);
  color: #b91c1c;
}

[data-theme="dark"] .next-action-chip.overdue {
  color: #fca5a5;
}

.task-card-slim {
  padding: 10px 12px;
}

.task-slim-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-slim-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 6px;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.task-slim-main:hover .task-slim-title strong {
  color: var(--brand);
}

.task-slim-title {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
}

.task-slim-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.task-slim-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.lead-hub-head {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.lead-hub-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.lead-hub-head-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lead-hub-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lead-hub-status,
.lead-hub-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.lead-hub-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.lead-hub-guided .lead-hub-layout {
  margin-top: 4px;
}

.lead-hub-main,
.lead-hub-side {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.lead-hub-side {
  position: sticky;
  top: 12px;
}

.lead-hub-main-single {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  max-width: 720px;
}

.lead-hub-head-compact h2 {
  font-size: 1.45rem;
}

.lead-hub-company-link {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  font: inherit;
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-align: left;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--brand) 55%, transparent);
  text-underline-offset: 0.18em;
}

.lead-hub-company-link:hover,
.lead-hub-company-link:focus-visible {
  color: var(--brand);
  text-decoration-color: var(--brand);
  outline: none;
}

.lead-hub-quick-compact {
  font-size: 13px;
}

.lead-hub-subtitle {
  margin: 0;
}

.lead-hub-files-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lead-hub-files-head h3 {
  margin: 0;
}

.lead-hub-files-quick .files-list {
  margin-top: 8px;
}

.followup-form-compact .followup-help-short {
  margin: 0 0 10px;
  font-size: 13px;
}

.followup-mode-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 12px;
  padding: 4px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--item-bg) 70%, var(--panel));
  border: 1px solid var(--line);
}

.followup-mode-tab {
  flex: 1;
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.followup-mode-tab.is-active {
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 80%, transparent);
}

.followup-pending-hint {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 40%, var(--line));
  background: color-mix(in srgb, var(--brand) 12%, var(--panel));
  font-size: 13px;
  line-height: 1.4;
}

.followup-next-plan {
  margin-top: 0;
}

.followup-form .field {
  display: block;
  margin-bottom: 14px;
  min-width: 0;
  flex: 1;
}

.followup-form .field>label,
.followup-form .crm-picker-label {
  display: block;
  margin-bottom: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--label);
}

.followup-form .form-row .field {
  margin-bottom: 0;
}

.crm-picker {
  position: relative;
  z-index: 1;
}

.crm-picker.is-open {
  z-index: 40;
}

.crm-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.crm-picker-trigger:focus-visible,
.crm-picker.is-open .crm-picker-trigger {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 28%, transparent);
}

.crm-picker-value.is-placeholder {
  color: var(--muted);
}

.crm-picker-chevron {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  flex-shrink: 0;
}

.crm-picker.is-open .crm-picker-chevron {
  transform: rotate(180deg);
}

.crm-picker-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: min(320px, 50vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 12px 28px color-mix(in srgb, #000 45%, transparent);
  z-index: 50;
}

.crm-picker-opt {
  display: block;
  width: 100%;
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.crm-picker-opt:hover,
.crm-picker-opt:focus-visible {
  background: color-mix(in srgb, var(--brand) 16%, var(--item-bg));
  outline: none;
}

.crm-picker-opt.is-active {
  background: color-mix(in srgb, var(--brand) 22%, var(--item-bg));
  font-weight: 600;
}

.followup-templates-details,
.followup-next-details,
.hub-advanced-block {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--panel);
}

.followup-templates-details>summary,
.followup-next-details>summary,
.hub-advanced-block>summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.followup-templates-details>summary::-webkit-details-marker,
.followup-next-details>summary::-webkit-details-marker,
.hub-advanced-block>summary::-webkit-details-marker {
  display: none;
}

.followup-templates-details[open],
.followup-next-details[open],
.hub-advanced-block[open] {
  padding-bottom: 12px;
}

.followup-templates-details .followup-templates {
  margin-top: 10px;
}

.followup-hint {
  margin: 0 0 8px;
  font-size: 12px;
}

.hub-advanced-block .tender-via-row {
  margin-top: 10px;
}

.lead-guide {
  padding: 16px 16px 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line));
  background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 12%, var(--panel)), var(--item-bg));
}

.lead-guide-brand {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
}

.lead-guide-warn {
  border-color: color-mix(in srgb, #f59e0b 45%, var(--line));
  background: linear-gradient(160deg, color-mix(in srgb, #f59e0b 14%, var(--panel)), var(--item-bg));
}

.lead-guide-danger {
  border-color: color-mix(in srgb, #ef4444 45%, var(--line));
  background: linear-gradient(160deg, color-mix(in srgb, #ef4444 12%, var(--panel)), var(--item-bg));
}

.lead-guide-ok {
  border-color: color-mix(in srgb, #22c55e 40%, var(--line));
}

.lead-guide-info {
  border-color: color-mix(in srgb, #38bdf8 40%, var(--line));
}

.lead-guide-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.lead-guide-steps {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lead-guide-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  background: var(--panel);
}

.lead-guide-step.is-done {
  border-color: color-mix(in srgb, #22c55e 40%, var(--line));
  color: var(--ink);
}

.lead-guide-step.is-current {
  border-color: var(--brand);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 18%, transparent);
}

.lead-guide-step-n {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  background: color-mix(in srgb, var(--brand) 20%, var(--panel));
  color: var(--ink);
}

.lead-guide-step.is-done .lead-guide-step-n {
  background: color-mix(in srgb, #22c55e 35%, var(--panel));
}

.lead-guide-bar {
  height: 4px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--line) 80%, transparent);
  margin: 0 0 12px;
  overflow: hidden;
}

.lead-guide-bar>span {
  display: block;
  height: 100%;
  background: var(--gradient, var(--brand));
  border-radius: inherit;
}

.lead-guide-title {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.lead-guide-body {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.lead-guide-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lead-guide-ctas .btn {
  width: auto;
}

.lead-hub-accordion-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.lead-hub-accordion-head .hub-tile-chevron {
  flex: 0 0 auto;
}

.lead-hub-accordion-head[aria-expanded="true"] .hub-tile-chevron {
  transform: rotate(-135deg);
}

.lead-hub-accordion-body {
  margin-top: 12px;
}

.lead-hub-tiles-inline {
  display: grid;
  gap: 10px;
}

.lead-hub-main {
  display: grid;
  gap: 14px;
}

.lead-hub-section {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--item-bg);
}

.lead-hub-tiles,
.company-hub-tiles {
  display: grid;
  gap: 10px;
}

.hub-tile {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}

.hub-tile.open {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 10%, transparent);
}

.hub-tile-head {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px 12px;
  align-items: center;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}

.hub-tile-title {
  font-weight: 700;
  font-size: 14px;
}

.hub-tile-summary {
  grid-column: 1 / -2;
  font-size: 12px;
  min-width: 0;
}

.hub-tile-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  justify-self: end;
}

.hub-tile.open .hub-tile-chevron {
  transform: rotate(-135deg);
}

.hub-tile-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

@media (max-width: 960px) {
  .lead-hub-layout {
    grid-template-columns: 1fr;
  }

  .lead-hub-side {
    position: static;
  }

  .task-slim-row {
    flex-wrap: wrap;
  }

  .task-slim-main {
    flex: 1 1 100%;
  }
}

/* —— Leadstatus mappen —— */
.companies-page,
.lead-maps-panel {
  display: grid;
  gap: 16px;
}

.companies-page:not(.companies-page-folder-open) .lead-maps-panel {
  min-height: min(70vh, 640px);
  align-content: center;
}

/* Leadmappen op dashboard (vertegenwoordiger e.d.) */
.companies-page-dashboard {
  margin-bottom: 8px;
}

.companies-page-dashboard-compact:not(.companies-page-folder-open) .lead-maps-panel {
  min-height: 0;
  align-content: start;
}

.companies-page-dashboard-compact .lead-status-panel-home .lead-status-buckets .stat {
  min-height: 108px;
}

.companies-page-dashboard-compact .lead-status-panel-home .lead-status-panel-title {
  font-size: 1.15rem;
}

.lead-status-panel-home .lead-status-panel-title {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.lead-status-panel-home .lead-status-panel-intro {
  font-size: 14px;
}

.lead-status-panel-home .lead-status-buckets {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
}

.lead-status-panel-home .lead-status-buckets .stat {
  min-height: 132px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.lead-status-panel-home .lead-status-buckets .stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.companies-folder-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: var(--bg, #0b1220);
  display: flex;
  flex-direction: column;
  padding: 0;
}

.companies-folder-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 18px 20px;
  box-sizing: border-box;
}

.companies-folder-head {
  display: flex;
  align-items: flex-start;
  gap: 14px 18px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.companies-folder-title-wrap {
  flex: 1 1 180px;
  min-width: 0;
}

.companies-folder-title-wrap h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--heading);
}

.companies-folder-hint {
  margin: 4px 0 0;
  font-size: 13px;
}

.companies-folder-count {
  align-self: center;
  font-size: 13px;
}

.companies-folder-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.companies-folder-body .companies-layout {
  height: 100%;
  min-height: 0;
  align-items: stretch;
}

/* Beide kolommen scrollen zelfstandig binnen de popup-hoogte */
.companies-folder-body .companies-form-panel {
  position: relative;
  top: auto;
  z-index: auto;
  max-height: 100%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Hele rechterkolom scrollt (banners + filters + bezig + lijst) */
.companies-folder-body .companies-list-panel {
  min-height: 0;
  max-height: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.companies-folder-body .companies-list-scroll {
  max-height: none;
  overflow: visible;
}

@media (max-width: 1100px) {
  .companies-folder-body {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .companies-folder-body .companies-layout {
    height: auto;
  }

  .companies-folder-body .companies-form-panel,
  .companies-folder-body .companies-list-panel {
    height: auto;
    max-height: min(70vh, 560px);
  }
}

.lead-status-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.lead-status-panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 1 auto;
}

.lead-status-panel-home .lead-status-panel-actions .btn:not(.ghost):not(.secondary) {
  font-weight: 600;
  min-height: 40px;
  padding-inline: 16px;
}

.lead-status-panel-title {
  margin: 0;
  font-size: 16px;
}

.lead-status-panel-intro {
  margin: 4px 0 0;
  font-size: 13px;
}

.lead-status-buckets {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 4px;
}

.lead-status-buckets .stat .stat-head>span:last-child {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.badge.lead-status {
  border: 1px solid var(--line);
}

.badge.lead-status-nieuw {
  background: color-mix(in srgb, #64748b 14%, transparent);
  color: #334155;
}

.badge.lead-status-warm {
  background: color-mix(in srgb, #f59e0b 16%, transparent);
  color: #92400e;
}

.badge.lead-status-in_aanvraag {
  background: color-mix(in srgb, #0ea5e9 16%, transparent);
  color: #0369a1;
}

.badge.lead-status-prijsofferte_verzonden {
  background: color-mix(in srgb, #06b6d4 16%, transparent);
  color: #0e7490;
}

.badge.lead-status-onderhandeling {
  background: color-mix(in srgb, #3b82f6 16%, transparent);
  color: #1d4ed8;
}

.badge.lead-status-klant {
  background: color-mix(in srgb, #10b981 16%, transparent);
  color: #047857;
}

.badge.lead-status-geen_interesse {
  background: color-mix(in srgb, #ef4444 12%, transparent);
  color: #b91c1c;
}

.badge.lead-status-geannuleerd {
  background: color-mix(in srgb, #94a3b8 14%, transparent);
  color: #475569;
}

.badge.lead-status-ambassadeur {
  background: color-mix(in srgb, #eab308 16%, transparent);
  color: #a16207;
}

.badge.lead-status-on_hold {
  background: color-mix(in srgb, #a855f7 12%, transparent);
  color: #6b21a8;
}

[data-theme="dark"] .badge.lead-status-nieuw {
  background: color-mix(in srgb, #94a3b8 24%, transparent);
  color: #e2e8f0;
  border-color: color-mix(in srgb, #94a3b8 40%, var(--line));
}

[data-theme="dark"] .badge.lead-status-warm {
  background: color-mix(in srgb, #f59e0b 22%, transparent);
  color: #fcd34d;
  border-color: color-mix(in srgb, #f59e0b 40%, var(--line));
}

[data-theme="dark"] .badge.lead-status-in_aanvraag {
  background: color-mix(in srgb, #0ea5e9 22%, transparent);
  color: #7dd3fc;
  border-color: color-mix(in srgb, #0ea5e9 40%, var(--line));
}

[data-theme="dark"] .badge.lead-status-prijsofferte_verzonden {
  background: color-mix(in srgb, #06b6d4 22%, transparent);
  color: #67e8f9;
  border-color: color-mix(in srgb, #06b6d4 40%, var(--line));
}

[data-theme="dark"] .badge.lead-status-onderhandeling {
  background: color-mix(in srgb, #3b82f6 22%, transparent);
  color: #93c5fd;
  border-color: color-mix(in srgb, #3b82f6 40%, var(--line));
}

[data-theme="dark"] .badge.lead-status-klant {
  background: color-mix(in srgb, #10b981 22%, transparent);
  color: #6ee7b7;
  border-color: color-mix(in srgb, #10b981 40%, var(--line));
}

[data-theme="dark"] .badge.lead-status-geen_interesse {
  background: color-mix(in srgb, #ef4444 20%, transparent);
  color: #fca5a5;
  border-color: color-mix(in srgb, #ef4444 40%, var(--line));
}

[data-theme="dark"] .badge.lead-status-geannuleerd {
  background: color-mix(in srgb, #94a3b8 22%, transparent);
  color: #cbd5e1;
  border-color: color-mix(in srgb, #94a3b8 40%, var(--line));
}

[data-theme="dark"] .badge.lead-status-ambassadeur {
  background: color-mix(in srgb, #eab308 22%, transparent);
  color: #fde68a;
  border-color: color-mix(in srgb, #eab308 40%, var(--line));
}

[data-theme="dark"] .badge.lead-status-on_hold {
  background: color-mix(in srgb, #a855f7 24%, transparent);
  color: #e9d5ff;
  border-color: color-mix(in srgb, #a855f7 45%, var(--line));
}

@media (max-width: 1200px) {

  .lead-status-buckets,
  .lead-status-panel-home .lead-status-buckets {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {

  .lead-status-buckets,
  .lead-status-panel-home .lead-status-buckets {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {

  /* Inclusief .lead-status-panel-home: anders blijft desktop 7-koloms layout op gsm */
  .lead-status-buckets,
  .lead-status-panel-home .lead-status-buckets,
  .lead-status-panel-home .hub-home-buckets,
  .lead-status-panel-home .hub-home-buckets.hub-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .companies-folder-shell {
    padding: 12px 12px 16px;
  }

  .companies-folder-head #companies-folder-back {
    width: 100%;
  }
}

/* —— Situatie-tegels (niveau 2 in leadmap) —— */
.lead-situation-panel {
  display: grid;
  gap: 16px;
  align-content: start;
  height: 100%;
  overflow: auto;
  padding: 4px 2px 12px;
}

.lead-situation-buckets {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.lead-situation-buckets .stat {
  min-height: 120px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.lead-situation-buckets .stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.companies-folder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.companies-folder-searchbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
}

.companies-folder-searchbar input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--bg);
  color: var(--ink);
}

.companies-folder-searchbar input[type="search"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.18);
}

.companies-folder-searchbar input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}

.companies-folder-body .companies-list-panel-solo,
.companies-folder-body .companies-layout-detail {
  height: 100%;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.companies-layout-detail {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

.companies-folder-body .companies-list-panel-solo .companies-list-scroll {
  max-height: none;
  overflow: visible;
}

.lead-forward-modal,
.company-create-modal {
  z-index: 140;
}

.lead-action-modal {
  max-width: min(560px, 94vw);
  max-height: min(90vh, 860px);
  overflow-y: auto;
}

@media (max-width: 1100px) {
  .lead-situation-buckets {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .lead-situation-buckets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .companies-folder-actions {
    width: 100%;
  }

  .companies-folder-actions .btn {
    flex: 1 1 auto;
  }
}

/* —— Opdrachten: tegel-hiërarchie —— */
.tasks-page,
.tasks-page .lead-maps-panel {
  display: grid;
  gap: 16px;
}

.tasks-page:not(.tasks-page-folder-open) .lead-maps-panel {
  min-height: min(70vh, 640px);
  align-content: center;
}

.tasks-folder-modal .companies-folder-body {
  overflow: auto;
}

.tasks-list-panel-solo {
  height: 100%;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.task-situation-buckets {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.task-situation-buckets .stat {
  min-height: 120px;
  cursor: pointer;
}

@media (max-width: 720px) {
  .task-situation-buckets {
    grid-template-columns: 1fr;
  }
}

/* —— Mijn wagen: tegeloverzicht —— */
.my-vehicle-page {
  display: grid;
  gap: 16px;
}

.my-vehicle-maps .lead-status-panel-home .lead-status-buckets.my-vehicle-buckets {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.my-vehicle-buckets .stat {
  min-height: 120px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.my-vehicle-buckets .stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.my-vehicle-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.my-vehicle-detail-head h2 {
  margin: 0;
  flex: 1 1 auto;
}

.my-vehicle-section {
  margin-top: 4px;
}

@media (max-width: 900px) {
  .my-vehicle-maps .lead-status-panel-home .lead-status-buckets.my-vehicle-buckets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* —— Hub-tegels: Overzicht / Mijn dag / Offertes / Activiteiten —— */
.hub-home-page {
  display: grid;
  gap: 16px;
}

.hub-home-page .lead-maps-panel {
  min-height: min(70vh, 640px);
  align-content: center;
}

.hub-home-compact .lead-maps-panel {
  min-height: 0;
}

.hub-home-buckets .stat {
  min-height: 120px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.hub-home-buckets .stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Specifiek genoeg om .lead-status-panel-home .lead-status-buckets (7 kol) te overrulen */
.lead-status-panel-home .hub-home-buckets.hub-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hub-detail-page {
  display: grid;
  gap: 12px;
}

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

@media (max-width: 720px) {
  .hub-home-page .lead-maps-panel {
    min-height: 0;
  }

  .lead-status-panel-home .hub-home-buckets .stat,
  .lead-status-panel-home .lead-status-buckets .stat {
    min-height: 108px;
    padding: 12px 12px 10px;
  }
}

/* —— Aanbestedingsbron —— */
.badge.tender-source {
  background: color-mix(in srgb, #0f766e 18%, transparent);
  color: #0f766e;
  border: 1px solid color-mix(in srgb, #0f766e 40%, var(--line));
  font-weight: 700;
}

[data-theme="dark"] .badge.tender-source {
  background: color-mix(in srgb, #14b8a6 20%, transparent);
  color: #5eead4;
  border-color: color-mix(in srgb, #14b8a6 45%, var(--line));
}

.tender-source-banner {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, #0f766e 35%, var(--line));
  background: color-mix(in srgb, #0f766e 10%, var(--item-bg));
}

.tender-source-banner strong {
  display: block;
  margin-bottom: 4px;
  color: #0f766e;
}

[data-theme="dark"] .tender-source-banner {
  border-color: color-mix(in srgb, #14b8a6 40%, var(--line));
  background: color-mix(in srgb, #14b8a6 12%, var(--item-bg));
}

[data-theme="dark"] .tender-source-banner strong {
  color: #5eead4;
}

.tender-source-banner p {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.4;
}

.tender-url-field {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
}

.tender-url-field>label {
  margin: 0;
}

.tender-url-open-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}

.tender-url-open-wrap .tender-url-open {
  text-decoration: none;
}

.tender-source-banner .tender-source-project-links {
  font-size: 13px;
}

.tender-source-banner .tender-source-project-links strong {
  display: inline;
  margin: 0 4px 0 0;
  color: inherit;
}

.tender-source-banner p:last-child {
  margin-bottom: 0;
}

.tender-source-link {
  font-size: 12px !important;
  word-break: break-all;
}

.tender-fields {
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed color-mix(in srgb, #0f766e 30%, var(--line));
  background: color-mix(in srgb, #0f766e 6%, transparent);
}

.tender-via-row {
  margin-bottom: 8px !important;
}

.lead-hub-tender {
  margin-top: 4px;
}

.lead-hub-tender .tender-source-banner {
  margin-bottom: 0;
}

/* Mobiel: vernieuwen / sessie-check */
.mobile-refresh-btn,
.session-refresh-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.mobile-refresh-btn.is-refreshing,
.session-refresh-btn.is-refreshing,
.session-refresh-btn-desktop.is-refreshing {
  opacity: 0.55;
  pointer-events: none;
  animation: crm-refresh-spin 0.8s linear infinite;
}

@keyframes crm-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

/* CRM fotoviewer — swipe + pinch/dubbeltik zoom op gsm */
body.crm-lightbox-open {
  overflow: hidden;
  touch-action: none;
}

.crm-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.crm-lightbox-top {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #fff;
  z-index: 2;
}

.crm-lightbox-top strong {
  font-size: 0.95rem;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-lightbox-close,
.crm-lightbox-nav {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(24, 24, 27, 0.75);
  color: #fff;
  border-radius: 999px;
  width: 44px;
  height: 44px;
  font-size: 1.25rem;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.crm-lightbox-stage {
  position: relative;
  width: min(960px, 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  touch-action: none;
}

.crm-lightbox-zoom {
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  will-change: transform;
  max-width: 100%;
}

.crm-lightbox-stage img,
.crm-lightbox-stage .crm-lightbox-video {
  max-width: min(860px, calc(100vw - 120px));
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: 10px;
  background: #000;
}

.crm-lightbox-stage img {
  pointer-events: auto;
  -webkit-user-drag: none;
  display: block;
  touch-action: none;
}

.crm-lightbox-stage .crm-lightbox-video {
  width: min(860px, calc(100vw - 120px));
  pointer-events: auto;
}

.crm-lightbox-stage.is-zoomed .crm-lightbox-nav {
  opacity: 0.35;
  pointer-events: none;
}

.crm-lightbox-count {
  margin-top: 12px;
  color: #d4d4d8;
  font-size: 0.85rem;
  text-align: center;
  padding: 0 12px;
}

@media (max-width: 640px) {
  .crm-lightbox {
    padding: 56px 0 24px;
  }

  .crm-lightbox-stage {
    width: 100%;
    min-height: min(70vh, 520px);
  }

  .crm-lightbox-stage img,
  .crm-lightbox-stage .crm-lightbox-video {
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 140px);
  }

  .crm-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: rgba(24, 24, 27, 0.85);
  }

  .crm-lightbox-nav#crm-lb-prev {
    left: 8px;
  }

  .crm-lightbox-nav#crm-lb-next {
    right: 8px;
  }
}

/* Project hub */
.badge.tone-ok {
  background: color-mix(in srgb, var(--ok, #16a34a) 18%, transparent);
  color: var(--ok, #15803d);
}

.badge.tone-warn {
  background: color-mix(in srgb, var(--warn, #d97706) 18%, transparent);
  color: var(--warn, #b45309);
}

.badge.tone-danger {
  background: color-mix(in srgb, var(--danger, #dc2626) 18%, transparent);
  color: var(--danger, #b91c1c);
}

.badge.tone-neutral {
  background: var(--panel-2, #f4f4f5);
  color: var(--muted, #71717a);
}

.stat-mini {
  border: 1px solid var(--line, #e4e4e7);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--panel, #fff);
}

.stat-mini strong {
  display: block;
  font-size: 1.15rem;
}

.stat-mini span {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--muted, #71717a);
}

.project-card {
  cursor: pointer;
}

.project-tabs {
  margin: 12px 0 4px;
  flex-wrap: wrap;
}

/* Overzicht: A–Z adresboek (naam → fiche) */
.companies-directory-panel {
  margin-top: 16px;
}

.companies-directory-list {
  max-height: min(60vh, 520px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.companies-directory-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.companies-directory-row:hover,
.companies-directory-row:focus-visible {
  background: color-mix(in srgb, var(--brand, #3b82f6) 10%, var(--panel-2, var(--panel, transparent)));
  outline: none;
}

.companies-directory-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.companies-directory-chevron {
  flex-shrink: 0;
  color: var(--muted, #71717a);
  font-size: 0.95rem;
}

/* ——— HubSpot-achtige index chrome, kanban, preview, overflow (UX fases A–E) ——— */

.crm-index-chrome {
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.crm-index-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.crm-index-title {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--heading);
}

.crm-index-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.crm-index-tabs-row {
  margin-bottom: 12px;
}

.crm-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.crm-view-tab {
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.crm-view-tab strong {
  margin-left: 4px;
  color: var(--ink);
}

.crm-view-tab.active {
  background: var(--gradient, var(--brand));
  border-color: transparent;
  color: var(--btn-text, #fff);
}

.crm-view-tab.active strong {
  color: inherit;
}

.crm-mode-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.crm-mode-btn {
  border: 0;
  background: var(--input-bg);
  color: var(--muted);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.crm-mode-btn+.crm-mode-btn {
  border-left: 1px solid var(--line);
}

.crm-mode-btn.active {
  background: var(--brand);
  color: var(--btn-text, #fff);
}

.crm-index-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.crm-search-wrap {
  flex: 1;
  min-width: 180px;
}

.crm-search-input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
}

.crm-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.crm-filter-chip {
  border: 1px solid var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.crm-filter-drawer {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input-bg);
}

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

.crm-kanban {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  align-items: flex-start;
}

.crm-kanban-col {
  flex: 0 0 260px;
  max-width: 280px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-height: 180px;
  border-top: 3px solid var(--brand);
}

.crm-kanban-col.tone-warn {
  border-top-color: #f59e0b;
}

.crm-kanban-col.tone-ok {
  border-top-color: #22c55e;
}

.crm-kanban-col.tone-info {
  border-top-color: #3b82f6;
}

.crm-kanban-col.tone-danger {
  border-top-color: #ef4444;
}

.crm-kanban-col.tone-violet {
  border-top-color: #8b5cf6;
}

.crm-kanban-col.tone-accent {
  border-top-color: #f97316;
}

.crm-kanban-col.tone-neutral {
  border-top-color: #94a3b8;
}

.crm-kanban-col.tone-brand {
  border-top-color: var(--brand);
}

.crm-kanban-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.crm-kanban-col-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--heading);
}

.crm-kanban-col-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(62vh, 640px);
  overflow-y: auto;
}

.crm-kanban-empty {
  margin: 8px;
  font-size: 12px;
}

.crm-kanban-add {
  margin: 0 8px 8px;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  padding: 8px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.crm-kanban-add:hover {
  border-color: var(--brand);
  color: var(--ink);
}

.company-card-compact,
.task-card-compact,
.pipe-card-compact {
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
}

.crm-tile-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.crm-tile-main {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
}

.crm-tile-title {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--heading);
  line-height: 1.25;
}

.crm-tile-sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-tile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
}

.crm-tile-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.crm-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
}

.crm-icon-btn.is-disabled {
  opacity: 0.35;
  cursor: default;
}

.crm-activity-badge {
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.crm-activity-badge.is-overdue {
  border-color: #ef4444;
  color: #ef4444;
}

.crm-overflow {
  position: relative;
  flex-shrink: 0;
}

.crm-overflow-toggle {
  min-width: 32px;
  padding-left: 8px !important;
  padding-right: 8px !important;
  font-size: 16px;
  line-height: 1;
}

.crm-overflow-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  min-width: 180px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.crm-overflow-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.crm-overflow-item:hover {
  background: var(--input-bg);
}

.crm-overflow-item.is-danger {
  color: #ef4444;
}

.crm-overflow-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.crm-record-actions {
  align-items: center;
}

.crm-record-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}

.crm-preview-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.crm-preview-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.crm-preview-panel {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  max-height: min(86vh, 720px);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  padding: 18px;
}

.crm-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.crm-preview-head h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--heading);
}

.crm-preview-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.crm-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.crm-preview-col h4 {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.crm-preview-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crm-preview-timeline li {
  display: flex;
  gap: 10px;
}

.crm-preview-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}

.crm-preview-next {
  font-weight: 800;
  color: var(--heading);
  margin: 0 0 10px;
}

.crm-preview-next.is-overdue {
  color: #ef4444;
}

.crm-preview-facts p {
  margin: 0 0 6px;
  font-size: 13px;
}

.pipe-card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.crm-compact-list .company-card-compact {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .crm-preview-grid {
    grid-template-columns: 1fr;
  }

  .crm-kanban-col {
    flex-basis: 220px;
  }

  .crm-index-head {
    flex-direction: column;
  }
}