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

/* ===== SIDEBAR ===== */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 28px 16px;
  position: fixed;
  height: 100vh;
  top: 0;
  left: 0;
  z-index: 100;
}

.sidebar-logo {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  padding: 0 12px 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-logo .logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--fg-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}

.sidebar-nav a:hover {
  background: var(--bg-card);
  color: var(--fg);
}

.sidebar-nav a.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.sidebar-nav .nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-bottom {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-bottom a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--fg-dim);
  font-size: 13px;
  transition: color 0.15s;
}

.sidebar-bottom a:hover { color: var(--fg-muted); }

/* ===== MAIN CONTENT ===== */
.app-main {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-topbar {
  height: 64px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  background: var(--bg);
  flex-shrink: 0;
}

.app-topbar-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  color: var(--fg);
}

.app-topbar-sub {
  font-size: 13px;
  color: var(--fg-dim);
  margin-left: 12px;
}

.app-content {
  padding: 36px 32px;
  flex: 1;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0f;
}

.btn-primary:hover {
  background: #e0b85e;
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: rgba(212, 168, 83, 0.2);
  color: var(--fg);
}

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
}

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

.btn-sm {
  padding: 7px 14px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== HERO CTA ===== */
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  background: var(--accent);
  color: #0a0a0f;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s;
  margin-bottom: 20px;
}

.hero-cta:hover {
  background: #e0b85e;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(212, 168, 83, 0.25);
}

.hero-cta-note {
  display: block;
  font-size: 13px;
  color: var(--fg-dim);
  margin-bottom: 40px;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.stat-card-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 12px;
}

.stat-card-value {
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card-sub {
  font-size: 13px;
  color: var(--fg-dim);
}

/* ===== CAMPAIGN CARDS ===== */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--fg-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

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

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

/* ===== ONBOARDING FORM ===== */
.onboarding-form {
  max-width: 580px;
}

.form-section {
  margin-bottom: 28px;
}

.form-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 16px;
  transition: border-color 0.2s;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: rgba(212, 168, 83, 0.4);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a5a6a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

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

.form-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

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

/* ===== SUCCESS BANNER ===== */
.success-banner {
  background: rgba(100, 200, 100, 0.08);
  border: 1px solid rgba(100, 200, 100, 0.2);
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6ec87a;
  font-size: 14px;
  margin-bottom: 24px;
}

.error-banner {
  background: rgba(220, 80, 80, 0.08);
  border: 1px solid rgba(220, 80, 80, 0.2);
  border-radius: 8px;
  padding: 14px 18px;
  color: #e07070;
  font-size: 14px;
  margin-bottom: 24px;
}

/* ===== LEADS LIST ===== */
.leads-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.leads-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lead-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: border-color 0.2s;
}

.lead-card:hover { border-color: rgba(212, 168, 83, 0.15); }

.lead-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.lead-info { flex: 1; min-width: 0; }

.lead-name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 2px;
}

.lead-title-company {
  font-size: 13px;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lead-email {
  font-size: 12px;
  color: var(--fg-dim);
  margin-top: 4px;
}

.lead-reason {
  font-size: 13px;
  color: var(--fg-muted);
  max-width: 300px;
  line-height: 1.5;
}

.lead-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.lead-status-badge {
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.status-new { background: var(--accent-dim); color: var(--accent); }
.status-contacted { background: rgba(100, 150, 220, 0.15); color: #7ba4e0; }
.status-qualified { background: rgba(100, 200, 100, 0.12); color: #6ec87a; }

/* ===== OUTREACH / EMAIL COMPOSER ===== */
.outreach-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}

.prospect-list-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: 0.5px;
}

.prospect-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.prospect-item:last-child { border-bottom: none; }

.prospect-item:hover { background: rgba(255,255,255,0.03); }

.prospect-item.selected { background: var(--accent-dim); }

.prospect-item-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.prospect-item-info { flex: 1; min-width: 0; }
.prospect-item-name { font-size: 14px; font-weight: 600; color: var(--fg); }
.prospect-item-co { font-size: 12px; color: var(--fg-muted); }

.prospect-item-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--fg-dim);
}

.prospect-item-status.has-draft { background: var(--accent); }
.prospect-item-status.sent { background: #7ba4e0; }

/* ===== EMAIL COMPOSER PANEL ===== */
.composer-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.composer-empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--fg-muted);
}

.composer-empty-icon { font-size: 40px; opacity: 0.3; margin-bottom: 12px; }

.composer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.composer-prospect-info .name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
}

.composer-prospect-info .co {
  font-size: 13px;
  color: var(--fg-muted);
}

.composer-body { padding: 24px; }

.email-field {
  margin-bottom: 16px;
}

.email-field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 6px;
}

.email-subject-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  padding: 8px 0;
  outline: none;
  transition: border-color 0.2s;
}

.email-subject-input:focus { border-bottom-color: rgba(212, 168, 83, 0.4); }

.email-body-textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  padding: 0;
  outline: none;
  resize: none;
  min-height: 240px;
}

.composer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.composer-status-badge {
  margin-left: auto;
  font-size: 12px;
  color: var(--fg-dim);
}

/* ===== LOADING ===== */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(212,168,83,0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,10,15,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  z-index: 10;
}

.loading-text {
  font-size: 14px;
  color: var(--fg-muted);
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== CAMPAIGN INFO BAR ===== */
.campaign-info-bar {
  background: var(--accent-dim);
  border: 1px solid rgba(212,168,83,0.2);
  border-radius: 8px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.campaign-info-bar .tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.campaign-info-bar .val {
  font-size: 13px;
  color: var(--fg);
}

.campaign-info-bar .sep {
  color: var(--fg-dim);
}

/* ===== TABS ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title-sm {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
}

/* ===== RESPONSIVE APP ===== */
@media (max-width: 900px) {
  .sidebar { width: 60px; padding: 20px 8px; }
  .sidebar-logo span { display: none; }
  .sidebar-nav a span { display: none; }
  .sidebar-bottom a span { display: none; }
  .app-main { margin-left: 60px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .outreach-layout { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .app-content { padding: 20px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .lead-card { flex-wrap: wrap; }
  .lead-reason { display: none; }
}
