/**
 * Admin — Design System
 * Única fuente de color del backend. Los módulos consumen estos tokens.
 * :root es el modo claro. .dark (en html o body) pasa al modo oscuro.
 */

:root {
  --ae-fondo: #F3F2F7;
  --ae-seccion: #E7E6EE;
  --ae-superficie: #FFFFFF;
  --ae-superficie-suave: #EEEDF4;
  --ae-borde: #DDDCE4;
  --ae-titulo: #12101A;
  --ae-texto: #2A2833;
  --ae-texto-secundario: #6F6D78;
  --ae-primario: #B2E915;
  --ae-primario-presionado: #96C40F;
  --ae-sobre-primario: #12101A;
  --ae-secundario: #6F4DF3;
  --ae-sobre-secundario: #FFFFFF;
  --ae-icono: #12101A;
  --ae-fondo-icono: #EEEDF4;
  --ae-fondo-icono-primario: #12101A;
  --ae-fuente: "Inter", system-ui, sans-serif;

  --bb-background: var(--ae-fondo);
  --bb-action: var(--ae-primario);
  --bb-text: var(--ae-texto);
  --bb-surface: var(--ae-superficie);
  --bb-surface-soft: var(--ae-superficie-suave);
  --bb-sidebar: var(--ae-seccion);
  --bb-card: var(--ae-superficie);
  --bb-action-pressed: var(--ae-primario-presionado);
  --bb-action-soft: rgba(178, 233, 21, 0.22);
  --bb-action-border: rgba(178, 233, 21, 0.55);
  --bb-accent: var(--ae-secundario);
  --bb-title: var(--ae-titulo);
  --bb-text-secondary: var(--ae-texto-secundario);
  --bb-on-action: var(--ae-sobre-primario);
  --bb-border: var(--ae-borde);
  --bb-border-light: #E7E6EE;

  --bb-primary: var(--bb-action);
  --bb-primary-bright: var(--bb-action-pressed);
  --bb-primary-soft: var(--bb-action-soft);
  --bb-primary-border: var(--bb-action-border);

  --bb-danger: #e23e3e;
  --bb-success: #16a34a;
  --bb-lime: var(--ae-primario);
  --bb-white: var(--ae-sobre-primario);

  --bb-shadow-sm: 0 1px 2px rgba(18, 16, 26, 0.06);
  --bb-shadow-md: 0 8px 20px rgba(18, 16, 26, 0.08);
  --bb-shadow-lg: 0 20px 50px rgba(18, 16, 26, 0.12);

  /* Tipografía */
  --bb-font-size-xs: 11px;
  --bb-font-size-sm: 12px;
  --bb-font-size-base: 13px;
  --bb-font-size-md: 14px;
  --bb-font-size-lg: 16px;
  --bb-font-size-xl: 18px;
  --bb-font-size-2xl: 24px;

  /* Espaciado */
  --bb-radius-sm: 8px;
  --bb-radius-md: 10px;
  --bb-radius-lg: 12px;
  --bb-radius-xl: 14px;
  --bb-radius-2xl: 16px;
  --bb-radius-pill: 999px;

  --bb-gap-xs: 6px;
  --bb-gap-sm: 8px;
  --bb-gap-md: 12px;
  --bb-gap-lg: 16px;
  --bb-gap-xl: 20px;

  /* Transiciones */
  --bb-transition-fast: 0.15s ease;
  --bb-transition-base: 0.2s ease;
}

.dark {
  --ae-fondo: #070417;
  --ae-seccion: #1E2136;
  --ae-superficie: #1B1D2C;
  --ae-superficie-suave: #232640;
  --ae-borde: #2C2E40;
  --ae-titulo: #FFFFFF;
  --ae-texto: #F4F4F6;
  --ae-texto-secundario: #9A9BA6;
  --ae-primario: #B2E915;
  --ae-primario-presionado: #96C40F;
  --ae-sobre-primario: #12101A;
  --ae-secundario: #6F4DF3;
  --ae-sobre-secundario: #FFFFFF;
  --ae-icono: #FFFFFF;
  --ae-fondo-icono: #12101E;
  --ae-fondo-icono-primario: #12101A;

  --bb-border-light: #3A3C52;
  --bb-action-soft: rgba(178, 233, 21, 0.16);
  --bb-action-border: rgba(178, 233, 21, 0.4);
  --bb-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --bb-shadow-md: 0 8px 20px rgba(0, 0, 0, 0.35);
  --bb-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.45);
}

/* Barras de scroll. El color sale del tema, claro u oscuro. */

* {
  scrollbar-width: thin;
  scrollbar-color: var(--ae-texto-secundario) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ae-texto-secundario) 70%, transparent);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--ae-texto-secundario);
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

/* ── Layout de página ───────────────────────────────────── */

.bb-page-header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bb-gap-lg);
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--bb-gap-xl);
}

.bb-page-header h2 {
  margin: 0 0 var(--bb-gap-xs);
  font-size: var(--bb-font-size-2xl);
  color: var(--bb-text);
}

.bb-page-subtitle {
  margin: 0;
  color: var(--bb-text-secondary);
  font-size: var(--bb-font-size-md);
}

.bb-header-actions {
  display: flex;
  gap: var(--bb-gap-sm);
  flex-wrap: wrap;
  align-items: center;
}

/* ── Botones ────────────────────────────────────────────── */

.bb-btn {
  border: none;
  border-radius: var(--bb-radius-pill);
  padding: 11px 16px;
  font-size: var(--bb-font-size-base);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--bb-gap-sm);
  text-decoration: none;
  transition: opacity var(--bb-transition-base), transform var(--bb-transition-base), background var(--bb-transition-base);
}

.bb-btn:hover {
  opacity: 0.92;
}

.bb-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bb-btn-primary {
  background: var(--bb-action);
  color: var(--bb-on-action);
}

.bb-btn-muted {
  background: var(--bb-surface);
  color: var(--bb-text);
  border: 1px solid var(--bb-border);
}

.bb-btn-danger {
  background: var(--bb-danger);
  color: var(--bb-on-action);
}

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

/* Controles nativos. El violeta marca el estado activo. */

input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  box-sizing: border-box;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px;
  max-width: 16px;
  margin: 0;
  padding: 0 !important;
  border: 1.5px solid var(--ae-borde);
  background: var(--ae-superficie-suave);
  display: inline-grid;
  place-content: center;
  vertical-align: middle;
  cursor: pointer;
  flex-shrink: 0;
}

input[type="checkbox"] {
  border-radius: 6px;
}

input[type="radio"] {
  border-radius: 999px;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background: var(--ae-secundario);
  border-color: var(--ae-secundario);
}

input[type="checkbox"]:checked::before {
  content: "";
  width: 9px;
  height: 5px;
  border: 2px solid var(--ae-sobre-secundario);
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) translate(0, -1px);
}

input[type="radio"]:checked::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ae-sobre-secundario);
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible,
select:focus-visible {
  outline: 2px solid var(--ae-primario);
  outline-offset: 2px;
}

select {
  appearance: none;
  min-height: 40px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--ae-borde) !important;
  border-radius: 12px;
  background-color: var(--ae-superficie-suave);
  color: var(--ae-texto);
  font-family: var(--ae-fuente) !important;
  font-size: 14px;
  font-weight: 500;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239A9BA6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* ── Alertas ────────────────────────────────────────────── */

.bb-alert {
  margin-bottom: var(--bb-gap-lg);
  padding: var(--bb-gap-md) var(--bb-gap-lg);
  border-radius: var(--bb-radius-md);
}

.bb-alert-success {
  background: rgba(22, 163, 74, 0.1);
  color: var(--bb-success);
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.bb-alert-danger {
  background: rgba(226, 62, 62, 0.08);
  color: var(--bb-danger);
  border: 1px solid rgba(226, 62, 62, 0.2);
}

/* ── Stats / KPIs ─────────────────────────────────────────── */

.bb-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bb-gap-sm);
  margin-bottom: var(--bb-gap-lg);
}

.bb-stat {
  flex: 1 1 140px;
  min-width: 120px;
  padding: 10px 14px;
  border: 1px solid var(--bb-border-light);
  border-radius: var(--bb-radius-md);
  background: var(--bb-surface);
}

.bb-stat strong {
  display: block;
  font-size: 20px;
  line-height: 1;
  color: var(--bb-text);
  margin-bottom: 4px;
}

.bb-stat span {
  font-size: var(--bb-font-size-sm);
  color: var(--bb-text-secondary);
}

/* ── Chips y tags ─────────────────────────────────────────── */

.bb-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--bb-radius-pill);
  background: var(--bb-surface);
  border: 1px solid var(--bb-border-light);
  color: var(--bb-text-secondary);
  font-size: var(--bb-font-size-sm);
  font-weight: 600;
}

.bb-chip-strong {
  background: var(--bb-action-soft);
  border-color: var(--bb-action-border);
  color: var(--bb-accent);
}

/* ── Tarjetas base ────────────────────────────────────────── */

.bb-card {
  background: var(--bb-surface);
  border: 1px solid var(--bb-border-light);
  border-radius: var(--bb-radius-xl);
  padding: var(--bb-gap-lg);
  transition: border-color var(--bb-transition-fast), box-shadow var(--bb-transition-fast);
}

.bb-card:hover {
  border-color: var(--bb-border);
  box-shadow: var(--bb-shadow-md);
}

.bb-card.is-selected,
.bb-card.is-active {
  border-color: var(--bb-primary);
  box-shadow: 0 0 0 2px var(--bb-primary-soft);
}

/* ── Empty state ──────────────────────────────────────────── */

.bb-empty-state {
  text-align: center;
  padding: 48px 20px;
  border: 1px dashed var(--bb-border);
  border-radius: var(--bb-radius-2xl);
  color: var(--bb-text-secondary);
}

/* ── Secciones contenedoras ───────────────────────────────── */

.bb-section {
  border: 1px solid var(--bb-border-light);
  border-radius: var(--bb-radius-2xl);
  background: var(--bb-surface-soft);
  padding: var(--bb-gap-lg);
}

.bb-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--bb-gap-sm);
  margin-bottom: var(--bb-gap-md);
}

.bb-section-title {
  margin: 0 0 4px;
  font-size: var(--bb-font-size-lg);
  font-weight: 800;
  color: var(--bb-text);
}

.bb-section-subtitle {
  margin: 0;
  font-size: var(--bb-font-size-base);
  color: var(--bb-text-secondary);
}

/* ── Modales popup ────────────────────────────────────────── */

.bb-modal-popup.popup {
  border-radius: var(--bb-radius-2xl);
  overflow: hidden;
  background: var(--bb-surface);
  color: var(--bb-text);
}

/* ── Marca: logo del tenant, o el nombre si no hay logo ── */

.bb-marca {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 8px 6px 4px;
  text-decoration: none;
}

.bb-marca img {
  width: 72px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.bb-marca-nombre {
  color: var(--ae-titulo);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  text-align: center;
}

.nav_contracted .bb-marca-nombre {
  font-size: 11px;
}

/* ── Cascarón del admin (pisa el CSS compilado) ─────────── */

body {
  background-color: var(--bb-background);
  color: var(--bb-text);
  font-family: var(--ae-fuente);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--bb-title);
}

p {
  color: var(--bb-text-secondary);
}

a {
  color: var(--bb-action);
}

a:hover {
  color: var(--bb-action-pressed);
}

button,
.button {
  background-color: var(--bb-action);
  color: var(--bb-on-action);
}

button svg,
.button svg {
  fill: var(--bb-on-action);
}

button a,
.button a,
button a:hover,
.button a:hover {
  color: var(--bb-on-action);
}

.button-black {
  background-color: var(--bb-surface);
  color: var(--bb-action);
}

input,
textarea,
select {
  background-color: var(--bb-surface);
  color: var(--bb-text);
  border-color: var(--bb-border);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--bb-action);
  outline: none;
}

label {
  color: var(--bb-text);
}

#nav {
  background-color: var(--ae-seccion);
  border-right: 1px solid var(--ae-borde);
  padding: 16px 12px 20px;
}

#nav .logo {
  margin-bottom: 8px;
}

#nav .bb-marca-nombre {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#nav .bb-marca-nombre::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 4px;
  background: var(--ae-primario);
}

#nav .title_nav {
  margin: 18px 8px 8px;
  color: var(--ae-texto-secundario);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

#nav .btn_nav {
  margin: 2px 0;
  list-style: none;
}

#nav .btn_nav a,
#nav .btn_nav a.btn_nav_active {
  color: var(--ae-texto-secundario);
  background: transparent;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  gap: 10px;
}

#nav .btn_nav a svg {
  fill: currentColor;
  flex-shrink: 0;
}

#nav .btn_nav:hover a,
#nav .btn_nav a:hover {
  background-color: var(--ae-superficie);
  color: var(--ae-titulo);
}

#nav .btn_nav:hover svg {
  fill: currentColor;
}

#nav .btn_nav a.active,
#nav .active,
#nav a.active {
  background-color: var(--ae-superficie) !important;
  color: var(--ae-titulo) !important;
}

#nav .btn_nav a.active svg,
#nav .active svg {
  fill: var(--ae-primario) !important;
}

#nav .deploy,
#nav .deploy a {
  background: transparent;
  color: var(--ae-texto-secundario);
}

#nav .contraer_retraer,
#nav .contraer_retraer:hover {
  margin-top: 24px;
  background: var(--ae-superficie-suave);
  color: var(--ae-texto-secundario);
  border-radius: 14px;
}

#nav .contraer_retraer svg {
  fill: currentColor;
}

#nav .salir_cel form button {
  background: transparent !important;
  color: var(--ae-texto-secundario) !important;
  font-family: inherit;
}

#nav .active_link {
  color: var(--ae-titulo) !important;
}

.ae-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  margin: -10px -20px 16px;
  padding: 12px 20px;
  background: var(--ae-fondo);
  border-bottom: 1px solid var(--ae-borde);
}

.ae-topbar-menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--ae-borde);
  border-radius: 12px;
  background: var(--ae-superficie);
  color: var(--ae-icono);
  cursor: pointer;
}

.ae-topbar-title {
  flex: 1;
  margin: 0;
  color: var(--ae-titulo);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.ae-topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ae-topbar-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ae-primario);
  color: var(--ae-sobre-primario);
  font-size: 13px;
  font-weight: 800;
}

.ae-topbar-name {
  color: var(--ae-texto);
  font-size: 13px;
  font-weight: 500;
}

.ae-topbar-logout {
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--ae-superficie);
  color: var(--ae-titulo);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ae-topbar-logout:hover {
  background: var(--ae-superficie-suave);
}

@media (max-width: 998px) {
  .ae-topbar {
    margin: -10px -12px 12px;
    padding: 10px 12px;
  }

  .ae-topbar-menu {
    display: inline-flex;
  }

  .ae-topbar-name {
    display: none;
  }
}

#content_all_app_body #app_body {
  background-color: var(--bb-background);
}
#content{
  max-width: 1200px!important;
  margin: 0 auto!important;
  padding: 0 20px!important;
}
@media (max-width: 767px) {
  #content{
    padding: 0!important;
  }
  #app_body{
    padding: 0!important;

  }
  .ae-nav-burger{
    margin: 0 10px!important;
  }
  .contenido{
    padding: 10px!important;
  }
}
.contenido,
#content .box,
.popup,
.popup .content_input,
.btn_salir {
  background: var(--bb-surface);
  color: var(--bb-text);
  border-color: var(--bb-border);
}
.contenido{
  background-color: unset!important;
}
#content .box {
  border: 1px solid var(--bb-border);
  color: var(--bb-text);
}

.popup .close {
  background: var(--bb-action);
  color: var(--bb-on-action);
}

.popup .close:hover {
  background: var(--bb-action-pressed);
  color: var(--bb-on-action);
}

#table table th {
  background: var(--bb-surface-soft);
  color: var(--bb-text);
}

#table table td {
  color: var(--bb-text);
}

#table table tr:hover {
  background-color: var(--bb-action-soft);
}

#table table tr:hover td {
  color: var(--bb-text);
}

.btn_salir button {
  color: var(--bb-text);
  background: transparent;
}

/* ── Acceso admin (login y contraseñas) ─────────────────── */

.bb-auth {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bb-background);
  font-family: "Source Sans 3", sans-serif;
}

.bb-auth-card {
  background: var(--bb-surface);
  color: var(--bb-text);
  border: 1px solid var(--bb-border);
  border-radius: 16px;
  box-shadow: var(--bb-shadow-lg);
  max-width: 460px;
  width: 90%;
  padding: 2rem;
  text-align: center;
}

.bb-auth-card h1,
.bb-auth-card h4 {
  color: var(--bb-title);
  font-size: 20px;
  font-weight: 800;
  margin: 12px 0;
}

.bb-auth-card p,
.bb-auth-card label {
  color: var(--bb-text-secondary);
}

.bb-auth-card input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  padding: 14px;
  font-size: 14px;
  border: 1px solid var(--bb-border);
  background: var(--bb-background);
  color: var(--bb-text);
}

.bb-auth-card .button,
.bb-auth-card button,
.bb-auth .btn-abso {
  background: var(--bb-action);
  color: var(--bb-on-action);
  border: none;
  border-radius: 999px;
  padding: 14px 24px;
  width: 100%;
  cursor: pointer;
  font-weight: 700;
}

.content_login .card,
.content_login .card-header,
.content_login .card-body {
  background: var(--bb-surface);
  color: var(--bb-text);
  border-color: var(--bb-border);
}

.content_login .card-header h4,
.content_login label {
  color: var(--bb-title);
}

.content_login input,
.content_login select {
  background: var(--bb-background);
  color: var(--bb-text);
  border: 1px solid var(--bb-border);
}

/* ── Login ──────────────────────────────────────────────── */

.ae-login {
  min-height: 100vh;
  margin: 0;
  background: var(--ae-fondo);
  color: var(--ae-texto);
  font-family: var(--ae-fuente);
  color-scheme: light;
}

.dark .ae-login {
  color-scheme: dark;
}

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

.ae-login-shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 16px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at -8% -10%, color-mix(in srgb, var(--ae-primario) 34%, transparent) 0%, transparent 68%),
    radial-gradient(ellipse 65% 60% at 108% 110%, color-mix(in srgb, var(--ae-secundario) 40%, transparent) 0%, transparent 70%),
    var(--ae-fondo);
}

.ae-login-form {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 36px 32px 28px;
  border: 1px solid var(--ae-borde);
  border-radius: 24px;
  background: var(--ae-superficie);
  box-shadow: var(--bb-shadow-lg);
}

.ae-login-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  color: var(--ae-primario);
}

.ae-login-mark svg {
  width: 56px;
  height: 42px;
  display: block;
}

.ae-login-hero {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 20px;
  border-radius: 16px;
}

.ae-login-stores {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.ae-login-store {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--ae-titulo);
  color: var(--ae-superficie);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: default;
}

.dark .ae-login-store {
  background: var(--ae-sobre-secundario);
  color: var(--ae-sobre-primario);
}

.ae-login-store img {
  display: block;
  height: 22px;
  width: auto;
}

.ae-login-form h1 {
  margin: 0 0 8px;
  color: var(--ae-titulo);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-align: center;
}

.ae-login-lead {
  margin: 0 0 28px;
  color: var(--ae-texto-secundario);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  text-align: center;
}

.ae-toast-stack {
  position: fixed;
  top: 20px;
  left: 50%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100% - 32px));
  transform: translateX(-50%);
}

.ae-toast {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--ae-borde);
  border-radius: 16px;
  background: var(--ae-superficie);
  color: var(--ae-titulo);
  font-family: var(--ae-fuente);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: var(--bb-shadow-md);
}

.ae-toast-error {
  border-color: var(--bb-danger);
}

.ae-toast-ok {
  border-color: var(--ae-primario);
}

.ae-login-status,
.ae-login-error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
}

.ae-login-status {
  background: rgba(22, 163, 74, 0.14);
  color: var(--bb-success);
}

.ae-login-error {
  margin: 8px 0 0;
  padding: 0;
  background: none;
  color: var(--bb-danger);
}

.ae-login-field {
  margin-bottom: 16px;
}

.ae-login-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.ae-login-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--ae-texto);
  font-size: 13px;
  font-weight: 500;
}

.ae-login-field-icon {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 48px;
  color: var(--ae-texto-secundario);
  pointer-events: none;
}

.ae-login-field-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.ae-login-control {
  position: relative;
}

.ae-login-control input,
.ae-login-control select {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 42px;
  border: 1px solid var(--ae-borde);
  border-radius: 12px;
  background: var(--ae-superficie-suave);
  color: var(--ae-texto);
  font-family: inherit;
  font-size: 14px;
}

.ae-login-control input::placeholder {
  color: var(--ae-texto-secundario);
}

.ae-login-control input[type="password"],
.ae-login-control input[type="text"]#password,
.ae-login-control input[type="text"]#password_confirmation {
  padding-right: 48px;
}

.ae-login-control input:focus,
.ae-login-control select:focus {
  outline: 2px solid var(--ae-primario);
  outline-offset: 2px;
  border-color: var(--ae-primario);
}

.ae-login-eye {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ae-icono);
  cursor: pointer;
}

.ae-login-eye svg {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.ae-login-eye-hide,
.ae-login-eye.is-on .ae-login-eye-show {
  display: none;
}

.ae-login-eye.is-on .ae-login-eye-hide {
  display: block;
}

.ae-login-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 24px;
  color: var(--ae-texto-secundario);
  font-size: 13px;
  font-weight: 500;
}

.ae-login-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--ae-primario);
}

.ae-login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: var(--ae-titulo);
  color: var(--ae-superficie);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--bb-transition-fast), transform var(--bb-transition-fast);
}

.ae-login-submit svg {
  width: 18px;
  height: 18px;
}

.dark .ae-login-submit {
  background: var(--ae-primario);
  color: var(--ae-sobre-primario);
}

.ae-login-submit:hover {
  background: var(--ae-texto);
}

.dark .ae-login-submit:hover {
  background: var(--ae-primario-presionado);
}

.ae-login-submit:active {
  transform: translateY(1px);
}

.ae-login-forgot {
  margin-bottom: 8px;
  color: var(--ae-texto-secundario);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.ae-login-forgot:hover,
.ae-login-forgot:focus-visible {
  color: var(--ae-titulo);
  text-decoration: underline;
}

@media (max-width: 480px) {
  .ae-login-form {
    padding: 28px 18px 22px;
  }

  .ae-login-label-row {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ae-login-submit {
    transition: none;
  }

  .ae-login-submit:active {
    transform: none;
  }
}

/* ── Sidebar ────────────────────────────────────────────── */

#nav.ae-nav {
  display: flex;
  flex-direction: column;
  width: 248px;
  height: 100vh;
  padding: 16px 12px 12px;
  overflow: hidden;
  background: var(--ae-seccion);
  border-right: 1px solid var(--ae-borde);
}

#content_all_app_body #app_body {
  width: calc(100% - 248px);
  border-radius: 0;
}

html.ae-nav-collapsed #nav.ae-nav,
#nav.ae-nav.nav_contracted {
  width: 76px !important;
  padding: 16px 10px 12px !important;
}

html.ae-nav-collapsed #content_all_app_body #app_body,
.app_body_extend {
  width: calc(100% - 76px) !important;
}

#nav.ae-nav .ae-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

#nav.ae-nav .ae-nav-marca,
#nav.ae-nav .bb-marca {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  justify-content: flex-start;
  padding: 0;
}

#nav.ae-nav .bb-marca img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

#nav.ae-nav .bb-marca-nombre {
  font-size: 15px;
  text-align: left;
}

#nav.ae-nav .bb-marca-nombre::before {
  display: none;
}

#nav.ae-nav .ae-nav-collapse,
#nav.ae-nav .ae-nav-collapse:hover {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ae-borde);
  border-radius: 12px;
  background: var(--ae-superficie);
  color: var(--ae-texto-secundario);
  cursor: pointer;
}

#nav.ae-nav .ae-nav-collapse span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

#nav.ae-nav .ae-nav-collapse svg {
  fill: none;
  stroke: currentColor;
  width: 18px;
  height: 18px;
}

html.ae-nav-collapsed #nav.ae-nav .ae-nav-collapse svg,
#nav.ae-nav.nav_contracted .ae-nav-collapse svg {
  transform: rotate(180deg);
}

#nav.ae-nav .ae-nav-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#nav.ae-nav .ae-nav-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

#nav.ae-nav .ae-nav-group {
  margin-bottom: 16px;
}

#nav.ae-nav .ae-nav-label,
#nav.ae-nav .title_nav {
  margin: 0 10px 6px;
  color: var(--ae-texto-secundario);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#nav.ae-nav .ae-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin: 2px 0;
  padding: 6px 8px;
  border-radius: 12px;
  color: var(--ae-texto-secundario);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

#nav.ae-nav .ae-nav-link:hover {
  background: var(--ae-superficie);
  color: var(--ae-titulo);
}

#nav.ae-nav .ae-nav-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  color: var(--ae-texto-secundario);
}

#nav.ae-nav .ae-nav-link svg,
#nav.ae-nav .ae-nav-logout svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
}

#nav.ae-nav .ae-nav-link.active {
  background: var(--ae-superficie);
  color: var(--ae-titulo);
}

#nav.ae-nav .ae-nav-link.active .ae-nav-ico {
  background: var(--ae-primario);
  color: var(--ae-sobre-primario);
}

#nav.ae-nav .ae-nav-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--ae-borde);
}

#nav.ae-nav .ae-nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 4px;
}

#nav.ae-nav .ae-nav-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--ae-primario);
  color: var(--ae-sobre-primario);
  font-size: 13px;
  font-weight: 800;
}

#nav.ae-nav .ae-nav-user-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#nav.ae-nav .ae-nav-user-name {
  overflow: hidden;
  color: var(--ae-titulo);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#nav.ae-nav .ae-nav-user-rol {
  color: var(--ae-texto-secundario);
  font-size: 12px;
  font-weight: 500;
}

#nav.ae-nav .ae-nav-theme {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ae-texto-secundario);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

#nav.ae-nav .ae-nav-theme:hover {
  background: var(--ae-superficie);
  color: var(--ae-titulo);
}

#nav.ae-nav .ae-nav-theme-ico {
  color: inherit;
}

#nav.ae-nav .ae-icon-luna {
  display: none;
}

html:not(.dark) #nav.ae-nav .ae-icon-sol {
  display: none;
}

html:not(.dark) #nav.ae-nav .ae-icon-luna {
  display: block;
}

#nav.ae-nav .ae-nav-logout-form {
  margin: 0;
}

#nav.ae-nav .ae-nav-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ae-texto-secundario);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

#nav.ae-nav .ae-nav-logout:hover {
  background: var(--ae-superficie);
  color: var(--ae-titulo);
}

html.ae-nav-collapsed #nav.ae-nav .ae-nav-head,
#nav.ae-nav.nav_contracted .ae-nav-head {
  flex-direction: column;
}

html.ae-nav-collapsed #nav.ae-nav .ae-nav-marca,
html.ae-nav-collapsed #nav.ae-nav .bb-marca,
#nav.ae-nav.nav_contracted .ae-nav-marca,
#nav.ae-nav.nav_contracted .bb-marca {
  justify-content: center;
}

html.ae-nav-collapsed #nav.ae-nav .bb-marca-nombre,
#nav.ae-nav.nav_contracted .bb-marca-nombre {
  font-size: 0;
}

html.ae-nav-collapsed #nav.ae-nav .bb-marca-nombre::before,
#nav.ae-nav.nav_contracted .bb-marca-nombre::before {
  display: block;
  width: 10px;
  height: 10px;
  margin: 0 auto;
  border-radius: 4px;
  background: var(--ae-primario);
  content: "";
  font-size: 0;
}

html.ae-nav-collapsed #nav.ae-nav .ae-nav-label,
html.ae-nav-collapsed #nav.ae-nav .ae-nav-text,
html.ae-nav-collapsed #nav.ae-nav .ae-nav-user-copy,
#nav.ae-nav.nav_contracted .ae-nav-label,
#nav.ae-nav.nav_contracted .ae-nav-text,
#nav.ae-nav.nav_contracted .ae-nav-user-copy {
  display: none;
}

html.ae-nav-collapsed #nav.ae-nav .ae-nav-link,
html.ae-nav-collapsed #nav.ae-nav .ae-nav-logout,
html.ae-nav-collapsed #nav.ae-nav .ae-nav-theme,
html.ae-nav-collapsed #nav.ae-nav .ae-nav-user,
#nav.ae-nav.nav_contracted .ae-nav-link,
#nav.ae-nav.nav_contracted .ae-nav-logout,
#nav.ae-nav.nav_contracted .ae-nav-theme,
#nav.ae-nav.nav_contracted .ae-nav-user {
  justify-content: center;
  padding: 4px;
}

.ae-nav-tip {
  position: fixed;
  z-index: 80;
  transform: translateY(-50%);
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--ae-titulo);
  color: var(--ae-fondo);
  font-family: Inter, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.ae-nav-tip[hidden] {
  display: none;
}

.ae-nav-burger {
  display: none;
}

@media (max-width: 998px) {
  .ae-nav-burger {
    position: sticky;
    top: 8px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 8px;
    padding: 0;
    border: 1px solid var(--ae-borde);
    border-radius: 12px;
    background: var(--ae-superficie);
    color: var(--ae-icono);
    cursor: pointer;
  }

  #nav.ae-nav {
    display: none;
    width: min(82vw, 300px);
  }

  #nav.ae-nav.ae-nav-open {
    display: flex;
  }

  #nav.ae-nav .ae-nav-collapse {
    display: none;
  }

  #content_all_app_body #app_body,
  .app_body_extend {
    width: 100% !important;
  }
}
