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

.app-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.sidebar-brand a {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-brand a span {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.nav-item:hover {
  color: var(--fg);
  background: rgba(255,255,255,0.05);
}

.nav-item.active {
  color: #fff;
  background: rgba(108, 92, 231, 0.15);
}

.nav-item .nav-icon {
  font-size: 18px;
  flex-shrink: 0;
}

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

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-card);
  margin-bottom: 8px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

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

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-body);
}

.btn-logout:hover {
  border-color: rgba(255,255,255,0.15);
  color: var(--fg);
}

/* ============ MAIN CONTENT ============ */
.app-main {
  flex: 1;
  padding: 40px;
  max-width: calc(100vw - 240px);
  overflow-x: hidden;
}

.page-header {
  margin-bottom: 32px;
}

.page-title {
  font-size: clamp(24px, 3vw, 36px);
  color: #fff;
  margin-bottom: 6px;
}

.page-subtitle {
  font-size: 15px;
  color: var(--fg-muted);
}

/* ============ ALERTS ============ */
.alert {
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: rgba(0, 206, 201, 0.1);
  border: 1px solid rgba(0, 206, 201, 0.2);
  color: #00cec9;
}

.alert-error {
  background: rgba(255, 80, 80, 0.08);
  border: 1px solid rgba(255, 80, 80, 0.2);
  color: #ff6b6b;
}

/* ============ CARDS ============ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}

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

.card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.card-subtitle {
  font-size: 13px;
  color: var(--fg-muted);
  margin-top: 4px;
}

/* ============ STATS ROW ============ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

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

.stat-card .stat-num {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  display: block;
  margin-bottom: 6px;
}

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

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

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 8px;
}

.form-label span {
  color: var(--fg-muted);
  font-weight: 400;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color 0.15s ease;
  outline: none;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: rgba(108, 92, 231, 0.5);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--fg-muted);
}

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

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a8a9a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--accent-bright);
  padding: 8px 14px;
}

.btn-ghost:hover {
  background: rgba(108, 92, 231, 0.1);
}

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

.btn-loading {
  opacity: 0.7;
  pointer-events: none;
}

/* ============ PROSPECT TABLE ============ */
.prospect-grid {
  display: grid;
  gap: 12px;
}

.prospect-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 16px;
  align-items: start;
  transition: border-color 0.15s ease;
}

.prospect-card:hover {
  border-color: rgba(108, 92, 231, 0.25);
}

.prospect-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(108,92,231,0.3), rgba(0,206,201,0.3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.prospect-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.prospect-meta {
  font-size: 13px;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.prospect-summary {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.6;
}

.prospect-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.tag-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(108, 92, 231, 0.12);
  color: var(--accent-bright);
  border: 1px solid rgba(108, 92, 231, 0.2);
  letter-spacing: 0.02em;
}

/* ============ EMAIL CARDS ============ */
.email-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.email-card:hover {
  border-color: rgba(108, 92, 231, 0.25);
}

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

.email-card-meta {
  flex: 1;
}

.email-prospect {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.email-subject {
  font-size: 14px;
  color: var(--accent-bright);
  font-style: italic;
}

.email-body {
  padding: 20px 24px;
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.8;
  white-space: pre-wrap;
  font-family: var(--font-body);
  background: var(--bg-card);
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(0, 206, 201, 0.1);
  color: #00cec9;
  border: 1px solid rgba(0, 206, 201, 0.2);
  flex-shrink: 0;
}

/* ============ EMPTY STATES ============ */
.empty-state {
  text-align: center;
  padding: 64px 32px;
}

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

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

.empty-text {
  font-size: 15px;
  color: var(--fg-muted);
  margin-bottom: 24px;
}

/* ============ STEPS INDICATOR ============ */
.steps-bar {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 28px;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.step-indicator:not(:last-child)::after {
  content: '→';
  color: var(--border);
  font-size: 18px;
  margin: 0 12px;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-dot.done {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
}

.step-dot.active {
  background: rgba(108, 92, 231, 0.2);
  border: 2px solid var(--accent);
  color: var(--accent-bright);
}

.step-dot.pending {
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  color: var(--fg-muted);
}

.step-label {
  font-size: 13px;
  font-weight: 500;
}

.step-label.done { color: #fff; }
.step-label.active { color: var(--accent-bright); }
.step-label.pending { color: var(--fg-muted); }

/* ============ LOGIN PAGE ============ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.login-box {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
}

.login-logo {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin-bottom: 8px;
}

.login-logo span {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-tagline {
  text-align: center;
  color: var(--fg-muted);
  font-size: 15px;
  margin-bottom: 36px;
}

.magic-link-box {
  background: rgba(0, 206, 201, 0.06);
  border: 1px solid rgba(0, 206, 201, 0.2);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
}

.magic-link-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: #00cec9;
  margin-bottom: 12px;
}

.magic-link-url {
  font-size: 12px;
  color: var(--fg-muted);
  word-break: break-all;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.magic-link-url a {
  color: var(--accent-bright);
  text-decoration: none;
}

.magic-link-note {
  font-size: 12px;
  color: var(--fg-muted);
}

/* ============ GENERATE MODAL FORM ============ */
.generate-form-card {
  background: var(--bg-elevated);
  border: 1px solid rgba(108, 92, 231, 0.2);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 32px;
}

/* ============ HERO CTA BUTTON ============ */
.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(108, 92, 231, 0.3);
}

.btn-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(108, 92, 231, 0.4);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .app-sidebar { display: none; }
  .app-main { max-width: 100vw; padding: 20px; }
  .stats-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .prospect-card { grid-template-columns: 40px 1fr; }
  .steps-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .step-indicator::after { display: none; }
}
