/* PulseOut App — matches landing page design language */
:root {
  --bg: #0D0D0D;
  --fg: #F5F5F0;
  --accent: #F5A623;
  --accent-dim: rgba(245,166,35,0.12);
  --muted: #8A8A82;
  --surface: #161614;
  --surface-2: #1E1E1C;
  --border: rgba(245,245,240,0.08);
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Instrument Sans', system-ui, sans-serif;
}

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

html { background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 16px; }

body { background: var(--bg); min-height: 100vh; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

.app-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; height: 64px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.app-nav-logo {
  font-family: var(--serif); font-size: 20px; color: var(--fg);
  display: flex; align-items: center; gap: 10px;
}
.app-nav-logo span { color: var(--accent); }
.app-nav-links { display: flex; gap: 32px; }
.app-nav-links a { color: var(--muted); font-size: 14px; transition: color 0.15s; }
.app-nav-links a:hover, .app-nav-links a.active { color: var(--fg); text-decoration: none; }

.app-main { flex: 1; padding: 48px 40px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* ── Typography ── */
.h1 { font-family: var(--serif); font-size: 36px; font-weight: 400; margin-bottom: 8px; }
.h2 { font-family: var(--serif); font-size: 28px; font-weight: 400; margin-bottom: 6px; }
.subhead { color: var(--muted); font-size: 15px; margin-bottom: 40px; }

/* ── Cards ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px;
  transition: border-color 0.2s;
}
.card:hover { border-color: rgba(245,245,240,0.15); }
.card-label { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.card-value { font-size: 32px; font-weight: 600; color: var(--fg); }
.card-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ── Stats Grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 48px; }
@media (max-width: 768px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── Table ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); }
.data-table td { padding: 16px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 8px; border: none; cursor: pointer;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  transition: all 0.15s;
}
.btn-primary { background: var(--accent); color: #0D0D0D; }
.btn-primary:hover { background: #fdb73a; transform: translateY(-1px); }
.btn-secondary { background: var(--surface-2); color: var(--fg); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface); border-color: rgba(245,245,240,0.15); }
.btn-danger { background: transparent; color: #e55; border: 1px solid rgba(238,85,85,0.3); }
.btn-danger:hover { background: rgba(238,85,85,0.1); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ── Form ── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 8px; }
.form-input, .form-select {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; color: var(--fg);
  font-family: var(--sans); font-size: 14px; outline: none;
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus { border-color: var(--accent); }
.form-select { appearance: none; cursor: pointer; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ── Badge / Status ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 100px; font-size: 12px; font-weight: 500;
}
.badge-draft { background: var(--surface-2); color: var(--muted); }
.badge-active { background: rgba(34,197,94,0.15); color: #4ade80; }
.badge-sent { background: var(--accent-dim); color: var(--accent); }
.badge-pending { background: rgba(96,165,250,0.15); color: #60a5fa; }
.badge-replied { background: rgba(34,197,94,0.15); color: #4ade80; }
.badge-failed { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-bounced { background: rgba(239,68,68,0.15); color: #f87171; }

/* ── Two Column Layout ── */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 32px; }
@media (max-width: 768px) { .split { grid-template-columns: 1fr; } }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 80px 40px; }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-family: var(--serif); font-size: 22px; font-weight: 400; margin-bottom: 8px; }
.empty-state p { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

/* ── Section Header ── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.section-header h2 { margin: 0; }

/* ── Progress Bar ── */
.progress-bar { height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--accent); transition: width 0.5s ease; }

/* ── Loading Spinner ── */
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Alerts ── */
.alert { padding: 14px 18px; border-radius: 8px; font-size: 14px; margin-bottom: 20px; border: 1px solid; }
.alert-success { background: rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.2); color: #4ade80; }
.alert-error { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.2); color: #f87171; }
.alert-info { background: var(--accent-dim); border-color: rgba(245,166,35,0.2); color: var(--accent); }

/* ── Prospect Row ── */
.prospect-name { font-weight: 500; }
.prospect-company { font-size: 13px; color: var(--muted); }
.prospect-email { font-size: 12px; color: var(--muted); font-family: monospace; }

/* ── Sequence Card ── */
.sequence-card { display: flex; align-items: flex-start; justify-content: space-between; }
.sequence-info h3 { font-family: var(--serif); font-size: 18px; margin-bottom: 4px; }
.sequence-meta { font-size: 13px; color: var(--muted); display: flex; gap: 16px; margin-top: 8px; }
.sequence-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Modal Backdrop ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; backdrop-filter: blur(4px);
}
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; width: 100%; max-width: 520px; }
.modal h2 { font-family: var(--serif); font-size: 22px; margin-bottom: 24px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

/* ── Step Indicator ── */
.step-track { display: flex; gap: 8px; margin: 8px 0; }
.step-item { flex: 1; text-align: center; padding: 12px; background: var(--surface-2); border-radius: 8px; font-size: 12px; }
.step-item.done { background: var(--accent-dim); color: var(--accent); }
.step-item.pending { background: var(--surface); color: var(--muted); border: 1px dashed var(--border); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 3px; }

/* ── Outreach Funnel ── */
.funnel-bar-group { display: flex; flex-direction: column; gap: 16px; }
.funnel-row { display: flex; align-items: center; gap: 16px; }
.funnel-label { width: 110px; font-size: 13px; color: var(--muted); flex-shrink: 0; }
.funnel-bar-wrap { flex: 1; background: var(--surface-2); border-radius: 4px; height: 28px; overflow: hidden; }
.funnel-bar { height: 100%; border-radius: 4px; transition: width 0.8s ease; min-width: 2px; }
.funnel-value { width: 100px; font-size: 13px; color: var(--fg); text-align: right; flex-shrink: 0; }

/* ── Prospect Detail Drawer ── */
.prospect-drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 150; opacity: 0; pointer-events: none; transition: opacity 0.18s;
}
.prospect-drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }

.prospect-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(480px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 160; transform: translateX(100%); transition: transform 0.22s;
  display: flex; flex-direction: column;
}
.prospect-drawer.is-open { transform: translateX(0); }

.prospect-drawer-header {
  padding: 24px 28px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
}
.prospect-drawer-header h2 { font-family: var(--serif); font-size: 22px; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prospect-drawer-header .close-btn {
  margin-left: auto; background: transparent; border: 1px solid var(--border);
  color: var(--muted); width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  font-size: 18px; line-height: 1;
}
.prospect-drawer-header .close-btn:hover { color: var(--fg); border-color: var(--accent); }

.prospect-drawer-meta {
  padding: 16px 28px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted);
}
.prospect-drawer-intent {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
}
.prospect-drawer-intent[data-intent="interested"] { background: var(--success); color: #fff; }
.prospect-drawer-intent[data-intent="not_now"],
.prospect-drawer-intent[data-intent="out_of_office"],
.prospect-drawer-intent[data-intent="wrong_person"] { background: #F5A623; color: #fff; }

.prospect-drawer-body { flex: 1; overflow-y: auto; padding: 24px 28px; }
.timeline { display: flex; flex-direction: column; gap: 18px; position: relative; }
.timeline::before {
  content: ''; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px;
  background: var(--border);
}
.timeline-row { display: grid; grid-template-columns: 16px 1fr; gap: 14px; align-items: flex-start; }
.timeline-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); margin-top: 4px; z-index: 1;
  border: 2px solid var(--surface);
}
.timeline-row[data-status="sent"]       .timeline-dot { background: var(--accent); }
.timeline-row[data-status="pending"]    .timeline-dot { background: var(--muted); }
.timeline-row[data-status="failed"]     .timeline-dot { background: #f87171; }
.timeline-row[data-status="opened"]     .timeline-dot { background: #F5A623; }
.timeline-row[data-status="clicked"]    .timeline-dot { background: #6366f1; }
.timeline-row[data-status="replied"]    .timeline-dot { background: #10b981; }
.timeline-row[data-status="bounced"]    .timeline-dot { background: #f87171; }
.timeline-row[data-status="complained"] .timeline-dot { background: #f87171; }
.timeline-row[data-status="interested"] .timeline-dot { background: var(--success); }
.timeline-row[data-status="meeting"]    .timeline-dot { background: #4ade80; }
.timeline-row[data-status="enrolled"]   .timeline-dot { background: var(--muted); }
.timeline-content { font-size: 13px; line-height: 1.45; min-width: 0; }
.timeline-title { color: var(--fg); font-weight: 500; }
.timeline-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }