/* Lead Tracker Dashboard — matches SiteLiftOS dark theme */

:root {
  --bg: #111827;
  --fg: #f9fafb;
  --fg-muted: #9ca3af;
  --accent: #3b82f6;
  --accent-dim: #1d4ed8;
  --surface: #1f2937;
  --surface-2: #374151;
  --border: #374151;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

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

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

/* Header */
.site-header {
  padding: 20px 48px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.tagline {
  font-size: 13px;
  color: var(--fg-muted);
  font-weight: 300;
}
.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav-links a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--fg);
}
.nav-links a.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
}
.nav-links a.btn-primary:hover {
  background: var(--accent-dim);
}

/* Main content */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 48px 80px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-header .subtitle {
  color: var(--fg-muted);
  font-size: 14px;
  margin-top: 4px;
}

/* Pipeline stats */
.pipeline-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}
.pipeline-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}
.pipeline-stat .stage-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 12px;
}
.pipeline-stat .stage-count {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--fg);
}
.pipeline-stat .stage-value {
  font-size: 14px;
  color: var(--fg-muted);
  margin-top: 4px;
}
.pipeline-stat.stage-new { border-color: #6366f1; }
.pipeline-stat.stage-new .stage-label { color: #818cf8; }
.pipeline-stat.stage-contacted { border-color: #f59e0b; }
.pipeline-stat.stage-contacted .stage-label { color: #fbbf24; }
.pipeline-stat.stage-proposal { border-color: #3b82f6; }
.pipeline-stat.stage-proposal .stage-label { color: #60a5fa; }
.pipeline-stat.stage-won { border-color: #10b981; }
.pipeline-stat.stage-won .stage-label { color: #34d399; }
.pipeline-stat.stage-lost { border-color: #6b7280; }
.pipeline-stat.stage-lost .stage-label { color: #9ca3af; }

/* Leads table */
.leads-section h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
}
.leads-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
}
.leads-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.leads-table tr:hover td {
  background: var(--surface);
}
.leads-table tr:last-child td {
  border-bottom: none;
}

.business-name {
  font-weight: 600;
  color: var(--fg);
}
.website-url {
  font-size: 13px;
  color: var(--fg-muted);
  text-decoration: none;
}
.website-url:hover {
  color: var(--accent);
}
.industry-badge {
  background: var(--surface-2);
  color: var(--fg-muted);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 100px;
}

.status-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.status-badge.new { background: #312e81; color: #818cf8; }
.status-badge.contacted { background: #451a03; color: #fbbf24; }
.status-badge.proposal { background: #1e3a5f; color: #60a5fa; }
.status-badge.won { background: #064e3b; color: #34d399; }
.status-badge.lost { background: #1f2937; color: #6b7280; }

.value-cell {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
}

.action-btns {
  display: flex;
  gap: 8px;
}
.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  color: var(--fg-muted);
  font-size: 13px;
  transition: all 0.15s;
}
.action-btn:hover {
  background: var(--surface-2);
  color: var(--fg);
}
.action-btn.delete:hover {
  color: #f87171;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--fg-muted);
}
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--fg);
  margin-bottom: 8px;
}
.empty-state p {
  font-size: 14px;
  margin-bottom: 24px;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open {
  display: flex;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  width: 520px;
  max-width: 90vw;
}
.modal h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 14px;
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group textarea {
  resize: vertical;
  min-height: 80px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: flex-end;
}
.btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-dim);
}
.btn-secondary {
  background: var(--surface-2);
  color: var(--fg-muted);
}
.btn-secondary:hover {
  background: var(--border);
  color: var(--fg);
}

.total-bar {
  margin-top: 36px;
  padding: 20px 24px;
  background: var(--surface);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
}
.total-bar .label {
  font-size: 13px;
  color: var(--fg-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.total-bar .value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--fg);
}

@media (max-width: 900px) {
  .pipeline-stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .page-container {
    padding: 24px 24px 48px;
  }
  .site-header {
    padding: 16px 24px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}