

:root {
  --bg: #f0f4f8;
  --white: #ffffff;
  --text: #0f1b2d;
  --text2: #4a5568;
  --muted: #9aa5b4;
  --border: #e8edf3;
  --teal: #00c9b1;
  --teal2: #00a896;
  --teal-dim: rgba(0,201,177,0.12);
  --indigo: #3d4fd1;
  --indigo-dim: rgba(61,79,209,0.10);
  --red: #f05252;
  --red-dim: rgba(240,82,82,0.10);
  --amber: #f59e0b;
  --amber-dim: rgba(245,158,11,0.10);
  --shadow-sm: 0 2px 8px rgba(15,27,45,0.06);
  --shadow-md: 0 4px 20px rgba(15,27,45,0.09);
  --shadow-lg: 0 8px 40px rgba(15,27,45,0.13);
}

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }


.app {
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

/* En desktop o navegador ancho */
@media (min-width: 768px) {
  html:not(.standalone) .app {
    max-width: 430px;
    margin: 0 auto;
  }
}

/* Instalada como app real */
html.standalone .app,
body.standalone .app {
  width: 100vw;
  max-width: none !important;
  height: 100dvh;
  margin: 0;
  border-radius: 0;
}


/* ── TOPBAR ── */
.topbar {
  background: var(--white);
  padding: 14px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}



.topbar {
  padding-top: calc(14px + env(safe-area-inset-top));
  padding-left: calc(20px + env(safe-area-inset-left));
  padding-right: calc(20px + env(safe-area-inset-right));
}


.topbar-left { display: flex; align-items: center; gap: 10px; }

.hamburger {
  width: 32px; height: 32px;
  display: flex; flex-direction: column;
  justify-content: center; gap: 5px;
  cursor: pointer;
}
.hamburger span {
  display: block; height: 2px; border-radius: 2px;
  background: var(--text);
  transition: all 0.2s;
}
.hamburger span:nth-child(2) { width: 70%; }

.topbar-title {
  font-family: 'Raleway', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

.notif-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative;
}
.notif-btn svg { width: 18px; height: 18px; stroke: var(--text2); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--white);
}

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--teal));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Raleway', sans-serif;
  font-size: 13px; font-weight: 700;
  color: white;
  cursor: pointer;
}

/* ── TABS ── */

.tabs-shell {
  position: relative;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.tabs {
  background: var(--white);
  display: flex;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 14px;
  scroll-behavior: smooth;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 1;
  min-width: 98px;
  padding: 36px 10px 20px;
  text-align: center;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.9px;
  text-transform: uppercase;
  user-select: none;
}

.tab.active {
  color: var(--indigo);
  border-bottom-color: var(--indigo);
  font-weight: 800;
}

.tab .tab-icon {
  font-size: 18px;
  line-height: 1;
  margin-bottom: 6px;
}

.tab .tab-icon i {
  display: inline-block;
}


.tabs-scroll-hint {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  height: calc(100% - 8px);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px 0 28px;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.92) 40%, rgba(255,255,255,1) 100%);
  color: var(--indigo);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  border: none;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.25s ease;
  z-index: 5;
}

.tabs-scroll-hint.hide {
  opacity: 0;
  pointer-events: none;
}

.tabs-scroll-hint svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: tabsHintMove 1.2s ease-in-out infinite;
}

.tabs-scroll-hint svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: tabsHintMove 1.2s ease-in-out infinite;
}

@keyframes tabsHintMove {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}




/* ── CONTENT ── */


.content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: none;
}

.content::-webkit-scrollbar {
  display: none;
}

html.standalone .content,
body.standalone .content {
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}


.section {
  display: none;
}

.section.active {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: min-content;
}

/* ── CARD ── */
.card {
  background: var(--white);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  animation: rise 0.3s ease both;
}
@keyframes rise {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:translateY(0); }
}

.card-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-label {
  font-size: 11px; font-weight: 700;
  color: var(--text2);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.card-action {
  font-size: 10px; font-weight: 600;
  color: var(--teal);
  cursor: pointer;
  letter-spacing: 0.3px;
}

/* ── HERO METRIC ── */
.hero-card {
  background: var(--white);
  border-radius: 20px;
  padding: 22px 20px 18px;
  box-shadow: var(--shadow-md);
  animation: rise 0.25s ease both;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,201,177,0.12), rgba(61,79,209,0.08));
}

.hero-period {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.hero-period-label {
  font-size: 11px; font-weight: 600;
  color: var(--text2);
}
.hero-period-select {
  font-size: 10px; font-weight: 700;
  color: var(--indigo);
  display: flex; align-items: center; gap: 3px;
  cursor: pointer;
}
.hero-period-select svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.5; }

.hero-sublabel {
  font-size: 10px; font-weight: 500;
  color: var(--muted);
  margin-bottom: 10px;
}

.hero-value {
  font-family: 'Raleway', sans-serif;
  font-size: 36px; font-weight: 300;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 8px;
}

.hero-delta {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 20px;
  margin-bottom: 16px;
}
.hero-delta.up   { background: rgba(0,201,177,0.12); color: var(--teal2); }
.hero-delta.down { background: var(--red-dim); color: var(--red); }
.hero-delta svg  { width: 10px; height: 10px; stroke: currentColor; fill: none; stroke-width: 2.5; }

/* ── MINI BAR CHART ── */
.mini-bars {
  display: flex; align-items: flex-end;
  gap: 5px; height: 56px;
  margin-bottom: 4px;
}
.mbar-group {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 2px;
}
.mbar {
  width: 100%; border-radius: 4px 4px 0 0;
  transition: height 0.6s cubic-bezier(0.34,1.2,0.64,1);
  cursor: pointer;
}
.mbar.income { background: linear-gradient(to top, var(--teal), rgba(0,201,177,0.6)); }
.mbar.expense { background: linear-gradient(to top, var(--indigo), rgba(61,79,209,0.5)); opacity: 0.6; }
.mbar.active-bar { opacity: 1 !important; }

.active-bar-label {
  background: var(--text);
  color: white;
  font-size: 8px; font-weight: 600;
  padding: 3px 6px; border-radius: 4px;
  white-space: nowrap;
  margin-bottom: 4px;
}

.chart-months {
  display: flex; gap: 5px;
}
.chart-month {
  flex: 1; text-align: center;
  font-size: 8px; font-weight: 600;
  color: var(--muted);
}
.chart-month.current { color: var(--text); }

.chart-legend {
  display: flex; gap: 14px; margin-top: 10px;
}
.legend-dot-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 500; color: var(--text2);
}
.ldot {
  width: 8px; height: 8px; border-radius: 2px;
}

/* ── KPI GRID ── */
.kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.kpi-card {
  background: var(--white);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  animation: rise 0.3s ease both;
  position: relative;
  overflow: hidden;
}

.kpi-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.kpi-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kpi-icon.teal   { background: var(--teal-dim); color: var(--teal2); }
.kpi-icon.red    { background: var(--red-dim);  color: var(--red); }
.kpi-icon.indigo { background: var(--indigo-dim); color: var(--indigo); }
.kpi-icon.amber  { background: var(--amber-dim); color: var(--amber); }

.kpi-num {
  font-family: 'Raleway', sans-serif;
  font-size: 22px; font-weight: 300;
  color: var(--text);
  line-height: 1; margin-bottom: 4px;
}
.kpi-name {
  font-size: 10px; font-weight: 600;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.kpi-delta-sm {
  position: absolute; top: 12px; right: 12px;
  font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 8px;
}
.kpi-delta-sm.up   { background: var(--teal-dim); color: var(--teal2); }
.kpi-delta-sm.down { background: var(--red-dim); color: var(--red); }

/* ── COMPARATIVO ── */
.comp-row {
  display: flex; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.comp-row:last-child { border-bottom: none; padding-bottom: 0; }

.comp-label { font-size: 12px; font-weight: 600; flex: 1; color: var(--text2); }
.comp-vals { display: flex; gap: 8px; align-items: center; }
.comp-cur {
  font-family: 'Roboto Mono', monospace;
  font-size: 12px; font-weight: 500; color: var(--text);
  min-width: 60px; text-align: right;
}
.comp-badge {
  font-size: 9px; font-weight: 700;
  padding: 2px 7px; border-radius: 10px;
  min-width: 46px; text-align: center;
}
.comp-badge.up   { background: var(--teal-dim); color: var(--teal2); }
.comp-badge.down { background: var(--red-dim); color: var(--red); }

/* ── GREETING ── */
.greeting {
  padding: 4px 0 2px;
  animation: rise 0.2s ease both;
}
.greeting-hello {
  font-size: 12px; font-weight: 500; color: var(--muted);
}
.greeting-name {
  font-family: 'Raleway', sans-serif;
  font-size: 22px; font-weight: 700; color: var(--text);
  margin-top: 1px;
}

/* ── COBROS ── */
.filter-row {
  display: flex; gap: 8px; flex-wrap: nowrap;
  overflow-x: auto; scrollbar-width: none;
  padding-bottom: 2px;
}
.filter-row::-webkit-scrollbar { display: none; }

.filter-chip {
  flex-shrink: 0;
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.filter-chip.active {
  background: var(--indigo);
  border-color: var(--indigo);
  color: white;
  box-shadow: 0 3px 12px rgba(61,79,209,0.25);
}

/* Stats strip */
.stats-strip {
  display: flex; gap: 8px;
}
.stat-pill {
  flex: 1;
  background: var(--white);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-pill-num {
  font-family: 'Raleway', sans-serif;
  font-size: 20px; font-weight: 300;
  color: var(--text); line-height: 1;
  margin-bottom: 3px;
}
.stat-pill-label {
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.stat-pill.teal   .stat-pill-num { color: var(--teal2); }
.stat-pill.red    .stat-pill-num { color: var(--red); }
.stat-pill.amber  .stat-pill-num { color: var(--amber); }
.stat-pill.teal   .stat-pill-label { color: var(--teal2); }
.stat-pill.red    .stat-pill-label { color: var(--red); }
.stat-pill.amber  .stat-pill-label { color: var(--amber); }

/* Cobro item */
.cobro-list { display: flex; flex-direction: column; gap: 8px; }

.cobro-card {
  background: var(--white);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  transition: all 0.15s;
  animation: rise 0.3s ease both;
}
.cobro-card:active { transform: scale(0.98); box-shadow: none; }

.cobro-avatar {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Raleway', sans-serif;
  font-size: 14px; font-weight: 700;
  flex-shrink: 0;
}
.cobro-avatar.pagado  { background: var(--teal-dim); color: var(--teal2); }
.cobro-avatar.moroso  { background: var(--red-dim); color: var(--red); }
.cobro-avatar.pendiente { background: var(--amber-dim); color: var(--amber); }

.cobro-info { flex: 1; min-width: 0; }
.cobro-nombre {
  font-size: 13px; font-weight: 700;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 2px;
}
.cobro-dir {
  font-size: 10px; font-weight: 500; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.cobro-right { text-align: right; flex-shrink: 0; }
.cobro-monto {
  font-family: 'Raleway', sans-serif;
  font-size: 16px; font-weight: 400;
  color: var(--text); margin-bottom: 4px;
}
.cobro-estado {
  font-size: 9px; font-weight: 700;
  padding: 2px 8px; border-radius: 8px;
  text-transform: uppercase; letter-spacing: 0.5px;
  display: inline-block;
}
.cobro-estado.pagado   { background: var(--teal-dim); color: var(--teal2); }
.cobro-estado.moroso   { background: var(--red-dim); color: var(--red); }
.cobro-estado.pendiente{ background: var(--amber-dim); color: var(--amber); }

/* ── LIQUIDACIONES ── */
.liq-hero {
  background: linear-gradient(135deg, var(--indigo), #5a6de8);
  border-radius: 20px;
  padding: 22px 20px;
  color: white;
  box-shadow: 0 8px 30px rgba(61,79,209,0.3);
  animation: rise 0.25s ease both;
  position: relative; overflow: hidden;
}
.liq-hero::after {
  content: '';
  position: absolute; bottom: -20px; right: -20px;
  width: 100px; height: 100px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.liq-hero-label {
  font-size: 10px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; opacity: 0.7; margin-bottom: 8px;
}
.liq-hero-amount {
  font-family: 'Raleway', sans-serif;
  font-size: 38px; font-weight: 200;
  letter-spacing: -1px; line-height: 1; margin-bottom: 6px;
}
.liq-hero-sub {
  font-size: 11px; font-weight: 500; opacity: 0.7;
}
.liq-hero-row {
  display: flex; justify-content: space-between;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.2);
}
.liq-hero-item { text-align: center; }
.liq-hero-item-val {
  font-family: 'Raleway', sans-serif;
  font-size: 16px; font-weight: 400;
}
.liq-hero-item-label {
  font-size: 9px; font-weight: 600;
  opacity: 0.6; text-transform: uppercase; letter-spacing: 1px;
  margin-top: 2px;
}

.liq-item-card {
  background: var(--white);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  animation: rise 0.3s ease both;
}
.liq-item-top {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 12px;
}
.liq-item-name {
  font-size: 14px; font-weight: 700; color: var(--text);
}
.liq-item-props {
  font-size: 10px; font-weight: 500; color: var(--muted); margin-top: 2px;
}
.liq-item-amount {
  font-family: 'Raleway', sans-serif;
  font-size: 20px; font-weight: 300; color: var(--text);
}
.liq-item-hon {
  font-size: 10px; font-weight: 500; color: var(--muted); margin-top: 1px; text-align: right;
}
.liq-progress-track {
  height: 5px; background: var(--border); border-radius: 5px; overflow: hidden; margin-bottom: 10px;
}
.liq-progress-fill {
  height: 100%; border-radius: 5px;
  background: linear-gradient(to right, var(--teal), var(--indigo));
  transition: width 1s cubic-bezier(0.34,1.2,0.64,1);
}
.liq-item-footer {
  display: flex; justify-content: space-between; align-items: center;
}
.liq-pct {
  font-size: 11px; font-weight: 700;
  color: var(--teal2);
}
.btn-wpp-clean {
  display: flex; align-items: center; gap: 6px;
  background: #f0fdf4;
  color: #16a34a;
  border: none; border-radius: 8px;
  padding: 7px 12px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px; font-weight: 700;
  cursor: pointer; transition: all 0.15s;
}
.btn-wpp-clean svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-wpp-clean:active { transform: scale(0.97); }

/* ── NOTIFICACIONES ── */
.notif-card {
  background: var(--white);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex; gap: 12px; align-items: flex-start;
  animation: rise 0.3s ease both;
  cursor: pointer;
  transition: all 0.15s;
}
.notif-card.unread {
  border-left: 3px solid var(--indigo);
}
.notif-card:active { transform: scale(0.99); }

.notif-ico {
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.notif-ico svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notif-ico.wpp   { background: #dcfce7; color: #16a34a; }
.notif-ico.alert { background: var(--red-dim); color: var(--red); }
.notif-ico.ok    { background: var(--teal-dim); color: var(--teal2); }
.notif-ico.info  { background: var(--indigo-dim); color: var(--indigo); }

.notif-body { flex: 1; min-width: 0; }
.notif-title {
  font-size: 12px; font-weight: 700; color: var(--text);
  margin-bottom: 3px;
}
.notif-desc {
  font-size: 11px; font-weight: 400; color: var(--text2);
  line-height: 1.4;
}
.notif-meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.notif-time {
  font-family: 'Roboto Mono', monospace;
  font-size: 9px; color: var(--muted); white-space: nowrap;
}
.notif-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--indigo);
}

/* ── REPORTES ── */
.donut-card {
  background: var(--white);
  border-radius: 16px; padding: 18px;
  box-shadow: var(--shadow-sm);
  animation: rise 0.3s ease both;
}
.donut-wrap {
  display: flex; gap: 16px; align-items: center; margin-bottom: 14px;
}
.donut-svg-wrap {
  position: relative; width: 88px; height: 88px; flex-shrink: 0;
}
.donut-svg-wrap svg { width: 88px; height: 88px; transform: rotate(-90deg); }
.donut-center-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.donut-pct {
  font-family: 'Raleway', sans-serif;
  font-size: 20px; font-weight: 300; color: var(--text);
}
.donut-sub-text {
  font-size: 8px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
}
.donut-legend-list { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.legend-row {
  display: flex; align-items: center; gap: 8px;
}
.legend-square {
  width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0;
}
.legend-name { flex: 1; font-size: 11px; font-weight: 500; color: var(--text2); }
.legend-pct {
  font-family: 'Roboto Mono', monospace;
  font-size: 11px; font-weight: 500; color: var(--text);
}

.flujo-row {
  margin-bottom: 12px;
}
.flujo-top {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;
}
.flujo-label { font-size: 11px; font-weight: 600; color: var(--text2); }
.flujo-val {
  font-family: 'Roboto Mono', monospace;
  font-size: 13px; font-weight: 500;
}
.flujo-val.inc { color: var(--teal2); }
.flujo-val.exp { color: var(--red); }
.flujo-track {
  height: 6px; background: var(--bg); border-radius: 6px; overflow: hidden;
}
.flujo-fill {
  height: 100%; border-radius: 6px;
}
.flujo-fill.inc { background: linear-gradient(to right, var(--teal), var(--teal2)); }
.flujo-fill.exp { background: linear-gradient(to right, var(--red), #f87171); }

.flujo-neto {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg);
  border-radius: 10px; padding: 12px 14px;
  margin-top: 14px;
}
.flujo-neto-label { font-size: 12px; font-weight: 700; color: var(--text); }
.flujo-neto-val {
  font-family: 'Raleway', sans-serif;
  font-size: 22px; font-weight: 300; color: var(--teal2);
}

/* ── MODAL WPP ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15,27,45,0.4);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.open { opacity:1; pointer-events:all; }

.modal {
  background: var(--white);
  border-radius: 24px 24px 0 0;
  padding: 24px 20px 40px;
  width: 100%;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34,1.2,0.64,1);
  box-shadow: 0 -8px 40px rgba(15,27,45,0.15);
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-handle {
  width: 36px; height: 4px;
  background: var(--border); border-radius: 4px;
  margin: 0 auto 20px;
}

.modal-title {
  font-family: 'Raleway', sans-serif;
  font-size: 20px; font-weight: 300;
  letter-spacing: 2px; color: var(--text);
  margin-bottom: 4px;
}
.modal-sub {
  font-size: 11px; font-weight: 500; color: var(--muted);
  margin-bottom: 18px;
}

.wpp-bubble-wrap {
  background: var(--bg);
  border-radius: 14px; padding: 14px; margin-bottom: 16px;
}
.wpp-from {
  font-size: 10px; font-weight: 700; color: var(--indigo);
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.wpp-from-dot { width: 7px; height: 7px; border-radius: 50%; background: #16a34a; }
.wpp-bubble {
  background: var(--white);
  border-radius: 4px 14px 14px 14px;
  padding: 12px 14px;
  font-size: 12px; line-height: 1.6; color: var(--text);
  box-shadow: var(--shadow-sm);
}
.wpp-tick {
  font-size: 10px; color: var(--muted);
  text-align: right; margin-top: 6px;
}

.btn-send {
  width: 100%; background: var(--indigo);
  color: white; border: none; border-radius: 12px;
  padding: 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px; font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(61,79,209,0.3);
}
.btn-send:active { transform: scale(0.97); }

.btn-cancel {
  width: 100%; background: transparent;
  color: var(--muted); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 12px;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px; font-weight: 600;
  cursor: pointer; margin-top: 10px;
}

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text); color: white;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px; font-weight: 700;
  padding: 12px 22px; border-radius: 30px;
  z-index: 300; transition: transform 0.4s cubic-bezier(0.34,1.4,0.64,1);
  white-space: nowrap; letter-spacing: 0.5px;
  box-shadow: 0 4px 20px rgba(15,27,45,0.25);
}
.toast.show { transform: translateX(-50%) translateY(0); }


/* ── TAB SIMULADOR highlight ── */
.tab.tab-sim { color: var(--indigo); font-weight: 800; }
.tab.tab-sim.active { color: var(--white); background: var(--indigo); border-radius: 8px 8px 0 0; border-bottom-color: var(--indigo); }

/* ── SIMULADOR ── */
.sim-hero {
  background: linear-gradient(150deg, #0f1b2d 0%, #1a2a6c 60%, #3d4fd1 100%);
  border-radius: 20px;
  padding: 24px 20px 20px;
  color: white;
  box-shadow: 0 8px 40px rgba(61,79,209,0.35);
  animation: rise 0.25s ease both;
  position: relative; overflow: hidden;
}
.sim-hero::before {
  content: '';
  position: absolute; top: -40px; right: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(0,201,177,0.12);
}
.sim-hero::after {
  content: '';
  position: absolute; bottom: -30px; left: -30px;
  width: 100px; height: 100px; border-radius: 50%;
  background: rgba(255,255,255,0.05);
}

.sim-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,201,177,0.2);
  border: 1px solid rgba(0,201,177,0.4);
  color: #00c9b1;
  font-size: 9px; font-weight: 700; letter-spacing: 2px;
  padding: 4px 10px; border-radius: 20px;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.sim-badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #00c9b1;
  animation: blink-dot 1.4s ease infinite;
}
@keyframes blink-dot { 0%,80%,100%{opacity:.3} 40%{opacity:1} }

.sim-hero-title {
  font-family: 'Raleway', sans-serif;
  font-size: 13px; font-weight: 400;
  opacity: 0.7; margin-bottom: 4px;
}
.sim-hero-amount {
  font-family: 'Raleway', sans-serif;
  font-size: 42px; font-weight: 200;
  letter-spacing: -1px; line-height: 1;
  margin-bottom: 16px;
}
.sim-contract-row {
  display: flex; gap: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.sim-contract-pill {
  flex: 1; background: rgba(255,255,255,0.1);
  border-radius: 10px; padding: 8px 10px;
}
.sim-contract-label {
  font-size: 8px; font-weight: 700; letter-spacing: 1px;
  opacity: 0.6; text-transform: uppercase; margin-bottom: 3px;
}
.sim-contract-val {
  font-family: 'Roboto Mono', monospace;
  font-size: 11px; font-weight: 500;
}

/* ── FLOW DIAGRAM ── */
.flow-card {
  background: var(--white);
  border-radius: 20px; padding: 20px;
  box-shadow: var(--shadow-md);
  animation: rise 0.3s ease both;
}
.flow-title {
  font-size: 11px; font-weight: 700; color: var(--text2);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 20px; text-align: center;
}

.flow-nodes {
  display: flex; flex-direction: column;
  align-items: center; gap: 0;
}

.flow-node {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--bg);
  border: 2px solid transparent;
  transition: all 0.4s cubic-bezier(0.34,1.2,0.64,1);
  position: relative;
}
.flow-node.active-node {
  background: var(--white);
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(0,201,177,0.12), var(--shadow-md);
  transform: scale(1.02);
}
.flow-node.done-node {
  background: rgba(0,201,177,0.06);
  border-color: rgba(0,201,177,0.3);
}
.flow-node.error-node {
  border-color: var(--red);
  box-shadow: 0 0 0 4px var(--red-dim);
}

.flow-node-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 20px;
  transition: all 0.3s;
}
.flow-node-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.fni-bank   { background: var(--indigo-dim); color: var(--indigo); }
.fni-spot   { background: var(--teal-dim); color: var(--teal2); }
.fni-prop   { background: rgba(245,158,11,0.12); color: var(--amber); }
.fni-inmob  { background: rgba(139,92,246,0.12); color: #8b5cf6; }
.fni-afip   { background: var(--red-dim); color: var(--red); }
.fni-ok     { background: rgba(0,201,177,0.15); color: var(--teal2); }

.flow-node-info { flex: 1; min-width: 0; }
.flow-node-name {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin-bottom: 2px;
}
.flow-node-desc {
  font-size: 10px; font-weight: 500; color: var(--muted);
}
.flow-node-amount {
  font-family: 'Raleway', sans-serif;
  font-size: 16px; font-weight: 400;
  color: var(--text); text-align: right;
  opacity: 0; transition: opacity 0.4s;
  flex-shrink: 0;
}
.flow-node.done-node .flow-node-amount { opacity: 1; color: var(--teal2); }
.flow-node.active-node .flow-node-amount { opacity: 1; }

.flow-check {
  position: absolute; top: 8px; right: 8px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--teal); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  opacity: 0; transform: scale(0);
  transition: all 0.3s cubic-bezier(0.34,1.4,0.64,1);
}
.flow-node.done-node .flow-check {
  opacity: 1; transform: scale(1);
}

/* Connector line */
.flow-connector {
  width: 2px; height: 18px;
  background: var(--border);
  transition: background 0.5s;
  margin: 2px 0;
}
.flow-connector.lit { background: var(--teal); }

/* ── PROGRESS BAR ── */
.sim-progress-wrap {
  margin: 16px 0 8px;
}
.sim-progress-label {
  display: flex; justify-content: space-between;
  font-size: 10px; font-weight: 600; color: var(--muted);
  margin-bottom: 6px;
}
.sim-progress-track {
  height: 6px; background: var(--border); border-radius: 6px; overflow: hidden;
}
.sim-progress-fill {
  height: 100%; border-radius: 6px;
  background: linear-gradient(to right, var(--teal), var(--indigo));
  width: 0%; transition: width 0.6s ease;
}

/* ── BTN SIMULAR ── */
.btn-simular {
  width: 100%; padding: 16px;
  background: linear-gradient(135deg, var(--indigo), #5a6de8);
  color: white; border: none; border-radius: 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px; font-weight: 800;
  letter-spacing: 1.5px; text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(61,79,209,0.35);
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  animation: rise 0.35s ease both;
}
.btn-simular:active { transform: scale(0.97); box-shadow: none; }
.btn-simular:disabled {
  background: var(--border); color: var(--muted);
  box-shadow: none; cursor: default;
}
.btn-simular svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ── SUCCESS CARD ── */
.success-card {
  background: linear-gradient(135deg, #f0fdf8, #e8f8f4);
  border: 1.5px solid rgba(0,201,177,0.3);
  border-radius: 16px; padding: 20px;
  text-align: center;
  display: none;
  animation: rise 0.4s cubic-bezier(0.34,1.2,0.64,1) both;
}
.success-card.show { display: block; }
.success-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--teal-dim); color: var(--teal2);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  font-size: 26px;
}
.success-icon svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.success-title {
  font-family: 'Raleway', sans-serif;
  font-size: 22px; font-weight: 300; color: var(--teal2);
  margin-bottom: 4px;
}
.success-sub {
  font-size: 11px; font-weight: 500; color: var(--text2); margin-bottom: 16px;
}
.success-chips {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
}
.success-chip {
  background: white; border: 1px solid rgba(0,201,177,0.25);
  border-radius: 20px; padding: 4px 12px;
  font-size: 10px; font-weight: 700; color: var(--teal2);
}

/* ── TIMELINE WPP ── */
.wpp-timeline {
  background: var(--white); border-radius: 16px;
  padding: 18px; box-shadow: var(--shadow-sm);
  display: none; animation: rise 0.4s ease both;
}
.wpp-timeline.show { display: block; }
.wpp-timeline-title {
  font-size: 10px; font-weight: 700; color: var(--text2);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px;
}
.wpp-msg {
  display: flex; gap: 10px; margin-bottom: 10px; align-items: flex-start;
  opacity: 0; transform: translateY(8px);
  transition: all 0.4s ease;
}
.wpp-msg.visible { opacity: 1; transform: translateY(0); }
.wpp-msg-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.wpp-msg-avatar.spot { background: linear-gradient(135deg, var(--indigo), var(--teal)); }
.wpp-msg-avatar.prop { background: var(--amber); }
.wpp-msg-avatar.inq  { background: #8b5cf6; }
.wpp-msg-bubble {
  background: var(--bg); border-radius: 4px 14px 14px 14px;
  padding: 8px 12px; flex: 1;
  font-size: 11px; line-height: 1.5; color: var(--text);
}
.wpp-msg-time {
  font-size: 9px; color: var(--muted); text-align: right; margin-top: 4px;
}
.wpp-msg.right { flex-direction: row-reverse; }
.wpp-msg.right .wpp-msg-bubble {
  border-radius: 14px 4px 14px 14px;
  background: rgba(61,79,209,0.08);
}

.btn-reset {
  width: 100%; padding: 13px;
  background: transparent; border: 1.5px solid var(--border);
  border-radius: 12px; color: var(--text2);
  font-family: 'Montserrat', sans-serif;
  font-size: 12px; font-weight: 600;
  cursor: pointer; margin-top: 8px;
  transition: all 0.2s;
}
.btn-reset:hover { border-color: var(--indigo); color: var(--indigo); }


/* ══════════════════════════════
   ONBOARDING
══════════════════════════════ */
#onboarding {
  position: fixed; inset: 0; z-index: 500;
  background: #0f1b2d;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.ob-slides {
  flex: 1; display: flex;
  transition: transform 0.5s cubic-bezier(0.77,0,0.18,1);
}

.ob-slide {
  min-width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 32px;
  position: relative; overflow: hidden;
}

/* slide backgrounds */
.ob-slide-1 { background: linear-gradient(160deg,#0f1b2d 0%,#1a2a6c 100%); }
.ob-slide-2 { background: linear-gradient(160deg,#0a1628 0%,#003d38 100%); }
.ob-slide-3 { background: linear-gradient(160deg,#1a0a2e 0%,#3d1fa0 100%); }

/* decorative blobs */
.ob-blob {
  position: absolute; border-radius: 50%;
  filter: blur(60px); opacity: 0.25; pointer-events: none;
}
.ob-blob-1 { width:220px;height:220px;background:#3d4fd1;top:-60px;right:-60px; }
.ob-blob-2 { width:160px;height:160px;background:#00c9b1;bottom:-40px;left:-40px; }
.ob-blob-3 { width:200px;height:200px;background:#00c9b1;top:-50px;left:-50px; }
.ob-blob-4 { width:180px;height:180px;background:#3d4fd1;bottom:-40px;right:-40px; }
.ob-blob-5 { width:200px;height:200px;background:#8b5cf6;top:-60px;right:-60px; }
.ob-blob-6 { width:160px;height:160px;background:#3d4fd1;bottom:-30px;left:-30px; }

.ob-eyebrow {
  font-family:'Montserrat',sans-serif;
  font-size:16px;font-weight:800;letter-spacing:4px;
  color:rgba(229, 231, 233, 0.861);
  margin-bottom:28px;
}

/* icon illustration */
.ob-icon-wrap {
  width:100px;height:100px;border-radius:28px;
  display:flex;align-items:center;justify-content:center;
  margin-bottom:28px;
  position:relative;
}
.ob-icon-wrap svg { width:48px;height:48px;stroke:currentColor;fill:none;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round; }
.obi-1 { background:rgba(61,79,209,0.3);border:1.5px solid rgba(61,79,209,0.5);color:#7c8ef5; }
.obi-2 { background:rgba(0,201,177,0.25);border:1.5px solid rgba(0,201,177,0.4);color:#00c9b1; }
.obi-3 { background:rgba(139,92,246,0.3);border:1.5px solid rgba(139,92,246,0.5);color:#a78bfa; }

/* pulse ring */
.ob-icon-wrap::after {
  content:'';position:absolute;inset:-10px;border-radius:38px;
  border:1.5px solid rgba(255,255,255,0.1);
  animation:ob-pulse 2s ease-in-out infinite;
}
@keyframes ob-pulse { 0%,100%{transform:scale(1);opacity:.5} 50%{transform:scale(1.06);opacity:.15} }

.ob-title {
  font-family:'Raleway',sans-serif;
  font-size:30px;font-weight:300;color:white;
  text-align:center;line-height:1.2;margin-bottom:16px;
}
.ob-title strong { font-weight:700; }

.ob-desc {
  font-family:'Montserrat',sans-serif;
  font-size:13px;font-weight:400;
  color:rgba(255,255,255,0.6);
  text-align:center;line-height:1.7;
  max-width:300px;
}
.ob-desc strong { color:rgba(255,255,255,0.9);font-weight:600; }

/* mini flow pills on slide 2 */
.ob-flow {
  display:flex;align-items:center;gap:6px;
  margin-top:20px;flex-wrap:wrap;justify-content:center;
}
.ob-pill {
  background:rgba(255,255,255,0.1);
  border:1px solid rgba(255,255,255,0.2);
  border-radius:20px;padding:5px 12px;
  font-size:10px;font-weight:700;color:white;
}
.ob-arrow { color:rgba(255,255,255,0.4);font-size:12px; }

/* stat chips on slide 3 */
.ob-stats {
  display:flex;gap:12px;margin-top:20px;
}
.ob-stat {
  flex:1;background:rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.15);
  border-radius:14px;padding:12px 8px;text-align:center;
}
.ob-stat-num {
  font-family:'Raleway',sans-serif;
  font-size:22px;font-weight:300;color:white;
}
.ob-stat-label {
  font-size:9px;font-weight:700;
  color:rgba(255,255,255,0.5);
  text-transform:uppercase;letter-spacing:1px;
  margin-top:3px;
}

/* bottom nav */
.ob-bottom {
  padding:24px 32px 40px;
  display:flex;align-items:center;justify-content:space-between;
  flex-shrink:0;
}

.ob-dots { display:flex;gap:6px; }
.ob-dot {
  width:6px;height:6px;border-radius:3px;
  background:rgba(255,255,255,0.25);
  transition:all 0.3s;cursor:pointer;
}
.ob-dot.active { width:20px;background:white; }

.ob-skip {
  font-family:'Montserrat',sans-serif;
  font-size:11px;font-weight:600;
  color:rgba(255,255,255,0.4);
  cursor:pointer;padding:8px 0;
  transition:color 0.2s;
}
.ob-skip:hover { color:rgba(255,255,255,0.8); }

.ob-next {
  width:48px;height:48px;border-radius:50%;
  background:white;color:#0f1b2d;
  border:none;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 4px 20px rgba(0,0,0,0.3);
  transition:all 0.2s;
}
.ob-next:active { transform:scale(0.93); }
.ob-next svg { width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round; }

.ob-enter-btn {
  background:white;color:#0f1b2d;
  border:none;border-radius:14px;
  padding:16px 36px;
  font-family:'Montserrat',sans-serif;
  font-size:14px;font-weight:800;letter-spacing:1px;
  cursor:pointer;
  box-shadow:0 6px 24px rgba(0,0,0,0.3);
  transition:all 0.2s;display:none;
}
.ob-enter-btn:active { transform:scale(0.97); }

/* ══════════════════════════════
   SIGNIA TAB
══════════════════════════════ */
.tab.tab-signia { color:#8b5cf6;font-weight:800; }
.tab.tab-signia.active {
  color:white;background:#8b5cf6;
  border-radius:8px 8px 0 0;border-bottom-color:#8b5cf6;
}

/* Signia hero */
.sig-hero {
  background:linear-gradient(150deg,#1a0a2e 0%,#2d1060 60%,#5b21b6 100%);
  border-radius:20px;padding:22px 20px;color:white;
  box-shadow:0 8px 40px rgba(91,33,182,0.4);
  animation:rise 0.25s ease both;position:relative;overflow:hidden;
}
.sig-hero::before {
  content:'';position:absolute;top:-40px;right:-40px;
  width:160px;height:160px;border-radius:50%;
  background:rgba(139,92,246,0.2);
}
.sig-badge {
  display:inline-flex;align-items:center;gap:6px;
  background:rgba(167,139,250,0.2);
  border:1px solid rgba(167,139,250,0.4);
  color:#a78bfa;font-size:9px;font-weight:700;letter-spacing:2px;
  padding:4px 10px;border-radius:20px;
  margin-bottom:14px;text-transform:uppercase;
}
.sig-hero-title {
  font-family:'Raleway',sans-serif;
  font-size:13px;font-weight:400;opacity:0.7;margin-bottom:4px;
}
.sig-hero-name {
  font-family:'Raleway',sans-serif;
  font-size:26px;font-weight:300;margin-bottom:6px;
}
.sig-hero-sub {
  font-size:11px;font-weight:500;opacity:0.6;
}
.sig-hero-row {
  display:flex;gap:8px;margin-top:16px;
  padding-top:14px;border-top:1px solid rgba(255,255,255,0.15);
}
.sig-pill {
  flex:1;background:rgba(255,255,255,0.1);
  border-radius:10px;padding:8px 10px;
}
.sig-pill-label {
  font-size:8px;font-weight:700;letter-spacing:1px;
  opacity:0.6;text-transform:uppercase;margin-bottom:3px;
}
.sig-pill-val {
  font-family:'Roboto Mono',monospace;
  font-size:10px;font-weight:500;
}

/* Document viewer */
.sig-doc-card {
  background:white;border-radius:16px;
  box-shadow:var(--shadow-md);
  animation:rise 0.3s ease both;overflow:hidden;
}
.sig-doc-header {
  background:var(--bg);padding:12px 16px;
  display:flex;align-items:center;gap:10px;
  border-bottom:1px solid var(--border);
}
.sig-doc-icon {
  width:32px;height:32px;border-radius:8px;
  background:rgba(139,92,246,0.12);color:#8b5cf6;
  display:flex;align-items:center;justify-content:center;
}
.sig-doc-icon svg { width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round; }
.sig-doc-title { font-size:12px;font-weight:700;color:var(--text); }
.sig-doc-sub { font-size:10px;font-weight:500;color:var(--muted);margin-top:1px; }
.sig-doc-status {
  margin-left:auto;font-size:9px;font-weight:700;
  padding:3px 8px;border-radius:20px;
  background:var(--amber-dim);color:var(--amber);
}
.sig-doc-status.signed { background:var(--teal-dim);color:var(--teal2); }

.sig-doc-body { padding:16px; }
.sig-doc-text {
  font-size:10px;line-height:1.7;color:var(--text2);
  margin-bottom:14px;
}
.sig-doc-text strong { color:var(--text);font-weight:700; }

.sig-fields {
  display:flex;flex-direction:column;gap:8px;margin-bottom:14px;
}
.sig-field {
  background:var(--bg);border-radius:8px;padding:8px 12px;
  display:flex;justify-content:space-between;
}
.sig-field-label {
  font-size:9px;font-weight:700;color:var(--muted);
  text-transform:uppercase;letter-spacing:.5px;
}
.sig-field-val { font-size:11px;font-weight:600;color:var(--text); }

/* Signature pad */
.sig-pad-wrap {
  border:2px dashed var(--border);border-radius:12px;
  padding:16px;text-align:center;margin-bottom:12px;
  transition:all 0.3s;cursor:pointer;
  position:relative;overflow:hidden;
  min-height:90px;
  display:flex;flex-direction:column;
  align-items:center;justify-content:center;
}
.sig-pad-wrap.signing {
  border-color:#8b5cf6;
  background:rgba(139,92,246,0.04);
}
.sig-pad-wrap.signed-pad {
  border-color:var(--teal);border-style:solid;
  background:rgba(0,201,177,0.04);
}
.sig-pad-label {
  font-size:11px;font-weight:600;color:var(--muted);margin-top:6px;
}
.sig-pad-icon {
  width:36px;height:36px;border-radius:10px;
  background:rgba(139,92,246,0.1);color:#8b5cf6;
  display:flex;align-items:center;justify-content:center;margin:0 auto;
}
.sig-pad-icon svg { width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round; }

canvas#sigCanvas {
  display:none;width:100%;height:70px;
  border-radius:8px;touch-action:none;
}

.sig-handwriting {
  display:none;
  font-family:'Raleway',sans-serif;
  font-size:28px;font-weight:300;
  color:#8b5cf6;letter-spacing:2px;
  animation:sig-write 0.8s ease both;
}
@keyframes sig-write {
  from { opacity:0;clip-path:inset(0 100% 0 0); }
  to   { opacity:1;clip-path:inset(0 0% 0 0); }
}

/* Token modal */
.token-overlay {
  position:fixed;inset:0;z-index:300;
  background:rgba(15,27,45,0.5);backdrop-filter:blur(4px);
  display:flex;align-items:center;justify-content:center;
  padding:32px;
  opacity:0;pointer-events:none;transition:opacity 0.25s;
}
.token-overlay.open { opacity:1;pointer-events:all; }
.token-card {
  background:white;border-radius:20px;padding:28px 24px;
  width:100%;max-width:320px;text-align:center;
  box-shadow:var(--shadow-lg);
  transform:scale(0.9);transition:transform 0.3s cubic-bezier(0.34,1.4,0.64,1);
}
.token-overlay.open .token-card { transform:scale(1); }
.token-phone-icon {
  width:56px;height:56px;border-radius:16px;
  background:rgba(139,92,246,0.1);color:#8b5cf6;
  display:flex;align-items:center;justify-content:center;
  margin:0 auto 14px;
}
.token-phone-icon svg { width:28px;height:28px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round; }
.token-title {
  font-family:'Raleway',sans-serif;
  font-size:20px;font-weight:300;color:var(--text);margin-bottom:4px;
}
.token-sub { font-size:11px;font-weight:500;color:var(--muted);margin-bottom:20px; }
.token-digits {
  display:flex;justify-content:center;gap:8px;margin-bottom:20px;
}
.token-digit {
  width:44px;height:52px;border-radius:10px;
  background:var(--bg);border:2px solid var(--border);
  display:flex;align-items:center;justify-content:center;
  font-family:'Roboto Mono',monospace;
  font-size:22px;font-weight:500;color:var(--text);
  transition:all 0.2s;
}
.token-digit.filled {
  border-color:#8b5cf6;background:rgba(139,92,246,0.06);
  animation:pop 0.2s cubic-bezier(0.34,1.6,0.64,1);
}
@keyframes pop { 0%{transform:scale(0.8)} 100%{transform:scale(1)} }
.btn-token-confirm {
  width:100%;background:#8b5cf6;color:white;
  border:none;border-radius:12px;padding:14px;
  font-family:'Montserrat',sans-serif;
  font-size:13px;font-weight:800;letter-spacing:1px;
  cursor:pointer;transition:all 0.2s;
  box-shadow:0 4px 20px rgba(139,92,246,0.35);
}
.btn-token-confirm:active { transform:scale(0.97); }
.btn-token-confirm:disabled {
  background:var(--border);color:var(--muted);box-shadow:none;cursor:default;
}

/* Signed confirmation */
.sig-confirmed {
  background:linear-gradient(135deg,#f5f3ff,#ede9fe);
  border:1.5px solid rgba(139,92,246,0.3);
  border-radius:16px;padding:20px;text-align:center;
  display:none;animation:rise 0.4s cubic-bezier(0.34,1.2,0.64,1) both;
}
.sig-confirmed.show { display:block; }
.sig-confirmed-icon {
  width:56px;height:56px;border-radius:50%;
  background:rgba(139,92,246,0.15);color:#8b5cf6;
  display:flex;align-items:center;justify-content:center;
  margin:0 auto 12px;
}
.sig-confirmed-icon svg { width:28px;height:28px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round; }
.sig-confirmed-title {
  font-family:'Raleway',sans-serif;
  font-size:22px;font-weight:300;color:#7c3aed;margin-bottom:4px;
}
.sig-confirmed-sub {
  font-size:11px;font-weight:500;color:var(--text2);margin-bottom:14px;
}
.sig-cert {
  background:white;border-radius:10px;padding:12px 14px;
  text-align:left;border:1px solid rgba(139,92,246,0.2);
}
.sig-cert-row {
  display:flex;justify-content:space-between;align-items:center;
  padding:5px 0;border-bottom:1px solid var(--border);
  font-size:10px;
}
.sig-cert-row:last-child { border-bottom:none; }
.sig-cert-label { font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.5px; }
.sig-cert-val { font-family:'Roboto Mono',monospace;font-weight:500;color:var(--text); }
.sig-cert-val.valid { color:var(--teal2);font-weight:700; }


/* ══ FINGERPRINT BANNER ══ */
#fpBanner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  background: linear-gradient(135deg, var(--indigo), #5a6de8);
  color: white; padding: 10px 16px;
  display: flex; align-items: center; gap: 10px;
  transform: translateY(-100%);
  transition: transform 0.5s cubic-bezier(0.34,1.2,0.64,1);
  box-shadow: 0 4px 20px rgba(61,79,209,0.3);
}
#fpBanner.show { transform: translateY(0); }
.fp-banner-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.fp-banner-icon svg { width: 16px; height: 16px; stroke: white; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fp-banner-text { flex: 1; }
.fp-banner-title { font-size: 12px; font-weight: 700; }
.fp-banner-sub { font-size: 10px; opacity: 0.8; margin-top: 1px; }
.fp-banner-close {
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255,255,255,0.2); border: none; color: white;
  font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ══ WELCOME BACK OVERLAY ══ */
#welcomeBack {
  position: fixed; inset: 0; z-index: 600;
  background: linear-gradient(160deg, #0f1b2d, #1a2a6c);
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px; text-align: center;
}
#welcomeBack.show { display: flex; }
.wb-icon {
  width: 80px; height: 80px; border-radius: 24px;
  background: rgba(0,201,177,0.2); border: 1.5px solid rgba(0,201,177,0.4);
  color: #00c9b1;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  animation: ob-pulse 2s ease-in-out infinite;
}
.wb-icon svg { width: 40px; height: 40px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.wb-hello {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 3px;
  color: rgba(255,255,255,0.5); text-transform: uppercase;
  margin-bottom: 10px;
}
.wb-title {
  font-family: 'Raleway', sans-serif;
  font-size: 28px; font-weight: 300; color: white;
  margin-bottom: 8px; line-height: 1.3;
}
.wb-title strong { font-weight: 700; color: #00c9b1; }
.wb-sub {
  font-size: 12px; font-weight: 500;
  color: rgba(255,255,255,0.5); margin-bottom: 32px;
}
.wb-chip {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px; padding: 6px 14px;
  font-family: 'Roboto Mono', monospace;
  font-size: 10px; color: rgba(255,255,255,0.6);
  margin-bottom: 24px;
}
.btn-wb-enter {
  background: white; color: #0f1b2d;
  border: none; border-radius: 14px;
  padding: 16px 40px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px; font-weight: 800; letter-spacing: 1px;
  cursor: pointer; box-shadow: 0 6px 24px rgba(0,0,0,0.3);
  transition: all 0.2s;
}
.btn-wb-enter:active { transform: scale(0.97); }

/* ══ INSTALL PWA BUTTON ══ */
.install-card {
  background: white; border-radius: 16px;
  padding: 16px; box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--indigo-dim);
  display: flex; gap: 12px; align-items: center;
  flex-shrink: 0;
}
.install-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--indigo-dim); color: var(--indigo);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.install-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.install-info { flex: 1; }
.install-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.install-sub { font-size: 10px; font-weight: 500; color: var(--muted); }
.btn-install {
  background: var(--indigo); color: white;
  border: none; border-radius: 10px; padding: 8px 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  cursor: pointer; transition: all 0.2s; flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(61,79,209,0.3);
}
.btn-install:active { transform: scale(0.96); }

/* iOS install instructions */
.ios-instructions {
  background: var(--bg); border-radius: 12px; padding: 14px;
  margin-top: 10px; display: none;
  border: 1px solid var(--border);
}
.ios-instructions.show { display: block; }
.ios-step {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 500; color: var(--text2);
}
.ios-step:last-child { border-bottom: none; }
.ios-step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--indigo); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; flex-shrink: 0;
}
.ios-step strong { color: var(--text); }

/* ══ SESSION CHIP in topbar ══ */
.session-chip {
  font-family: 'Roboto Mono', monospace;
  font-size: 9px; font-weight: 500;
  color: var(--teal2);
  background: var(--teal-dim);
  padding: 3px 8px; border-radius: 20px;
  display: none;
}


html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Montserrat', sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}

html.standalone,
body.standalone {
  background: var(--bg);
}


/* ══════════════════════════════
   ESCALA MÁS GRANDE PARA CELU / PWA
══════════════════════════════ */
@media (max-width: 480px) {
  html.standalone .topbar,
  body.standalone .topbar {
    padding-top: calc(16px + env(safe-area-inset-top));
    padding-left: calc(22px + env(safe-area-inset-left));
    padding-right: calc(22px + env(safe-area-inset-right));
    padding-bottom: 14px;
  }

  html.standalone .topbar-title,
  body.standalone .topbar-title {
    font-size: 22px;
  }

  html.standalone .notif-btn,
  html.standalone .avatar,
  body.standalone .notif-btn,
  body.standalone .avatar {
    width: 40px;
    height: 40px;
  }

  html.standalone .notif-btn svg,
  body.standalone .notif-btn svg {
    width: 20px;
    height: 20px;
  }

  html.standalone .avatar,
  body.standalone .avatar {
    font-size: 15px;
  }

  html.standalone .session-chip,
  body.standalone .session-chip {
    font-size: 10px;
    padding: 4px 9px;
  }

  html.standalone .tabs,
  body.standalone .tabs {
    padding: 0 10px;
  }

  html.standalone .tab,
  body.standalone .tab {
    min-width: 76px;
    font-size: 10px;
    padding: 14px 5px 12px;
  }

  html.standalone .tab-icon svg,
  body.standalone .tab-icon svg {
    width: 20px;
    height: 20px;
  }

  html.standalone .content,
  body.standalone .content {
    padding-top: 20px;
    gap: 16px;
  }

  html.standalone .greeting-hello,
  body.standalone .greeting-hello {
    font-size: 14px;
  }

  html.standalone .greeting-name,
  body.standalone .greeting-name {
    font-size: 30px;
  }

  html.standalone .hero-card,
  body.standalone .hero-card {
    padding: 24px 22px 20px;
  }

  html.standalone .hero-period-label,
  body.standalone .hero-period-label {
    font-size: 13px;
  }

  html.standalone .hero-period-select,
  body.standalone .hero-period-select {
    font-size: 12px;
  }

  html.standalone .hero-sublabel,
  body.standalone .hero-sublabel {
    font-size: 11px;
  }

  html.standalone .hero-value,
  body.standalone .hero-value {
    font-size: 48px;
  }

  html.standalone .hero-delta,
  body.standalone .hero-delta {
    font-size: 13px;
    padding: 5px 10px;
  }

  html.standalone .chart-month,
  body.standalone .chart-month {
    font-size: 10px;
  }

  html.standalone .legend-dot-item,
  body.standalone .legend-dot-item {
    font-size: 12px;
  }

  html.standalone .kpi-row,
  body.standalone .kpi-row {
    gap: 12px;
  }

  html.standalone .kpi-card,
  body.standalone .kpi-card {
    padding: 16px;
  }

  html.standalone .kpi-icon,
  body.standalone .kpi-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 12px;
  }

  html.standalone .kpi-icon svg,
  body.standalone .kpi-icon svg {
    width: 20px;
    height: 20px;
  }

  html.standalone .kpi-num,
  body.standalone .kpi-num {
    font-size: 26px;
  }

  html.standalone .kpi-name,
  body.standalone .kpi-name {
    font-size: 11px;
  }

  html.standalone .kpi-delta-sm,
  body.standalone .kpi-delta-sm {
    font-size: 10px;
  }

  html.standalone .card,
  body.standalone .card {
    padding: 20px;
  }

  html.standalone .card-label,
  body.standalone .card-label {
    font-size: 13px;
  }

  html.standalone .card-action,
  body.standalone .card-action {
    font-size: 12px;
  }

  html.standalone .comp-label,
  body.standalone .comp-label {
    font-size: 14px;
  }

  html.standalone .comp-cur,
  body.standalone .comp-cur {
    font-size: 14px;
  }

  html.standalone .comp-badge,
  body.standalone .comp-badge {
    font-size: 10px;
    padding: 3px 8px;
  }

  html.standalone .filter-chip,
  body.standalone .filter-chip {
    font-size: 12px;
    padding: 9px 16px;
  }

  html.standalone .stat-pill,
  body.standalone .stat-pill {
    padding: 14px 10px;
  }

  html.standalone .stat-pill-num,
  body.standalone .stat-pill-num {
    font-size: 24px;
  }

  html.standalone .stat-pill-label,
  body.standalone .stat-pill-label {
    font-size: 10px;
  }

  html.standalone .cobro-card,
  body.standalone .cobro-card {
    padding: 16px;
  }

  html.standalone .cobro-avatar,
  body.standalone .cobro-avatar {
    width: 46px;
    height: 46px;
    font-size: 15px;
  }

  html.standalone .cobro-nombre,
  body.standalone .cobro-nombre {
    font-size: 15px;
  }

  html.standalone .cobro-dir,
  body.standalone .cobro-dir {
    font-size: 11px;
  }

  html.standalone .cobro-monto,
  body.standalone .cobro-monto {
    font-size: 18px;
  }

  html.standalone .cobro-estado,
  body.standalone .cobro-estado {
    font-size: 10px;
  }

  html.standalone .btn-install,
  html.standalone .btn-send,
  html.standalone .btn-cancel,
  html.standalone .btn-reset,
  html.standalone .btn-simular,
  html.standalone .btn-wpp-clean,
  body.standalone .btn-install,
  body.standalone .btn-send,
  body.standalone .btn-cancel,
  body.standalone .btn-reset,
  body.standalone .btn-simular,
  body.standalone .btn-wpp-clean {
    font-size: 13px;
    min-height: 46px;
  }

  html.standalone .install-title,
  body.standalone .install-title {
    font-size: 15px;
  }

  html.standalone .install-sub,
  body.standalone .install-sub {
    font-size: 11px;
  }
}






.ob-logo {
  max-width: 58px;
  max-height: 58px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.18));
}



/* =========================
   FLOATING LEAD CTA
========================= */
.lead-float-btn{
  position: fixed;
  right: 16px;
  bottom: 86px;
  z-index: 10020;
  border: 0;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, #3d4fd1 0%, #6173ff 100%);
  color: #fff;
  box-shadow: 0 14px 34px rgba(61,79,209,.30);
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
  max-width: 280px;
}

.lead-float-btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(61,79,209,.34);
}

.lead-float-btn.pulse{
  animation: leadPulse 1.8s infinite;
}

.lead-float-icon{
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.16);
  font-size: 18px;
}

.lead-float-text{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  line-height: 1.1;
}

.lead-float-title{
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .2px;
}

.lead-float-sub{
  font-size: 11px;
  opacity: .85;
  margin-top: 2px;
}

@keyframes leadPulse{
  0%   { box-shadow: 0 14px 34px rgba(61,79,209,.30); }
  50%  { box-shadow: 0 14px 34px rgba(61,79,209,.30), 0 0 0 10px rgba(61,79,209,.08); }
  100% { box-shadow: 0 14px 34px rgba(61,79,209,.30); }
}

.lead-float-btn{
  position: fixed;
  right: 16px;
  bottom: 86px;
  z-index: 10020;
  border: 0;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, #3d4fd1 0%, #6173ff 100%);
  color: #fff;
  box-shadow: 0 14px 34px rgba(61,79,209,.30);
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
  max-width: 280px;
}


.btn-ia-send{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 148px;
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  overflow: hidden;

  background:
    linear-gradient(135deg, #5b6cff 0%, #6d4dff 45%, #3b82f6 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;

  box-shadow:
    0 10px 26px rgba(76, 99, 255, .30),
    0 4px 10px rgba(59, 130, 246, .18),
    inset 0 1px 0 rgba(255,255,255,.22);

  transition:
    transform .18s ease,
    box-shadow .22s ease,
    filter .22s ease;
}

.btn-ia-send::before{
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.04));
  pointer-events: none;
}

.btn-ia-send::after{
  content: '';
  position: absolute;
  top: -35%;
  left: -25%;
  width: 55%;
  height: 180%;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,.18) 50%,
    rgba(255,255,255,0) 100%
  );
  transform: rotate(18deg);
  transition: left .65s ease;
  pointer-events: none;
}

.btn-ia-send:hover{
  transform: translateY(-2px) scale(1.015);
  box-shadow:
    0 16px 34px rgba(76, 99, 255, .38),
    0 8px 18px rgba(59, 130, 246, .22),
    inset 0 1px 0 rgba(255,255,255,.26);
  filter: brightness(1.03);
}

.btn-ia-send:hover::after{
  left: 120%;
}

.btn-ia-send:active{
  transform: translateY(0) scale(.985);
  box-shadow:
    0 8px 18px rgba(76, 99, 255, .28),
    inset 0 2px 6px rgba(0,0,0,.10);
}

.btn-ia-send:focus{
  outline: none;
}

.btn-ia-send:focus-visible{
  box-shadow:
    0 0 0 3px rgba(255,255,255,.55),
    0 0 0 6px rgba(91,108,255,.28),
    0 14px 30px rgba(76, 99, 255, .32);
}

.btn-ia-send-icon{
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.20);
  font-size: 12px;
}

.btn-ia-send-text{
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

.btn-ia-send[disabled]{
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@media (max-width: 768px){
  .btn-ia-send{
    min-width: 122px;
    height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    font-size: 13px;
  }

  .btn-ia-send-icon{
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
}


.ia-chat-demo-box{
  display: flex;
  flex-direction: column;
  min-height: 520px;
}

.ia-chat-messages{
  flex: 1;
  min-height: 260px;
  max-height: 52vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.ia-chat-input-row{
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 24%, #fff 100%);
}

.ia-chat-input-row .search-cobros-input{
  flex: 1;
  min-width: 0;
}

@media (max-width: 768px){
  .ia-chat-demo-box{
    min-height: 440px;
  }

  .ia-chat-messages{
    max-height: 46vh;
  }
}



/* =========================
   LEAD MODAL
========================= */
.lead-overlay{
  position: fixed;
  inset: 0;
  z-index: 10030;
  background: rgba(9,16,40,.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
}

.lead-modal{
  width: min(100%, 540px);
  max-height: 92vh;
  overflow: auto;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(15,23,42,.24);
  padding: 22px 18px 18px;
  position: relative;
}

.lead-close{
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  background: #eef2ff;
  color: #3d4fd1;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.lead-head{
  margin-bottom: 16px;
  padding-right: 38px;
}

.lead-badge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef2ff;
  color: #3d4fd1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 7px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.lead-title{
  font-family: 'Raleway', sans-serif;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.05;
  color: #111827;
}

.lead-sub{
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: #667085;
}

.lead-form{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lead-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lead-field{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lead-field label{
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #6b7280;
}

.lead-field input,
.lead-field select,
.lead-field textarea{
  width: 100%;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #111827;
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
  box-sizing: border-box;
}

.lead-field input:focus,
.lead-field select:focus,
.lead-field textarea:focus{
  border-color: #6173ff;
  box-shadow: 0 0 0 4px rgba(97,115,255,.12);
  background: #fff;
}

.lead-check{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: #667085;
  line-height: 1.4;
  margin-top: 2px;
}

.lead-check input{
  margin-top: 2px;
}

.lead-actions{
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.lead-btn-secondary,
.lead-btn-primary{
  flex: 1;
  border: 0;
  border-radius: 15px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.lead-btn-secondary{
  background: #eef2f7;
  color: #475467;
}

.lead-btn-primary{
  background: linear-gradient(135deg, #3d4fd1 0%, #6173ff 100%);
  color: #fff;
  box-shadow: 0 10px 26px rgba(61,79,209,.22);
}

.lead-btn-primary.loading{
  opacity: .7;
  pointer-events: none;
}

.lead-success{
  text-align: center;
  padding: 20px 12px 8px;
}

.lead-success-icon{
  width: 62px;
  height: 62px;
  margin: 0 auto 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #10b981, #34d399);
  color: #fff;
  font-size: 24px;
  box-shadow: 0 14px 30px rgba(16,185,129,.22);
}

.lead-success-title{
  font-size: 24px;
  font-weight: 800;
  color: #111827;
}

.lead-success-sub{
  margin-top: 6px;
  font-size: 14px;
  color: #667085;
  line-height: 1.45;
}
@media (max-width: 640px){
  .lead-float-btn{
    right: 10px;
    left: auto;
    bottom: 82px;
    width: 34vw;
    max-width: 155px;
    min-width: 112px;
    justify-content: flex-start;
    padding: 9px 10px;
    border-radius: 15px;
  }

  .lead-modal{
    border-radius: 24px;
    padding: 20px 14px 16px;
  }

  .lead-title{
    font-size: 24px;
  }
}



.search-cobros-wrap{
  padding: 10px 0 4px;
}

.search-cobros-input{
  width: 100%;
  height: 42px;
  border: 1px solid #dfe3ea;
  border-radius: 12px;
  padding: 0 14px;
  font-size: 14px;
  outline: none;
  background: #fff;
  box-sizing: border-box;
}

.search-cobros-input:focus{
  border-color: #4f8cff;
  box-shadow: 0 0 0 3px rgba(79,140,255,.12);
}

.recibo-modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .48);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}

.recibo-modal-overlay.open{
  display: flex;
}

.recibo-modal-card{
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 24px;
  padding: 18px 18px 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .20);
  position: relative;
  animation: reciboPop .18s ease;
}

@keyframes reciboPop{
  from{ transform: scale(.96); opacity: 0; }
  to{ transform: scale(1); opacity: 1; }
}

.recibo-close{
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}

.recibo-head{
  text-align: center;
  margin-bottom: 14px;
}

.recibo-badge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(20, 184, 166, .10);
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.recibo-title{
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px;
}

.recibo-sub{
  font-size: 13px;
  color: #64748b;
}

.recibo-sheet{
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 16px 14px;
}

.recibo-main-amount{
  text-align: center;
  font-size: 34px;
  font-weight: 900;
  color: #0f172a;
  margin: 4px 0 14px;
  letter-spacing: -.02em;
}

.recibo-grid{
  display: grid;
  gap: 10px;
}

.recibo-row{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #e2e8f0;
}

.recibo-row:last-child{
  border-bottom: 0;
  padding-bottom: 0;
}

.recibo-label{
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  min-width: 110px;
}

.recibo-value{
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  word-break: break-word;
}

.recibo-note{
  margin-top: 12px;
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

.recibo-modal-actions{
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.recibo-btn{
  flex: 1;
  height: 46px;
  border: 0;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.recibo-btn.primary{
  background: #16a34a;
  color: #fff;
}

.recibo-btn.ghost{
  background: #eef2f7;
  color: #0f172a;
}


.greeting-top{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.btn-reset-demo-mini{
  height:22px;
  padding:0 8px;
  border:1px solid rgba(15, 23, 42, .08);
  border-radius:999px;
  background:rgba(255,255,255,.72);
  color:#64748b;
  font-size:11px;
  font-weight:700;
  line-height:1;
  cursor:pointer;
  transition:all .18s ease;
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
}

.btn-reset-demo-mini:hover{
  background:#fff;
  color:#0f172a;
  border-color:rgba(15, 23, 42, .14);
  transform:translateY(-1px);
}

.btn-reset-demo-mini:active{
  transform:translateY(0);
}



.stats-strip-filtros .stat-pill{
  cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease, opacity .18s ease, border-color .18s ease;
  border:1px solid transparent;
}

.stats-strip-filtros .stat-pill:hover{
  transform:translateY(-1px);
}

.stats-strip-filtros .stat-pill.active{
  border-color:rgba(15, 23, 42, .14);
  box-shadow:0 10px 24px rgba(15, 23, 42, .10);
  transform:translateY(-1px);
}

.stats-strip-filtros .stat-pill:not(.active){
  opacity:.72;
}

.stat-pill.slate{
  background:linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}




.cobro-card-wrap{
  margin-bottom:12px;
}

.cobro-accordion{
  margin-top:8px;
  border-radius:18px;
  overflow:hidden;
  animation:cobroAccordionIn .18s ease;
}

@keyframes cobroAccordionIn{
  from{ opacity:0; transform:translateY(-4px); }
  to{ opacity:1; transform:translateY(0); }
}

.cobro-accordion-inner{
  background:linear-gradient(180deg,#ffffff 0%,#f8fafc 100%);
  border:1px solid #e2e8f0;
  border-radius:18px;
  padding:14px 14px 12px;
}

.cobro-accordion-title{
  font-size:13px;
  font-weight:800;
  color:#0f172a;
  margin-bottom:10px;
}

.cobro-concepto-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:8px 0;
  border-bottom:1px dashed #e2e8f0;
}

.cobro-concepto-label{
  font-size:13px;
  color:#475569;
  font-weight:600;
}

.cobro-concepto-amount{
  font-size:13px;
  color:#0f172a;
  font-weight:800;
  white-space:nowrap;
}

.cobro-concepto-total{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding-top:12px;
  margin-top:2px;
}

.cobro-concepto-total-label{
  font-size:14px;
  font-weight:900;
  color:#0f172a;
}

.cobro-concepto-total-amount{
  font-size:16px;
  font-weight:900;
  color:#0f172a;
}

.cobro-accordion-actions{
  display:flex;
  gap:10px;
  margin-top:14px;
}

.btn-cobro-ghost,
.btn-cobro-pay{
  flex:1;
  height:42px;
  border:0;
  border-radius:12px;
  font-size:14px;
  font-weight:800;
  cursor:pointer;
}

.btn-cobro-ghost{
  background:#eef2f7;
  color:#0f172a;
}

.btn-cobro-pay{
  background:#16a34a;
  color:#fff;
}



.wpp-preview-overlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.48);
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:10000;
}

.wpp-preview-overlay.open{
  display:flex;
}

.wpp-preview-card{
  width:100%;
  max-width:420px;
  background:#e5ddd5;
  border-radius:24px;
  padding:16px;
  box-shadow:0 24px 60px rgba(15,23,42,.22);
  position:relative;
}

.wpp-preview-close{
  position:absolute;
  top:10px;
  right:12px;
  border:0;
  background:transparent;
  font-size:28px;
  color:#64748b;
  cursor:pointer;
}

.wpp-preview-top{
  margin-bottom:12px;
}

.wpp-preview-title{
  font-size:18px;
  font-weight:900;
  color:#0f172a;
}

.wpp-preview-sub{
  font-size:12px;
  color:#64748b;
}

.wpp-chat-shell{
  background:#d9fdd3;
  border-radius:18px;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
  box-shadow:inset 0 0 0 1px rgba(15,23,42,.04);
}

.wpp-bubble-media{
  background:#fff;
  border-radius:14px;
  overflow:hidden;
  border:1px solid rgba(15,23,42,.08);
}

.wpp-preview-image{
  width:100%;
  display:block;
  background:#fff;
}

.wpp-file-meta{
  padding:10px 12px;
  background:#fff;
}

.wpp-file-name{
  font-size:13px;
  font-weight:800;
  color:#0f172a;
}

.wpp-file-sub{
  font-size:11px;
  color:#64748b;
  margin-top:2px;
}

.wpp-bubble-caption{
  background:#fff;
  border-radius:14px;
  padding:12px;
  font-size:13px;
  line-height:1.45;
  color:#0f172a;
  white-space:pre-line;
}

.wpp-preview-actions{
  display:flex;
  gap:10px;
  margin-top:14px;
}



.liq-card-wrap{
  margin-bottom:12px;
}

.liq-clickable-card{
  cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease;
}

.liq-clickable-card:hover{
  transform:translateY(-1px);
}

.liq-accordion{
  margin-top:8px;
  border-radius:18px;
  overflow:hidden;
  animation:liqAccordionIn .18s ease;
}

@keyframes liqAccordionIn{
  from{ opacity:0; transform:translateY(-4px); }
  to{ opacity:1; transform:translateY(0); }
}

.liq-accordion-inner{
  background:linear-gradient(180deg,#ffffff 0%,#f8fafc 100%);
  border:1px solid #e2e8f0;
  border-radius:18px;
  padding:14px 14px 12px;
}

.liq-accordion-title{
  font-size:13px;
  font-weight:800;
  color:#0f172a;
  margin-bottom:10px;
}

.liq-accordion-actions{
  display:flex;
  gap:10px;
  margin-top:14px;
  flex-wrap:wrap;
}

.btn-liq-send,
.btn-liq-pay{
  flex:1;
  min-width:120px;
  height:42px;
  border:0;
  border-radius:12px;
  font-size:14px;
  font-weight:800;
  cursor:pointer;
}

.btn-liq-send{
  background:#eef2ff;
  color:#3730a3;
}

.btn-liq-pay{
  background:#16a34a;
  color:#fff;
}


.liq-unified-card{
  margin-bottom:12px;
}

.liq-card-footer{
  display:flex;
  justify-content:flex-end;
  margin-top:12px;
}

.btn-liq-detail{
  height:34px;
  padding:0 12px;
  border:1px solid rgba(15,23,42,.08);
  border-radius:10px;
  background:#fff;
  color:#334155;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
  transition:all .18s ease;
}

.btn-liq-detail:hover{
  background:#f8fafc;
  border-color:rgba(15,23,42,.14);
}

.liq-inline-detail{
  margin-top:14px;
  padding-top:14px;
  border-top:1px dashed #dbe3ec;
  animation:liqInlineIn .18s ease;
}

@keyframes liqInlineIn{
  from{ opacity:0; transform:translateY(-4px); }
  to{ opacity:1; transform:translateY(0); }
}

.liq-inline-title{
  font-size:13px;
  font-weight:800;
  color:#0f172a;
  margin-bottom:10px;
}

.liq-inline-actions{
  display:flex;
  gap:10px;
  margin-top:14px;
  flex-wrap:wrap;
}


.fact-tabs-strip{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:10px;
  margin-bottom:12px;
}

.fact-tab{
  border:1px solid #e2e8f0;
  background:#fff;
  border-radius:16px;
  padding:12px 12px 10px;
  text-align:left;
  cursor:pointer;
  transition:all .18s ease;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.fact-tab:hover{
  transform:translateY(-1px);
  border-color:#cbd5e1;
}

.fact-tab.active{
  border-color:#fdba74;
  background:#fff7ed;
  box-shadow:0 10px 24px rgba(245, 158, 11, .10);
}

.fact-tab-title{
  font-size:12px;
  font-weight:800;
  color:#64748b;
  text-transform:uppercase;
  letter-spacing:.4px;
}

.fact-tab-count{
  font-size:22px;
  font-weight:900;
  color:#0f172a;
  line-height:1;
}

.fact-tab-amount{
  font-size:12px;
  font-weight:700;
  color:#b45309;
}

.fac-card-wrap{
  margin-bottom:12px;
}

.fac-unified-card{
  margin-bottom:0;
}

.fac-card-footer{
  display:flex;
  justify-content:flex-end;
  margin-top:12px;
}

.btn-fac-detail{
  height:34px;
  padding:0 12px;
  border:1px solid rgba(15,23,42,.08);
  border-radius:10px;
  background:#fff;
  color:#334155;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
  transition:all .18s ease;
}

.btn-fac-detail:hover{
  background:#f8fafc;
  border-color:rgba(15,23,42,.14);
}

.fac-inline-detail{
  margin-top:14px;
  padding-top:14px;
  border-top:1px dashed #dbe3ec;
  animation:facInlineIn .18s ease;
}

@keyframes facInlineIn{
  from{ opacity:0; transform:translateY(-4px); }
  to{ opacity:1; transform:translateY(0); }
}

.fac-inline-title{
  font-size:13px;
  font-weight:800;
  color:#0f172a;
  margin-bottom:10px;
}

.fac-inline-actions{
  display:flex;
  gap:10px;
  margin-top:14px;
  flex-wrap:wrap;
}

.btn-fac-emit,
.btn-fac-send{
  flex:1;
  min-width:120px;
  height:42px;
  border:0;
  border-radius:12px;
  font-size:14px;
  font-weight:800;
  cursor:pointer;
}

.btn-fac-emit{
  background:#fff7ed;
  color:#b45309;
}

.btn-fac-send{
  background:#eef2ff;
  color:#3730a3;
}

.btn-fac-pay{
  flex:1;
  min-width:120px;
  height:42px;
  border:0;
  border-radius:12px;
  font-size:14px;
  font-weight:800;
  cursor:pointer;
  background:#16a34a;
  color:#fff;
}

.fac-loading{
  opacity:.7;
  pointer-events:none;
}

@media (max-width: 480px){
  .fact-tabs-strip{
    grid-template-columns:1fr 1fr;
  }
}


.notif-hero-card{
  background:linear-gradient(135deg,#f8fafc 0%,#ffffff 100%);
  border:1px solid #e2e8f0;
  border-radius:24px;
  padding:16px;
  margin-bottom:12px;
  box-shadow:0 10px 28px rgba(15,23,42,.05);
}

.notif-hero-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

.notif-hero-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  background:#dcfce7;
  color:#166534;
  font-size:11px;
  font-weight:800;
  margin-bottom:8px;
}

.notif-hero-title{
  font-size:22px;
  font-weight:900;
  color:#0f172a;
  line-height:1.05;
}

.notif-hero-sub{
  font-size:13px;
  color:#64748b;
  margin-top:4px;
}

.notif-bot-status{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background:#dcfce7;
  color:#166534;
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}

.notif-bot-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#16a34a;
  box-shadow:0 0 0 4px rgba(22,163,74,.12);
}

.notif-kpi-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.notif-kpi-box{
  background:#f8fafc;
  border:1px solid #e2e8f0;
  border-radius:18px;
  padding:14px 12px;
  text-align:center;
}

.notif-kpi-value{
  font-size:26px;
  font-weight:900;
  color:#0f172a;
  line-height:1;
}

.notif-kpi-label{
  margin-top:5px;
  font-size:11px;
  font-weight:800;
  color:#64748b;
  text-transform:uppercase;
  letter-spacing:.4px;
}

.notif-tabs-strip{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:10px;
  margin-bottom:12px;
}

.notif-tab{
  border:1px solid #e2e8f0;
  background:#fff;
  border-radius:16px;
  padding:12px;
  text-align:left;
  cursor:pointer;
  transition:all .18s ease;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.notif-tab:hover{
  transform:translateY(-1px);
  border-color:#cbd5e1;
}

.notif-tab.active{
  border-color:#86efac;
  background:#f0fdf4;
  box-shadow:0 10px 24px rgba(34,197,94,.08);
}

.notif-tab-title{
  font-size:12px;
  font-weight:800;
  color:#64748b;
  text-transform:uppercase;
  letter-spacing:.4px;
}

.notif-tab-count{
  font-size:22px;
  font-weight:900;
  color:#0f172a;
  line-height:1;
}

.notif-list-modern{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.notif-modern-card{
  display:grid;
  grid-template-columns:52px 1fr auto;
  gap:12px;
  align-items:flex-start;
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:20px;
  padding:14px;
  box-shadow:0 8px 20px rgba(15,23,42,.04);
}

.notif-modern-icon{
  width:52px;
  height:52px;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:24px;
  background:#f8fafc;
}

.notif-modern-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.notif-modern-title{
  font-size:15px;
  font-weight:900;
  color:#0f172a;
}

.notif-modern-status{
  font-size:11px;
  font-weight:800;
  padding:5px 9px;
  border-radius:999px;
  background:#f1f5f9;
  color:#475569;
  white-space:nowrap;
}

.notif-modern-dest{
  font-size:13px;
  font-weight:800;
  color:#334155;
  margin-top:4px;
}

.notif-modern-message{
  font-size:13px;
  line-height:1.5;
  color:#475569;
  margin-top:8px;
}

.notif-modern-meta{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:10px;
}

.notif-modern-chip{
  display:inline-flex;
  align-items:center;
  padding:5px 8px;
  border-radius:999px;
  background:#f8fafc;
  color:#64748b;
  font-size:11px;
  font-weight:700;
}

.notif-modern-right{
  text-align:right;
  min-width:82px;
}

.notif-modern-time{
  font-size:12px;
  font-weight:900;
  color:#0f172a;
}

.notif-modern-date{
  font-size:11px;
  color:#64748b;
  margin-top:4px;
}

.notif-modern-card.tone-info .notif-modern-icon{
  background:#eff6ff;
}

.notif-modern-card.tone-success .notif-modern-icon{
  background:#ecfdf5;
}

.notif-modern-card.tone-warn .notif-modern-icon{
  background:#fff7ed;
}

.notif-modern-card.tone-danger .notif-modern-icon{
  background:#fef2f2;
}

@media (max-width: 640px){
  .notif-modern-card{
    grid-template-columns:48px 1fr;
  }

  .notif-modern-right{
    grid-column:2;
    text-align:left;
    margin-top:6px;
    min-width:auto;
  }

  .notif-hero-top{
    flex-direction:column;
  }
}



.idx-hero-card{
  background:linear-gradient(135deg,#eef2ff 0%,#f8fbff 100%);
  border:1px solid #dbe4ff;
  border-radius:24px;
  padding:16px;
  margin-bottom:12px;
  box-shadow:0 12px 30px rgba(61,79,209,.07);
}

.idx-hero-top{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
}

.idx-hero-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(61,79,209,.10);
  color:#3d4fd1;
  font-size:11px;
  font-weight:800;
  margin-bottom:8px;
}

.idx-hero-title{
  font-size:22px;
  font-weight:900;
  color:#0f172a;
  line-height:1.05;
}

.idx-hero-sub{
  font-size:13px;
  color:#64748b;
  margin-top:4px;
}

.idx-hero-stats{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:8px;
  min-width:280px;
}

.idx-mini-kpi{
  background:#fff;
  border:1px solid #e0e7ff;
  border-radius:18px;
  padding:12px 10px;
  text-align:center;
}

.idx-mini-kpi-val{
  font-size:20px;
  font-weight:900;
  color:#0f172a;
  line-height:1;
}

.idx-mini-kpi-label{
  margin-top:4px;
  font-size:10px;
  font-weight:800;
  color:#64748b;
  text-transform:uppercase;
  letter-spacing:.4px;
}

.section-idx-sticky {
  position: relative;
}

.idx-sticky-top {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 10px 0 14px;
  margin: 0 0 10px;
}

.idx-sticky-top::before {
  content: "";
  position: absolute;
  top: -28px;
  bottom: -16px;
  left: -20px;
  right: -20px;
  z-index: -1;
  background: #f8fbff;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.idx-sticky-top::after {
  content: "";
  position: absolute;
  left: -20px;
  right: -20px;
  bottom: -18px;
  height: 24px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(248,251,255,1) 0%, rgba(248,251,255,0) 100%);
}

.idx-tabs-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.idx-tab {
  width: 100%;
  min-width: 0;
}

/* opcional: mejora visual del contenido interno */
.idx-tab-title,
.idx-tab-count,
.idx-tab-amount {
  display: block;
}



.idx-tab-title{
  font-size:12px;
  font-weight:800;
  color:#64748b;
  text-transform:uppercase;
  letter-spacing:.4px;
}

.idx-tab-count{
  font-size:22px;
  font-weight:900;
  color:#0f172a;
  line-height:1;
}

.idx-tab-amount{
  font-size:12px;
  font-weight:700;
  color:#3d4fd1;
}

.idx-group-block{
  margin-bottom:16px;
}

.idx-group-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.idx-group-title{
  font-size:18px;
  font-weight:900;
  color:#0f172a;
}

.idx-group-sub{
  font-size:12px;
  color:#64748b;
  margin-top:2px;
}

.idx-cards-grid{
  display:grid;
  gap:12px;
}

.idx-card{
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:22px;
  padding:14px;
  box-shadow:0 8px 22px rgba(15,23,42,.04);
  transition:all .18s ease;
}

.idx-card:hover{
  transform:translateY(-1px);
}

.idx-card-processing{
  border-color:#c7d2fe;
  box-shadow:0 12px 28px rgba(99,102,241,.12);
}

.idx-card-top{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:12px;
}

.idx-card-title{
  font-size:15px;
  font-weight:900;
  color:#0f172a;
}

.idx-card-sub{
  margin-top:4px;
  font-size:12px;
  color:#64748b;
}

.idx-card-pill{
  min-width:54px;
  height:30px;
  padding:0 10px;
  border-radius:999px;
  background:#eef2ff;
  color:#3d4fd1;
  font-size:12px;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
}

.idx-kpi-row{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:8px;
}

.idx-kpi-item{
  background:#f8fafc;
  border:1px solid #e2e8f0;
  border-radius:16px;
  padding:10px;
}

.idx-kpi-label{
  font-size:11px;
  font-weight:800;
  color:#64748b;
  margin-bottom:5px;
}

.idx-kpi-value{
  font-size:16px;
  font-weight:900;
  color:#0f172a;
  line-height:1.1;
}

.idx-kpi-up{
  color:#3d4fd1;
}

.idx-kpi-final{
  color:#4338ca;
}

.idx-applied-note{
  margin-top:12px;
  padding:10px 12px;
  border-radius:14px;
  background:#ecfdf5;
  color:#166534;
  font-size:13px;
  font-weight:800;
}

.idx-progress-wrap{
  margin-top:12px;
  padding:12px;
  border-radius:16px;
  background:#eef2ff;
  border:1px solid #c7d2fe;
}

.idx-progress-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size:12px;
  color:#3730a3;
  font-weight:800;
  margin-bottom:8px;
}

.idx-progress-bar{
  height:10px;
  border-radius:999px;
  background:rgba(99,102,241,.15);
  overflow:hidden;
}

.idx-progress-fill{
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#6366f1 0%,#4f46e5 100%);
  transition:width .2s ease;
}

.idx-actions{
  margin-top:14px;
}

.btn-idx-magic{
  width:100%;
  height:46px;
  border:0;
  border-radius:14px;
  background:linear-gradient(135deg,#4f46e5 0%,#3730a3 100%);
  color:#fff;
  font-size:14px;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 12px 26px rgba(79,70,229,.22);
  transition:all .18s ease;
}

.btn-idx-magic:hover{
  transform:translateY(-1px);
}

.btn-idx-magic:disabled{
  opacity:.65;
  cursor:not-allowed;
  transform:none;
  box-shadow:none;
}

@media (max-width: 720px){
  .idx-hero-top{
    flex-direction:column;
  }

  .idx-hero-stats{
    width:100%;
    min-width:0;
  }

  .idx-kpi-row{
    grid-template-columns:1fr;
  }
}



.idx-bulk-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 16px;
  margin:14px 0 16px;
  border:1px solid rgba(61,79,209,.10);
  background:linear-gradient(135deg,#f8faff 0%,#eef3ff 100%);
  border-radius:18px;
}

.idx-bulk-title{
  font-size:14px;
  font-weight:800;
  color:#233049;
}

.idx-bulk-sub{
  font-size:12px;
  color:#64748b;
  margin-top:2px;
}

.idx-bulk-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.idx-progress{
  display:none;
  margin:0 0 16px;
  padding:14px 16px;
  border-radius:16px;
  background:#fff;
  border:1px solid #e8edf7;
  box-shadow:0 10px 30px rgba(15,23,42,.05);
}

.idx-progress.show{
  display:block;
}

.idx-progress-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  font-size:13px;
  color:#334155;
  margin-bottom:10px;
}

.idx-progress-track{
  width:100%;
  height:10px;
  background:#e9eef8;
  border-radius:999px;
  overflow:hidden;
}

.idx-progress-fill{
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#3d4fd1 0%,#6d7cff 100%);
  transition:width .25s ease;
}

.wa-idx-modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.45);
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  z-index:9999;
}

.wa-idx-modal-backdrop.show{
  display:flex;
}

.wa-idx-modal{
  width:min(980px, 100%);
  max-height:90vh;
  overflow:hidden;
  background:#fff;
  border-radius:24px;
  box-shadow:0 30px 80px rgba(15,23,42,.30);
  display:flex;
  flex-direction:column;
}

.wa-idx-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:18px 20px 14px;
  border-bottom:1px solid #eef2f7;
}

.wa-idx-kicker{
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#22c55e;
}

.wa-idx-title{
  font-size:22px;
  font-weight:900;
  color:#0f172a;
}

.wa-idx-close{
  border:none;
  background:#f3f6fb;
  width:38px;
  height:38px;
  border-radius:12px;
  font-size:24px;
  line-height:1;
  cursor:pointer;
  color:#334155;
}

.wa-idx-body{
  padding:18px 20px;
  overflow:auto;
}

.wa-idx-summary{
  font-size:13px;
  color:#64748b;
  margin-bottom:14px;
}

.wa-idx-list{
  display:grid;
  gap:14px;
}

.wa-idx-card{
  border:1px solid #e8edf7;
  border-radius:18px;
  padding:14px;
  background:#fbfdff;
}

.wa-idx-card-top{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
  flex-wrap:wrap;
}

.wa-idx-name{
  font-size:15px;
  font-weight:800;
  color:#0f172a;
}

.wa-idx-meta{
  font-size:12px;
  color:#64748b;
  margin-top:2px;
}

.wa-idx-phone{
  font-size:12px;
  font-weight:700;
  color:#16a34a;
}

.wa-idx-text{
  width:100%;
  min-height:150px;
  border:1px solid #dbe4f0;
  border-radius:14px;
  background:#fff;
  padding:12px 14px;
  resize:vertical;
  font-size:13px;
  line-height:1.5;
  color:#1e293b;
}

.wa-idx-foot{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
  padding:16px 20px 20px;
  border-top:1px solid #eef2f7;
  background:#fcfdff;
}

@media (max-width: 768px){
  .idx-bulk-bar{
    flex-direction:column;
    align-items:stretch;
  }

  .idx-bulk-actions{
    width:100%;
  }

  .idx-bulk-actions .btn-spot{
    flex:1;
    justify-content:center;
  }

  .wa-idx-modal{
    max-height:92vh;
    border-radius:20px;
  }

  .wa-idx-title{
    font-size:18px;
  }

  .wa-idx-foot{
    justify-content:stretch;
  }

  .wa-idx-foot .btn-spot{
    flex:1;
    justify-content:center;
  }
}



/* =========================
   INDEXACIONES · ACCIÓN MASIVA
========================= */

.idx-bulk-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 16px;
  margin:14px 0 16px;
  border:1px solid rgba(61,79,209,.10);
  background:linear-gradient(135deg,#f8faff 0%,#eef3ff 100%);
  border-radius:18px;
  box-shadow:0 10px 26px rgba(61,79,209,.06);
}

.idx-bulk-info{
  min-width:0;
}

.idx-bulk-title{
  font-size:14px;
  font-weight:800;
  color:#233049;
  line-height:1.1;
}

.idx-bulk-sub{
  font-size:12px;
  color:#64748b;
  margin-top:4px;
  line-height:1.35;
}

.idx-bulk-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.idx-bulk-actions .btn-spot{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:none;
  border-radius:14px;
  padding:11px 16px;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
  transition:all .18s ease;
  white-space:nowrap;
}

.idx-bulk-actions .btn-spot:disabled{
  opacity:.55;
  cursor:not-allowed;
  transform:none !important;
}

.btn-spot-primary{
  background:linear-gradient(135deg,#3d4fd1 0%,#6678ff 100%);
  color:#fff;
  box-shadow:0 12px 26px rgba(61,79,209,.22);
}

.btn-spot-primary:hover:not(:disabled){
  transform:translateY(-1px);
}

.btn-spot-light{
  background:#fff;
  color:#233049;
  border:1px solid #dbe4f0 !important;
}

.btn-spot-light:hover:not(:disabled){
  background:#f8fbff;
}

.idx-progress{
  margin:0 0 16px;
  padding:14px 16px;
  border-radius:16px;
  background:#fff;
  border:1px solid #e8edf7;
  box-shadow:0 10px 30px rgba(15,23,42,.05);
}

.idx-progress.show{
  display:block;
}

.idx-progress-track{
  width:100%;
  height:10px;
  background:#e9eef8;
  border-radius:999px;
  overflow:hidden;
  margin-top:10px;
}

.idx-progress-track .idx-progress-fill{
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#3d4fd1 0%,#6d7cff 100%);
  transition:width .22s ease;
}

/* =========================
   MODAL WHATSAPP MASIVO
========================= */

.wa-idx-modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.45);
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  z-index:9999;
}

.wa-idx-modal-backdrop.show{
  display:flex;
}

.wa-idx-modal{
  width:min(980px, 100%);
  max-height:90vh;
  overflow:hidden;
  background:#fff;
  border-radius:24px;
  box-shadow:0 30px 80px rgba(15,23,42,.30);
  display:flex;
  flex-direction:column;
}

.wa-idx-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:18px 20px 14px;
  border-bottom:1px solid #eef2f7;
}

.wa-idx-kicker{
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#22c55e;
}

.wa-idx-title{
  font-size:22px;
  font-weight:900;
  color:#0f172a;
  line-height:1.1;
}

.wa-idx-close{
  border:none;
  background:#f3f6fb;
  width:38px;
  height:38px;
  border-radius:12px;
  font-size:24px;
  line-height:1;
  cursor:pointer;
  color:#334155;
}

.wa-idx-close:hover{
  background:#eaf0f8;
}

.wa-idx-body{
  padding:18px 20px;
  overflow:auto;
}

.wa-idx-summary{
  font-size:13px;
  color:#64748b;
  margin-bottom:14px;
}

.wa-idx-list{
  display:grid;
  gap:14px;
}

.wa-idx-card{
  border:1px solid #e8edf7;
  border-radius:18px;
  padding:14px;
  background:#fbfdff;
}

.wa-idx-card-top{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
  flex-wrap:wrap;
}

.wa-idx-name{
  font-size:15px;
  font-weight:800;
  color:#0f172a;
}

.wa-idx-meta{
  font-size:12px;
  color:#64748b;
  margin-top:2px;
}

.wa-idx-phone{
  font-size:12px;
  font-weight:700;
  color:#16a34a;
}

.wa-idx-text{
  width:100%;
  min-height:150px;
  border:1px solid #dbe4f0;
  border-radius:14px;
  background:#fff;
  padding:12px 14px;
  resize:vertical;
  font-size:13px;
  line-height:1.5;
  color:#1e293b;
  outline:none;
}

.wa-idx-foot{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
  padding:16px 20px 20px;
  border-top:1px solid #eef2f7;
  background:#fcfdff;
}

.btn-spot-success{
  background:linear-gradient(135deg,#16a34a 0%,#22c55e 100%);
  color:#fff;
  border:none;
  box-shadow:0 12px 26px rgba(34,197,94,.20);
}

.btn-spot-success:hover{
  transform:translateY(-1px);
}

@media (max-width: 768px){
  .idx-bulk-bar{
    flex-direction:column;
    align-items:stretch;
  }

  .idx-bulk-actions{
    width:100%;
  }

  .idx-bulk-actions .btn-spot{
    flex:1;
  }

  .wa-idx-modal{
    max-height:92vh;
    border-radius:20px;
  }

  .wa-idx-title{
    font-size:18px;
  }

  .wa-idx-foot{
    justify-content:stretch;
  }

  .wa-idx-foot .btn-spot,
  .wa-idx-foot .btn-spot-success{
    flex:1;
  }
}




.idx-wa-bulk-open {
  overflow: hidden;
}

.idx-wa-bulk-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.idx-wa-bulk-modal {
  width: min(1180px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  border-radius: 28px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  flex-direction: column;
}

.idx-wa-bulk-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 28px 18px;
  background: linear-gradient(135deg, #e9fdf3 0%, #f7fbff 50%, #eef4ff 100%);
  border-bottom: 1px solid #e8eef7;
}

.idx-wa-bulk-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #16a34a;
  margin-bottom: 6px;
}

.idx-wa-bulk-title {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.idx-wa-bulk-subtitle {
  margin-top: 8px;
  color: #475569;
  font-size: 14px;
}

.idx-wa-bulk-close {
  border: 0;
  background: #ffffff;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #334155;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.idx-wa-bulk-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 28px 8px;
}

.idx-wa-summary-card {
  background: #fff;
  border: 1px solid #e7edf5;
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.idx-wa-summary-card span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}

.idx-wa-summary-card strong {
  display: block;
  font-size: 22px;
  color: #0f172a;
  font-weight: 800;
}

.idx-wa-bulk-list {
  padding: 16px 28px 24px;
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.idx-wa-bulk-card {
  background: #ffffff;
  border: 1px solid #e7edf5;
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.idx-wa-bulk-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.idx-wa-bulk-avatar {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.26);
}

.idx-wa-bulk-person {
  flex: 1;
  min-width: 0;
}

.idx-wa-bulk-name {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.idx-wa-bulk-sub {
  font-size: 13px;
  color: #64748b;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.idx-wa-bulk-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #15803d;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid #bbf7d0;
}

.idx-wa-bulk-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.idx-wa-bulk-meta-item {
  background: #f8fafc;
  border: 1px solid #e7edf5;
  border-radius: 16px;
  padding: 12px 14px;
}

.idx-wa-bulk-meta-item span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 5px;
}

.idx-wa-bulk-meta-item strong {
  display: block;
  color: #0f172a;
  font-size: 15px;
  font-weight: 800;
}

.idx-wa-phone {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid #dbe6ef;
  background: #eaf7ef;
}

.idx-wa-phone-top {
  background: linear-gradient(135deg, #1faa59 0%, #128c7e 100%);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.idx-wa-phone-contact {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.idx-wa-phone-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #dcfce7;
  box-shadow: 0 0 0 4px rgba(255,255,255,.15);
}

.idx-wa-phone-number {
  opacity: .92;
  white-space: nowrap;
}

.idx-wa-phone-body {
  padding: 18px;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.55), transparent 35%),
    linear-gradient(180deg, #d9fdd3 0%, #eaf7ef 100%);
}

.idx-wa-bubble {
  margin-left: auto;
  max-width: 88%;
  background: #ffffff;
  border-radius: 18px 18px 4px 18px;
  padding: 14px 14px 10px;
  color: #0f172a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  font-size: 14px;
  line-height: 1.45;
}

.idx-wa-bubble strong {
  font-weight: 800;
}

.idx-wa-space {
  height: 10px;
}

.idx-wa-time {
  text-align: right;
  margin-top: 10px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.idx-wa-bulk-actions {
  padding: 18px 28px 26px;
  border-top: 1px solid #e8eef7;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #fff;
}

.idx-wa-btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}

.idx-wa-btn-light {
  background: #eef2f7;
  color: #334155;
}

.idx-wa-btn-primary {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  box-shadow: 0 14px 30px rgba(34, 197, 94, 0.28);
}

@media (max-width: 980px) {
  .idx-wa-bulk-summary,
  .idx-wa-bulk-meta,
  .idx-wa-bulk-list {
    grid-template-columns: 1fr;


  }

  .idx-wa-bulk-modal {
    width: 100%;
    max-height: 95vh;
    border-radius: 22px;
  }

  .idx-wa-bulk-title {
    font-size: 22px;
  }

  .idx-wa-bubble {
    max-width: 96%;
  }
}

/* =========================
   INDEXACIONES · ENCABEZADO STICKY
   ========================= */

.section-idx-sticky {
  position: relative;
}

.idx-sticky-top {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 10px 0 14px;
  margin: 0 0 10px;
}

.idx-sticky-top::before {
  content: "";
  position: absolute;
  top: -28px;
  bottom: -16px;
  left: -20px;
  right: -20px;
  z-index: -1;
  background: #f8fbff;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.idx-sticky-top::after {
  content: "";
  position: absolute;
  left: -20px;
  right: -20px;
  bottom: -18px;
  height: 24px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(248,251,255,1) 0%, rgba(248,251,255,0) 100%);
}

.idx-tabs-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.idx-tab {
  width: 100%;
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #ffffff;
  padding: 12px 10px;
  text-align: left;
  transition: all 0.18s ease;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.idx-tab:hover {
  transform: translateY(-1px);
}

.idx-tab.active {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #eef2ff 0%, #ffffff 100%);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.12);
}

.idx-tab-title,
.idx-tab-count,
.idx-tab-amount {
  display: block;
}

.idx-tab-title {
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.idx-tab-count {
  font-size: 22px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
  margin-bottom: 4px;
}

.idx-tab-amount {
  font-size: 12px;
  font-weight: 700;
  color: #3d4fd1;
}

@media (max-width: 768px) {
  .idx-tabs-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


.greeting {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
}

.greeting-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.greeting-hello {
  font-size: 14px;
  font-weight: 700;
  color: #64748b;
  line-height: 1.1;
  margin-bottom: 4px;
}

.greeting-name {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.05;
}

.btn-reset-demo-mini {
  min-width: 92px;
  border: 0;
  border-radius: 16px;
  padding: 0 18px;
  background: linear-gradient(135deg, #5b5cf0 0%, #4f46e5 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.26);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.btn-reset-demo-mini:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(79, 70, 229, 0.34);
}

.btn-reset-demo-mini:active {
  transform: translateY(0);
}

@media (max-width: 640px) {
  .greeting {
    gap: 10px;
  }

  .greeting-name {
    font-size: 22px;
  }

  .btn-reset-demo-mini {
    min-width: 82px;
    padding: 0 14px;
    border-radius: 14px;
    font-size: 13px;
  }
}



.mini-bars {
  height: 96px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  margin-top: 14px;
}

.mini-bar-pair {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.mini-bar-col {
  width: 12px;
  border-radius: 10px 10px 4px 4px;
  min-height: 8px;
  transition: height .25s ease, opacity .25s ease, transform .25s ease;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.mini-bar-col.ingresos {
  background: var(--teal);
}

.mini-bar-col.egresos {
  background: var(--indigo);
  opacity: .58;
}

.mini-bar-pair:hover .mini-bar-col {
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  .mini-bars {
    height: 82px;
    gap: 8px;
  }

  .mini-bar-col {
    width: 10px;
  }
}

.mini-bars {
  height: 96px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 10px;
}

.mini-bar-pair {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.mini-bar-col {
  width: 12px;
  min-height: 8px;
  border-radius: 10px 10px 4px 4px;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.mini-bar-col.ingresos {
  background: var(--teal);
}

.mini-bar-col.egresos {
  background: var(--indigo);
  opacity: 0.6;
}


.kpi-wide-card {
  margin-top: 12px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #eef2ff 0%, #f8fbff 100%);
  border: 1px solid rgba(99, 102, 241, 0.14);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
  animation: fadeUp .45s ease both;
}

.kpi-wide-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.kpi-icon.violet {
  background: linear-gradient(135deg, #5b5cf0 0%, #4f46e5 100%);
  color: #fff;
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.18);
  transform: scale(.88);
  transform-origin: center;
}

.kpi-wide-copy {
  min-width: 0;
}

.kpi-wide-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6366f1;
  margin-bottom: 3px;
}

.kpi-wide-value {
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  color: #0f172a;
}

.kpi-wide-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
}

.kpi-wide-right {
  flex-shrink: 0;
}

.kpi-wide-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.10);
  color: #4f46e5;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .kpi-wide-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
  }

  .kpi-wide-value {
    font-size: 22px;
  }

  .kpi-wide-right {
    width: 100%;
  }

  .kpi-wide-pill {
    width: 100%;
    justify-content: center;
  }
}


.section-cobros-sticky {
  position: relative;
}

.cobros-sticky-top {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 10px 0 14px;
  margin: 0 0 10px;
}

.cobros-sticky-top::before {
  content: "";
  position: absolute;
  top: -28px;
  bottom: -16px;
  left: -20px;
  right: -20px;
  z-index: -1;
  background: #f8fbff;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.cobros-sticky-top::after {
  content: "";
  position: absolute;
  left: -20px;
  right: -20px;
  bottom: -18px;
  height: 24px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(248,251,255,1) 0%, rgba(248,251,255,0) 100%);
}

.stats-strip-filtros {
  margin-bottom: 12px;
}

.search-cobros-wrap {
  margin-bottom: 0;
  position: relative;
  z-index: 2;
}

.cobro-list {
  position: relative;
  z-index: 1;
}

.stats-strip-filtros,
.search-cobros-wrap {
  position: relative;
  z-index: 2;
}


.section-liq-sticky {
  position: relative;
}

.liq-sticky-top {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 10px 0 14px;
  margin: 0 0 10px;
}

.liq-sticky-top::before {
  content: "";
  position: absolute;
  top: -28px;
  bottom: -16px;
  left: -20px;
  right: -20px;
  z-index: -1;
  background: #f8fbff;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.liq-sticky-top::after {
  content: "";
  position: absolute;
  left: -20px;
  right: -20px;
  bottom: -18px;
  height: 24px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(248,251,255,1) 0%, rgba(248,251,255,0) 100%);
}
#liqList {
  position: relative;
  z-index: 1;
}


#tab-liquidaciones .stat-pill {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, opacity .18s ease;
}

#tab-liquidaciones .stat-pill:hover {
  transform: translateY(-1px);
}

#tab-liquidaciones .stat-pill.active {
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.10);
  transform: translateY(-1px);
}

#tab-liquidaciones .stat-pill.slate.active {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  color: #fff;
}

#tab-liquidaciones .stat-pill.amber.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
}

#tab-liquidaciones .stat-pill.teal.active {
  background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
  color: #fff;
}

#tab-liquidaciones .stat-pill.indigo.active {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
}

#tab-liquidaciones .stat-pill.active .stat-pill-num,
#tab-liquidaciones .stat-pill.active .stat-pill-label {
  color: #fff;
}




.tab-ai{
  background: linear-gradient(135deg,#eef2ff 0%,#f8fbff 100%);
}

.ia-hero-card{
  background: linear-gradient(135deg,#eef4ff 0%,#ffffff 100%);
  border:1px solid rgba(61,79,209,.10);
  border-radius:22px;
  padding:18px;
  margin-bottom:14px;
  box-shadow:0 10px 24px rgba(15,23,42,.06);
}

.ia-hero-top{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
  flex-wrap:wrap;
}

.ia-hero-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 12px;
  border-radius:999px;
  background:rgba(61,79,209,.08);
  color:#3d4fd1;
  font-size:12px;
  font-weight:800;
  margin-bottom:10px;
}

.ia-hero-title{
  font-size:24px;
  font-weight:900;
  color:#0f172a;
  line-height:1.1;
}

.ia-hero-sub{
  margin-top:6px;
  font-size:14px;
  color:#64748b;
  max-width:620px;
  line-height:1.45;
}

.ia-hero-kpis{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.ia-mini-kpi{
  min-width:110px;
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:16px;
  padding:12px 14px;
  text-align:center;
}

.ia-mini-kpi-val{
  font-size:22px;
  font-weight:900;
  color:#0f172a;
}

.ia-mini-kpi-label{
  font-size:12px;
  color:#64748b;
  margin-top:4px;
}

.ia-props-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:14px;
  margin-top:12px;
}

.ia-prop-card{
  border:1px solid #e2e8f0;
  border-radius:18px;
  padding:14px;
  background:#fff;
}

.ia-prop-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
  margin-bottom:6px;
}

.ia-prop-title{
  font-size:16px;
  font-weight:800;
  color:#0f172a;
}

.ia-prop-price{
  font-size:16px;
  font-weight:900;
  color:#0f766e;
  white-space:nowrap;
}

.ia-prop-zone{
  font-size:13px;
  color:#64748b;
  margin-bottom:10px;
}

.ia-prop-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:8px;
}

.ia-chat-demo-box{
  margin-top:10px;
  border:1px solid #e2e8f0;
  border-radius:20px;
  background:#fff;
  overflow:hidden;
}

.ia-chat-header{
  display:flex;
  gap:12px;
  align-items:center;
  padding:14px 16px;
  border-bottom:1px solid #e2e8f0;
  background:#f8fafc;
}

.ia-chat-avatar{
  width:40px;
  height:40px;
  border-radius:50%;
  background:#3d4fd1;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
}

.ia-chat-title{
  font-size:14px;
  font-weight:800;
  color:#0f172a;
}

.ia-chat-sub{
  font-size:12px;
  color:#64748b;
}

.ia-chat-messages{
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:10px;
  max-height:340px;
  overflow:auto;
  background:#fcfdff;
}

.ia-msg{
  max-width:85%;
  padding:12px 14px;
  border-radius:16px;
  font-size:14px;
  line-height:1.5;
}

.ia-msg-bot{
  background:#eef2ff;
  color:#1e293b;
  align-self:flex-start;
}

.ia-msg-user{
  background:#0f172a;
  color:#fff;
  align-self:flex-end;
}

.ia-chat-input-row{
  display:flex;
  gap:10px;
  padding:14px;
  border-top:1px solid #e2e8f0;
  background:#fff;
}

.ia-chat-input-row .search-cobros-input{
  flex:1;
}




.ia-subtabs-wrap{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:14px 0;
}

.ia-subtab{
  border:none;
  background:#eef2ff;
  color:#334155;
  padding:10px 14px;
  border-radius:14px;
  font-weight:800;
  font-size:13px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:8px;
}

.ia-subtab.active{
  background:#3d4fd1;
  color:#fff;
}

.ia-subtab-count{
  background:rgba(255,255,255,.22);
  padding:2px 8px;
  border-radius:999px;
  font-size:11px;
}

.ia-sugerencias-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:12px 0 14px;
}

.ia-suggestion-chip{
  border:none;
  background:#f8fafc;
  border:1px solid #e2e8f0;
  color:#334155;
  padding:9px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}

.ia-suggestion-chip:hover{
  background:#eef2ff;
}

.ia-prop-desc{
  margin-top:12px;
  padding:12px;
  border-radius:14px;
  background:#f8fafc;
  color:#475569;
  font-size:13px;
  line-height:1.5;
}



.cobro-periodo {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}


.liq-card-expandible{
  display:block;
  padding:0;
  overflow:hidden;
}

.liq-card-main{
  background:#fff;
  border:1px solid rgba(15,23,42,.07);
  border-radius:18px;
  box-shadow:0 8px 26px rgba(15,23,42,.05);
  transition:.18s ease;
}

.liq-card-main:hover{
  transform:translateY(-1px);
  box-shadow:0 14px 34px rgba(15,23,42,.08);
}

.liq-card-head{
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:16px 16px 12px;
}

.liq-inline-toggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 16px 14px;
  border-top:1px solid rgba(15,23,42,.06);
  font-size:13px;
  font-weight:700;
  color:#334155;
}

.liq-inline-arrow{
  font-size:16px;
  line-height:1;
  transition:transform .18s ease;
}

.liq-inline-arrow.open{
  transform:rotate(180deg);
}

.liq-accordion-inline{
  padding:0 16px 16px;
  border-top:1px solid rgba(15,23,42,.06);
  background:linear-gradient(180deg,#fcfdff 0%,#f8fafc 100%);
}

.liq-accordion-title{
  font-size:14px;
  font-weight:800;
  color:#0f172a;
  margin:14px 0 10px;
}

.liq-card-head{
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:16px 16px 12px;
}

.liq-avatar{
  width:42px;
  height:42px;
  min-width:42px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  font-size:12px;
  color:#fff;
  text-transform:uppercase;
  margin-top:2px;
}

.liq-main{
  flex:1;
  min-width:0;
}

.liq-topline{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.liq-owner-wrap{
  min-width:0;
}

.liq-owner{
  font-size:16px;
  font-weight:800;
  color:#0f172a;
  line-height:1.15;
  letter-spacing:-0.01em;
  margin-bottom:4px;
}

.liq-subline{
  font-size:14px;
  color:#64748b;
  line-height:1.25;
}

.liq-meta-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.liq-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 10px;
  border-radius:999px;
  background:#f8fafc;
  border:1px solid rgba(148,163,184,.18);
}

.liq-chip-label{
  font-size:11px;
  font-weight:700;
  color:#64748b;
}

.liq-chip-value{
  font-size:12px;
  font-weight:800;
  color:#0f172a;
}

.liq-right{
  text-align:right;
  min-width:132px;
  padding-top:2px;
}

.liq-amount-label{
  font-size:11px;
  color:#94a3b8;
  text-transform:uppercase;
  letter-spacing:.06em;
  margin-bottom:4px;
  font-weight:700;
}

.liq-amount{
  font-size:28px;
  font-weight:900;
  color:#0f172a;
  line-height:1;
  letter-spacing:-0.03em;
}

.liq-inline-toggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 16px 14px;
  border-top:1px solid rgba(15,23,42,.06);
  font-size:13px;
  font-weight:700;
  color:#334155;
}

@media (max-width: 768px){
  .liq-card-head{
    flex-wrap:wrap;
  }

  .liq-right{
    width:100%;
    min-width:0;
    text-align:left;
    padding-left:56px;
    margin-top:4px;
  }

  .liq-amount{
    font-size:24px;
  }
}



.fac-card-wrap{
  margin-bottom:14px;
  animation:fadeUp .35s ease both;
}

.fac-card-pro{
  display:block;
  cursor:pointer;
}

.fac-card-main{
  background:#fff;
  border:1px solid rgba(15,23,42,.07);
  border-radius:18px;
  box-shadow:0 8px 26px rgba(15,23,42,.05);
  overflow:hidden;
  transition:.18s ease;
}

.fac-card-main:hover{
  transform:translateY(-1px);
  box-shadow:0 14px 34px rgba(15,23,42,.08);
}

.fac-card-head{
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:16px 16px 12px;
}

.fac-avatar{
  width:42px;
  height:42px;
  min-width:42px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  font-size:12px;
  color:#fff;
  text-transform:uppercase;
  margin-top:2px;
}

.fac-avatar.pendiente{ background:#f59e0b; }
.fac-avatar.emitida{ background:#6366f1; }
.fac-avatar.enviada{ background:#14b8a6; }
.fac-avatar.anulada{ background:#ef4444; }

.fac-main{
  flex:1;
  min-width:0;
}

.fac-topline{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.fac-persona-wrap{
  min-width:0;
}

.fac-persona{
  font-size:16px;
  font-weight:800;
  color:#0f172a;
  line-height:1.15;
  letter-spacing:-0.01em;
  margin-bottom:4px;
}

.fac-subline{
  font-size:14px;
  color:#64748b;
  line-height:1.25;
}

.fac-meta-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.fac-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 10px;
  border-radius:999px;
  background:#f8fafc;
  border:1px solid rgba(148,163,184,.18);
  max-width:100%;
}

.fac-chip-wide{
  max-width:100%;
}

.fac-chip-label{
  font-size:11px;
  font-weight:700;
  color:#64748b;
  white-space:nowrap;
}

.fac-chip-value{
  font-size:12px;
  font-weight:800;
  color:#0f172a;
}

.fac-right{
  text-align:right;
  min-width:132px;
  padding-top:2px;
}

.fac-amount-label{
  font-size:11px;
  color:#94a3b8;
  text-transform:uppercase;
  letter-spacing:.06em;
  margin-bottom:4px;
  font-weight:700;
}

.fac-amount{
  font-size:28px;
  font-weight:900;
  color:#0f172a;
  line-height:1;
  letter-spacing:-0.03em;
}

.fac-inline-toggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 16px 14px;
  border-top:1px solid rgba(15,23,42,.06);
  font-size:13px;
  font-weight:700;
  color:#334155;
}

.fac-inline-arrow{
  font-size:16px;
  line-height:1;
  transition:transform .18s ease;
}

.fac-inline-arrow.open{
  transform:rotate(180deg);
}

.fac-accordion-inline{
  padding:0 16px 16px;
  border-top:1px solid rgba(15,23,42,.06);
  background:linear-gradient(180deg,#fcfdff 0%,#f8fafc 100%);
}

.fac-accordion-title{
  font-size:14px;
  font-weight:800;
  color:#0f172a;
  margin:14px 0 10px;
}

.fac-inline-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}

@media (max-width: 768px){
  .fac-card-head{
    flex-wrap:wrap;
  }

  .fac-right{
    width:100%;
    min-width:0;
    text-align:left;
    padding-left:56px;
    margin-top:4px;
  }

  .fac-amount{
    font-size:24px;
  }
}




.section-facturas-sticky {
  position: relative;
}

.fac-sticky-top{
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 10px 0 14px;
  margin: 0 0 10px;
}

.fac-sticky-top::before {
  content: "";
  position: absolute;
  top: -28px;
  bottom: -16px;
  left: -20px;
  right: -20px;
  z-index: -1;
  background: #f8fbff;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.fac-sticky-top::after {
  content: "";
  position: absolute;
  left: -20px;
  right: -20px;
  bottom: -18px;
  height: 24px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(248,251,255,1) 0%, rgba(248,251,255,0) 100%);
}



.fact-tabs-strip-compact{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.fact-tab{
  border: 1px solid rgba(148,163,184,.18);
  background: #fff;
  border-radius: 16px;
  padding: 10px 8px;
  min-height: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-shadow: 0 6px 18px rgba(15,23,42,.04);
  transition: .18s ease;
}

.fact-tab:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15,23,42,.06);
}

.fact-tab.active{
  border-color: rgba(79,70,229,.22);
  background: linear-gradient(180deg,#eef2ff 0%, #ffffff 100%);
  box-shadow: 0 10px 24px rgba(79,70,229,.10);
}

.fact-tab-title{
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1;
}

.fact-tab-count{
  font-size: 20px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}

.fact-tab-amount{
  display: none;
}

.fac-search-sticky{
  margin-top: 0;
}

.fac-list-body{
  padding-bottom: 8px;
}
@media (max-width: 768px){
  .fact-tabs-strip-compact{
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .fact-tabs-strip-compact::-webkit-scrollbar{
    display: none;
  }

  .fact-tab{
    flex: 0 0 92px;
    min-width: 92px;
    min-height: 62px;
    border-radius: 14px;
    padding: 9px 8px;
  }

  .fact-tab-count{
    font-size: 18px;
  }
}


.sim-entry-card{
  margin-top:18px;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
  border:1px solid rgba(61,79,209,.10);
  border-radius:24px;
  box-shadow:0 14px 40px rgba(15,23,42,.06);
  padding:22px;
}

.sim-entry-head{
  margin-bottom:18px;
}

.sim-entry-kicker{
  font-size:.80rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#4f46e5;
  margin-bottom:6px;
}

.sim-entry-title{
  margin:0 0 8px;
  font-size:1.45rem;
  font-weight:800;
  color:#0f172a;
}

.sim-entry-sub{
  margin:0;
  color:#475569;
  line-height:1.55;
  font-size:.98rem;
}

.sim-mode-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  margin-top:18px;
}

.sim-mode-card{
  position:relative;
  display:flex;
  align-items:flex-start;
  gap:14px;
  width:100%;
  text-align:left;
  border:1.5px solid #e5e7eb;
  background:#fff;
  border-radius:20px;
  padding:16px;
  cursor:pointer;
  transition:.20s ease;
}

.sim-mode-card:hover{
  transform:translateY(-1px);
  border-color:rgba(61,79,209,.28);
  box-shadow:0 12px 24px rgba(61,79,209,.08);
}

.sim-mode-card.active{
  border-color:#4f46e5;
  background:linear-gradient(180deg,#f7f7ff 0%,#eef2ff 100%);
  box-shadow:0 12px 28px rgba(79,70,229,.12);
}

.sim-mode-icon{
  width:46px;
  height:46px;
  min-width:46px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.sim-mode-icon svg{
  width:22px;
  height:22px;
  stroke:currentColor;
  fill:none;
  stroke-width:2;
}

.sim-mode-icon-auto{
  background:rgba(59,130,246,.10);
  color:#2563eb;
}

.sim-mode-icon-live{
  background:rgba(16,185,129,.12);
  color:#059669;
}

.sim-mode-content{
  flex:1;
}

.sim-mode-title{
  font-size:1rem;
  font-weight:800;
  color:#0f172a;
  margin-bottom:4px;
}

.sim-mode-text{
  font-size:.93rem;
  line-height:1.5;
  color:#475569;
}

.sim-mode-check{
  opacity:0;
  transform:scale(.8);
  transition:.20s ease;
  width:26px;
  height:26px;
  border-radius:50%;
  background:#4f46e5;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:.9rem;
  font-weight:800;
}

.sim-mode-card.active .sim-mode-check{
  opacity:1;
  transform:scale(1);
}

.sim-mode-panel{
  display:none;
  margin-top:18px;
}

.sim-mode-panel.show{
  display:block;
}

.sim-info-box,
.sim-live-box{
  background:#fff;
  border:1px solid #e9eef6;
  border-radius:20px;
  padding:18px;
}

.sim-info-box{
  display:flex;
  align-items:flex-start;
  gap:12px;
  margin-bottom:14px;
}

.sim-info-icon{
  width:34px;
  height:34px;
  border-radius:12px;
  background:rgba(61,79,209,.10);
  color:#3d4fd1;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1rem;
}

.sim-info-text{
  color:#334155;
  line-height:1.55;
}

.sim-live-title{
  font-size:1.05rem;
  font-weight:800;
  color:#0f172a;
  margin-bottom:6px;
}

.sim-live-sub{
  color:#475569;
  line-height:1.55;
  margin-bottom:12px;
}

.sim-live-note{
  background:#ecfeff;
  color:#155e75;
  border:1px solid #bae6fd;
  border-radius:16px;
  padding:12px 14px;
  font-size:.93rem;
  line-height:1.5;
  margin-bottom:16px;
}

.sim-live-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:end;
}

.sim-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.sim-label{
  font-size:.88rem;
  font-weight:700;
  color:#334155;
}

.sim-input{
  height:48px;
  border-radius:14px;
  border:1px solid #dbe4f0;
  padding:0 14px;
  font-size:.96rem;
  outline:none;
  transition:.18s ease;
}

.sim-input:focus{
  border-color:#4f46e5;
  box-shadow:0 0 0 4px rgba(79,70,229,.10);
}

.btn-sim-validate,
.btn-sim-live,
.btn-sim-secondary{
  border:none;
  border-radius:14px;
  padding:13px 16px;
  font-weight:800;
  cursor:pointer;
  transition:.18s ease;
}

.btn-sim-validate{
  background:#0f172a;
  color:#fff;
  white-space:nowrap;
}

.btn-sim-validate:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 20px rgba(15,23,42,.14);
}

.btn-sim-live{
  background:linear-gradient(135deg,#10b981 0%,#059669 100%);
  color:#fff;
}

.btn-sim-secondary{
  background:#eef2ff;
  color:#4338ca;
}

.sim-live-status{
  margin-top:14px;
  border-radius:14px;
  padding:12px 14px;
  font-size:.93rem;
  line-height:1.5;
}

.sim-live-status.ok{
  background:#ecfdf5;
  color:#166534;
  border:1px solid #bbf7d0;
}

.sim-live-status.error{
  background:#fef2f2;
  color:#991b1b;
  border:1px solid #fecaca;
}

.sim-live-status.waiting{
  background:#eff6ff;
  color:#1d4ed8;
  border:1px solid #bfdbfe;
}

.sim-live-next{
  margin-top:14px;
  display:flex;
  flex-direction:column;
  gap:10px;
}




.sim-live-next-text{
  color:#334155;
  line-height:1.5;
}

@media (max-width: 768px){
  .sim-mode-grid{
    grid-template-columns:1fr;
  }

  .sim-live-form{
    grid-template-columns:1fr;
  }

  .btn-sim-validate{
    width:100%;
  }
}


.sim-hero.compact{
  background: linear-gradient(135deg,#f8fbff 0%,#ffffff 100%);
  border:1px solid rgba(61,79,209,.10);
  border-radius:22px;
  padding:18px;
  box-shadow:0 10px 28px rgba(15,23,42,.05);
  margin-bottom:18px;
}

.sim-hero-main{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}

.sim-hero-left{
  flex:1;
  min-width:0;
}

.sim-hero-title{
  font-size:1.15rem;
  font-weight:800;
  color:#0f172a;
  margin-top:10px;
}

.sim-hero-subtitle{
  margin-top:4px;
  font-size:.92rem;
  color:#64748b;
  line-height:1.45;
}

.sim-hero-total-box.compact{
  min-width:220px;
  background:#fff;
  border:1px solid #e7edf7;
  border-radius:16px;
  padding:12px 14px;
  text-align:right;
}

.sim-hero-total-label{
  font-size:.76rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:#64748b;
  margin-bottom:4px;
}

.sim-hero-amount{
  font-size:1.65rem;
  font-weight:900;
  color:#0f172a;
  line-height:1.1;
  margin:0;
}

.sim-hero-total-note{
  margin-top:4px;
  font-size:.82rem;
  color:#64748b;
}

.sim-summary-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-top:14px;
}

.sim-summary-item{
  background:#fff;
  border:1px solid #edf2f7;
  border-radius:14px;
  padding:10px 12px;
}

.sim-summary-label{
  display:block;
  font-size:.75rem;
  font-weight:700;
  color:#64748b;
  margin-bottom:4px;
}

.sim-summary-item strong{
  font-size:.93rem;
  color:#0f172a;
  font-weight:800;
  line-height:1.35;
}

.sim-inline-status{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}

.sim-inline-chip{
  background:#f8fafc;
  border:1px solid #e2e8f0;
  color:#475569;
  border-radius:999px;
  padding:7px 11px;
  font-size:.80rem;
  font-weight:700;
}

.sim-inline-chip.warning{
  background:#fff7ed;
  border-color:#fdba74;
  color:#c2410c;
}

.sim-detail-toggle{
  margin-top:12px;
  background:transparent;
  border:none;
  padding:0;
  color:#4338ca;
  font-weight:800;
  font-size:.9rem;
  cursor:pointer;
}

.sim-detail-collapse{
  margin-top:12px;
}

.sim-breakdown-card.compact{
  margin-top:0;
  padding:14px 16px;
  border-radius:16px;
}

.sim-breakdown-card.compact .sim-breakdown-row{
  padding:8px 0;
}

@media (max-width: 992px){
  .sim-hero-main{
    flex-direction:column;
  }

  .sim-hero-total-box.compact{
    width:100%;
    text-align:left;
  }

  .sim-summary-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media (max-width: 576px){
  .sim-summary-grid{
    grid-template-columns:1fr;
  }
}


.sim-detail-collapse.is-hidden{
  display:none;
}

.sim-summary-inline{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  margin-top:14px;
  padding:10px 12px;
  background:#fff;
  border:1px solid #edf2f7;
  border-radius:14px;
}

.sim-summary-inline-label{
  font-size:.80rem;
  font-weight:700;
  color:#64748b;
}

.sim-summary-inline strong{
  font-size:.94rem;
  font-weight:800;
  color:#0f172a;
}

.sim-summary-inline-sep{
  color:#94a3b8;
  font-weight:700;
  margin:0 2px;
}

.sim-summary-grid-compact{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

@media (max-width: 768px){
  .sim-summary-grid-compact{
    grid-template-columns:1fr;
  }

  .sim-summary-inline{
    align-items:flex-start;
  }
}

.sim-summary-inline.second-line{
  margin-top:10px;
}

.sim-detail-collapse{
  margin-top:12px;
  display:block;
}

.sim-detail-collapse.is-hidden{
  display:none;
}

.sim-breakdown-card.compact{
  margin-top:0;
  padding:14px 16px;
  border-radius:16px;
  background:#f8fbff;
  border:1px solid #dbe7f3;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.sim-breakdown-card.compact .sim-breakdown-list{
  display:flex;
  flex-direction:column;
  gap:0;
}

.sim-breakdown-card.compact .sim-breakdown-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:10px 0;
  border-bottom:1px solid #e2e8f0;
}

.sim-breakdown-card.compact .sim-breakdown-row:last-child{
  border-bottom:none;
}

.sim-breakdown-card.compact .sim-breakdown-concept{
  color:#334155;
  font-weight:700;
  font-size:.95rem;
}

.sim-breakdown-card.compact .sim-breakdown-amount{
  color:#0f172a;
  font-weight:800;
  font-size:.95rem;
  white-space:nowrap;
}

.sim-breakdown-card.compact .sim-breakdown-row.total{
  margin-top:4px;
  padding-top:14px;
  border-top:2px solid #cbd5e1;
  border-bottom:none;
}

.sim-breakdown-card.compact .sim-breakdown-row.total .sim-breakdown-concept,
.sim-breakdown-card.compact .sim-breakdown-row.total .sim-breakdown-amount{
  color:#0f172a;
  font-size:1.02rem;
  font-weight:900;
}


#flowCard,
#successCard,
#wppTimeline,
#btnReset{
  display:none;
}

.wpp-msg{
  opacity:0;
  transform:translateY(10px);
  transition:.32s ease;
}

.wpp-msg.show{
  opacity:1;
  transform:none;
}


.flow-node,
.flow-connector,
.flow-check{
  transition:.28s ease;
}

.flow-node{
  opacity:.55;
  transform:scale(.985);
}

.flow-node.is-active{
  opacity:1;
  transform:scale(1.01);
  box-shadow:0 10px 24px rgba(79,70,229,.12);
  border-color:rgba(79,70,229,.30);
}

.flow-node.is-done{
  opacity:1;
  transform:none;
}

.flow-node .flow-check{
  opacity:0;
  transform:scale(.7);
}

.flow-node.is-done .flow-check{
  opacity:1;
  transform:scale(1);
}

.flow-connector{
  opacity:.28;
}

.flow-connector.is-done{
  opacity:1;
}

.sim-progress-fill{
  transition:width .35s ease;
}



#simDocs{
  display:none;
  margin-top:18px;
}

.sim-docs-head{
  margin-bottom:12px;
}

.sim-docs-title{
  font-size:1.05rem;
  font-weight:900;
  color:#0f172a;
}

.sim-docs-sub{
  margin-top:4px;
  color:#64748b;
  font-size:.92rem;
}

.sim-docs-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}

.sim-doc-card{
  background:#fff;
  border:1px solid #e5edf7;
  border-radius:18px;
  padding:16px;
  box-shadow:0 10px 24px rgba(15,23,42,.05);
  opacity:0;
  transform:translateY(10px);
  transition:.32s ease;
}

.sim-doc-card.show{
  opacity:1;
  transform:none;
}

.sim-doc-top{
  display:flex;
  gap:12px;
  align-items:flex-start;
  margin-bottom:14px;
}

.sim-doc-icon{
  width:42px;
  height:42px;
  border-radius:14px;
  background:#eef2ff;
  color:#4338ca;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1.1rem;
}

.sim-doc-name{
  font-size:.96rem;
  font-weight:800;
  color:#0f172a;
}

.sim-doc-meta{
  margin-top:2px;
  font-size:.84rem;
  color:#64748b;
}

.sim-doc-body{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.sim-doc-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  font-size:.9rem;
  color:#475569;
  padding-bottom:8px;
  border-bottom:1px dashed #e2e8f0;
}

.sim-doc-row:last-child{
  border-bottom:none;
  padding-bottom:0;
}

.sim-doc-row strong{
  color:#0f172a;
  font-weight:800;
  text-align:right;
}

.sim-doc-badge{
  margin-top:14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  padding:7px 12px;
  font-size:.8rem;
  font-weight:800;
}

.sim-doc-badge.ok{
  background:#ecfdf5;
  color:#166534;
  border:1px solid #bbf7d0;
}

@media (max-width: 992px){
  .sim-docs-grid{
    grid-template-columns:1fr;
  }
}

.sim-docs{
  display:none;
  margin-top:18px;
}

#simDocs{
  display:none;
  margin-top:18px;
}


.sim-doc-card{
  text-align:left;
  border:none;
  cursor:pointer;
  width:100%;
}

.sim-doc-card:hover{
  transform:translateY(-2px);
  box-shadow:0 16px 30px rgba(15,23,42,.08);
}

.sim-doc-modal{
  position:fixed;
  inset:0;
  z-index:1200;
}

.sim-doc-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.45);
  backdrop-filter:blur(3px);
}

.sim-doc-modal-dialog{
  position:relative;
  z-index:2;
  width:min(760px, calc(100vw - 28px));
  margin:40px auto;
  max-height:calc(100vh - 80px);
  overflow:auto;
}

.sim-doc-modal-close{
  position:sticky;
  top:8px;
  margin-left:auto;
  display:flex;
  align-items:center;
  justify-content:center;
  width:42px;
  height:42px;
  border:none;
  border-radius:999px;
  background:#0f172a;
  color:#fff;
  font-size:1.5rem;
  cursor:pointer;
  z-index:3;
}

.sim-doc-paper{
  background:#fff;
  border-radius:24px;
  padding:26px;
  box-shadow:0 24px 60px rgba(15,23,42,.20);
  margin-top:10px;
}

.sim-doc-paper-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:16px;
}

.sim-doc-paper-brand{
  font-size:1.2rem;
  font-weight:900;
  color:#4338ca;
  letter-spacing:.04em;
}

.sim-doc-paper-type{
  background:#eef2ff;
  color:#4338ca;
  border:1px solid #c7d2fe;
  border-radius:999px;
  padding:6px 12px;
  font-size:.82rem;
  font-weight:800;
}

.sim-doc-paper-title{
  font-size:1.45rem;
  font-weight:900;
  color:#0f172a;
  margin-bottom:4px;
}

.sim-doc-paper-sub{
  color:#64748b;
  font-size:.94rem;
  margin-bottom:18px;
}

.sim-doc-paper-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin-bottom:18px;
}

.sim-doc-field{
  background:#f8fafc;
  border:1px solid #e2e8f0;
  border-radius:16px;
  padding:12px 14px;
}

.sim-doc-field-label{
  font-size:.78rem;
  font-weight:700;
  color:#64748b;
  margin-bottom:4px;
}

.sim-doc-field-value{
  color:#0f172a;
  font-weight:800;
  line-height:1.4;
}

.sim-doc-paper-total{
  margin-top:10px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  border-top:2px solid #e2e8f0;
  padding-top:16px;
  font-size:1rem;
  color:#334155;
}

.sim-doc-paper-total strong{
  font-size:1.3rem;
  color:#0f172a;
  font-weight:900;
}

.sim-doc-paper-footer{
  margin-top:18px;
  padding-top:14px;
  border-top:1px dashed #cbd5e1;
  font-size:.88rem;
  color:#64748b;
}

@media (max-width: 640px){
  .sim-doc-paper{
    padding:18px;
    border-radius:20px;
  }

  .sim-doc-paper-grid{
    grid-template-columns:1fr;
  }

  .sim-doc-paper-top{
    flex-direction:column;
    align-items:flex-start;
  }
}




/* =========================================
   SPOT · FLUJO REAL PROBAR CON $1
   Scoped a #tab-simulador
========================================= */
#tab-simulador .sim-live-wrap {
  margin-top: 20px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .28s ease, transform .28s ease;
}

#tab-simulador .sim-live-wrap.is-visible {
  opacity: 1;
  transform: translateY(0);
}

#tab-simulador .sim-live-shell {
  position: relative;
  border-radius: 26px;
  padding: 22px;
  background:
    radial-gradient(circle at top right, rgba(80,112,255,.08), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  border: 1px solid rgba(27, 44, 95, .08);
  box-shadow: 0 22px 60px rgba(17, 24, 39, .08);
}

#tab-simulador .sim-live-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

#tab-simulador .sim-live-badge,
#tab-simulador .sim-live-modal-badge,
#tab-simulador .sim-live-success-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(66, 94, 255, .08);
  color: #3d50d9;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2px;
}

#tab-simulador .sim-live-title {
  margin: 10px 0 6px;
  font-size: 28px;
  line-height: 1.1;
  color: #13203d;
  font-weight: 800;
}

#tab-simulador .sim-live-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: #60708f;
  max-width: 860px;
}

#tab-simulador .sim-live-head-note {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #f6f8ff;
  border: 1px solid rgba(61, 79, 209, .10);
  color: #44557a;
  font-size: 12px;
  font-weight: 700;
}

#tab-simulador .sim-live-head-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #32c36c;
  box-shadow: 0 0 0 6px rgba(50, 195, 108, .12);
}

#tab-simulador .sim-live-grid {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 16px;
  margin-bottom: 16px;
}

#tab-simulador .sim-live-card {
  position: relative;
  border-radius: 22px;
  padding: 18px;
  background: #fff;
  border: 1px solid rgba(25, 45, 95, .08);
  box-shadow: 0 12px 34px rgba(17, 24, 39, .05);
}

#tab-simulador .sim-live-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

#tab-simulador .sim-live-eyebrow {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #8a97b1;
  margin-bottom: 4px;
}

#tab-simulador .sim-live-card-title {
  font-size: 18px;
  font-weight: 800;
  color: #1a2640;
  line-height: 1.2;
}

#tab-simulador .sim-live-chip,
#tab-simulador .sim-live-chip-soft,
#tab-simulador .sim-live-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

#tab-simulador .sim-live-chip {
  background: #eef2ff;
  color: #4152d7;
}

#tab-simulador .sim-live-chip-soft {
  background: #f4f7ff;
  color: #5e6f97;
}

#tab-simulador .sim-live-paybox {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 14px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfcff 0%, #f7f9ff 100%);
  border: 1px solid rgba(55, 84, 190, .08);
  margin-bottom: 12px;
}

#tab-simulador .sim-live-pay-label {
  grid-column: 1 / -1;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
  color: #8d99b2;
}

#tab-simulador .sim-live-pay-value {
  font-size: 20px;
  font-weight: 800;
  color: #1b2540;
  line-height: 1.1;
  word-break: break-word;
}

#tab-simulador .sim-live-pay-value-cvu {
  font-size: 17px;
  letter-spacing: .02em;
}

#tab-simulador .sim-live-copy-btn,
#tab-simulador .sim-live-secondary-btn,
#tab-simulador .sim-live-primary-btn {
  border: 0;
  outline: 0;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, opacity .18s ease;
}

#tab-simulador .sim-live-copy-btn {
  padding: 10px 14px;
  border-radius: 14px;
  background: #eef2ff;
  color: #3f50d8;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

#tab-simulador .sim-live-copy-btn:hover,
#tab-simulador .sim-live-secondary-btn:hover,
#tab-simulador .sim-live-primary-btn:hover {
  transform: translateY(-1px);
}

#tab-simulador .sim-live-copy-btn.is-copied {
  background: #eafaf0;
  color: #218d4d;
}

#tab-simulador .sim-live-pay-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin: 14px 0;
}

#tab-simulador .sim-live-mini {
  padding: 12px;
  border-radius: 16px;
  background: #fafbff;
  border: 1px solid rgba(27, 44, 95, .06);
}

#tab-simulador .sim-live-mini-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #90a0ba;
  margin-bottom: 6px;
  font-weight: 800;
}

#tab-simulador .sim-live-mini strong {
  display: block;
  color: #25324c;
  font-size: 13px;
  line-height: 1.4;
}

#tab-simulador .sim-live-help {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#tab-simulador .sim-live-help span {
  padding: 8px 10px;
  border-radius: 999px;
  background: #f7faff;
  border: 1px solid rgba(43, 70, 167, .08);
  color: #5d6c88;
  font-size: 12px;
  font-weight: 700;
}

#tab-simulador .sim-live-steps {
  display: grid;
  gap: 10px;
}

#tab-simulador .sim-live-step {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border-radius: 18px;
  background: #fbfcff;
  border: 1px solid rgba(27, 44, 95, .06);
  transition: border-color .22s ease, background .22s ease, transform .22s ease, box-shadow .22s ease;
}

#tab-simulador .sim-live-step-num {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 14px;
  background: #eef2ff;
  color: #4253d8;
}

#tab-simulador .sim-live-step-title {
  font-size: 14px;
  font-weight: 800;
  color: #1d2a45;
  margin-bottom: 3px;
}

#tab-simulador .sim-live-step-text {
  font-size: 13px;
  color: #65738f;
  line-height: 1.5;
}

#tab-simulador .sim-live-step.is-active {
  background: linear-gradient(180deg, #f7f9ff 0%, #fdfdff 100%);
  border-color: rgba(66, 94, 255, .25);
  box-shadow: 0 10px 26px rgba(65, 82, 215, .08);
}

#tab-simulador .sim-live-step.is-active .sim-live-step-num {
  background: #4253d8;
  color: #fff;
  box-shadow: 0 8px 18px rgba(66, 83, 216, .22);
}

#tab-simulador .sim-live-step.is-done {
  background: #f7fcf8;
  border-color: rgba(41, 159, 87, .18);
}

#tab-simulador .sim-live-step.is-done .sim-live-step-num {
  background: #2fb464;
  color: #fff;
}

#tab-simulador .sim-live-actionbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #17233d 0%, #24345c 100%);
  color: #fff;
  margin-bottom: 16px;
}

#tab-simulador .sim-live-action-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 4px;
}

#tab-simulador .sim-live-action-sub {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255,255,255,.76);
}

#tab-simulador .sim-live-action-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#tab-simulador .sim-live-primary-btn {
  padding: 13px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #5c74ff 0%, #475ce8 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 16px 30px rgba(66, 83, 216, .28);
}

#tab-simulador .sim-live-primary-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

#tab-simulador .sim-live-secondary-btn {
  padding: 13px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  border: 1px solid rgba(255,255,255,.14);
}

#tab-simulador .sim-live-monitor {
  margin-bottom: 16px;
}

#tab-simulador .sim-live-status-pill {
  background: #f4f7ff;
  color: #65748f;
}

#tab-simulador .sim-live-status-list {
  display: grid;
  gap: 10px;
}

#tab-simulador .sim-live-status-row {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  background: #fbfcff;
  border: 1px solid rgba(27, 44, 95, .06);
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

#tab-simulador .sim-live-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d8e0ef;
  position: relative;
}

#tab-simulador .sim-live-status-body strong {
  display: block;
  color: #1f2b47;
  font-size: 14px;
  margin-bottom: 3px;
}

#tab-simulador .sim-live-status-body span {
  display: block;
  color: #6a7892;
  font-size: 13px;
  line-height: 1.45;
}

#tab-simulador .sim-live-status-badge {
  padding: 8px 10px;
  border-radius: 999px;
  background: #f1f4fb;
  color: #7a879f;
  font-size: 12px;
  font-weight: 800;
}

#tab-simulador .sim-live-status-row.is-active {
  background: #f8faff;
  border-color: rgba(69, 95, 231, .18);
  box-shadow: 0 12px 24px rgba(68, 92, 220, .08);
}

#tab-simulador .sim-live-status-row.is-active .sim-live-status-dot {
  background: #5065f0;
  box-shadow: 0 0 0 8px rgba(80, 101, 240, .12);
}

#tab-simulador .sim-live-status-row.is-active .sim-live-status-badge {
  background: #eef2ff;
  color: #4152d7;
}

#tab-simulador .sim-live-status-row.is-done {
  background: #f6fcf7;
  border-color: rgba(47, 180, 100, .18);
}

#tab-simulador .sim-live-status-row.is-done .sim-live-status-dot {
  background: #2fb464;
  box-shadow: 0 0 0 8px rgba(47, 180, 100, .10);
}

#tab-simulador .sim-live-status-row.is-done .sim-live-status-badge {
  background: #eafaf0;
  color: #218d4d;
}

#tab-simulador .sim-live-success {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 22px;
  background: linear-gradient(135deg, #f7fcf8 0%, #ffffff 100%);
  border: 1px solid rgba(47, 180, 100, .18);
  box-shadow: 0 18px 42px rgba(47, 180, 100, .08);
}

#tab-simulador .sim-live-success-glow {
  position: absolute;
  top: -80px;
  right: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(47, 180, 100, .14) 0%, rgba(47,180,100,0) 70%);
  pointer-events: none;
}

#tab-simulador .sim-live-success-main {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

#tab-simulador .sim-live-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #2fb464;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 18px 34px rgba(47, 180, 100, .22);
}

#tab-simulador .sim-live-success-copy h4 {
  margin: 10px 0 6px;
  font-size: 24px;
  line-height: 1.15;
  color: #173420;
  font-weight: 800;
}

#tab-simulador .sim-live-success-copy p {
  margin: 0;
  color: #5e6e65;
  font-size: 14px;
  line-height: 1.65;
  max-width: 820px;
}

#tab-simulador .sim-live-success-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
  margin-bottom: 18px;
}

#tab-simulador .sim-live-success-item {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(25, 60, 35, .08);
}

#tab-simulador .sim-live-success-item span {
  display: block;
  color: #7b8b82;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 7px;
  font-weight: 800;
}

#tab-simulador .sim-live-success-item strong {
  color: #1e3125;
  font-size: 16px;
  font-weight: 800;
}

#tab-simulador .sim-live-success-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#tab-simulador .sim-live-success .sim-live-secondary-btn {
  background: #f0f5f1;
  color: #355640;
  border: 1px solid rgba(53, 86, 64, .08);
}

/* MODAL */
#tab-simulador .sim-live-modal[hidden] {
  display: none !important;
}

#tab-simulador .sim-live-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

#tab-simulador .sim-live-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 20, 40, .58);
  backdrop-filter: blur(3px);
}

#tab-simulador .sim-live-modal-dialog {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100vw - 28px));
  margin: 40px auto;
  border-radius: 28px;
  padding: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  box-shadow: 0 28px 80px rgba(10, 20, 50, .28);
  border: 1px solid rgba(24, 42, 95, .08);
  max-height: calc(100vh - 80px);
  overflow: auto;
}

#tab-simulador .sim-live-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 0;
  background: #f4f6fb;
  color: #304160;
  font-size: 24px;
  cursor: pointer;
}

#tab-simulador .sim-live-modal-head h4 {
  margin: 10px 0 6px;
  font-size: 26px;
  color: #16223d;
  line-height: 1.1;
  font-weight: 800;
}

#tab-simulador .sim-live-modal-head p {
  margin: 0 0 18px;
  color: #66748f;
  font-size: 14px;
  line-height: 1.6;
}

#tab-simulador .sim-live-receipt {
  border-radius: 24px;
  padding: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  border: 1px solid rgba(28, 48, 102, .08);
}

#tab-simulador .sim-live-receipt-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px dashed rgba(35, 54, 102, .14);
  margin-bottom: 16px;
}

#tab-simulador .sim-live-receipt-brand {
  color: #4253d8;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

#tab-simulador .sim-live-receipt-title {
  color: #18253f;
  font-size: 24px;
  font-weight: 800;
}

#tab-simulador .sim-live-receipt-number {
  padding: 10px 14px;
  border-radius: 16px;
  background: #eef2ff;
  color: #4456dc;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

#tab-simulador .sim-live-receipt-grid,
#tab-simulador .sim-live-receipt-contract {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  margin-bottom: 14px;
}

#tab-simulador .sim-live-receipt-grid > div,
#tab-simulador .sim-live-receipt-contract > div {
  padding: 14px;
  border-radius: 18px;
  background: #fbfcff;
  border: 1px solid rgba(24, 42, 95, .06);
}

#tab-simulador .sim-live-receipt-grid span,
#tab-simulador .sim-live-receipt-contract span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #91a0b7;
  margin-bottom: 7px;
  font-weight: 800;
}

#tab-simulador .sim-live-receipt-grid strong,
#tab-simulador .sim-live-receipt-contract strong {
  color: #1f2c47;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
}

#tab-simulador .sim-live-receipt-footer {
  padding-top: 14px;
  border-top: 1px dashed rgba(35, 54, 102, .14);
  color: #6d7c95;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 991px) {
  #tab-simulador .sim-live-grid,
  #tab-simulador .sim-live-success-grid {
    grid-template-columns: 1fr;
  }

  #tab-simulador .sim-live-head,
  #tab-simulador .sim-live-actionbar,
  #tab-simulador .sim-live-receipt-top {
    flex-direction: column;
  }

  #tab-simulador .sim-live-pay-meta,
  #tab-simulador .sim-live-receipt-grid,
  #tab-simulador .sim-live-receipt-contract {
    grid-template-columns: 1fr;
  }

  #tab-simulador .sim-live-action-right {
    width: 100%;
  }

  #tab-simulador .sim-live-primary-btn,
  #tab-simulador .sim-live-secondary-btn {
    width: 100%;
    justify-content: center;
  }

  #tab-simulador .sim-live-status-row {
    grid-template-columns: 14px 1fr;
  }

  #tab-simulador .sim-live-status-badge {
    grid-column: 2;
    justify-self: start;
    margin-top: 4px;
  }
}

@media (max-width: 640px) {
  #tab-simulador .sim-live-shell,
  #tab-simulador .sim-live-card,
  #tab-simulador .sim-live-success,
  #tab-simulador .sim-live-modal-dialog {
    border-radius: 20px;
  }

  #tab-simulador .sim-live-title {
    font-size: 24px;
  }

  #tab-simulador .sim-live-success-copy h4,
  #tab-simulador .sim-live-modal-head h4,
  #tab-simulador .sim-live-receipt-title {
    font-size: 22px;
  }

  #tab-simulador .sim-live-pay-value {
    font-size: 18px;
  }
}


/* ===========================
   ENTRADA ALIAS / PRE-FLUJO
=========================== */
#tab-simulador .sim-entry-title{
  font-size: 22px;
  line-height: 1.15;
  font-weight: 800;
  color: #16223d;
  margin-bottom: 8px;
}

#tab-simulador .sim-entry-sub{
  font-size: 14px;
  line-height: 1.65;
  color: #63728e;
  margin-bottom: 12px;
}

#tab-simulador .sim-entry-note{
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg,#f8fbff 0%,#f4f8ff 100%);
  border: 1px solid rgba(61,79,209,.10);
  color: #4f6285;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 16px;
}

#tab-simulador .sim-live-status{
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 600;
}

#tab-simulador .sim-live-status.is-loading{
  display: block;
  background: #f6f8ff;
  border: 1px solid rgba(61,79,209,.10);
  color: #4d60a4;
}

#tab-simulador .sim-live-status.is-ok{
  display: block;
  background: #eefbf2;
  border: 1px solid rgba(47,180,100,.16);
  color: #1e7d43;
}

#tab-simulador .sim-live-status.is-error{
  display: block;
  background: #fff4f4;
  border: 1px solid rgba(214,72,72,.14);
  color: #b33a3a;
}

#tab-simulador .sim-live-next{
  display: none;
  margin-top: 16px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg,#ffffff 0%,#fbfcff 100%);
  border: 1px solid rgba(27,44,95,.08);
  box-shadow: 0 10px 28px rgba(17,24,39,.05);
}

#tab-simulador .sim-live-next.is-visible{
  display: block;
}

#tab-simulador .sim-live-next-text{
  font-size: 14px;
  line-height: 1.65;
  color: #596983;
  margin-bottom: 14px;
}

#tab-simulador .sim-live-next .btn-sim-live,
#tab-simulador .sim-live-next .btn-sim-secondary{
  margin-right: 8px;
  margin-bottom: 8px;
}

/* ===========================
   RECAUDOS EN BLOQUE PREMIUM
=========================== */
#tab-simulador .sim-live-warning{
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg,#fffdf7 0%,#fffaf0 100%);
  border: 1px solid rgba(219,166,63,.16);
}

#tab-simulador .sim-live-warning-title{
  font-size: 13px;
  font-weight: 800;
  color: #7a5b17;
  margin-bottom: 10px;
}

#tab-simulador .sim-live-warning-list{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#tab-simulador .sim-live-warning-list span{
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(122,91,23,.08);
  color: #7a6740;
  font-size: 12px;
  font-weight: 700;
}



.sim-detect-modal[hidden] {
  display: none !important;
}

.sim-detect-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.sim-detect-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(6px);
}

.sim-detect-dialog {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  margin: 10vh auto 0;
  background: #fff;
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .22);
  animation: simDetectIn .28s ease;
}

.sim-detect-badge {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(34, 197, 94, .12);
  color: #15803d;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 12px;
}

.sim-detect-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.sim-detect-grid div {
  background: #f8fafc;
  border-radius: 16px;
  padding: 14px;
}

.sim-detect-grid span {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
}

.sim-detect-grid strong {
  display: block;
  color: #0f172a;
  font-size: 15px;
}

.sim-detect-note {
  margin-top: 16px;
  font-size: 14px;
  color: #475569;
}

.sim-live-inline-box {
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, #f8fbff 0%, #eef4ff 100%);
  border: 1px solid rgba(61, 79, 209, .10);
}

.sim-live-inline-help {
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 16px;
}

.sim-live-inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.sim-live-inline-status {
  margin-top: 14px;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
}

.sim-live-inline-status.ok {
  background: rgba(34, 197, 94, .10);
  color: #15803d;
}

.sim-live-inline-status.error {
  background: rgba(239, 68, 68, .10);
  color: #b91c1c;
}

.sim-live-inline-wait {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px dashed rgba(15, 23, 42, .16);
}

.sim-live-inline-wait-title {
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}

.sim-live-inline-wait-sub {
  font-size: 14px;
  color: #475569;
}

@keyframes simDetectIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sim-input-locked {
  background: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
  opacity: 1;
}


.dot-pulse {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  background: #e53935;
  vertical-align: middle;
  animation: dotPulse 1.2s infinite ease-in-out;
}

@keyframes dotPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.45);
    opacity: .55;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}



/* =========================
   INDEXACIONES · HEADER STICKY
   ========================= */

.section-idx-sticky{
  position: relative;
}

.idx-sticky-top{
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 10px 0 14px;
  margin: 0 0 10px;
}

.idx-sticky-top::before{
  content: "";
  position: absolute;
  top: -28px;
  bottom: -16px;
  left: -20px;
  right: -20px;
  z-index: -1;
  background: #f8fbff;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.idx-sticky-top::after{
  content: "";
  position: absolute;
  left: -20px;
  right: -20px;
  bottom: -18px;
  height: 24px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(248,251,255,1) 0%, rgba(248,251,255,0) 100%);
}

.idx-tabs-strip{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.idx-tab{
  width: 100%;
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  padding: 12px 10px;
  text-align: left;
  transition: all .18s ease;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.idx-tab:hover{
  transform: translateY(-1px);
}

.idx-tab.active{
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #eef2ff 0%, #ffffff 100%);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.12);
}

.idx-tab-title,
.idx-tab-count,
.idx-tab-amount{
  display: block;
}

.idx-tab-title{
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 6px;
}

.idx-tab-count{
  font-size: 22px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
  margin-bottom: 4px;
}

.idx-tab-amount{
  font-size: 12px;
  font-weight: 700;
  color: #3d4fd1;
}


.section-idx-sticky{
  position: relative;
}

.idx-sticky-top{
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 10px 0 14px;
  margin: 0 0 10px;
}

.idx-sticky-top::before{
  content: "";
  position: absolute;
  top: -28px;
  bottom: -16px;
  left: -20px;
  right: -20px;
  z-index: -1;
  background: #f8fbff;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.idx-sticky-top::after{
  content: "";
  position: absolute;
  left: -20px;
  right: -20px;
  bottom: -18px;
  height: 24px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(248,251,255,1) 0%, rgba(248,251,255,0) 100%);
}


#reciboModal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#reciboModal.open {
  display: flex;
}

#reciboModal .modal-dialog,
#reciboModal .recibo-modal-dialog {
  width: min(100%, 560px);
  max-height: calc(100dvh - 32px);
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#reciboModalBody {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(100dvh - 80px);
  padding: 18px;
}

/* opcional: que el encabezado quede fijo si lo tenés por fuera del body */
#reciboModal .modal-header,
#reciboModal .recibo-modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
}

/* opcional: footer fijo */
#reciboModal .modal-footer,
#reciboModal .recibo-modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: #fff;
}

/* mobile */
@media (max-width: 576px) {
  #reciboModal {
    padding: 10px;
    align-items: flex-end;
  }

  #reciboModal .modal-dialog,
  #reciboModal .recibo-modal-dialog {
    width: 100%;
    max-height: calc(100dvh - 10px);
    border-radius: 18px 18px 0 0;
  }

  #reciboModalBody {
    max-height: calc(100dvh - 70px);
    padding: 16px;
  }
}


#reciboModal {
  position: fixed;
  inset: 0;
  display: none;
  padding: 16px;
  background: rgba(0,0,0,.45);
  overflow-y: auto;
}

#reciboModal.open {
  display: flex;
  justify-content: center;
  align-items: center;
}

#reciboModalBody {
  width: min(100%, 560px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: #fff;
  border-radius: 20px;
  padding: 18px;
}



/* =========================================
   FIX GLOBAL SCROLL PARA MODALES
========================================= */

/* overlays: permiten scroll si el modal supera la pantalla */
.modal-overlay,
.recibo-modal-overlay,
.sim-detect-modal,
.token-overlay {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-top: 16px;
  padding-bottom: 16px;
}

/* modal WPP */
.modal {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* modal recibo */
.recibo-modal-card {
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* modal detectar movimientos */
.sim-detect-dialog {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px auto;
}

/* modal token */
.token-card {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* mobile fino */
@media (max-width: 576px) {
  .modal {
    max-height: calc(100dvh - 8px);
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }

  .recibo-modal-overlay,
  .modal-overlay,
  .sim-detect-modal,
  .token-overlay {
    padding: 10px;
  }

  .recibo-modal-card,
  .sim-detect-dialog,
  .token-card {
    max-height: calc(100dvh - 20px);
  }
}



.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15,27,45,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal {
  background: var(--white);
  border-radius: 24px 24px 0 0;
  padding: 24px 20px 40px;
  width: 100%;
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34,1.2,0.64,1);
  box-shadow: 0 -8px 40px rgba(15,27,45,0.15);
}



.recibo-modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .48);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.recibo-modal-overlay.open{
  display: flex;
}

.recibo-modal-card{
  width: 100%;
  max-width: 460px;
  max-height: calc(100dvh - 36px);
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .20);
  position: relative;
  animation: reciboPop .18s ease;

  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#reciboModalBody{
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 18px 16px;
  min-height: 0;
}


#leadFloatBtn.lead-pos-bottom-right{
  right: 16px !important;
  bottom: 96px !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
}

#leadFloatBtn.lead-pos-center{
  right: 16px !important;
  top: 5% !important;
  left: auto !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
}



/* =========================
   IA SUBTABS PRO
========================= */
.ia-subtabs-wrap{
  display:flex;
  gap:10px;
  padding:8px;
  margin:14px 0 16px;
  background: linear-gradient(180deg, #f8faff 0%, #eef3ff 100%);
  border:1px solid rgba(97,115,255,.14);
  border-radius:22px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.85),
    0 10px 26px rgba(61,79,209,.08);
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}

.ia-subtabs-wrap::-webkit-scrollbar{
  display:none;
}

.ia-subtab{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:48px;
  padding:0 18px;
  border:0;
  border-radius:16px;
  background:transparent;
  color:#4b5563;
  font-size:14px;
  font-weight:800;
  letter-spacing:.1px;
  white-space:nowrap;
  cursor:pointer;
  transition:
    transform .18s ease,
    background .22s ease,
    color .22s ease,
    box-shadow .22s ease;
}

.ia-subtab::before{
  content:'';
  position:absolute;
  inset:0;
  border-radius:16px;
  background:linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.36));
  opacity:0;
  transition:opacity .22s ease;
  pointer-events:none;
}

.ia-subtab:hover{
  transform:translateY(-1px);
  color:#24324a;
  background:rgba(255,255,255,.66);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    0 8px 18px rgba(15,23,42,.06);
}

.ia-subtab:hover::before{
  opacity:1;
}

.ia-subtab:active{
  transform:translateY(0);
}

.ia-subtab.active{
  color:#fff;
  background:linear-gradient(135deg, #3d4fd1 0%, #6173ff 55%, #7c8cff 100%);
  box-shadow:
    0 14px 28px rgba(61,79,209,.28),
    0 4px 10px rgba(61,79,209,.16),
    inset 0 1px 0 rgba(255,255,255,.22);
}

.ia-subtab.active::before{
  opacity:0;
}

.ia-subtab-count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:24px;
  height:24px;
  padding:0 8px;
  border-radius:999px;
  background:rgba(61,79,209,.10);
  color:#3d4fd1;
  font-size:11px;
  font-weight:900;
  line-height:1;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7);
}

.ia-subtab.active .ia-subtab-count{
  background:rgba(255,255,255,.18);
  color:#fff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18);
}

/* indicador inferior suave en active */
.ia-subtab.active::after{
  content:'';
  position:absolute;
  left:14px;
  right:14px;
  bottom:-4px;
  height:8px;
  border-radius:999px;
  background:rgba(97,115,255,.26);
  filter:blur(8px);
  pointer-events:none;
}

/* mobile */
@media (max-width: 768px){
  .ia-subtabs-wrap{
    gap:8px;
    padding:7px;
    border-radius:18px;
  }

  .ia-subtab{
    min-height:44px;
    padding:0 14px;
    font-size:13px;
    border-radius:14px;
  }

  .ia-subtab-count{
    min-width:22px;
    height:22px;
    font-size:10px;
    padding:0 7px;
  }
}


/* ===== IA: compactar espacios ===== */

.ia-hero-card{
  margin-bottom: 10px !important;
}

.ia-subtabs-wrap{
  margin: 8px 0 10px !important;
  padding: 6px !important;
}

#tab-ia .card{
  margin-top: 0 !important;
  padding: 12px !important;
  border-radius: 18px;
}

#tab-ia .card-header{
  margin-bottom: 8px !important;
  padding-bottom: 0 !important;
}

.ia-sugerencias-row{
  margin-top: 6px !important;
  margin-bottom: 8px !important;
  gap: 8px !important;
}

.ia-chat-demo-box{
  margin-top: 6px !important;
}


.ia-chat-input-row{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.ia-chat-input-row .search-cobros-input{
  height: 48px;
  min-height: 48px;
  padding: 0 16px !important;
  line-height: 48px;
  box-sizing: border-box;
  margin: 0 !important;
}

.ia-chat-input-row .search-cobros-input::placeholder{
  line-height: 48px;
}


.ia-msg-link{
  color: #3d4fd1;
  font-weight: 700;
  text-decoration: underline;
  word-break: break-word;
}

.ia-msg-link:hover{
  color: #2436b8;
  text-decoration-thickness: 2px;
}

.ia-msg-bot,
.ia-msg-user{
  word-break: break-word;
  overflow-wrap: anywhere;
}

.ia-msg-link{
  color:#3d4fd1;
  font-weight:800;
  text-decoration:underline;
  text-underline-offset:2px;
  word-break:break-word;
}

.ia-msg-link:hover{
  color:#2436b8;
}

.sig-steps{
  display:flex;
  gap:10px;
  margin:14px 0 16px;
  overflow:auto;
  padding-bottom:4px;
}

.sig-step{
  min-width:140px;
  background:#fff;
  border:1px solid rgba(124,58,237,.10);
  border-radius:16px;
  padding:10px 12px;
  display:flex;
  align-items:center;
  gap:10px;
  box-shadow:0 10px 24px rgba(15,23,42,.05);
  opacity:.72;
  transition:.25s ease;
}

.sig-step.active{
  opacity:1;
  transform:translateY(-1px);
  border-color:rgba(124,58,237,.28);
  box-shadow:0 14px 28px rgba(124,58,237,.10);
}

.sig-step.done{
  opacity:1;
  border-color:rgba(16,185,129,.28);
}

.sig-step-num{
  width:28px;
  height:28px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,#7c3aed,#a78bfa);
  color:#fff;
  font-size:12px;
  font-weight:800;
  flex:0 0 28px;
}

.sig-step-text{
  font-size:12px;
  line-height:1.2;
  font-weight:700;
  color:#1f2937;
}

.sig-mail-card,
.sig-context-card,
.sig-accept-box{
  background:#fff;
  border:1px solid rgba(124,58,237,.10);
  border-radius:18px;
  padding:14px;
  box-shadow:0 10px 24px rgba(15,23,42,.05);
  margin-bottom:14px;
}

.sig-mail-top{
  display:flex;
  align-items:flex-start;
  gap:12px;
}

.sig-mail-icon{
  width:42px;
  height:42px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,#ede9fe,#f5f3ff);
  font-size:20px;
}

.sig-mail-title,
.sig-context-title,
.sig-accept-title{
  font-size:14px;
  font-weight:800;
  color:#111827;
}

.sig-mail-sub,
.sig-context-text,
.sig-accept-text{
  font-size:12px;
  color:#6b7280;
  line-height:1.45;
}

.sig-mail-badge{
  margin-left:auto;
  font-size:11px;
  font-weight:700;
  color:#7c3aed;
  background:rgba(124,58,237,.08);
  border-radius:999px;
  padding:6px 10px;
  white-space:nowrap;
}

.sig-mail-body{
  margin-top:12px;
  font-size:13px;
  color:#374151;
  line-height:1.5;
}

.sig-mail-actions{
  margin-top:12px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.sig-mail-opened,
.sig-mail-file{
  font-size:11px;
  font-weight:700;
  padding:7px 10px;
  border-radius:999px;
  background:#f8fafc;
  color:#334155;
}



.sim-demo-intro{
  margin: 14px 0 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124,58,237,.06), rgba(59,130,246,.05));
  border: 1px solid rgba(124,58,237,.10);
}

.sim-demo-intro-text{
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
  font-weight: 500;
}

.sim-demo-flow{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.sim-demo-flow-pill{
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(124,58,237,.10);
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  box-shadow: 0 6px 18px rgba(15,23,42,.04);
}

.sim-demo-flow-sep{
  font-size: 13px;
  font-weight: 800;
  color: #7c3aed;
}



/* =========================================
   FIX GENERAL MODALES MOBILE / SAFE AREA
========================================= */

body.modal-open-app{
  overflow: hidden !important;
  touch-action: none;
}

.modal-overlay,
.lead-overlay,
.wpp-preview-overlay,
.recibo-modal-overlay,
.idx-wa-bulk-overlay,
.sim-doc-modal{
  padding:
    max(10px, env(safe-area-inset-top))
    10px
    max(10px, env(safe-area-inset-bottom));
}

/* ----- WPP bottom sheet ----- */
.modal{
  width: min(100%, 560px);
  max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
}

.wpp-bubble-wrap{
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-actions{
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 18%, #fff 100%);
  padding-top: 14px;
  margin-top: 10px;
}

/* ----- Lead modal ----- */
.lead-modal{
  width: min(100%, 540px);
  max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 22px 18px 0;
}

.lead-form{
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.lead-actions{
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  gap: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 18%, #fff 100%);
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
  margin-top: 14px;
}

/* ----- Recibo / Factura / previews ----- */
.recibo-modal-card,
.wpp-preview-card,
.sim-doc-modal-dialog{
  max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#reciboModalBody,
#facturaModalBody,
.wpp-chat-shell,
.sim-doc-paper{
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.recibo-modal-actions,
.wpp-preview-actions{
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 18%, #fff 100%);
  padding-top: 14px;
  margin-top: 0;
}

/* ----- Indexación bulk ----- */
.idx-wa-bulk-modal{
  max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

.idx-wa-bulk-list{
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.idx-wa-bulk-actions{
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 18%, #fff 100%);
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

/* ----- Mobile ----- */
@media (max-width: 768px){
  .modal{
    border-radius: 22px 22px 0 0;
    padding: 16px 14px calc(14px + env(safe-area-inset-bottom));
  }

  .lead-modal,
  .recibo-modal-card,
  .wpp-preview-card,
  .idx-wa-bulk-modal{
    width: 100%;
    border-radius: 20px;
  }

  .lead-actions,
  .wpp-preview-actions,
  .recibo-modal-actions,
  .idx-wa-bulk-actions{
    flex-direction: column;
  }

  .lead-actions > * ,
  .wpp-preview-actions > * ,
  .recibo-modal-actions > * ,
  .idx-wa-bulk-actions > * ,
  .modal-actions > *{
    width: 100%;
  }

  .sim-doc-modal-dialog{
    width: calc(100vw - 16px);
    margin: 8px auto;
  }

  .sim-doc-paper{
    border-radius: 18px;
    padding: 16px;
  }

  .sim-doc-paper-grid{
    grid-template-columns: 1fr;
  }
}



.ia-chat-demo-box{
  display: flex;
  flex-direction: column;
  min-height: 520px;
}

.ia-chat-messages{
  flex: 1;
  min-height: 260px;
  max-height: 52vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.ia-chat-input-row{
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 24%, #fff 100%);
}

@media (max-width: 768px){
  .ia-chat-demo-box{
    min-height: 440px;
  }

  .ia-chat-messages{
    max-height: 46vh;
  }
}




/* ===== FIX DEFINITIVO CHAT IA ===== */

#tab-ia .card{
  display: flex;
  flex-direction: column;
}

#tab-ia .ia-chat-demo-box{
  margin-top: 8px !important;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
  display: flex !important;
  flex-direction: column !important;
  height: clamp(320px, 58vh, 560px) !important;
  min-height: 320px !important;
}

#tab-ia .ia-chat-messages{
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding: 14px !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fcfdff;
}

#tab-ia .ia-chat-input-row{
  position: sticky !important;
  bottom: 0 !important;
  z-index: 20 !important;
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom)) !important;
  border-top: 1px solid #e2e8f0;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 22%, #fff 100%) !important;
}

#tab-ia .ia-chat-input-row .search-cobros-input{
  flex: 1 1 auto !important;
  min-width: 0 !important;
  height: 48px;
  min-height: 48px;
  margin: 0 !important;
}

#tab-ia .btn-ia-send{
  flex: 0 0 auto;
}

@media (max-width: 768px){
  #tab-ia .ia-chat-demo-box{
    height: calc(100dvh - 285px) !important;
    min-height: 280px !important;
    max-height: 500px !important;
  }

  #tab-ia .ia-chat-input-row{
    gap: 8px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom)) !important;
  }
}



.ia-subtabs-wrap{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ia-subtabs-wrap::-webkit-scrollbar{
  display: none;
}

.ia-subtab{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  white-space: nowrap;

  padding: 8px 12px;
  min-height: 34px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.ia-subtab-count{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
}


.ia-hero-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ia-hero-top > div:first-child{
  flex: 1 1 auto;
  min-width: 0;
}

.ia-subtabs-wrap{
  flex: 0 0 auto;
}



@media (max-width: 768px){
  .ia-hero-top{
    flex-direction: column;
    align-items: stretch;
  }

  .ia-subtabs-wrap{
    width: 100%;
    margin-top: 8px;
  }

  .ia-subtab{
    padding: 7px 10px;
    min-height: 32px;
    font-size: 12px;
  }
}


.ia-subtab{
  padding: 7px 11px;
  min-height: 32px;
  font-size: 12px;
}


#tab-ia .ia-chat-messages{
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
}



#tab-ia .ia-chat-demo-box{
  height: clamp(260px, 42vh, 420px) !important;
  min-height: 260px !important;
}




#tab-ia .ia-chat-messages{
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}



/* ===== FIX CHAT IA · bienvenida cerca sin romper scroll ===== */

#tab-ia .ia-chat-demo-box{
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: clamp(240px, 36vh, 340px) !important;
  margin-top: 6px !important;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
}

#tab-ia .ia-chat-messages{
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding: 12px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  justify-content: flex-start !important;
  background: #fcfdff;
}

#tab-ia .ia-chat-input-row{
  position: sticky !important;
  bottom: 0 !important;
  z-index: 10 !important;
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px 12px !important;
  border-top: 1px solid #e2e8f0;
  background: #fff !important;
}

#tab-ia .ia-chat-input-row .search-cobros-input{
  flex: 1 1 auto !important;
  min-width: 0 !important;
  height: 46px;
  min-height: 46px;
  margin: 0 !important;
}

@media (max-width: 768px){
  #tab-ia .ia-chat-demo-box{
    height: clamp(220px, 32vh, 300px) !important;
  }

  #tab-ia .ia-chat-messages{
    padding: 10px !important;
  }

  #tab-ia .ia-chat-input-row{
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom)) !important;
  }
}


