/* ====== APP SHELL ====== */
.app-body {
  background: var(--bg);
  min-height: 100vh;
}

/* ====== NAV ====== */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 23, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  font-size: 0.875rem;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover, .nav-link.active {
  color: var(--fg);
  background: var(--highlight-bg);
}

.nav-link-dim {
  color: var(--fg-dim);
  font-size: 0.8rem;
}

/* ====== MAIN ====== */
.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ====== PAGE HEADER ====== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 36px;
  gap: 16px;
}

.page-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 4px;
}

.page-sub {
  color: var(--fg-dim);
  font-size: 0.9rem;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--fg-dim);
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
}

.breadcrumb:hover { color: var(--fg-muted); }

/* ====== BUTTONS ====== */
.btn-primary {
  background: var(--accent);
  color: #0a0e17;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, opacity 0.15s;
}

.btn-primary:hover { background: var(--accent-strong); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-display);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-ghost:hover { border-color: var(--fg-dim); color: var(--fg); }

/* ====== STATS GRID ====== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-card.accent .stat-value { color: var(--accent); }
.stat-card.accent-strong .stat-value { color: #34d399; }

.stat-label {
  font-size: 0.75rem;
  color: var(--fg-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--fg);
  font-family: var(--font-mono);
  line-height: 1.1;
}

/* ====== SECTION ====== */
.section { margin-bottom: 40px; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
}

/* ====== CAMPAIGN LIST ====== */
.campaign-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.campaign-card {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  overflow: hidden;
}

.campaign-card:hover {
  border-color: var(--accent);
  background: var(--highlight-bg);
}

.campaign-card-left { flex: 1; }

.campaign-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--fg);
  margin-bottom: 8px;
}

.campaign-meta { display: flex; gap: 8px; flex-wrap: wrap; }

.meta-tag {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: var(--highlight-bg);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 100px;
}

.campaign-card-stats {
  display: flex;
  gap: 32px;
}

.c-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.c-stat-num {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--fg);
}

.c-stat.accent .c-stat-num { color: var(--accent); }

.c-stat-label {
  font-size: 0.7rem;
  color: var(--fg-dim);
  font-family: var(--font-mono);
}

/* ====== STATUS BADGES ====== */
.campaign-status-badge,
.status-pill {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.status-draft { color: var(--fg-dim); }
.status-running { color: var(--accent); }
.status-paused { color: #f59e0b; }
.status-error { color: #f87171; }
.status-discovered { color: var(--fg-dim); }
.status-contacted { color: var(--accent); }
.status-replied { color: #34d399; }
.status-converted { color: #34d399; }
.status-sent { color: var(--accent); }
.status-scheduled { color: #f59e0b; }
.status-failed { color: #f87171; }

/* ====== CAMPAIGN ACTIONS ====== */
.campaign-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.campaign-icp-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ====== TABS ====== */
.campaign-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-display);
  color: var(--fg-muted);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover { color: var(--fg); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.hidden { display: none !important; }

/* ====== PROSPECTS LIST ====== */
.prospects-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prospect-row {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 24px;
}

.prospect-info { flex: 1; }

.prospect-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fg);
  margin-bottom: 4px;
}

.prospect-role {
  font-weight: 400;
  color: var(--fg-dim);
  font-size: 0.85rem;
}

.prospect-company {
  font-size: 0.875rem;
  color: var(--fg-muted);
  margin-bottom: 6px;
}

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

.prospect-news {
  font-size: 0.8rem;
  color: var(--fg-dim);
  font-style: italic;
  line-height: 1.5;
}

.prospect-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.prospect-email {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-muted);
}

/* ====== EMAILS LIST ====== */
.emails-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.email-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 24px;
}

.email-step {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--highlight-bg);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.email-info { flex: 1; }

.email-subject {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--fg);
  margin-bottom: 4px;
}

.email-to {
  font-size: 0.8rem;
  color: var(--fg-dim);
}

.email-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.email-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-dim);
}

/* ====== EMPTY STATE ====== */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  border: 1px dashed var(--border);
  border-radius: 12px;
}

.empty-icon {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 16px;
  font-family: var(--font-mono);
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--fg-muted);
  max-width: 360px;
  margin: 0 auto 24px;
  line-height: 1.7;
}

/* ====== MODAL ====== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
}

.modal-close {
  background: none;
  border: none;
  color: var(--fg-dim);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}

.modal-close:hover { color: var(--fg); background: var(--highlight-bg); }

/* ====== FORM ====== */
.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg-muted);
  margin-bottom: 8px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-group input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: var(--font-display);
  color: var(--fg);
  transition: border-color 0.15s;
  outline: none;
}

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

.form-hint {
  font-size: 0.75rem;
  color: var(--fg-dim);
  margin-top: 6px;
  display: block;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

/* ====== MISC ====== */
.fg-dim { color: var(--fg-dim); }

/* ====== RESPONSIVE ====== */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .campaign-card-stats { display: none; }
}

@media (max-width: 640px) {
  .app-main { padding: 24px 16px 60px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
  .campaign-tabs { overflow-x: auto; }
  .prospect-row, .email-row { flex-wrap: wrap; }
}
