/*
 * SOPHIA Global CSS (canónico)
 *
 * Este archivo consolida estilos globales propios de SOPHIA:
 * - base/sophia.base.css
 * - common/loaders.css
 * - common/states.css
 *
 * Nota: modules/Shared/Resources/css/base/style.css se mantiene aparte
 * como base de plantilla legacy (sin cambios funcionales).
 */

@font-face {
  font-display: swap;
  font-family: 'Heebo';
  font-style: normal;
  font-weight: 400;
  src: url('/assets/fonts/heebo-v28-latin_latin-ext-regular.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Heebo';
  font-style: normal;
  font-weight: 500;
  src: url('/assets/fonts/heebo-v28-latin_latin-ext-500.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Heebo';
  font-style: normal;
  font-weight: 700;
  src: url('/assets/fonts/heebo-v28-latin_latin-ext-700.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  src: url('/assets/fonts/roboto-v49-latin_latin-ext-regular.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  src: url('/assets/fonts/roboto-v49-latin_latin-ext-500.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  src: url('/assets/fonts/roboto-v49-latin_latin-ext-700.woff2') format('woff2');
}

/* Sobrescribir fuentes globales de Bootstrap */
:root {
  --bs-body-font-family: 'Roboto', 'Heebo', sans-serif;
}

/* Evita salto horizontal del layout al abrir/cerrar modales (scroll lock de Bootstrap). */
html {
  scrollbar-gutter: stable both-edges;
}

/* Scroll global: más delgado y sutil. */
html,
body {
  scrollbar-width: thin;
  scrollbar-color: rgba(116, 117, 121, 0.24) rgba(116, 117, 121, 0.08);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: rgba(116, 117, 121, 0.06);
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background-color: rgba(116, 117, 121, 0.24);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: content-box;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background-color: rgba(116, 117, 121, 0.38);
}

[data-bs-theme="dark"] html,
[data-bs-theme="dark"] body {
  scrollbar-color: rgba(207, 211, 215, 0.24) rgba(207, 211, 215, 0.1);
}

[data-bs-theme="dark"] html::-webkit-scrollbar-track,
[data-bs-theme="dark"] body::-webkit-scrollbar-track {
  background: rgba(207, 211, 215, 0.08);
}

[data-bs-theme="dark"] html::-webkit-scrollbar-thumb,
[data-bs-theme="dark"] body::-webkit-scrollbar-thumb {
  background-color: rgba(207, 211, 215, 0.24);
}

[data-bs-theme="dark"] html::-webkit-scrollbar-thumb:hover,
[data-bs-theme="dark"] body::-webkit-scrollbar-thumb:hover {
  background-color: rgba(207, 211, 215, 0.38);
}

/* Neutraliza compensación lateral de Bootstrap al abrir modales para evitar “saltos” del layout. */
body.modal-open {
  padding-right: 0 !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Heebo', sans-serif;
}
/*Alert*/
:root {
  --color-success: #28a745;
  --color-error: #dc3545;
  --color-warning: #ffc107;
  --color-info: #0d6efd;
}

.modal-icon-alert {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.error {
  color: var(--color-error);
}

.warning {
  color: var(--color-warning);
}

.success {
  color: var(--color-success);
}

.info {
  color: var(--color-info);
}

.toast-custom {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.2rem;
  border-radius: 0.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  max-width: 360px;
  animation: fadeSlide 0.3s ease-out;
  background-color: #ffffff; /* fondo blanco sólido */
  color: #212529; /* texto oscuro */
  border-left: 4px solid var(--color-info);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
  word-wrap: break-word;
  line-height: 1.4;
  overflow-y: auto;
  max-height: 300px;
}
[data-bs-theme="dark"] .toast-custom {
  background-color: #2c2f36;
  color: #f1f1f1;
}


.toast-custom::-webkit-scrollbar {
  width: 6px;
}
.toast-custom::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.toast-custom.toast-success { border-left-color: var(--color-success); }
.toast-custom.toast-error   { border-left-color: var(--color-error); }
.toast-custom.toast-warning { border-left-color: var(--color-warning); }
.toast-custom.toast-info    { border-left-color: var(--color-info); }

.toast-container-custom {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1055;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/*Generales*/
.objeto-oculto  {
  display: none !important;
}

/* Estilo general de botón circular */
.btn-circular {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 2.5rem !important;
  height: 2.5rem !important;
  border-radius: 50% !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
}

.btn-circular i {
  display: block !important;
  font-size: 1.2rem !important;
  line-height: 1 !important;
  text-align: center !important;
}

/* Columna persistente de acciones (reusable) */
.sph-col-acciones-th {
  min-width: 180px;
}

.sph-col-acciones-layout {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 100%;
}

.sph-col-acciones-main {
  flex: 1;
  min-width: 0;
}

.sph-col-acciones-panel {
  --tabla-head-height: 56px;
  width: 64px;
  min-width: 64px;
  background: var(--bs-body-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: var(--tabla-head-height) 0 1rem 0;
  border-left: none;
  position: relative;
  align-self: stretch;
  overflow: visible;
  z-index: 5;
  margin-left: 0;
}

.sph-col-acciones-panel::-webkit-scrollbar {
  display: none;
}

.sph-col-acciones-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  margin: 0;
  height: var(--tabla-head-height);
  background-color: var(--bs-dark);
  border-top: 1px solid var(--bs-border-color);
  border-bottom: 1px solid var(--bs-border-color);
  border-radius: 0 !important;
  box-sizing: border-box;
  z-index: 1;
}

.sph-col-acciones-panel::after {
  content: "";
  position: absolute;
  top: 19px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--bs-white);
  z-index: 2;
  pointer-events: none;
}

.sph-col-acciones-btn,
.sph-col-acciones-btn-print {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  overflow: visible;
  margin-top: 0;
  z-index: 1040;
}

.sph-col-acciones-btn {
  bottom: 1.5rem;
}

.sph-col-acciones-btn-print {
  bottom: 6rem;
  background-color: var(--bs-success);
  border-color: var(--bs-success);
  color: #fff;
}

.sph-col-acciones-btn i,
.sph-col-acciones-btn-print i {
  font-size: 1.45rem;
}

.sph-col-acciones-label {
  display: none;
}

.sph-col-acciones-panel .sph-col-acciones-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.sph-col-acciones-panel .sph-col-acciones-item:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.sph-col-acciones-panel .sph-col-acciones-item::after {
  content: attr(data-label);
  position: absolute;
  top: calc(100% + 0.2rem);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  line-height: 1.05;
  font-weight: 600;
  white-space: normal;
  width: 58px;
  text-align: center;
  color: var(--bs-body-color);
  pointer-events: none;
}

.sph-col-acciones-panel .sph-col-acciones-item:disabled {
  opacity: 0.55;
  box-shadow: none;
}

@media (max-width: 767.98px) {
  .sph-col-acciones-panel {
    display: block !important;
    position: fixed;
    width: 100%;
    min-width: 100%;
    height: auto;
    min-height: 0;
    padding: 0.35rem 0 0.35rem 0;
    margin: 0;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    background: var(--bs-body-bg);
    border: 0;
    overflow: visible;
    z-index: 1040;
    justify-content: center;
  }

  .sph-col-acciones-panel::before,
  .sph-col-acciones-panel::after {
    display: none;
  }

  .sph-col-acciones-btn-print {
    display: none;
  }

  .sph-col-acciones-btn {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: calc(0.35rem + env(safe-area-inset-bottom, 0px));
    width: min(320px, calc(100vw - 2rem));
    height: 48px;
    border-radius: 0.65rem;
    padding: 0 0.95rem;
    gap: 0.5rem;
  }

  .sph-col-acciones-btn i {
    font-size: 1.15rem;
  }

  .sph-col-acciones-label {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
  }

  .sph-col-acciones-btn.sph-col-acciones-item::after {
    display: none;
  }

  .sph-col-acciones-layout {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
}

/* Columna de botones fija para pestañas (reusable) */
.tab-botones-tab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  align-items: stretch;
  min-height: 100%;
}

.tab-botones-tab-main {
  min-width: 0;
}

.tab-botones-tab-panel {
  --tab-botones-label-font-size: 0.62rem;
  --tab-botones-label-line-height: 1.05;
  --tab-botones-label-lines: 2;
  --tab-botones-label-offset: 0.2rem;
  --tab-botones-label-reserve: calc(
    (var(--tab-botones-label-font-size) * var(--tab-botones-label-line-height) * var(--tab-botones-label-lines))
    + var(--tab-botones-label-offset)
    + 0.25rem
  );
  position: relative;
  min-width: 64px;
  background: transparent;
}

.tab-botones-tab-panel::before {
  display: none;
}

.tab-botones-tab-stack {
  --tab-botones-label-font-size: 0.62rem;
  --tab-botones-label-line-height: 1.05;
  --tab-botones-label-lines: 2;
  --tab-botones-label-offset: 0.2rem;
  --tab-botones-label-reserve: calc(
    (var(--tab-botones-label-font-size) * var(--tab-botones-label-line-height) * var(--tab-botones-label-lines))
    + var(--tab-botones-label-offset)
    + 0.25rem
  );
  position: fixed !important;
  inset: auto calc(1.5rem + 4mm) 1.5rem auto;
  display: flex;
  flex-direction: column;
  gap: var(--tab-botones-label-reserve);
  align-items: center;
  z-index: 1045;
  transform: none !important;
  will-change: auto;
}

.tab-botones-tab-btn {
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
  position: relative;
  overflow: visible;
  margin-top: 0;
}

.tab-botones-tab-btn i {
  font-size: 1.45rem;
  line-height: 1;
}

.tab-botones-tab-label {
  position: absolute;
  top: calc(100% + var(--tab-botones-label-offset));
  left: 50%;
  transform: translateX(-50%);
  display: inline-block;
  min-width: 80px;
  font-size: var(--tab-botones-label-font-size);
  line-height: var(--tab-botones-label-line-height);
  font-weight: 600;
  text-align: center;
  white-space: normal;
  color: var(--bs-body-color);
  pointer-events: none;
}

.tab-botones-tab-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.tab-botones-tab-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.tab-botones-tab-btn:disabled {
  opacity: 0.55;
  box-shadow: none;
}

@media (max-width: 767.98px) {
  .tab-botones-tab-layout {
    grid-template-columns: 1fr;
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .tab-botones-tab-panel {
    min-width: 0;
    background: transparent;
  }

  .tab-botones-tab-panel::before {
    display: none;
  }

  .tab-botones-tab-stack {
    left: 50%;
    right: auto;
    top: auto;
    bottom: calc(0.35rem + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    width: min(320px, calc(100vw - 2rem));
    gap: 0.5rem;
  }

  .tab-botones-tab-btn {
    width: 100%;
    height: 48px;
    padding: 0 0.95rem;
    border-radius: 0.65rem;
    flex-direction: row;
    gap: 0.5rem;
    justify-content: flex-start;
  }

  .tab-botones-tab-btn i {
    font-size: 1.15rem;
  }

  .tab-botones-tab-label {
    position: static;
    transform: none;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    color: inherit;
  }
}

/* Evita choque de back-top con la columna persistente */
.back-top {
  right: 88px;
}

@media (max-width: 767.98px) {
  .back-top {
    right: 10px;
  }
}

/* Estilos del panel de resultados */
#panelResultadosEstudiantes {
  max-height: 300px;            /* Limita la altura del panel */
  overflow-y: auto;             /* Activa el scroll vertical si el contenido excede el max-height */
  background-color: var(--bs-body-bg); /* Fondo por defecto según el tema (usamos var de Bootstrap) */
  border: 1px solid rgba(0, 0, 0, 0.125); /* Borde sutil */
  border-radius: 5px;           /* Bordes redondeados */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Sombra sutil */
  padding: 0.5rem 1rem;         /* Espaciado */
  visibility: hidden;           /* Inicialmente oculto */
  opacity: 0;                   /* Inicialmente invisible */
  transition: opacity 0.3s ease, visibility 0s ease 0.3s; /* Animación de visibilidad */
}

/* Fondo y texto para el tema claro (data-bs-theme="light") */
[data-bs-theme="light"] #panelResultadosEstudiantes {
  background-color: var(--bs-light); /* Fondo blanco para el modo claro */
  color: var(--bs-dark);             /* Texto oscuro para el modo claro */
}

/* Fondo y texto para el tema oscuro (data-bs-theme="dark") */
[data-bs-theme="dark"] #panelResultadosEstudiantes {
  background-color: var(--bs-dark);   /* Fondo oscuro para el modo oscuro */
  color: var(--bs-light);             /* Texto claro para el modo oscuro */
}

/* Estilos de los resultados dentro del panel */
#panelResultadosEstudiantes .p-2 {
  padding: 0.75rem 1rem;        /* Asegura un espaciado adecuado en cada item */
}

#panelResultadosEstudiantes .border-bottom {
  border-bottom: 1px solid #dee2e6;  /* Línea entre resultados */
}

#panelResultadosEstudiantes .cursor-pointer {
  cursor: pointer;             /* Cursor de puntero */
}

#panelResultadosEstudiantes a {
  color: inherit;               /* El color de los enlaces será heredado */
  text-decoration: none;        /* Elimina el subrayado */
}

#panelResultadosEstudiantes a:hover {
  color: #007bff;               /* Color azul al pasar el ratón */
  text-decoration: underline;   /* Subraya el enlace al pasar el ratón */
}

.progress-bar {
  width: 0;
  transition: width 0.8s ease-in-out;
}
/**
 * SOPHIA - Shared Loader/Spinner Styles
 *
 * Estilos unificados para indicadores de carga.
 * Usar con LoaderManager de @shared/ui/loaderManager.js
 *
 * Clases principales:
 * - .sophia-loader: Contenedor de loader
 * - .sophia-loader-overlay: Overlay con backdrop
 * - .sophia-loader-inline: Loader inline
 * - .sophia-loader-table: Loader específico para tablas
 */

/* ==========================================================================
   Base Loader Container
   ========================================================================== */

.sophia-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  opacity: 1;
  transition: opacity 0.2s ease-out;
}

.sophia-loader.d-none,
.sophia-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.sophia-loader-text {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--bs-secondary);
}

/* ==========================================================================
   Overlay Loader (Full screen or container)
   ========================================================================== */

.sophia-loader-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(2px);
  z-index: 1050;
  opacity: 1;
  transition: opacity 0.2s ease-out;
}

.sophia-loader-overlay--global {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0.28);
}

.sophia-loader-overlay--global .sophia-loader-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.sophia-loader-inline--stack {
  flex-direction: column;
  justify-content: center;
  gap: 0.9rem;
}

.sophia-loader-text--global {
  color: #ffffff;
  font-weight: 600;
  margin-top: 0;
}

/* Spinner oficial del sistema */
.loader {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  border: 10px solid;
  border-color: rgba(55, 65, 81, 0.18) rgba(55, 65, 81, 0.28) rgba(55, 65, 81, 0.38) rgba(55, 65, 81, 0.52);
  box-sizing: border-box;
  animation: sophia-loader-rotation 1s linear infinite;
}

[data-bs-theme="dark"] .loader {
  border-color: rgba(255, 255, 255, 0.14) rgba(255, 255, 255, 0.24) rgba(255, 255, 255, 0.34) rgba(255, 255, 255, 0.5);
}

.loader.loader-sm {
  width: 28px;
  height: 28px;
  border-width: 6px;
}

.loader.loader-global {
  width: 56px;
  height: 56px;
  border-width: 10px;
}

@keyframes sophia-loader-rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.sophia-loader-overlay.d-none,
.sophia-loader-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Dark mode support */
[data-bs-theme="dark"] .sophia-loader-overlay {
  background-color: rgba(33, 37, 41, 0.85);
}

/* Parent container needs position relative */
.sophia-loader-container {
  position: relative;
  min-height: 100px;
}

/* ==========================================================================
   Inline Loader
   ========================================================================== */

.sophia-loader-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.sophia-loader-inline .spinner-border,
.sophia-loader-inline .spinner-grow {
  width: 1rem;
  height: 1rem;
}

/* ==========================================================================
   Button Loader
   ========================================================================== */

.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn-loading .btn-text {
  opacity: 0;
}

.btn-loading .btn-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Helper class to show/hide button content */
.btn .btn-loading-content {
  display: none;
}

.btn.is-loading .btn-default-content {
  display: none;
}

.btn.is-loading .btn-loading-content {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

/* ==========================================================================
   Table Loader
   ========================================================================== */

.sophia-loader-table {
  text-align: center;
  padding: 2rem 1rem;
}

.sophia-loader-table td {
  border: none !important;
  background-color: var(--bs-body-bg) !important;
}

.sophia-loader-table .spinner-border {
  width: 2rem;
  height: 2rem;
}

/* Skeleton loading for table rows */
.sophia-skeleton-row td {
  background: linear-gradient(
    90deg,
    var(--bs-gray-200) 25%,
    var(--bs-gray-100) 50%,
    var(--bs-gray-200) 75%
  );
  background-size: 200% 100%;
  animation: sophia-skeleton-shimmer 1.5s infinite;
  height: 48px;
}

[data-bs-theme="dark"] .sophia-skeleton-row td {
  background: linear-gradient(
    90deg,
    var(--bs-gray-700) 25%,
    var(--bs-gray-600) 50%,
    var(--bs-gray-700) 75%
  );
  background-size: 200% 100%;
}

@keyframes sophia-skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ==========================================================================
   Card Loader
   ========================================================================== */

.sophia-loader-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.sophia-loader-card .spinner-border {
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1rem;
}

/* ==========================================================================
   Progress Bar Loader
   ========================================================================== */

.sophia-progress-loader {
  width: 100%;
  height: 4px;
  background-color: var(--bs-gray-200);
  overflow: hidden;
  border-radius: 2px;
}

.sophia-progress-loader-bar {
  width: 30%;
  height: 100%;
  background-color: var(--bs-primary);
  animation: sophia-progress-indeterminate 1.5s infinite ease-in-out;
}

@keyframes sophia-progress-indeterminate {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(400%);
  }
}

/* ==========================================================================
   Pulse Animation
   ========================================================================== */

.sophia-pulse {
  animation: sophia-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes sophia-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ==========================================================================
   Dot Loader
   ========================================================================== */

.sophia-loader-dots {
  display: inline-flex;
  gap: 0.25rem;
}

.sophia-loader-dots span {
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--bs-primary);
  border-radius: 50%;
  animation: sophia-dot-bounce 1.4s infinite ease-in-out both;
}

.sophia-loader-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.sophia-loader-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes sophia-dot-bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* ==========================================================================
   Loading States Utilities
   ========================================================================== */

/* Disable interactions while loading */
.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

/* Prevent content shift while loading */
.loading-min-height {
  min-height: 200px;
}

.loading-min-height-sm {
  min-height: 100px;
}

.loading-min-height-lg {
  min-height: 400px;
}
/**
 * SOPHIA - Shared State Classes
 *
 * Clases utilitarias para estados comunes de la aplicación.
 * Complementa Bootstrap 5 con estados específicos de SOPHIA.
 *
 * Categorías:
 * - Estados de carga (.is-loading, .is-processing)
 * - Estados de contenido (.is-empty, .has-error)
 * - Estados de selección (.is-selected, .is-active)
 * - Estados de visibilidad (.is-visible, .is-hidden)
 * - Estados de formulario (.is-dirty, .is-pristine)
 */

/* ==========================================================================
   Loading States
   ========================================================================== */

.is-loading {
  position: relative;
  pointer-events: none;
}

.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.6);
  z-index: 10;
}

[data-bs-theme="dark"] .is-loading::after {
  background-color: rgba(33, 37, 41, 0.6);
}

.is-processing {
  cursor: wait !important;
}

.is-processing * {
  cursor: wait !important;
}

/* ==========================================================================
   Content States
   ========================================================================== */

/* Empty state */
.is-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--bs-secondary);
}

.is-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.is-empty-title {
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--bs-body-color);
}

.is-empty-description {
  font-size: 0.875rem;
  max-width: 320px;
  margin-bottom: 1rem;
}

/* Error state */
.has-error {
  border-color: var(--bs-danger) !important;
}

.has-error-message {
  color: var(--bs-danger);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Success state */
.has-success {
  border-color: var(--bs-success) !important;
}

.has-success-message {
  color: var(--bs-success);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Warning state */
.has-warning {
  border-color: var(--bs-warning) !important;
}

.has-warning-message {
  color: var(--bs-warning);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* ==========================================================================
   Selection States
   ========================================================================== */

.is-selected {
  background-color: rgba(var(--bs-primary-rgb), 0.1) !important;
  border-color: var(--bs-primary) !important;
}

.is-selected-row {
  background-color: rgba(var(--bs-primary-rgb), 0.08) !important;
}

.is-active {
  background-color: rgba(var(--bs-primary-rgb), 0.15) !important;
}

.is-highlighted {
  background-color: rgba(var(--bs-warning-rgb), 0.15) !important;
  animation: sophia-highlight-fade 2s ease-out forwards;
}

@keyframes sophia-highlight-fade {
  0% {
    background-color: rgba(var(--bs-warning-rgb), 0.3);
  }
  100% {
    background-color: transparent;
  }
}

/* ==========================================================================
   Visibility States
   ========================================================================== */

.is-visible {
  visibility: visible !important;
  opacity: 1 !important;
}

.is-hidden {
  visibility: hidden !important;
  opacity: 0 !important;
}

.is-collapsed {
  max-height: 0 !important;
  overflow: hidden !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.is-expanded {
  max-height: none !important;
}

/* Fade transitions */
.fade-enter {
  opacity: 0;
}

.fade-enter-active {
  opacity: 1;
  transition: opacity 0.2s ease-out;
}

.fade-exit {
  opacity: 1;
}

.fade-exit-active {
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

/* ==========================================================================
   Form States
   ========================================================================== */

.is-dirty {
  /* Campo modificado */
}

.is-dirty:not(:focus) {
  border-color: var(--bs-warning);
}

.is-pristine {
  /* Campo sin modificar */
}

.is-touched {
  /* Campo que ha tenido focus */
}

.is-untouched {
  /* Campo que nunca ha tenido focus */
}

/* Form submission states */
.is-submitting {
  pointer-events: none;
}

.is-submitting .btn-submit {
  pointer-events: none;
  opacity: 0.7;
}

.is-submitted {
  /* Formulario enviado exitosamente */
}

.has-validation-error .form-control,
.has-validation-error .form-select {
  border-color: var(--bs-danger);
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* ==========================================================================
   Disabled States
   ========================================================================== */

.is-disabled {
  pointer-events: none;
  opacity: 0.5;
  cursor: not-allowed;
}

.is-readonly {
  pointer-events: none;
  background-color: var(--bs-gray-100);
}

[data-bs-theme="dark"] .is-readonly {
  background-color: var(--bs-gray-800);
}

/* ==========================================================================
   Interactive States
   ========================================================================== */

.is-clickable {
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
}

.is-clickable:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.is-draggable {
  cursor: grab;
}

.is-dragging {
  cursor: grabbing;
  opacity: 0.8;
  box-shadow: var(--bs-box-shadow-lg);
}

.is-droppable {
  /* Zona válida para soltar */
}

.is-droppable.is-drag-over {
  background-color: rgba(var(--bs-success-rgb), 0.1);
  border-color: var(--bs-success);
  border-style: dashed;
}

/* ==========================================================================
   Status Indicators
   ========================================================================== */

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot-success {
  background-color: var(--bs-success);
}

.status-dot-warning {
  background-color: var(--bs-warning);
}

.status-dot-danger {
  background-color: var(--bs-danger);
}

.status-dot-info {
  background-color: var(--bs-info);
}

.status-dot-secondary {
  background-color: var(--bs-secondary);
}

/* Animated status dot */
.status-dot-pulse {
  animation: sophia-status-pulse 2s infinite;
}

@keyframes sophia-status-pulse {
  0% {
    box-shadow: 0 0 0 0 currentColor;
    opacity: 1;
  }
  70% {
    box-shadow: 0 0 0 6px currentColor;
    opacity: 0;
  }
  100% {
    box-shadow: 0 0 0 0 currentColor;
    opacity: 0;
  }
}

/* ==========================================================================
   Connection/Sync States
   ========================================================================== */

.is-online {
  /* Conectado */
}

.is-offline {
  /* Desconectado */
  filter: grayscale(50%);
  opacity: 0.8;
}

.is-syncing {
  /* Sincronizando */
}

.is-synced {
  /* Sincronizado */
}

.is-stale {
  /* Datos desactualizados */
  opacity: 0.7;
}

/* ==========================================================================
   Transition Utilities
   ========================================================================== */

.transition-all {
  transition: all 0.2s ease-out;
}

.transition-opacity {
  transition: opacity 0.2s ease-out;
}

.transition-transform {
  transition: transform 0.2s ease-out;
}

.transition-colors {
  transition: background-color 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out;
}

/* No transition utility */
.no-transition {
  transition: none !important;
}
