/* ============================================
   PluginWebSitePrimeAfocat - spaFrontend Styles
   ============================================ */

/* === SCOPE: Todo el CSS está encapsulado bajo .afo-scope === */
.afo-scope {
  /* ===== VARIABLES POR DEFECTO (sobrescribir en personalizado.css) ===== */
  --afo-primary: #2563eb;
  --afo-primary-dark: #1d4ed8;
  --afo-primary-light: #dbeafe;
  --afo-secondary: #7f8c8d;
  --afo-success: #059669;
  --afo-danger: #e11d48;
  --afo-warning: #d97706;
  --afo-dark: #1e293b;
  --afo-light: #f8fafc;
  --afo-border: #e2e8f0;

  --afo-border-radius: 0.75rem;
  --afo-radius-sm: 0.5rem;
  --afo-radius-lg: 1rem;
  --afo-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --afo-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --afo-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --afo-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --afo-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --afo-white: #ffffff;
  --afo-black: #000000;

  --afo-info: #0dcaf0;
  --afo-info-dark: #31d2f2;

  --afo-secondary-dark: #5a6268;
  --afo-secondary-darker: #545b62;
  --afo-success-dark: #157347;
  --afo-success-darker: #146c43;
  --afo-danger-dark: #b02a37;
  --afo-danger-darker: #a52834;

  --afo-alert-info-bg: #eff6ff;
  --afo-alert-info-color: #1e40af;
  --afo-alert-success-bg: #f0fdf4;
  --afo-alert-success-color: #166534;
  --afo-alert-warning-bg: #fffbeb;
  --afo-alert-warning-color: #92400e;
  --afo-alert-danger-bg: #fff1f2;
  --afo-alert-danger-color: #9f1239;

  --afo-modal-overlay: rgba(0, 0, 0, 0.5);
  --afo-modal-border: rgba(0, 0, 0, 0.2);
  --afo-modal-header-footer-border: #e2e8f0;

  --afo-table-header-color: #475569;
  --afo-table-row-hover: #f1f5f9;
  --afo-table-cell-border: #f1f5f9;

  --afo-input-border: #cbd5e1;
  --afo-estado-vigente: #0a6e3a;
  
  /* Tamaños de botones */
  --afo-btn-padding-y: 0.75rem;
  --afo-btn-padding-x: 1.5rem;
  --afo-btn-font-size: 0.9375rem;

  --afo-btn-sm-padding-y: 0.375rem;
  --afo-btn-sm-padding-x: 0.75rem;
  --afo-btn-sm-font-size: 0.8125rem;

  --afo-btn-lg-padding-y: 0.875rem;
  --afo-btn-lg-padding-x: 2rem;
  --afo-btn-lg-font-size: 1.0625rem;
  
  /* Tamaños de campos */
  --afo-input-padding-y: 0.75rem;
  --afo-input-padding-x: 1rem;
  --afo-input-font-size: 0.9375rem;
  --afo-input-padding-y-sm: 0.5rem;
  --afo-input-padding-x-sm: 0.75rem;
  --afo-input-font-size-sm: 0.875rem;

  /* Fuente */
  --afo-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

/* === CONTENEDORES PRINCIPALES === */
.afo-scope .afo-contenedor {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.afo-scope .afo-contenedor-sm {
  max-width: 800px;
}

.afo-scope .afo-contenedor-lg {
  max-width: 1400px;
}

/* === SISTEMA DE FILAS === */
.afo-scope .afo-fila {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -0.75rem;
}

/* === SISTEMA DE COLUMNAS === */
.afo-scope [class^="afo-col-"],
.afo-scope [class*=" afo-col-"],
.afo-scope .afo-col {
  position: relative;
  width: 100%;
  padding: 0 0.75rem;
  box-sizing: border-box;
}

.afo-scope .afo-col { flex: 1 0 0%; }
.afo-scope .afo-col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.afo-scope .afo-col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.afo-scope .afo-col-3 { flex: 0 0 25%; max-width: 25%; }
.afo-scope .afo-col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.afo-scope .afo-col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.afo-scope .afo-col-6 { flex: 0 0 50%; max-width: 50%; }
.afo-scope .afo-col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.afo-scope .afo-col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.afo-scope .afo-col-9 { flex: 0 0 75%; max-width: 75%; }
.afo-scope .afo-col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.afo-scope .afo-col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.afo-scope .afo-col-12 { flex: 0 0 100%; max-width: 100%; }

/* === APILADO EN MÓVIL === */
@media (max-width: 575.98px) {
  .afo-scope .afo-col,
  .afo-scope [class^="afo-col-"],
  .afo-scope [class*=" afo-col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* === TARJETAS (CARDS) MODERNAS === */
.afo-scope .afo-tarjeta {
  background: var(--afo-white);
  border: 1px solid var(--afo-border);
  border-radius: var(--afo-border-radius);
  box-shadow: var(--afo-shadow-sm);
  transition: var(--afo-transition);
  overflow: hidden;
  font-family: var(--afo-font-family);
}

.afo-scope .afo-tarjeta:hover {
  box-shadow: var(--afo-shadow-md);
}

.afo-scope .afo-tarjeta-encabezado {
  padding: 1.25rem 1.5rem;
  background-color: var(--afo-light);
  border-bottom: 1px solid var(--afo-border);
  font-weight: 600;
font-variant-caps:all-petite-caps;
}

.afo-scope .afo-tarjeta-cuerpo {
  flex: 1 1 auto;
  padding: 1.5rem;
  font-size: 0.950rem;
}

.afo-scope .afo-tarjeta-primaria .afo-tarjeta-encabezado {
  background: linear-gradient(135deg, var(--afo-primary), var(--afo-primary-dark));
  color: var(--afo-white);
}

.afo-scope .afo-tarjeta-peligro .afo-tarjeta-encabezado {
  background: linear-gradient(135deg, var(--afo-danger), var(--afo-danger-dark));
  color: var(--afo-white);
}

.afo-scope .afo-tarjeta-exito .afo-tarjeta-encabezado {
  background: linear-gradient(135deg, var(--afo-success), var(--afo-success-dark));
  color: var(--afo-white);
}

.afo-scope .afo-tarjeta-info .afo-tarjeta-encabezado {
  background: linear-gradient(135deg, var(--afo-info), var(--afo-info-dark));
  color: var(--afo-black);
}

.afo-scope .afo-tarjeta-default .afo-tarjeta-encabezado {
  background: var(--afo-white);
  color: var(--afo-dark);
  border-bottom: 2px solid var(--afo-border);
}

/* === ALERTAS MODERNAS === */
.afo-scope .afo-alerta {
  position: relative;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  border-radius: var(--afo-border-radius);
  border-left: 4px solid transparent;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--afo-font-family);
}

.afo-scope .afo-alerta-informacion {
  background-color: var(--afo-alert-info-bg);
  color: var(--afo-alert-info-color);
  border-left-color: var(--afo-primary);
}

.afo-scope .afo-alerta-exito {
  background-color: var(--afo-alert-success-bg);
  color: var(--afo-alert-success-color);
  border-left-color: var(--afo-success);
}

.afo-scope .afo-alerta-advertencia {
  background-color: var(--afo-alert-warning-bg);
  color: var(--afo-alert-warning-color);
  border-left-color: var(--afo-warning);
}

.afo-scope .afo-alerta-peligro {
  background-color: var(--afo-alert-danger-bg);
  color: var(--afo-alert-danger-color);
  border-left-color: var(--afo-danger);
}

/* === BADGES === */
.afo-scope .afo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  border-radius: 50rem;
  vertical-align: middle;
  font-family: var(--afo-font-family);
}

.afo-scope .afo-badge-exito {
  color: #fff;
  background-color: var(--afo-success);
}

.afo-scope .afo-badge-advertencia {
  color: #fff;
  background-color: var(--afo-warning);
}

.afo-scope .afo-badge-peligro {
  color: #fff;
  background-color: var(--afo-danger);
}

.afo-scope .afo-badge-informacion {
  color: #fff;
  background-color: var(--afo-primary);
}

/* === BOTONES MODERNOS === */
.afo-scope .afo-boton {
  padding: var(--afo-btn-padding-y) var(--afo-btn-padding-x);
  font-size: var(--afo-btn-font-size);
  font-weight: 600;
  border-radius: var(--afo-border-radius);
  transition: var(--afo-transition);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  font-family: var(--afo-font-family);
  line-height: 1.5;
  text-decoration: none;
}

.afo-scope .afo-boton-sm {
  padding: var(--afo-btn-sm-padding-y) var(--afo-btn-sm-padding-x);
  font-size: var(--afo-btn-sm-font-size);
}

.afo-scope .afo-boton-lg {
  padding: var(--afo-btn-lg-padding-y) var(--afo-btn-lg-padding-x);
  font-size: var(--afo-btn-lg-font-size);
}

.afo-scope .afo-boton:hover {
  transform: translateY(-2px);
  box-shadow: var(--afo-shadow-md);
}

.afo-scope .afo-boton:active {
  transform: translateY(0);
  box-shadow: none;
}

.afo-scope .afo-boton-primario {
  background: linear-gradient(135deg, var(--afo-primary), var(--afo-primary-dark));
  color: var(--afo-white);
}

.afo-scope .afo-boton-secundario {
  background: var(--afo-secondary);
  color: var(--afo-white);
}

.afo-scope .afo-boton-exito {
  background: linear-gradient(135deg, var(--afo-success), var(--afo-success-dark));
  color: var(--afo-white);
}

.afo-scope .afo-boton-peligro {
  background: linear-gradient(135deg, var(--afo-danger), var(--afo-danger-dark));
  color: var(--afo-white);
}

/* === MODAL MODERNO === */
.afo-scope .afo-modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999999;
  display: none;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: var(--afo-modal-overlay);
  font-family: var(--afo-font-family);
}

.afo-scope .afo-modal.afo-modal-visible {
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
}

/* body.afo-modal-abierto se controla desde JS con position:fixed */

.afo-scope .afo-modal-dialogo {
  position: relative;
  width: auto;
  margin: 1.75rem auto;
  max-width: 500px;
  pointer-events: none;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.afo-scope .afo-modal-visible .afo-modal-dialogo {
  animation: afo-aparecer 0.3s ease-out;
}

.afo-scope .afo-modal-contenido {
  position: relative;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  background-color: var(--afo-white);
  border: 1px solid var(--afo-modal-border);
  border-radius: var(--afo-radius-lg);
  box-shadow: var(--afo-shadow-lg);
  /* Sin max-height: el scroll aparece en el overlay oscuro */
}

.afo-scope .afo-modal-encabezado {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--afo-modal-header-footer-border);
}

.afo-scope .afo-modal-titulo {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.afo-scope .afo-modal-cuerpo {
  flex: 1 1 auto;
  padding: 1.5rem;
  /* Sin overflow-y: la barra de scroll aparece en el overlay oscuro */
}

.afo-scope .afo-modal-pie {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--afo-modal-header-footer-border);
  gap: 0.5rem;
}

.afo-scope .afo-modal-cerrar {
  background: transparent;
  border: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--afo-black);
  opacity: 0.5;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s;
}

.afo-scope .afo-modal-cerrar:hover {
  opacity: 0.75;
}

/* === SKELETON LOADER === */
.afo-scope .afo-skeleton {
  background: var(--afo-white);
  border: 1px solid var(--afo-border);
  border-radius: var(--afo-border-radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.afo-scope .afo-skeleton-header {
  margin-bottom: 1.25rem;
}

.afo-scope .afo-skeleton-body {
  margin-bottom: 1.25rem;
}

.afo-scope .afo-skeleton-footer {
  margin-top: 1rem;
}

.afo-scope .afo-skeleton-line {
  height: 0.75rem;
  background: linear-gradient(90deg, var(--afo-border) 25%, var(--afo-light) 50%, var(--afo-border) 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  margin-bottom: 0.75rem;
  animation: afo-skeleton-loading 1.5s ease-in-out infinite;
}

.afo-scope .afo-skeleton-line-sm { width: 30%; }
.afo-scope .afo-skeleton-line-md { width: 60%; }
.afo-scope .afo-skeleton-line-lg { width: 100%; height: 1rem; }

.afo-scope .afo-skeleton-text {
  text-align: center;
  color: var(--afo-secondary);
  font-size: 0.875rem;
  margin-top: 1rem;
  animation: afo-pulse 2s ease-in-out infinite;
}

@keyframes afo-skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

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

/* === TOAST NOTIFICATIONS === */
.afo-scope .afo-toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 400px;
  font-family: var(--afo-font-family);
}

.afo-scope .afo-toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--afo-white);
  border: 1px solid var(--afo-border);
  border-radius: var(--afo-border-radius);
  box-shadow: var(--afo-shadow-lg);
  animation: afo-toast-in 0.3s ease-out;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.afo-scope .afo-toast-exito {
  border-left: 4px solid var(--afo-success);
}

.afo-scope .afo-toast-informacion {
  border-left: 4px solid var(--afo-primary);
}

.afo-scope .afo-toast-advertencia {
  border-left: 4px solid var(--afo-warning);
}

.afo-scope .afo-toast-peligro {
  border-left: 4px solid var(--afo-danger);
}

.afo-scope .afo-toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.afo-scope .afo-toast-message {
  flex: 1;
  font-size: 0.875rem;
  color: var(--afo-dark);
}

.afo-scope .afo-toast-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--afo-secondary);
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.afo-scope .afo-toast-close:hover {
  color: var(--afo-dark);
}

@keyframes afo-toast-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* === UTILIDADES === */
.afo-scope .afo-mb-0 { margin-bottom: 0; }
.afo-scope .afo-mb-2 { margin-bottom: 0.5rem; }
.afo-scope .afo-mb-3 { margin-bottom: 1rem; }
.afo-scope .afo-mt-2 { margin-top: 0.5rem; }
.afo-scope .afo-mt-3 { margin-top: 1rem; }
.afo-scope .afo-ml-2 { margin-left: 0.5rem; }
.afo-scope .afo-mr-2 { margin-right: 0.5rem; }
.afo-scope .afo-p-2 { padding: 0.5rem; }
.afo-scope .afo-p-3 { padding: 1rem; }

.afo-scope .afo-texto-centro { text-align: center; }
.afo-scope .afo-texto-izquierda { text-align: left; }
.afo-scope .afo-texto-derecha { text-align: right; }

/* === IMÁGENES === */
.afo-scope .afo-imagen-responsive {
  max-width: 100%;
  height: auto;
}

.afo-scope .afo-logo {
  max-height: 50px;
  width: auto;
}

/* === TABLAS === */
.afo-scope .afo-tabla-contenedor {
  width: 100%;
  overflow-x: auto;
  margin-top: 1.5rem;
  border-radius: var(--afo-border-radius);
  border: 1px solid var(--afo-border);
}

.afo-scope .afo-tabla-contenedor h4{
  font-size: 1.325rem;
}

.afo-scope .afo-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  color: var(--afo-dark);
  background: var(--afo-white);
  font-family: var(--afo-font-family);
}

.afo-scope .afo-tabla thead th {
  background-color: var(--afo-light);
  color: var(--afo-table-header-color);
  padding: 0.75rem 0.75rem;
  border-bottom: 2px solid var(--afo-border);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
}

.afo-scope .afo-tabla tbody td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--afo-table-cell-border);
  white-space: nowrap;
}

.afo-scope .afo-tabla tbody tr:last-child td {
  border-bottom: none;
}

.afo-scope .afo-tabla tbody tr:hover {
  background-color: var(--afo-table-row-hover);
}

/* Tabla modal */
.afo-scope .afo-tabla-modal {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.afo-scope .afo-tabla-modal th,
.afo-scope .afo-tabla-modal td {
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--afo-modal-header-footer-border);
}

.afo-scope .afo-tabla-modal thead {
  background-color: var(--afo-light);
}

/* === ESTADOS DE AFILIACIÓN === */
.afo-scope .afo-estado-vigente {
  color: var(--afo-estado-vigente);
  font-weight: 700;
}

.afo-scope .afo-estado-vencido,
.afo-scope .afo-estado-desconocido {
  color: var(--afo-danger);
  font-weight: 700;
}

/* === CAMPOS DE FORMULARIO === */
.afo-scope .afo-campo {
  width: 100%;
  padding: var(--afo-input-padding-y) var(--afo-input-padding-x);
  font-size: var(--afo-input-font-size);
  border: 1px solid var(--afo-input-border);
  border-radius: var(--afo-border-radius);
  transition: var(--afo-transition);
  font-family: var(--afo-font-family);
  background-color: var(--afo-white);
  color: var(--afo-dark);
  line-height: 1.5;
  box-sizing: border-box;
}

.afo-scope .afo-campo:focus {
  border-color: var(--afo-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.afo-scope .afo-etiqueta-campo {
  display: inline-block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  color: var(--afo-dark);
  font-size: 0.875rem;
}

.afo-scope .afo-grupo {
  margin-bottom: 1.25rem;
}

@media (max-width: 575.98px) {
  .afo-scope .afo-campo {
    padding: var(--afo-input-padding-y-sm) var(--afo-input-padding-x-sm);
    font-size: var(--afo-input-font-size-sm);
  }
}

/* === ANIMACIONES === */
@keyframes afo-girar {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes afo-aparecer {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== FORMULARIO DE CONSULTA (MODERNO) ===== */
.afo-scope .afocat-form-wrapper {
  background: var(--afo-white);
  border-radius: var(--afo-radius-lg);
  padding: 2.5rem;
  box-shadow: var(--afo-shadow);
  margin-bottom: 1.5rem;
  border: 1px solid var(--afo-border);
}

.afo-scope .afocat-form-wrapper h3 {
  color: var(--afo-primary);
  margin: 0 0 1.5rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  border-bottom: 2px solid var(--afo-border);
  padding-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.afo-scope .afocat-form {
  display: block;
}

.afo-scope .afocat-form-divider {
  text-align: center;
  margin: 1.5rem 0;
  color: var(--afo-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  position: relative;
}

.afo-scope .afocat-form-divider::before {
  content: '';
  position: absolute;
  left: 10%;
  top: 50%;
  right: 10%;
  height: 1px;
  background: var(--afo-border);
  z-index: 1;
}

.afo-scope .afocat-form-divider span {
  background: var(--afo-white);
  padding: 0 1.25rem;
  display: inline-block;
  position: relative;
  z-index: 2;
}

.afo-scope .afocat-form-actions {
  margin-top: 1.5rem;
  text-align: center;
}

.afo-scope .afocat-form-group {
  margin-bottom: 1.25rem;
}

.afo-scope .afocat-form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--afo-dark);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.afo-scope .afocat-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--afo-border);
  border-radius: var(--afo-border-radius);
  font-size: 1rem;
  transition: var(--afo-transition);
  background-color: var(--afo-white);
  color: var(--afo-dark);
  font-family: var(--afo-font-family);
  line-height: 1.5;
  box-sizing: border-box;
}

.afo-scope .afocat-input:focus {
  outline: none;
  border-color: var(--afo-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.afo-scope .afocat-help-text {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  color: var(--afo-secondary);
  font-style: italic;
}

/* ===== FORMULARIO EN ESCRITORIO (HORIZONTAL) ===== */
@media (min-width: 769px) {
  .afo-scope .afocat-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1.25rem;
  }

  .afo-scope .afocat-form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
  }

  .afo-scope .afocat-form-divider {
    flex: 0 0 auto;
    margin: 0;
    padding: 0 0.75rem;
    position: relative;
    bottom: -8px;
  }

  .afo-scope .afocat-form-divider::before {
    display: none;
  }

  .afo-scope .afocat-form-divider span {
    background: var(--afo-light);
    padding: 0.625rem 1rem;
    border-radius: 50%;
    border: 2px solid var(--afo-border);
    font-size: 0.8125rem;
    min-width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .afo-scope .afocat-form-actions {
    flex: 1 0 100%;
    margin-top: 1.5rem;
  }
}

/* ===== BOTONES PROFESIONALES ===== */
.afo-scope .afocat-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: var(--afo-border-radius);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--afo-transition);
  text-decoration: none;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  line-height: 1.5;
  gap: 0.5rem;
  font-family: var(--afo-font-family);
}

.afo-scope .afocat-btn-primary {
  background: linear-gradient(135deg, var(--afo-primary), var(--afo-primary-dark));
  color: var(--afo-white);
  box-shadow: 0 4px 6px rgba(37, 99, 235, 0.25);
}

.afo-scope .afocat-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
}

.afo-scope .afocat-btn-secondary {
  background: var(--afo-white);
  color: var(--afo-primary);
  border: 2px solid var(--afo-border);
}

.afo-scope .afocat-btn-secondary:hover {
  background: var(--afo-light);
  border-color: var(--afo-primary-light);
}

/* === DETALLE OCULTO (para modales de detalle) === */
.afo-scope .afo-detalle-oculto { display: none; }

.afo-scope .text-center { text-align: center; }
.afo-scope .text-bold { font-weight: 700; }
.afo-scope .classTdMonto { text-align: right; font-variant-numeric: tabular-nums; }




/* ============================================
   PAGINACIÓN AFOCAT - ESTILOS MODERNOS
   ============================================
   Compatible con el sistema de variables y
   el scope .afo-scope.
   ============================================ */

.afo-scope .afo-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  font-family: var(--afo-font-family);
  border-top: 1px solid var(--afo-border);
  margin-top: 1.5rem;
}

/* Información de registros */
.afo-scope .afo-pagination-info {
  font-size: 0.875rem;
  color: var(--afo-secondary);
  font-weight: 500;
}

/* Contenedor de botones */
.afo-scope .afo-pagination-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Botones de navegación (Anterior / Siguiente) */
.afo-scope .afo-pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid var(--afo-border);
  border-radius: var(--afo-radius-sm);
  background-color: var(--afo-white);
  color: var(--afo-dark);
  cursor: pointer;
  transition: var(--afo-transition);
  font-family: var(--afo-font-family);
  line-height: 1.5;
}

.afo-scope .afo-pagination-btn:hover:not(:disabled) {
  background-color: var(--afo-light);
  border-color: var(--afo-primary);
  color: var(--afo-primary);
  transform: translateY(-1px);
  box-shadow: var(--afo-shadow-sm);
}

.afo-scope .afo-pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--afo-light);
  color: var(--afo-secondary);
}

/* Contenedor de números de página */
.afo-scope .afo-pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Cada botón de página */
.afo-scope .afo-pagination-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--afo-radius-sm);
  background-color: transparent;
  color: var(--afo-dark);
  cursor: pointer;
  transition: var(--afo-transition);
  font-family: var(--afo-font-family);
  line-height: 1;
}

.afo-scope .afo-pagination-page:hover:not(.afo-pagination-active) {
  background-color: var(--afo-light);
  border-color: var(--afo-border);
}

.afo-scope .afo-pagination-page.afo-pagination-active {
  background: linear-gradient(135deg, var(--afo-primary), var(--afo-primary-dark));
  color: var(--afo-white);
  border-color: var(--afo-primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  font-weight: 700;
  cursor: default;
}

/* Responsive: en móviles apila la info y los botones */
@media (max-width: 575.98px) {
  .afo-scope .afo-pagination {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .afo-scope .afo-pagination-info {
    text-align: center;
  }

  .afo-scope .afo-pagination-buttons {
    justify-content: center;
  }

  .afo-scope .afo-pagination-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
  }

  .afo-scope .afo-pagination-page {
    min-width: 2rem;
    height: 2rem;
    font-size: 0.8125rem;
  }
}
.afo-scope .afo-pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
  color: var(--afo-secondary);
  font-size: 0.875rem;
}