/* ===== APP SHARED ===== */
.app-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.app-nav-brand {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--accent);
  text-decoration: none;
}

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

.app-nav-links a {
  font-size: 0.875rem;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.app-nav-links a:hover { color: var(--fg); }
.app-nav-links a.active { color: var(--accent); }

/* Page */
.app-page {
  padding: 48px 8%;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Header row */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, transform 0.1s;
  text-decoration: none;
  font-family: var(--font-body);
}

.btn:hover { opacity: 0.85; }
.btn:active { transform: scale(0.97); }

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

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

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

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

/* Cards */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-bottom: 16px;
}

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

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

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

.empty-state p { font-size: 0.9rem; line-height: 1.6; }

/* ===== ICP CARDS ===== */
.icp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.icp-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
  text-decoration: none;
  display: block;
}

.icp-card:hover {
  border-color: rgba(200, 255, 60, 0.25);
  transform: translateY(-2px);
}

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

.icp-card-desc {
  font-size: 0.8rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

.icp-card-count {
  margin-top: 16px;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ===== PROSPECT LIST ===== */
.prospect-list { display: flex; flex-direction: column; gap: 12px; }

.prospect-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color 0.2s;
}

.prospect-item:hover { border-color: rgba(200, 255, 60, 0.15); }

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

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

.prospect-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.prospect-role {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

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

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

.prospect-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 100px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.badge-pending { background: rgba(255,255,255,0.06); color: var(--fg-muted); }
.badge-completed { background: var(--accent-dim); color: var(--accent); }
.badge-draft { background: rgba(200, 255, 60, 0.08); color: var(--accent); }
.badge-sent { background: rgba(100, 200, 100, 0.1); color: #6dda8a; }

/* ===== EMAIL PREVIEW ===== */
.email-preview {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 24px;
}

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

.email-preview-subject {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
}

.email-preview-body {
  padding: 24px;
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--fg-muted);
}

.email-preview-body strong { color: var(--fg); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 24px; }

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

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

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: rgba(200, 255, 60, 0.4);
}

.form-textarea { resize: vertical; min-height: 100px; }

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

.tag-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 48px;
  cursor: text;
  transition: border-color 0.2s;
}

.tag-input-wrap:focus-within { border-color: rgba(200, 255, 60, 0.4); }

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
}

.tag-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent);
  font-size: 0.9rem;
  line-height: 1;
  padding: 0;
}

/* ===== SECTION HEADERS ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ===== LOADING ===== */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(200,255,60,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 0.875rem;
  color: var(--fg);
  z-index: 1000;
  animation: slideUp 0.3s ease;
}

.toast.success { border-color: rgba(200,255,60,0.3); }
.toast.error { border-color: rgba(255,100,100,0.3); }

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===== STAT BAR ===== */
.stat-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.stat-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.stat-item-val {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-item-label {
  font-size: 0.75rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

@media (max-width: 768px) {
  .stat-bar { grid-template-columns: 1fr 1fr; }
}

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

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

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

.modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
}

/* Split layout for ICP detail */
.split-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .split-layout { grid-template-columns: 1fr; }
}

/* Nav tabs on ICP detail */
.detail-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.detail-tab {
  padding: 10px 16px;
  font-size: 0.875rem;
  color: var(--fg-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  font-family: var(--font-body);
}

.detail-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.detail-tab:hover { color: var(--fg); }