/* rb-marketing — estilos propios (mismo criterio que rb-fl5) sobre Bootstrap 5.3.
   Pensado para personas con baja visión: Atkinson Hyperlegible, letra base de 18px
   ajustable (A−/A+), contrastes AA o mejores en claro y oscuro y foco siempre visible. */

@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/vendor/fonts/atkinson-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/vendor/fonts/atkinson-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(/vendor/fonts/atkinson-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(/vendor/fonts/atkinson-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(/vendor/fonts/atkinson-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: 700; font-display: swap;
  src: url(/vendor/fonts/atkinson-700-italic.woff2) format("woff2"); }

/* --- Escala de letra (la elige el usuario, queda en localStorage) --- */
html[data-escala="0"] { font-size: 100%; }    /* 16px */
html[data-escala="1"] { font-size: 112.5%; }  /* 18px, por defecto */
html[data-escala="2"] { font-size: 125%; }    /* 20px */
html[data-escala="3"] { font-size: 137.5%; }  /* 22px */

:root {
  --bs-body-font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --bs-body-line-height: 1.55;
  --foco: #0b57d0;
}
[data-bs-theme="light"] {
  --bs-body-color: #16181b;               /* casi negro: contraste ~17:1 */
  --bs-secondary-color: #4a5058;          /* texto secundario ≥ 7:1 (AAA) */
  --bs-link-color: #0a4fb8; --bs-link-color-rgb: 10, 79, 184;
  --bs-link-hover-color: #073a88; --bs-link-hover-color-rgb: 7, 58, 136;
  --ok: #047857;                          /* ≥ 5:1 sobre blanco */
  --error: #b91c1c;
  --alerta: #92400e;
}
[data-bs-theme="dark"] {
  --bs-body-bg: #121417;
  --bs-body-color: #eceff3;
  --bs-secondary-color: #bcc3cc;          /* ≥ 9:1 sobre el fondo oscuro */
  --bs-tertiary-bg: #1b1f24;
  --bs-link-color: #8ab4ff; --bs-link-color-rgb: 138, 180, 255;
  --bs-link-hover-color: #b3ceff; --bs-link-hover-color-rgb: 179, 206, 255;
  --foco: #8ab4ff;
  --ok: #6fdc94;
  --error: #ff9a9a;
  --alerta: #fcd34d;
}

/* Foco bien visible para quien navega con teclado */
:focus-visible { outline: 3px solid var(--foco) !important; outline-offset: 2px; box-shadow: none !important; }
.btn, .form-control, .form-select { --bs-border-width: 1.5px; }
.form-control::placeholder { color: var(--bs-secondary-color); opacity: .85; }

/* El atributo hidden siempre oculta, aunque el elemento tenga d-flex u otra utilidad de display de Bootstrap. */
[hidden] { display: none !important; }

/* --- Nav --- */
.navbar .nav-link, .dropdown-item { font-size: 1rem; }
.navbar .nav-link.active { font-weight: 700; text-decoration: underline; text-underline-offset: .35em; }
.dropdown-menu { max-height: calc(100vh - 6rem); overflow-y: auto; }
.menu-usuario { min-width: 16rem; }
/* Celular (menú colapsado): el menú de usuario va dentro del flujo, a todo el ancho que queda, en vez de flotar
   alineado a la derecha del botón (se salía de la pantalla y tapaba A− / A+). El menú desplegado scrollea si no entra. */
@media (max-width: 991.98px) {
  .navbar-collapse { max-height: calc(100vh - 4.5rem); max-height: calc(100dvh - 4.5rem); overflow-y: auto; }
  .navbar-collapse .menu-usuario { position: static; min-width: 0; max-height: none; overflow: visible; margin-top: .5rem; }
}
[data-bs-theme="light"] .tema-claro, [data-bs-theme="dark"] .tema-oscuro { display: none; }

/* --- Login --- */
.login-card { border-radius: 1rem; }

.table { --bs-table-bg: transparent; }
.table > thead th { background: var(--bs-secondary-bg); }
.table-responsive { position: relative; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* Modo oscuro: botones outline más claros para mantener contraste AA */
[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-color: #ced4da; --bs-btn-border-color: #8c959f; }
[data-bs-theme="dark"] .btn-outline-danger { --bs-btn-color: #f19ca4; --bs-btn-border-color: #f19ca4; }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #8ab4ff; --bs-btn-border-color: #8ab4ff; }
/* La confirmación puede abrirse sobre otro modal: va por encima. */
#confirmModal { z-index: 1070; }


/* --- Generales --- */
.td-num, .table td.td-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.texto-log { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .85rem;
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 30rem; overflow: auto; }
.btn-grande { min-height: 3rem; }
.form-angosto { max-width: 44rem; }
caption { color: var(--bs-body-color); font-weight: 700; }

/* --- Emulador de WhatsApp: colores de la app (fondo beige, burbuja blanca); en oscuro, los de su modo oscuro --- */
.wa-fondo { background: #efeae2; border-radius: .75rem; padding: 1rem; max-width: 26rem; }
.wa-burbuja { position: relative; background: #fff; color: #111b21; border-radius: .6rem; padding: .5rem .6rem 1.3rem;
  box-shadow: 0 1px .5px rgba(11, 20, 26, .13); overflow-wrap: anywhere; }
.wa-titulo { font-weight: 700; margin-bottom: .35rem; }
.wa-pie { color: #667781; font-size: .85rem; margin-top: .35rem; }
.wa-hora { position: absolute; right: .6rem; bottom: .25rem; font-size: .75rem; color: #667781; }
.wa-media { display: block; width: 100%; border-radius: .4rem; margin-bottom: .4rem; }
.wa-media-vacia { display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 7rem;
  background: #d1d7db; color: #3b4a54; font-size: 1.1rem; }
.wa-boton { background: #fff; color: #027eb5; text-align: center; border-radius: .6rem; padding: .45rem; margin-top: .2rem;
  font-weight: 600; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); }
.wa-burbuja mark { background: #fff3a3; color: inherit; padding: 0 .1em; border-radius: .2em; }
[data-bs-theme="dark"] .wa-fondo { background: #0b141a; }
[data-bs-theme="dark"] .wa-burbuja, [data-bs-theme="dark"] .wa-boton { background: #202c33; color: #e9edef; }
[data-bs-theme="dark"] .wa-boton { color: #53bdeb; }
[data-bs-theme="dark"] .wa-pie, [data-bs-theme="dark"] .wa-hora { color: #aebac1; }
[data-bs-theme="dark"] .wa-burbuja mark { background: #6b5d00; color: #fff; }

/* --- Conversación de la bandeja --- */
.chat { display: flex; flex-direction: column; gap: .4rem; max-height: 32rem; overflow-y: auto; padding: .75rem;
  background: var(--bs-tertiary-bg); border-radius: .75rem; }
.chat-msg { max-width: 85%; padding: .45rem .65rem; border-radius: .6rem; overflow-wrap: anywhere; }
.chat-entra { align-self: flex-start; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); }
.chat-sale { align-self: flex-end; background: #d9fdd3; color: #111b21; }
[data-bs-theme="dark"] .chat-sale { background: #005c4b; color: #e9edef; }
.chat-otra-linea { opacity: .75; border-style: dashed; }
.chat-meta { display: block; font-size: .75rem; opacity: .8; margin-top: .15rem; }

/* --- Embudo de estadísticas --- */
.col-barra { width: 35%; min-width: 5rem; }
.barra-celda { display: block; height: .8rem; border-radius: .2rem; background: #15803d; }
[data-bs-theme="dark"] .barra-celda { background: #4ade80; }
