/* Responsive — base obligatoria para todo el portal */

html {
  -webkit-text-size-adjust: 100%;
}

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

.aei-content {
  min-width: 0;
}

.table-responsive {
  -webkit-overflow-scrolling: touch;
}

/* Loading global — peticiones HTTP */
.aei-global-loading {
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  pointer-events: all;
}

.aei-global-loading__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 39, 68, 0.35);
}

.aei-global-loading__panel {
  position: relative;
  z-index: 1;
  min-width: 220px;
  max-width: min(90vw, 320px);
  padding: 1.25rem 1.5rem;
  border-radius: var(--bs-border-radius);
  background: var(--bs-body-bg);
  box-shadow: 0 1rem 2.5rem rgba(15, 39, 68, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  text-align: center;
}

.aei-global-loading__text {
  font-size: 0.9rem;
  color: var(--bs-secondary-color);
  font-weight: 500;
}

body.aei-global-loading-active {
  overflow: hidden;
}

/* Modal — evitar recorte del selector en cambio de usuario */
#switch-user-modal .modal-content,
#switch-user-modal .modal-body {
  overflow: visible;
}

/* Modales en pantallas pequeñas */
@media (max-width: 576px) {
  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }

  .aei-switch-user-modal__header {
    padding: 0.875rem 1rem;
  }

  .aei-switch-user-modal__subtitle {
    font-size: 0.75rem;
  }

  .aei-switch-user-modal__body,
  .aei-switch-user-modal__footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .aei-switch-user-modal__footer {
    flex-direction: column-reverse;
    gap: 0.5rem;
  }

  .aei-switch-user-modal__footer .btn {
    width: 100%;
  }
}
