:root {
  --ink: #2b2b2b;
  --ink-soft: #6b6b6b;
  --bar: #353535;
  --hero: #3a3a3a;
  --yellow: #ffd200;
  --yellow-ink: #3a3000;
  --bg: #f2f2f2;
  --card: #fff;
  --line: #ececec;
  --green: #2e9e5b;
  --green-bg: #e7f6ec;
  --blue: #3b7ddd;
  --blue-bg: #eaf1fb;
  --orange: #e8892c;
  --red: #d94141;
  --radius: 14px;
  font-family: "Catamaran", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; }
a { color: inherit; }
.muted { color: #a5a5a5; }

/* ---------- top bar ---------- */
.topbar { height: 64px; background: var(--bar); display: flex; align-items: center; justify-content: space-between; color: #fff; }
.brand-corner {
  width: 72px; height: 64px; background: var(--yellow); color: #fff; font-size: 22px;
  display: grid; place-items: center; clip-path: polygon(0 0, 100% 0, 100% 78%, 0 100%);
}
.topnav { display: flex; gap: 40px; padding-right: 36px; font-size: 15px; }
.topnav a { text-decoration: none; opacity: .8; }
.topnav a:hover { opacity: 1; }

.page { max-width: 1500px; margin: 0 auto; padding: 32px 28px 60px; }

/* ---------- hero ---------- */
.hero {
  background: var(--hero); color: #fff; border-radius: var(--radius); padding: 26px 30px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px;
}
.eyebrow { color: var(--yellow); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.hero h1 { margin: 4px 0 6px; font-size: 28px; font-weight: 600; }
.hero-meta { margin: 0; color: #cfcfcf; font-size: 14px; }
.hero-meta strong { color: #fff; }
.dot { margin: 0 6px; color: #888; }


/* ---------- table ---------- */
.table-card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.04); margin-bottom: 18px; }
.prospects { width: 100%; border-collapse: collapse; }
.prospects th {
  text-align: left; font-size: 12px; font-weight: 500; color: #8a8a8a; padding: 14px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.prospects td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.prospects .c { text-align: center; }
.prospects .name { font-weight: 600; }
.action-col { width: 260px; }

.row td:first-child { box-shadow: inset 4px 0 0 var(--row-accent, #d6d6d6); }
.row[data-status="appointment-booked"] { --row-accent: var(--green); background: var(--green-bg); }
.row[data-status="call-back-required"] { --row-accent: var(--blue); background: var(--blue-bg); }
.row[data-status="message-left"] { --row-accent: var(--orange); }
.row[data-status="bad-number"], .row[data-status="do-not-call"] { --row-accent: var(--red); }
.row[data-status="not-interested"] { --row-accent: #9a9a9a; }

.view-btn { display: inline-block; border: 1px solid #e2e2e2; border-radius: 8px; padding: 5px 10px; font-size: 13px; background: #fff; }
.badge-yes { display: inline-block; background: var(--green-bg); color: var(--green); border-radius: 8px; padding: 5px 12px; font-weight: 600; font-size: 13px; }

.status-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.status-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #aaa; }
.s-appointment-booked::before { background: var(--green); }
.s-call-back-required::before { background: var(--blue); }
.s-message-left::before { background: var(--orange); }
.s-bad-number::before, .s-do-not-call::before { background: var(--red); }

/* ---------- buttons ---------- */
.btn {
  border: 0; border-radius: 8px; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-yellow { background: var(--yellow); color: var(--yellow-ink); }
.btn-yellow:not(:disabled):hover { filter: brightness(.95); }
.btn-dark { background: #3a3a3a; color: #fff; }
.btn-ghost { background: transparent; color: #fff; border: 1px solid #5a5a5a; }
.call-btn svg { width: 14px; height: 14px; fill: currentColor; }

/* ---------- live status pill ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 99px; padding: 6px 14px;
  font-size: 13px; font-weight: 600; background: #f1f1f1; color: #555; white-space: nowrap;
}
.pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.2s ease-in-out infinite; }
.pill-ringing { background: #fff6cc; color: #8a6d00; }
.pill-on_call { background: var(--green-bg); color: var(--green); }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- outcome ---------- */
.outcome { display: inline-flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.outcome-row { display: flex; gap: 6px; }
.outcome select { font: inherit; font-size: 13px; border: 1px solid #d9d9d9; border-radius: 8px; padding: 6px 8px; background: #fff; }
.ended-note { display: block; color: var(--ink-soft); font-size: 12px; margin-top: 3px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #2f2f2f; color: #fff; padding: 10px 18px; border-radius: 10px; transition: all .2s; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); }

/* ---------- debug + login ---------- */
.debug td { font-size: 13px; vertical-align: top; }
.debug pre { white-space: pre-wrap; word-break: break-all; font-size: 12px; max-width: 900px; }
.debug summary { cursor: pointer; color: var(--ink-soft); }
.yes { color: var(--green); font-weight: 600; }

.login-page { display: grid; place-items: center; min-height: 100vh; background: var(--bar); }
.login-card { background: var(--hero); color: #fff; padding: 32px; border-radius: var(--radius); width: 320px; display: grid; gap: 12px; }
.login-card h1 { margin: 0 0 6px; }
.login-card input { font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid #555; background: #2c2c2c; color: #fff; }
.login-error { color: #ff9a9a; margin: 0; }

@media (max-width: 1100px) {
  .prospects th:nth-child(4), .prospects td:nth-child(4), .prospects th:nth-child(7), .prospects td:nth-child(7) { display: none; }
  .hero { flex-direction: column; }
}

.err { color: var(--red); }
.call-count { display: block; color: var(--ink-soft); font-size: 12px; margin-top: 4px; }
