:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface-2: #243044;
  --border: #2d3f56;
  --text: #e8edf4;
  --muted: #8fa3bc;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.15);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #a855f7;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.page { max-width: 1400px; margin: 0 auto; padding: 24px; }

.hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f1419 60%, #1a1a2e 100%);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 40px 32px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
}

.hero h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 8px; }
.subtitle { color: var(--muted); font-size: 17px; max-width: 560px; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.hero-meta span {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.stat-card .label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card .value {
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.stat-card.highlight { border-color: var(--accent); background: var(--accent-soft); }
.stat-card.highlight .value { color: #93c5fd; }
.stat-card[style*="--stat-accent"] { border-color: var(--stat-accent); }

.week-picker {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.week-picker label { font-size: 14px; color: var(--muted); }

.week-picker select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  min-width: 220px;
}

.summary-box {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  font-size: 16px;
}

.summary-box p { margin: 0; }

.panel-desc {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.highlight-panel {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(59,130,246,0.08) 0%, var(--surface) 100%);
}

.activity-badge {
  background: color-mix(in srgb, var(--act-color) 20%, transparent);
  color: var(--act-color);
  border: 1px solid color-mix(in srgb, var(--act-color) 40%, transparent);
}

.activity-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-header h2 { font-size: 20px; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

input, select, textarea, button {
  font: inherit;
}

input[type="search"],
input[type="text"],
input[type="date"],
input[type="password"],
select,
textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.chart-bars { display: flex; flex-direction: column; gap: 12px; }

.bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 48px;
  align-items: center;
  gap: 12px;
}

.bar-label { font-size: 14px; color: var(--muted); }

.bar-track {
  height: 28px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #6366f1);
  min-width: 4px;
  transition: width 0.4s ease;
}

.bar-count { text-align: right; font-weight: 600; font-size: 14px; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tr:hover td { background: rgba(255, 255, 255, 0.02); }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-afspraak { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.badge-geen { background: rgba(143, 163, 188, 0.2); color: var(--muted); }
.badge-nieuw { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; }
.badge-gewonnen { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.badge-verloren { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.badge-followup { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.badge-onbekend { background: rgba(143, 163, 188, 0.15); color: var(--muted); }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 32px;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 24px 0 8px;
}

/* Admin page */
.admin-layout { max-width: 900px; margin: 0 auto; padding: 24px; }

.admin-header {
  margin-bottom: 28px;
}

.admin-header h1 { font-size: 28px; margin-bottom: 8px; }
.admin-header p { color: var(--muted); }

.admin-nav {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, opacity 0.15s;
}

.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: white; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid .full { grid-column: 1 / -1; }

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-group { margin-bottom: 4px; }

.hint-box {
  background: var(--accent-soft);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 24px;
  color: #bfdbfe;
  font-size: 14px;
}

.lead-list { display: flex; flex-direction: column; gap: 12px; }

.lead-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.lead-item-info h3 { font-size: 16px; margin-bottom: 4px; }
.lead-item-info p { font-size: 13px; color: var(--muted); }

.lead-item-actions { display: flex; gap: 8px; flex-shrink: 0; }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--success);
  color: white;
  padding: 14px 20px;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 100;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 100px 1fr 36px; }
  .lead-item { flex-direction: column; }
  .pipeline { grid-template-columns: 1fr; }
}

/* Pipeline / Kanban */
.pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.pipeline-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.pipeline-col-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  border-top: 3px solid var(--step-color, var(--accent));
}

.pipeline-col-header h3 {
  font-size: 14px;
  line-height: 1.35;
  margin-bottom: 6px;
}

.pipeline-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface);
  font-weight: 700;
  font-size: 14px;
}

.pipeline-cards {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.pipeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.pipeline-card h4 {
  font-size: 14px;
  margin-bottom: 8px;
  line-height: 1.3;
}

.pipeline-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.pipeline-card-meta .tag {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 999px;
}

.pipeline-card-meta .tag.late {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.pipeline-card-meta .tag.assignee {
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
}

.pipeline-card-meta .tag.appt {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

.pipeline-card-meta .tag.regio {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

.badge-intake { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }
.badge-maten { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; }
.badge-offerte { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }

.funnel-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.funnel-step {
  text-align: center;
  padding: 16px 12px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-bottom: 3px solid var(--step-color, var(--accent));
}

.funnel-step .num {
  font-size: 28px;
  font-weight: 700;
  display: block;
}

.funnel-step .lbl {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.3;
}

@media (max-width: 900px) {
  .funnel-summary { grid-template-columns: repeat(2, 1fr); }
  .pipeline { grid-template-columns: repeat(4, minmax(260px, 1fr)); }
}

/* Call Activity Dashboard */
.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.btn-accent {
  background: #f59e0b;
  color: #1a1a1a;
  border: none;
  font-weight: 600;
}

.btn-accent:hover { background: #fbbf24; }

.hero-dashboard { margin-bottom: 20px; }

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.hub-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
}

.hub-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.hub-primary { border-color: var(--accent); background: var(--accent-soft); }

.hub-icon { font-size: 32px; display: block; margin-bottom: 12px; }

.hub-card h2 { font-size: 20px; margin-bottom: 10px; }

.hub-card p { color: var(--muted); font-size: 14px; line-height: 1.6; }

.hub-link { display: inline-block; margin-top: 16px; color: #93c5fd; font-weight: 600; font-size: 14px; }

.filter-panel h2 { font-size: 18px; margin-bottom: 16px; }

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.kpi-card.highlight { border-color: var(--accent); background: var(--accent-soft); }
.kpi-card.success { border-color: var(--success); background: rgba(34, 197, 94, 0.1); }

.kpi-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; line-height: 1.3; }

.kpi-value { font-size: 26px; font-weight: 700; }

.muted-text { color: var(--muted); font-size: 13px; }

.table-wide table { font-size: 13px; }
.table-wide th, .table-wide td { padding: 10px 12px; }

.form-grid-wide { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.day-block {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  margin-bottom: 20px;
}

.day-block h3 { font-size: 16px; margin-bottom: 10px; }

.day-count {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}

.day-list { list-style: none; padding: 0; }

.day-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.day-list li:last-child { border-bottom: none; }

