/* outreach.css — B2B professional light theme for FrameSpeed Outreach Tracker */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F5F4F0;
  --bg-w: #FFFFFF;
  --bg-2: #EEECEA;
  --bg-3: #E4E2DE;
  --fg: #1A1917;
  --fg-2: #6B6863;
  --fg-3: #9C9891;
  --accent: #2A52E0;
  --accent-hover: #1E40BF;
  --accent-light: rgba(42, 82, 224, 0.08);
  --green: #16A34A;
  --green-bg: rgba(22,163,74,0.09);
  --red: #DC2626;
  --red-bg: rgba(220,38,38,0.07);
  --amber: #D97706;
  --amber-bg: rgba(217,119,6,0.08);
  --blue: #2563EB;
  --blue-bg: rgba(37,99,235,0.08);
  --purple: #7C3AED;
  --purple-bg: rgba(124,58,237,0.08);
  --gray-bg: rgba(107,104,99,0.08);
  --gray: #6B6863;
  --border: #E2DFDA;
  --border-2: #D5D2CD;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --font: 'DM Sans', system-ui, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Page shell ─────────────────────────────────────────────────── */
.page-shell { min-height: 100vh; }

/* ── Header ─────────────────────────────────────────────────────── */
.page-header {
  background: var(--bg-w);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fg);
  text-decoration: none;
}

.brand-divider { color: var(--fg-3); font-weight: 300; }

.brand-page {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-2);
}

.header-nav {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
}

.header-nav a {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--fg-2);
  text-decoration: none;
  transition: color 0.15s;
}

.header-nav a:hover { color: var(--fg); }
.header-nav a.active { color: var(--accent); }

/* ── Main ───────────────────────────────────────────────────────── */
.page-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ── Stats bar ──────────────────────────────────────────────────── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--bg-w);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1;
}

.stat-replied { color: var(--green); }
.text-warn { color: var(--red); }
.stat-overdue { border-color: rgba(220,38,38,0.25); }

.stat-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--fg-2);
  letter-spacing: 0.02em;
  margin-top: 0.2rem;
}

/* ── Sections ───────────────────────────────────────────────────── */
.section { display: flex; flex-direction: column; gap: 0.75rem; }

.section-head { display: flex; flex-direction: column; gap: 0.2rem; }

.section-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
}

.section-sub {
  font-size: 0.8rem;
  color: var(--fg-2);
}

.section-sub + .section-sub { margin-top: 0; }

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: var(--bg-w);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ── Badges ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-warn {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid rgba(217,119,6,0.2);
}

.badge-muted {
  background: var(--bg-2);
  color: var(--fg-2);
  font-size: 0.68rem;
}

/* ── Tables ─────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.data-table thead tr {
  border-bottom: 1px solid var(--border);
}

.data-table th {
  text-align: left;
  padding: 0.7rem 1rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--fg-3);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--bg);
}

.data-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tbody tr {
  transition: background 0.1s;
}

.data-table tbody tr:hover { background: rgba(0,0,0,0.015); }

/* Overdue rows */
.row-overdue { background: rgba(220,38,38,0.03) !important; }
.row-overdue:hover { background: rgba(220,38,38,0.05) !important; }
.row-alert { background: rgba(217,119,6,0.03); }

/* ── Cells ──────────────────────────────────────────────────────── */
.cell-contact { min-width: 130px; }
.cell-company { color: var(--fg-2); }
.cell-email a { color: var(--fg-2); text-decoration: none; }
.cell-email a:hover { color: var(--accent); text-decoration: underline; }
.cell-date { color: var(--fg-3); font-size: 0.82rem; white-space: nowrap; }
.cell-overdue { color: var(--red); font-size: 0.82rem; white-space: nowrap; }
.cell-notes { color: var(--fg-2); font-size: 0.82rem; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-actions { white-space: nowrap; }

.contact-name { font-weight: 500; }
.contact-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.2rem; }
.no-date { color: var(--fg-3); }

/* ── Tags ───────────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.1rem 0.4rem;
  background: var(--bg-2);
  color: var(--fg-2);
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ── Status badges ──────────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
}

.status-prospect  { background: var(--gray-bg); color: var(--gray); }
.status-in_sequence { background: var(--blue-bg); color: var(--blue); }
.status-replied   { background: var(--green-bg); color: var(--green); }
.status-converted { background: var(--purple-bg); color: var(--purple); }
.status-bounced   { background: var(--red-bg); color: var(--red); }

/* ── Step indicator ─────────────────────────────────────────────── */
.step-indicator {
  display: flex;
  gap: 6px;
  align-items: center;
}

.step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: default;
  transition: background 0.15s;
}

.step-done {
  background: var(--accent);
  color: #fff;
}

.step-check {
  background: var(--green);
  color: #fff;
}

.step-pending {
  background: var(--bg-2);
  color: var(--fg-3);
  border: 1.5px solid var(--border-2);
}

.step-chip {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--fg-2);
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, color 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-resolve {
  background: var(--green-bg);
  color: var(--green);
  border-color: rgba(22,163,74,0.2);
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
}

.btn-resolve:hover:not(:disabled) { background: rgba(22,163,74,0.15); }

.btn-enroll {
  background: var(--accent-light);
  color: var(--accent);
  border-color: rgba(42,82,224,0.2);
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
}

.btn-enroll:hover:not(:disabled) { background: rgba(42,82,224,0.14); }

.btn-enrolled {
  background: var(--green-bg);
  color: var(--green);
  border-color: rgba(22,163,74,0.2);
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
}

.btn-reply {
  background: var(--green-bg);
  color: var(--green);
  border-color: rgba(22,163,74,0.2);
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
}

.btn-reply:hover:not(:disabled) { background: rgba(22,163,74,0.15); }

.btn-remove {
  background: transparent;
  color: var(--fg-3);
  border-color: var(--border);
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
}

.btn-remove:hover:not(:disabled) { color: var(--red); border-color: rgba(220,38,38,0.3); background: var(--red-bg); }

.btn-sm { font-size: 0.75rem; padding: 0.3rem 0.7rem; }

/* ── Overdue chip ───────────────────────────────────────────────── */
.overdue-chip {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--red);
  background: var(--red-bg);
  border: 1px solid rgba(220,38,38,0.2);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.3rem;
}

/* ── Add contact form ───────────────────────────────────────────── */
.add-form { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }

.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.form-group { display: flex; flex-direction: column; gap: 0.3rem; }

.form-group label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--fg-2);
}

.req { color: var(--red); }

.form-group input {
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.form-group input:focus { border-color: var(--accent); }
.form-group input::placeholder { color: var(--fg-3); }

.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.25rem;
}

.form-msg {
  font-size: 0.82rem;
  font-weight: 500;
}

.msg-ok { color: var(--green); }
.msg-err { color: var(--red); }

/* ── Empty state ────────────────────────────────────────────────── */
.empty-state {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--fg-3);
  font-size: 0.88rem;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .page-main { padding: 1.25rem; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .data-table { font-size: 0.8rem; }
  .data-table th, .data-table td { padding: 0.6rem 0.75rem; }
  .header-nav { display: none; }
}
