/* Client Finder for CodeNest — design tokens (one choice per axis) */
:root {
  --brand: #0F766E;
  --brand-dark: #115E59;
  --bg: #FAF8F4;
  --card: #FFFFFF;
  --ink: #1C1917;
  --text-2: #57534E;
  --line: rgba(28, 25, 23, 0.10);
  --radius-card: 14px;
  --radius-btn: 10px;
  --space: 8px;
  --dot-new: #A8A29E;
  --dot-emailed: #0F766E;
  --dot-replied: #15803D;
  --dot-interested: #115E59;
  --dot-bounced: #B91C1C;
  --amber-soft: #FEF3C7;
  --red-soft: #FEF2F2;
  --teal-soft: #ECFDF5;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

a { color: var(--brand-dark); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--ink); }
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }

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

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  border-right: 1px solid var(--line);
  background: var(--bg);
  padding: calc(var(--space) * 3);
  display: flex;
  flex-direction: column;
  gap: calc(var(--space) * 3);
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 15px;
}
.brand-name { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 17px; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--text-2); line-height: 1.3; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 12px; color: var(--text-2); margin: 16px 0 8px; }
.nav-label:first-child { margin-top: 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 10px;
  border: 1px solid transparent; border-radius: var(--radius-btn);
  background: transparent; color: var(--ink);
  font-size: 14px; text-align: left; width: 100%;
}
.nav-item svg { flex: 0 0 16px; color: var(--text-2); }
.nav-item:hover { background: rgba(28, 25, 23, 0.04); }
.nav-item.active { background: var(--card); border-color: var(--line); font-weight: 500; }
.nav-item.active svg { color: var(--brand); }
.nav-count {
  margin-left: auto; font-family: "IBM Plex Mono", monospace; font-size: 12px;
  color: var(--text-2);
}
.sidebar-foot {
  margin-top: auto; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-card);
  background: var(--card); font-size: 12.5px; line-height: 1.5; color: var(--text-2);
}
.sidebar-foot strong { color: var(--ink); font-weight: 600; }

.main { flex: 1; min-width: 0; padding: calc(var(--space) * 4); max-width: 1180px; }
.view { display: none; }
.view.active { display: block; }
.view-head { margin-bottom: 24px; }
.view-head h1 { font-size: 28px; line-height: 1.2; }
.view-head p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }

/* ---------- generic ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 20px;
}
.section { margin-bottom: 24px; }
.section-title { font-size: 17px; margin-bottom: 4px; }
.section-note { color: var(--text-2); font-size: 13.5px; margin: 0 0 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: var(--radius-btn); border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 14px; font-weight: 500;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn:hover { background: rgba(28, 25, 23, 0.04); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--brand-dark); height: 32px; padding: 0 8px; }
.btn-quiet:hover { background: rgba(15, 118, 110, 0.08); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn svg { flex: 0 0 16px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 500; }
.field .hint { font-size: 12.5px; color: var(--text-2); }
.input, select.input, textarea.input {
  border: 1px solid var(--line); border-radius: var(--radius-btn);
  background: var(--card); padding: 10px 12px; width: 100%;
}
textarea.input { min-height: 120px; resize: vertical; line-height: 1.6; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .field { flex: 1; min-width: 180px; }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: var(--radius-card);
  background: var(--card); padding: 12px 16px;
  font-size: 13.5px; color: var(--text-2); line-height: 1.55;
}
.notice svg { flex: 0 0 16px; margin-top: 2px; color: var(--brand); }
.notice strong { color: var(--ink); font-weight: 600; }
.notice.amber { background: #FFFBEB; border-color: rgba(180, 83, 9, 0.25); }
.notice.amber svg { color: #B45309; }

/* status: quiet text + dot, never loud pills */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.status-new .dot { background: var(--dot-new); }
.status-emailed .dot { background: var(--dot-emailed); }
.status-replied .dot { background: var(--dot-replied); }
.status-interested { color: var(--ink); font-weight: 500; }
.status-interested .dot { background: var(--dot-interested); }
.status-bounced { color: #991B1B; }
.status-bounced .dot { background: var(--dot-bounced); }

/* ---------- dashboard ---------- */
.stat-row { display: flex; gap: 24px; align-items: baseline; flex-wrap: wrap; margin-bottom: 24px; }
.stat-hero .stat-num { font-family: "Space Grotesk", sans-serif; font-size: 44px; font-weight: 700; line-height: 1; }
.stat-hero .stat-label { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.stat { min-width: 72px; }
.stat .stat-num { font-family: "IBM Plex Mono", monospace; font-size: 22px; font-weight: 500; line-height: 1.1; }
.stat .stat-label { font-size: 12.5px; color: var(--text-2); }
.stat .stat-sub { font-size: 12px; color: var(--text-2); }

.pipeline { padding: 20px; }
.pipeline-track { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: rgba(28, 25, 23, 0.07); margin: 16px 0 12px; }
.pipeline-seg { height: 100%; min-width: 4px; }
.pipeline-seg.seg-new { background: #D6D3D1; }
.pipeline-seg.seg-emailed { background: #5EEAD4; }
.pipeline-seg.seg-replied { background: #34D399; }
.pipeline-seg.seg-interested { background: var(--brand); }
.pipeline-labels { display: flex; }
.pipeline-stage { flex: 1; min-width: 0; }
.pipeline-stage .stage-name { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.pipeline-stage .stage-num { font-family: "IBM Plex Mono", monospace; font-size: 20px; margin-top: 2px; }
.pipeline-stage .stage-note { font-size: 12px; color: var(--text-2); }

.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; }
.queue-item, .activity-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.queue-item:first-of-type, .activity-item:first-of-type { border-top: 0; padding-top: 4px; }
.queue-item .grow, .activity-item .grow { flex: 1; min-width: 0; }
.queue-item h3, .activity-item h3 { font-size: 14.5px; font-weight: 600; }
.queue-item .meta, .activity-item .meta { font-size: 13px; color: var(--text-2); }
.pin { color: var(--brand); flex: 0 0 16px; margin-top: 2px; }

/* ---------- client list ---------- */
.filters {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  margin-bottom: 16px;
}
.filters .input { width: auto; }
.search-box { flex: 1; min-width: 200px; position: relative; }
.search-box .input { padding-left: 36px; width: 100%; }
.search-box svg { position: absolute; left: 12px; top: 11px; color: var(--text-2); }

.client-list { display: flex; flex-direction: column; gap: 12px; }
.client-card { padding: 16px 20px; }
.client-top { display: flex; gap: 12px; align-items: flex-start; }
.client-top .grow { flex: 1; min-width: 0; }
.client-name { font-family: "Space Grotesk", sans-serif; font-size: 17px; font-weight: 600; line-height: 1.3; display: flex; align-items: flex-start; gap: 8px; }
.client-name .pin { margin-top: 4px; }
.client-meta { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }
.client-why { font-size: 14px; margin: 10px 0 0; }
.client-why span { color: var(--text-2); }
.client-contact { font-size: 13.5px; color: var(--text-2); margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.client-contact .mono { font-size: 13px; }
.client-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); align-items: center; }
.client-actions .spacer { flex: 1; }
.website-state { font-size: 13px; color: var(--text-2); }
.bounce-note { font-size: 13px; color: #991B1B; margin-top: 8px; }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: var(--radius-btn);
  background: var(--card); padding: 6px 10px; font-size: 13px;
}
.chip button { border: 0; background: none; color: var(--text-2); font-size: 14px; line-height: 1; padding: 0; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(28, 25, 23, 0.45);
  display: none; align-items: flex-start; justify-content: center;
  padding: 48px 16px; z-index: 50; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--card); border-radius: var(--radius-card);
  width: 100%; max-width: 680px; padding: 24px;
  border: 1px solid var(--line);
}
.modal h2 { font-size: 20px; margin-bottom: 4px; }
.modal .modal-sub { color: var(--text-2); font-size: 13.5px; margin: 0 0 16px; }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.modal-actions .spacer { flex: 1; }
.cv-reminder {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--teal-soft); border: 1px solid rgba(15, 118, 110, 0.25);
  border-radius: var(--radius-btn); padding: 12px 14px; font-size: 13.5px; margin-top: 16px;
}
.cv-reminder svg { flex: 0 0 16px; margin-top: 2px; color: var(--brand-dark); }
.cv-reminder .mono { font-size: 12.5px; }
.confirm-box {
  margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px;
  display: none;
}
.confirm-box.open { display: block; }

/* ---------- find / queue ---------- */
.queued-item {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px;
}
.queued-item:first-of-type { border-top: 0; }

/* ---------- activity log ---------- */
.log-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.log-table th { text-align: left; font-size: 12.5px; color: var(--text-2); font-weight: 500; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); }
.log-table td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.log-table tr:last-child td { border-bottom: 0; }

/* ---------- states ---------- */
.empty {
  border: 1px dashed rgba(28, 25, 23, 0.25); border-radius: var(--radius-card);
  padding: 32px 24px; text-align: center; color: var(--text-2);
}
.empty h3 { color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.empty p { margin: 0 0 16px; font-size: 14px; }
.skeleton {
  border-radius: var(--radius-card); background: rgba(28, 25, 23, 0.06);
  min-height: 96px; margin-bottom: 12px;
  animation: shimmer 1.4s ease-in-out infinite alternate;
}
@keyframes shimmer { from { opacity: 0.55; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
  * { transition: none !important; }
}

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #FAF8F4; padding: 10px 16px;
  border-radius: var(--radius-btn); font-size: 14px; z-index: 100;
  display: none; max-width: 90vw;
}
.toast.show { display: block; }

footer.foot { margin-top: 40px; color: var(--text-2); font-size: 12.5px; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; padding: 16px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-label { display: none; }
  .nav-item { width: auto; }
  .sidebar-foot { display: none; }
  .main { padding: 16px; }
  .dash-grid { grid-template-columns: 1fr; }
  .stat-hero .stat-num { font-size: 36px; }
}
