/* Hotpitch App Styles — design tokens match landing page */
:root {
  --bg: #08080a;
  --bg-elevated: #111114;
  --bg-card: #16161a;
  --fg: #e8e6e3;
  --fg-muted: #8a8a8e;
  --accent: #f5a623;
  --accent-glow: rgba(245, 166, 35, 0.15);
  --accent-hot: #ff5c00;
  --border: rgba(255,255,255,0.06);
  --border-subtle: rgba(255,255,255,0.04);
  --danger: #e53935;
  --success: #4caf50;
  --radius: 4px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Nav ── */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 60px;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-logo span { color: var(--accent); }

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

.nav-btn {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 16px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.nav-btn:hover { color: var(--fg); background: var(--bg-elevated); }
.nav-btn.active { color: var(--fg); background: var(--bg-card); border: 1px solid var(--border); }

/* ── Main ── */
.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 40px;
}

/* ── Views ── */
.view { display: none; }
.view.active { display: block; }

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}

.view-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 4px;
}

.view-sub {
  color: var(--fg-muted);
  font-size: 14px;
}

/* ── Buttons ── */
.btn-primary {
  background: var(--fg);
  color: var(--bg);
  border: none;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
  border-radius: var(--radius);
}

.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-accent {
  background: var(--accent);
  color: #000;
  border: none;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  transition: opacity 0.15s;
  border-radius: var(--radius);
}

.btn-accent:hover { opacity: 0.88; }
.btn-accent:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  border-radius: var(--radius);
}

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

.btn-danger {
  background: none;
  border: 1px solid rgba(229, 57, 53, 0.3);
  color: var(--danger);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: var(--radius);
}

.btn-danger:hover { background: rgba(229, 57, 53, 0.08); }

/* ── Filter bar ── */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-input, .filter-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 8px 14px;
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s;
}

.filter-input { flex: 1; min-width: 200px; }
.filter-input:focus, .filter-select:focus { border-color: var(--accent); }
.filter-select option { background: var(--bg-card); }

/* ── Table ── */
.table-wrap { width: 100%; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
}

tbody tr:hover { background: var(--bg-elevated); }

tbody td {
  padding: 14px 16px;
  color: var(--fg);
  vertical-align: middle;
}

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

.priority-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 2px;
}

.priority-1 { background: rgba(245, 166, 35, 0.15); color: var(--accent); }
.priority-2 { background: rgba(255,255,255,0.06); color: var(--fg-muted); }
.priority-3 { background: transparent; color: var(--fg-muted); border: 1px solid var(--border); }

.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 2px;
}

.status-draft { background: rgba(255,255,255,0.06); color: var(--fg-muted); }
.status-sent { background: rgba(76, 175, 80, 0.12); color: var(--success); }

.tag-chip {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 2px;
  margin: 0 2px 2px 0;
}

.td-actions { display: flex; gap: 8px; align-items: center; }

/* ── Loading / empty ── */
.loading {
  padding: 60px 0;
  text-align: center;
  color: var(--fg-muted);
  font-size: 14px;
}

.empty-state {
  padding: 80px 0;
  text-align: center;
  color: var(--fg-muted);
}

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

.empty-state p { font-size: 14px; margin-bottom: 24px; }

/* ── Tracking stats ── */
.stats-row {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 20px 28px;
  flex: 1;
  min-width: 120px;
  border-radius: var(--radius);
}

.stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Forms ── */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 32px;
  max-width: 600px;
  border-radius: var(--radius);
}

.form-row {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

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

.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--fg-muted); opacity: 0.6; }
.form-textarea { resize: vertical; min-height: 100px; }

.form-select {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  cursor: pointer;
  border-radius: var(--radius);
}

.form-select option { background: var(--bg-card); }

.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.save-status {
  font-size: 13px;
  color: var(--success);
}

.form-hint {
  font-size: 12px;
  color: var(--fg-muted);
  margin-top: 6px;
}

code {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 12px;
  color: var(--accent);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.15s ease;
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  border-radius: var(--radius);
  animation: slideUp 0.2s ease;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s;
}

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

.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

/* ── Contact selector (send modal) ── */
.contact-selector {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.contact-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.1s;
}

.contact-option:last-child { border-bottom: none; }
.contact-option:hover { background: var(--bg-elevated); }
.contact-option input[type="checkbox"] { accent-color: var(--accent); }
.contact-option label { cursor: pointer; flex: 1; }
.contact-option .contact-email { font-size: 12px; color: var(--fg-muted); }

/* ── Campaign detail ── */
.campaign-detail { max-width: 800px; }
.detail-section { margin-bottom: 32px; }
.detail-section h3 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  margin-bottom: 16px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 24px;
  transition: color 0.15s;
  padding: 0;
}

.back-btn:hover { color: var(--fg); }

/* ── Send result banner ── */
.send-result {
  background: rgba(76, 175, 80, 0.08);
  border: 1px solid rgba(76, 175, 80, 0.2);
  color: var(--success);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-top: 16px;
}

.send-error {
  background: rgba(229, 57, 53, 0.08);
  border: 1px solid rgba(229, 57, 53, 0.2);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-top: 16px;
}

/* ── Select all bar ── */
.select-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--fg-muted);
}

/* ── Animations ── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ── Responsive ── */
@media (max-width: 768px) {
  .app-nav { padding: 0 20px; }
  .app-main { padding: 32px 20px; }
  .view-header { flex-direction: column; }
  .modal { padding: 24px; }
  .stats-row { gap: 12px; }
}
