/**
 * CRM / panel — estética tipo Holded: fondo claro, tarjetas blancas, top bar oscuro
 * Tipografía: Inter + IBM Plex Mono
 */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --holded-nav: #2d333f;
  --holded-nav-text: #f8fafc;
  --holded-nav-muted: rgba(248, 250, 252, 0.7);

  --bg-base: #f5f7fa;
  --bg-elevated: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f8fafc;
  --bg-input: #ffffff;

  --border: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-focus: rgba(59, 130, 246, 0.45);

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

  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.1);
  --accent-glow: rgba(59, 130, 246, 0.22);

  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --danger: #ff5a5f;
  --danger-hover: #e63946;
  --danger-soft: rgba(255, 90, 95, 0.1);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 10px 10px -5px rgba(15, 23, 42, 0.03);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --focus-ring: 0 0 0 3px var(--accent-glow);
}

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

html {
  scroll-behavior: smooth;
  /* Evita que las anclas queden ocultas bajo la topbar sticky */
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg-base);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(59, 130, 246, 0.22);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s var(--ease);
}
a:hover {
  color: var(--accent-hover);
  text-decoration: none;
}
body:not(.app--panel) a:hover {
  text-decoration: underline;
}
a:focus-visible {
  outline: none;
  border-radius: 4px;
  box-shadow: var(--focus-ring);
}

/* ——— App shell (Holded-style top bar) ——— */
.app-topnav {
  background: var(--holded-nav);
  color: var(--holded-nav-text);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 200;
}

.app-topnav__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.app-topnav__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.app-topnav__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.25);
  color: #fff;
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.app-topnav__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--holded-nav-text);
  line-height: 1.25;
}

.app-topnav__title-accent {
  color: #93c5fd;
  font-weight: 700;
}

.app-topnav__subtitle {
  margin: 2px 0 0;
  font-size: 0.8125rem;
  color: var(--holded-nav-muted);
  font-weight: 400;
  line-height: 1.35;
}

.app-topnav__nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.app-topnav__link {
  color: var(--holded-nav-muted);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.app-topnav__link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
}
.app-topnav__link--primary {
  color: #fff;
  background: rgba(59, 130, 246, 0.35);
}
.app-topnav__link--primary:hover {
  background: rgba(59, 130, 246, 0.55);
  color: #fff;
}

.app-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}
.app-avatar--sm {
  width: 36px;
  height: 36px;
  font-size: 0.8125rem;
}

.password-toggle-wrap {
  position: relative;
  margin-bottom: 18px;
}
.password-toggle-wrap input[type="password"],
.password-toggle-wrap input[type="text"] {
  padding-right: 44px;
  margin-bottom: 0;
}
.password-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.password-toggle-btn:hover {
  color: var(--text);
}

@media (max-width: 640px) {
  .app-topnav__inner {
    padding: 12px 16px;
  }
  .app-topnav__title {
    font-size: 0.95rem;
  }
  .app-topnav__subtitle {
    font-size: 0.75rem;
  }
}

.app-main {
  flex: 1;
  min-width: 0;
}

/* ——— Dashboard (filas de KPIs + columnas tipo Holded) ——— */
.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
@media (min-width: 901px) and (max-width: 1280px) {
  .dashboard-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .dashboard-kpis {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 721px) and (max-width: 900px) {
  .dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.kpi-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.kpi-card--link {
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.kpi-card--link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: inherit;
}
.kpi-card--link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring), var(--shadow-md);
}
.kpi-card__label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.kpi-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
  word-break: break-word;
}
.kpi-card__value--success {
  color: #047857;
}
.kpi-card__value--warning {
  color: #b45309;
}
.kpi-card__value--danger {
  color: #b91c1c;
}
.kpi-card__value--accent {
  color: var(--accent);
}
.kpi-card__value--soft {
  font-weight: 500;
}
.kpi-card__sub {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}
.kpi-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kpi-card__head .kpi-card__label {
  margin: 0;
}

/* Dos columnas anchas: bridge | OpenAI (admin) o similar */
.dashboard-split {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-bottom: 0;
}
@media (max-width: 1024px) {
  .dashboard-split {
    grid-template-columns: 1fr;
  }
}
.dashboard-split .section-title {
  margin-top: 0;
  margin-bottom: 12px;
}
.dashboard-split + .section-title {
  margin-top: 32px;
}
.dashboard-split .qr-card {
  margin-bottom: 0;
}
/* Panel CRM cliente: cuadrícula (varias columnas a la vez) */
.client-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.client-dashboard {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 8px;
}
.client-dashboard__split-top {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.25fr);
  gap: 22px;
  align-items: start;
}
@media (max-width: 1080px) {
  .client-dashboard__split-top {
    grid-template-columns: 1fr;
  }
}
.client-dashboard__connect .qr-card {
  margin-bottom: 0;
}
.client-dashboard__leads-principal {
  min-width: 0;
}
.client-dashboard__split-mid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}
@media (max-width: 860px) {
  .client-dashboard__split-mid {
    grid-template-columns: 1fr;
  }
}
.client-dashboard__cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.client-dashboard__full {
  min-width: 0;
}
.section-title--in-grid {
  margin: 0 0 10px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  line-height: 1.35;
}
.section-title__count {
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.section-title__hint-inline {
  display: inline;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  font-size: 0.65rem;
}
.card--scrollable {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card--scrollable > .empty-state,
.card--scrollable > .empty-state--compact {
  margin: 0;
  padding: 16px;
}
.card--scrollable > .table-wrap {
  max-height: min(280px, 42vh);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.card--scrollable .leads-tbl thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  box-shadow: 0 1px 0 var(--border);
}
.card--scrollable--tall > .table-wrap {
  max-height: min(380px, 52vh);
}
.card--scrollable--wide > .table-wrap {
  max-height: min(340px, 48vh);
}
.empty-state--compact {
  padding: 14px 16px;
  font-size: 0.8125rem;
}
.client-qr-hero {
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 55%, #f1f5f9 100%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-card);
}
.client-panel > .section-title {
  margin-top: 28px;
  margin-bottom: 12px;
}
.client-panel > #configuracion-bot {
  margin-top: 32px;
}
.card--settings {
  padding: 32px 40px 36px;
  max-width: 100%;
}
.form--settings {
  gap: 0;
  max-width: 100%;
}
.form--settings .form-footer-actions--wide {
  clear: both;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  margin-bottom: 0;
  padding-top: 20px;
  justify-content: flex-start;
}
.config-rules-chatgpt-hint__link {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent, #2563eb);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.config-rules-chatgpt-hint__link:hover,
.config-rules-chatgpt-hint__link:focus-visible {
  color: #1d4ed8;
  outline: none;
}
.form--settings .form-footer-actions--wide .btn {
  min-width: 200px;
}
.settings-mosaic {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
  align-items: start;
}
@media (max-width: 900px) {
  .settings-mosaic {
    grid-template-columns: 1fr;
  }
}
.settings-mosaic .settings-block--mosaic {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.settings-block {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
}
.settings-block--full {
  margin-bottom: 20px;
}
.settings-block--last {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.settings-block__title {
  margin: 0 0 16px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
  margin-bottom: 0;
  align-items: start;
}
@media (max-width: 720px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}
.form--settings .form-grid-2 .row {
  margin-bottom: 0;
}
.form--settings .row {
  padding: 16px 18px;
  background: #f8fafc;
}
.form--settings .row + .row {
  margin-top: 10px;
}
.form--settings .row--reglas textarea {
  min-height: 11rem;
}
.form--settings .form-grid-2 + .row {
  margin-top: 4px;
}
.card--settings .form .row.row--reglas,
.card--settings .form .row.row--span-full {
  grid-template-columns: minmax(100px, 200px) 1fr;
}
@media (max-width: 640px) {
  .card--settings {
    padding: 20px 18px 24px;
  }
  .card--settings .form .row,
  .form--settings .form-grid-2 {
    display: block;
  }
  .form--settings .form .row {
    display: block;
  }
  .form--settings .form .row > div {
    width: 100%;
  }
  .form--settings .form .row label {
    padding-top: 0;
    margin-bottom: 8px;
  }
  .form-grid-2 .row {
    margin-bottom: 8px;
  }
}

/* ——— Layout ——— */
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 24px 48px;
}

@media (max-width: 640px) {
  .wrap {
    padding: 20px 16px 40px;
  }
}

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

/* Legacy: si queda un topbar en alguna vista */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  padding: 0;
  border-bottom: none;
}

.topbar h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.25;
}

.topbar a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.topbar a:hover {
  background: var(--bg-surface-hover);
  color: var(--text);
  text-decoration: none;
  border-color: #cbd5e1;
}

.page-heading {
  margin: 0 0 24px;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.page-heading .accent,
.accent {
  color: var(--accent);
  font-weight: 700;
}

.section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 36px 0 14px;
}
.section-title:first-of-type {
  margin-top: 8px;
}
.section-title-hint {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-left: 6px;
}
@media (max-width: 720px) {
  .section-title-hint {
    display: block;
    margin: 6px 0 0;
  }
}
.inbox-msg-count {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--accent-soft);
  color: var(--accent);
  vertical-align: middle;
  white-space: nowrap;
}
.inbox-msg-count--btn {
  border: 1px solid rgba(59, 130, 246, 0.25);
  cursor: pointer;
}
.inbox-msg-count--btn:hover {
  background: rgba(59, 130, 246, 0.15);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.brand h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.brand p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  align-items: start;
}
@media (max-width: 960px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

body.app--panel {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ——— Cliente: menú lateral y subvistas ——— */
/* Altura fija al viewport: el scroll es solo del panel central; el lateral no se mueve */
html:has(body.app--client-app) {
  height: 100%;
}

body.app--client-app {
  height: 100vh;
  max-height: 100vh;
  min-height: 100vh;
  /* El safe-area ya se aplica en header/footer internos; evitar doble margen en iPhone */
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  box-sizing: border-box;
}

@supports (height: 100svh) {
  body.app--client-app {
    height: 100svh;
    max-height: 100svh;
    min-height: 100svh;
  }
}

@supports (height: 100dvh) {
  body.app--client-app {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 100dvh;
  }
}

body.app--client-app .client-app {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.client-sidebar {
  width: 260px;
  flex-shrink: 0;
  align-self: stretch;
  background: var(--holded-nav);
  color: var(--holded-nav-text);
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.client-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.client-sidebar__brand .app-avatar--sm {
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.client-sidebar__product-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.client-sidebar__brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.client-sidebar__product {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--holded-nav-text);
}

.client-sidebar__product-accent {
  color: #93c5fd;
  font-weight: 800;
}
.client-sidebar__product-link {
  text-decoration: none;
}
.client-sidebar__product-link:hover,
.client-sidebar__product-link:focus-visible {
  color: #bfdbfe;
  text-decoration: underline;
  text-underline-offset: 2px;
  outline: none;
}

.client-sidebar__tenant {
  font-size: 0.75rem;
  color: var(--holded-nav-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-main__title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.client-view-help-link {
  margin: 0;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fafc;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
}

.client-view-help-link:hover,
.client-view-help-link:focus-visible {
  color: var(--accent, #2563eb);
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.06);
  outline: none;
}

.client-view-help-link--header {
  flex-shrink: 0;
}

.client-view-help-body {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text);
}

.client-view-help-body p {
  margin: 0 0 0.75rem;
}

.client-view-help-body p:last-child {
  margin-bottom: 0;
}

.client-view-help-body ul {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
}

.client-view-help-body li {
  margin-bottom: 0.35rem;
}

.client-view-help-body .client-view-help-note {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.client-view-help-modal .recent-modal__panel {
  max-width: 32rem;
}

.client-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.client-sidebar__link {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--holded-nav-muted);
  text-decoration: none;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.client-sidebar__link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--holded-nav-text);
}

.client-sidebar__link.is-active {
  background: rgba(59, 130, 246, 0.22);
  color: #fff;
  font-weight: 600;
}

.client-sidebar__foot {
  padding: 14px 12px calc(18px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  margin-top: auto;
}

.client-sidebar__foot-link {
  font-size: 0.8125rem;
  color: var(--holded-nav-muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.client-sidebar__foot-link:hover {
  color: var(--holded-nav-text);
  background: rgba(255, 255, 255, 0.06);
}

.client-sidebar__foot-link--primary {
  color: #fff;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
}

.client-sidebar__foot-link--primary:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.client-sidebar__backdrop {
  display: none;
}

.client-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-base);
}

body.app--client-app .client-main {
  overflow: hidden;
}

.client-main__header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 40;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

body.app--client-app .client-main__header {
  position: relative;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
}

.client-main__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.client-main__body {
  flex: 1;
  padding: 24px 28px 32px;
  max-width: min(1680px, 100%);
  width: 100%;
  margin: 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.app--client-app .client-main__body {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.client-sidebar__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
}

.client-sidebar__toggle:hover {
  background: var(--bg-surface-hover);
}

.client-dashboard__intro {
  color: var(--text-secondary);
  margin: 0 0 16px;
  font-size: 0.9375rem;
}

.client-dashboard__connect-first {
  margin-bottom: 28px;
}

.client-dashboard__connect-first .qr-card {
  margin-bottom: 0;
}

.client-qr-summary .client-qr-summary__body {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.client-qr-summary--connected {
  border: 1px solid rgba(16, 185, 129, 0.22);
  background: linear-gradient(160deg, #ffffff 0%, #f8fffc 58%, #ecfdf5 100%);
}

.client-qr-summary--paused {
  border: 1px solid rgba(239, 68, 68, 0.26);
  background: linear-gradient(160deg, #ffffff 0%, #fff9f9 58%, #fef2f2 100%);
}

.client-qr-summary-connected {
  margin-top: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(16, 185, 129, 0.18);
  border-radius: 12px;
  background: rgba(236, 253, 245, 0.7);
}

.client-qr-summary-connected.is-paused {
  border: 1px solid rgba(239, 68, 68, 0.22);
  background: rgba(254, 242, 242, 0.9);
}

.client-qr-summary-connected__title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
  color: #047857;
  letter-spacing: -0.01em;
}

.client-qr-summary-connected__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.client-qr-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.client-qr-summary-chip--ok {
  color: #047857;
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
}

.client-qr-summary-chip--paused {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
}

.client-qr-summary-connected__text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #065f46;
}

.client-qr-summary-connected.is-paused .client-qr-summary-connected__title {
  color: #991b1b;
}

.client-qr-summary-connected.is-paused .client-qr-summary-connected__text {
  color: #7f1d1d;
}

.client-welcome-banner {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(147, 197, 253, 0.12) 50%, rgba(241, 245, 249, 0.95) 100%);
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.client-welcome-banner__title {
  margin: 0 0 12px;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.3;
}

.client-welcome-banner__name {
  color: var(--accent);
}

.client-welcome-banner__text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.client-welcome-banner__link {
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.client-welcome-banner__link:hover {
  color: var(--accent-hover);
}

.client-config-gate {
  margin-top: 14px;
  padding: 20px 22px;
  background: #fffbeb;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
}

.client-config-gate__title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
  color: #92400e;
}

.form--settings .settings-block--identity-stacked .row {
  margin-bottom: 8px;
}

.form--settings .settings-block--identity-stacked .row:last-of-type {
  margin-bottom: 0;
}

/* En Listas y en el bloque IA de Configuración deja separación visible entre filas */
#listas-form .row + .row,
.form--settings .settings-block--mosaic .row + .row {
  margin-top: 12px;
}

.form--settings .settings-block--reglas-bot .row--reglas textarea.mono-area--bot-rules {
  min-height: 16rem;
  width: 100%;
  max-width: 100%;
  resize: vertical;
  box-sizing: border-box;
}

.client-nav-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.client-nav-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}

.client-nav-tile:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.client-nav-tile__icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 4px;
}

.client-nav-tile__title {
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.client-nav-tile__desc,
.client-nav-tile__meta {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.client-nav-tile__meta {
  font-weight: 600;
  color: var(--accent);
}

.section-title--page {
  margin: 0 0 14px;
}

.client-section-card {
  margin-bottom: 8px;
}

/* Listados en subpáginas: sin max-height de dashboard; scroll en el panel principal */
body.app--client-app .client-section-card.card--scrollable {
  flex: 0 1 auto;
  align-self: stretch;
  width: 100%;
}

body.app--client-app .client-section-card.card--scrollable > .table-wrap,
body.app--client-app .client-section-card.card--scrollable--tall > .table-wrap,
body.app--client-app .client-section-card.card--scrollable--wide > .table-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

body.app--client-app .client-section-card.card--scrollable .leads-tbl thead th {
  background: #f1f5f9;
}

body.app--client-app .client-section-card table.leads-tbl {
  font-size: 0.875rem;
}

body.app--client-app .client-section-card table.leads-tbl th {
  font-size: 0.7rem;
  padding: 14px 18px;
}

body.app--client-app .client-section-card table.leads-tbl td {
  padding: 14px 18px;
}

body.app--client-app .client-section-card .cell-clip-wide {
  max-width: min(520px, 36vw);
}

@media (min-width: 1400px) {
  body.app--client-app .client-main__body {
    padding-left: 40px;
    padding-right: 40px;
  }
}

body.app--client-app .client-main__body > .footer-tech {
  margin-top: auto;
  padding-top: 28px;
  flex-shrink: 0;
  scroll-margin-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 960px) {
  body.app--client-app .client-main__body {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 20px));
  }
}

/* Admin: tabla de clientes a ancho útil (mismo criterio que panel cliente) */
.admin-tenants-table-wrap {
  margin-top: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.admin-tenants-table-wrap table.leads-tbl {
  font-size: 0.875rem;
  margin: 0;
}

.admin-tenants-table-wrap table.leads-tbl th,
.admin-tenants-table-wrap table.leads-tbl td {
  padding: 14px 18px;
}

.admin-openai-card .input-row {
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 899px) {
  /* En iPhone/Safari dejamos que el scroll sea del documento para que oculten
     barras superior/inferior como en la home (evita el scroll interno fijo). */
  body.app--client-app {
    height: auto;
    max-height: none;
    min-height: 100dvh;
    overflow-y: auto;
  }

  body.app--client-app .client-app {
    min-height: 100dvh;
    max-height: none;
    overflow: visible;
  }

  body.app--client-app .client-main,
  body.app--client-app .client-main__body {
    overflow: visible;
  }

  .client-sidebar {
    position: fixed;
    top: env(safe-area-inset-top, 0px);
    left: 0;
    bottom: env(safe-area-inset-bottom, 0px);
    z-index: 200;
    transform: translateX(-105%);
    transition: transform 0.22s var(--ease);
    box-shadow: var(--shadow-lg);
    max-width: min(300px, 92vw);
  }

  .client-sidebar.is-open {
    transform: translateX(0);
  }

  .client-sidebar__backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(15, 23, 42, 0.45);
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
  }

  .client-sidebar__toggle {
    display: inline-flex;
  }

  .client-main__body {
    padding: 18px 16px 28px;
  }

  /* Misma especificidad que la regla de escritorio (position: relative) para que sticky funcione al hacer scroll del documento en móvil */
  body.app--client-app .client-main__header {
    position: sticky;
    top: 0;
    z-index: 60;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  }
}

/* ——— Surfaces ——— */
.card {
  background: var(--bg-surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-card);
}

.card--flush {
  padding: 0;
  overflow: hidden;
}

.card h2 {
  margin: 0 0 14px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.qr-card {
  background: var(--bg-surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  color: var(--text);
  box-shadow: var(--shadow-card);
}

.qr-card--nested {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.qr-card--nested .qr-card--nested {
  margin-bottom: 0;
}

/* ——— WhatsApp / estado ——— */
.qr-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.qr-status--block {
  align-items: flex-start;
  margin-bottom: 16px;
}

/* Auto-recarga: título + punto en una sola fila; texto auxiliar debajo */
.token-ar-os-banner.qr-status {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.token-ar-os-banner__line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.token-ar-os-banner__title {
  font-weight: 700;
  line-height: 1.25;
}

/* No usar .err aquí: trae padding/caja y desalinea el punto con el texto */
.token-ar-os-banner__title--pending {
  color: #9a3412;
}

/* Punto “pendiente” en banner auto-recarga: sin pulso, mismo tono que el borde */
.dot.dot-autorecharge-pending {
  background: #f97316;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.35);
  animation: none;
}

/* Escritorio: ancho natural del contenido. Móvil: 100% del contenedor para no salirse del viewport */
#token-autorecharge-form .lead-status-filter-select {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (max-width: 899px) {
  #token-autorecharge-form .lead-status-filter-select {
    display: block;
    width: 100%;
  }
  #token-ar-pack.lead-status-filter-select {
    font-size: 0.875rem;
    padding-right: 36px;
  }
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot.ok,
.dot.green {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}
.dot.red {
  background: #ff5a5f;
  box-shadow: 0 0 0 3px rgba(255, 90, 95, 0.15);
}
.dot.amber {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
  animation: status-pulse 1.8s ease-in-out infinite;
}
.dot.gray {
  background: #94a3b8;
  box-shadow: none;
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

#qr-img-wrap {
  margin-top: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: inline-block;
  box-shadow: var(--shadow-md);
}
#qr-img-wrap img {
  display: block;
  width: 260px;
  height: 260px;
  border-radius: var(--radius-sm);
}

/* ——— Tablas CRM ——— */
table.leads-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
table.leads-tbl th {
  background: #f8fafc;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.6875rem;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.leads-tbl td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
  vertical-align: middle;
}
table.leads-tbl tbody tr {
  transition: background 0.12s var(--ease);
}
table.leads-tbl tbody tr:hover td {
  background: #f8fafc;
}
table.leads-tbl tbody tr:last-child td {
  border-bottom: none;
}
table.leads-tbl code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}
table.leads-tbl code.admin-bot-num-code--offline {
  color: var(--text-secondary);
  background: #f1f5f9;
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: 8px;
  font-weight: 400;
}

table.leads-tbl code.admin-bot-num-code--online {
  color: #166534;
  background: #ecfdf3;
  border: 1px solid #86efac;
  padding: 3px 8px;
  border-radius: 8px;
  font-weight: 400;
}

/* ——— Badges ——— */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-pend {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge-gest {
  background: var(--success-soft);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 4px 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.status-pill.managed {
  color: #047857;
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--success-soft);
}
.status-pill.off {
  color: #b91c1c;
  border-color: rgba(255, 90, 95, 0.35);
  background: var(--danger-soft);
}

/* ——— Botones ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s var(--ease), transform 0.1s var(--ease), box-shadow 0.15s var(--ease);
  box-shadow: var(--shadow-sm);
}
.btn:hover {
  background: var(--accent-hover);
}
.btn:active {
  transform: translateY(1px);
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring), 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s var(--ease), opacity 0.15s var(--ease);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
}
.btn-sm.btn-primary,
a.btn-sm.btn-primary,
a.btn-sm.btn-primary:visited,
a.btn-sm.btn-primary:hover,
a.btn-sm.btn-primary:active,
a.btn-sm.btn-primary:focus {
  color: #fff;
  text-decoration: none;
}
.btn-danger {
  background: #fff0f0;
  color: #b91c1c;
  border: 1px solid rgba(255, 90, 95, 0.4);
}
.btn-danger:hover {
  background: #ffe4e4;
  color: #991b1b;
}
.btn-success,
.btn-on {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.btn-success:hover,
.btn-on:hover {
  background: #d1fae5;
  color: #065f46;
}
.btn-muted {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid var(--border);
}
.btn-muted:hover {
  background: #e2e8f0;
  color: #334155;
}
.btn-sm.btn-muted,
label.btn-sm.btn-muted {
  color: #475569;
  text-decoration: none;
}
.btn-sm.btn-muted:hover,
label.btn-sm.btn-muted:hover {
  color: #334155;
}
.btn-outline {
  background: var(--bg-surface);
  color: var(--accent);
  border: 1px solid var(--border);
}
.btn-outline:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}
.btn-outline:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.inbox-action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}
.cell-inbox-actions {
  white-space: normal;
  min-width: 220px;
}
.cell-lead-actions {
  min-width: 250px;
}
.lead-action-btns {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.lead-action-btns .btn-sm {
  white-space: nowrap;
}
.cell-lead-actions--compact {
  min-width: 56px;
  width: 56px;
}

.bot-toggle {
  padding: 11px 22px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9375rem;
  font-family: var(--font-sans);
  transition: filter 0.15s var(--ease), transform 0.1s var(--ease);
}
.bot-toggle:active {
  transform: scale(0.98);
}
.bot-on {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: var(--shadow-sm);
}
.bot-on:hover {
  filter: brightness(0.98);
  background: #d1fae5;
}
.bot-off {
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.bot-off:hover {
  filter: brightness(1.05);
  background: var(--accent-hover);
}

.copy {
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.copy:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ——— Formularios ——— */
.form {
  display: grid;
  gap: 12px;
}
.form .row,
.kv .row {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 14px 20px;
  align-items: start;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--border);
}
.form label,
.kv label {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  padding-top: 10px;
}
.form input,
.form textarea,
.form select,
.card input[type="text"],
.card input[type="password"],
.card input[type="email"],
.card input[type="number"],
.card textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.04);
}
.form textarea,
.card textarea {
  min-height: 100px;
  resize: vertical;
}
.form input:focus,
.form textarea:focus,
.card input:focus,
.card textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form input::placeholder,
.card input::placeholder {
  color: var(--text-muted);
}

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

/* ——— Alertas / toasts ——— */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #f8fafc;
  margin-bottom: 14px;
  color: var(--text);
  font-size: 0.875rem;
}
.alert.ok {
  border-color: rgba(16, 185, 129, 0.35);
  background: var(--success-soft);
  color: #047857;
}
.alert.err {
  border-color: rgba(255, 90, 95, 0.3);
  background: var(--danger-soft);
  color: #9f1239;
}

#flash {
  display: none;
  position: fixed;
  bottom: 22px;
  right: 22px;
  left: auto;
  top: auto;
  z-index: 10000;
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.875rem;
  max-width: min(400px, calc(100vw - 40px));
  text-align: left;
  pointer-events: none;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
#flash.ok {
  background: #ecfdf5;
  color: #047857;
  border-color: rgba(16, 185, 129, 0.4);
}
#flash.err {
  background: #fff1f2;
  color: #9f1239;
  border-color: rgba(255, 90, 95, 0.4);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  min-width: 260px;
  max-width: min(92vw, 420px);
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
}
.toast.ok {
  border-color: rgba(16, 185, 129, 0.4);
  background: #ecfdf5;
  color: #047857;
}
.toast.err {
  border-color: rgba(255, 90, 95, 0.35);
  background: #fff1f2;
  color: #9f1239;
}

/* OpenAI admin */
.openai-status-line {
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.45;
}
.openai-status-line.muted {
  color: var(--text-secondary);
  font-weight: 400;
}
.openai-status-line.ok {
  color: var(--text-secondary);
}
.openai-status-line.err {
  color: #b91c1c;
}

/* Stripe admin — resultado de «Comprobar Stripe» */
.stripe-check-wrap {
  margin-bottom: 16px;
}

.stripe-api-status {
  margin-bottom: 0;
}

.stripe-check-results {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stripe-check-results[hidden] {
  display: none !important;
}

.stripe-check-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.stripe-check-card__title {
  margin: 0 0 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.stripe-check-card__price {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stripe-check-meta {
  display: grid;
  gap: 6px;
  margin: 0;
  font-size: 0.8125rem;
}

.stripe-check-meta div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
}

.stripe-check-meta dt {
  margin: 0;
  font-weight: 600;
  color: var(--text-secondary);
  flex: 0 0 auto;
}

.stripe-check-meta dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--text);
  word-break: break-all;
}

.stripe-check-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stripe-check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.stripe-check-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stripe-check-pill.is-ok {
  color: #166534;
  background: #ecfdf3;
  border-color: #bbf7d0;
}

.stripe-check-pill.is-ok::before {
  background: #22c55e;
}

.stripe-check-pill.is-warn {
  color: #9a3412;
  background: #fff7ed;
  border-color: #fed7aa;
}

.stripe-check-pill.is-warn::before {
  background: #f97316;
}

.stripe-check-pill.is-mode {
  color: #1e3a8a;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.stripe-check-pill.is-mode::before {
  background: #3b82f6;
}

.stripe-check-warnings {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  list-style: none;
}

.stripe-check-warnings li + li {
  margin-top: 6px;
}

.stripe-topup-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.stripe-topup-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.stripe-topup-section__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}

.stripe-topup-section__badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.stripe-topup-section__badge.is-ok {
  color: #166534;
  background: #dcfce7;
}

.stripe-topup-section__badge.is-warn {
  color: #9a3412;
  background: #ffedd5;
}

.stripe-topup-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stripe-topup-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.stripe-topup-item:last-child {
  border-bottom: none;
}

.stripe-topup-item.is-ok {
  border-left: 3px solid #22c55e;
}

.stripe-topup-item.is-err {
  border-left: 3px solid #ef4444;
  background: #fffbfb;
}

.stripe-topup-item__title {
  margin: 0 0 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.stripe-topup-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.stripe-topup-item__tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
}

.stripe-topup-item.is-ok .stripe-topup-item__tag--ok {
  background: #ecfdf3;
  color: #166534;
}

.stripe-topup-item__meta {
  margin: 0;
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-all;
}

.stripe-topup-item__err {
  margin: 0;
  font-size: 0.8125rem;
  color: #b91c1c;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .stripe-check-card__price {
    font-size: 1.15rem;
  }
}

.openai-key-hint {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-secondary);
  background: #f8fafc;
  border: 1px solid var(--border);
  font-weight: 400;
  max-width: 42rem;
}

/* ——— Login (index) ——— */
.auth-page {
  min-height: 100vh;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
}
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  flex: 1;
}
.auth-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(120% 80% at 50% -20%, rgba(59, 130, 246, 0.08), transparent 55%);
  pointer-events: none;
  z-index: 0;
}
.auth-shell > * {
  position: relative;
  z-index: 1;
}

/* Cabecera de marca (billing, restablecer contraseña, páginas auth públicas) */
.auth-brand-page.login-box {
  overflow: hidden;
}
.auth-brand-strip {
  margin: -40px -36px 24px;
  padding: 28px 20px 26px;
  text-align: center;
  background: linear-gradient(145deg, #0f172a 0%, #1e3a5f 55%, #0c4a6e 100%);
}
.auth-brand-strip img {
  display: block;
  margin: 0 auto;
  max-width: 200px;
  width: 100%;
  height: auto;
  border: 0;
}
.auth-brand-strip__tag {
  margin: 14px 0 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
}
@media (max-width: 480px) {
  .auth-brand-strip {
    margin: -40px -36px 20px;
  }
}

.login-box {
  width: 100%;
  max-width: 440px;
  padding: 40px 36px 36px;
  background: var(--bg-surface);
  border: none;
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}
.login-box h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.login-box > p {
  margin: 0 0 28px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.login-box label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.login-box input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  margin-bottom: 18px;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}
.login-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* iOS Safari: fuentes menores de 16px en inputs disparan zoom y desajustan el layout */
@media (max-width: 960px) {
  textarea,
  select,
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]) {
    font-size: max(16px, 1rem) !important;
  }
}
.login-box button[type="submit"] {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9375rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.15s var(--ease), transform 0.1s var(--ease);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.login-box button[type="submit"]:hover {
  background: var(--accent-hover);
}
.login-box button[type="submit"]:active {
  transform: translateY(1px);
}
.err {
  background: #fff1f2;
  color: #9f1239;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 0.875rem;
  border: 1px solid rgba(255, 90, 95, 0.3);
}
.err.err--pending-pay {
  background: #eff6ff;
  color: #1e3a8a;
  border: 1px solid rgba(59, 130, 246, 0.35);
  margin-bottom: 16px;
}
.err.err--pending-pay .err-pending-pay__text {
  margin: 0 0 12px;
  line-height: 1.45;
}
.err.err--pending-pay .err-pending-pay__detail {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #334155;
}

/* ——— Landing (index): conversión + UX ——— */
body.landing-page {
  min-height: 100vh;
  overflow-x: hidden;
}
body.landing-page--conversion {
  background: var(--bg-base);
}
.landing-container {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}
.landing-skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.landing-skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  z-index: 10001;
}

.landing-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.landing-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  min-height: 52px;
}
.landing-brand {
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.landing-brand__name {
  min-width: 0;
  line-height: 1.25;
}
.landing-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.landing-topbar__nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}
.landing-topbar__link {
  display: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.landing-topbar__link:hover {
  color: var(--text);
  background: var(--bg-elevated);
}
@media (min-width: 640px) {
  .landing-topbar__link {
    display: inline-block;
  }
}
.landing-topbar__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff !important;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}
.landing-topbar__cta:hover {
  background: var(--accent-hover);
  color: #fff !important;
  text-decoration: none;
}

@media (max-width: 639px) {
  .landing-topbar__inner {
    flex-wrap: nowrap;
    gap: 12px;
  }
  .landing-brand {
    min-width: 0;
    flex: 1;
  }
  .landing-brand__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.landing-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(155deg, #1e293b 0%, #0f172a 42%, #172554 100%);
  color: #f8fafc;
  padding: 44px 0 56px;
  margin: 0;
}
.landing-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: radial-gradient(rgba(148, 163, 184, 0.15) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}
.landing-hero > .landing-container {
  position: relative;
  z-index: 1;
}
.landing-hero__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
  gap: 36px;
  align-items: start;
}
.landing-hero__copy {
  max-width: 38rem;
}
.landing-eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(59, 130, 246, 0.25);
  color: #bfdbfe;
  border: 1px solid rgba(147, 197, 253, 0.35);
}
.landing-hero__copy h1 {
  margin: 0 0 16px;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: #fff;
}
.landing-hero__lead {
  margin: 0 0 22px;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: #cbd5e1;
}
.landing-hero__lead strong {
  color: #f1f5f9;
}
.landing-checklist {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
}
.landing-checklist li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #e2e8f0;
}
.landing-checklist li:last-child {
  margin-bottom: 0;
}
.landing-checklist__ico {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.landing-checklist__text {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
  text-wrap: pretty;
}
.landing-hero__copy .landing-checklist strong {
  font-weight: 700;
  color: #f1f5f9;
}
.landing-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.landing-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 700;
  font-family: var(--font-sans);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.12s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}
.landing-btn--primary {
  background: #fff;
  color: #1e40af !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.landing-btn--primary:hover {
  background: #f8fafc;
  color: #1e3a8a !important;
  text-decoration: none;
  transform: translateY(-1px);
}
.landing-btn--ghost {
  background: transparent;
  color: #e2e8f0 !important;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.landing-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff !important;
  text-decoration: none;
}
.landing-btn--large {
  padding: 16px 28px;
  font-size: 1rem;
}
.landing-hero__fineprint {
  margin: 18px 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.45;
}

.landing-demo-band {
  padding: 36px 0 44px;
  background: var(--bg-base);
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}
.landing-demo-band__intro {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto 22px;
}
.landing-demo-band__title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}
.landing-demo-band__sub {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.landing-demo-band__card {
  max-width: 460px;
  margin: 0 auto;
  padding: 20px 20px 22px;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.landing-demo-band__card--phone {
  padding: 16px;
  background: linear-gradient(160deg, #eef2f6 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.landing-demo-band .landing-chat-preview.landing-chat-preview--in-band {
  margin: 0;
}
.landing-chat-preview--in-band {
  border-radius: 16px;
}

.landing-demo-band__split {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: stretch;
  max-width: 960px;
  margin: 0 auto;
}
.landing-demo-band__split-col {
  min-width: 0;
  width: 100%;
}
.landing-demo-band__split-col:first-child .landing-demo-band__card {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}
.landing-demo-band__split-kicker {
  margin: 0 0 10px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}
.landing-crm-preview {
  margin: 0;
}
.landing-crm-preview .section-title.section-title--page {
  padding: 12px 14px 10px;
  margin: 0;
  font-size: 0.9375rem;
}
.landing-crm-preview .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
/* Vista previa landing: ancho mínimo + scroll para no aplastar columnas ni solapar texto */
.landing-crm-preview .landing-crm-preview__tbl.leads-tbl {
  width: auto;
  min-width: 920px;
  table-layout: auto;
  font-size: 0.8125rem;
}
.landing-crm-preview .landing-crm-preview__tbl td,
.landing-crm-preview .landing-crm-preview__tbl th {
  vertical-align: top;
}
.landing-crm-preview .landing-crm-preview__tbl td.col-detail,
.landing-crm-preview .landing-crm-preview__tbl th.col-detail {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  min-width: 16rem;
  max-width: 28rem;
}
.landing-crm-preview .landing-crm-preview__tbl .cell-lead-actions {
  white-space: nowrap;
}
.landing-crm-preview__note {
  margin: 0;
  padding: 10px 14px 14px;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}
.landing-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 20px;
}
.landing-trust__item {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.landing-chat-preview {
  margin: 0 0 20px;
  max-width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.6);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  cursor: pointer;
  outline: none;
  transition:
    border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    transform 0.2s var(--ease);
}
.landing-chat-preview:hover {
  border-color: rgba(147, 197, 253, 0.35);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(59, 130, 246, 0.15);
}
.landing-chat-preview:focus-visible {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), var(--focus-ring);
}
.landing-chat-preview--playing {
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow:
    0 16px 48px rgba(37, 99, 235, 0.25),
    0 0 0 1px rgba(96, 165, 250, 0.35);
}
.landing-chat-preview__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(59, 130, 246, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.landing-chat-preview__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bfdbfe;
}
.landing-chat-preview__pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: landing-pulse-dot 2s ease-out infinite;
}
@keyframes landing-pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(74, 222, 128, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
  }
}
.landing-chat-preview__replay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9 !important;
  font-size: 0.8125rem;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition:
    background 0.15s var(--ease),
    border-color 0.15s var(--ease);
}
.landing-chat-preview__replay:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff !important;
}
.landing-chat-preview__replay:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.55);
}
.landing-chat-preview__step {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-secondary, #64748b);
  background: rgba(148, 163, 184, 0.2);
}
.landing-chat-preview--wa .landing-chat-preview__step {
  color: #64748b;
  background: rgba(100, 116, 139, 0.15);
}
.landing-chat-preview__replay-ico {
  display: inline-block;
  transition: transform 0.35s var(--ease);
}
.landing-chat-preview__replay:active .landing-chat-preview__replay-ico {
  transform: rotate(-200deg);
}
.landing-chat-preview__hint {
  margin: 0;
  padding: 10px 14px 12px;
  font-size: 0.6875rem;
  line-height: 1.45;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.landing-chat-preview__hint kbd {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.625rem;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.landing-chat-line {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  max-height: 280px;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.38s var(--ease),
    transform 0.38s var(--ease),
    max-height 0.45s var(--ease),
    margin 0.35s var(--ease);
}
.landing-chat-line--typing {
  align-items: flex-start;
}
.landing-chat-line--typing .landing-chat-preview__typing {
  padding-top: 4px;
}
.landing-chat-line--me {
  align-items: flex-end;
}
.landing-chat-line--them {
  align-items: flex-start;
}
.landing-chat-line--hidden {
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  max-height: 0 !important;
  margin: 0 !important;
  overflow: hidden;
  pointer-events: none;
}
.landing-chat-line--show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.landing-chat-preview__meta {
  font-size: 0.625rem;
  color: #64748b;
  padding: 0 4px;
  align-self: inherit;
}
.landing-chat-line--typing .landing-chat-preview__meta {
  display: none;
}

.landing-chat-preview__chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.landing-chat-preview__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}
.landing-chat-preview__title {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}
.landing-chat-preview__thread {
  padding: 16px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
}
.landing-chat-preview__bubble {
  max-width: 92%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.8125rem;
  line-height: 1.45;
}
.landing-chat-preview__bubble--in {
  background: #25d366;
  color: #052e16;
  border-bottom-right-radius: 4px;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.landing-chat-preview__bubble--bot {
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
}
.landing-chat-preview__badge {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
}
.landing-chat-preview__typing {
  display: flex;
  gap: 4px;
  padding: 8px 0 0 4px;
}
.landing-chat-preview__typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: landing-typing 1.2s ease-in-out infinite;
}
.landing-chat-preview__typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.landing-chat-preview__typing span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes landing-typing {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

/* Demo: aspecto próximo a WhatsApp (modo claro) + empresa de servicios */
.landing-chat-preview.landing-chat-preview--wa {
  background: #f0f2f5;
  border: 1px solid #d1d7db;
  box-shadow: 0 10px 28px rgba(17, 27, 33, 0.09);
}
.landing-chat-preview.landing-chat-preview--wa:hover {
  border-color: #c4ccd3;
  box-shadow: 0 14px 34px rgba(17, 27, 33, 0.12);
}
.landing-chat-preview.landing-chat-preview--wa.landing-chat-preview--playing {
  border-color: #53bdeb;
  box-shadow: 0 10px 28px rgba(37, 170, 225, 0.22);
}
.landing-chat-preview--wa .landing-chat-preview__toolbar {
  background: #f0f2f5;
  border-bottom: 1px solid #e9edef;
}
.landing-chat-preview--wa .landing-chat-preview__pill {
  color: #54656f;
}
.landing-chat-preview--wa .landing-chat-preview__pulse {
  background: #25d366;
  animation: landing-pulse-dot-wa 2s ease-out infinite;
}
@keyframes landing-pulse-dot-wa {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}
.landing-chat-preview--wa .landing-chat-preview__replay {
  border: 1px solid #e9edef;
  background: #fff;
  color: #008069 !important;
}
.landing-chat-preview--wa .landing-chat-preview__replay:hover {
  background: #f8f9fa;
  border-color: #d1d7db;
  color: #075e54 !important;
}
.landing-chat-preview--wa .landing-chat-preview__replay:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.35);
}

.landing-chat-preview__wa-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #008069;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.landing-chat-preview__wa-back {
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1;
  opacity: 0.95;
  margin-right: -4px;
}
.landing-chat-preview__wa-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}
.landing-chat-preview__wa-head-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.landing-chat-preview__wa-name {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.landing-chat-preview__wa-status {
  font-size: 0.75rem;
  opacity: 0.85;
}
.landing-chat-preview__wa-actions {
  display: flex;
  gap: 14px;
  font-size: 1.0625rem;
  opacity: 0.92;
}

.landing-chat-preview__wa-thread.landing-chat-preview__thread {
  padding: 12px 11px 16px;
  min-height: 140px;
  background-color: #e5ddd5;
  background-image:
    radial-gradient(circle at 40% 30%, rgba(0, 40, 30, 0.03) 0%, transparent 45%),
    radial-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-size:
    auto,
    18px 18px;
}

/* Demo landing: alto fijo para los 4 mensajes + typing y escenarios largos → sin saltos de scroll */
.landing-demo-band .landing-chat-preview__wa-thread.landing-chat-preview__thread {
  min-height: 480px;
}
.landing-demo-aside-card .landing-chat-preview__wa-thread.landing-chat-preview__thread {
  min-height: 480px;
}
@media (max-width: 420px) {
  .landing-demo-band .landing-chat-preview__wa-thread.landing-chat-preview__thread {
    min-height: 530px;
  }
  .landing-demo-aside-card .landing-chat-preview__wa-thread.landing-chat-preview__thread {
    min-height: 530px;
  }
}

.landing-chat-preview__bubble.landing-chat-preview__bubble--wa-out,
.landing-chat-preview__bubble.landing-chat-preview__bubble--wa-in {
  max-width: 94%;
  padding: 8px 10px 6px;
  border-radius: 8px;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.landing-chat-preview__bubble--wa-out {
  align-items: flex-end;
  background: #dcf8c6 !important;
  color: #111b21 !important;
  border-radius: 8px 0 8px 8px !important;
}
.landing-chat-preview__bubble--wa-in {
  align-items: flex-start;
  background: #fff !important;
  color: #111b21 !important;
  border-radius: 0 8px 8px 8px !important;
}
.landing-chat-preview__bubble-text {
  font-size: 0.84375rem;
  line-height: 1.45;
  align-self: stretch;
  text-align: left;
}
.landing-chat-preview__bubble-time {
  font-size: 0.625rem;
  color: rgba(17, 27, 33, 0.45);
  letter-spacing: 0.02em;
  align-self: flex-end;
  margin-top: -2px;
}
.landing-chat-preview__bubble--wa-in .landing-chat-preview__bubble-time {
  align-self: flex-end;
}
.landing-chat-preview__wa-bot-row {
  display: block;
  margin-bottom: 4px;
}
.landing-chat-preview__badge--wa {
  margin-bottom: 0;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.5625rem;
  background: rgba(0, 168, 132, 0.14);
  color: #008069;
  border: none;
}

.landing-chat-preview__typing--wa {
  padding: 12px 14px;
  background: #fff;
  border-radius: 0 12px 12px 12px;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}
.landing-chat-preview__typing--wa span {
  background: #8696a0;
}

.landing-chat-preview--wa .landing-chat-preview__hint {
  background: #f0f2f5;
  color: #667781;
  border-top: 1px solid #e9edef;
}
.landing-chat-preview--wa .landing-chat-preview__hint kbd {
  background: #fff;
  border-color: #e9edef;
  color: #54656f;
}

.landing-form-aside {
  position: sticky;
  top: 72px;
}
.landing-login-card.login-box {
  margin: 0;
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.landing-demo-aside-card {
  margin: 0 0 14px;
  padding: 20px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-xl);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.28);
}
.landing-submit--link {
  display: inline-block;
  text-align: center;
  text-decoration: none;
}
.landing-submit--link:hover {
  color: #fff;
  text-decoration: none;
}
.landing-login-inline-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.8125rem;
  color: var(--accent);
}
.landing-login-inline-link:hover {
  color: var(--accent-hover);
}
.landing-login-card .landing-login-inline-link {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.landing-login-section {
  margin-bottom: 48px;
}
.landing-login-section .landing-login-card.login-box {
  max-width: 520px;
  margin: 0 auto;
}
body.modal-open {
  overflow: hidden;
}
.landing-login-modal .recent-modal__backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
}
.landing-login-modal .recent-modal__panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, calc(100% - 24px));
  margin: 0;
  max-height: min(90vh, 720px);
  z-index: 1;
}
.landing-login-modal .landing-login-panel.landing-login-card.login-box {
  padding: 0;
  border-radius: 18px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 28px 60px rgba(15, 23, 42, 0.42),
    0 12px 24px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.28);
}
.landing-login-modal .landing-login-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 52%, #0c4a6e 100%);
}
.landing-login-modal .landing-login-head__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #f8fafc;
}
.landing-login-modal .landing-login-head__close {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), transform 0.1s var(--ease);
}
.landing-login-modal .landing-login-head__close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.landing-login-modal .landing-login-head__close:active {
  transform: scale(0.96);
}
.landing-login-modal .landing-login-head__close-x {
  position: relative;
  display: block;
  width: 15px;
  height: 15px;
}
.landing-login-modal .landing-login-head__close-x::before,
.landing-login-modal .landing-login-head__close-x::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 17px;
  height: 2px;
  margin-left: -8.5px;
  margin-top: -1px;
  border-radius: 1px;
  background: currentColor;
}
.landing-login-modal .landing-login-head__close-x::before {
  transform: rotate(45deg);
}
.landing-login-modal .landing-login-head__close-x::after {
  transform: rotate(-45deg);
}
.landing-login-modal .landing-login-panel__body {
  padding: 22px 22px 20px;
}
.landing-login-modal .landing-login-sub--lead {
  font-size: 0.9375rem;
  line-height: 1.55;
  margin: 0 0 20px;
}
.landing-login-modal .landing-login-form label {
  font-size: 0.6875rem;
}
.landing-login-modal .landing-login-form input {
  margin-bottom: 16px;
}
/* El margen del formulario no debe aplicarse al input del toggle: alarga el wrap y baja el ojo */
.landing-login-modal .landing-login-form .password-toggle-wrap input[type="password"],
.landing-login-modal .landing-login-form .password-toggle-wrap input[type="text"] {
  margin-bottom: 0;
}
.landing-login-modal .landing-login-secure-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.landing-login-modal .landing-login-secure-note__text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: break-word;
}
.landing-login-modal .landing-login-secure-note__lead {
  font-weight: 500;
}
.landing-login-modal .landing-login-secure-note__sep {
  opacity: 0.55;
  user-select: none;
}
.landing-login-modal .landing-login-secure-note__forgot {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: inherit;
  font-weight: 500;
  color: inherit;
  display: inline;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: rgba(100, 116, 139, 0.45);
  vertical-align: baseline;
}
.landing-login-modal .landing-login-secure-note__forgot:hover {
  color: var(--accent);
  text-decoration-color: rgba(37, 99, 235, 0.45);
}
.g-recaptcha-host {
  margin-top: 12px;
}
.landing-login-modal .g-recaptcha-host {
  display: flex;
  justify-content: flex-start;
}
.landing-login-modal .landing-login-secure-note__icon {
  display: inline-flex;
  color: #059669;
  flex-shrink: 0;
}
.landing-login-modal .landing-login-secure-note__icon svg {
  display: block;
}
.landing-login-modal .landing-login-foot {
  padding: 16px 16px 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.landing-login-modal .landing-login-foot--compact {
  margin-top: 18px;
  padding: 14px 16px 16px;
}
.landing-login-modal .landing-login-textlink {
  margin: 10px 0 0;
  display: inline-block;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: rgba(37, 99, 235, 0.45);
  vertical-align: baseline;
}
.landing-login-modal .landing-login-textlink:hover {
  color: var(--accent-hover);
  text-decoration-color: rgba(37, 99, 235, 0.8);
}
.landing-login-modal .landing-login-signup-cta {
  margin-top: 18px;
  padding: 16px 14px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  border-radius: 14px;
  border: none;
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 0 0 1px rgba(226, 232, 240, 0.9);
}
.landing-login-modal .landing-login-signup-cta__intro {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.landing-login-modal .landing-login-signup-cta__label {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
}
.landing-login-modal .landing-login-signup-cta__rule {
  margin-top: 10px;
  height: 1px;
  flex-shrink: 0;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.55), transparent);
}
.landing-login-modal .landing-login-signup-cta__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.landing-login-modal .landing-login-signup-cta__action:hover {
  text-decoration: none;
  background: #eff6ff;
  border-color: var(--accent);
  color: var(--accent-hover);
}
.landing-login-modal .landing-login-signup-cta__in {
  display: inline-block;
}
.landing-login-modal .landing-login-signup-cta__action:hover .landing-login-signup-cta__in,
.landing-login-modal .landing-login-signup-cta__action:focus-visible .landing-login-signup-cta__in {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  text-decoration-color: rgba(37, 99, 235, 0.75);
}
.landing-login-modal .landing-login-foot__divider {
  height: 1px;
  margin: 12px 0;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.45), transparent);
}
.landing-login-modal .landing-login-foot__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin: 0 0 8px;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.landing-login-modal .landing-login-foot__back:hover {
  color: var(--accent-hover);
}
.landing-login-modal .landing-login-foot__msg {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
}
.landing-login-modal .landing-login-foot__msg.hint {
  color: var(--text-secondary);
}
.landing-login-modal .landing-login-foot__msg.err {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: #fff1f2;
  border: 1px solid rgba(255, 90, 95, 0.28);
  color: #9f1239;
  font-weight: 500;
}
.landing-login-modal .landing-login-sub {
  margin-top: 0;
}
@media (max-width: 640px) {
  .landing-login-modal .recent-modal__panel {
    width: calc(100% - 16px);
  }
  .landing-login-modal .landing-login-panel__body {
    padding: 18px 16px 16px;
  }
}
.landing-login-kicker {
  margin: 0 0 8px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.landing-login-title {
  margin: 0 0 8px;
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}
.landing-login-sub {
  margin: 0 0 18px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.45;
}
.landing-login-trust {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-muted);
}
/* Sobrescribe .login-box > p (margin-top: 0), que pisaba el espacio sobre el botón */
.login-box > p.landing-login-trust {
  margin-top: 40px;
  margin-bottom: 0;
}
.landing-login-card .landing-submit,
.landing-login-card button[type="submit"].landing-submit,
.login-box.auth-brand-page .landing-submit,
.login-box.auth-brand-page button[type="submit"].landing-submit {
  width: 100%;
  margin-top: 6px;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--accent) 0%, #2563eb 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.9375rem;
  font-family: var(--font-sans);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}
.landing-login-card .landing-submit:hover,
.login-box.auth-brand-page .landing-submit:hover,
.login-box.auth-brand-page button[type="submit"].landing-submit:hover {
  filter: brightness(1.06);
}

.landing-body {
  padding: 48px 0 100px;
}
.landing-pain {
  margin-bottom: 56px;
}
.landing-benefits {
  margin-bottom: 8px;
}
@media (max-width: 640px) {
  .landing-body {
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  }
}
.landing-section-title {
  margin: 0 0 24px;
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}
.landing-section-title--center {
  text-align: center;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}
.landing-section-title--flush {
  margin-bottom: 10px;
}
.landing-section-head {
  margin-bottom: 28px;
}
.landing-section-head--center {
  text-align: center;
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 32px;
}
.landing-section-kicker {
  margin: 0 0 8px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.landing-section-head--center .landing-section-kicker {
  color: var(--accent);
}
.landing-section-lead {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.landing-section-head--center .landing-section-lead {
  margin-left: auto;
  margin-right: auto;
}

.landing-pain__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 820px) {
  .landing-pain__grid {
    grid-template-columns: 1fr;
  }
}
.landing-quote {
  margin: 0;
  padding: 18px 18px;
  font-size: 0.9375rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.landing-pain__flip {
  margin: 0;
  font-size: 1.0625rem;
  text-align: center;
  color: var(--text);
  line-height: 1.55;
}

.landing-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 900px) {
  .landing-cards {
    grid-template-columns: 1fr;
  }
}
.landing-card {
  padding: 24px 22px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.landing-card:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.landing-card__icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.12), rgba(147, 197, 253, 0.2));
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.landing-card__icon {
  font-size: 1.6rem;
  line-height: 1;
  display: block;
}
.landing-card__title {
  margin: 0 0 10px;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.landing-card__text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.landing-steps-wrap {
  margin-top: 48px;
  padding: 36px 28px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
}
.landing-steps-num {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.landing-steps-num li {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}
.landing-steps-num li:last-child {
  margin-bottom: 0;
}
.landing-steps-num__n {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 1.125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.landing-steps-num div strong {
  display: block;
  font-size: 1.0625rem;
  color: var(--text);
  margin-bottom: 4px;
}
.landing-steps-num div span {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.landing-faq-block {
  margin-top: 48px;
}
.landing-details {
  margin-bottom: 10px;
  padding: 16px 18px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.landing-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  list-style: none;
}
.landing-details summary::-webkit-details-marker {
  display: none;
}
.landing-details summary::after {
  content: "+";
  float: right;
  font-weight: 700;
  color: var(--accent);
}
.landing-details[open] summary::after {
  content: "−";
}
.landing-details p {
  margin: 12px 0 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.landing-final-cta {
  margin-top: 48px;
  padding: 40px 28px;
  text-align: center;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(147, 197, 253, 0.18) 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
}
.landing-final-cta__inner h2 {
  margin: 0 0 10px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}
.landing-final-cta__inner p {
  margin: 0 0 22px;
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}
.landing-final-cta .landing-btn--primary {
  background: var(--accent);
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}
.landing-final-cta .landing-btn--primary:hover {
  background: var(--accent-hover);
  color: #fff !important;
}

.landing-pricing {
  position: relative;
  margin: 52px 0 56px;
  padding: 42px 0;
  z-index: 0;
}
.landing-pricing::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #1d4ed8 100%);
  z-index: -1;
}
.landing-pricing .landing-section-kicker,
.landing-pricing .landing-section-title,
.landing-pricing .landing-section-lead {
  color: #fff;
}
.landing-pricing .landing-section-lead {
  opacity: 0.92;
}
.landing-pricing__layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 560px);
  gap: 26px;
  align-items: center;
}
.landing-pricing__copy {
  margin: 0;
}
.landing-pricing__copy .landing-section-lead {
  max-width: 42ch;
}
.landing-price-card {
  max-width: 560px;
  margin: 0;
  padding: 30px 26px;
  background: linear-gradient(165deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: var(--radius-xl);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.65) inset;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.landing-price-card::before {
  content: "";
  position: absolute;
  top: -110px;
  right: -80px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0) 68%);
  pointer-events: none;
}
.landing-price-card__eyebrow {
  margin: 0 0 8px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.13em;
}
.landing-price-card__amount {
  margin: 0 0 10px;
  color: var(--text);
  line-height: 1;
}
.landing-price-card__amount strong {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  letter-spacing: -0.04em;
}
.landing-price-card__cents {
  font-size: 0.45em;
  vertical-align: super;
  letter-spacing: -0.01em;
}
.landing-price-card__currency {
  margin-left: 2px;
  font-size: 0.74em;
  font-weight: 600;
  color: var(--text-secondary);
}
.landing-price-card__amount span {
  margin-left: 8px;
  font-size: 1.05rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.landing-price-card__desc {
  margin: 0 0 14px;
  color: var(--text-secondary);
}
.landing-price-card__list {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  text-align: left;
  display: grid;
  gap: 8px;
}
.landing-price-card__list li {
  position: relative;
  padding-left: 24px;
  color: var(--text);
  font-size: 0.92rem;
}
.landing-price-card__list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: #059669;
  font-weight: 800;
}
.landing-price-card .landing-btn {
  min-width: 260px;
}
.landing-price-card__note {
  margin: 12px 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
@media (max-width: 940px) {
  .landing-pricing__layout {
    grid-template-columns: 1fr;
  }
  .landing-pricing__copy {
    text-align: center;
  }
  .landing-pricing__copy .landing-section-lead {
    margin-left: auto;
    margin-right: auto;
  }
  .landing-price-card {
    margin: 0 auto;
  }
}

.landing-seo-note {
  margin: 40px 0 0;
  padding: 12px 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border);
}

.landing-footer {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.landing-footer__inner {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.landing-footer__copy {
  margin: 0;
}
.landing-footer__legal {
  margin-top: 8px;
  display: flex;
  gap: 10px 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.landing-footer__legal a {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.landing-footer__legal a:hover {
  color: var(--accent);
}

.landing-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.6);
}
.landing-details summary:focus-visible {
  outline: none;
  border-radius: 6px;
  box-shadow: var(--focus-ring);
}
.landing-topbar__cta:focus-visible,
.landing-topbar__link:focus-visible {
  outline: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--focus-ring);
}

.landing-mobile-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.92) 40%);
  justify-content: center;
  align-items: center;
  text-decoration: none;
}

/* Ajuste fino para anclas de la landing */
#beneficios,
#precio,
#como-empezar,
#faq-h,
#landing-chat-demo,
#acceso-panel-login {
  scroll-margin-top: 100px;
}
.landing-mobile-bar__text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 420px;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.9375rem;
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.35);
}
.landing-mobile-bar:hover .landing-mobile-bar__text {
  background: var(--accent-hover);
  color: #fff !important;
}
@media (max-width: 960px) {
  .landing-hero__layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .landing-hero__copy {
    max-width: none;
  }
  .landing-form-aside {
    position: relative;
    top: auto;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }
  .landing-mobile-bar {
    display: flex;
  }
}

@media (max-width: 520px) {
  .landing-container {
    padding-left: 16px;
    padding-right: 16px;
  }
  .landing-hero {
    padding: 28px 0 42px;
  }
  .landing-checklist li {
    font-size: 0.875rem;
    line-height: 1.55;
    gap: 10px;
    margin-bottom: 14px;
    align-items: flex-start;
  }
  .landing-checklist__ico {
    margin-top: 3px;
  }
  .landing-hero__copy h1 {
    font-size: clamp(1.45rem, 6vw, 1.85rem);
    line-height: 1.18;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-card:hover {
    transform: none;
  }
  .landing-btn:hover {
    transform: none;
  }
  .landing-chat-preview__typing span {
    animation: none;
    opacity: 0.5;
  }
}

/* ——— Legacy / detalle leads ——— */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.switch-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface-hover);
  color: var(--text);
  cursor: pointer;
  font-size: 0.8125rem;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.switch-label {
  min-width: 58px;
  text-align: left;
  color: var(--text-secondary);
  font-weight: 600;
}
.switch-track {
  width: 42px;
  height: 22px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.45);
  position: relative;
  transition: all 0.18s var(--ease);
}
.switch-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.18s var(--ease);
  box-shadow: var(--shadow-sm);
}
.switch-toggle.on {
  border-color: rgba(52, 211, 153, 0.4);
  background: var(--success-soft);
}
.switch-toggle.on .switch-track {
  background: rgba(52, 211, 153, 0.35);
  border-color: rgba(52, 211, 153, 0.5);
}
.switch-toggle.on .switch-thumb {
  transform: translateX(20px);
}
.switch-toggle:disabled {
  opacity: 0.65;
  cursor: wait;
}

.kv {
  display: grid;
  gap: 10px;
}
.kv code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  word-break: break-all;
}

.leads-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.leads-head span {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.lead {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  background: #f8fafc;
}
.lead.managed {
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--success-soft);
}
.lead-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}
.lead-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.phone {
  font-weight: 700;
  letter-spacing: 0.02em;
}
.date {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 720px) {
  .fields {
    grid-template-columns: 1fr;
  }
}

.field {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-subtle);
}
.field b {
  display: block;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field span {
  font-size: 0.875rem;
  line-height: 1.4;
}

.wa {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  margin-top: 8px;
}

details {
  margin-top: 10px;
}
details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.875rem;
}

.card-collapsible {
  box-shadow: var(--shadow-card);
}
.card-collapsible > summary {
  list-style: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  color: inherit;
  padding: 0;
}
.card-collapsible.card--flush > summary {
  padding: 18px 24px;
  border-bottom: 1px solid transparent;
}
.card-collapsible.card--flush[open] > summary {
  border-bottom-color: var(--border);
}
.card-collapsible > summary::-webkit-details-marker {
  display: none;
}
.card-collapsible > summary::marker {
  content: "";
}
.card-collapsible .card-title {
  display: inline-block;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.card-collapsible .card-subtitle {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
}
.card-collapsible[open] > summary {
  margin-bottom: 12px;
}
.card-collapsible .card-body {
  margin-top: 0;
  padding: 0 24px 24px;
}
.card-collapsible.card--flush[open] .card-body {
  padding-top: 4px;
}

/* Tutorial Bridge admin: .card--flush usa overflow:hidden y recorta el <details> abierto; scroll propio en el cuerpo */
details.bridge-install-details.card--flush {
  overflow: visible;
}
details.bridge-install-details[open] > .card-body {
  max-height: min(72vh, 42rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  min-height: 0;
}

.chat {
  margin-top: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 12px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
}
.msg-u {
  color: #1d4ed8;
  margin: 4px 0;
}
.msg-a {
  color: #047857;
  margin: 4px 0;
}
.empty {
  color: var(--text-muted);
  padding: 12px 4px;
}

footer {
  margin-top: 28px;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.lead-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.inline-form {
  margin: 0;
}

.btn-manage {
  border-color: rgba(16, 185, 129, 0.45) !important;
  background: var(--success-soft) !important;
  color: #047857 !important;
}
.btn-manage:hover {
  border-color: rgba(16, 185, 129, 0.6) !important;
}

/* Utilidades */
.mt-sm {
  margin-top: 12px;
}
.mt-md {
  margin-top: 20px;
}
.text-center {
  text-align: center;
}
.flex-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.bridge-meta.is-online {
  color: var(--success);
}
.bridge-meta.is-offline {
  color: var(--danger);
}

.bridge-hint {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.help-q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  vertical-align: middle;
}
.help-q:hover {
  border-color: var(--accent);
  color: var(--text);
}

.input-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.input-row > input {
  flex: 1;
  min-width: 220px;
}
.input-row .w-num {
  flex: 0 0 auto;
  width: 120px;
  min-width: 0;
}
.input-row--range {
  flex-wrap: nowrap;
}
.input-row--range .w-num {
  width: 110px;
  max-width: 110px;
}
.input-row--range .range-sep {
  flex: 0 0 auto;
}

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

.tenant-create-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.tenant-create-bar .tenant-field {
  flex: 1;
  min-width: 140px;
}
.tenant-create-bar .tenant-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.tenant-create-bar input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.tenant-create-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.mb-field {
  margin-bottom: 16px;
}

/* ——— Cliente CRM ——— */
.crm-title {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.crm-accent {
  color: var(--accent);
}
.brand-tagline {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.bot-state-line {
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.bot-state-ok {
  font-weight: 700;
  color: var(--success);
}
.bot-state-paused {
  font-weight: 700;
  color: var(--danger);
}
.success-banner {
  color: var(--success);
  margin-top: 14px;
  font-weight: 600;
}
.success-banner--paused {
  color: #991b1b;
}
.subtle-p {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  margin: 6px 0 0;
}
.subtle-p--paused {
  color: #7f1d1d;
}
.qr-init-grid {
  margin-top: 22px;
  text-align: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 520px) {
  .qr-init-grid {
    grid-template-columns: 1fr;
  }
}
.qr-init-grid .qr-card--nested > p:first-of-type {
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text);
}
.qr-init-grid > :only-child {
  grid-column: 1 / -1;
  width: min(100%, 320px);
  justify-self: center;
}
.empty-state {
  padding: 28px 22px;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.875rem;
}
.table-wrap {
  overflow-x: auto;
}
.cell-muted {
  color: var(--text-muted);
  font-size: 0.75rem;
}
.cell-clip {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leads-tbl--qualified th.col-detail,
.leads-tbl--qualified td.col-detail {
  width: 34%;
}
.leads-tbl--qualified th.col-detail {
  white-space: normal;
}
.leads-tbl--qualified td.col-detail {
  white-space: normal;
  overflow-wrap: anywhere;
}
.cell-clip-wide {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.input-alias {
  max-width: 190px;
}
.mono-area {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}
.allowlist-sync-field {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  resize: none;
}
.allowlist-manage {
  position: relative;
  width: 100%;
}
.allowlist-hint {
  margin: 0 0 12px;
  line-height: 1.45;
}
.allowlist-visual-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 2rem;
}
.allowlist-visual-empty {
  margin: 0;
}
.allowlist-entry {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #f8fafc;
}
.allowlist-entry-body {
  flex: 1;
  min-width: 0;
}
.allowlist-entry-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  margin-bottom: 4px;
}
.allowlist-entry-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.agenda-entry-meta .agenda-promote-allowlist {
  margin-top: 2px;
}
.allowlist-entry-tel {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.allowlist-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.allowlist-chip--muted {
  opacity: 0.9;
}
.allowlist-entry-remove {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.allowlist-entry-remove:hover {
  color: var(--danger-hover);
  background: var(--danger-soft);
}
.recent-modal {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: none;
}
.recent-modal[aria-hidden="false"] {
  display: block;
}
.recent-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}
.recent-modal__panel {
  position: relative;
  width: min(760px, calc(100vw - 28px));
  max-height: min(78vh, 760px);
  overflow: hidden;
  margin: 8vh auto 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}
.recent-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.recent-modal__head h3 {
  margin: 0;
  font-size: 0.95rem;
}
.recent-modal__body {
  overflow: auto;
  padding: 12px 16px 16px;
}
.bot-rules-sector-modal__panel {
  max-width: min(720px, 96vw);
}
.bot-rules-sector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 8px;
}
.bot-rules-sector-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.bot-rules-sector-btn:hover,
.bot-rules-sector-btn:focus-visible {
  border-color: var(--accent, #2563eb);
  background: #eff6ff;
  outline: none;
}
.bot-rules-sector-btn[data-sector-id="generico"] {
  grid-column: 1 / -1;
  font-weight: 600;
  background: #f8fafc;
}
.recent-msg-item {
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}
.recent-msg-item:last-child {
  margin-bottom: 0;
}
.recent-msg-item--user {
  background: #eff6ff;
  border-color: rgba(59, 130, 246, 0.2);
}
.recent-msg-item--assistant {
  background: #ecfdf5;
  border-color: rgba(16, 185, 129, 0.25);
}
.recent-msg-item__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.recent-msg-item__who {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.recent-msg-item__ts {
  color: var(--text-muted);
  font-size: 0.75rem;
}
.recent-msg-item__txt {
  color: var(--text);
  font-size: 0.875rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.form-footer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}
.footer-tech {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 32px;
  text-align: center;
}
.w-num {
  width: 120px;
}
.range-sep {
  color: var(--text-muted);
  user-select: none;
}
.lead-status-filter-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background-color: #fff;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 8px 38px 8px 12px;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 1px),
    calc(100% - 10px) calc(50% - 1px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.lead-status-filter-select:hover {
  border-color: #94a3b8;
  background-color: #f8fafc;
}
.lead-status-filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
  background-color: #fff;
}
.smtp-admin-form select.lead-status-filter-select,
#billing-settings-form select.lead-status-filter-select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.smtp-admin-form select.lead-status-filter-select {
  font-weight: 400;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.checkbox-row input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
}

.ui-switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.ui-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.ui-switch__slider {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background-color .2s ease, box-shadow .2s ease;
  flex: 0 0 auto;
}
.ui-switch__slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform .2s ease;
}
.ui-switch input[type="checkbox"]:checked + .ui-switch__slider {
  background: var(--accent);
}
.ui-switch input[type="checkbox"]:checked + .ui-switch__slider::after {
  transform: translateX(20px);
}
.ui-switch input[type="checkbox"]:focus-visible + .ui-switch__slider {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.ui-switch__label {
  color: #0f172a;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  color: #334155;
}

/* Responsive form rows */
@media (max-width: 560px) {
  .form .row,
  .kv .row {
    grid-template-columns: 1fr;
  }
  .form label,
  .kv label {
    padding-top: 0;
  }
  .lead-actions {
    flex-direction: column;
  }
  .lead-actions .copy {
    width: 100%;
    justify-content: center;
  }
  #flash,
  .toast {
    right: 14px;
    left: 14px;
    bottom: 14px;
    max-width: none;
  }
  .input-alias {
    max-width: none;
    min-width: 180px;
    width: 100%;
  }
}

/* Atribución reCAPTCHA (cuando la insignia flotante está oculta) */
.recaptcha-attribution-bar {
  width: 100%;
  box-sizing: border-box;
  border-top: 1px solid rgba(112, 164, 255, 0.14);
  margin-top: 0.75rem;
  padding: 0.65rem 0 0;
}
.recaptcha-attribution-bar .tech-container {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}
.recaptcha-attribution {
  margin: 0;
  max-width: 40rem;
  font-size: 0.6875rem;
  line-height: 1.5;
  text-align: center;
  color: var(--tech-muted, #8fa3c9);
  opacity: 0.88;
}
.recaptcha-attribution a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.recaptcha-attribution--inline {
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--border, #e2e8f0);
  font-size: 0.6875rem;
  line-height: 1.45;
  text-align: center;
  color: #64748b;
}
.tech-footer__legal-btn {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: inherit;
  color: var(--tech-muted, #9eb0d5);
  cursor: pointer;
  text-decoration: none;
}
.tech-footer__legal-btn:hover {
  color: #c7d6f5;
  text-decoration: underline;
}

body.omebot-cookie-scroll-lock {
  overflow: hidden;
}

.cookie-consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
/* display:flex ganaría a [hidden] en algunos navegadores si no forzamos oculto */
.cookie-consent-overlay[hidden] {
  display: none !important;
}
.cookie-consent-overlay__panel {
  width: min(100%, 520px);
  max-height: min(88vh, 720px);
  overflow: auto;
  padding: 1.25rem 1.35rem;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}
.cookie-consent-overlay__brand {
  text-align: center;
  margin: 0 0 1rem;
}
.cookie-consent-overlay__logo {
  display: block;
  margin: 0 auto;
  width: min(180px, 58vw);
  height: auto;
}
.cookie-consent-overlay__text {
  min-width: 0;
}
.cookie-consent-overlay__title {
  display: block;
  color: #f1f5f9;
  font-size: 1rem;
  margin: 0 0 0.35rem;
}
.cookie-consent-overlay__p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #cbd5e1;
}
.cookie-consent-overlay__legal {
  margin-top: 0.5rem !important;
}
.cookie-consent-overlay__legal a {
  color: #93c5fd;
  text-decoration: underline;
}
.cookie-consent-overlay__legal a:hover {
  color: #bfdbfe;
}
.cookie-consent-overlay__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
}
.cookie-consent-modal__panel {
  max-width: min(420px, 94vw);
}
.cookie-consent-pref-row {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}
.cookie-consent-pref-row:last-of-type {
  border-bottom: 0;
  margin-bottom: 0.5rem;
  padding-bottom: 0;
}
.cookie-consent-pref-row__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-primary, #0f172a);
}
.cookie-consent-pref-row__label input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}
.cookie-consent-pref-row__hint {
  margin: 0.35rem 0 0 1.6rem;
  font-size: 0.8125rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.45;
}
.cookie-consent-modal__footer {
  border-top: 0 !important;
  padding-top: 0.5rem !important;
  margin-top: 0 !important;
  justify-content: flex-start !important;
  gap: 0.5rem !important;
}

/* Botón flotante soporte WhatsApp (global) */
.wa-support-fab {
  position: fixed;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.wa-support-fab:hover {
  background: #20bd5a;
  color: #fff;
  transform: scale(1.06);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}
.wa-support-fab:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.wa-support-fab--bottom-right {
  right: max(18px, env(safe-area-inset-right, 0px));
  bottom: max(18px, env(safe-area-inset-bottom, 0px));
}
.wa-support-fab--bottom-left {
  left: max(18px, env(safe-area-inset-left, 0px));
  bottom: max(18px, env(safe-area-inset-bottom, 0px));
}
.wa-support-fab__icon {
  display: flex;
  line-height: 0;
}
:is(.landing-tech-page, .legal-tech-page) .wa-support-fab {
  position: fixed !important;
  z-index: 10050;
}
@media (max-width: 960px) {
  :is(.landing-tech-page, .legal-tech-page) .wa-support-fab--bottom-right {
    right: max(14px, env(safe-area-inset-right, 0px));
    bottom: max(5.5rem, calc(env(safe-area-inset-bottom, 0px) + 4.75rem));
  }
  :is(.landing-tech-page, .legal-tech-page) .wa-support-fab--bottom-left {
    left: max(14px, env(safe-area-inset-left, 0px));
    bottom: max(5.5rem, calc(env(safe-area-inset-bottom, 0px) + 4.75rem));
  }
}
@media (max-width: 560px) {
  .wa-support-fab {
    width: 52px;
    height: 52px;
  }
  .wa-support-fab--bottom-right {
    right: max(14px, env(safe-area-inset-right, 0px));
    bottom: max(14px, env(safe-area-inset-bottom, 0px));
  }
  .wa-support-fab--bottom-left {
    left: max(14px, env(safe-area-inset-left, 0px));
    bottom: max(14px, env(safe-area-inset-bottom, 0px));
  }
  :is(.landing-tech-page, .legal-tech-page) .wa-support-fab--bottom-right,
  :is(.landing-tech-page, .legal-tech-page) .wa-support-fab--bottom-left {
    bottom: max(5.5rem, calc(env(safe-area-inset-bottom, 0px) + 4.75rem));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
