/* ═══════════════════════════════════════════════════════════
   SabreMailer - Design System & Styles
   Premium email marketing dashboard inspired by Brevo/MailerLite
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties (Theme System) ─────────────────── */
:root {
  /* Light theme (default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-sidebar: #1a1a2e;
  --bg-sidebar-hover: rgba(255, 255, 255, 0.08);
  --bg-sidebar-active: rgba(124, 58, 237, 0.15);
  --bg-input: #ffffff;
  --bg-hover: #f1f5f9;

  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-sidebar: rgba(255, 255, 255, 0.7);
  --text-sidebar-active: #ffffff;
  --text-inverse: #ffffff;

  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --border-sidebar: rgba(255, 255, 255, 0.08);

  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-light: rgba(124, 58, 237, 0.1);
  --primary-glow: rgba(124, 58, 237, 0.25);

  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.1);
  --info: #06b6d4;
  --info-light: rgba(6, 182, 212, 0.1);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 20px var(--primary-glow);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sidebar-width: 260px;
  --transition: 0.2s ease;
}

[data-theme="medium"] {
  --bg-primary: #e2e8f0;
  --bg-secondary: #cbd5e1;
  --bg-tertiary: #b8c5d4;
  --bg-card: #dde5ee;
  --bg-input: #d4dce8;
  --bg-hover: #c8d3e1;
  --text-primary: #1e293b;
  --text-secondary: #334155;
  --text-muted: #475569;
  --border-color: #94a3b8;
  --border-light: #b8c5d4;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
}

[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #1a2332;
  --bg-card: #1e293b;
  --bg-input: #1e293b;
  --bg-hover: #273449;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --border-color: #334155;
  --border-light: #1e293b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Dev Banner ───────────────────────────────────────────── */
.dev-banner {
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
  color: #1e293b;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 16px;
  text-align: center;
  letter-spacing: 0.5px;
}
.dev-banner a { color: #1e293b; text-decoration: underline; margin: 0 8px; }

/* ── App Layout ───────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-sidebar);
  overflow: hidden;
}

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

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.logo-icon svg {
  width: 22px;
  height: 22px;
  stroke: white;
}

.logo-text h1 {
  font-size: 18px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.3px;
}

.logo-subtitle {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

/* ── Navigation ───────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-sidebar);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none !important;
  cursor: pointer;
  position: relative;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  min-width: 20px;
  stroke: var(--text-sidebar);
  transition: stroke var(--transition);
}

.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: white;
}
.nav-item:hover svg { stroke: white; }

.nav-item.active {
  background: var(--bg-sidebar-active);
  color: var(--text-sidebar-active);
}
.nav-item.active svg { stroke: var(--primary); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-section-divider {
  display: flex;
  align-items: center;
  padding: 16px 14px 8px;
  gap: 8px;
}
.nav-section-divider span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
}
.nav-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-sidebar);
}

.nav-external {
  opacity: 0.65;
}
.nav-external:hover {
  opacity: 1;
}

/* ── Sidebar Footer ──────────────────────────────────────── */
.sidebar-footer {
  border-top: 1px solid var(--border-sidebar);
}

.sidebar-footer-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-sidebar);
  font-size: 11px;
  transition: background var(--transition);
}
.sidebar-footer-toggle:hover {
  background: var(--bg-sidebar-hover);
}

.footer-toggle-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
}

.footer-collapsed-name {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
}

.footer-chevron {
  transition: transform var(--transition);
}

.sidebar-footer-content {
  padding: 8px 16px 14px;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-name {
  color: white;
  font-size: 13px;
  font-weight: 600;
}

.user-role-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--primary-light);
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-logout {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  padding: 4px;
  border-radius: 4px;
  transition: all var(--transition);
}
.btn-logout:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.user-company {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-sidebar);
}

.account-selector-label {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 4px;
}

.account-selector-dropdown {
  width: 100%;
  padding: 5px 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-sidebar);
  border-radius: var(--radius-sm);
  color: white;
  font-size: 12px;
  cursor: pointer;
}

.sidebar-dev-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 8px;
}

.dev-info-text {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
}

.btn-hard-refresh {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.4);
  font-size: 10px;
  padding: 2px 0;
  text-align: left;
  transition: color var(--transition);
}
.btn-hard-refresh:hover {
  color: var(--primary);
}

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-secondary);
  padding: 24px 32px;
}

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

.page-header-left h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.page-header-left p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.page-header-actions {
  display: flex;
  gap: 10px;
}

/* ── Stats Grid ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--stat-color, var(--primary)), transparent);
  opacity: 0.7;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-card-trend {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}
.stat-card-trend.up { color: var(--success); background: var(--success-light); }
.stat-card-trend.down { color: var(--danger); background: var(--danger-light); }

.stat-card-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 20px;
}

.card-body-flush {
  padding: 0;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  font-family: var(--font-family);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #a855f7);
  color: white;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), #9333ea);
  box-shadow: 0 4px 16px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--border-color);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
}
.btn-success:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
}
.btn-danger:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

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

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-icon:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

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

/* ── Forms ────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-family);
  transition: all var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

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

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

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* Password toggle */
.password-field {
  position: relative;
}
.password-field .form-input { padding-right: 40px; }
.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  opacity: 0.6;
}
.password-toggle:hover { opacity: 1; }

/* ── Tables ───────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tbody tr {
  transition: background var(--transition);
  border-bottom: 1px solid var(--border-light);
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.data-table tbody td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
}

.data-table .email-cell {
  font-weight: 500;
}

.data-table .actions-cell {
  display: flex;
  gap: 6px;
}

/* ── Status Badges ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-draft { background: var(--bg-hover); color: var(--text-muted); }
.badge-active, .badge-sent { background: var(--success-light); color: var(--success); }
.badge-scheduled { background: var(--info-light); color: var(--info); }
.badge-sending { background: var(--warning-light); color: var(--warning); }
.badge-bounced, .badge-failed { background: var(--danger-light); color: var(--danger); }
.badge-unsubscribed { background: rgba(107, 114, 128, 0.1); color: #6b7280; }
.badge-paused { background: var(--warning-light); color: var(--warning); }

/* ── Search Bar ───────────────────────────────────────────── */
.search-bar {
  position: relative;
  max-width: 400px;
}

.search-bar svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.search-bar input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-family);
  transition: all var(--transition);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ── Filter Tabs ──────────────────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0;
}

.filter-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  font-family: var(--font-family);
}

.filter-tab:hover {
  color: var(--text-primary);
}

.filter-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.filter-tab .count {
  background: var(--bg-hover);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  margin-left: 6px;
}

.filter-tab.active .count {
  background: var(--primary-light);
  color: var(--primary);
}

/* ── Empty States ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

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

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
}

.modal-wide {
  max-width: 900px;
}

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

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 20px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

/* ── Toast Notifications ──────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  cursor: pointer;
  max-width: 400px;
}

.toast-success {
  background: #059669;
  color: white;
}
.toast-error {
  background: #dc2626;
  color: white;
}
.toast-warning {
  background: #d97706;
  color: white;
}
.toast-info {
  background: #0891b2;
  color: white;
}

.toast.fade-out {
  animation: slideOutRight 0.3s ease forwards;
}

/* ── Template Cards ───────────────────────────────────────── */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.template-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}

.template-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.template-card-preview {
  height: 160px;
  background: var(--bg-secondary);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.template-card-preview iframe {
  transform: scale(0.4);
  transform-origin: top left;
  width: 250%;
  height: 250%;
  border: none;
  pointer-events: none;
}

.template-card-preview .preview-placeholder {
  font-size: 40px;
  opacity: 0.3;
}

.template-card-body {
  padding: 14px 16px;
}

.template-card-body h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.template-card-body p {
  font-size: 12px;
  color: var(--text-muted);
}

.template-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border-color);
}

.template-card-category {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
}

/* ── Campaign Card ────────────────────────────────────────── */
.campaign-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.campaign-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
  cursor: pointer;
}

.campaign-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.campaign-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.campaign-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.campaign-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.campaign-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.campaign-card-stats {
  display: flex;
  gap: 24px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.campaign-stat {
  text-align: center;
}
.campaign-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.campaign-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ── Contact List Cards ───────────────────────────────────── */
.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.list-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.list-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.list-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.list-card h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.list-card-count {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.list-card-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Loading Spinner ──────────────────────────────────────── */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  flex-direction: column;
  gap: 12px;
}

.loading-overlay span {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Toolbar ──────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Email Editor ─────────────────────────────────────────── */
.email-editor-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  min-height: 500px;
}

.editor-pane {
  display: flex;
  flex-direction: column;
}

.editor-pane h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.html-editor {
  flex: 1;
  width: 100%;
  min-height: 400px;
  padding: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
  tab-size: 2;
}

.html-editor:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.preview-pane {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.preview-pane iframe {
  width: 100%;
  height: 100%;
  min-height: 400px;
  border: none;
  background: white;
}

/* ── Progress Bar ─────────────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #a855f7);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ── Tags ─────────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--bg-hover);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}

/* ── Checkbox ─────────────────────────────────────────────── */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-wrapper input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ── Settings Layout ──────────────────────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
}

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

.settings-nav-item {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  text-align: left;
  font-family: var(--font-family);
}

.settings-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.settings-nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.settings-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* ── Test Result ──────────────────────────────────────────── */
.test-result {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  margin-top: 12px;
}
.test-result.success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.test-result.error {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ── Quick Actions Grid ───────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.quick-action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
}

.quick-action-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.quick-action-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.quick-action-text h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.quick-action-text p {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
}

.pagination-btn {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-family);
}

.pagination-btn:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.pagination-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 12px;
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

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

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ── Scrollbar Styling ────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .main-content { padding: 16px 20px; }
  .email-editor-container { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* ── Selection highlight ──────────────────────────────────── */
::selection {
  background: var(--primary-light);
  color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════
   Email Validator Styles
   ═══════════════════════════════════════════════════════════ */

/* ── Validator Tabs ──────────────────────────────────────── */
.validator-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 4px;
}

.validator-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
  font-family: var(--font-family);
  flex: 1;
  justify-content: center;
}

.validator-tab svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  transition: stroke var(--transition);
}

.validator-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.validator-tab:hover svg { stroke: var(--text-primary); }

.validator-tab.active {
  background: linear-gradient(135deg, var(--primary), #a855f7);
  color: white;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.validator-tab.active svg { stroke: white; }

/* ── Validator Input ─────────────────────────────────────── */
.validator-single-form {
  max-width: 700px;
}

.validator-input-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.validator-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.validator-input-wrapper svg {
  position: absolute;
  left: 14px;
  stroke: var(--text-muted);
  pointer-events: none;
}

.validator-email-input {
  padding-left: 44px !important;
  font-size: 15px !important;
  padding: 14px 16px !important;
  border-radius: var(--radius-md) !important;
}

.btn-validate {
  padding: 14px 24px !important;
  font-size: 14px !important;
}

.validator-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
}

.validator-textarea {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.8;
  resize: vertical;
  min-height: 180px;
}

/* ── Validator Loading ───────────────────────────────────── */
.validator-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px;
  color: var(--text-muted);
}

.spinner-sm {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ── Single Result Card ──────────────────────────────────── */
.validator-result-card {
  animation: fadeSlideIn 0.4s ease;
}

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

.validator-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
}

.validator-result-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.validator-result-icon {
  font-size: 32px;
}

.validator-result-email {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.validator-result-label {
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.validator-score-ring {
  flex-shrink: 0;
}

/* ── Check Rows ──────────────────────────────────────────── */
.validator-checks-list {
  padding: 8px 0;
}

.validator-check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

.validator-check-row:hover {
  background: var(--bg-hover);
}

.validator-check-row:last-child {
  border-bottom: none;
}

.validator-check-row.failed {
  background: var(--danger-light);
}

.validator-check-status {
  font-size: 16px;
  line-height: 1;
  margin-top: 1px;
  flex-shrink: 0;
}

.validator-check-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  min-width: 100px;
  flex-shrink: 0;
}

.validator-check-detail {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
}

.validator-mx-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.validator-mx-tag {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--info-light);
  color: var(--info);
  border-radius: 6px;
  font-weight: 500;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.validator-suggestion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--warning-light);
  color: var(--warning);
  font-size: 13px;
  font-weight: 500;
}

.validator-suggestion svg {
  flex-shrink: 0;
  stroke: var(--warning);
}

/* ── Summary Cards ───────────────────────────────────────── */
.validator-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.validator-summary-card {
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  transition: transform var(--transition);
}

.validator-summary-card:hover {
  transform: translateY(-2px);
}

.validator-summary-card.valid {
  background: var(--success-light);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.validator-summary-card.risky {
  background: var(--warning-light);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.validator-summary-card.invalid {
  background: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.validator-summary-card.unknown {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
}

.summary-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
}

.summary-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Deliverability Bar ──────────────────────────────────── */
.validator-deliverability {
  text-align: center;
}

.deliverability-bar {
  width: 100%;
  height: 12px;
  border-radius: 6px;
  background: var(--bg-hover);
  display: flex;
  overflow: hidden;
  margin-bottom: 8px;
}

.deliverability-fill {
  height: 100%;
  transition: width 0.8s ease;
}

.deliverability-fill.valid { background: var(--success); }
.deliverability-fill.risky { background: var(--warning); }
.deliverability-fill.invalid { background: var(--danger); }

.deliverability-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.deliverability-label strong {
  color: var(--text-primary);
  font-size: 16px;
}

/* ── Score Bar Mini (table cells) ────────────────────────── */
.score-bar-mini {
  display: inline-block;
  width: 50px;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-hover);
  overflow: hidden;
  vertical-align: middle;
  margin-right: 6px;
}

.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.score-bar-fill.high { background: var(--success); }
.score-bar-fill.medium { background: var(--warning); }
.score-bar-fill.low { background: var(--danger); }

.score-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── Risky / Unknown badges ──────────────────────────────── */
.badge-risky { background: var(--warning-light); color: var(--warning); }
.badge-unknown { background: var(--bg-hover); color: var(--text-muted); }

/* ── How it Works Grid ───────────────────────────────────── */
.validator-info-card {
  margin-top: 24px;
}

.validator-info-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.validator-checks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.validator-check-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.validator-check-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 800;
}

.validator-check-item h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.validator-check-item p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Responsive: Validator ───────────────────────────────── */
@media (max-width: 768px) {
  .validator-tabs { flex-direction: column; }
  .validator-input-row { flex-direction: column; }
  .validator-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .validator-result-header { flex-direction: column; gap: 16px; text-align: center; }
  .validator-checks-grid { grid-template-columns: 1fr; }
}

/* ── Utility classes ──────────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }

/* ── Profile Grid ────────────────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.profile-card {
  transition: all var(--transition);
}

.profile-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════
   CONTACT IMPORT WIZARD
   ═══════════════════════════════════════════════════════════ */

.import-wizard {
  max-width: 1000px;
  margin: 0 auto;
}

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

.import-wizard-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.import-wizard-header-left h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.import-wizard-header-left p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Import Steps ──────────────────────────────────────────── */
.import-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
  padding: 16px 0;
}

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

.import-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.import-step.active .import-step-circle {
  background: linear-gradient(135deg, var(--primary), #a855f7);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
}

.import-step.completed .import-step-circle {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.import-step-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.import-step.active .import-step-label {
  color: var(--text-primary);
}

.import-step.completed .import-step-label {
  color: var(--success);
}

.import-step-connector {
  width: 60px;
  height: 2px;
  background: var(--border-color);
  margin: 0 8px;
  border-radius: 2px;
}

.import-step.completed + .import-step-connector,
.import-step.completed .import-step-connector {
  background: var(--success);
}

/* ── Upload Section ────────────────────────────────────────── */
.import-upload-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.import-format-cards h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.format-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.format-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.format-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.format-card-info strong {
  font-size: 13px;
  display: block;
  color: var(--text-primary);
}

.format-card-ext {
  font-size: 11px;
  color: var(--text-muted);
}

.format-help {
  margin-top: 12px;
}

.format-help summary {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
  padding: 8px 0;
}

.format-help-content {
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.format-help-item {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.format-help-item strong {
  color: var(--text-primary);
}

/* ── Dropzone ──────────────────────────────────────────────── */
.import-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--bg-card);
}

.import-dropzone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.import-dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 24px var(--primary-glow);
  transform: scale(1.01);
}

.dropzone-icon {
  margin-bottom: 16px;
  opacity: 0.4;
}

.import-dropzone h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.import-dropzone p {
  font-size: 13px;
  color: var(--text-muted);
}

.dropzone-hint {
  margin-top: 12px !important;
  font-size: 11px !important;
  color: var(--text-muted);
}

/* ── Upload Status ─────────────────────────────────────────── */
.import-upload-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
}

.import-upload-status.loading {
  background: var(--info-light);
  color: var(--info);
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.import-upload-status.error {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.upload-status-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(6, 182, 212, 0.2);
  border-top-color: var(--info);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Format Detected Banner ────────────────────────────────── */
.import-format-detected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
}

.format-detected-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.format-detected-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.format-detected-left strong {
  font-size: 14px;
  display: block;
  color: var(--text-primary);
}

.format-detected-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.format-detected-meta code {
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

/* ── Mapping Templates Bar ─────────────────────────────────── */
.mapping-templates-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 12px;
}

.mapping-templates-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mapping-templates-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.mapping-template-select {
  width: 250px;
}

/* ── Mapping Table ─────────────────────────────────────────── */
.mapping-table .mapping-row.mapping-required td:first-child {
  position: relative;
}

.mapping-field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.mapping-field-icon {
  font-size: 16px;
}

.mapping-required-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--danger-light);
  color: var(--danger);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.mapping-select {
  min-width: 200px;
}

.mapping-preview {
  font-size: 11px;
  background: var(--bg-tertiary);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text-muted);
  display: inline-block;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Preview Table ─────────────────────────────────────────── */
.preview-table {
  font-size: 12px;
}

.preview-table th,
.preview-table td {
  white-space: nowrap;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Import Summary ────────────────────────────────────────── */
.import-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.import-summary-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.import-summary-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.import-summary-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.import-summary-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Mapping Summary ───────────────────────────────────────── */
.mapping-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mapping-summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.mapping-summary-item.mapped .mapping-summary-source {
  color: var(--success);
  font-weight: 500;
}

.mapping-summary-item.unmapped {
  opacity: 0.5;
}

.mapping-summary-item.unmapped .mapping-summary-source {
  color: var(--text-muted);
  font-style: italic;
}

.mapping-summary-field {
  font-weight: 500;
  min-width: 100px;
}

.mapping-summary-arrow {
  color: var(--text-muted);
}

.mapping-summary-compact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-tertiary);
  padding: 12px;
  border-radius: var(--radius-sm);
}

.mapping-summary-compact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.mapping-summary-compact-item code {
  background: var(--bg-hover);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--primary);
}

/* ── Import Warning ────────────────────────────────────────── */
.import-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--warning-light);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  color: var(--warning);
  font-size: 13px;
  font-weight: 500;
  margin-top: 16px;
}

/* ── Import Result ─────────────────────────────────────────── */
.import-result-card {
  padding: 32px;
  border-radius: var(--radius-lg);
  text-align: center;
  margin-top: 16px;
}

.import-result-card.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.02));
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.import-result-card.error {
  background: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.import-result-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.import-result-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.import-result-stats {
  display: flex;
  justify-content: center;
  gap: 36px;
  margin-bottom: 24px;
}

.import-result-stat {
  text-align: center;
}

.import-result-stat-value {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.import-result-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.import-error-details {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.import-error-details strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.import-result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ── Import Actions Bar ────────────────────────────────────── */
.import-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}

/* ═══════════════════════════════════════════════════════════ */
/* AI WRITER & DELIVERABILITY STYLES                          */
/* ═══════════════════════════════════════════════════════════ */

/* ── AI Tools Grid ──────────────────────────────────────── */
.ai-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

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

.ai-tool-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge-ai {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-free {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── AI Result ──────────────────────────────────────────── */
.ai-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.ai-result-header h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.ai-result-body {
  font-family: 'Inter', monospace;
  line-height: 1.7;
  resize: vertical;
}

.ai-usage-info {
  margin-top: 8px;
  color: var(--text-muted);
}

.ai-usage-info small {
  font-size: 11px;
}

/* ── Subject Line List ──────────────────────────────────── */
.ai-subject-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.ai-subject-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.ai-subject-item:hover {
  background: var(--bg-card);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ai-subject-item span:first-child {
  font-size: 13px;
  color: var(--text-primary);
}

/* ── Spam Score ─────────────────────────────────────────── */
.spam-score-display {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: var(--bg-hover);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}

.spam-score-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid currentColor;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.spam-score-number {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.spam-score-label {
  font-size: 12px;
  color: var(--text-muted);
}

.spam-score-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.spam-score-text span {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.spam-score-text small {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Spam Issues List ───────────────────────────────────── */
.spam-issues-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spam-issue {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.spam-issue-error {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
  color: #fca5a5;
}

.spam-issue-warning {
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid #f59e0b;
  color: #fcd34d;
}

.spam-issue-info {
  background: rgba(99, 102, 241, 0.1);
  border-left: 3px solid #6366f1;
  color: #a5b4fc;
}

.spam-issue-success {
  background: rgba(16, 185, 129, 0.1);
  border-left: 3px solid #10b981;
  color: #6ee7b7;
}

/* ── Alert Banners ──────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
}

.alert a { color: var(--primary); text-decoration: underline; }

.alert-warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.alert-info {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

/* ── Status Badges ──────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

/* ── Stats Grid ─────────────────────────────────────────── */
.stats-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

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

.stat-progress {
  margin-top: 10px;
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}

.stat-progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.stat-unit {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 4px;
}

/* ── Two Column Layout ──────────────────────────────────── */
.two-column-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

/* ── Warmup Schedule ────────────────────────────────────── */
.warmup-info p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.warmup-schedule {
  display: flex;
  gap: 4px;
}

.warmup-week {
  flex: 1;
  text-align: center;
  padding: 12px 6px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.warmup-week.warmup-active {
  border-color: var(--primary);
  background: rgba(124, 58, 237, 0.1);
}

.warmup-week.warmup-done {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

.warmup-stage {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.warmup-limit {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Toggle / Checkbox Label ────────────────────────────── */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
}

.toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* ── Tips Grid ──────────────────────────────────────────── */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

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

.tip-item {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--bg-hover);
  border-radius: var(--radius-md);
}

.tip-icon {
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1;
}

.tip-item strong {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tip-item p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ── Button Extensions ──────────────────────────────────── */
.btn-full { width: 100%; }
.btn-xs { padding: 4px 10px; font-size: 11px; }

.page-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.text-muted { color: var(--text-muted); }

/* ── Email Finder ──────────────────────────────────────── */
.email-cell {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

#finderResultsTable td {
  vertical-align: middle;
  padding: 10px 14px;
}

#finderResultsTable a {
  word-break: break-all;
}

.badge-draft {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.finder-tab {
  padding: 10px 20px;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-weight: 500;
  transition: all 0.2s;
}
.finder-tab.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
  background: rgba(var(--primary-rgb, 99, 102, 241), 0.08);
}
.finder-tab:hover:not(.active) {
  background: var(--bg-secondary);
}
.finder-tab-content {
  animation: fadeIn 0.2s ease;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text-primary);
}
