/* Pitchbloom Dashboard */
:root {
  --bg-deep: #0a0a0f;
  --bg-card: #12121a;
  --bg-accent: #1a1a2e;
  --text-primary: #f0ede6;
  --text-secondary: #8a8a9a;
  --text-muted: #5a5a6a;
  --accent: #e8723a;
  --accent-glow: rgba(232, 114, 58, 0.15);
  --accent-soft: #f09a6a;
  --green: #4ade80;
  --red: #f87171;
  --border: rgba(255, 255, 255, 0.06);
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* NAV */
nav { padding: 24px 0; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.logo { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.5px; }
.logo span { color: var(--accent); }

/* Stats row */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 32px 0; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.stat-card .label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.stat-card .value { font-family: 'Space Grotesk', sans-serif; font-size: 1.75rem; font-weight: 600; }

/* Tabs */
.tabs { display: flex; gap: 4px; margin: 32px 0 0; border-bottom: 1px solid var(--border); }
.tab { padding: 12px 20px; font-size: 0.9rem; color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s; }
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; margin-bottom: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-title { font-size: 1rem; font-weight: 600; }

/* Campaign list */
.campaign-item { display: flex; align-items: center; justify-content: space-between; padding: 16px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; transition: border-color 0.15s; }
.campaign-item:hover { border-color: rgba(255,255,255,0.12); }
.campaign-info .campaign-name { font-weight: 600; margin-bottom: 4px; }
.campaign-info .campaign-meta { font-size: 0.8rem; color: var(--text-muted); }
.campaign-stats { display: flex; gap: 24px; font-size: 0.85rem; color: var(--text-secondary); }
.campaign-stats strong { color: var(--text-primary); }
.status-badge { font-size: 0.75rem; padding: 3px 10px; border-radius: 20px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.status-draft { background: rgba(138,138,154,0.15); color: var(--text-secondary); }
.status-running { background: var(--accent-glow); color: var(--accent-soft); }
.status-completed { background: rgba(74,222,128,0.1); color: var(--green); }
.status-sent { background: rgba(74,222,128,0.1); color: var(--green); border: 1px solid rgba(74,222,128,0.2); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 8px; font-size: 0.875rem; font-weight: 600; cursor: pointer; border: none; transition: all 0.15s; font-family: 'DM Sans', sans-serif; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-soft); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text-primary); border-color: rgba(255,255,255,0.12); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-success { background: rgba(74,222,128,0.15); color: var(--green); border: 1px solid rgba(74,222,128,0.2); }
.btn-success:hover { background: rgba(74,222,128,0.25); }
.btn-danger { background: rgba(248,113,113,0.15); color: var(--red); border: 1px solid rgba(248,113,113,0.2); }
.btn-danger:hover { background: rgba(248,113,113,0.25); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.form-input, .form-textarea { width: 100%; background: var(--bg-accent); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; color: var(--text-primary); font-size: 0.95rem; font-family: 'DM Sans', sans-serif; outline: none; transition: border-color 0.15s; }
.form-input:focus, .form-textarea:focus { border-color: var(--accent); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; }

/* Email card */
.email-item { padding: 20px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 14px; }
.email-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.email-prospect { font-weight: 600; margin-bottom: 2px; }
.email-company { font-size: 0.85rem; color: var(--text-muted); }
.email-subject { font-size: 0.9rem; color: var(--accent-soft); font-weight: 600; margin-bottom: 10px; }
.email-body { font-size: 0.88rem; color: var(--text-secondary); white-space: pre-wrap; line-height: 1.7; max-height: 180px; overflow: hidden; position: relative; }
.email-body::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 40px; background: linear-gradient(transparent, var(--bg-card)); }
.email-actions { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state svg { margin: 0 auto 16px; opacity: 0.3; }
.empty-state p { font-size: 0.9rem; }

/* Loading */
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.2); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Section content toggle */
.section { display: none; }
.section.active { display: block; }

/* Loading overlay */
.loading-bar { height: 3px; background: var(--accent); position: fixed; top: 0; left: 0; width: 0; z-index: 999; animation: loading 1.5s ease-in-out infinite; }
@keyframes loading { 0% { width: 0; opacity: 1; } 80% { width: 80%; opacity: 1; } 100% { width: 80%; opacity: 0; } }

/* Responsive */
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .campaign-stats { display: none; }
  .container { padding: 0 16px; }
}