/* Intake workbench — internal tool, app-shell language.
   Design philosophy: not a marketing page. Dense, functional, live state,
   keyboard-first. Overtoom brand tokens on neutral app chrome. Fonts
   self-hosted (CSP font-src 'self'). */

@font-face { font-family: "Inter"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("/fonts/outfit.woff2") format("woff2"); font-weight: 600 800; font-display: swap; }

:root {
  --brown: #492a23;
  --coral: #ff7a00;
  --coral-deep: #b8480e;
  --green: #25d366;
  --ink: #2b2320;
  --muted: #8a7d77;
  --line: #ece8e4;
  --chrome: #f7f5f2;
  --panel: #ffffff;
  --sidebar: #ffffff;
  --error: #e5484d;
  --font: "Inter", system-ui, sans-serif;
  --head: "Outfit", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--chrome);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}
kbd {
  font-family: var(--font);
  font-size: 0.75rem;
  background: rgba(255,255,255,0.25);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
}

.shell { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: 244px;
  flex: none;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
}
.brand { padding: 4px 8px 24px; }
.brand img { height: 26px; width: auto; display: block; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  color: var(--muted); text-decoration: none;
  font-weight: 500; font-size: 0.9375rem;
}
.nav-item.active { background: #fff4ec; color: var(--coral-deep); }
.nav-icon { font-size: 1.05rem; line-height: 1; }

.side-stat {
  margin-top: 20px; padding: 16px;
  background: var(--chrome); border-radius: 12px;
}
.side-stat-num { font-family: var(--head); font-weight: 800; font-size: 2rem; line-height: 1; color: var(--brown); }
.side-stat-label { font-size: 0.8125rem; color: var(--muted); margin-top: 2px; }

.sidebar-foot { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); }
.agent-line { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.agent-avatar {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  background: var(--brown); color: #fff;
  border-radius: 50%; font-weight: 700; font-size: 0.8125rem;
}
.agent-name { font-weight: 600; font-size: 0.875rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-switch { border: 0; background: none; color: var(--coral); font: inherit; font-size: 0.8125rem; cursor: pointer; }
.conn-line { display: flex; align-items: center; gap: 7px; font-size: 0.8125rem; color: var(--muted); }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: #cbb; flex: none; }
.conn-dot.ok { background: var(--green); }
.conn-dot.bad { background: var(--error); }

/* ── Work area ───────────────────────────────────────────────────────────── */
.work { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 32px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.topbar h1 { font-family: var(--head); font-weight: 700; font-size: 1.375rem; letter-spacing: -0.02em; }
.topbar .sub { color: var(--muted); font-size: 0.9375rem; margin-top: 2px; }
.campaign-chip {
  flex: none; background: var(--chrome); border: 1px solid var(--line);
  border-radius: 1000px; padding: 7px 14px; font-size: 0.8125rem; color: var(--muted);
}
.campaign-chip b { color: var(--brown); }

.grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px; padding: 24px 32px; align-items: start;
}
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  font-weight: 600; font-size: 0.9375rem;
}

/* ── Form ────────────────────────────────────────────────────────────────── */
.form { padding: 20px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: #fff; border: 1px solid #ddd6d1; border-radius: 9px; padding: 11px 13px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 3px rgba(255,122,0,0.15); }
.phone-row { display: flex; gap: 8px; }
/* Vaste breedte voor de landcode. Zonder deze basis erft de select de
   width:100% van .field select en duwt hij het nummerveld tot een streepje. */
.phone-row .prefix {
  flex: 0 0 112px; width: auto;
  display: grid; place-items: center; background: var(--chrome);
  border: 1px solid #ddd6d1; border-radius: 9px; padding: 0 13px; font-weight: 600;
}
select.prefix { display: block; font: inherit; font-weight: 600; cursor: pointer; }
.phone-row input { flex: 1; }

.btn-primary {
  width: 100%; font: inherit; font-weight: 600; font-size: 1rem; color: #fff;
  background: var(--coral); border: 0; border-radius: 9px; padding: 12px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.12s ease;
}
.btn-primary:hover:not(:disabled) { background: var(--coral-deep); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.status { margin-top: 14px; padding: 0; font-size: 0.9375rem; font-weight: 500; border-radius: 9px; }
.status:empty { display: none; }
.status.busy { padding: 10px 13px; background: var(--chrome); color: var(--muted); }
.status.ok { padding: 10px 13px; background: #eafaf0; color: #0a8c50; }
.status.err { padding: 10px 13px; background: #fdecec; color: var(--error); }

/* ── Confirmation / countdown ────────────────────────────────────────────── */
.confirm { padding: 28px 20px; text-align: center; }
.countdown { position: relative; width: 104px; height: 104px; margin: 0 auto 16px; }
.ring { width: 104px; height: 104px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #efece8; stroke-width: 7; }
.ring-fg { fill: none; stroke: var(--coral); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--head); font-weight: 800; font-size: 1.75rem; }
.confirm-name { font-family: var(--head); font-weight: 700; font-size: 1.25rem; }
.confirm-phone { color: var(--muted); margin-bottom: 14px; }
.confirm-sub { font-size: 0.875rem; color: var(--muted); margin-bottom: 16px; }

/* Bekend nummer. De rand draagt de betekenis: rood is een stop, oranje is
   "kijk hier even naar voordat je doorgaat". */
.known { padding: 28px 20px; text-align: center; }
.known-mark {
  width: 44px; height: 44px; margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 50%; border: 2px solid var(--coral); color: var(--coral);
  font-family: var(--head); font-weight: 800; font-size: 1.25rem;
}
.known.stop .known-mark { border-color: var(--error); color: var(--error); }
.known-history {
  list-style: none; margin: 0 0 18px; padding: 14px 16px;
  background: var(--chrome); border-radius: 12px;
  text-align: left; font-size: 0.875rem; color: var(--ink);
  display: flex; flex-direction: column; gap: 6px;
}
.known-history li { display: flex; justify-content: space-between; gap: 12px; }
.known-history span { color: var(--muted); }
.known-history:empty { display: none; }
.known .btn-primary { margin-bottom: 10px; }
/* Bij een opt-out draagt de knop de ernst van wat je doet: dit is geen
   gewone bevestiging, en hij hoort niet op de coral van "aanmelden" te lijken. */
.known.stop .btn-primary { background: var(--error); }
.known.stop .btn-primary:hover { background: #c93a3e; }
.btn-ghost {
  font: inherit; font-weight: 600; color: var(--brown); background: var(--chrome);
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 24px; cursor: pointer;
}
.btn-ghost:hover { background: var(--line); }

/* ── Feed ────────────────────────────────────────────────────────────────── */
.count-pill { background: var(--chrome); border-radius: 1000px; padding: 2px 10px; font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.feed { list-style: none; max-height: 460px; overflow-y: auto; }
.feed-empty { padding: 28px 20px; color: var(--muted); font-size: 0.9375rem; text-align: center; }
.feed-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: 0; }
.feed-av { width: 32px; height: 32px; flex: none; display: grid; place-items: center; background: var(--chrome); border-radius: 50%; font-weight: 700; font-size: 0.8125rem; color: var(--brown); }
.feed-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.feed-name { font-weight: 600; font-size: 0.9375rem; }
.feed-meta { font-size: 0.8125rem; color: var(--muted); }
.feed-badge { flex: none; font-size: 0.75rem; font-weight: 600; padding: 3px 9px; border-radius: 1000px; }
.badge-scheduled { background: #fff4ec; color: var(--coral-deep); }
.badge-active { background: #eafaf0; color: #0a8c50; }
.badge-opted_out { background: #f2efec; color: var(--muted); }
.badge-completed { background: #eef2fb; color: #3557b7; }
