/* ============================================================
   LeadsEvolution — Design System & Styles
   ============================================================ */

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

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg-0: #07070f;
  --bg-1: #0d0d1a;
  --bg-2: #12121f;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-h: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.07);
  --border-focus: rgba(108,95,246,0.6);

  --primary: #6c5ff6;
  --primary-l: #8b80f9;
  --primary-d: #4f44d9;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #3b82f6;
  --wa:      #25d366;

  --text-1: #f1f5f9;
  --text-2: #94a3b8;
  --text-3: #475569;

  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --nav-h: 68px;
  --header-h: 60px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-0);
  color: var(--text-1);
  min-height: 100dvh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font-family: inherit; }
button { cursor: pointer; border: none; background: none; }

/* ── Login Page ─────────────────────────────────────────────── */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(108,95,246,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(34,197,94,0.08) 0%, transparent 50%),
    var(--bg-0);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow), 0 0 0 1px rgba(108,95,246,0.1);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(108,95,246,0.4);
}

.login-logo h1 {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-l), #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-logo p { color: var(--text-2); font-size: 13px; margin-top: 4px; }

.login-form .form-group { margin-bottom: 20px; }
.login-form label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 8px; font-weight: 500; }

.password-wrap {
  position: relative;
}

.password-wrap input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 42px 12px 14px;
  color: var(--text-1);
  font-size: 16px;
  transition: border-color .2s, box-shadow .2s;
}

.password-wrap input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(108,95,246,0.15);
}

.toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  box-shadow: 0 4px 20px rgba(108,95,246,0.35);
  margin-top: 8px;
}

.btn-login:hover { opacity: 0.9; }
.btn-login:active { transform: scale(0.99); }

.login-error {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 14px;
  display: none;
}

.login-footer {
  text-align: center;
  margin-top: 28px;
  color: var(--text-3);
  font-size: 12px;
}

/* ── App Shell ──────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-bottom: var(--nav-h);
  background:
    radial-gradient(ellipse at 10% 0%, rgba(108,95,246,0.08) 0%, transparent 50%),
    var(--bg-0);
}

#app-content {
  flex: 1;
  padding: 16px 16px 0;
  overflow-y: auto;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* ── Bottom Navigation ──────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(13,13,26,0.92);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  z-index: 100;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 500;
  transition: color .2s, background .2s;
  flex: 1;
}

.nav-btn .nav-icon { font-size: 22px; line-height: 1; }
.nav-btn.active { color: var(--primary-l); background: rgba(108,95,246,0.12); }
.nav-btn:hover:not(.active) { color: var(--text-2); }

/* ── View Headers ───────────────────────────────────────────── */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-top: 8px;
}

.view-header h1 {
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.count-badge {
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
  color: var(--text-2);
}

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

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: background .2s, transform .15s;
}

.stat-card:hover { background: var(--bg-card-h); transform: translateY(-2px); }
.stat-card.primary { border-color: rgba(108,95,246,0.3); background: rgba(108,95,246,0.08); }
.stat-card.success { border-color: rgba(34,197,94,0.3); background: rgba(34,197,94,0.06); }
.stat-card.warning { border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.06); }

.stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1;
}

.stat-card.primary .stat-num { color: var(--primary-l); }
.stat-card.success .stat-num { color: var(--success); }
.stat-card.warning .stat-num { color: var(--warning); }

.stat-label { font-size: 11px; color: var(--text-2); margin-top: 4px; font-weight: 500; }

/* Mini stats */
.mini-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.stat-card.mini {
  padding: 12px;
  text-align: left;
  cursor: default;
}

.stat-card.mini .stat-num { font-size: 22px; }
.stat-card.mini .stat-label { font-size: 11px; }

/* ── Section Titles ─────────────────────────────────────────── */
.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 10px;
  margin-top: 4px;
}

/* ── Client Rows (dashboard recent) ────────────────────────── */
.client-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }

.client-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  transition: background .15s;
}

.client-row:hover { background: var(--bg-card-h); }

.client-row .badge { margin-left: auto; }

/* ── Avatars ─────────────────────────────────────────────────── */
.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  flex-shrink: 0;
}

.avatar.lg { width: 46px; height: 46px; font-size: 18px; }
.avatar.xl { width: 56px; height: 56px; font-size: 22px; }

/* ── Efecto blur en avatares (privacidad) ───────────────────── */
/* Los avatares aparecen borrosos y se muestran al pasar el dedo/cursor */
.avatar {
  filter: blur(6px);
  transition: filter 0.3s ease;
  user-select: none;
}
.avatar:hover,
.avatar:focus,
.avatar:active {
  filter: blur(0px);
}

/* Blur en números de teléfono */
.client-num {
  filter: blur(4px);
  transition: filter 0.3s ease;
  cursor: pointer;
}
.client-num:hover,
.client-num:active {
  filter: blur(0px);
}

/* Blur en toda la tarjeta de cliente: al tocar la tarjeta se revela */
.client-card:not(:hover):not(:active) .avatar,
.client-row:not(:hover):not(:active) .avatar {
  filter: blur(6px);
}
.client-card:hover .avatar,
.client-card:active .avatar,
.client-row:hover .avatar,
.client-row:active .avatar {
  filter: blur(0px);
}
.client-card:not(:hover):not(:active) .client-num,
.client-row:not(:hover):not(:active) .client-num {
  filter: blur(4px);
}
.client-card:hover .client-num,
.client-card:active .client-num,
.client-row:hover .client-num,
.client-row:active .client-num {
  filter: blur(0px);
}

/* Soporte táctil: al tocar se quita el blur momentáneamente */
@media (hover: none) {
  .avatar {
    filter: blur(6px);
    transition: filter 0.2s ease;
  }
  .client-num {
    filter: blur(4px);
    transition: filter 0.2s ease;
  }
  .client-card:active .avatar,
  .client-row:active .avatar {
    filter: blur(0px);
  }
  .client-card:active .client-num,
  .client-row:active .client-num {
    filter: blur(0px);
  }
}


.client-name { font-size: 14px; font-weight: 600; }
.client-num  { font-size: 12px; color: var(--text-2); }
.client-info { min-width: 0; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid;
  white-space: nowrap;
  flex-shrink: 0;
}

.badges-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

/* ── Quick Actions ──────────────────────────────────────────── */
.quick-actions { display: flex; gap: 10px; margin-top: 4px; padding-bottom: 20px; }
.quick-actions .btn-primary,
.quick-actions .btn-secondary { flex: 1; }

/* ── Filters Bar ────────────────────────────────────────────── */
.filters-bar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon { position: absolute; left: 12px; color: var(--text-3); font-size: 14px; }

.search-wrap input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px 10px 36px;
  color: var(--text-1);
  font-size: 14px;
  transition: border-color .2s;
}

.search-wrap input:focus { outline: none; border-color: var(--border-focus); }

.filter-row { display: flex; gap: 8px; }

.filter-row select {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  color: var(--text-1);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .2s;
}

.filter-row select:focus { outline: none; border-color: var(--border-focus); }

.filter-chips { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }

.chip {
  font-size: 12px;
  padding: 4px 10px;
  background: rgba(108,95,246,0.15);
  border: 1px solid rgba(108,95,246,0.3);
  color: var(--primary-l);
  border-radius: 20px;
}

/* ── Client Cards Grid ──────────────────────────────────────── */
.clients-grid { display: flex; flex-direction: column; gap: 10px; padding-bottom: 20px; }

@media (min-width: 600px) {
  .clients-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
}

.client-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  transition: background .15s, transform .15s;
}

.client-card:hover { background: var(--bg-card-h); transform: translateY(-1px); }

.client-card-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.client-card-info { flex: 1; min-width: 0; }

.client-card-actions { display: flex; gap: 6px; align-items: center; }

/* ── Campaigns ──────────────────────────────────────────────── */
.campaigns-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 20px; }

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

.campaign-card-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.campaign-info { flex: 1; }
.campaign-name { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.campaign-meta { font-size: 12px; color: var(--text-2); }
.campaign-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

/* Progress bar */
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0 4px;
}

.progress-bar.lg { height: 10px; border-radius: 5px; margin: 12px 0 8px; }

.progress-fill {
  height: 100%;
  border-radius: inherit;
  transition: width .5s ease;
}

.progress-label { font-size: 12px; color: var(--text-2); }

/* Campaign progress modal */
.camp-progress-box { margin: 16px 0; }
.prog-nums { font-size: 14px; color: var(--text-2); text-align: center; }

.camp-log {
  height: 200px;
  overflow-y: auto;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  appVersion: '2.3.0',
  font-size: 12px;
  font-family: 'Courier New', monospace;
  color: var(--text-2);
}

.fab-menu-item.highlight-green { border-color: #25d366; }
.fab-menu-item.highlight-blue { border-color: #3b82f6; }

.log-line { padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.03); }

/* ── Settings ─────────────────────────────────────────────── */
.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}

.settings-section .section-title {
  font-size: 13px;
  margin-bottom: 14px;
  color: var(--text-2);
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 20px;
}

.app-version {
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
  padding: 8px 0 20px;
}

.alert-info {
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  color: #93c5fd;
  margin: 10px 0;
}

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

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

.form-group label small { font-size: 11px; text-transform: none; letter-spacing: 0; font-weight: 400; }

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-1);
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(108,95,246,0.12);
}

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

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

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  box-shadow: 0 4px 16px rgba(108,95,246,0.3);
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.sm { padding: 7px 14px; font-size: 13px; }

.btn-secondary {
  background: rgba(255,255,255,0.07);
  color: var(--text-1);
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background .2s;
}

.btn-secondary:hover { background: rgba(255,255,255,0.1); }
.btn-secondary.sm { padding: 7px 14px; font-size: 13px; }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background .2s, color .2s;
}

.btn-ghost:hover { background: var(--bg-card); color: var(--text-1); }
.btn-ghost.sm { padding: 7px 14px; font-size: 13px; }
.btn-ghost.danger:hover { color: var(--danger); border-color: rgba(239,68,68,0.3); }

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(239,68,68,0.3);
  cursor: pointer;
  transition: background .2s;
}

.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-danger.sm { padding: 7px 14px; font-size: 13px; }

.btn-warning {
  background: rgba(245,158,11,0.15);
  color: #fcd34d;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(245,158,11,0.3);
  cursor: pointer;
  transition: background .2s;
}

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

.btn-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  font-size: 15px;
  cursor: pointer;
  transition: background .15s;
}

.btn-icon:hover { background: rgba(255,255,255,0.1); }
.btn-icon.danger:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3); }

/* WhatsApp Button */
.btn-wa {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(37,211,102,0.12);
  border: 1px solid rgba(37,211,102,0.3);
  color: var(--wa);
  transition: background .15s;
}

.btn-wa:hover { background: rgba(37,211,102,0.2); }

.btn-wa-full {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  background: rgba(37,211,102,0.12);
  border: 1px solid rgba(37,211,102,0.3);
  border-radius: var(--radius-sm);
  color: var(--wa);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}

.btn-wa-full:hover { background: rgba(37,211,102,0.2); }

/* ── Workflow Toggle ─────────────────────────────────────────── */
.workflow-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 4px 10px 4px 8px;
  font-size: 12px;
}

.wf-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
}

.workflow-toggle.active  { border-color: rgba(34,197,94,0.4); }
.workflow-toggle.active  .wf-dot { background: var(--success); box-shadow: 0 0 6px var(--success); }
.workflow-toggle.paused  { border-color: rgba(245,158,11,0.4); }
.workflow-toggle.paused  .wf-dot { background: var(--warning); }

.wf-label { color: var(--text-2); white-space: nowrap; }

.wf-btn {
  background: rgba(108,95,246,0.15);
  color: var(--primary-l);
  border: 1px solid rgba(108,95,246,0.3);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}

.wf-btn:hover { background: rgba(108,95,246,0.25); }

/* ── Modal ──────────────────────────────────────────────────── */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}

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

.modal {
  width: 100%;
  max-width: 520px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  padding: 24px 20px 32px;
  max-height: 90dvh;
  overflow-y: auto;
  transform: translateY(30px);
  transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#modal-overlay.open .modal { transform: translateY(0); }

@media (min-width: 600px) {
  #modal-overlay { align-items: center; }
  .modal {
    border-radius: var(--radius-lg);
    max-height: 85dvh;
  }
}

.modal h2 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 17px; font-weight: 700; }
.modal-subtitle { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.modal-desc { color: var(--text-2); font-size: 13px; margin-bottom: 16px; }

.modal-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-2);
  margin: 14px 0;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.modal-center { text-align: center; }
.modal-center p { color: var(--text-2); font-size: 14px; margin: 10px 0 20px; }
.modal-icon { font-size: 40px; margin-bottom: 12px; }
.modal-icon.danger { filter: grayscale(0); }

/* Import options */
.import-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background .15s;
}

.option-btn:hover { background: var(--bg-card-h); }
.opt-icon { font-size: 24px; flex-shrink: 0; }
.opt-title { font-size: 14px; font-weight: 600; }
.opt-desc { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ── Toast Notifications ────────────────────────────────────── */
.toast {
  position: fixed;
  top: 20px;
  right: 50%;
  transform: translateX(50%) translateY(-80px);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  z-index: 500;
  box-shadow: var(--shadow);
  white-space: nowrap;
  transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity .3s;
  opacity: 0;
}

.toast.show { transform: translateX(50%) translateY(0); opacity: 1; }
.toast-success { border-color: rgba(34,197,94,0.4); }
.toast-error   { border-color: rgba(239,68,68,0.4); }
.toast-warning { border-color: rgba(245,158,11,0.4); }

/* ── Empty States ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-2);
}

.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { margin-bottom: 16px; }

.empty-msg { text-align: center; color: var(--text-3); font-size: 13px; padding: 20px; }
.empty-msg a { color: var(--primary-l); }

/* ── Utilities ──────────────────────────────────────────────── */
.muted { color: var(--text-3); }
em.muted { font-style: italic; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

/* ── Botón destacado en modal de importar ────────────────── */
.option-btn.highlight {
  border-color: rgba(34,197,94,0.4);
  background: rgba(34,197,94,0.07);
  box-shadow: 0 0 0 1px rgba(34,197,94,0.2), 0 4px 16px rgba(34,197,94,0.1);
  position: relative;
  overflow: hidden;
}

.option-btn.highlight::before {
  content: 'RECOMENDADO';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #22c55e;
  opacity: 0.8;
}

.option-btn.highlight:hover {
  border-color: rgba(34,197,94,0.7);
  background: rgba(34,197,94,0.12);
  box-shadow: 0 0 0 1px rgba(34,197,94,0.4), 0 8px 24px rgba(34,197,94,0.15);
}

.option-btn.highlight .opt-icon {
  filter: drop-shadow(0 0 6px rgba(34,197,94,0.4));
}

/* ── Pausa / Reanudación de Campañas ────────────────────────── */
.camp-paused-info {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: #f59e0b;
  margin-bottom: 10px;
}

.camp-resume-info {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: #3b82f6;
  margin-bottom: 12px;
}

/* ── Botón Volver al Dashboard ──────────────────────────── */
.view-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-2);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-back:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-1);
  border-color: rgba(255,255,255,0.2);
  transform: translateX(-2px);
}

/* ── FAB Sync flotante ──────────────────────────────────── */
#fab-sync-container {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.fab-sync {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(59,130,246,0.45), 0 0 0 0 rgba(59,130,246,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fab-pulse 3s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab-sync:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(59,130,246,0.6);
  animation: none;
}

@keyframes fab-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(59,130,246,0.45), 0 0 0 0 rgba(59,130,246,0.3); }
  50%       { box-shadow: 0 4px 20px rgba(59,130,246,0.45), 0 0 0 10px rgba(59,130,246,0); }
}

.fab-menu {
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.fab-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-1);
  border-radius: 24px;
  padding: 8px 16px 8px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
}

.fab-menu-item:hover {
  background: var(--surface-3);
  border-color: var(--primary-l);
  transform: translateX(-2px);
}

.fab-menu-item.highlight-green {
  border-color: rgba(34,197,94,0.4);
  color: #22c55e;
}
.fab-menu-item.highlight-green:hover {
  background: rgba(34,197,94,0.1);
  border-color: rgba(34,197,94,0.7);
}

.fab-menu-item.highlight-blue {
  border-color: rgba(59,130,246,0.4);
  color: #60a5fa;
}
.fab-menu-item.highlight-blue:hover {
  background: rgba(59,130,246,0.1);
  border-color: rgba(59,130,246,0.7);
}

/* ── Form row (botones en fila) ─────────────────────────── */
.form-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ── Quick actions - hasta 3 botones ───────────────────── */
.quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 0 8px;
}

.quick-actions button {
  flex: 1;
  min-width: 120px;
}

/* ── btn-secondary ──────────────────────────────────────── */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  background: rgba(255,255,255,0.07);
  color: var(--text-1);
  border: 1px solid var(--border);
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}
.btn-secondary.sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* ── Tabs de estado de campañas ─────────────────────────── */
.camp-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 12px 0 8px;
  margin-bottom: 4px;
}

.camp-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.05);
  color: var(--text-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}

.camp-tab:hover {
  background: rgba(108,95,246,0.12);
  color: var(--primary-l);
  border-color: rgba(108,95,246,0.35);
}

.camp-tab.active {
  background: rgba(108,95,246,0.2);
  color: var(--primary-l);
  border-color: rgba(108,95,246,0.5);
  box-shadow: 0 0 12px rgba(108,95,246,0.15);
}

.camp-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  font-size: 10px;
  font-weight: 700;
}

.camp-tab.active .camp-tab-count {
  background: rgba(108,95,246,0.4);
}

/* ── Badge de país en campañas ──────────────────────────── */
.badge-pais {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(59,130,246,0.12);
  color: #60a5fa;
  border: 1px solid rgba(59,130,246,0.25);
  vertical-align: middle;
}

/* ── modal-icon warning color ───────────────────────────── */
.modal-icon.warning {
  background: rgba(245,158,11,0.15);
  color: var(--warning);
}

/* ── Destinatarios Preview List ──────────────────────────── */
.dest-preview-list {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  padding: 6px;
  margin-top: 6px;
}
.dest-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.dest-item:last-child {
  border-bottom: none;
}
.dest-item label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
  font-size: 13px;
  font-weight: 400 !important;
  color: var(--text-1);
  text-transform: none !important;
  margin-bottom: 0 !important;
}
.dest-info {
  display: flex;
  flex-direction: column;
}
.dest-name {
  font-weight: 600;
  color: var(--text-1);
}
.dest-num-cat {
  font-size: 11px;
  color: var(--text-2);
}
.btn-link {
  background: none;
  border: none;
  color: var(--primary-l);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 0 4px;
}
.btn-link:hover {
  text-decoration: underline;
}
.camp-paused-info {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  color: var(--warning);
  padding: 8px 12px;
  font-size: 12px;
  margin-bottom: 12px;
}
.wake-lock-warning {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  padding: 10px 12px;
  font-size: 12px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  animation: pulseWarning 2s infinite ease-in-out;
}
@keyframes pulseWarning {
  0% { border-color: rgba(239, 68, 68, 0.25); }
  50% { border-color: rgba(239, 68, 68, 0.6); }
  100% { border-color: rgba(239, 68, 68, 0.25); }
}

/* ── Vista CHATS ──────────────────────────────────────────── */

/* Loading spinner */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Lista de chats */
.chat-list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-bottom: calc(var(--nav-h) + 16px);
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.chat-item:hover, .chat-item:active {
  background: var(--bg-card-h);
}

.chat-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-info {
  flex: 1;
  min-width: 0;
}

.chat-name-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.chat-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-time {
  font-size: 11px;
  color: var(--text-3);
  flex-shrink: 0;
}

.chat-preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.chat-preview {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-unread {
  background: var(--success);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  flex-shrink: 0;
}

/* ── Thread de mensajes ─────────────────────────────────── */

.chat-thread-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  min-height: var(--header-h);
}

.chat-thread-info {
  flex: 1;
  min-width: 0;
}

.chat-thread-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-thread-num {
  font-size: 11px;
  color: var(--text-3);
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 12px calc(var(--nav-h) + 24px);
  overflow-y: auto;
  min-height: 60vh;
}

/* Burbujas de mensajes */
.msg-bubble {
  max-width: 78%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
}

.msg-in {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.msg-out {
  align-self: flex-end;
  background: rgba(108, 95, 246, 0.2);
  border: 1px solid rgba(108, 95, 246, 0.3);
  border-bottom-right-radius: 4px;
}

.msg-text {
  color: var(--text-1);
}

.msg-time {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 3px;
  text-align: right;
}

/* ── Chat Input Bar ─────────────────────────────────────── */

.chat-messages {
  /* Override: extra bottom padding for input bar */
  padding-bottom: calc(var(--nav-h) + 80px) !important;
}

.chat-input-bar {
  position: fixed;
  bottom: var(--nav-h);
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  z-index: 20;
  backdrop-filter: blur(8px);
}

.chat-input {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 10px 16px;
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.4;
  resize: none;
  max-height: 120px;
  overflow-y: auto;
  transition: border-color 0.2s;
  outline: none;
}
.chat-input::placeholder { color: var(--text-3); }
.chat-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(108,95,246,0.15);
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.1s, opacity 0.2s;
  border: none;
  cursor: pointer;
}
.chat-send-btn:hover { background: var(--primary-l); }
.chat-send-btn:active { transform: scale(0.93); }
.chat-send-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Indicador de polling (punto verde parpadeante) ─────── */
.poll-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
  transition: background 0.3s;
  align-self: center;
  flex-shrink: 0;
}
.poll-dot-active {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}
