@font-face {
  font-family: 'Bebas Neue';
  src: url("../fonts/BebasNeue.b2b293064f55.ttf") format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Bebas Neue';
  src: url("../fonts/BebasNeue.b2b293064f55.ttf") format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto';
  src: url("../fonts/Roboto.3aa911d4a1e7.ttf") format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto';
  src: url("../fonts/Roboto.3aa911d4a1e7.ttf") format('truetype');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto';
  src: url("../fonts/Roboto.3aa911d4a1e7.ttf") format('truetype');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto';
  src: url("../fonts/Roboto.3aa911d4a1e7.ttf") format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

/* ==============================
   Variables de marca
   ============================== */
:root {
  /* Colores primarios */
  --color-primario-1: #196189;
  --color-primario-2: #41c4aa;

  /* Colores secundarios */
  --color-secundario-1: #3982a5;
  --color-secundario-2: #069a74;
  --color-secundario-3: #354b45;
  --color-secundario-4: #00a0ce;
  --color-secundario-5: #06415d;

  /* Colores de acento */
  --color-acento-1: #75c5c6;
  --color-acento-2: #6dd4a2;
  --color-acento-3: #ff7300;
  --color-acento-4: #96b1ac;
  --color-acento-5: #8987e2;

  /* Textos y fondos */
  --color-texto: #ffffff;
  --color-texto-base: var(--color-secundario-5);
  --color-texto-suave: var(--color-secundario-3);
  --color-fondo: #f8f9fa;
  --color-fondo-elevado: rgba(255, 255, 255, 0.94);
  --sombra-panel: 0 18px 48px rgba(6, 65, 93, 0.12);

  /* Tipografías */
  --fuente-principal: 'Bebas Neue', sans-serif;
  --fuente-secundaria: 'Roboto', sans-serif;
}

/* ==============================
   Estilos base
   ============================== */
html {
  font-size: 16px;
}

body {
  position: relative;
  display: flex;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  font-family: var(--fuente-secundaria);
  background-color: var(--color-fondo);
  color: var(--color-texto-base);
  line-height: 1.5;
  z-index: 0;
}

body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("/static/images/Fondo CDT.1fa16b17461d.png");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  opacity: 0.16;
  pointer-events: none;
  z-index: -1;
}

body,
button,
input,
select,
textarea {
  font-family: var(--fuente-secundaria);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--fuente-principal);
  color: var(--color-secundario-5);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

h1 {
  font-size: clamp(1.9rem, 1.2rem + 1.6vw, 2.6rem);
}

p {
  color: var(--color-texto-base);
  line-height: 1.6;
}

/* Para Webkit (Chrome, Safari, Edge) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[readonly],
input.form-control[readonly],
span.input-group-text {
  background-color: #f8f9fa;
  border: none;
  color: #212529;
  font-weight: 600;
  pointer-events: none;
  box-shadow: none;
  cursor: default;
}

input[readonly]:focus {
  outline: none;
}

/* ==============================
   Sidebar
   ============================== */
.sidebar {
  width: 250px;
  background-color: var(--color-primario-1) !important;
  color: var(--color-texto);
  display: flex;
  flex-direction: column;
  padding-top: 20px;
  overflow-y: auto;
  height: 100vh;
  position: fixed;
  /* z-index menor que modales de Bootstrap (1055) */
  z-index: 1040;
  /* Prevenir cualquier flash durante carga */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* IMPORTANTE: Oculto por defecto hasta que se determine si animar o no */
  transform: translateX(-100%);
  opacity: 0;
}

/* Sidebar visible cuando ya fue animado (sidebar-ready sin first-time-load) */
html.sidebar-ready:not(.first-time-load) .sidebar,
body.sidebar-ready:not(.first-time-load) .sidebar {
  transform: translateX(0);
  opacity: 1;
  transition: none;
}

/* Forzar color de fondo en todos los elementos hijos del sidebar */
.sidebar * {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Solo ocultar en desktop cuando se aplica .hidden manualmente */
.sidebar.hidden {
  margin-left: -260px;
  transition: margin-left 0.3s;
}

.content {
  /* Empezar centrado por defecto */
  margin-left: 0;
  min-height: 100vh;
  min-width: 0;
  max-width: 100%;
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  overflow-x: visible;
  scrollbar-gutter: stable;
}

/* Contenido con margen cuando sidebar está visible */
body.sidebar-ready .content {
  margin-left: 260px;
  /* Prevenir flash de contenido durante carga inicial */
  min-height: 100vh;
}

/* Preparar elementos para animación (prevenir FOUC) */
.content>.container {
  opacity: 1;
}

/* Asegurar que las animaciones no causen reflow horizontal */
.fx-fade-in,
.fx-stagger-in,
.fx-page-enter {
  will-change: transform, opacity;
}

/* Contenedor de tabs estable durante animaciones */
.tab-content {
  overflow-x: visible;
  position: relative;
}

/* Las tablas administran su propio viewport horizontal. */
.card:has(.tab-content),
.card:has(.cert-tabla) {
  overflow: visible;
}

/* Estado inicial para elementos que serán animados */
body:not(.fx-ready) .content>.container>header,
body:not(.fx-ready) .content>.container .card,
body:not(.fx-ready) .content>.container .UDL-card,
body:not(.fx-ready) .content>.container .buttonWeight,
body:not(.fx-ready) .content>.container .buttonWeight2 {
  opacity: 0;
}

/* ========================================
   ANIMACIONES DEL SIDEBAR - Primera Carga
   ======================================== */

/* Sidebar oculto inicialmente */
body:not(.sidebar-ready) .sidebar {
  transform: translateX(-100%);
  opacity: 0;
}

/* Contenido centrado cuando sidebar está oculto */
body:not(.sidebar-ready) .content {
  margin-left: 0 !important;
  transition: margin-left 0.3s ease;
}

/* Títulos de sección ocultos inicialmente SOLO en primera carga */
body.first-time-load:not(.sidebar-ready) .sidebar .menu-title {
  opacity: 0;
  transform: translateY(-10px);
}

/* Links de herramientas ocultos inicialmente SOLO en primera carga */
body.first-time-load:not(.sidebar-ready) .sidebar .tool-link {
  opacity: 0;
  transform: translateY(-15px);
}

/* Prevenir animaciones en sidebar después de primera carga */
body:not(.first-time-load) .sidebar .menu-title,
body:not(.first-time-load) .sidebar .tool-link {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

/* Animación de entrada del sidebar */
@keyframes slideInFromLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Animación de títulos de sección */
@keyframes fadeSlideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animación de links de herramientas */
@keyframes fadeSlideDownTools {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Clases de animación para sidebar */
.fx-sidebar-enter {
  animation: slideInFromLeft 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.fx-section-title {
  animation: fadeSlideDown 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.fx-tool-item {
  animation: fadeSlideDownTools 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Sin transición cuando NO es primera carga */
body:not(.first-time-load) .content {
  transition: none !important;
}

/* Asegurar que las animaciones no causen reflow horizontal */
.fx-fade-in,
.fx-stagger-in,
.fx-page-enter {
  will-change: transform, opacity;
}

/* Contenedor de tabs estable durante animaciones */
.tab-content {
  overflow-x: visible;
  position: relative;
}

/* Las tablas administran su propio viewport horizontal. */
.card:has(.tab-content),
.card:has(.cert-tabla) {
  overflow: visible;
}

/* Estado inicial para elementos que serán animados */
body:not(.fx-ready) .content>.container>header,
body:not(.fx-ready) .content>.container .card,
body:not(.fx-ready) .content>.container .UDL-card,
body:not(.fx-ready) .content>.container .buttonWeight,
body:not(.fx-ready) .content>.container .buttonWeight2 {
  opacity: 0;
}

/* Consolidado: Primera carga usa mismas transiciones base (evita duplicación) */
html.first-time-load:not(.sidebar-ready) .sidebar,
body.first-time-load:not(.sidebar-ready) .sidebar {
  transform: translateX(-100%);
  opacity: 0;
}

body.first-time-load.sidebar-ready .content {
  margin-left: 260px !important;
}

/* Transición suave del contenido SOLO en primera carga al activar sidebar */
body.first-time-load .content {
  transition: margin-left 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

html.first-time-load:not(.sidebar-ready) .sidebar .menu-title,
html.first-time-load:not(.sidebar-ready) .sidebar .tool-link {
  opacity: 0;
  transform: translateY(-12px);
}

/* Animación de entrada del sidebar (única definición) */
@keyframes slideInFromLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Animación de títulos de sección */
@keyframes fadeSlideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animación de links de herramientas */
@keyframes fadeSlideDownTools {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Clases de animación para sidebar */
.fx-sidebar-enter {
  animation: slideInFromLeft 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.fx-section-title {
  animation: fadeSlideDown 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.fx-tool-item {
  animation: fadeSlideDownTools 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.sidebar.hidden+.content {
  margin-left: 0;
}

.sidebar a {
  color: var(--color-texto);
  text-decoration: none;
  display: block;
  padding: 12px 16px;
  font-family: var(--fuente-secundaria);
  font-size: 0.98rem;
  font-weight: 600;
}

.sidebar a:hover {
  background-color: var(--color-secundario-2);
}

.sidebar .active {
  background-color: var(--color-primario-2);
}

.sidebar-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.sidebar-footer {
  flex: 0 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: auto;
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.07));
  backdrop-filter: blur(8px);
}

.sidebar-context-title {
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--fuente-secundaria);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.authenticated-user-card {
  align-items: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  display: flex;
  gap: 0.85rem;
  padding: 0.9rem;
}

.authenticated-user-avatar {
  align-items: center;
  background: linear-gradient(135deg, var(--color-primario-1), var(--color-primario-2));
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-family: var(--fuente-secundaria);
  font-size: 1rem;
  font-weight: 700;
  height: 2.6rem;
  justify-content: center;
  letter-spacing: 0.03em;
  width: 2.6rem;
}

.authenticated-user-copy {
  min-width: 0;
}

.authenticated-user-name {
  color: #fff;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.authenticated-user-role {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  line-height: 1.2;
  margin-top: 0.25rem;
}

.authenticated-user-status {
  display: flex;
  justify-content: flex-start;
  margin-top: 0.75rem;
}

.role-sidebar-panel .form-label {
  color: var(--color-texto);
  font-size: 0.82rem;
  font-weight: 600;
}

.role-sidebar-panel .form-select {
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.role-sidebar-panel .scope-badge {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  display: inline-flex;
  font-weight: 600;
  font-size: 0.78rem;
  line-height: 1.35;
  padding: 0.42rem 0.7rem;
  text-align: left;
  white-space: normal;
}

.content {
  margin-left: 250px;
  flex-grow: 1;
  padding: clamp(1rem, 2vw, 1.75rem);
  overflow-y: auto;
  /* Prevenir salto de contenido cuando aparece scrollbar */
  scrollbar-gutter: stable;
}

hr {
  border: 0;
  height: 1px;
  background-color: var(--color-primario-2);
  margin: 5px 0;
}

.btn-sm {
  font-weight: 600;
  min-height: 2.1rem;
}

.btn-link:hover {
  text-decoration: none !important;
}


/* ==============================
   Estilos de nav-tabs
   ============================== */

.bg-body {
  background: none !important;
  font-family: var(--fuente-principal);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 4px 10px;
  white-space: nowrap;
}

.card-header {
  background-color: var(--color-secundario-4);
  color: var(--color-texto);
  font-size: 1rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--fuente-principal);
  letter-spacing: -0.01em;
}

.card-header-tabs {
  margin-bottom: 0;
}

.nav-tabs .nav-link {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  color: #ffffff;
}

.nav-tabs .nav-link:hover {
  background-color: var(--color-primario-1);
}

.nav-tabs .nav-link.active {
  background-color: var(--color-primario-2);
  color: var(--color-primario-1);
}

.nav-link {
  letter-spacing: 0 !important;
}


/* ==============================
   Submenús
   ============================== */
.submenu {
  background-color: var(--color-secundario-3);
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.submenu.show {
  display: block !important;
}

.submenu.collapse:not(.show) {
  display: none;
}

.submenu a {
  display: block;
  padding: 8px 15px;
  text-decoration: none;
  color: var(--color-texto);
  transition: background-color 0.3s ease, padding-left 0.3s ease;
  position: relative;
}

.submenu a::before {
  content: '•';
  position: absolute;
  left: 8px;
  opacity: 0;
  transition: opacity 0.3s ease, left 0.3s ease;
  font-size: 1.2em;
}

.submenu a:hover::before {
  opacity: 1;
  left: 5px;
}

.submenu a:hover {
  background-color: var(--color-acento-1);
  color: #000000;
  padding-left: 20px;
}

/* ==============================
   Tool links
   ============================== */
.tool-link {
  display: block;
  color: var(--color-texto);
  background: transparent;
  padding: 12px 14px;
  margin: 4px 12px;
  border-radius: 12px;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.tool-link::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease-out, height 0.6s ease-out;
}

.tool-link:active::before {
  width: 350px;
  height: 350px;
}

.tool-link .bi {
  margin-right: 8px;
  transition: transform 0.3s ease;
}

.tool-link-notifiable {
  padding-right: 44px;
}

.tool-link-notification-badge {
  position: absolute;
  top: 4px;
  right: 9px;
  z-index: 1;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 6px 14px rgba(220, 53, 69, 0.32);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

.tool-link.active .tool-link-notification-badge {
  border-color: var(--color-primario-2);
}

.tool-link:hover .bi {
  transform: translateX(3px);
}

.tool-link:hover {
  background-color: var(--color-secundario-2);
  color: var(--color-texto);
  transform: translateY(-1px);
}

.tool-link.active {
  background-color: var(--color-primario-2);
  color: #fff;
}

/* ==============================
   Sidebar headers y títulos
   ============================== */
.menu-title {
  color: var(--color-primario-2);
  padding: 10px 20px 4px 20px;
  font-weight: 700;
  font-size: 0.74rem;
  font-family: var(--fuente-secundaria);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-link {
  margin-top: 6px;
}

.sidebar-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  position: relative;
}

.sidebar-header > a {
  align-items: center;
  display: flex;
  justify-content: center;
  min-width: 0;
  width: 100%;
}

.sidebar-header img {
  display: block;
  height: auto;
  max-height: 3.25rem;
  max-width: 13.5rem;
  object-fit: contain;
  width: 100%;
}

.sidebar .bi {
  font-size: 1.05rem;
}

.submenu a .bi {
  margin-right: 8px;
}

.sidebar a .bi-chevron-down {
  transition: transform 0.3s ease;
}

.sidebar a[aria-expanded="true"] .bi-chevron-down {
  transform: rotate(180deg);
}

/* ==============================
   Toggle sidebar
   ============================== */
.sidebar-toggle-btn {
  position: fixed;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 0;
  z-index: 3000;
  background-color: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(6, 65, 93, 0.12);
  box-shadow: 0 8px 24px rgba(6, 65, 93, 0.12);
  transition: all 0.3s ease;
}

.sidebar-toggle-btn:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: scale(1.05);
}

.sidebar-toggle-btn i {
  font-size: 1.25rem;
}

/* Desktop: Botón oculto */
@media (min-width: 1025px) {
  .sidebar-toggle-btn {
    display: none !important;
  }

  .sidebar-close-btn,
  .sidebar-backdrop {
    display: none !important;
  }

  /* Sin transiciones en desktop para navegación instantánea */
  .sidebar {
    transition: none !important;
  }
}

/* Tablet y móviles: botón visible y alineado con el contenido. */
@media (max-width: 1024px) {
  .sidebar-toggle-btn {
    top: max(0.75rem, env(safe-area-inset-top));
    left: max(0.75rem, env(safe-area-inset-left));
  }

  /* Ocultar botón cuando el sidebar esté desplegado */
  .sidebar.show~.sidebar-toggle-btn {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
  }
}

.sidebar h4 {
  margin: 0;
  padding: 0;
  font-size: 1.05rem;
}

/* ==============================
   Responsive
   ============================== */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    height: 100dvh;
    width: min(19rem, calc(100vw - 3rem));
    overflow: hidden;
    padding-bottom: 0;
    /* z-index menor que modales de Bootstrap (1055) */
    z-index: 1040;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    /* Estado inicial: oculto a la izquierda */
    transform: translateX(-100%) !important;
    opacity: 1 !important;
    margin-left: 0 !important;
    /* Animación suave para mostrar/ocultar en móviles */
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  }

  .sidebar.show {
    /* Mostrar: deslizar a posición visible */
    transform: translateX(0) !important;
  }

  .content {
    margin-left: 0 !important;
    width: 100%;
    padding-top: 4.75rem;
  }

  body.sidebar-ready .content,
  body.first-time-load.sidebar-ready .content {
    margin-left: 0 !important;
  }
}

/* Animación para el overlay */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ==============================
   Composición de gas: toggle filas
   ============================== */
.comp-hidden-row {
  display: none !important;
}

.comp-toggle-btn {
  font-weight: 600;
  color: var(--color-secundario-5);
  text-decoration: none;
}

.comp-toggle-btn:hover {
  text-decoration: underline;
}

/* Contenedor colapsable con animación de altura */
.fx-collapse-animate {
  overflow: hidden;
  transition: height .24s ease;
  will-change: height;
}

/* Footer variante estrecha (borde limitado al contenido) */
.sectFooter.sectFooter--narrow {
  border-top: none !important;
}

.sectFooter--narrow .inner-border {
  border-top: none;
  padding-top: 5px;
  margin-left: auto;
  margin-right: auto;
}

/* ==============================
   Animaciones globales
   ============================== */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes staggerFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.fx-fade-in {
  animation: fadeSlideIn 0.4s ease-out backwards;
  opacity: 1 !important;
  /* Forzar visibilidad al aplicar animación */
}

.fx-page-enter {
  animation: fadeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.fx-stagger-in {
  animation: staggerFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  opacity: 1 !important;
  /* Forzar visibilidad al aplicar animación */
}

.fx-scale-in {
  animation: scaleIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  opacity: 1 !important;
  /* Forzar visibilidad al aplicar animación */
}

/* Utilidades de delay para efectos escalonados */
.fx-delay-1 {
  animation-delay: 0.1s;
}

.fx-delay-2 {
  animation-delay: 0.2s;
}

.fx-delay-3 {
  animation-delay: 0.3s;
}

.fx-delay-4 {
  animation-delay: 0.4s;
}

.fx-delay-5 {
  animation-delay: 0.5s;
}

.fx-delay-6 {
  animation-delay: 0.6s;
}

/* Placeholders genéricos para pantallas iniciales */
.placeholder-card,
.fx-placeholder-card {
  border: 1px dashed var(--color-secundario-3);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.01));
}

@keyframes subtleFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

.placeholder-icon,
.fx-placeholder-icon {
  font-size: 48px;
  color: var(--color-primario-2);
  animation: subtleFloat 3s ease-in-out infinite;
}

/* Hover sutil reutilizable para tarjetas */
.fx-hover-card {
  transition: transform .18s ease, box-shadow .18s ease;
}

.fx-hover-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

/* Animaciones para inputs al recibir focus */
.form-control:focus,
.gas-input:focus {
  animation: inputFocusPulse 0.4s ease-out;
}

@keyframes inputFocusPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}

/* Indicador de navegación/carga */
.fx-navigating {
  pointer-events: none;
  opacity: 0.3;
  transform: scale(0.96) translateY(15px);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.6, 1);
}

/* Animación de pulso para elementos activos */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.fx-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Animación de salida para páginas (fade out + pequeño desplazamiento) */
@keyframes fadeOutDown {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(15px) scale(0.96);
  }
}

.fx-page-exit {
  animation: fadeOutDown 0.35s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

/* ==============================
   UI común de indicadores
   (reglas reutilizables de la interfaz)
   ============================== */
.section-title {
  color: var(--color-secundario-3);
  font-size: 30px;
  font-family: var(--fuente-principal);
}

header {
  background-color: #ffffff;
  border-bottom: 3px solid var(--color-primario-1);
  margin-bottom: 10px;
}

.sectComposición {
  background-color: var(--color-fondo);
  margin-bottom: 5px;
  padding: 20px;
  border-radius: 12px;
}

.gas-input {
  width: 90px;
  border: 1px solid var(--color-secundario-3);
  border-radius: 6px;
  padding: 2px 6px;
  font-family: var(--fuente-secundaria);
}

.gas-input::placeholder {
  color: rgba(0, 0, 0, 0.3);
}

.box-title {
  background-color: var(--color-secundario-4);
  color: var(--color-texto);
  font-size: 20px;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--fuente-principal);
  letter-spacing: 1px;
}

.box-titleResultados {
  background-color: var(--color-secundario-5);
  color: var(--color-texto);
  font-size: 20px;
  padding: 4px 8px;
  border-radius: 6px;
  height: 35px;
  display: flex;
  align-items: center;
  font-family: var(--fuente-principal);
  letter-spacing: 1px;
  justify-content: center;
}

.form-control {
  border: 1px solid var(--color-secundario-3);
  border-radius: 6px;
  font-family: var(--fuente-secundaria);
}

.form-control:focus {
  border-color: var(--color-primario-2);
  outline: none;
  box-shadow: 0 0 4px rgba(65, 196, 170, 0.4);
}

input.form-control::placeholder {
  color: rgba(0, 0, 0, 0.3);
}

/* Botones estándar de la plataforma */
.buttonWeight {
  min-width: 120px;
  height: 50px;
  padding: 0 1rem;
  font-family: var(--fuente-secundaria);
  font-weight: 600;
  background-color: var(--color-primario-1);
  color: var(--color-texto);
  border: none;
  border-radius: 8px;
  transition: 0.3s ease;
}

.buttonWeight:hover {
  background-color: var(--color-secundario-1);
}

.buttonWeight2 {
  min-width: 120px;
  height: 50px;
  padding: 0 1rem;
  font-family: var(--fuente-secundaria);
  font-weight: 600;
  background-color: var(--color-primario-2);
  color: var(--color-texto);
  border: none;
  border-radius: 8px;
  transition: 0.3s ease;
}

.buttonWeight2:hover {
  background-color: var(--color-secundario-2);
}

/* Footer estándar */
.sectFooter {
  padding-top: 5px;
  border-top: none;
  font-family: var(--fuente-secundaria);
  color: var(--color-secundario-5);
}

/* Alturas dinámicas del logo del footer (sin estilos inline) */
.sectFooter .footer-logo {
  max-height: 60px;
}

.sectFooter.footer-h-60 .footer-logo {
  max-height: 60px;
}

.sectFooter.footer-h-80 .footer-logo {
  max-height: 80px;
}

.sectFooter.footer-h-100 .footer-logo {
  max-height: 100px;
}

/* Selects estándar */
.form-select {
  border: 1px solid var(--color-secundario-3);
  border-radius: 6px;
  font-family: var(--fuente-secundaria);
  background-color: var(--color-acento-1);
}

.custom-select {
  padding-right: 0 !important;
}

/* Retroalimentación global para esperas y operaciones asincrónicas */
.global-loading-alert {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.8rem 1rem;
  border: 1px solid rgba(65, 196, 170, 0.5);
  border-radius: 0.65rem;
  background: var(--color-secundario-5);
  color: var(--color-texto);
  box-shadow: 0 10px 30px rgba(6, 65, 93, 0.24);
  font-weight: 600;
  opacity: 0;
  transform: translateY(-0.5rem);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.global-loading-alert[hidden] {
  display: none;
}

.global-loading-alert.is-visible {
  opacity: 1;
  transform: translateY(0);
}

form[data-loading-feedback-busy="true"] {
  cursor: wait;
}

@media (max-width: 576px) {
  .global-loading-alert {
    right: 0.75rem;
    left: 0.75rem;
    max-width: none;
  }
}

/* ==============================
   Responsive layout contract
   ============================== */
.sidebar-close-btn {
  display: none;
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(6, 65, 93, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--color-secundario-5);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1039;
  border: 0;
  padding: 0;
  background: rgba(6, 30, 43, 0.52);
  animation: fadeIn 0.2s ease;
}

.sidebar-backdrop[hidden] {
  display: none;
}

.table-responsive {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.table-responsive > table {
  margin-bottom: 0;
}

@media (max-width: 1024px) {
  body.sidebar-open {
    overscroll-behavior: none;
  }

  body.sidebar-open .content {
    overflow: hidden;
  }

  .sidebar-close-btn {
    display: inline-flex;
  }

  .sidebar-header {
    min-height: 4.25rem;
    padding-right: 4.25rem !important;
  }

  .sidebar-header a {
    min-width: 0;
  }

  .sidebar-header img {
    max-height: 3rem;
    max-width: min(12.5rem, calc(100% - 2.75rem));
  }

  .sidebar-footer {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .sidebar,
  .content,
  .content > .container,
  .content > .container-fluid {
    max-width: 100%;
  }

  .content > .container,
  .content > .container-fluid {
    padding-inline: 0;
  }

  .card-header-tabs,
  .nav-tabs {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    overscroll-behavior-inline: contain;
  }

  .nav-tabs .nav-item,
  .nav-tabs .nav-link {
    flex: 0 0 auto;
  }

  .modal-dialog {
    width: auto;
    max-width: calc(100vw - 2rem);
    margin: 1rem;
  }

  .modal-dialog-scrollable {
    height: calc(100dvh - 2rem);
  }

  .modal-dialog-scrollable .modal-content {
    max-height: calc(100dvh - 2rem);
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    min-width: 0;
  }

  .modal-footer {
    flex-wrap: wrap;
  }

  .buttonWeight,
  .buttonWeight2,
  .btn,
  .form-control,
  .form-select {
    min-height: 44px;
  }

  .btn-sm {
    min-height: 44px;
  }
}

@media (max-width: 768px) {
  .content {
    padding: 4.5rem 1rem 1rem;
  }

  header.row,
  .sectFooter {
    margin-inline: 0;
  }

  .section-title {
    font-size: clamp(1.55rem, 8vw, 2rem);
    overflow-wrap: anywhere;
  }

  .card-header-tabs .nav-link,
  .nav-tabs .nav-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .modal-footer > .btn,
  .modal-footer > form,
  .modal-footer > form > .btn {
    flex: 1 1 10rem;
  }
}

@media (max-width: 576px) {
  .content {
    padding: 4.25rem 0.75rem 0.75rem;
  }

  .sidebar {
    width: min(19rem, calc(100vw - 2rem));
  }

  .sectComposición,
  .card-body,
  .modal-body {
    padding-inline: 0.875rem;
  }

  .modal-dialog {
    max-width: calc(100vw - 1rem);
    margin: 0.5rem;
  }

  .modal-dialog-scrollable {
    height: calc(100dvh - 1rem);
  }

  .modal-dialog-scrollable .modal-content {
    max-height: calc(100dvh - 1rem);
  }

  .modal-footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .modal-footer > *,
  .buttonWeight,
  .buttonWeight2 {
    width: 100%;
  }

  .global-loading-alert {
    top: max(0.75rem, env(safe-area-inset-top));
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .content,
  .sidebar-backdrop {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
