/*
 * Wyshapp Panel v3 — capa de migración (preview → producción)
 * Cargar DESPUÉS de wyshapp.css en todas las vistas del panel.
 */

:root {
  --color-bg: #F8FAFC;
  --color-surface: #FFFFFF;
  --color-surface-2: #F1F5F9;
  --color-border: #E2E8F0;
  --color-text: #0F172A;
  --color-muted: #64748B;
  --color-primary: var(--brand-accent, #2563EB);
  --color-primary-h: #1D4ED8;
  --color-primary-soft: color-mix(in srgb, var(--color-primary) 12%, #fff);
  --color-success: #10B981;
  --color-success-bg: #ECFDF5;
  --color-success-soft: var(--color-success-bg);
  --color-warning: #F59E0B;
  --color-warning-bg: #FFFBEB;
  --color-warn: var(--color-warning);
  --color-warn-soft: var(--color-warning-bg);
  --color-danger: #EF4444;
  --color-danger-bg: #FEF2F2;
  --color-danger-soft: var(--color-danger-bg);
  --color-info: #3B82F6;
  --color-info-bg: #EFF6FF;
  --color-sidebar-bg: #FFFFFF;
  --color-sidebar-tx: #64748B;
  --color-sidebar-text: #334155;
  --color-sidebar-hover: #F1F5F9;
  --color-sidebar-border: #E2E8F0;
  --topbar-h: 56px;
  --btn-radius: 10px;

  /* Aliases legacy → v3 */
  --bg: var(--color-bg);
  --bg2: var(--color-surface);
  --dark: var(--color-text);
  --green: var(--color-primary);
  --green-pale: var(--color-primary-soft);
  --green-light: color-mix(in srgb, var(--color-primary) 55%, #fff);
  --text1: var(--color-text);
  --text2: var(--color-muted);
  --text3: #94A3B8;
  --border: var(--color-border);
  --sidebar: var(--color-sidebar-bg);
  --radius: 8px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-sm: var(--shadow);
  --red: var(--color-danger);
  --red-pale: var(--color-danger-soft);
  --amber: var(--color-warn);
  --amber-pale: var(--color-warn-soft);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
}

.content { padding: 20px 24px; flex: 1; overflow-y: auto; }

/* ── Sidebar claro v3 ── */
.sidebar.sidebar-v2 {
  background: var(--color-sidebar-bg) !important;
  border-right: 1px solid var(--color-sidebar-border);
}
.sidebar.sidebar-v2 .sidebar-brand {
  position: relative;
  display: flex;
  align-items: flex-start;
  padding: 12px 10px 26px;
  min-height: 50px;
  border-bottom: 1px solid var(--color-sidebar-border);
}
.sidebar.sidebar-v2 .sidebar-logo {
  color: var(--color-text) !important;
  font-family: Poppins, Inter, sans-serif !important;
  font-weight: 700 !important;
  font-size: 17px !important;
  padding: 0 !important;
  margin: 0;
  border-bottom: none !important;
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  text-decoration: none;
  line-height: 1;
  flex-shrink: 0;
}
.sidebar-logo-word {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.35px;
  line-height: 1;
  color: var(--color-text);
}
.sidebar.sidebar-v2 .sidebar-logo-word span {
  color: var(--color-primary) !important;
}
.sidebar-plan-tag {
  position: absolute;
  right: 8px;
  bottom: 6px;
  font-size: 9px;
  font-weight: 600;
  color: var(--brand-accent, var(--color-primary));
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  padding: 2px 7px;
  border-radius: 6px;
  line-height: 1.25;
  letter-spacing: 0.01em;
  white-space: nowrap;
  z-index: 1;
}
.sidebar-client-logo-mini {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 5px;
  background: #fff;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}
.sidebar-logo--client {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: none;
  min-height: 0;
  padding: 0 !important;
  flex: 1 1 auto;
}
.sidebar-client-logo {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 48px;
  height: auto;
  object-fit: contain;
  object-position: left center;
  border-radius: 6px;
}
.sidebar-brand--client,
.sidebar.sidebar-v2 .sidebar-brand:has(.sidebar-logo--client) {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px 10px 10px;
  min-height: 0;
}
.sidebar-brand--client .sidebar-plan-tag,
.sidebar.sidebar-v2 .sidebar-brand:has(.sidebar-logo--client) .sidebar-plan-tag {
  position: static;
  align-self: flex-end;
  margin: 0;
}

/* Marca del negocio (Mi bot) */
.brand-form-single {
  padding: 0 16px 16px;
  max-width: 520px;
}
.brand-form-col .form-hint,
.brand-form-single .form-hint {
  font-size: 11px;
  color: var(--color-muted);
  margin-top: 6px;
  line-height: 1.4;
}
.brand-color-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.brand-color-input {
  width: 44px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--color-surface);
}
.brand-remove-form { margin-top: 10px; }
.brand-alert { margin-bottom: 16px; }

/* Color de marca personalizado */
.sidebar.sidebar-v2[style*="--brand-accent"] .sidebar-link.active {
  box-shadow: inset 3px 0 0 var(--brand-accent) !important;
}
body[style*="--brand-accent"] .btn-primary {
  background: var(--brand-accent) !important;
}
body[style*="--brand-accent"] .btn-primary:hover {
  filter: brightness(0.92);
}
body[style*="--brand-accent"] .dash-kpi-sub a {
  color: var(--brand-accent);
}
body[style*="--brand-accent"] .form-input:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 18%, transparent);
}

@media (max-width: 720px) {
  .brand-form-single { max-width: none; }
}
.sidebar.sidebar-v2 .sidebar-nav { padding: 8px 10px; }
.sidebar.sidebar-v2 .sidebar-sep { background: var(--color-sidebar-border); margin: 6px 8px; }
.sidebar-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  padding: 12px 12px 4px;
}
.sidebar.sidebar-v2 .sidebar-link {
  color: var(--color-sidebar-tx);
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-sm);
}
.sidebar.sidebar-v2 .sidebar-link-icon {
  background: transparent;
  width: 28px;
  height: 28px;
}
.sidebar.sidebar-v2 .sidebar-link-icon i { color: var(--color-muted) !important; }
.sidebar.sidebar-v2 .sidebar-link-label { font-size: 13px; }
.sidebar.sidebar-v2 .sidebar-link:hover {
  background: var(--color-sidebar-hover);
  color: var(--color-sidebar-text);
}
.sidebar.sidebar-v2 .sidebar-link:hover .sidebar-link-icon i { color: var(--color-sidebar-text) !important; }
.sidebar.sidebar-v2 .sidebar-link.active {
  background: color-mix(in srgb, var(--brand-accent, var(--color-primary)) 12%, transparent);
  color: var(--brand-accent, var(--color-primary));
  border: none;
  box-shadow: inset 3px 0 0 var(--brand-accent, var(--color-primary));
}
.sidebar.sidebar-v2 .sidebar-link.active .sidebar-link-icon { background: transparent; }
.sidebar.sidebar-v2 .sidebar-link.active .sidebar-link-icon i {
  color: var(--brand-accent, var(--color-primary)) !important;
}
.sidebar.sidebar-v2 .sidebar-nav-badge {
  background: var(--color-bg);
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  font-size: 9px;
}
.sidebar.sidebar-v2 .sidebar-link.plan-lock .sidebar-nav-badge {
  background: var(--color-warning-bg);
  color: #B45309;
  border-color: #FDE68A;
}
.sidebar.sidebar-v2 .sidebar-footer {
  border-top: 1px solid var(--color-sidebar-border);
  padding: 12px 10px;
}
.sidebar.sidebar-v2 .sidebar-user-card { background: transparent; padding: 8px 10px; }
.sidebar.sidebar-v2 .sidebar-user-card:hover { background: var(--color-sidebar-hover); }
.sidebar.sidebar-v2 .sidebar-user-avatar {
  background: var(--color-bg);
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: 50%;
}
.sidebar.sidebar-v2 .sidebar-user-info strong { color: var(--color-text); font-size: 12px; }
.sidebar.sidebar-v2 .sidebar-user-info span { color: var(--color-muted); }
.sidebar.sidebar-v2 .sidebar-logout-btn { color: var(--color-muted); }
.sidebar.sidebar-v2 .sidebar-logout-btn:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

/* ── Topbar v3 ── */
.topbar {
  min-height: var(--topbar-h);
  height: auto;
  padding: 0 24px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.topbar-head { min-width: 0; }
.topbar-page-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.3px;
  color: var(--color-text);
}
.topbar-page-sub { font-size: 12px; color: var(--color-muted); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-left: auto; }
.topbar-right .btn { white-space: nowrap; }
.content > .alert:first-child,
.content > .banner-plan-inactive:first-child,
.content > .locked-msg:first-child { margin-top: 0; }
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--color-success-bg);
  color: #047857;
}
.status-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
}

/* ── Botones v3 ── */
.btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--btn-radius);
  line-height: 1.25;
  transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s;
}
.btn-primary {
  background: var(--brand-accent, var(--color-primary)) !important;
  border: 1px solid var(--brand-accent, var(--color-primary)) !important;
  color: #fff !important;
}
.btn-primary:hover { filter: brightness(0.92); }
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover { background: var(--color-surface-2); }
.btn-ghost {
  background: transparent;
  color: var(--color-muted);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-danger {
  background: var(--color-danger-soft);
  color: var(--color-danger);
  border: 1px solid color-mix(in srgb, var(--color-danger) 25%, transparent);
}
.btn-danger:hover {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}

.card-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}
.card-form-actions .btn { margin-top: 0; }

.toggle input:checked + .toggle-slider { background: var(--brand-accent, var(--color-primary)); }

/* ── Badges v3 ── */
.badge,
.badge-success,
.badge-warning,
.badge-danger,
.badge-red,
.badge-info,
.badge-blue,
.badge-confirmado,
.badge-pendiente,
.badge-revision,
.badge-duplicado {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.3;
}
.badge-success,
.badge-confirmado { background: var(--color-success-soft); color: #047857; }
.badge-warning,
.badge-pendiente { background: var(--color-warn-soft); color: #B45309; }
.badge-danger,
.badge-red,
.badge-revision { background: var(--color-danger-soft); color: #B91C1C; }
.badge-info,
.badge-blue { background: var(--color-info-bg); color: #1D4ED8; }
.badge-duplicado { background: var(--color-surface-2); color: var(--color-muted); }
.badge-wisphub {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
}
.badge-wisphub.ok { background: var(--color-success-soft); color: #047857; }
.badge-wisphub.err { background: var(--color-danger-soft); color: #B91C1C; }
.badge-wisphub.pen { background: var(--color-surface-2); color: var(--color-muted); }

/* ── Cards ── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 10px);
  box-shadow: var(--shadow-sm);
}
.card-icon { background: var(--color-bg); color: var(--color-primary); }
.card-icon i { color: var(--color-primary); }

/* ── Auth login/registro (lado claro) ── */
.auth-split .auth-side {
  background: var(--color-info-bg) !important;
  color: var(--color-text);
  border-right: 1px solid #BFDBFE;
}
.auth-split .auth-side-logo { color: var(--color-text) !important; }
.auth-split .auth-side-logo span { color: var(--color-primary) !important; }
.auth-split .auth-side-tagline { color: var(--color-text) !important; font-size: 22px; }
.auth-split .auth-side-sub { color: var(--color-muted) !important; }
.auth-split .auth-side-list li { color: var(--color-sidebar-text); }
.auth-split .auth-side-list li i { color: var(--color-success); }
.auth-split .auth-side-stat { color: var(--color-muted); }
.auth-split .auth-side-stat strong { color: var(--color-primary); }
.btn-auth-submit {
  background: var(--color-primary) !important;
  color: #fff !important;
}

/* ── Dashboard inicio v3 ── */
.dashboard-v2 .dash-topbar {
  padding: 0 24px;
  min-height: var(--topbar-h);
  align-items: center;
}
.dashboard-v2 .dash-greet-title { font-size: 15px; font-weight: 600; font-family: inherit; }
.dashboard-v2 .dash-greet-sub { font-size: 12px; }
.dash-kpi-icon.ok { background: var(--color-success-bg); color: #047857; }
.dash-kpi-sub a { color: var(--color-primary); }
.dash-wa-hero-v2,
.dash-wa-hero.dash-wa-hero-v2 {
  display: flex;
  gap: 20px;
  align-items: stretch;
  background: var(--color-surface) !important;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px !important;
  border-radius: var(--radius-md, 8px);
  overflow: visible;
}
.dash-wa-main { flex: 1; min-width: 0; }
.dash-wa-hero-v2 h2,
.dash-wa-hero-v2 .dash-wa-main h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text) !important;
}
.dash-wa-hero-v2 p,
.dash-wa-hero-v2 .dash-wa-main p {
  font-size: 12px;
  color: var(--color-muted) !important;
  margin-bottom: 10px;
  max-width: 420px;
}
.dash-wa-link-box { display: flex; gap: 8px; margin-bottom: 0; }
.dash-wa-link-input {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  width: 100%;
  background: var(--color-bg);
}
.dash-wa-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 8px; }
.dash-wa-num { font-size: 11px; color: var(--color-muted); margin: 0; }
.dash-wa-num strong { color: var(--color-text); }
.dash-wa-qr-box {
  flex-shrink: 0;
  text-align: center;
  padding: 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.dash-wa-qr-box .dash-wa-qr {
  padding: 8px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  width: auto;
  height: auto;
  margin: 0;
}
.dash-wa-qr-box canvas {
  display: block;
  width: 104px;
  height: 104px;
}
.dash-wa-qr-caption { font-size: 10px; color: var(--color-muted); margin: 0; }
.dash-wa-hero-v2 .dash-wa-badge,
.dash-wa-hero.dash-wa-hero-v2 .dash-wa-badge {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  text-transform: none;
  letter-spacing: 0;
}
.dash-kpi.compact .dash-kpi-label { font-size: 11px; margin-bottom: 2px; }
.dash-kpi.compact .dash-kpi-icon { width: 28px; height: 28px; min-width: 28px; }
.dash-kpi.compact .dash-kpi-icon i { font-size: 15px; }
.dash-kpi.compact .dash-kpi-sub { margin-top: 2px; font-size: 10px; }
.dash-plan-card {
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: var(--color-success-bg);
  border-radius: var(--radius-md, 8px);
  padding: 14px 16px;
}
.dash-plan-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.dash-plan-card p { font-size: 12px; color: var(--color-muted); margin: 0; }
.dash-plan-tag, .dash-plan-card .dash-plan-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #047857;
  margin-bottom: 6px;
}
.bot-plan-summary-body { padding: 0 4px 4px; }
.bot-plan-cta-row { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.bot-plan-included { margin-top: 14px; }
.bot-plan-included-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted); margin-bottom: 8px; }
.bot-plan-features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 14px; }
.bot-plan-features li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.4; }
.bot-plan-features li i { color: #059669; font-size: 15px; margin-top: 1px; flex-shrink: 0; }
.bot-plan-hint { margin: 12px 0 0; font-size: 13px; color: var(--color-muted); line-height: 1.5; }
.bot-plan-price { font-size: 20px; font-weight: 700; color: #047857; margin: 6px 0 4px; letter-spacing: -0.02em; }
.bot-plan-vence { font-size: 12px; color: var(--color-muted); margin: 4px 0 0; line-height: 1.45; }
.bot-plan-vence-warn { color: #b45309; font-weight: 600; }
.bot-plan-vence-danger { color: #b91c1c; font-weight: 600; }
.bot-plan-upgrade-hint {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--color-bg, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  font-size: 12px;
  line-height: 1.55;
  color: var(--color-muted);
}
.bot-plan-upgrade-hint a { color: var(--brand-accent, var(--color-primary)); font-weight: 600; text-decoration: none; }
.bot-plan-upgrade-hint a:hover { text-decoration: underline; }
.dash-plan-active { background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%); border-color: rgba(16, 185, 129, 0.3); }
.dash-plan-pending { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); border-color: #fde68a; }
.dash-plan-demo { background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%); border-color: var(--color-border, #e2e8f0); }

/* Form focus */
.form-input:focus,
.search-input:focus {
  border-color: var(--brand-accent, var(--color-primary));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent, var(--color-primary)) 18%, transparent);
}

/* Wh page accents */
.wh-section-label { color: var(--brand-accent, var(--color-primary)); }
.btn-copy:hover { border-color: var(--brand-accent, var(--color-primary)); color: var(--brand-accent, var(--color-primary)); }

/* ── Status, switches, toggles, lock ── */
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.status-item { text-align: center; padding: 12px; background: var(--color-bg); border-radius: var(--radius-sm); }
.status-item .val { display: block; font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.status-item .lbl { font-size: 11px; color: var(--color-muted); font-weight: 500; }
.switch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.switch-label h4 { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.switch-label p { font-size: 11px; color: var(--color-muted); }
.toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: var(--shadow-sm);
}
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }
.plus-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--color-warning-bg);
  color: #B45309;
}
.card.locked { position: relative; overflow: hidden; }
.lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  z-index: 2;
  border-radius: var(--radius-md);
}
.lock-overlay .lock-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-info-bg);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 20px;
}

/* ── Dashboard compact KPIs + setup ── */
.card-compact { padding: 14px 16px; }
.dash-kpi-grid.compact { gap: 8px; margin-bottom: 12px; }
.dash-kpi.compact { padding: 10px 12px; }
.dash-kpi.compact .dash-kpi-value { font-size: 16px; }
.dash-kpi.compact .dash-kpi-value.kpi-ok { color: var(--color-success); }
.setup-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.setup-card-head h2 { font-size: 14px; font-weight: 600; }
.setup-card-head p { font-size: 11px; color: var(--color-muted); margin: 2px 0 0; }
.setup-inline-pct { font-size: 12px; font-weight: 600; color: var(--color-muted); white-space: nowrap; }
.setup-inline-pct strong { color: var(--color-success); }
.setup-list-compact { display: flex; flex-direction: column; gap: 6px; }
.setup-row-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  font-size: 12px;
}
.setup-row-compact.done { background: var(--color-success-bg); border-color: #A7F3D0; }
.setup-row-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.setup-row-compact.done .setup-row-icon { background: var(--color-success); color: #fff; }
.setup-row-label { flex: 1; font-weight: 500; min-width: 0; }
.dash-nav-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dash-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--color-text);
  font-size: 11px;
  font-weight: 500;
  background: var(--color-surface);
}
.dash-tile:hover { background: var(--color-bg); border-color: var(--color-primary); }
.dash-settings-section { margin-top: 20px; }
.dash-settings-details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.dash-settings-summary {
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 13px;
  list-style: none;
}
.dash-settings-summary::-webkit-details-marker { display: none; }
.dash-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 16px 16px;
}

.dash-wa-hero-v2 .dash-wa-hero-inner {
  background: transparent;
  padding: 0;
}
.page-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-accent, var(--color-primary));
  margin-bottom: 4px;
}
.status-badge.offline, .bot-status-badge.offline {
  background: var(--color-bg);
  color: var(--color-muted);
}
.status-badge.offline .dot, .bot-status-badge.offline .dot { background: #94A3B8; }

/* ── Bandeja v18 (preview-v2 layout) ── */
.main-content--bandeja {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}
.main-content--bandeja .topbar { flex-shrink: 0; }
.main-content--bandeja .content-fill {
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.main-content--bandeja .bandeja-layout-pro,
.main-content--bandeja .bandeja-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  height: auto;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}
.main-content--bandeja .bandeja-layout-pro {
  border-top: 1px solid var(--border, var(--color-border, #E2E8F0));
}
.main-content--bandeja .hilos-panel {
  width: 280px;
  border-right: 1px solid var(--border, var(--color-border, #E2E8F0));
  background: var(--bg2, var(--color-surface, #fff));
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.main-content--bandeja .hilos-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border, var(--color-border, #E2E8F0));
  font-size: 13px;
  font-weight: 600;
}
.main-content--bandeja .hilos-list { flex: 1; overflow-y: auto; }
.main-content--bandeja .chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.main-content--bandeja .chat-header {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.main-content--bandeja .chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.main-content--bandeja .chat-messages .msg-row { display: flex; margin-bottom: 4px; }
.main-content--bandeja .chat-messages .msg-row-in { justify-content: flex-start; }
.main-content--bandeja .chat-messages .msg-row-out { justify-content: flex-end; }
.main-content--bandeja .chat-messages .msg-bubble { max-width: 75%; }
.main-content--bandeja .chat-messages .msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  font-size: 10px;
  color: var(--text2, var(--color-muted, #64748B));
  margin-top: 4px;
}
.main-content--bandeja .chat-messages .msg-ticks {
  display: inline-flex;
  font-size: 11px;
  letter-spacing: -2px;
  color: #94a3b8;
}
.main-content--bandeja .chat-messages .msg-ticks.delivered { color: #94a3b8; }
.main-content--bandeja .chat-messages .msg-ticks.read { color: var(--brand-accent, #2563EB); }
.main-content--bandeja .chat-input {
  padding: 10px 14px;
  border-top: 1px solid var(--border, var(--color-border, #E2E8F0));
  background: var(--bg2, var(--color-surface, #fff));
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}
.main-content--bandeja .fallback-box {
  display: none;
  padding: 10px 14px;
  border-top: 1px solid #FDE68A;
  background: var(--color-warning-bg, #FFFBEB);
  font-size: 12px;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}
.main-content--bandeja .fallback-box.visible { display: flex; }

/* Bandeja — tonos más suaves (menos verde chillón) */
.main-content--bandeja .hilos-header i { color: var(--text2, var(--color-muted, #64748B)); }
.main-content--bandeja a.hilo-item:hover { background: rgba(15, 23, 42, 0.03); }
.main-content--bandeja a.hilo-item.active {
  background: #f1f5f9;
  border-left-color: var(--brand-accent, #2563EB);
}
.main-content--bandeja .msg-bot {
  background: #f8fafc;
  border-color: #e2e8f0;
}
.main-content--bandeja .msg-out {
  background: #eef2ff;
  border-color: #dbeafe;
}
.main-content--bandeja .btn-send,
.main-content--bandeja .btn-fallback-si {
  background: var(--brand-accent, #2563EB);
  color: #fff;
}
.main-content--bandeja .btn-send:hover,
.main-content--bandeja .btn-fallback-si:hover { filter: brightness(0.95); }
.main-content--bandeja .chat-empty-icon i,
.main-content--bandeja .chat-assign-info i { color: var(--text2, var(--color-muted, #64748B)); }
.main-content--bandeja .msg-file-link { color: var(--brand-accent, #2563EB); }

@media (max-width: 1100px) {
  .main-content--bandeja .hilos-panel { width: 240px; }
}
@media (max-width: 768px) {
  .main-content--bandeja .hilos-panel { display: none; }
}

@media (max-width: 1100px) {
  .dash-main-grid { grid-template-columns: 1fr !important; }
  .dash-settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dash-wa-hero-v2,
  .dash-wa-hero.dash-wa-hero-v2 {
    flex-direction: column;
    align-items: stretch;
  }
  .dash-wa-qr-box {
    align-self: center;
    width: fit-content;
    margin: 0 auto;
  }
}

/* ── Shared UI (wyshapp-ui.js) ── */
.nx-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #0F172A;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
  max-width: min(360px, calc(100vw - 32px));
}
.nx-toast--show { opacity: 1; transform: translateY(0); }
.nx-toast--ok { background: #059669; }
.nx-toast--err { background: #DC2626; }
.nx-toast--warn { background: #D97706; }

.nx-skeleton {
  background: linear-gradient(90deg, var(--color-bg, #F1F5F9) 25%, #E2E8F0 50%, var(--color-bg, #F1F5F9) 75%);
  background-size: 200% 100%;
  animation: nx-shimmer 1.2s infinite;
  border-radius: 6px;
}
.nx-skeleton-row td { padding: 12px 16px; }
@keyframes nx-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Surfaces & tables (v10) ── */
.pagos-stat,
.wh-field-list {
  background: var(--color-surface);
  border-color: var(--color-border);
}
.wh-field-list {
  background: var(--color-surface);
}
.wh-field-row {
  background: var(--color-surface);
}
.wh-field-row:hover { background: var(--color-surface-2); }
.wh-field-row.highlight { background: var(--color-warn-soft); }
.wh-field-row.highlight:hover { background: color-mix(in srgb, var(--color-warn) 14%, #fff); }

.content table,
.card table {
  width: 100%;
  border-collapse: collapse;
}
.content table th,
.card table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
}
.content table td,
.card table td {
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 400;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.content table tr:last-child td,
.card table tr:last-child td { border-bottom: none; }
.content table tbody tr:hover td,
.card table tbody tr:hover td { background: var(--color-surface-2); }

/* Pagos row status bars */
tr.row-pendiente { border-left: 3px solid var(--color-warn); }
tr.row-revision { border-left: 3px solid var(--color-danger); }
tr.row-confirmado { border-left: 3px solid var(--color-success); }

/* ── Pagos page ── */
.pagos-table-card .card-h,
.card-h {
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--color-text);
}
.search-input {
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--btn-radius);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pagos-stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.pagos-stat .v.green { color: var(--color-success); }
.pagos-stat .v.amber { color: var(--color-warn); }

.content table td strong,
.card table td strong {
  font-weight: 600;
}

/* Pagos action buttons — 4 semantic colors max */
.btn-action {
  padding: 6px 12px;
  border-radius: var(--btn-radius);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.25;
}
.btn-action .ti { font-size: 14px; line-height: 1; }
.btn-action:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-action.wisp {
  border-color: var(--color-success);
  color: var(--color-success);
  background: var(--color-success-soft);
}
.btn-action.wisp:hover:not(:disabled) {
  background: var(--color-success);
  color: #fff;
}
.btn-action.edit,
.btn-action.ver,
.btn-action.multi,
.btn-action.parcial {
  border-color: var(--color-border);
  color: var(--color-muted);
  background: var(--color-surface);
}
.btn-action.edit:hover:not(:disabled),
.btn-action.ver:hover:not(:disabled),
.btn-action.multi:hover:not(:disabled),
.btn-action.parcial:hover:not(:disabled) {
  border-color: var(--color-text);
  color: var(--color-text);
  background: var(--color-surface-2);
}
.btn-action.scan,
.btn-action.retry {
  border-color: var(--color-warn);
  color: var(--color-warn);
  background: var(--color-warn-soft);
}
.btn-action.scan:hover:not(:disabled),
.btn-action.retry:hover:not(:disabled) {
  background: var(--color-warn);
  color: #fff;
}
.btn-action.del {
  border-color: color-mix(in srgb, var(--color-danger) 35%, transparent);
  color: var(--color-danger);
  background: transparent;
}
.btn-action.del:hover:not(:disabled) {
  background: var(--color-danger-soft);
}
.actions-wrap {
  display: flex;
  gap: 4px;
  align-items: flex-start;
  flex-wrap: wrap;
  max-width: 420px;
}
.actions-wrap .btn-action {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 8px;
  gap: 4px;
  white-space: nowrap;
}
.actions-wrap .btn-action .ti { font-size: 13px; flex-shrink: 0; }

/* Pagos media & modals */
.img-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--color-border);
  transition: transform 0.2s, border-color 0.2s;
}
.img-thumb:hover {
  transform: scale(1.05);
  border-color: var(--brand-accent, var(--color-primary));
}
.no-img {
  width: 44px;
  height: 44px;
  background: var(--color-surface-2);
  border-radius: var(--btn-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  color: var(--color-muted);
}
.no-img .ti { font-size: 20px; line-height: 1; }
.empty-row td {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-muted);
  font-size: 14px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}
.overlay.open { display: flex; }
.modal-box {
  background: var(--color-surface);
  border-radius: 16px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
}
.modal-hdr {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-hdr h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--color-text);
}
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--color-muted);
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}
.modal-close:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}
.modal-body { display: flex; overflow: hidden; flex: 1; }
.modal-img-panel {
  width: 380px;
  min-width: 300px;
  flex-shrink: 0;
  background: var(--color-bg);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  gap: 10px;
}
.modal-img-frame {
  width: 100%;
  flex: 1;
  min-height: 320px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s;
}
.modal-img-frame:hover { border-color: var(--brand-accent, var(--color-primary)); }
.modal-img-frame img { width: 100%; height: 100%; object-fit: contain; }
.modal-fields { flex: 1; padding: 20px 24px; overflow-y: auto; }
.field-row { margin-bottom: 14px; }
.field-row label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-muted);
  margin-bottom: 5px;
}
.field-row input,
.field-row select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--btn-radius);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-2);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.btn-cancel {
  padding: 10px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--btn-radius);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-muted);
  background: var(--color-surface);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-cancel:hover { background: var(--color-surface-2); color: var(--color-text); }
.btn-save {
  padding: 10px 20px;
  border: 1px solid var(--brand-accent, var(--color-primary));
  border-radius: var(--btn-radius);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--brand-accent, var(--color-primary));
  cursor: pointer;
  transition: filter 0.15s;
}
.btn-save:hover { filter: brightness(0.92); }
.btn-save:disabled { opacity: 0.45; cursor: wait; }
#overlayWisp .modal-box { max-width: 480px; }
#overlayZoom {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
#overlayZoom.open { display: flex; }
#overlayZoom img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
#overlayZoom .close-z {
  position: fixed;
  top: 20px;
  right: 24px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 28px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
  transition: color 0.15s;
}
#overlayZoom .close-z:hover { color: #fff; }

/* Wisphub / panel modals (modal-overlay) */
.modal-overlay {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}
.modal-overlay .modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
}
.modal-overlay .modal-actions {
  margin-top: 0;
  padding: 16px 24px;
  background: var(--color-surface-2);
  border-top: 1px solid var(--color-border);
}

.dash-setup-bar-fill { background: var(--brand-accent, var(--color-primary)); }

/* Pagos card header + filter chips */
.pagos-card-head {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}
.pagos-card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}
.pagos-filter-chips {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px;
  background: var(--color-surface-2, #f1f5f9);
  border: 1px solid var(--color-border, var(--border));
  border-radius: 14px;
  box-sizing: border-box;
}
button.pagos-filter-chip,
.pagos-filter-chip {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: none;
  box-shadow: none;
  text-shadow: none;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  margin: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  color: var(--color-muted, var(--text2));
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
button.pagos-filter-chip::before,
.pagos-filter-chip::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--color-muted, #94a3b8);
  opacity: 0.55;
}
button.pagos-filter-chip[data-estado="all"]::before,
.pagos-filter-chip[data-estado="all"]::before { background: var(--brand-accent, var(--color-primary, #2563eb)); opacity: 1; }
button.pagos-filter-chip[data-estado="pendiente"]::before,
.pagos-filter-chip[data-estado="pendiente"]::before { background: #d97706; opacity: 1; }
button.pagos-filter-chip[data-estado="revision_manual"]::before,
.pagos-filter-chip[data-estado="revision_manual"]::before { background: #dc2626; opacity: 1; }
button.pagos-filter-chip[data-estado="confirmado"]::before,
.pagos-filter-chip[data-estado="confirmado"]::before { background: #059669; opacity: 1; }
button.pagos-filter-chip[data-estado="descartado"]::before,
.pagos-filter-chip[data-estado="descartado"]::before { background: #64748b; opacity: 1; }
.pagos-filter-chip:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand-accent, var(--color-primary)) 45%, transparent);
  outline-offset: 2px;
}
.pagos-filter-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  background: var(--color-surface-2, #f1f5f9);
  color: var(--color-muted, var(--text2));
}
button.pagos-filter-chip[data-estado="all"].active,
.pagos-filter-chip[data-estado="all"].active {
  background: #fff;
  border-color: color-mix(in srgb, var(--brand-accent, var(--color-primary)) 35%, transparent);
  color: var(--color-primary-h, var(--brand-accent, var(--color-primary)));
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
button.pagos-filter-chip[data-estado="pendiente"].active,
.pagos-filter-chip[data-estado="pendiente"].active {
  background: #fff;
  border-color: #fcd34d;
  color: #b45309;
  box-shadow: 0 1px 3px rgba(217, 119, 6, 0.12);
}
button.pagos-filter-chip[data-estado="revision_manual"].active,
.pagos-filter-chip[data-estado="revision_manual"].active {
  background: #fff;
  border-color: #fca5a5;
  color: #b91c1c;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.12);
}
button.pagos-filter-chip[data-estado="confirmado"].active,
.pagos-filter-chip[data-estado="confirmado"].active {
  background: #fff;
  border-color: #6ee7b7;
  color: #047857;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.12);
}
button.pagos-filter-chip[data-estado="descartado"].active,
.pagos-filter-chip[data-estado="descartado"].active {
  background: #fff;
  border-color: #cbd5e1;
  color: var(--color-text, var(--dark));
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
button.pagos-filter-chip:hover:not(.active),
.pagos-filter-chip:hover:not(.active) {
  background: rgba(255, 255, 255, 0.65);
}
button.pagos-filter-chip.active .pagos-filter-chip-count,
.pagos-filter-chip.active .pagos-filter-chip-count {
  background: color-mix(in srgb, currentColor 12%, #fff);
  color: inherit;
}
.pagos-load-more-wrap { text-align: center; padding: 16px 24px; border-top: 1px solid var(--color-border, var(--border)); }

/* Mobile actions menu */
.actions-wrap--desktop { display: flex; }
.actions-mobile { display: none; position: relative; }
.actions-mobile-toggle {
  padding: 6px 10px;
  border: 1px solid var(--color-border, var(--border));
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.actions-mobile-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 50;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--color-border, var(--border));
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 4px;
}
.actions-mobile-menu.open { display: block; }
.actions-mobile-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.actions-mobile-menu button:hover:not(:disabled) { background: var(--color-bg, #F8FAFC); }
.actions-mobile-menu button:disabled { opacity: 0.4; cursor: not-allowed; }

.sidebar-nav-badge-count {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: #DC2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .actions-wrap--desktop { display: none !important; }
  .actions-mobile { display: block; }
  th.col-acciones, td.col-acciones { min-width: 56px !important; width: 56px !important; }
  .modal-img-panel { display: none; }
}

/* Mi bot — Líneas activas (Meta) */
.wa-lines-body { padding: 0 20px 20px; }
.wa-lines-list { display: flex; flex-direction: column; gap: 10px; }
.wa-line-item {
  padding: 14px 16px;
  background: var(--color-surface-2, #f1f5f9);
  border: 1px solid var(--color-border, var(--border));
  border-radius: 14px;
}
.wa-line-item.is-active {
  border-color: #a7f3d0;
  background: linear-gradient(135deg, #ecfdf5 0%, var(--color-surface, #fff) 100%);
}
.wa-line-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.wa-line-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #047857;
}
.wa-line-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}
.wa-line-item:not(.is-active) .wa-line-status { color: #b45309; }
.wa-line-item:not(.is-active) .wa-line-dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }
.wa-line-provider { font-size: 10px; }
.wa-line-number {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text, var(--dark));
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.wa-line-id {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--color-muted, var(--text2));
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Mi bot — WhatsApp status (legacy aliases) */
.wa-connect-body { padding: 0 20px 20px; }
.wa-connect-body--placeholder { opacity: 0.45; pointer-events: none; }
.wa-connect-status { margin-bottom: 16px; }
.wa-connect-number-block {
  padding: 16px 18px;
  background: var(--color-surface-2, #f1f5f9);
  border: 1px solid var(--color-border, var(--border));
  border-radius: 14px;
}
.wa-connect-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted, var(--text2));
  margin-bottom: 6px;
}
.wa-connect-number {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text, var(--dark));
  margin-bottom: 12px;
}
.wa-connect-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.wa-connect-foot {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-muted, var(--text2));
}

/* Mi plan Wyshapp / activar — tarjeta estado + planes claros */
.plan-status-card {
  background: linear-gradient(135deg, var(--color-success-bg) 0%, var(--color-surface) 55%);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-lg, 12px);
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.plan-status-card.plan-status-warn {
  background: linear-gradient(135deg, #fffbeb 0%, var(--color-surface) 55%);
  border-color: #fde68a;
}
.plan-status-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.plan-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #d1fae5;
  color: #047857;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.plan-status-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; }
.plan-status-main h2 { font-size: 20px; font-weight: 700; color: var(--color-text); margin: 0 0 4px; }
.plan-status-price { font-size: 22px; font-weight: 700; color: #047857; margin: 0; }
.plan-status-price span { font-size: 13px; font-weight: 500; color: var(--color-muted); }
.plan-status-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.plan-status-vence {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
}
.plan-status-vence i { font-size: 18px; color: var(--color-primary); margin-top: 2px; }
.plan-status-vence-lbl {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}
.plan-status-vence strong { font-size: 14px; color: var(--color-text); }
.plan-status-vence.is-warn { border-color: #fde68a; background: #fffbeb; }
.plan-status-vence.is-warn i { color: #d97706; }
.plan-status-vence.is-danger { border-color: #fecaca; background: #fef2f2; }
.plan-status-vence.is-danger i { color: #dc2626; }
.plan-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(16, 185, 129, 0.2);
}

.activar-page .planes-wrap {
  background: var(--color-surface) !important;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-sm);
}
.activar-page .planes-titulo { color: var(--color-text) !important; }
.activar-page .planes-sub { color: var(--color-muted) !important; }
.activar-page .plan-card {
  background: var(--color-bg) !important;
  border-color: var(--color-border) !important;
}
.activar-page .plan-card:hover {
  border-color: color-mix(in srgb, var(--color-primary) 45%, var(--color-border)) !important;
  background: var(--color-surface) !important;
}
.activar-page .plan-card.selected,
.activar-page .plan-card.popular {
  border-color: var(--color-primary) !important;
  background: var(--color-primary-soft) !important;
}
.activar-page .plan-nombre { color: var(--color-text) !important; }
.activar-page .plan-precio span { color: var(--color-muted) !important; }
.activar-page .plan-features li { color: var(--color-sidebar-text) !important; }
.activar-page .plan-features li.no { color: var(--color-muted) !important; }
.activar-page .plan-divider { background: var(--color-border) !important; }
.activar-page .current-badge {
  background: #fef3c7 !important;
  border-color: #fde68a !important;
  color: #b45309 !important;
}
.activar-page .lock-alert {
  background: var(--color-warning-bg) !important;
  border-color: #fde68a !important;
}
.activar-page .lock-alert h4 { color: var(--color-text) !important; }
.activar-page .lock-alert p { color: var(--color-muted) !important; }
.activar-page .btn-upgrade {
  background: var(--color-surface) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text) !important;
}
.activar-page .btn-upgrade:hover {
  border-color: var(--color-primary) !important;
  background: var(--color-primary-soft) !important;
}
.activar-page .btn-upgrade.primary {
  background: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #fff !important;
}
.activar-page .pago-section h3 { color: var(--color-muted) !important; }
.activar-page .metodo {
  background: var(--color-surface) !important;
  border-color: var(--color-border) !important;
}
.activar-page .metodo-info h4 { color: var(--color-text) !important; }
.activar-page .metodo-info p { color: var(--color-muted) !important; }
.activar-page .form-label-dark {
  color: var(--color-muted) !important;
}
.activar-page .form-input-dark {
  color: var(--color-text) !important;
  background: var(--color-surface) !important;
  border-color: var(--color-border) !important;
}
.activar-page .form-input-dark::placeholder { color: #94a3b8 !important; }
.activar-page .instr {
  background: var(--color-bg) !important;
  border: 1px solid var(--color-border);
}
.activar-page .instr h4,
.activar-page .instr p,
.activar-page .num-pago { color: var(--color-text) !important; }
.activar-page .num-pago { background: var(--color-surface-2) !important; }
.activar-page .nota-footer { color: var(--color-muted) !important; }

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

/* ── Preview-v2 shared components (v18) ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-header-hero h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.page-header-hero p {
  font-size: 13px;
  color: var(--text2, var(--color-muted, #64748B));
  max-width: 560px;
  line-height: 1.45;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border, var(--color-border, #E2E8F0));
  border-radius: var(--radius, var(--radius-md, 12px));
  background: var(--bg2, var(--color-surface, #fff));
}
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text2, var(--color-muted, #64748B));
  background: var(--bg, var(--color-bg, #F8FAFC));
  border-bottom: 1px solid var(--border, var(--color-border, #E2E8F0));
}
.table-wrap td {
  padding: 11px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border, var(--color-border, #E2E8F0));
}
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap tr:hover td { background: rgba(248, 250, 252, 0.8); }
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.metric-card {
  background: var(--bg2, var(--color-surface, #fff));
  border: 1px solid var(--border, var(--color-border, #E2E8F0));
  border-radius: var(--radius, var(--radius-md, 12px));
  padding: 14px 16px;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.05));
}
.metric-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text2, var(--color-muted, #64748B));
  margin-bottom: 6px;
}
.metric-value { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.pct-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--bg, var(--color-bg, #F8FAFC));
  border-radius: 99px;
  overflow: hidden;
  margin-top: 10px;
}
.pct-bar-fill {
  height: 100%;
  background: var(--green, var(--color-success, #16a34a));
  border-radius: 99px;
}
.stats-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.chart-card h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--dark, var(--color-text, #0F172A));
}

@media (max-width: 1100px) {
  .metrics-grid, .stats-two-col { grid-template-columns: 1fr; }
}

.empty-state-full { grid-column: 1 / -1; }
.empty-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  border-radius: 12px;
  background: var(--color-info-bg);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.item-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  min-height: 168px;
}
.item-card.inactivo { opacity: 0.72; }
.item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.item-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.item-nombre {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  word-break: break-word;
  line-height: 1.3;
}
.item-precio {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.01em;
}
.item-status {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 999px;
  line-height: 1.2;
}
.item-status.is-active {
  background: var(--color-success-bg);
  color: #047857;
}
.item-status.is-inactive {
  background: var(--color-surface-2);
  color: var(--color-muted);
}
.item-desc, .item-a {
  font-size: 13px;
  color: var(--color-muted);
  margin: 0 0 12px;
  line-height: 1.5;
  flex: 1;
}
.item-desc-empty {
  font-style: italic;
  color: var(--color-muted);
}
.item-q { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.item-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.item-actions form { display: inline; margin: 0; }
.btn-edit.btn-secondary {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}
.btn-edit.btn-secondary:hover { background: var(--color-surface-2); }
.btn-delete.btn-icon {
  color: var(--color-danger);
  border-color: #fecaca;
  background: var(--color-danger-bg);
}
.btn-delete.btn-icon:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--color-text);
}
.empty-state p {
  font-size: 13px;
  color: var(--color-muted);
  margin: 0 0 16px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.sug-card {
  border: 1px solid #BFDBFE;
  background: var(--color-info-bg);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.sug-head { margin-bottom: 8px; }
.sug-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.sug-sub { font-size: 12px; color: var(--color-muted); line-height: 1.45; }
.sug-list { display: flex; flex-direction: column; }
.sug-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(37, 99, 235, 0.12);
}
.sug-row:first-child { border-top: none; padding-top: 0; }
.sug-q { flex: 1; font-size: 13px; font-weight: 500; min-width: 0; }
.sug-meta { font-size: 11px; font-weight: 700; color: var(--color-muted); }
.btn-sug {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-primary);
  background: white;
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-sug:hover { background: var(--color-info-bg); }

.form-hint {
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 6px;
  line-height: 1.45;
}
