/* ═══════════════════════════════════════════════════════════════════════════
   VisionexMailChimp — Design System & Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── CSS VARIABLES ─────────────────────────────────────────────────────── */
:root {
  --primary: #1a6fdb;
  --primary-dark: #1250a8;
  --primary-light: #dbeafe;
  --primary-gradient: linear-gradient(135deg, #1a6fdb 0%, #06b6d4 100%);
  --secondary: #06b6d4;

  --success: #10b981;
  --success-light: #d1fae5;
  --error: #ef4444;
  --error-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --info: #3b82f6;
  --info-light: #dbeafe;

  --bg-app: #f1f5f9;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-topbar: rgba(255,255,255,0.9);

  --border: #e2e8f0;
  --border-dark: #cbd5e1;

  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);

  --transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: all 0.35s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="dark"] {
  --bg-app: #0f172a;
  --bg-card: #1e293b;
  --bg-sidebar: #1e293b;
  --bg-topbar: rgba(30,41,59,0.95);
  --border: #334155;
  --border-dark: #475569;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --primary-light: #1e3a5f;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.4);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.5);
}

/* ─── RESET & BASE ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
ul { list-style: none; }

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

/* ─── APP SHELL ─────────────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ─── SIDEBAR ───────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: var(--transition-slow);
  overflow: hidden;
}

.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .badge,
.sidebar.collapsed .plan-info,
.sidebar.collapsed .plan-bar { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 16px 0; }
.sidebar.collapsed .logo-mark { margin: 0; }

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

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

.logo-mark {
  width: 34px; height: 34px;
  background: var(--primary-gradient);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-mark svg { color: #fff; width: 18px; height: 18px; }

.logo-text {
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.sidebar-toggle {
  color: var(--text-muted);
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition);
}
.sidebar-toggle:hover { background: var(--bg-app); color: var(--text-primary); }
.sidebar-toggle svg { width: 16px; height: 16px; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 20px 6px;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  margin: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

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

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item span:first-of-type { flex: 1; }

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  line-height: 1.4;
}
.badge-blue { background: var(--info-light); color: var(--info); }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-red { background: var(--error-light); color: var(--error); }
.badge-yellow { background: var(--warning-light); color: var(--warning); }

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

.plan-badge { }
.plan-info { display: flex; justify-content: space-between; margin-bottom: 8px; }
.plan-name { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.plan-usage { font-size: 0.75rem; color: var(--text-muted); }
.plan-bar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.plan-fill { height: 100%; background: var(--primary-gradient); border-radius: 3px; transition: width 0.5s; }

/* ─── MAIN WRAPPER ──────────────────────────────────────────────────────── */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition-slow);
}

.main-wrapper.collapsed { margin-left: 64px; }

/* ─── TOPBAR ────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-topbar);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }

.mobile-menu-btn { display: none; color: var(--text-secondary); padding: 6px; border-radius: 6px; }
.mobile-menu-btn:hover { background: var(--bg-app); }
.mobile-menu-btn svg { width: 20px; height: 20px; }

.global-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 200;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15); max-height: 360px; overflow-y: auto; padding: 6px;
}
.global-search-results.hidden { display: none; }
.gs-group { font-size: 0.68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); padding: 8px 10px 4px; }
.gs-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px;
  padding: 8px 10px; cursor: pointer; color: var(--text-primary); font-size: 0.85rem; }
.gs-item:hover { background: var(--bg-app); }
.gs-item small { display: block; color: var(--text-muted); font-size: 0.72rem; }
.gs-empty { padding: 14px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  min-width: 280px;
  transition: var(--transition);
}
.search-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,111,219,0.1); }
.search-wrap.sm { min-width: 200px; }
.search-icon { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.search-input { background: none; border: none; outline: none; font-size: 0.875rem; color: var(--text-primary); flex: 1; min-width: 0; }
.search-input::placeholder { color: var(--text-muted); }
.search-wrap kbd { font-size: 0.65rem; background: var(--border); border-radius: 4px; padding: 2px 6px; color: var(--text-muted); }

.topbar-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  transition: var(--transition);
  position: relative;
}
.topbar-btn:hover { background: var(--bg-app); border-color: var(--border); color: var(--text-primary); }
.topbar-btn svg { width: 18px; height: 18px; }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--error);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.tooltip { position: relative; }
.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-card);
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.tooltip:hover::after { opacity: 1; }

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}
.user-menu:hover { background: var(--bg-app); }

.user-avatar {
  width: 32px; height: 32px;
  background: var(--primary-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.83rem; font-weight: 600; line-height: 1.2; }
.user-role { font-size: 0.7rem; color: var(--text-muted); }
.chevron { width: 14px; height: 14px; color: var(--text-muted); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 180px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: var(--transition);
  z-index: 200;
}
.user-dropdown.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: var(--transition);
}
.user-dropdown a:hover { background: var(--bg-app); color: var(--text-primary); }
.user-dropdown a.danger { color: var(--error); }
.user-dropdown a svg { width: 15px; height: 15px; }
.user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* ─── NOTIFICATIONS PANEL ───────────────────────────────────────────────── */
.notifications-panel {
  position: fixed;
  top: calc(var(--topbar-height) + 8px);
  right: 20px;
  width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 95;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  transition: var(--transition);
}
.notifications-panel.open { opacity: 1; pointer-events: all; transform: translateY(0); }

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.notif-header button { font-size: 0.78rem; color: var(--primary); }
.notif-header button:hover { text-decoration: underline; }

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.notif-item:hover { background: var(--bg-app); }
.notif-item.unread { background: color-mix(in srgb, var(--primary) 4%, var(--bg-card)); }

.notif-dot-indicator {
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.notif-dot-indicator.green { background: var(--success); }
.notif-dot-indicator.red { background: var(--error); }
.notif-dot-indicator.blue { background: var(--info); }
.notif-dot-indicator.yellow { background: var(--warning); }

.notif-body p { font-size: 0.845rem; margin-bottom: 3px; line-height: 1.4; }
.notif-body span { font-size: 0.75rem; color: var(--text-muted); }

/* ─── PAGE CONTAINER & PAGES ────────────────────────────────────────────── */
.page-container {
  flex: 1;
  padding: 28px;
  overflow-x: hidden;
}

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.25s ease; }

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

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

.page-header h1 { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.page-subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-top: 2px; }

.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ─── BUTTONS ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
}
.btn svg { width: 15px; height: 15px; }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 2px 8px rgba(26,111,219,0.35);
}
.btn-primary:hover { opacity: 0.9; box-shadow: 0 4px 14px rgba(26,111,219,0.45); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-app); color: var(--text-primary); border-color: var(--border-dark); }

.btn-danger {
  background: var(--error);
  color: #fff;
}
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ─── FORM INPUTS ───────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.845rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: var(--transition);
  outline: none;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,111,219,0.1); }
.form-input::placeholder { color: var(--text-muted); }

.select-input {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}
.select-input:focus { border-color: var(--primary); }
.select-input.full { width: 100%; }

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

.input-with-icon { position: relative; }
.input-with-icon .form-input { padding-right: 44px; }
.input-icon-btn {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  padding: 4px;
}
.input-icon-btn svg { width: 16px; height: 16px; }

.color-row { display: flex; align-items: center; gap: 8px; }
.color-input { width: 42px; height: 38px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; padding: 2px; }

.range-input { width: 100%; accent-color: var(--primary); }
.range-val { font-size: 0.8rem; color: var(--text-muted); }

.toggle-group { display: flex; justify-content: space-between; align-items: center; }
.toggle {
  width: 42px; height: 24px;
  background: var(--border-dark);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}
.toggle::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.toggle.active { background: var(--primary); }
.toggle.active::after { left: 21px; }

/* ─── CARDS ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}
.card-header h3 { font-size: 1rem; font-weight: 600; }

/* ─── KPI CARDS ─────────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  transition: var(--transition);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.kpi-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-icon.blue { background: var(--info-light); color: var(--info); }
.kpi-icon.green { background: var(--success-light); color: var(--success); }
.kpi-icon.purple { background: #ede9fe; color: var(--secondary); }
.kpi-icon.red { background: var(--error-light); color: var(--error); }
.kpi-icon.yellow { background: var(--warning-light); color: var(--warning); }

.kpi-body { flex: 1; }
.kpi-label { display: block; font-size: 0.78rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-value { display: block; font-size: 1.85rem; font-weight: 700; margin: 4px 0 6px; letter-spacing: -0.02em; }
.kpi-delta { font-size: 0.78rem; font-weight: 500; display: flex; align-items: center; gap: 4px; }
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--error); }
.kpi-delta.neutral { color: var(--text-muted); }
.kpi-delta svg { width: 13px; height: 13px; }

/* ─── CHARTS ────────────────────────────────────────────────────────────── */
.charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.charts-row.mt { margin-top: 0; grid-template-columns: 1fr 2fr; }

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.chart-card:hover { box-shadow: var(--shadow); }

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 8px;
}
.chart-header h3 { font-size: 1rem; font-weight: 600; }
.chart-header p { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

.chart-legend { display: flex; align-items: center; gap: 14px; font-size: 0.8rem; color: var(--text-secondary); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.legend-dot.blue { background: var(--info); }
.legend-dot.green { background: var(--success); }
.legend-dot.purple { background: var(--secondary); }
.legend-dot.yellow { background: var(--warning); }
.legend-dot.red { background: var(--error); }

.pie-legend {
  display: flex;
  justify-content: space-around;
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ─── DATA TABLE ────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-app);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--primary) 3%, var(--bg-card)); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}
.status-pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
}
.status-pill.sent { background: var(--success-light); color: var(--success); }
.status-pill.sent::before { background: var(--success); }
.status-pill.failed { background: var(--error-light); color: var(--error); }
.status-pill.failed::before { background: var(--error); }
.status-pill.pending { background: var(--warning-light); color: var(--warning); }
.status-pill.pending::before { background: var(--warning); }
.status-pill.active { background: var(--success-light); color: var(--success); }
.status-pill.active::before { background: var(--success); }
.status-pill.scheduled { background: var(--info-light); color: var(--info); }
.status-pill.scheduled::before { background: var(--info); }
.status-pill.draft { background: var(--bg-app); color: var(--text-muted); border: 1px solid var(--border); }
.status-pill.draft::before { background: var(--text-muted); }
.status-pill.bounced { background: var(--error-light); color: var(--error); }
.status-pill.bounced::before { background: var(--error); }
.status-pill.unsubscribed, .status-pill.unsubscribe { background: var(--warning-light); color: var(--warning); }
.status-pill.unsubscribed::before, .status-pill.unsubscribe::before { background: var(--warning); }
.status-pill.completed { background: #f0fdf4; color: #16a34a; }
.status-pill.completed::before { background: #16a34a; }
.status-pill.sending { background: #eff6ff; color: #2563eb; }
.status-pill.sending::before { background: #2563eb; }
.status-pill.paused { background: var(--warning-light); color: var(--warning); }
.status-pill.paused::before { background: var(--warning); }
.status-pill.cancelled { background: var(--bg-app); color: var(--text-muted); border: 1px solid var(--border); }
.status-pill.cancelled::before { background: var(--text-muted); }
.status-pill.missed, .status-pill.blocked { background: #fef2f2; color: #b91c1c; }
.status-pill.missed::before, .status-pill.blocked::before { background: #dc2626; }
/* Delivery lifecycle statuses */
.status-pill.processed { background: #fff7ed; color: #c2410c; }
.status-pill.processed::before { background: #f97316; }
.status-pill.delivered { background: #eff6ff; color: #1d4ed8; }
.status-pill.delivered::before { background: #3b82f6; }
.status-pill.opened { background: var(--success-light); color: var(--success); }
.status-pill.opened::before { background: var(--success); }

.status-pill.negative_reply { background: var(--error-light); color: var(--error); }
.status-pill.negative_reply::before { background: var(--error); }
.status-pill.complaint { background: var(--error-light); color: var(--error); }
.status-pill.complaint::before { background: var(--error); }
.status-pill.bounce { background: var(--error-light); color: var(--error); }
.status-pill.bounce::before { background: var(--error); }
.status-pill.unengaged { background: var(--bg-app); color: var(--text-muted); border: 1px solid var(--border); }
.status-pill.unengaged::before { background: var(--text-muted); }
.status-pill.manual { background: var(--info-light); color: var(--info); }
.status-pill.manual::before { background: var(--info); }
.legend-dot.orange { background: #f97316; }

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.pagination { display: flex; align-items: center; gap: 4px; }
.page-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  transition: var(--transition);
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:disabled { opacity: 0.35; cursor: default; }
.page-btn svg { width: 13px; height: 13px; }

/* ─── SKELETON LOADER ───────────────────────────────────────────────────── */
.skel {
  height: 14px;
  background: var(--border);
  border-radius: 6px;
  animation: shimmer 1.5s infinite;
  background: linear-gradient(90deg, var(--border) 25%, var(--bg-app) 50%, var(--border) 75%);
  background-size: 200% 100%;
}
.skel-sm { width: 60%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── CAMPAIGNS ─────────────────────────────────────────────────────────── */
.campaign-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-tabs { display: flex; gap: 4px; }
.filter-tab {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.845rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: var(--transition);
}
.filter-tab:hover { background: var(--bg-app); }
.filter-tab.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

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

.campaigns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.campaign-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.campaign-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); }

/* Deep-link target flash — see _navigateAndHighlightCampaign() in app.js,
   used when jumping from a Follow-up 1 badge to its campaign card (or back). */
.campaign-card.highlight-flash { animation: campaignHighlightFlash 2s ease-out; }
@keyframes campaignHighlightFlash {
  0%   { box-shadow: 0 0 0 3px var(--primary); border-color: var(--primary); }
  100% { box-shadow: var(--shadow-sm); }
}

.campaign-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.campaign-card-header h3 { font-size: 0.95rem; font-weight: 600; line-height: 1.3; max-width: 200px; }
.campaign-card-body { margin-bottom: 16px; }
.campaign-meta { font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.campaign-meta svg { width: 13px; height: 13px; }

.campaign-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 14px; }
.c-stat { text-align: center; }
.c-stat-val { font-size: 1.1rem; font-weight: 700; display: block; }
.c-stat-lbl { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.campaign-progress { margin-top: 16px; }
.progress-bar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: var(--primary-gradient); transition: width 0.8s; }
.progress-label { font-size: 0.75rem; color: var(--text-muted); display: flex; justify-content: space-between; margin-top: 4px; }

.campaign-actions { display: flex; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.campaign-actions .btn { flex: 1; justify-content: center; }

/* ─── CONTACTS ──────────────────────────────────────────────────────────── */
.contacts-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.stat-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.845rem;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}
.stat-chip svg { width: 15px; height: 15px; }
.stat-chip.green { color: var(--success); }
.stat-chip.red { color: var(--error); }
.stat-chip.yellow { color: var(--warning); }

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeIn 0.2s;
}
.bulk-actions span { font-size: 0.845rem; font-weight: 500; color: var(--primary); }
.bulk-actions.hidden { display: none; }

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--primary-light);
  color: var(--primary);
  margin-right: 4px;
}

/* ─── TEMPLATES ─────────────────────────────────────────────────────────── */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.template-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}
.template-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.template-card:hover .template-overlay { opacity: 1; }

.template-thumb {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  position: relative;
  overflow: hidden;
}
.template-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26,111,219,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: var(--transition);
}
.template-overlay .btn { background: rgba(255,255,255,0.2); color: #fff; border-color: rgba(255,255,255,0.3); }
.template-overlay .btn:hover { background: rgba(255,255,255,0.35); }

.template-info { padding: 16px; }
.template-info h3 { font-size: 0.925rem; font-weight: 600; margin-bottom: 4px; }
.template-info p { font-size: 0.8rem; color: var(--text-muted); }
.template-tags { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

.template-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.tpl-pick-item {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}
.tpl-pick-item:hover, .tpl-pick-item.selected { border-color: var(--primary); }
.tpl-pick-item.selected { box-shadow: 0 0 0 3px rgba(26,111,219,0.2); }
.tpl-pick-thumb { height: 120px; position: relative; overflow: hidden; }
.tpl-pick-label { padding: 10px; font-size: 0.845rem; font-weight: 500; text-align: center; }

/* ─── EDITOR ────────────────────────────────────────────────────────────── */
.editor-shell {
  display: grid;
  grid-template-columns: 200px 1fr 240px;
  gap: 16px;
  height: calc(100vh - 200px);
}

.editor-blocks-panel, .editor-props-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-y: auto;
}
.editor-blocks-panel h4, .editor-props-panel h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.block-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 24px; }
.block-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.835rem;
  color: var(--text-secondary);
  background: var(--bg-app);
  cursor: grab;
  transition: var(--transition);
}
.block-item:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.block-item svg { width: 15px; height: 15px; }
.block-item:active { cursor: grabbing; }

.device-btns { display: flex; gap: 6px; }
.device-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}
.device-btn:hover, .device-btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.device-btn svg { width: 16px; height: 16px; }

.editor-canvas-wrap {
  overflow-y: auto;
  background: #e8eaf0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 32px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.editor-canvas {
  width: 600px;
  min-height: 400px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  overflow: hidden;
}
.editor-canvas.mobile-view { width: 375px; }

.email-block {
  position: relative;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}
.email-block:hover { border-color: var(--primary); }

.block-toolbar {
  display: none;
  position: absolute;
  top: -1px; right: -1px;
  background: var(--primary);
  border-radius: 0 0 0 6px;
  gap: 0;
  z-index: 10;
}
.email-block:hover .block-toolbar { display: flex; }
.block-toolbar span {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.9);
  cursor: pointer;
  transition: background 0.15s;
}
.block-toolbar span:hover { background: rgba(0,0,0,0.15); }
.block-toolbar svg { width: 13px; height: 13px; }

.var-list { display: flex; flex-direction: column; gap: 6px; }
.var-chip { font-size: 0.8rem; padding: 6px 10px; background: var(--bg-app); border-radius: var(--radius-sm); color: var(--text-secondary); }
.var-chip code { background: var(--primary-light); color: var(--primary); padding: 1px 5px; border-radius: 3px; font-size: 0.78rem; }

/* ─── WIZARD ────────────────────────────────────────────────────────────── */
.wizard-progress {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.wiz-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.wiz-step span { font-size: 0.78rem; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.wiz-step.active .wiz-num { background: var(--primary-gradient); color: #fff; box-shadow: 0 0 0 3px rgba(26,111,219,0.2); }
.wiz-step.active span { color: var(--primary); font-weight: 600; }
.wiz-step.done .wiz-num { background: var(--success); color: #fff; }
.wiz-step.done span { color: var(--success); }

.wiz-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 600;
  transition: var(--transition);
}

.wiz-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
  margin-bottom: 22px;
  min-width: 30px;
  transition: background 0.3s;
}
.wiz-connector.done { background: var(--success); }

.wizard-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.wiz-panel { display: none; padding: 32px; }
.wiz-panel.active { display: block; animation: fadeIn 0.2s; }
.wiz-panel h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 8px; }
.wiz-panel > p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 24px; }

.wiz-split { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.wiz-left, .wiz-right { }
.wiz-right h3 { font-size: 0.9rem; font-weight: 600; margin-bottom: 14px; color: var(--text-secondary); }

.wiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-top: 1px solid var(--border);
  background: var(--bg-app);
}
#wiz-step-label { font-size: 0.82rem; color: var(--text-muted); }

/* Drop zone */
.dropzone {
  border: 2px dashed var(--border-dark);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-light); }
.dropzone-icon svg { width: 48px; height: 48px; color: var(--text-muted); margin-bottom: 12px; }
.dropzone p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 6px; }
.dropzone p.muted { font-size: 0.8rem; color: var(--text-muted); }
.upload-btn { margin-top: 14px; }

.upload-result.hidden { display: none; }
.file-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--success-light);
  border: 1px solid var(--success);
  border-radius: var(--radius-sm);
  margin-top: 14px;
  font-size: 0.875rem;
  color: var(--success);
}
.file-chip svg { width: 18px; height: 18px; flex-shrink: 0; }
.file-chip button { margin-left: auto; color: var(--success); }
.file-chip button svg { width: 16px; height: 16px; }

.format-table-wrap { overflow-x: auto; margin-bottom: 16px; }
.format-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.format-table th, .format-table td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; }
.format-table th { background: var(--bg-app); font-weight: 600; color: var(--text-secondary); }
.format-table th.col-email { color: var(--success); background: var(--success-light); }

.preview-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-style: italic;
}

.format-error-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--error-light, #fef2f2);
  border: 1.5px solid var(--error, #ef4444);
  border-radius: var(--radius);
  font-size: 0.875rem;
}
.format-error-banner svg { width: 18px; height: 18px; color: var(--error); flex-shrink: 0; margin-top: 2px; }
.format-error-banner strong { color: var(--error); display: block; margin-bottom: 4px; }
.format-error-banner .muted { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.format-error-banner .mt-4 { margin-top: 4px; }
.format-error-banner code { background: rgba(0,0,0,0.06); padding: 1px 4px; border-radius: 3px; font-size: 0.82em; }

.tip-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--info-light);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  color: #1d4ed8;
}
.tip-box svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.tip-box code { background: rgba(59,130,246,0.15); padding: 1px 4px; border-radius: 3px; font-size: 0.78rem; }
.tip-box.mt { margin-top: 16px; }

.radio-group { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.radio-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
}
.radio-option:hover { border-color: var(--primary); }
.radio-option.selected { border-color: var(--primary); background: var(--primary-light); }
.radio-option input { accent-color: var(--primary); }
.radio-option small { color: var(--text-muted); font-size: 0.78rem; }
.radio-option.option-disabled { cursor: not-allowed; opacity: 0.5; }
.radio-option.option-disabled:hover { border-color: var(--border); }
.radio-option.option-disabled input { cursor: not-allowed; }

.smtp-fields { margin-top: 8px; }

.smtp-provider-hint { font-size: 0.8rem; margin-top: 5px; display: flex; align-items: center; gap: 6px; border-radius: 6px; padding: 5px 8px; }
.smtp-provider-hint.hidden { display: none; }
.smtp-provider-hint.detected { background: var(--success-light); color: var(--success); }
.smtp-provider-hint.manual { background: var(--bg-app); color: var(--text-muted); border: 1px solid var(--border); }
.smtp-provider-hint svg { width: 13px; height: 13px; flex-shrink: 0; }

.email-preview-card {
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.ep-row {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.845rem;
}
.ep-row:last-child { border-bottom: none; }
.ep-label { font-weight: 600; color: var(--text-muted); min-width: 60px; font-size: 0.78rem; }

.delivery-estimate {
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.de-row {
  display: flex;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.de-row:last-child { border-bottom: none; }
.de-row span { color: var(--text-muted); }
.de-row strong { color: var(--text-primary); }

.review-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; margin-bottom: 24px; }
.review-card {
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.review-card h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.review-card h4 svg { width: 14px; height: 14px; }
.review-val { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.review-sub { font-size: 0.8rem; color: var(--text-muted); }

.launch-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  background: linear-gradient(135deg, #ede9fe, #e0e7ff);
  border: 1px solid rgba(26,111,219,0.3);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
[data-theme="dark"] .launch-box { background: linear-gradient(135deg, #1e1b4b, #1e1b4b80); }
.launch-info { display: flex; align-items: center; gap: 16px; }
.launch-icon { width: 36px; height: 36px; color: var(--primary); }
.launch-info strong { font-size: 1rem; display: block; margin-bottom: 4px; }
.launch-info p { font-size: 0.85rem; color: var(--text-secondary); }

/* ─── SCHEDULER ─────────────────────────────────────────────────────────── */
.scheduler-layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; height: calc(100vh - 200px); }

.queue-panel, .timeline-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.queue-header, .tl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.queue-header h3, .tl-header h3 { font-size: 0.95rem; font-weight: 600; }

.tl-controls { display: flex; gap: 8px; }

.queue-list { flex: 1; overflow-y: auto; }

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.845rem;
  transition: var(--transition);
}
.queue-item:hover { background: var(--bg-app); }

.qi-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.qi-info { flex: 1; min-width: 0; }
.qi-name { font-weight: 500; truncate: ellipsis; overflow: hidden; white-space: nowrap; max-width: 160px; }
.qi-email { font-size: 0.77rem; color: var(--text-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 160px; }
.qi-meta { text-align: right; flex-shrink: 0; }
.qi-time { font-size: 0.77rem; color: var(--text-muted); }
.qi-campaign { font-size: 0.72rem; color: var(--primary); font-weight: 500; }

.timeline { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 0; }
.tl-item {
  display: flex;
  gap: 16px;
  padding-bottom: 20px;
  position: relative;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 28px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.tl-item:last-child::before { display: none; }

.tl-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  z-index: 1;
}
.tl-dot svg { width: 14px; height: 14px; }
.tl-dot.sent { background: var(--success-light); color: var(--success); border: 2px solid var(--success); }
.tl-dot.failed { background: var(--error-light); color: var(--error); border: 2px solid var(--error); }
.tl-dot.pending { background: var(--warning-light); color: var(--warning); border: 2px solid var(--warning); }
.tl-dot.skipped { background: var(--bg-sidebar); color: var(--text-muted); border: 2px solid var(--border); }

.tl-content { flex: 1; padding-top: 4px; }
.tl-content .tl-title { font-size: 0.875rem; font-weight: 500; }
.tl-content .tl-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.tl-time { font-size: 0.77rem; color: var(--text-muted); flex-shrink: 0; margin-top: 6px; }

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--success-light);
  color: var(--success);
}
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

/* ─── ANALYTICS ─────────────────────────────────────────────────────────── */
.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.akpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.akpi-card:hover { box-shadow: var(--shadow); }
.akpi-label { font-size: 0.78rem; font-weight: 500; color: var(--text-muted); display: block; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.akpi-val { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; }
.sparkline { opacity: 0.7; }

.heatmap-wrap {
  overflow-x: auto;
  padding-top: 8px;
}
.heatmap-grid {
  display: grid;
  grid-template-columns: 50px repeat(24, 1fr);
  gap: 3px;
  min-width: 600px;
}
.hm-cell {
  height: 28px;
  border-radius: 4px;
  background: var(--border);
  transition: opacity 0.2s;
}
.hm-cell:hover { opacity: 0.75; cursor: pointer; }
.hm-label { font-size: 0.7rem; color: var(--text-muted); display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; white-space: nowrap; }
.hm-hour-label { font-size: 0.65rem; color: var(--text-muted); text-align: center; height: 20px; display: flex; align-items: center; justify-content: center; }

/* ─── SETTINGS ──────────────────────────────────────────────────────────── */
.settings-layout { display: grid; grid-template-columns: 200px 1fr; gap: 24px; }

.settings-nav {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  height: fit-content;
  box-shadow: var(--shadow-sm);
}
.sn-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
}
.sn-item:hover { background: var(--bg-app); color: var(--text-primary); }
.sn-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.sn-item svg { width: 16px; height: 16px; }

.settings-content h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.settings-tab { display: none; }
.settings-tab.active { display: block; animation: fadeIn 0.2s; }

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.settings-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }

.api-integrations { display: flex; flex-direction: column; gap: 0; }
.api-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.api-row:last-child { border-bottom: none; }
.api-info { display: flex; align-items: center; gap: 12px; flex: 1; }
.api-logo {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; color: #fff;
}
.api-logo.sg { background: #1A82E2; }
.api-logo.mg { background: #F06D00; }
.api-logo.aws { background: #232F3E; }
.api-info > div > p { font-size: 0.8rem; color: var(--text-muted); }
.api-status { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); min-width: 110px; }
.api-status.connected { color: var(--success); }

.team-list { display: flex; flex-direction: column; gap: 0; }
.team-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.team-row:last-child { border-bottom: none; }
.team-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.team-avatar.teal { background: linear-gradient(135deg, #0ea5e9, #06b6d4); }
.team-avatar.pink { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.team-info { flex: 1; }
.team-info strong { display: block; font-size: 0.875rem; }
.team-info span { font-size: 0.8rem; color: var(--text-muted); }
.role-badge { font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: 10px; }
.role-badge.owner { background: #fef3c7; color: #d97706; }
.role-badge.admin { background: var(--primary-light); color: var(--primary); }
.role-badge.viewer { background: var(--bg-app); color: var(--text-muted); border: 1px solid var(--border); }

.plan-display { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.plan-tier { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary); margin-bottom: 4px; }
.plan-price { font-size: 2rem; font-weight: 700; margin-bottom: 12px; }
.plan-price small { font-size: 1rem; color: var(--text-muted); font-weight: 400; }
.plan-features { display: flex; flex-direction: column; gap: 6px; }
.plan-features span { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-secondary); }
.plan-features svg { width: 15px; height: 15px; color: var(--success); }

/* ─── MODAL ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  animation: fadeIn 0.2s;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 420px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: slideUp 0.25s ease;
}

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

.modal-icon { margin-bottom: 16px; }
.modal-icon svg { width: 44px; height: 44px; color: var(--warning); }
.modal h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.modal p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 24px; }
.modal-actions { display: flex; justify-content: center; gap: 12px; }

/* ─── TOAST ─────────────────────────────────────────────────────────────── */
/* Anchored top-right so it never overlaps bottom wizard navigation */
.toast-container {
  position: fixed;
  top: calc(var(--topbar-height) + 12px);
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 500;
  pointer-events: none; /* container itself is click-through */
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 0 16px; /* bottom-pad handled by progress bar */
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  min-width: 300px;
  max-width: 380px;
  animation: toastIn 0.32s cubic-bezier(0.34, 1.46, 0.64, 1);
  font-size: 0.875rem;
  position: relative;
  overflow: hidden;
  pointer-events: all;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-14px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.toast.out {
  animation: toastOut 0.22s ease forwards;
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-10px) scale(0.96); }
}

/* auto-dismiss progress bar at the bottom of the toast */
.toast-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  border-radius: 0 0 var(--radius) var(--radius);
  width: 100%;
  transform-origin: left center;
  animation: toastProgress linear forwards;
}

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

.toast-body {
  flex: 1;
  padding-bottom: 14px;
}
.toast-title {
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.3;
  margin-bottom: 1px;
}
.toast-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}
/* legacy single-message support */
.toast-msg { flex: 1; padding-bottom: 14px; }

.toast-icon { width: 19px; height: 19px; flex-shrink: 0; margin-top: 1px; }
.toast-close {
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0 14px 4px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.toast-close:hover { color: var(--text-primary); }
.toast-close svg { width: 14px; height: 14px; }

.toast.success { border-left: 4px solid var(--success); }
.toast.success .toast-icon  { color: var(--success); }
.toast.success .toast-progress { background: var(--success); }

.toast.error   { border-left: 4px solid var(--error); }
.toast.error   .toast-icon  { color: var(--error); }
.toast.error   .toast-progress { background: var(--error); }

.toast.info    { border-left: 4px solid var(--info); }
.toast.info    .toast-icon  { color: var(--info); }
.toast.info    .toast-progress { background: var(--info); }

.toast.warning { border-left: 4px solid var(--warning); }
.toast.warning .toast-icon  { color: var(--warning); }
.toast.warning .toast-progress { background: var(--warning); }

/* ─── UPLOAD INLINE CONFIRMATION ──────────────────────────────────────── */
.upload-inline-success {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--success-light);
  border: 1.5px solid var(--success);
  border-radius: var(--radius);
  margin-top: 12px;
  animation: toastIn 0.3s ease;
}
.upload-inline-success svg { width: 18px; height: 18px; color: var(--success); flex-shrink: 0; }
.uis-body { flex: 1; }
.uis-title { font-size: 0.875rem; font-weight: 600; color: #065f46; line-height: 1.3; }
.uis-sub   { font-size: 0.78rem; color: #047857; margin-top: 1px; }
.uis-cta   { font-size: 0.8rem; font-weight: 500; color: var(--success); white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.uis-cta svg { width: 13px; height: 13px; }
[data-theme="dark"] .uis-title { color: #a7f3d0; }
[data-theme="dark"] .uis-sub   { color: #6ee7b7; }

/* ─── ONBOARDING ────────────────────────────────────────────────────────── */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeIn 0.4s;
}

.onboarding-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px;
  max-width: 440px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.onboarding-modal::before {
  content: '';
  position: absolute;
  top: -80px; left: -80px;
  width: 300px; height: 300px;
  background: var(--primary-gradient);
  opacity: 0.06;
  border-radius: 50%;
}

.onboarding-step { display: none; }
.onboarding-step.active { display: block; animation: fadeIn 0.3s; }

.ob-icon-wrap {
  width: 72px; height: 72px;
  border-radius: 20px;
  background: var(--primary-gradient);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 8px 24px rgba(26,111,219,0.35);
}
.ob-icon-wrap.purple { background: linear-gradient(135deg, #0ea5e9, #06b6d4); box-shadow: 0 8px 24px rgba(6,182,212,0.35); }
.ob-icon-wrap.green { background: linear-gradient(135deg, #10b981, #34d399); box-shadow: 0 8px 24px rgba(16,185,129,0.35); }
.ob-icon-wrap svg { width: 34px; height: 34px; color: #fff; }

.onboarding-modal h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 12px; }
.onboarding-modal p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; margin-bottom: 28px; }

.onboarding-dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 28px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: var(--transition); }
.dot.active { background: var(--primary); width: 22px; border-radius: 4px; }

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

/* ─── SENDER OVERRIDE (Step 3) ──────────────────────────────────────────── */

/* Label row: "Select Sender" on the left, badge on the right */
.sender-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}
.sender-label-row label { margin-bottom: 0; }

/* Wrapper that stacks the <select> and the loading indicator */
.sender-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Sender badge ────────────────────────────────────────────────────────── */
.sender-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.4;
}
.sender-badge svg { width: 12px; height: 12px; flex-shrink: 0; }
.sender-badge.default {
  background: rgba(26,111,219,0.12);
  color: var(--primary);
  border: 1px solid rgba(26,111,219,0.3);
}
.sender-badge.saved {
  background: rgba(16,185,129,0.12);
  color: var(--success);
  border: 1px solid rgba(16,185,129,0.3);
}
.sender-badge.custom {
  background: rgba(245,158,11,0.12);
  color: #d97706;
  border: 1px solid rgba(245,158,11,0.3);
}
[data-theme="dark"] .sender-badge.custom { color: #fbbf24; }

/* ── API loading indicator ───────────────────────────────────────────────── */
.sender-api-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 4px 0;
}
.micro-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: dzSpin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ── API error notice ────────────────────────────────────────────────────── */
.sender-api-error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--warning);
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 8px;
}
.sender-api-error svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Pre-filled info box (default / saved) ────────────────────────────────── */
.sender-info-box {
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sib-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
}
.sib-label {
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 44px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.sib-val {
  color: var(--text-primary);
  font-weight: 500;
}
.sib-note {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.sib-note svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ── Custom sender fields container ──────────────────────────────────────── */
.custom-sender-fields {
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.custom-sender-fields .form-group { margin-bottom: 14px; }
.custom-sender-fields .form-group:last-child { margin-bottom: 0; }

/* Required star */
.req-star { color: var(--error); font-weight: 700; margin-left: 2px; }

/* Label with tooltip icon button */
.label-with-tip {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
}
.label-with-tip label { margin-bottom: 0; }
.tip-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.tip-icon-btn:hover { color: var(--primary); }
.tip-icon-btn svg { width: 14px; height: 14px; }

/* Inline field error message */
.field-error {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--error);
  margin-top: 4px;
}
.field-error svg { width: 12px; height: 12px; flex-shrink: 0; }

/* SMTP test connection inline result */
.smtp-test-result {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
}
.smtp-test-result.hidden { display: none; }
.smtp-test-result.success {
  background: var(--success-light);
  color: #065f46;
  border: 1px solid #6ee7b7;
}
.smtp-test-result.error {
  background: var(--error-light);
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.smtp-test-result.warning {
  background: var(--warning-light);
  color: #92400e;
  border: 1px solid #fcd34d;
}

/* Spinning icon for loading state */
@keyframes spin { to { transform: rotate(360deg); } }
.spin-icon { display: inline-block; animation: spin 0.8s linear infinite; }

/* Red border on invalid inputs */
.form-input.input-error {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 2px rgba(239,68,68,0.15);
}

/* Separator gap before Reply-To */
.sender-section-sep { margin-top: 18px; }

/* ── No saved senders fallback card ──────────────────────────────────────── */
.no-saved-senders {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 16px;
  background: var(--bg-app);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-muted);
  margin-top: 16px;
  font-size: 0.875rem;
}
.no-saved-senders svg { width: 28px; height: 28px; opacity: 0.4; }
.no-saved-senders p { margin: 0; }
.no-saved-senders p.muted { font-size: 0.78rem; }

/* ── Sender type context info card (right column) ────────────────────────── */
.sender-type-info-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--info-light);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 16px;
  font-size: 0.82rem;
  color: #1e40af;
}
.stic-icon svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.stic-body { line-height: 1.5; }
[data-theme="dark"] .sender-type-info-card { color: #93c5fd; background: rgba(59,130,246,0.08); }

/* ─── ONBOARDING SKIP BUTTON ────────────────────────────────────────────── */
.onboarding-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-app);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 1;
}
.onboarding-close-btn:hover { background: var(--border); color: var(--text-primary); }
.onboarding-close-btn svg { width: 16px; height: 16px; }

/* ─── DROPZONE LOADING SPINNER ──────────────────────────────────────────── */
.dz-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: dzSpin 0.8s linear infinite;
  margin: 0 auto 4px;
}
@keyframes dzSpin {
  to { transform: rotate(360deg); }
}

/* ─── UPLOAD SKIP NOTE (invalid/duplicate row count) ────────────────────── */
.uis-skip {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--warning);
  margin-top: 4px;
}
.uis-skip svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ─── WIZARD STEP 2 HEADER (title + upload button row) ─────────────────── */
.wiz-step2-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.wiz-step2-header h2 { margin-bottom: 4px; }
.wiz-step2-header > div > p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 0; }
.wiz-upload-tpl-btn { flex-shrink: 0; cursor: pointer; }
.wiz-upload-tpl-btn svg { width: 15px; height: 15px; }

/* ─── TEMPLATE EMPTY STATE ──────────────────────────────────────────────── */
.tpl-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
  color: var(--text-muted);
  gap: 10px;
  text-align: center;
}
.tpl-empty-state svg { width: 40px; height: 40px; opacity: 0.4; }
.tpl-empty-state p { font-size: 0.9rem; margin: 0; }
.tpl-empty-state p.muted { font-size: 0.8rem; }

/* ─── STATS MODAL EMAIL LISTS ───────────────────────────────────────────── */
.stats-lists { display: flex; flex-direction: column; gap: 6px; }

.stats-list-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stats-list-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-sidebar);
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: background 0.15s;
}
.stats-list-toggle:hover { background: var(--bg-app); }

.stats-arrow { font-size: 0.65rem; color: var(--text-muted); }

.stats-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  font-size: 0.7rem;
  font-weight: 700;
}

.stats-email-list {
  max-height: 180px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
}

.stats-email-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.stats-email-row:last-child { border-bottom: none; }
.stats-email-row:nth-child(even) { background: var(--bg-app); }

.stats-email-addr {
  color: var(--text-primary);
  font-family: monospace;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.stats-email-meta {
  color: var(--text-muted);
  font-size: 0.73rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.stats-empty-list {
  padding: 14px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

/* ─── UTILITY ───────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.muted { color: var(--text-muted) !important; }
.mt { margin-top: 16px; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ─── RESPONSIVE ────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .analytics-kpis { grid-template-columns: repeat(2,1fr); }
  .charts-row { grid-template-columns: 1fr; }
  .charts-row.mt { grid-template-columns: 1fr; }
  .wiz-split { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .editor-shell { grid-template-columns: 1fr; height: auto; }
  .editor-blocks-panel { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .editor-blocks-panel h4 { width: 100%; }
  .block-list { flex-direction: row; flex-wrap: wrap; }
  .editor-canvas { width: 100%; }
  .scheduler-layout { grid-template-columns: 1fr; height: auto; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { display: flex; flex-wrap: wrap; gap: 4px; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-wrapper { margin-left: 0 !important; }
  .mobile-menu-btn { display: flex; }
  .search-wrap { min-width: 160px; }
  .search-wrap kbd { display: none; }
  .user-info { display: none; }
  .page-container { padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .analytics-kpis { grid-template-columns: 1fr 1fr; }
  .campaign-filters { flex-direction: column; align-items: flex-start; }
  .wizard-progress { gap: 4px; }
  .wiz-connector { min-width: 16px; }
  .review-grid { grid-template-columns: 1fr; }
  .launch-box { flex-direction: column; align-items: flex-start; }
  .topbar { padding: 0 16px; gap: 8px; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .analytics-kpis { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .topbar-btn:not(.last) { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH SCREEN  –  full-page login / signup overlay
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-app);
  overflow: hidden;
}

/* Decorative gradient blobs */
.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  pointer-events: none;
}
.auth-blob-1 {
  width: 500px; height: 500px;
  background: var(--primary);
  top: -160px; left: -160px;
}
.auth-blob-2 {
  width: 400px; height: 400px;
  background: var(--secondary);
  bottom: -120px; right: -120px;
}

/* Card */
.auth-card {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 40px 32px;
  width: 100%;
  max-width: 440px;
  animation: authCardIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Brand */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.auth-logo-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--primary-gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.auth-logo-mark i { width: 20px; height: 20px; }
.auth-logo-text {
  font-size: 1.05rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.01em;
}

/* Tabs */
.auth-tabs {
  display: flex;
  background: var(--bg-app);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 28px;
  gap: 4px;
}
.auth-tab {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: transparent;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.auth-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Form title */
.auth-form-title { margin-bottom: 20px; }
.auth-form-title h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}
.auth-form-title p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Input with icon */
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-input-icon {
  position: absolute;
  left: 12px;
  width: 16px; height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.auth-input {
  padding-left: 38px !important;
  padding-right: 40px;
}
.auth-eye-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: flex; align-items: center;
  transition: color 0.15s;
}
.auth-eye-btn:hover { color: var(--text-secondary); }
.auth-eye-btn i { width: 16px; height: 16px; }

/* Field error */
.auth-field-error {
  display: block;
  min-height: 18px;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--error);
}

/* Error banner */
.auth-error-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--error-light);
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  color: #b91c1c;
  font-size: 0.85rem;
  margin-bottom: 16px;
}
.auth-error-banner i { width: 16px; height: 16px; flex-shrink: 0; }

/* Full-width button */
.btn-full { width: 100%; justify-content: center; }

/* Spinner animation */
.spin {
  animation: spinAnim 0.7s linear infinite;
  display: inline-block;
}
@keyframes spinAnim { to { transform: rotate(360deg); } }

/* Footer switch text */
.auth-switch-text {
  margin-top: 18px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Forgot / switch links */
.auth-link { color: var(--primary); font-weight: 500; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }
.forgot-link { float: right; font-size: 0.8rem; font-weight: 400; }

/* Label row with forgot link */
.form-label { display: flex; align-items: center; justify-content: space-between; }

/* Input error highlight */
.input-error {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15) !important;
}

/* Btn spinner hidden/shown */
.btn-spinner { display: inline-flex; align-items: center; gap: 6px; }

/* Dark mode adjustments */
[data-theme="dark"] .auth-error-banner {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.3);
  color: #fca5a5;
}
[data-theme="dark"] .auth-blob { opacity: 0.12; }

/* Mobile */
@media (max-width: 480px) {
  .auth-card { padding: 28px 20px 24px; max-width: 100%; margin: 16px; }
  .auth-blob { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SMTP CONFIG MANAGER  –  multi-account settings UI
   ═══════════════════════════════════════════════════════════════════════════ */

/* Header row */
.smtp-mgr-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.smtp-mgr-header h2 { margin: 0 0 2px; }
.smtp-mgr-header .page-subtitle { margin: 0; }

/* Search bar */
.smtp-search-bar { margin-bottom: 16px; }

/* Config list container */
.smtp-config-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }

/* Empty state */
.smtp-empty-state {
  text-align: center;
  padding: 48px 24px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}
.smtp-empty-icon {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  background: var(--bg-app);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.smtp-empty-icon i { width: 28px; height: 28px; }
.smtp-empty-state p { margin: 0 0 16px; font-size: 0.9rem; }

/* Config card */
.smtp-config-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  flex-wrap: wrap;
}
.smtp-config-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }

/* Card left: avatar + info */
.smtp-card-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.smtp-card-avatar {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 10px;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.smtp-card-info { min-width: 0; }
.smtp-card-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.smtp-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.smtp-card-meta span { display: flex; align-items: center; gap: 3px; }

/* Security / default badges */
.smtp-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.smtp-badge-tls     { background: var(--info-light);    color: var(--info);    }
.smtp-badge-ssl     { background: var(--success-light); color: var(--success); }
.smtp-badge-none    { background: var(--warning-light); color: var(--warning); }
.smtp-badge-default { background: var(--primary-light); color: var(--primary); }

/* Card actions */
.smtp-card-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.smtp-action-btn   { padding: 6px !important; }
.smtp-action-btn i { width: 15px; height: 15px; }
.danger-hover:hover { color: var(--error) !important; border-color: var(--error-light) !important; }

/* Per-card test result bar */
.smtp-card-test-result {
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.smtp-card-test-result.success { background: var(--success-light); color: #065f46; }
.smtp-card-test-result.error   { background: var(--error-light);   color: #991b1b; }
.smtp-card-test-result i       { width: 14px; height: 14px; flex-shrink: 0; }

/* Add / Edit drawer */
.smtp-form-drawer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  overflow: hidden;
  animation: smtpDrawerIn 0.25s ease;
}
@keyframes smtpDrawerIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.smtp-form-inner { padding: 20px 24px 24px; }
.smtp-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.smtp-form-header h3 { margin: 0; font-size: 1rem; }
.smtp-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* Checkbox label */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }

/* Responsive adjustments */
@media (max-width: 640px) {
  .smtp-config-card { flex-direction: column; align-items: flex-start; }
  .smtp-card-actions { width: 100%; justify-content: flex-end; }
  .smtp-form-actions { flex-direction: column; align-items: stretch; }
  .smtp-form-actions > div { width: 100%; display: flex; gap: 8px; }
  .smtp-mgr-header { flex-direction: column; align-items: flex-start; }
}

/* ─── VISIONEX BRANDING ──────────────────────────────────────────────────── */

/* Sidebar logo image */
.sidebar-logo-img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar.collapsed .sidebar-logo-img { width: 32px; height: 32px; }

/* Auth screen logo image */
.auth-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Splash screen — z-index 10001 sits above auth-screen (9999) and everything else.
   CSS animation auto-dismisses it after 2 s with no JS dependency.
   JS also adds .hidden (display:none) as a belt-and-suspenders cleanup. */
.splash-screen {
  position: fixed;
  inset: 0;
  background: #0d1117;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  animation: splash-auto-dismiss 0.5s ease 2s forwards;
}
/* CSS-only auto-dismiss: fades out after 2 s delay, stays gone (fill-mode: forwards) */
@keyframes splash-auto-dismiss {
  0%   { opacity: 1; pointer-events: all; visibility: visible; }
  100% { opacity: 0; pointer-events: none; visibility: hidden; }
}
/* JS-driven instant removal via classList.add('hidden') */
.splash-screen.hidden {
  display: none !important;
}
.splash-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.splash-logo {
  width: 90px;
  height: 90px;
  margin-bottom: 24px;
  animation: splash-pulse 2s ease infinite alternate;
}
@keyframes splash-pulse {
  from { filter: drop-shadow(0 0 8px rgba(26,111,219,0.4)); }
  to   { filter: drop-shadow(0 0 20px rgba(6,182,212,0.7)); }
}
.splash-title {
  font-size: 2rem;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.splash-subtitle {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 36px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
}
.splash-bar {
  width: 220px;
  height: 3px;
  background: #1e293b;
  border-radius: 2px;
  overflow: hidden;
}
.splash-progress {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 2px;
  animation: splash-fill 1.6s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes splash-fill {
  from { width: 0%; }
  to   { width: 100%; }
}

.toggle:focus-visible, .user-menu:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Campaign Stats modal KPI tiles: 7 across when there is room, wrapping to
   fewer columns on narrow screens instead of crushing the tiles. */
.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.notif-empty { padding: 24px 16px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

/* RBAC: controls above the viewer's role are hidden (server still enforces 403). */
.role-hidden { display: none !important; }
.role-badge.editor { background: #dcfce7; color: #15803d; }


/* ── Template editor (WYSIWYG) ─────────────────────────────────────────── */
.te-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 8px 10px; margin-bottom: 12px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
}
.te-toolbar.te-disabled .te-btn, .te-toolbar.te-disabled #te-format, .te-toolbar.te-disabled .te-color { opacity: .4; pointer-events: none; }
.te-btn {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text-secondary); background: none; cursor: pointer;
}
.te-btn:hover { background: var(--primary-light); color: var(--primary); }
.te-btn svg { width: 16px; height: 16px; }
.te-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.te-color { width: 32px; height: 32px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: none; cursor: pointer; }
.te-shell { height: calc(100vh - 280px); min-height: 420px; }
.te-shell .block-item { width: 100%; text-align: left; cursor: pointer; }
.te-canvas { padding: 28px 32px; color: #1e293b; line-height: 1.6; font-family: Arial, sans-serif; font-size: 14px; outline: none; }
.te-canvas:focus { box-shadow: 0 0 0 2px var(--primary), 0 8px 32px rgba(0,0,0,0.12); }
.te-canvas img { max-width: 100%; height: auto; }
.te-canvas table td { border: 1px dashed #cbd5e1; }
.te-canvas[contenteditable="false"] table td { border-color: transparent; }
.te-source { width: 100%; height: 100%; min-height: 420px; font-family: ui-monospace, Consolas, monospace; font-size: 0.8rem; resize: none; }
.editor-canvas-wrap .te-source { max-width: 900px; }
#te-preview-btn.active, #te-source-btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }


/* ── Analytics: engagement quality ─────────────────────────────────────── */
.eng-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 32px 0 14px; }
.eng-header h2 { font-size: 1.15rem; margin: 0 0 2px; }
.eng-open-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.eng-open-cards .akpi-card { display: flex; flex-direction: column; gap: 4px; }
.eng-highlight { border-color: var(--primary); background: var(--primary-light); }
.eng-note { font-size: 0.72rem; color: var(--text-muted); }
.eng-summary, .eng-coverage { font-size: 0.8rem; color: var(--text-secondary); margin: 10px 2px 0; line-height: 1.5; }
.eng-coverage { color: var(--text-muted); font-size: 0.75rem; }
.eng-sub { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 14px 0 8px; }
.eng-sub:first-child { margin-top: 0; }
.eng-empty { color: var(--text-muted); font-size: 0.82rem; padding: 12px 0; }
.eng-bar-row { margin-bottom: 8px; }
.eng-bar-label { display: flex; justify-content: space-between; font-size: 0.78rem; margin-bottom: 3px; color: var(--text-secondary); }
.eng-bar { height: 6px; background: var(--bg-app); border-radius: 3px; overflow: hidden; }
.eng-bar > div, .eng-inline-bar > div { height: 100%; background: var(--primary); border-radius: 3px; }
.eng-inline-bar { display: inline-block; vertical-align: middle; width: 70px; height: 6px; background: var(--bg-app); border-radius: 3px; overflow: hidden; margin-right: 8px; }


/* ── Settings > Deliverability ─────────────────────────────────────────── */
.dv-h { margin: 22px 0 8px; font-size: 1rem; }
.dv-sub { font-size: 0.78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 18px 0 8px; }
.dv-steps { margin: 6px 0 0 18px; padding: 0; font-size: 0.85rem; line-height: 1.6; color: var(--text-secondary); }
.dv-note { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; margin-top: 10px; }
.dv-rec { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 6px; background: var(--bg-app); }
.dv-rec > span { width: 90px; flex-shrink: 0; font-size: 0.75rem; color: var(--text-muted); }
.dv-rec > code { flex: 1; font-size: 0.78rem; }
.dv-pill { display: inline-block; font-size: 0.74rem; font-weight: 600; padding: 3px 10px; border-radius: 10px; background: var(--bg-app); color: var(--text-muted); border: 1px solid var(--border); }
.dv-pill.lvl-ok { background: #dcfce7; color: #15803d; border-color: transparent; }
.dv-pill.lvl-warn { background: #fef3c7; color: #b45309; border-color: transparent; }
.dv-pill.lvl-bad { background: #fee2e2; color: #b91c1c; border-color: transparent; }
.dv-pill.lvl-unknown { background: var(--bg-app); color: var(--text-muted); }
