@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ═══════════════════════════════════════════════════════════
   DESIGN TOKENS — Light (default)
═══════════════════════════════════════════════════════════ */
:root {
  /* Backgrounds */
  --bg-base:     #f0f2f7;
  --bg-surface:  #ffffff;
  --bg-elevated: #e8ecf3;
  --bg-hover:    #dde3ed;
  --bg-card:     #ffffff;
  --bg-glass:    rgba(255, 255, 255, 0.80);

  /* Borders */
  --border:        rgba(10, 20, 60, 0.08);
  --border-light:  rgba(10, 20, 60, 0.11);
  --border-strong: rgba(10, 20, 60, 0.18);

  /* Primary accent — DataVision orange */
  --accent:       #E84521;
  --accent-2:     #F05A35;
  --accent-hover: #C73718;
  --accent-dim:   rgba(232, 69, 33, 0.09);
  --accent-glow:  rgba(232, 69, 33, 0.22);
  --accent-soft:  rgba(232, 69, 33, 0.06);

  /* Gradients */
  --grad-primary:   linear-gradient(135deg, #E84521 0%, #F07A40 100%);
  --grad-primary-h: linear-gradient(135deg, #C73718 0%, #E06030 100%);
  --grad-success:   linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  --grad-warn:      linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --grad-danger:    linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --grad-text:      linear-gradient(135deg, #E84521 0%, #F07A40 100%);
  --grad-sidebar:   #ffffff;

  /* Semantic */
  --success:     #16a34a;
  --success-dim: rgba(22, 163, 74, 0.10);
  --warning:     #d97706;
  --warning-dim: rgba(217, 119, 6, 0.10);
  --danger:      #dc2626;
  --danger-dim:  rgba(220, 38, 38, 0.10);
  --purple:      #7c3aed;
  --purple-dim:  rgba(124, 58, 237, 0.10);
  --cyan:        #0891b2;
  --cyan-dim:    rgba(8, 145, 178, 0.10);

  /* Text */
  --text-primary:   #111827;
  --text-secondary: #4b5563;
  --text-muted:     #9ca3af;

  /* Geometry */
  --radius:    8px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 28px;

  /* Shadows (light) */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow:    0 4px 20px rgba(0, 0, 0, 0.10), 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.14), 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-accent: 0 4px 16px rgba(232, 69, 33, 0.25);
  --shadow-glow:   0 0 32px rgba(232, 69, 33, 0.12);

  --sidebar-w: 240px;
  color-scheme: light;
}

/* ═══════════════════════════════════════════════════════════
   DARK MODE TOKENS
═══════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  --bg-base:     #111318;
  --bg-surface:  #191c24;
  --bg-elevated: #1f2330;
  --bg-hover:    #262c3c;
  --bg-card:     #1b1f2b;
  --bg-glass:    rgba(25, 28, 36, 0.80);

  --border:        rgba(255, 255, 255, 0.06);
  --border-light:  rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.14);

  --accent:       #F05A35;
  --accent-2:     #F07A55;
  --accent-hover: #E04020;
  --accent-dim:   rgba(240, 90, 53, 0.14);
  --accent-glow:  rgba(240, 90, 53, 0.24);
  --accent-soft:  rgba(240, 90, 53, 0.08);

  --grad-primary:   linear-gradient(135deg, #F05A35 0%, #F07A55 100%);
  --grad-primary-h: linear-gradient(135deg, #E04020 0%, #E06040 100%);
  --grad-text:      linear-gradient(135deg, #F07A55 0%, #F09A75 100%);
  --grad-sidebar:   #191c24;

  --success:     #22c55e;
  --success-dim: rgba(34, 197, 94, 0.12);
  --warning:     #f59e0b;
  --warning-dim: rgba(245, 158, 11, 0.12);
  --danger:      #f87171;
  --danger-dim:  rgba(248, 113, 113, 0.12);
  --purple:      #a78bfa;
  --purple-dim:  rgba(167, 139, 250, 0.12);

  --text-primary:   #e1e5ef;
  --text-secondary: #7a8499;
  --text-muted:     #3f475a;

  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.40);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.50), 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow:    0 8px 28px rgba(0, 0, 0, 0.60), 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 56px rgba(0, 0, 0, 0.75), 0 8px 20px rgba(0, 0, 0, 0.45);
  --shadow-accent: 0 4px 16px rgba(240, 90, 53, 0.28);
  --shadow-glow:   0 0 40px rgba(240, 90, 53, 0.12);

  color-scheme: dark;
}

/* ═══════════════════════════════════════════════════════════
   BASE
═══════════════════════════════════════════════════════════ */
html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: "cv11", "ss01", "cv09";
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  transition: background 0.2s, color 0.2s;
}

/* ═══════════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════════ */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ═══════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: background 0.2s, border-color 0.2s;
}

.sidebar-logo {
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  position: relative;
}

.sidebar-logo-img {
  width: 100%;
  max-width: 148px;
  height: auto;
  object-fit: contain;
  display: block;
}

[data-theme="dark"] .sidebar-logo-img {
  filter: grayscale(1) brightness(1.3);
  opacity: 0.85;
}

.sidebar-brand-name { font-size: 15px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.5px; }
.sidebar-brand-name span { background: var(--grad-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.sidebar-brand-sub { font-size: 10px; color: var(--text-muted); margin-top: 2px; letter-spacing: 0.4px; }

.sidebar-nav { flex: 1; padding: 10px 8px; overflow-y: auto; }

.nav-section {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 10px 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  user-select: none;
  text-decoration: none;
  position: relative;
  margin-bottom: 1px;
  letter-spacing: -0.1px;
}

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

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

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
  box-shadow: var(--shadow-accent);
}

.nav-item .icon { width: 15px; height: 15px; opacity: 0.55; flex-shrink: 0; transition: opacity 0.15s; }
.nav-item:hover .icon { opacity: 0.8; }
.nav-item.active .icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   MAIN
═══════════════════════════════════════════════════════════ */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  height: 56px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  transition: background 0.2s, border-color 0.2s;
  box-shadow: var(--shadow-xs);
}

.topbar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  letter-spacing: -0.3px;
}
.topbar-subtitle { font-size: 12px; color: var(--text-muted); }
.topbar-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar-user-name { font-size: 12px; font-weight: 500; color: var(--text-secondary); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Theme toggle button */
.btn-theme-toggle {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.content { flex: 1; overflow-y: auto; padding: 24px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* ═══════════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

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

.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 13px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.2px; }

/* ═══════════════════════════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════════════════════════ */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  cursor: default;
  transition: border-color 0.22s, transform 0.22s, box-shadow 0.22s, background 0.2s;
  box-shadow: var(--shadow-xs);
}

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

/* Top color bar */
.stat-card .stat-accent-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card.blue   { border-color: rgba(74,108,247,0.15); }
.stat-card.blue:hover { border-color: rgba(74,108,247,0.3); box-shadow: 0 8px 32px rgba(74,108,247,0.12); }
.stat-card.blue .stat-accent-bar   { background: linear-gradient(90deg, #4a6cf7, #6080f8); }

.stat-card.green  { border-color: rgba(22,163,74,0.15); }
.stat-card.green:hover { border-color: rgba(22,163,74,0.3); box-shadow: 0 8px 32px rgba(22,163,74,0.12); }
.stat-card.green .stat-accent-bar  { background: linear-gradient(90deg, #22c55e, #16a34a); }

.stat-card.yellow { border-color: rgba(217,119,6,0.15); }
.stat-card.yellow:hover { border-color: rgba(217,119,6,0.3); box-shadow: 0 8px 32px rgba(217,119,6,0.12); }
.stat-card.yellow .stat-accent-bar { background: linear-gradient(90deg, #f59e0b, #d97706); }

.stat-card.purple { border-color: rgba(124,58,237,0.15); }
.stat-card.purple:hover { border-color: rgba(124,58,237,0.3); box-shadow: 0 8px 32px rgba(124,58,237,0.12); }
.stat-card.purple .stat-accent-bar { background: linear-gradient(90deg, #8b5cf6, #7c3aed); }

.stat-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.stat-icon.blue   { background: rgba(74,108,247,0.09);  color: #4a6cf7; }
.stat-icon.green  { background: rgba(22,163,74,0.09);   color: var(--success); }
.stat-icon.yellow { background: rgba(217,119,6,0.09);   color: var(--warning); }
.stat-icon.purple { background: rgba(124,58,237,0.09);  color: var(--purple); }

.stat-value {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -2px;
  font-feature-settings: "tnum";
}

.stat-card.blue   .stat-value { color: #4a6cf7; }
.stat-card.green  .stat-value { color: var(--success); }
.stat-card.yellow .stat-value { color: var(--warning); }
.stat-card.purple .stat-value { color: var(--purple); }

[data-theme="dark"] .stat-card.blue   .stat-value { background: linear-gradient(135deg,#F07A55,#F05A35); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
[data-theme="dark"] .stat-card.green  .stat-value { background: linear-gradient(135deg,#86efac,#4ade80); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
[data-theme="dark"] .stat-card.yellow .stat-value { background: linear-gradient(135deg,#fcd34d,#fbbf24); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
[data-theme="dark"] .stat-card.purple .stat-value { background: linear-gradient(135deg,#c4b5fd,#a78bfa); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }

.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-rate  { font-size: 11px; color: var(--text-muted); margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-rate span { color: var(--success); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1;
  font-family: inherit;
  letter-spacing: -0.1px;
  user-select: none;
}

.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 0.40; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover {
  background: var(--grad-primary-h);
  box-shadow: 0 4px 20px rgba(242, 155, 107, 0.35);
  transform: translateY(-1px);
}
.btn-primary:active { transform: scale(0.97) translateY(0); }
.btn-lg { padding: 11px 22px; font-size: 14px; }
.btn-full { width: 100%; justify-content: center; }

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

.btn-danger {
  background: var(--danger-dim);
  border: 1px solid rgba(220,38,38,0.15);
  color: var(--danger);
}
.btn-danger:hover { background: var(--grad-danger); color: #fff; border-color: transparent; }

.btn-success {
  background: var(--success-dim);
  border: 1px solid rgba(22,163,74,0.2);
  color: var(--success);
}
.btn-success:hover { background: var(--grad-success); color: #fff; border-color: transparent; }

.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn-icon { padding: 7px; aspect-ratio: 1; }

/* ═══════════════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
.table-container { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; }
#prospects-table { min-width: 1440px; table-layout: fixed; }

thead tr {
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: var(--bg-elevated); }

td {
  padding: 13px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  vertical-align: middle;
}

.td-name  { color: var(--text-primary); font-weight: 600; letter-spacing: -0.2px; }
.th-idx, .td-idx { width: 36px; min-width: 36px; max-width: 36px; }
.th-email, .td-email { width: 190px; min-width: 190px; max-width: 190px; }
.th-status, .td-status { width: 95px; min-width: 95px; max-width: 95px; }
.th-contact, .td-contact { width: 115px; min-width: 115px; max-width: 115px; }
.th-company, .td-company { width: 110px; min-width: 110px; max-width: 110px; }
.th-role, .td-role { width: 90px; min-width: 90px; max-width: 90px; }
.th-step, .td-step { width: 90px; min-width: 90px; max-width: 90px; }
.th-next, .td-next { width: 130px; min-width: 130px; max-width: 130px; }
.th-campaigns, .td-campaigns { width: 140px; min-width: 140px; max-width: 140px; }
.th-actions, .td-actions { width: 112px; min-width: 112px; max-width: 112px; }
.th-actions-lead, .td-actions-lead { width: 154px; min-width: 154px; max-width: 154px; }
.td-email {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.th-follow-up,
.td-follow-up { width: 360px; min-width: 360px; }
.td-company,
.td-contact,
.td-role,
.td-campaigns,
.td-next {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.td-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.campaign-summary-count { font-size: 11px; color: var(--text-muted); margin-left: 6px; }
.follow-up-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  height: 34px;
  padding: 0 32px 0 10px;
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.follow-up-select.has-stage {
  border-color: rgba(245, 158, 11, 0.35);
  background: var(--warning-dim);
  color: var(--warning);
  font-weight: 600;
}
.follow-up-select.stage-contactar {
  background: #fff7ed;
  border-color: rgba(249, 115, 22, 0.35);
  color: #c2410c;
}
.follow-up-select.stage-interesado {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.35);
  color: #1d4ed8;
}
.follow-up-select.stage-reunion {
  background: #f0fdf4;
  border-color: rgba(22, 163, 74, 0.35);
  color: #15803d;
}
.follow-up-select.stage-negociacion {
  background: #f5f3ff;
  border-color: rgba(124, 58, 237, 0.35);
  color: #6d28d9;
}
.follow-up-select.stage-ganado {
  background: #ecfdf5;
  border-color: rgba(5, 150, 105, 0.35);
  color: #047857;
}
.follow-up-select.stage-perdido {
  background: #fef2f2;
  border-color: rgba(220, 38, 38, 0.35);
  color: #b91c1c;
}

/* ═══════════════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.badge-sent     { background: rgba(74,108,247,0.10);  color: #4a6cf7; border: 1px solid rgba(74,108,247,0.18); }
.badge-opened   { background: var(--success-dim); color: var(--success); border: 1px solid rgba(22,163,74,0.2); }
.badge-clicked  { background: var(--purple-dim);  color: var(--purple); border: 1px solid rgba(124,58,237,0.2); }
.badge-draft    { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border-light); }
.badge-failed   { background: var(--danger-dim);  color: var(--danger); border: 1px solid rgba(220,38,38,0.2); }
.badge-active   { background: var(--success-dim); color: var(--success); border: 1px solid rgba(22,163,74,0.2); }
.badge-inactive { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }

/* ═══════════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; letter-spacing: 0.1px; }
.form-required { color: var(--danger); }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  outline: none;
}

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

.form-input:hover, .form-select:hover, .form-textarea:hover {
  border-color: var(--border-strong);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: var(--bg-surface);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
  background: var(--bg-elevated);
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] .form-textarea:focus {
  background: var(--bg-hover);
}

.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.form-select { appearance: none; cursor: pointer; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 5px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.three { grid-template-columns: 1fr 1fr 1fr; }

/* ═══════════════════════════════════════════════════════════
   TOGGLE
═══════════════════════════════════════════════════════════ */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle { position: relative; width: 40px; height: 22px; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-light);
  border-radius: 22px;
  transition: background 0.2s;
  border: 1px solid var(--border);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 2px; top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.22s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
  border-color: transparent;
}
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }
.toggle-label { font-size: 13px; color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 20px;
}

[data-theme="dark"] .modal-overlay { background: rgba(0, 0, 0, 0.70); }

.modal-overlay.open, .modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: min(92vw, 640px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(16px);
  transition: transform 0.28s cubic-bezier(.34,1.4,.64,1);
  overflow: hidden;
}

.modal-overlay.open .modal,
.modal-overlay.active .modal { transform: scale(1) translateY(0); }

.modal.wide { width: min(92vw, 900px); }

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

.modal-title { font-size: 15px; font-weight: 700; letter-spacing: -0.3px; }

.modal-close {
  width: 30px; height: 30px;
  border: 1px solid var(--border-light);
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: all 0.15s;
  line-height: 1;
}

.modal-close:hover {
  background: var(--danger-dim);
  border-color: rgba(220,38,38,0.3);
  color: var(--danger);
}

.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

/* ═══════════════════════════════════════════════════════════
   SECTION
═══════════════════════════════════════════════════════════ */
.section { display: none; }
.section.active { display: block; }
#section-whatsapp.active { display: flex; }
#section-whatsapp.active { display: block; overflow: hidden; }

/* ═══════════════════════════════════════════════════════════
   SEARCH BAR
═══════════════════════════════════════════════════════════ */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0 12px;
  width: 260px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text-primary);
  padding: 9px 0;
  font-family: inherit;
}

.search-bar input::placeholder { color: var(--text-muted); }

[data-theme="dark"] .search-bar { background: var(--bg-elevated); }

/* ═══════════════════════════════════════════════════════════
   TOOLBAR
═══════════════════════════════════════════════════════════ */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════
   UPLOAD ZONE
═══════════════════════════════════════════════════════════ */
.upload-zone {
  border: 1.5px dashed rgba(74,108,247,0.30);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(74,108,247,0.03);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.upload-zone-icon { font-size: 36px; margin-bottom: 12px; }
.upload-zone h3 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.upload-zone p { font-size: 12px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   EMAIL PREVIEW
═══════════════════════════════════════════════════════════ */
.email-preview {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.7;
  min-height: 200px;
  border: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════
   PROGRESS BAR
═══════════════════════════════════════════════════════════ */
.progress-wrap { background: var(--bg-elevated); border-radius: 20px; height: 5px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 20px; background: var(--grad-primary); transition: width 0.6s cubic-bezier(.25,.46,.45,.94); }
.progress-bar.green { background: var(--grad-success); }
.progress-bar.yellow { background: var(--grad-warn); }

/* ═══════════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════════ */
.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 9999; }

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  color: var(--text-primary);
  min-width: 290px;
  max-width: 380px;
  animation: toastIn 0.35s cubic-bezier(.34,1.5,.64,1);
}

.toast.success { border-color: rgba(22,163,74,0.3); }
.toast.error   { border-color: rgba(220,38,38,0.3); }
.toast.info    { border-color: rgba(74,108,247,0.3); }
.toast.warning { border-color: rgba(217,119,6,0.3); }
.toast-icon { font-size: 16px; flex-shrink: 0; }

@keyframes toastIn {
  from { transform: translateX(24px) scale(0.94); opacity: 0; }
  to   { transform: translateX(0) scale(1); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 56px 24px; }
.empty-state-icon { font-size: 32px; margin-bottom: 14px; opacity: 0.35; display: block; }
.empty-state h3 { font-size: 14px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 12px; color: var(--text-muted); line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════
   CAMPAIGNS GRID
═══════════════════════════════════════════════════════════ */
.campaigns-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

.campaign-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.campaign-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.campaign-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.campaign-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.campaign-card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); line-height: 1.3; letter-spacing: -0.3px; }
.campaign-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.campaign-card-stats { display: flex; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.campaign-stat { text-align: center; }
.campaign-stat-value { font-size: 18px; font-weight: 700; color: var(--text-primary); font-feature-settings: "tnum"; }
.campaign-stat-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.4px; }

/* ═══════════════════════════════════════════════════════════
   TABS
═══════════════════════════════════════════════════════════ */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-elevated);
  border-radius: 11px;
  padding: 3px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  color: var(--text-muted);
  transition: all 0.15s;
  border: none;
  background: transparent;
  font-family: inherit;
}

.tab.active {
  background: var(--bg-surface);
  color: var(--accent);
  box-shadow: var(--shadow-xs);
  font-weight: 600;
  border: 1px solid var(--border-light);
}

.tab:hover:not(.active) { color: var(--text-secondary); background: var(--bg-hover); }

/* ═══════════════════════════════════════════════════════════
   SPINNER
═══════════════════════════════════════════════════════════ */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}

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

/* ═══════════════════════════════════════════════════════════
   DETAIL VIEW
═══════════════════════════════════════════════════════════ */
.detail-grid { display: grid; grid-template-columns: 1fr 380px; gap: 20px; }

/* ═══════════════════════════════════════════════════════════
   CHECKBOX
═══════════════════════════════════════════════════════════ */
.checkbox-wrap { display: flex; align-items: center; gap: 8px; cursor: pointer; }
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

/* ═══════════════════════════════════════════════════════════
   TAG
═══════════════════════════════════════════════════════════ */
.tag {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(74,108,247,0.08);
  border: 1px solid rgba(74,108,247,0.18);
  border-radius: 5px;
  font-size: 11px;
  color: #4a6cf7;
  font-weight: 500;
}

[data-theme="dark"] .tag { color: #7b9af7; }

/* ═══════════════════════════════════════════════════════════
   CODE
═══════════════════════════════════════════════════════════ */
code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  background: rgba(74,108,247,0.08);
  padding: 2px 7px;
  border-radius: 5px;
  color: #4a6cf7;
  border: 1px solid rgba(74,108,247,0.15);
}

[data-theme="dark"] code { color: #7b9af7; }

/* ═══════════════════════════════════════════════════════════
   DIVIDER
═══════════════════════════════════════════════════════════ */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ═══════════════════════════════════════════════════════════
   LOADING OVERLAY
═══════════════════════════════════════════════════════════ */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  z-index: 10;
  backdrop-filter: blur(4px);
}

[data-theme="dark"] .loading-overlay { background: rgba(17, 19, 24, 0.80); }

/* ═══════════════════════════════════════════════════════════
   CHART BARS
═══════════════════════════════════════════════════════════ */
.chart-bar-wrap { display: flex; flex-direction: column; gap: 11px; }
.chart-row { display: flex; align-items: center; gap: 10px; }
.chart-label { font-size: 12px; color: var(--text-secondary); width: 80px; text-align: right; flex-shrink: 0; }
.chart-track { flex: 1; height: 6px; background: var(--bg-elevated); border-radius: 20px; overflow: hidden; }
.chart-fill { height: 100%; border-radius: 20px; transition: width 1s cubic-bezier(.25,.46,.45,.94); background: var(--grad-primary); }
.chart-pct { font-size: 12px; color: var(--text-muted); width: 42px; flex-shrink: 0; font-feature-settings: "tnum"; }

/* ═══════════════════════════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   STEP CARD
═══════════════════════════════════════════════════════════ */
.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 10px;
  transition: all 0.15s;
  box-shadow: var(--shadow-xs);
}

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

.step-number-badge {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(74,108,247,0.22);
}

.step-card-body { flex: 1; min-width: 0; }
.step-card-subject { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-card-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; display: flex; gap: 12px; }
.step-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════
   ENROLL ITEM
═══════════════════════════════════════════════════════════ */
.enroll-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.1s;
}
.enroll-item:hover { background: var(--bg-elevated); }
.enroll-item input[type=checkbox] { flex-shrink: 0; }
.enroll-item-info { flex: 1; min-width: 0; }
.enroll-item-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.enroll-item-meta { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ═══════════════════════════════════════════════════════════
   STATUS BADGES
═══════════════════════════════════════════════════════════ */
.badge-completed   { background: var(--success-dim); color: var(--success); border: 1px solid rgba(22,163,74,0.2); border-radius: 20px; padding: 3px 8px; font-size: 11px; font-weight: 600; }
.badge-paused      { background: var(--warning-dim); color: var(--warning); border: 1px solid rgba(217,119,6,0.2); border-radius: 20px; padding: 3px 8px; font-size: 11px; font-weight: 600; }
.badge-active-seq  { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(74,108,247,0.2); border-radius: 20px; padding: 3px 8px; font-size: 11px; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════
   AREA CHART
═══════════════════════════════════════════════════════════ */
.area-chart svg text { font-family: 'Inter', sans-serif; }

/* ═══════════════════════════════════════════════════════════
   HAMBURGER / RESPONSIVE
═══════════════════════════════════════════════════════════ */
.btn-hamburger {
  display: none;
  width: 36px; height: 36px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  transition: all 0.15s;
}
.btn-hamburger:hover { background: var(--bg-hover); }
.btn-hamburger span { display: block; width: 16px; height: 1.5px; background: var(--text-secondary); border-radius: 2px; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 99; }
.sidebar-overlay.open { display: block; }

@media (max-width: 768px) {
  /* ── Sidebar ── */
  .btn-hamburger { display: flex; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; transform: translateX(-100%); transition: transform 0.28s cubic-bezier(.22,.68,0,1.2); }
  .sidebar.open { transform: translateX(0); }
  .main { width: 100%; }
  .content { padding: 16px; }

  /* ── Topbar ── */
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-title { font-size: 13px; max-width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lang-text { display: none; }
  .lang-btn { padding: 5px 7px; }
  .lang-switcher { gap: 2px; }
  .topbar-user-name { display: none; }
  .btn-theme-toggle { display: none; }
  .topbar-clock { display: none; }

  /* ── Dashboard ── */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
  .stat-value { font-size: 26px; }
  .content > #section-dashboard > div[style*="grid-template-columns"] { display: flex !important; flex-direction: column; }

  /* ── Tables ── */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .toolbar { gap: 8px; flex-wrap: wrap; }
  .search-bar { width: 100%; }

  /* ── Forms ── */
  .form-grid { grid-template-columns: 1fr !important; }

  /* ── Analytics ── */
  .analytics-stats-row { grid-template-columns: repeat(2, 1fr); }
  .analytics-stat-value { font-size: 20px; }

  /* ── Campaign detail ── */
  .cd-header { margin: -16px -16px 0; padding: 0 16px; }
  .cd-tabs-row { flex-direction: column; align-items: flex-start; }
  .cd-tabs { overflow-x: auto; width: 100%; }
  .cd-tab { padding: 11px 14px; font-size: 12px; }
  .step-split { flex-direction: column; height: auto; min-height: unset; margin: 0 -16px; }
  .step-list-panel { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: 200px; }
  .step-editor-panel { padding: 16px; }

  /* ── Inbox ── */
  #section-inbox > div { flex-direction: column !important; height: auto !important; }
  #section-inbox > div > div:first-child { width: 100% !important; flex-direction: row !important; flex-wrap: wrap; gap: 8px; }
  #inbox-folders { flex-direction: row !important; flex-wrap: wrap; gap: 4px; }
  #section-inbox > div > div:last-child { min-height: 50vh; }

  /* ── RD Station ── */
  #rd-panel-contacts > div,
  #rd-panel-deals > div { flex-direction: column !important; }
  #rd-panel-contacts > div > div:first-child,
  #rd-panel-deals > div > div:first-child { width: 100% !important; }

  /* ── WhatsApp conversations ── */
  #wa-view-convos { flex-direction: column !important; }
  #wa-view-convos > div:first-child { width: 100% !important; max-height: 45vh; }
  #wa-view-convos > div:last-child { min-height: 50vh; }
  #wa-view-campaigns { flex-direction: column !important; }
  #wa-view-campaigns > div:first-child { width: 100% !important; }

  /* ── Modals ── */
  .modal { width: 100vw; max-height: 100dvh; border-radius: 20px 20px 0 0; margin-top: auto; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .toast { min-width: unset; width: calc(100vw - 32px); }
  .toast-container { right: 16px; left: 16px; bottom: 16px; }
}

/* ═══════════════════════════════════════════════════════════
   CAMPAIGN DETAIL TABS
═══════════════════════════════════════════════════════════ */
.cd-header {
  margin: -24px -24px 0;
  padding: 0 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: -24px;
  z-index: 10;
  box-shadow: var(--shadow-xs);
}

.cd-breadcrumb { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cd-name { font-size: 14px; font-weight: 700; letter-spacing: -0.3px; }
.cd-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.cd-tabs-row { display: flex; align-items: center; justify-content: space-between; }
.cd-tabs { display: flex; }

.cd-tab {
  padding: 13px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
  white-space: nowrap;
}

.cd-tab:hover { color: var(--text-secondary); }
.cd-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.cd-tab-content { display: none; padding-top: 20px; }
.cd-tab-content.active { display: block; }

/* ═══════════════════════════════════════════════════════════
   ANALYTICS STATS
═══════════════════════════════════════════════════════════ */
.analytics-stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

.analytics-stat-card { background: var(--bg-card); padding: 20px; text-align: center; }
.analytics-stat-label { font-size: 10px; color: var(--text-muted); margin-bottom: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; }
.analytics-stat-value { font-size: 28px; font-weight: 800; color: var(--accent); line-height: 1; font-feature-settings: "tnum"; letter-spacing: -1px; }
.analytics-stat-sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════
   STEP SPLIT PANE
═══════════════════════════════════════════════════════════ */
.step-split { display: flex; height: calc(100vh - 220px); min-height: 480px; margin: 0 -24px; border-top: 1px solid var(--border); }
.step-list-panel { width: 220px; flex-shrink: 0; border-right: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; background: var(--bg-elevated); }
.step-list-items { flex: 1; }
.step-editor-panel { flex: 1; overflow-y: auto; padding: 28px 32px; background: var(--bg-base); }
.step-list-item { padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; transition: all 0.12s; }
.step-list-item:hover { background: var(--bg-hover); }
.step-list-item.active { border-left-color: var(--accent); background: var(--accent-dim); }
.step-list-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.step-list-item-num { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; color: var(--text-muted); text-transform: uppercase; }
.step-list-item-subject { font-size: 12px; font-weight: 500; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-list-item-delay { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.step-list-footer { padding: 12px; border-top: 1px solid var(--border); flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════
   DAYS GRID
═══════════════════════════════════════════════════════════ */
.days-grid { display: flex; gap: 8px; flex-wrap: wrap; }

.day-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s;
  user-select: none;
  background: var(--bg-surface);
}

.day-label input { display: none; }
.day-label.checked { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }

/* ═══════════════════════════════════════════════════════════
   OPTION SECTION
═══════════════════════════════════════════════════════════ */
.option-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-xs); }
.option-section-header { margin-bottom: 16px; }
.option-section-title { font-size: 13px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.1px; }
.option-section-desc { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════
   CAMPAIGN TABLE
═══════════════════════════════════════════════════════════ */
.camp-name-cell { display: flex; align-items: center; gap: 10px; }
.camp-name-text { font-size: 13px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.2px; }
.camp-progress-wrap { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.camp-progress-bar { flex: 1; height: 4px; background: var(--bg-elevated); border-radius: 20px; overflow: hidden; }
.camp-progress-fill { height: 100%; border-radius: 20px; background: var(--grad-success); }
.camp-progress-pct { font-size: 11px; color: var(--text-secondary); width: 34px; text-align: right; flex-shrink: 0; font-feature-settings: "tnum"; }

/* ═══════════════════════════════════════════════════════════
   STEP EDITOR
═══════════════════════════════════════════════════════════ */
.step-editor-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 20px; display: flex; align-items: center; gap: 12px; letter-spacing: -0.4px; }
.step-editor-num { width: 28px; height: 28px; border-radius: 50%; background: var(--grad-primary); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step-editor-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; color: var(--text-muted); gap: 12px; }

/* ═══════════════════════════════════════════════════════════
   LIVE STATUS BADGE
═══════════════════════════════════════════════════════════ */
.badge-active-green {
  background: var(--success-dim);
  color: var(--success);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(22,163,74,0.2);
}

.badge-active-green::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

/* ═══════════════════════════════════════════════════════════
   AUTH SCREEN
═══════════════════════════════════════════════════════════ */
#auth-screen {
  background: var(--bg-base) !important;
  position: relative;
  overflow: hidden;
}

/* Subtle gradient in light mode */
#auth-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 20% 10%, rgba(74,108,247,0.10) 0%, transparent 55%),
    radial-gradient(ellipse 60% 70% at 80% 90%, rgba(124,58,237,0.08) 0%, transparent 55%);
  pointer-events: none;
}

/* Subtle grid pattern */
#auth-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   MULTI-SELECT DROPDOWN
═══════════════════════════════════════════════════════════ */
.ms-wrap { position: relative; }

.ms-trigger {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px; border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; background: var(--bg-base);
  font-size: 12px; color: var(--text-secondary);
  transition: border-color .15s;
  user-select: none;
}
.ms-trigger:hover { border-color: var(--accent); }
.ms-trigger.ms-open { border-color: var(--accent); }
.ms-trigger-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ms-dropdown {
  position: absolute; top: calc(100% + 3px); left: 0; right: 0; z-index: 200;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  max-height: 220px; overflow-y: auto;
}

.ms-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; cursor: pointer;
  font-size: 12px; color: var(--text-secondary);
  transition: background .1s;
}
.ms-item:hover { background: rgba(255,255,255,.05); color: var(--text-primary); }
.ms-item input[type=checkbox] { margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.ms-item.ms-checked { color: var(--text-primary); font-weight: 500; }

/* ── Language switcher ─────────────────────────────────────────────────── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 3px;
}
.lang-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.4px;
  transition: all .15s;
  font-family: inherit;
}
.lang-btn:hover { background: var(--bg-hover); color: var(--text-secondary); }
.lang-btn.active { background: var(--accent); color: #fff; }
.lang-btn .lang-flag { width: 20px; height: 15px; border-radius: 2px; object-fit: cover; flex-shrink: 0; }

.topbar-clock {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.topbar-clock svg { opacity: 0.5; flex-shrink: 0; }

/* ── WhatsApp theme variables ──────────────────────────────────────────── */
:root {
  --wa-bg-main:        #F0F2F5;
  --wa-bg-header:      #F0F2F5;
  --wa-bg-item:        #FFFFFF;
  --wa-bg-item-hover:  #F5F6F6;
  --wa-bg-deep:        #F5F6F6;
  --wa-bg-empty:       #F0F2F5;
  --wa-bg-chat:        #EAE6DF;
  --wa-bg-border:      #E9EDEF;
  --wa-text-primary:   #111827;
  --wa-text-secondary: #54656F;
  --wa-text-muted:     #667781;
  --wa-text-icon:      #54656F;
  --wa-bubble-in:      #FFFFFF;
  --wa-bubble-out:     #D9FDD3;
  --wa-bubble-out-meta:#667781;
}
[data-theme="dark"] {
  --wa-bg-main:        #111B21;
  --wa-bg-header:      #202C33;
  --wa-bg-item:        #2A3942;
  --wa-bg-item-hover:  #3A4D58;
  --wa-bg-deep:        #182229;
  --wa-bg-empty:       #222E35;
  --wa-bg-chat:        #0B141A;
  --wa-bg-border:      #1D2B34;
  --wa-text-primary:   #E9EDEF;
  --wa-text-secondary: #8696A0;
  --wa-text-muted:     #667781;
  --wa-text-icon:      #AEBAC1;
  --wa-bubble-in:      #202C33;
  --wa-bubble-out:     #005C4B;
  --wa-bubble-out-meta:#7BC9A3;
}


/* ═══════════════════════════════════════════════════════════
   NOTIFICATIONS
═══════════════════════════════════════════════════════════ */
.notif-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  transition: background 0.2s;
}
.notif-unread {
  border-left: 3px solid var(--accent);
  background: var(--bg-elevated);
}
.notif-read {
  opacity: 0.75;
}
.notif-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.notif-body {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.notif-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================================
   THEME 1:1 (Fuel base, pastel orange)
============================================================ */
:root {
  --accent: #f29b6b;
  --accent-2: #f6b48a;
  --accent-hover: #e68652;
  --accent-dim: rgba(242, 155, 107, 0.12);
  --accent-glow: rgba(242, 155, 107, 0.24);
  --accent-soft: rgba(242, 155, 107, 0.08);
  --grad-primary: linear-gradient(135deg, #f29b6b 0%, #f6b48a 100%);
  --grad-primary-h: linear-gradient(135deg, #e68652 0%, #f29b6b 100%);
  --grad-text: linear-gradient(135deg, #f29b6b 0%, #f6b48a 100%);
  --shadow-accent: 0 4px 16px rgba(242, 155, 107, 0.26);
  --shadow-glow: 0 0 32px rgba(242, 155, 107, 0.12);
}

[data-theme="dark"] {
  --accent: #f6b48a;
  --accent-2: #f9c8a5;
  --accent-hover: #ef9d6e;
  --accent-dim: rgba(246, 180, 138, 0.20);
  --accent-glow: rgba(246, 180, 138, 0.30);
  --accent-soft: rgba(246, 180, 138, 0.10);
  --grad-primary: linear-gradient(135deg, #f6b48a 0%, #f9c8a5 100%);
  --grad-primary-h: linear-gradient(135deg, #ef9d6e 0%, #f6b48a 100%);
  --grad-text: linear-gradient(135deg, #f9c8a5 0%, #fde1cb 100%);
  --shadow-accent: 0 4px 16px rgba(246, 180, 138, 0.28);
  --shadow-glow: 0 0 40px rgba(246, 180, 138, 0.12);
}

.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(242, 155, 107, 0.35);
}

.btn-lg { padding: 11px 22px; font-size: 14px; }
.btn-full { width: 100%; justify-content: center; }

.sidebar-logo-img { max-width: 200px; }
[data-theme="dark"] .sidebar-logo-img { filter: none !important; }

.app.auth-locked {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ============================================================
   AUTH SCREEN (1:1 from Fuel structure, pastel orange palette)
============================================================ */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background:
    radial-gradient(42vw 34vw at 18% 42%, rgba(242, 155, 107, 0.28) 0%, rgba(242, 155, 107, 0) 72%),
    radial-gradient(34vw 34vw at 78% 36%, rgba(246, 180, 138, 0.22) 0%, rgba(246, 180, 138, 0) 70%),
    linear-gradient(180deg, #f0f2f7 0%, #e8ecf3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.auth-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(10, 20, 60, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 20, 60, 0.06) 1px, transparent 1px);
  background-size: 54px 54px;
}

.auth-screen::after {
  content: none;
}

#auth-screen.auth-screen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2000 !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  overflow: hidden !important;
  background:
    radial-gradient(42vw 34vw at 18% 42%, rgba(242, 155, 107, 0.28) 0%, rgba(242, 155, 107, 0) 72%),
    radial-gradient(34vw 34vw at 78% 36%, rgba(246, 180, 138, 0.22) 0%, rgba(246, 180, 138, 0) 70%),
    linear-gradient(180deg, #f0f2f7 0%, #e8ecf3 100%) !important;
}

#auth-screen.auth-screen::before {
  content: '' !important;
  background-image:
    linear-gradient(rgba(10, 20, 60, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 20, 60, 0.06) 1px, transparent 1px) !important;
  background-size: 54px 54px !important;
}

#auth-screen.auth-screen::after {
  content: none !important;
}

[data-theme="dark"] .auth-screen {
  background:
    radial-gradient(42vw 34vw at 18% 42%, rgba(246, 180, 138, 0.18) 0%, rgba(246, 180, 138, 0) 72%),
    radial-gradient(34vw 34vw at 78% 36%, rgba(239, 157, 110, 0.12) 0%, rgba(239, 157, 110, 0) 70%),
    linear-gradient(180deg, #1a1f2e 0%, #181c2a 100%);
}

[data-theme="dark"] #auth-screen.auth-screen {
  background:
    radial-gradient(42vw 34vw at 18% 42%, rgba(246, 180, 138, 0.18) 0%, rgba(246, 180, 138, 0) 72%),
    radial-gradient(34vw 34vw at 78% 36%, rgba(239, 157, 110, 0.12) 0%, rgba(239, 157, 110, 0) 70%),
    linear-gradient(180deg, #1a1f2e 0%, #181c2a 100%) !important;
}

.auth-card {
  width: 420px;
  max-width: 100%;
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.80);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 18px;
  padding: 32px 28px 26px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 24px 58px rgba(194, 120, 76, 0.22), 0 4px 16px rgba(194, 120, 76, 0.10);
}

[data-theme="dark"] .auth-card {
  background: rgba(30, 40, 65, 0.82);
  border-color: rgba(246, 180, 138, 0.22);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.38);
}

.auth-logo-wrap { text-align: center; margin-bottom: 28px; }

.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.60);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

[data-theme="dark"] .auth-tabs {
  background: rgba(40, 55, 88, 0.54);
  border-color: rgba(246, 180, 138, 0.20);
}

.auth-tab {
  flex: 1;
  padding: 9px;
  border-radius: 7px;
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  transition: all 0.15s;
}

.auth-tab.active {
  background: rgba(255, 255, 255, 0.90);
  color: var(--text-primary);
  box-shadow: 0 1px 6px rgba(194, 120, 76, 0.14);
}

[data-theme="dark"] .auth-tab.active {
  background: rgba(242, 155, 107, 0.18);
  color: var(--text-primary);
}

.auth-form-wrap { padding-top: 4px; }
