@layer components {
  /* Indicador global de carga al navegar entre vistas del SPA */
  .app-root[aria-busy="true"] {
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .app-root[aria-busy="true"]::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: var(--color-primary);
    z-index: 999999;
    animation: spaLoadingBar 1.5s infinite linear;
    box-shadow: 0 0 10px var(--color-primary);
  }

  @keyframes spaLoadingBar {
    0% { left: -30%; width: 30%; }
    50% { left: 30%; width: 70%; }
    100% { left: 100%; width: 30%; }
  }


  /* =========================================================
     Skeleton Loaders & Shimmer Effect (UI/UX)
     ========================================================= */

  @keyframes skeletonShimmer {
    0% {
      background-position: -200% 0;
    }
    100% {
      background-position: 200% 0;
    }
  }

  .skeleton {
    background: linear-gradient(
      90deg,
      #f1f5f9 25%,
      #e2e8f0 50%,
      #f1f5f9 75%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite ease-in-out;
    border-radius: 6px;
    display: inline-block;
  }

  .skeleton-text {
    height: 14px;
    width: 100%;
    border-radius: 4px;
  }

  .skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .skeleton-badge {
    height: 22px;
    width: 60px;
    border-radius: 12px;
  }

  .skeleton-btn {
    height: 36px;
    width: 90px;
    border-radius: 8px;
  }

  .skeleton-card {
    background: #ffffff;
    border: 1px solid var(--border-soft, #e2e8f0);
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* Animación suave de entrada para filas y tarjetas */
  @keyframes rowFadeIn {
    from {
      opacity: 0;
      transform: translateY(4px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .animate-fade-in {
    animation: rowFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* Textos de estado vacío fuera de capas para conservar prioridad tipográfica. */
/* Empty State Moderno */
@layer components {
.empty-state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}
}

@layer components {
.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  margin-bottom: 4px;
}
}

.empty-state-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main, #102a56);
  margin: 0;
}

.empty-state-desc {
  font-size: 13.5px;
  color: var(--text-secondary, #64748b);
  margin: 0;
  max-width: 320px;
}
