/* Brainium Lead Analyzer Pro v3 — Professional Dashboard Styles */

/* ---- Help Panel ---- */
.help-panel {
  position: relative;
  flex-shrink: 0;
}
.help-toggle {
  position: fixed;
  right: 16px;
  top: 16px;
  z-index: 15;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: #fff;
  border: 1px solid #e5e7eb;
  display: grid;
  place-items: center;
  color: #6b7280;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: all 0.15s ease;
  cursor: pointer;
}
.help-toggle:hover {
  background: #f9fafb;
  color: #2563eb;
  border-color: #bfdbfe;
  box-shadow: 0 2px 8px rgba(79,70,229,0.12);
}
.help-toggle.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.help-content {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 280px;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  padding: 56px 16px 20px;
  overflow-y: auto;
  z-index: 14;
  box-shadow: -4px 0 16px rgba(0,0,0,0.04);
  animation: slideIn 0.2s ease;
}
.help-content.hidden {
  display: none;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.help-content h4 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #2563eb;
  margin-bottom: 0.35rem;
}
.help-content p {
  margin-bottom: 0.5rem;
  color: #4b5563;
}
.help-content ul {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
}
.help-content li {
  padding: 0.25rem 0;
  padding-left: 1rem;
  position: relative;
  color: #4b5563;
}
.help-content li::before {
  content: ">";
  position: absolute;
  left: 0;
  color: #93c5fd;
  font-weight: 700;
}
.help-step {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.5rem;
}
.help-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: #2563eb;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  margin-right: 0.35rem;
}

/* ---- Login Split Layout ---- */
.login-split {
  display: flex;
  min-height: 100vh;
  margin: 0;
}
.login-left {
  flex: 0 0 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: #fff;
  position: relative;
  order: 2;
}
.login-left::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, #e5e7eb 20%, #e5e7eb 80%, transparent);
}
.login-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 40%, #1e40af 100%);
  position: relative;
  overflow: hidden;
  order: 1;
}
.login-right::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(239,68,68,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.login-right::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -20%;
  width: 60%;
  height: 120%;
  background: radial-gradient(ellipse, rgba(59,130,246,0.1) 0%, transparent 70%);
  pointer-events: none;
}
.login-right-badge {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.15);
  color: #93c5fd;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 1.25rem;
}
.login-feature {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.login-feature-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 0.55rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  display: grid;
  place-items: center;
  color: #93c5fd;
}
@media (max-width: 900px) {
  .login-split { flex-direction: column; }
  .login-left { flex: none; padding: 2rem; }
  .login-left::after { display: none; }
  .login-right { padding: 2rem; }
}

/* ---- Sidebar ---- */
.sidebar-gradient {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  border-top: 3px solid #ef4444;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.6rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  transition: all 0.15s ease;
}
.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}
.nav-link.active {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ---- Status dots ---- */
.status-dot {
  height: 8px;
  width: 8px;
  border-radius: 9999px;
  display: inline-block;
  background-color: #475569;
  transition: all 0.3s ease;
}
/* Integration health: green = working, red = issue */
.status-dot.ok {
  background-color: #16a34a;
  box-shadow: 0 0 6px rgba(22, 163, 74, 0.45);
}
.status-dot.bad {
  background-color: #dc2626;
  box-shadow: 0 0 6px rgba(220, 38, 38, 0.4);
}
.status-dot.checking {
  background-color: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

/* ---- Cards ---- */
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.85rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
}
.card-flat {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.85rem;
}

/* ---- Stat cards ---- */
.stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.85rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}
.stat-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 0.65rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* ---- Priority badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* HIGH = red (hot), MEDIUM = blue (warm), LOW = grey (cold) */
.badge-HIGH {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  color: #dc2626;
  border: 1px solid #fecaca;
}
.badge-MEDIUM {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.badge-LOW {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.badge-none {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* ---- Buttons ---- */
.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #fff;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 0.6rem;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
  transform: translateY(-0.5px);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-primary-lg {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #fff;
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border-radius: 0.65rem;
  font-size: 0.95rem;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}
.btn-primary-lg:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}
.btn-ghost {
  background: #fff;
  border: 1px solid #d1d5db;
  color: #374151;
  font-weight: 500;
  padding: 0.5rem 0.95rem;
  border-radius: 0.6rem;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}
.btn-ghost:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}
.btn-ghost[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-ghost[disabled]:hover {
  background: #fff;
  border-color: #d1d5db;
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
  transition: all 0.15s ease;
}
.btn-icon:hover {
  background: #f9fafb;
  color: #374151;
  border-color: #d1d5db;
}
.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  color: #fff;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 0.6rem;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.3);
}
.btn-danger:hover {
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
  transform: translateY(-0.5px);
}

/* ---- Step timeline ---- */
.step-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #fff;
  transition: all 0.25s ease;
}
.step-card.running {
  border-color: #60a5fa;
  background: linear-gradient(135deg, #fafafe, #eff6ff);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08), 0 2px 12px rgba(59, 130, 246, 0.1);
}
.step-card.done {
  border-color: #bfdbfe;
  background: #fafbff;
}
.step-card.failed {
  border-color: #fca5a5;
  background: #fffbfb;
}
.step-icon {
  height: 32px;
  width: 32px;
  min-width: 32px;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  background: #f1f5f9;
  color: #94a3b8;
  transition: all 0.25s ease;
}
.step-card.running .step-icon {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1d4ed8;
}
.step-card.done .step-icon {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1d4ed8;
}
.step-card.failed .step-icon {
  background: linear-gradient(135deg, #ffe4e6, #fecdd3);
  color: #be123c;
}
.spin {
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Step connector line ---- */
.step-connector {
  width: 2px;
  height: 16px;
  background: #e5e7eb;
  margin-left: 2.1rem;
}
.step-connector.done {
  background: linear-gradient(180deg, #bfdbfe, #dbeafe);
}

/* ---- Tables ---- */
.data-table {
  width: 100%;
  font-size: 0.875rem;
}
.data-table thead {
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}
.data-table th {
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}
.data-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.data-table th.sortable:hover {
  color: #374151;
}
.data-table td {
  padding: 0.75rem 1rem;
}
.data-table tbody tr {
  border-top: 1px solid #f1f5f9;
  transition: background 0.1s ease;
}
.data-table tbody tr:hover {
  background: #f8fafc;
}

/* ---- Dropzone ---- */
.dropzone {
  border: 2px dashed #d1d5db;
  border-radius: 0.85rem;
  transition: all 0.2s ease;
  background: #fafafa;
}
.dropzone:hover {
  border-color: #93c5fd;
  background: #fafafe;
}
.dropzone.drag {
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
}

/* ---- Toast ---- */
.toast-item {
  background: #1e293b;
  color: #fff;
  padding: 0.7rem 1rem;
  border-radius: 0.65rem;
  font-size: 0.84rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: toastin 0.2s ease-out;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.toast-item.error {
  background: linear-gradient(135deg, #be123c, #e11d48);
}
.toast-item.ok {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
}
@keyframes toastin {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Accordion ---- */
.accordion-header {
  cursor: pointer;
  user-select: none;
  transition: background 0.1s ease;
}
.accordion-header:hover {
  background: #f8fafc;
}

/* ---- Inputs ---- */
.input {
  width: 100%;
  border-radius: 0.6rem;
  border: 1px solid #d1d5db;
  padding: 0.65rem 0.9rem;
  font-size: 0.875rem;
  transition: all 0.15s ease;
  background: #fff;
}
.input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.input-lg {
  padding: 0.85rem 1.1rem;
  font-size: 0.95rem;
  border-radius: 0.7rem;
}
.select {
  border-radius: 0.6rem;
  border: 1px solid #d1d5db;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  background: #fff;
  transition: all 0.15s ease;
}
.select:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ---- Section headers ---- */
.section-header {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

/* ---- Page header ---- */
.page-header {
  margin-bottom: 1.75rem;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
}
.page-subtitle {
  color: #6b7280;
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

/* ---- Progress bar ---- */
.progress-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: #94a3b8;
}
.empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  opacity: 0.4;
}

/* ---- Divider ---- */
.divider {
  height: 1px;
  background: #e5e7eb;
  margin: 1.5rem 0;
}

/* ---- Checkbox ---- */
.checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  accent-color: #2563eb;
}

/* ---- Skeleton loading ---- */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.5rem;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Fade in ---- */
.fade-in {
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Campaign Steps ---- */
.camp-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.camp-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #94a3b8;
  border: 2px solid #e2e8f0;
  transition: all 0.2s ease;
}
.camp-step.active .camp-step-circle {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.camp-step.completed .camp-step-circle {
  background: #2563eb;
  color: #fff;
  border-color: transparent;
}
.camp-step-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #94a3b8;
}
.camp-step.active .camp-step-label {
  color: #1e40af;
  font-weight: 600;
}
.camp-step.completed .camp-step-label {
  color: #1d4ed8;
}
.camp-step-line {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  margin: 0 0.5rem;
  transition: background 0.3s ease;
}
.camp-step-line.done {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

/* ---- Wizard step numbers ---- */
.wizard-step-num {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #94a3b8;
  border: 2px solid #e2e8f0;
  flex-shrink: 0;
}
.wizard-step-num.active {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* ---- Settings Tabs ---- */
.settings-tabs {
  display: flex;
  flex-direction: column;
}
.settings-tab {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1rem;
  font-size: 0.84rem;
  font-weight: 500;
  color: #6b7280;
  border-left: 3px solid transparent;
  transition: all 0.12s ease;
  text-align: left;
  cursor: pointer;
  background: none;
  border-top: none;
  border-right: none;
  border-bottom: 1px solid #f3f4f6;
  width: 100%;
}
.settings-tab:last-child {
  border-bottom: none;
}
.settings-tab:hover {
  background: #f9fafb;
  color: #374151;
}
.settings-tab.active {
  background: #eff6ff;
  color: #1d4ed8;
  border-left-color: #2563eb;
  font-weight: 600;
}
.settings-tab-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.settings-tab.active .settings-tab-icon {
  color: #2563eb;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ---- Report sections ---- */
.report-section {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #fff;
  margin-bottom: 0.5rem;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}
.report-section:hover {
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.report-section .accordion-header {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
}
.report-section .section-body {
  padding: 0 1rem 1rem;
  color: #4b5563;
  line-height: 1.7;
  font-size: 0.875rem;
}

/* ---- Email preview card ---- */
.email-preview {
  border: 1px solid #e5e7eb;
  border-radius: 0.85rem;
  overflow: hidden;
  background: #fff;
}
.email-header {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
  background: #fafbfc;
}
.email-body {
  padding: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ---- Tooltip ---- */
[title] {
  position: relative;
}

/* ============================================================
   NEW CLASSES FOR MULTI-PAGE ARCHITECTURE
   ============================================================ */

/* ---- Wizard step indicator (Campaign Studio) ---- */
.wizard-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  transition: all 0.25s ease;
}
.wizard-step.active {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #fff;
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.wizard-step.completed {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.wizard-step .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255,255,255,0.2);
}
.wizard-step.active .step-num {
  background: rgba(255,255,255,0.25);
}
.wizard-step.completed .step-num {
  background: #dbeafe;
}

/* ---- Step indicator connector (1->2->3->4) ---- */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
}
.step-indicator .step-line {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  min-width: 20px;
  max-width: 60px;
  transition: background 0.25s ease;
}
.step-indicator .step-line.done {
  background: linear-gradient(90deg, #bfdbfe, #2563eb);
}

/* ---- Filter chip / tag ---- */
.filter-chip,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  transition: all 0.15s ease;
}
.filter-chip:hover,
.tag:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}
.filter-chip .chip-remove,
.tag .tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  background: rgba(67, 56, 202, 0.15);
  color: #1d4ed8;
  cursor: pointer;
  font-size: 0.6rem;
  line-height: 1;
  transition: background 0.15s ease;
}
.filter-chip .chip-remove:hover,
.tag .tag-remove:hover {
  background: rgba(67, 56, 202, 0.3);
}

/* ---- Editable field (inline email editing) ---- */
.editable-field {
  border: 1px solid transparent;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  transition: all 0.15s ease;
  min-height: 2.5em;
  outline: none;
}
.editable-field:hover {
  border-color: #e5e7eb;
  background: #fafbfc;
}
.editable-field:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: #fff;
}
.editable-field[contenteditable="true"] {
  cursor: text;
}

/* ---- Campaign card ---- */
.campaign-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.85rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}
.campaign-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border-color: #d1d5db;
}
.campaign-card .campaign-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}
.campaign-card .campaign-status.running {
  background: #eff6ff;
  color: #1d4ed8;
}
.campaign-card .campaign-status.completed {
  background: #eff6ff;
  color: #1d4ed8;
}
.campaign-card .campaign-status.failed {
  background: #fff1f2;
  color: #be123c;
}

/* ---- Lead row (Lead Manager table) ---- */
.lead-row {
  border-top: 1px solid #f1f5f9;
  transition: background 0.1s ease;
  cursor: pointer;
}
.lead-row:hover {
  background: #f8fafc;
}
.lead-row.selected {
  background: #eff6ff;
}
.lead-row .lead-expand {
  display: none;
  padding: 0.75rem 1rem;
  background: #fafbfc;
  border-top: 1px solid #f1f5f9;
}
.lead-row.expanded .lead-expand {
  display: block;
}

/* ---- Column mapper (mapping Excel columns) ---- */
.column-mapper {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #fafbfc;
  margin-bottom: 0.5rem;
  transition: border-color 0.15s ease;
}
.column-mapper:hover {
  border-color: #d1d5db;
}
.column-mapper .col-source {
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  padding: 0.35rem 0.6rem;
  background: #f1f5f9;
  border-radius: 0.4rem;
}
.column-mapper .col-arrow {
  color: #94a3b8;
  font-size: 0.75rem;
}
.column-mapper .col-target select {
  width: 100%;
}

/* ---- Rich toolbar (email editing toolbar) ---- */
.rich-toolbar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.6rem;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-bottom: none;
  border-radius: 0.6rem 0.6rem 0 0;
}
.rich-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 0.35rem;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.1s ease;
  font-size: 0.85rem;
}
.rich-toolbar button:hover {
  background: #e5e7eb;
  color: #374151;
}
.rich-toolbar button.active {
  background: #dbeafe;
  color: #1d4ed8;
}
.rich-toolbar .toolbar-divider {
  width: 1px;
  height: 20px;
  background: #e5e7eb;
  margin: 0 0.25rem;
}

/* ---- Stat chart (CSS-only bar charts for dashboard) ---- */
.stat-chart .chart-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.stat-chart .chart-label {
  width: 4rem;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}
.stat-chart .chart-track {
  flex: 1;
  height: 1.25rem;
  background: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
}
.stat-chart .chart-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s ease;
}
.stat-chart .chart-value {
  width: 2rem;
  font-size: 0.75rem;
  color: #6b7280;
  text-align: right;
  flex-shrink: 0;
}

/* ===================================================================
   DASHBOARD — rich visual components
   =================================================================== */

/* ---- KPI hero cards ---- */
.kpi-card {
  position: relative;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.4rem 1.5rem;
  overflow: hidden;
  transition: all 0.2s ease;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.12);
}
.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.kpi-card.kpi-blue::before { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.kpi-card.kpi-grey::before { background: linear-gradient(90deg, #475569, #94a3b8); }
.kpi-card.kpi-red::before { background: linear-gradient(90deg, #dc2626, #f87171); }
.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
}
.kpi-blue .kpi-icon { background: #eff6ff; color: #2563eb; }
.kpi-grey .kpi-icon { background: #f1f5f9; color: #475569; }
.kpi-red .kpi-icon { background: #fef2f2; color: #dc2626; }
.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #0f172a;
}
.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}
.kpi-trend.up { background: #eff6ff; color: #1d4ed8; }
.kpi-trend.down { background: #fef2f2; color: #dc2626; }
.kpi-trend.flat { background: #f1f5f9; color: #64748b; }

/* ---- Donut chart ---- */
.donut-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto;
}
.donut {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.donut-hole {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 102px;
  height: 102px;
  background: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}
.donut-total {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}
.donut-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  font-weight: 600;
  margin-top: 0.1rem;
}
.donut-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.donut-legend-item:last-child { border-bottom: none; }
.donut-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ---- Vertical bar chart (activity) ---- */
.vbar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
  height: 160px;
  padding-top: 1rem;
}
.vbar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  height: 100%;
  justify-content: flex-end;
}
.vbar {
  width: 100%;
  max-width: 38px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  position: relative;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 4px;
  cursor: default;
}
.vbar:hover {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
}
.vbar.empty {
  background: #e2e8f0;
}
.vbar-count {
  font-size: 0.7rem;
  font-weight: 700;
  color: #475569;
}
.vbar-day {
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 500;
}

/* ---- Insight horizontal bars ---- */
.insight-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.7rem;
}
.insight-row:last-child { margin-bottom: 0; }
.insight-name {
  width: 38%;
  font-size: 0.78rem;
  color: #475569;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.insight-track {
  flex: 1;
  height: 0.65rem;
  background: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
}
.insight-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  transition: width 0.6s ease;
}
.insight-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
  width: 1.8rem;
  text-align: right;
}

/* ---- Welcome banner ---- */
.welcome-banner {
  background: linear-gradient(120deg, #0f172a 0%, #1e3a5f 55%, #1d4ed8 100%);
  border-radius: 1rem;
  padding: 1.6rem 1.8rem;
  position: relative;
  overflow: hidden;
}
.welcome-banner::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 50%;
  height: 180%;
  background: radial-gradient(ellipse, rgba(239, 68, 68, 0.12) 0%, transparent 70%);
  pointer-events: none;
}
.welcome-banner::after {
  content: "";
  position: absolute;
  bottom: -50%;
  left: 20%;
  width: 40%;
  height: 160%;
  background: radial-gradient(ellipse, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

/* ---- Mini campaign card ---- */
.mini-camp {
  padding: 0.85rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  transition: all 0.15s ease;
}
.mini-camp:hover {
  border-color: #bfdbfe;
  background: #fafbff;
}

/* ---- Tabs ---- */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 1.25rem;
}
.tab-btn {
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab-btn:hover {
  color: #374151;
}
.tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

/* ---- Bulk action bar ---- */
.bulk-bar {
  position: sticky;
  bottom: 1rem;
  background: #1e293b;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0.85rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: slideUp 0.2s ease;
  z-index: 10;
}
.bulk-bar button {
  padding: 0.4rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.1s ease;
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  background: rgba(255,255,255,0.1);
}
.bulk-bar button:hover {
  background: rgba(255,255,255,0.2);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Sender profile card ---- */
.sender-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  transition: all 0.15s ease;
}
.sender-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.sender-card.default {
  border-color: #93c5fd;
  background: #fafafe;
}
.sender-card .default-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
