/* =========================================================
   OsFin — Landing Page Styles
   Línea de diseño: "Tech-Finance Futurista" (Dark Mode Avanzado)
   ========================================================= */

:root {
  /* --- Superficies (dark sobrio, sin brillos) --- */
  --color-bg: #0B0C10;
  --color-bg-elevated: #14151B;
  --color-bg-elevated-2: #1B1D25;
  --color-border: #2A2D38;
  --color-border-strong: #363A47;

  /* --- Marca: azul del logo (acento primario) --- */
  --color-blue: #0087F6;
  --color-blue-soft: rgba(0, 135, 246, 0.10);
  --color-blue-strong: #2A97FF;

  /* --- Marca: verde del logo (estado positivo / éxito) --- */
  --color-green: #2BA24C;
  --color-green-soft: rgba(43, 162, 76, 0.12);
  --color-green-strong: #33B356;
  --color-green-platinum: #8FC0A9;   /* verde platinado (contornos sobrios) */

  /* --- Escala de estado del presupuesto: atención (ámbar) y alerta (coral) --- */
  --color-amber: #E0A62E;
  --color-amber-soft: rgba(224, 166, 46, 0.14);
  --color-magenta: #E5576F;
  --color-alert-soft: rgba(229, 87, 111, 0.12);

  --color-text-primary: #EDEEF2;
  --color-text-secondary: #9A9CAE;
  --color-text-muted: #62667A;

  /* --- Tipografía --- */
  --font-primary: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;

  /* --- Layout --- */
  --container-width: 1180px;
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --space-section: clamp(4rem, 8vw, 8rem);

  /* --- Sombras neutras (sin glows de color) --- */
  --shadow-card: 0 12px 30px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.25);
  --transition-base: 0.2s ease;

  /* --- Espaciado consistente (paneles internos: Dashboard, Presupuestos, etc.) --- */
  --gap-sm: 0.75rem;
  --gap-md: 1.125rem;
  --gap-lg: 1.5rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

h1, h2, h3 {
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: 1.15rem; font-weight: 700; }

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

section {
  padding-block: var(--space-section);
}

/* Se eliminaron los orbes de color desenfocados y las animaciones ambientales
   (estética sobria, sin neón). El hero conserva solo un gráfico de líneas tenue. */
@media (prefers-reduced-motion: reduce) {
  .chat-card.is-shaking {
    animation: none;
  }
}

/* --- Utilidad de elevación sobria (antes glow neón) --- */
.glow-cyan,
.glow-magenta {
  box-shadow: var(--shadow-card);
}

/* --- Utilidades de texto --- */
.eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-blue);
  margin-bottom: 1rem;
}

.eyebrow--center {
  display: block;
  text-align: center;
}

.section-lead {
  max-width: 640px;
  color: var(--color-text-secondary);
  font-size: 1.05rem;
}

.features h2,
.problem h2 {
  text-align: center;
  max-width: 760px;
  margin-inline: auto;
}

.problem .section-lead {
  margin-inline: auto;
  text-align: center;
}

/* --- Botones --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
  white-space: nowrap;
}

.btn--primary {
  background: var(--color-blue);
  color: #FFFFFF;
}

.btn--primary:hover {
  background: var(--color-blue-strong);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn--ghost:hover {
  border-color: var(--color-blue);
  color: var(--color-blue);
}

.btn--text {
  background: none;
  color: var(--color-text-secondary);
  padding-inline: 0;
}

.btn--text:hover {
  color: var(--color-text-primary);
}

/* Botón de acción discreto (outline de acento) para contextos "in-app"
   donde no debe competir con el contenido. */
.btn--premium {
  background: var(--color-blue-soft);
  border: 1px solid rgba(0, 135, 246, 0.30);
  color: var(--color-blue);
}

.btn--premium:hover {
  background: rgba(0, 135, 246, 0.16);
  border-color: var(--color-blue);
  transform: none;
}

.btn--small {
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
}

.btn--large {
  padding: 1rem 2rem;
  font-size: 1.05rem;
}

/* Botón de icono (p. ej. copiar credenciales del asesor) */
.btn--icon.btn--small {
  padding: 0.5rem 0.62rem;
}

.btn--icon svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.btn--icon .btn__label {
  display: none; /* en escritorio solo se ve el icono; el texto vive en el title/aria-label */
}

.btn--icon.is-copied {
  border-color: var(--color-green-strong);
  color: var(--color-green-strong);
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 12, 16, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.15rem;
}

.logo__mark {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-menu {
  position: fixed;
  inset: 76px 0 auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
  transform: translateY(-120%);
  opacity: 0;
  text-align: center;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.nav-menu.is-open {
  transform: translateY(0);
  opacity: 1;
}

.nav-menu a {
  font-weight: 600;
  color: var(--color-text-primary);
}

.nav-menu a:hover {
  color: var(--color-blue);
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

/* Orbes de color desactivados (estética sobria); los <span> del HTML quedan inertes. */
.hero__orb {
  display: none;
}

.hero__chart {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 46%;
  opacity: 0.4;
}

.hero__chart-line {
  fill: none;
  stroke: var(--color-blue);
  stroke-width: 1.5;
  opacity: 0.3;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding-top: 3rem;
}

.hero__subtitle {
  margin-top: 1.25rem;
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  max-width: 540px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

.hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.hero__trust li {
  position: relative;
  padding-left: 1.1rem;
}

.hero__trust li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  translate: 0 -50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-blue);
}

.hero__visual {
  display: flex;
  justify-content: center;
}

/* --- Chat demo card: conversación simulada con OsFin IA --- */
.chat-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-green-platinum);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.chat-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.chat-card__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.chat-card__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-blue);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 800;
}

.chat-card__status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.chat-card__status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-blue);
}

.chat-card__thread {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.25rem;
  background: var(--color-bg);
}

.chat-bubble {
  position: relative;
  max-width: 85%;
  padding: 0.55rem 0.85rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.45;
}

.chat-bubble p {
  margin: 0;
}

.chat-bubble__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  margin-top: 0.25rem;
  font-size: 0.68rem;
  color: var(--color-text-muted);
}

.chat-bubble__ticks {
  color: #53BDEB;
}

/* Globo saliente (usuario) — verde WhatsApp en modo oscuro */
.chat-bubble--user {
  align-self: flex-end;
  background: #005C4B;
  color: #E9EDEF;
  border-bottom-right-radius: 4px;
}

.chat-bubble--user .chat-bubble__meta {
  color: rgba(233, 237, 239, 0.6);
}

.chat-bubble--user::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: -7px;
  width: 12px;
  height: 12px;
  background: inherit;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

/* Globo entrante (OsFin IA) — gris pizarra WhatsApp en modo oscuro */
.chat-bubble--ai {
  align-self: flex-start;
  background: #202C33;
  color: #E9EDEF;
  border-bottom-left-radius: 4px;
}

.chat-bubble--ai::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: -7px;
  width: 12px;
  height: 12px;
  background: inherit;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.chat-bubble--ai .chat-bubble__meta {
  justify-content: flex-start;
}

.chat-bubble--alert {
  background: #202C33;
}

.chat-card__input {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
}

.chat-card__input input {
  flex: 1;
  min-width: 0;
  background: var(--color-bg-elevated-2);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 0.85rem;
}

.chat-card__input input::placeholder {
  color: var(--color-text-muted);
}

.chat-card__send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: var(--color-blue);
  color: #FFFFFF;
  cursor: default;
}

.chat-card__send svg {
  width: 16px;
  height: 16px;
}

/* Efecto de alerta / vibración sutil de OsFin IA */
@keyframes shake-alert {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

.chat-card.is-shaking {
  animation: shake-alert 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  border-color: var(--color-green-platinum);
  box-shadow: var(--shadow-card);
}

/* =========================================================
   Problema
   ========================================================= */
.problem__grid {
  margin-top: 3rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

.problem__card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
}

.problem__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--color-blue-soft);
  color: var(--color-blue);
}

.problem__icon svg {
  width: 22px;
  height: 22px;
}

.problem__card h3 {
  margin-bottom: 0.6rem;
}

.problem__card p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

/* =========================================================
   Solución / Evidencia
   ========================================================= */
.solution__inner {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.solution__steps {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.solution__steps li {
  display: flex;
  gap: 1.25rem;
}

.solution__step-number {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 1rem;
  color: var(--color-blue);
}

.solution__steps h3 {
  margin-bottom: 0.35rem;
}

.solution__steps p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

.evidence-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.evidence-card__title {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  color: var(--color-text-secondary);
}

.evidence-bar {
  margin-bottom: 1.5rem;
}

.evidence-bar__label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: var(--color-text-secondary);
}

.evidence-bar__value {
  font-weight: 700;
  color: var(--color-text-primary);
}

.evidence-bar__track {
  height: 10px;
  border-radius: 999px;
  background: var(--color-bg-elevated-2);
  overflow: hidden;
}

.evidence-bar__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.evidence-bar__fill--alert {
  background: var(--color-magenta);
}

.evidence-bar__fill--support {
  background: var(--color-green);
}

.evidence-card__insight {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  border-top: 1px solid var(--color-border);
  padding-top: 1.25rem;
}

/* =========================================================
   Beneficios — Bento Grid
   ========================================================= */
.bento-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.bento-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.bento-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-blue);
  box-shadow: var(--shadow-card);
}

.bento-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--color-blue-soft);
  color: var(--color-blue);
}

.bento-card__icon svg {
  width: 22px;
  height: 22px;
}

.bento-card h3 {
  margin-bottom: 0.6rem;
}

.bento-card p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.bento-card--alert {
  background: var(--color-alert-soft);
  border-color: rgba(229, 87, 111, 0.35);
}

.bento-card--alert:hover {
  border-color: var(--color-magenta);
  box-shadow: var(--shadow-card);
}

.bento-card--alert .bento-card__icon {
  background: rgba(229, 87, 111, 0.18);
  color: var(--color-magenta);
}

/* =========================================================
   CTA final
   ========================================================= */
.cta-final {
  text-align: center;
}

.cta-final__inner {
  max-width: 620px;
  margin-inline: auto;
}

.cta-final h2 {
  margin-bottom: 1rem;
}

.cta-final p {
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: 2.5rem;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
}

.footer__copy {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.footer__links {
  display: flex;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.footer__links a:hover {
  color: var(--color-text-primary);
}

/* =========================================================
   Auth (Login / Registro) — pantallas de demostración
   ========================================================= */
.auth-body {
  min-height: 100vh;
}

.auth-link {
  color: var(--color-blue);
  font-weight: 600;
  font-size: 0.9rem;
}

.auth-link:hover {
  color: var(--color-blue-strong);
}

.auth-link--back {
  display: inline-block;
  margin-top: 1.75rem;
  color: var(--color-text-secondary);
}

.auth-link--back:hover {
  color: var(--color-text-primary);
}

/* Layout dividido a pantalla completa — sin header ni footer */
.auth-split {
  display: flex;
  min-height: 100vh;
}

/* Columna visual: foto de fondo (gráfica trending). Oculta en móvil. */
.auth-visual {
  display: none;
  position: relative;
  background-color: var(--color-bg-elevated);
  background-size: cover;
  background-position: center;
}

.auth-visual__scrim {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(2rem, 4vw, 3.5rem);
  color: #FFFFFF;
  background: linear-gradient(180deg, rgba(11, 12, 16, 0.55) 0%, rgba(11, 12, 16, 0.3) 42%, rgba(11, 12, 16, 0.92) 100%);
}

.auth-visual__copy {
  max-width: 480px;
}

.auth-visual__copy h1 {
  color: #FFFFFF;
}

.auth-visual__lead {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.auth-showcase__points {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.auth-point {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
}

.auth-point__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
}

.auth-point__icon svg {
  width: 15px;
  height: 15px;
}

/* Columna del formulario: panel sólido, sin tarjeta flotante */
.auth-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  padding: 2.5rem 1.5rem;
}

.auth-panel__inner {
  width: 100%;
  max-width: 400px;
}

.auth-panel__logo {
  margin-bottom: 2.5rem;
}

.auth-panel__title {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}

.auth-panel__subtitle {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.form-field input {
  background: var(--color-bg-elevated-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

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

.form-field input:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px var(--color-blue-soft);
}

/* Campo de contraseña con botón "ver contraseña" */
.password-field {
  position: relative;
  display: flex;
}

.password-field input {
  flex: 1;
  min-width: 0;
  padding-right: 2.9rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--transition-base);
}

.password-toggle:hover {
  color: var(--color-text-primary);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

.password-toggle__off {
  display: none;
}

.password-toggle.is-visible .password-toggle__on {
  display: none;
}

.password-toggle.is-visible .password-toggle__off {
  display: block;
}

.form-error {
  display: block;
  font-size: 0.8rem;
  color: var(--color-magenta);
}

.form-error--banner {
  padding: 0.75rem 1rem;
  background: var(--color-alert-soft);
  border: 1px solid rgba(229, 87, 111, 0.35);
  border-radius: var(--radius-sm);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.checkbox input {
  accent-color: var(--color-blue);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn--block {
  width: 100%;
}

.auth-switch {
  margin-top: 1.75rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.auth-switch a {
  color: var(--color-blue);
  font-weight: 700;
}

.auth-footer {
  border-top: 1px solid var(--color-border);
  padding-block: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* =========================================================
   Panel (Admin / Asesor) — dashboards internos
   ========================================================= */
.dash-shell {
  display: flex;
  min-height: 100vh;
}

/* Los <section> internos no heredan el padding gigante del hero de marketing.
   Se excluye .panel para que conserve su propio padding vertical. */
.dash-main section:not(.panel) {
  padding-block: 0;
}

/* Checkbox oculto que controla el drawer en móvil (sin JS) */
.dash-nav-checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Sidebar — en móvil es un drawer que entra desde la izquierda */
.dash-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 264px;
  max-width: 82vw;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
  padding: 1.5rem 1.25rem;
  background: var(--color-bg-elevated);
  border-right: 1px solid var(--color-border);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
}

.dash-nav-checkbox:checked ~ .dash-sidebar {
  transform: translateX(0);
}

.dash-sidebar__logo {
  margin-bottom: 0.25rem;
}

.dash-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.dash-sidebar__nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background-color var(--transition-base), color var(--transition-base);
}

.dash-sidebar__nav a:hover {
  background: var(--color-bg-elevated-2);
  color: var(--color-text-primary);
}

.dash-sidebar__nav a.is-active {
  background: var(--color-blue-soft);
  color: var(--color-blue);
}

/* Usuario + cerrar sesión, anclado al fondo del sidebar */
.dash-sidebar__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.dash-sidebar__user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

/* Backdrop del drawer (móvil): al tocarlo, cierra */
.dash-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
  cursor: pointer;
}

.dash-nav-checkbox:checked ~ .dash-backdrop {
  opacity: 1;
  visibility: visible;
}

.dash-main {
  flex: 1;
  min-width: 0;
  padding: 0 1.5rem 3rem;
}

/* Topbar como header: barra sólida a todo lo ancho, fija arriba al hacer scroll */
.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin: 0 -1.5rem var(--gap-lg);
  padding: 0.9rem 1.5rem;
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
}

/* El título (2º hijo, tras el botón de menú) empuja el resto a la derecha */
.dash-topbar > :nth-child(2) {
  margin-right: auto;
}

.dash-topbar h1 {
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  line-height: 1.3;
}

.dash-topbar__user {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-top: 0.2rem;
}

/* Botón hamburguesa (label del checkbox) — solo visible en móvil/tablet */
.dash-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  cursor: pointer;
}

.dash-menu-btn svg {
  width: 20px;
  height: 20px;
}

/* Widget de perfil: correo + rol; al abrir muestra "Cerrar sesión" */
.dash-profile {
  position: relative;
  flex-shrink: 0;
}

.dash-profile__trigger {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.6rem 0.35rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  cursor: pointer;
  list-style: none;
}

.dash-profile__trigger::-webkit-details-marker {
  display: none;
}

.dash-profile__trigger:hover {
  border-color: var(--color-border-strong);
}

.dash-profile__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-blue-soft);
  color: var(--color-blue);
}

.dash-profile__avatar svg {
  width: 18px;
  height: 18px;
}

.dash-profile__meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  max-width: 190px;
}

.dash-profile__role {
  order: -1;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.dash-profile__email {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-profile__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 50;
  width: 220px;
  padding: 0.85rem;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
}

.dash-profile__menu-label {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 0.6rem;
  word-break: break-word;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.stat-card__label {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.stat-card__value {
  font-size: 2rem;
  font-weight: 800;
}

.stat-card__hint {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: 0.4rem;
}

.budget-card__hint {
  color: var(--color-text-secondary);
  font-weight: 400;
}

.stat-card--alert .stat-card__value {
  color: var(--color-magenta);
}

.stat-card--support .stat-card__value {
  color: var(--color-green);
}

.panel {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.9rem 1.5rem;
  margin-bottom: 1.75rem;
}

/* El último elemento no suma margen: el espacio inferior lo da el padding del panel */
.panel > *:last-child {
  margin-bottom: 0;
}

.panel__title {
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.panel__header .panel__title {
  margin-bottom: 0;
}

/* Panel colapsable de creación (usa <details>, sin JS) */
.panel--collapsible summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--color-blue);
}

.panel--collapsible summary::-webkit-details-marker {
  display: none;
}

.panel--collapsible .auth-form {
  margin-top: 1.25rem;
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  color: var(--color-text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.data-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover td {
  background: var(--color-bg-elevated-2);
}

.data-table__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Celda con dos líneas: título + subtítulo (p. ej. cliente + motivo) */
.table-stack {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.table-primary {
  font-weight: 600;
  color: var(--color-text-primary);
}

.table-sub {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

/* Buscador de tabla */
.table-search {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.table-search svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.table-search input {
  width: 100%;
  background: var(--color-bg-elevated-2);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.6rem 1rem 0.6rem 2.45rem;
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 0.88rem;
}

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

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

/* Tabla en modo tarjeta (móvil): cada fila se apila con su etiqueta */
@media (max-width: 720px) {
  .data-table--cards {
    min-width: 0;
  }

  .data-table--cards thead {
    display: none;
  }

  .data-table--cards tr {
    display: block;
    background: var(--color-bg-elevated-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 1rem;
    margin-bottom: 0.85rem;
  }

  .data-table--cards tr[hidden] {
    display: none;
  }

  .data-table--cards tr:last-child {
    margin-bottom: 0;
  }

  .data-table--cards td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--color-border);
    text-align: right;
    overflow-wrap: anywhere;
    color: var(--color-text-primary);
  }

  .data-table--cards td:last-child {
    border-bottom: none;
  }

  .data-table--cards td::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    text-align: left;
  }

  /* La celda de acciones va a lo ancho, botones alineados */
  .data-table--cards td[data-label="Acciones"] {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }

  .data-table--cards td[data-label="Acciones"] .data-table__actions {
    margin-top: 0.4rem;
  }

  .data-table--cards td[data-label="Acciones"] .btn {
    flex: 1;
  }

  /* En tarjeta móvil el icono va acompañado de su etiqueta (los botones son anchos) */
  .data-table--cards .btn--icon .btn__label {
    display: inline;
  }
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-badge--active {
  background: var(--color-green-soft);
  color: var(--color-green);
}

.status-badge--active::before {
  background: var(--color-green);
}

.status-badge--inactive {
  background: var(--color-alert-soft);
  color: var(--color-magenta);
}

.status-badge--inactive::before {
  background: var(--color-magenta);
}

.messages {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.messages li {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  border: 1px solid var(--color-border);
}

.messages li.success {
  background: var(--color-green-soft);
  color: var(--color-green);
  border-color: rgba(43, 162, 76, 0.35);
}

.messages li.error {
  background: var(--color-alert-soft);
  color: var(--color-magenta);
  border-color: rgba(229, 87, 111, 0.35);
}

.messages li.info {
  background: var(--color-blue-soft);
  color: var(--color-blue-strong);
  border-color: rgba(0, 135, 246, 0.35);
}

/* Distintivo "Próximamente" (funciones en desarrollo, p. ej. 2FA) */
.tag-soon {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--color-blue-soft);
  color: var(--color-blue-strong);
  border: 1px solid rgba(0, 135, 246, 0.35);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

/* =========================================================
   Pantalla de carga de OsFin IA (generar observaciones)
   ========================================================= */
.is-loading-locked {
  overflow: hidden;
}

.ia-loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(7, 8, 11, 0.82);
  backdrop-filter: blur(8px);
  animation: ia-fade 0.25s ease both;
}

.ia-loader[hidden] {
  display: none;
}

.ia-loader__box {
  width: 100%;
  max-width: 420px;
  padding: 2.4rem 2rem;
  text-align: center;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.ia-loader__badge {
  position: relative;
  width: 84px;
  height: 84px;
  margin: 0 auto 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ia-loader__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid rgba(0, 135, 246, 0.20);
  border-top-color: var(--color-blue);
  border-right-color: var(--color-blue);
  /* !important: gana aunque el sistema tenga "animaciones reducidas";
     un spinner que no gira parece que la app se colgó. */
  animation: ia-spin 0.75s linear infinite !important;
  will-change: transform;
}

.ia-loader__logo {
  display: block;
}

.ia-loader__title {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.ia-loader__step {
  min-height: 1.4em;
  margin: 0 0 1.3rem;
  font-size: 0.95rem;
  color: var(--color-blue-strong);
  font-weight: 600;
}

.ia-loader__step.is-in {
  animation: ia-step-in 0.35s ease both;
}

.ia-loader__bar {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: var(--color-bg-elevated-2);
  overflow: hidden;
}

.ia-loader__bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 45%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-blue), var(--color-green));
  /* !important por la misma razón que el anillo: la barra debe moverse siempre. */
  animation: ia-bar 1.15s linear infinite !important;
  will-change: transform;
}

.ia-loader__note {
  margin: 1.2rem 0 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

@keyframes ia-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes ia-step-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ia-bar {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(235%); }
}

.messages li.warning {
  background: var(--color-bg-elevated-2);
  color: var(--color-text-primary);
}

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

@media (min-width: 900px) {
  .dash-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 260px;
    padding: 2rem 1.5rem;
    transform: none;
    max-width: none;
  }

  .dash-menu-btn,
  .dash-backdrop {
    display: none;
  }
}

@media (min-width: 1024px) {
  .stat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =========================================================
   Panel Cliente — KPIs, presupuestos, observaciones, carga, config
   ========================================================= */
/* Tarjeta destacada (Saldo disponible): el color en el número basta para
   distinguirla, sin bordes ni glow — línea "premium fintech" sobria. */
.stat-card--featured {
  border-left: 3px solid var(--color-green);
}

.stat-card--featured .stat-card__value {
  color: var(--color-green);
}

/* Grid de 4 KPIs del Dashboard de Cliente: fila pareja en escritorio en vez
   de heredar el corte a 3 columnas de .stat-grid (que deja "Saldo" solo). */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-lg);
  margin-bottom: var(--gap-lg);
}

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

@media (min-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --- Mini gráfico de línea (gasto acumulado) --- */
.chart-static {
  width: 100%;
  height: 180px;
  margin-bottom: 0.5rem;
}

.chart-static svg {
  width: 100%;
  height: 100%;
}

.chart-static__caption {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

/* --- Chip de origen (transacciones) --- */
.origin-chip {
  display: inline-flex;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.origin-chip--bot {
  background: var(--color-blue-soft);
  color: var(--color-blue);
}

.origin-chip--csv {
  background: var(--color-amber-soft);
  color: var(--color-text-primary);
}

.origin-chip--manual {
  background: var(--color-bg-elevated-2);
  color: var(--color-text-secondary);
}

.amount--ingreso {
  color: var(--color-blue);
  font-weight: 700;
}

.amount--gasto {
  color: var(--color-text-primary);
  font-weight: 700;
}

/* --- Layout de dos columnas (Presupuestos) --- */
.split-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Cargar CSV: formulario a la izquierda y archivos a la derecha en escritorio;
   apilados (formulario primero) en móvil. */
.carga-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

.carga-layout > .panel {
  margin-bottom: 0;
}

@media (min-width: 1024px) {
  .carga-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .carga-layout .data-table {
    min-width: 0;
  }
}

/* Configuración: Perfil a la izquierda; 2FA y Vinculación apilados a la derecha
   en escritorio. Todo apilado en móvil. */
.config-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

.config-layout__col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.config-layout > .panel,
.config-layout__col > .panel {
  margin-bottom: 0;
}

@media (min-width: 1024px) {
  .config-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* Lista de metadatos de la cuenta (rol, último acceso, etc.) */
.config-meta {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 0;
}

.config-meta > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--color-border);
}

.config-meta > div:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.config-meta dt {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.config-meta dd {
  margin: 0;
  color: var(--color-text-primary);
  font-weight: 600;
  text-align: right;
}

/* --- Barra de presupuesto con marca al 80% --- */
.budget-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.budget-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.budget-card__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
}

.budget-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--color-blue-soft);
  color: var(--color-blue);
  flex-shrink: 0;
}

.budget-card__icon svg {
  width: 18px;
  height: 18px;
}

.budget-card__meta {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.6rem;
}

.budget-bar {
  position: relative;
  margin-bottom: 0.75rem;
}

.budget-bar__track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--color-bg-elevated-2);
}

.budget-bar__fill {
  height: 100%;
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.budget-bar__fill--ok {
  background: var(--color-green);
}

.budget-bar__fill--atencion {
  background: var(--color-amber);
}

.budget-bar__fill--alerta {
  background: var(--color-magenta);
}

.budget-bar__fill--sin_umbral {
  background: var(--color-text-secondary);
  opacity: 0.55;
}

.cat-breakdown {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cat-breakdown__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
  gap: 1rem;
}

.cat-breakdown__name {
  font-weight: 600;
}

.cat-breakdown__amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.budget-bar__tick {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 80%;
  width: 2px;
  background: var(--color-text-muted);
}

.budget-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.status-badge--ok,
.status-badge--informativa {
  background: var(--color-green-soft);
  color: var(--color-green);
}

.status-badge--ok::before,
.status-badge--informativa::before {
  background: var(--color-green);
}

.status-badge--atencion {
  background: var(--color-amber-soft);
  color: var(--color-amber);
}

.status-badge--atencion::before {
  background: var(--color-amber);
}

.status-badge--alerta {
  background: var(--color-alert-soft);
  color: var(--color-magenta);
}

.status-badge--alerta::before {
  background: var(--color-magenta);
}

/* --- Filtros tipo pestaña (Observaciones) --- */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-tabs a {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: border-color var(--transition-base), color var(--transition-base), background-color var(--transition-base);
}

.filter-tabs a:hover {
  color: var(--color-text-primary);
}

.filter-tabs a.is-active {
  background: var(--color-blue-soft);
  border-color: transparent;
  color: var(--color-blue);
}

/* --- Banner informativo neutro --- */
.notice-banner {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--color-blue-soft);
  border: 1px solid rgba(0, 135, 246, 0.30);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
}

.notice-banner svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-blue);
}

/* --- Grilla de tarjetas de observación --- */
.insight-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.insight-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.insight-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.insight-card__date {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.insight-card__title {
  margin-bottom: 0.5rem;
}

.insight-card__body {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.insight-card__support {
  background: var(--color-bg-elevated-2);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
}

.insight-card__support-label {
  display: block;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
  margin-bottom: 0.4rem;
}

.insight-card__support dl {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.insight-card__support div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--color-text-secondary);
}

.insight-card__support dt {
  color: var(--color-text-muted);
}

.insight-card__support dd {
  color: var(--color-text-primary);
  font-weight: 600;
}

/* --- Dropzone de carga CSV --- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  cursor: pointer;
  transition: border-color var(--transition-base), background-color var(--transition-base);
  margin-bottom: 1.25rem;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--color-blue);
  background: var(--color-blue-soft);
}

.dropzone svg {
  width: 32px;
  height: 32px;
  color: var(--color-blue);
}

.dropzone__hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.dropzone__filename {
  font-size: 0.85rem;
  color: var(--color-blue);
  font-weight: 600;
}

.dropzone__filename:empty {
  display: none;
}

/* --- Confirmación inline (eliminar archivo) --- */
.confirm-inline {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--color-alert-soft);
  border: 1px solid rgba(229, 87, 111, 0.35);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.confirm-inline__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* --- Interruptor (2FA) --- */
.switch-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch__track {
  position: absolute;
  inset: 0;
  background: var(--color-bg-elevated-2);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color var(--transition-base), border-color var(--transition-base);
}

.switch__track::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: var(--color-text-secondary);
  border-radius: 50%;
  transition: transform var(--transition-base), background-color var(--transition-base);
}

.switch input:checked + .switch__track {
  background: var(--color-blue-soft);
  border-color: var(--color-blue);
}

.switch input:checked + .switch__track::before {
  transform: translateX(20px);
  background: var(--color-blue);
}

/* --- Distintivo verificado --- */
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-green);
  font-size: 0.82rem;
  font-weight: 700;
}

.verified-badge svg {
  width: 15px;
  height: 15px;
}

.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.mt-sm {
  margin-top: 0.75rem;
}

.mt-lg {
  margin-top: 1.5rem;
}

.mb-md {
  margin-bottom: 1.125rem;
}

/* --- Insights globales (admin) --- */
.insight-muted {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.insight-subtitle {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
}

.insight-callout {
  background: var(--color-bg-elevated-2);
  border-left: 3px solid var(--color-blue);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
}

.insight-alert-row {
  margin-bottom: 1.25rem;
}

.insight-alert-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.insight-alert-row__head > span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

/* --- Formulario flotante disparado por un botón (<details>) --- */
.modal-trigger {
  position: relative;
}

.modal-trigger summary {
  cursor: pointer;
  list-style: none;
}

.modal-trigger summary::-webkit-details-marker {
  display: none;
}

.modal-trigger .panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.6rem);
  z-index: 20;
  width: min(360px, 90vw);
  box-shadow: var(--shadow-card);
  margin-bottom: 0;
}

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

@media (min-width: 960px) {
  .split-layout {
    grid-template-columns: 320px 1fr;
  }

  .insight-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =========================================================
   Scroll reveal
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   Responsive — Tablet / Desktop
   ========================================================= */
@media (min-width: 768px) {
  .problem__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .bento-card--large {
    grid-column: span 2;
  }
}

/* Centrado del contenido apilado en mobile / tablet (antes del layout a dos columnas) */
@media (max-width: 1023px) {
  .hero__content {
    text-align: center;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__trust {
    justify-content: center;
  }

  .solution__content {
    text-align: center;
  }

  .solution__steps {
    align-items: center;
  }

  .solution__steps li {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .evidence-card__title {
    text-align: center;
  }
}

@media (min-width: 1024px) {
  .nav-toggle {
    display: none;
  }

  .nav-menu {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
    padding: 0;
    background: none;
    border: none;
    transform: none;
    opacity: 1;
  }

  .nav-menu a {
    font-size: 0.95rem;
  }

  .hero__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .hero__content {
    max-width: 560px;
  }

  .solution__inner {
    flex-direction: row;
    align-items: center;
  }

  .solution__content,
  .solution__visual {
    flex: 1;
  }

  .bento-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .bento-card--large {
    grid-column: span 1;
  }

  /* Muestra la columna visual (foto) junto al formulario en pantallas amplias */
  .auth-visual {
    display: block;
    flex: 1.7;
  }
}

/* =========================================================
   Panel Asesor — dashboard, bandeja de tickets, atención
   ========================================================= */

/* Dúo de gráficos del dashboard */
.chart-duo {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-lg);
}

/* Gráfico de barras (tickets por semana) — SVG-free, solo CSS */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  height: 200px;
  padding-top: 1rem;
}

.bar-chart__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  height: 100%;
}

.bar-chart__bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 0.35rem;
}

.bar-chart__bar {
  width: 100%;
  max-width: 38px;
  min-height: 4px;
  background: var(--color-blue);
  border-radius: 6px 6px 0 0;
  transition: height var(--transition-base);
}

.bar-chart__count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.bar-chart__label {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

/* Dona de motivos (conic-gradient armado en Python, sin librería) */
.donut {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.donut__chart {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut__hole {
  position: absolute;
  inset: 26%;
  background: var(--color-bg-elevated);
  border-radius: 50%;
}

.donut__legend {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.donut__legend-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.donut__swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.donut__legend-name {
  flex: 1;
  color: var(--color-text-secondary);
}

.donut__legend-value {
  color: var(--color-text-primary);
  font-weight: 600;
}

/* Tarjetas de ticket (bandeja y atención) */
.ticket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.ticket-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.4rem;
}

.ticket-card--link {
  transition: border-color var(--transition-base), transform var(--transition-base);
}

.ticket-card--link:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-2px);
}

.ticket-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ticket-card__date {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.ticket-card__client {
  font-size: 1.05rem;
  font-weight: 700;
}

.ticket-card__motive {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--color-text-primary);
  font-weight: 600;
}

.ticket-card__ai-tag {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  background: var(--color-blue-soft);
  color: var(--color-blue);
}

.ticket-card__summary {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
}

.ticket-card__context {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  border-left: 2px solid var(--color-border-strong);
  padding-left: 0.75rem;
}

.ticket-card__action {
  margin-top: 0.4rem;
}

.ticket-card__open {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-blue);
}

/* Insignias de prioridad */
.prio-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.prio-badge--alta {
  background: var(--color-alert-soft);
  color: var(--color-magenta);
  border-color: rgba(229, 87, 111, 0.35);
}

.prio-badge--media {
  background: var(--color-amber-soft);
  color: var(--color-amber);
  border-color: rgba(224, 166, 46, 0.4);
}

.prio-badge--baja {
  background: var(--color-green-soft);
  color: var(--color-green);
  border-color: rgba(43, 162, 76, 0.35);
}

/* Pantalla de atención: chat + panel de contexto */
.atencion-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-lg);
  align-items: start;
}

.adv-chat {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.adv-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.adv-chat__title {
  font-weight: 700;
}

.adv-chat__notice {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  background: var(--color-bg-elevated-2);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
}

.adv-chat__thread {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 0.4rem;
  margin-bottom: 1rem;
}

.adv-chat__empty {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  text-align: center;
  padding: 2rem 0;
}

.adv-msg {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 82%;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
}

.adv-msg--cliente {
  align-self: flex-start;
  background: var(--color-bg-elevated-2);
  border-bottom-left-radius: 4px;
}

.adv-msg--bot {
  align-self: flex-end;
  background: rgba(0, 135, 246, 0.10);
  border: 1px solid rgba(0, 135, 246, 0.22);
  border-bottom-right-radius: 4px;
}

.adv-msg--asesor {
  align-self: flex-end;
  background: var(--color-blue);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.adv-msg__author {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

.adv-msg__body {
  font-size: 0.9rem;
  line-height: 1.45;
}

.adv-msg__time {
  font-size: 0.68rem;
  opacity: 0.6;
  align-self: flex-end;
}

.adv-chat__composer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
}

.adv-chat__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.adv-chat__presets > form {
  flex: 1 1 200px;
}

.adv-chat__input {
  display: flex;
  gap: 0.6rem;
}

.adv-chat__input input {
  flex: 1;
  min-width: 0;
  background: var(--color-bg-elevated-2);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 0.9rem;
}

.adv-chat__input input:focus {
  outline: none;
  border-color: var(--color-blue);
}

.adv-chat__closed {
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-align: center;
}

/* Panel de contexto financiero (solo lectura) */
.adv-context {
  display: flex;
  flex-direction: column;
}

.adv-context__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.adv-context__num {
  font-size: 1.1rem;
  font-weight: 800;
}

.adv-context__num--ok {
  color: var(--color-green);
}

.adv-context__num--alert {
  color: var(--color-magenta);
}

/* =========================================================
   Atención al cliente — chat "app" + toggle "Ver detalles"
   ========================================================= */
.adv-detog {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* Asunto · prioridad · estado, junto al nombre en el header */
.adv-head__meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.adv-chat__dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-green);
}

.adv-chat__dot--off {
  background: var(--color-text-muted);
}

/* Botón que alterna Chat / Detalles */
.adv-toggle__hide {
  display: none;
}

#detToggle:checked ~ .dash-topbar .adv-toggle__show {
  display: none;
}

#detToggle:checked ~ .dash-topbar .adv-toggle__hide {
  display: inline;
}

#detToggle:checked ~ .dash-topbar .adv-toggle {
  background: var(--color-blue);
  border-color: var(--color-blue);
  color: #FFFFFF;
}

/* Solo una vista a la vez */
.adv-pane--info {
  display: none;
}

#detToggle:checked ~ .adv-pane--chat {
  display: none;
}

#detToggle:checked ~ .adv-pane--info {
  display: block;
}

/* En esta pantalla el chat llena el alto; solo los mensajes scrollean */
.adv-main {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding-bottom: 0;
  overflow: hidden;
}

/* En modo "Ver detalles" la página vuelve a scrollear normal */
.adv-main:has(#detToggle:checked) {
  height: auto;
  overflow: visible;
}

/* --- Chat: parte del cuerpo (sin caja), input siempre abajo --- */
.adv-chat.adv-pane--chat {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-height: none;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: hidden;
}

.adv-chat__notice {
  margin: 0 0 0.5rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-bg-elevated);
}

/* Mensajes: fondo tipo WhatsApp; solo esta área scrollea */
.adv-chat__thread {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  gap: 0.5rem;
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  background: #0B141A;
  border-radius: var(--radius-md);
}

/* Barra de escribir al pie, como parte del cuerpo (sin recuadro) */
.adv-chat__composer {
  gap: 0.6rem;
  padding: 0;
  background: transparent;
  border: none;
}

.adv-chat__closed {
  padding: 1rem;
  border: none;
  background: var(--color-bg-elevated);
  border-radius: var(--radius-sm);
  text-align: center;
}

/* Detalles del cliente en dos columnas (masonry) en escritorio */
@media (min-width: 1024px) {
  #detToggle:checked ~ .adv-pane--info {
    columns: 2;
    column-gap: 1.5rem;
  }

  .adv-pane--info > .panel {
    break-inside: avoid;
  }
}

.adv-budget {
  margin-bottom: 1rem;
}

.adv-budget__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
}

.adv-insight {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--color-border);
}

.adv-insight:last-child {
  border-bottom: none;
}

.adv-insight__title {
  font-weight: 600;
  font-size: 0.9rem;
}

.adv-insight__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.adv-insight__support {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-top: 0.25rem;
  padding: 0.5rem 0.7rem;
  background: var(--color-bg-elevated-2);
  border-radius: var(--radius-sm);
}

.adv-insight__support div {
  display: flex;
  gap: 0.35rem;
  font-size: 0.78rem;
}

.adv-insight__support dt {
  color: var(--color-text-secondary);
}

.adv-insight__support dd {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 1024px) {
  .chart-duo {
    grid-template-columns: 1.5fr 1fr;
  }

  .atencion-layout {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  }
}
