/* Design Tokens - RS Welspun Pedidos */
:root {
    --color-primary: #3C0D34;
    --color-primary-hover: #2A0925;
    --color-primary-light: #F5EEF3;
    --color-accent: #7B1271;
    --color-navy: #0a1228;
    --color-success: #16a34a;
    --color-warning: #f59e0b;
    --color-danger: #dc2626;
    --color-info: #2563eb;
    --color-bg: #f6f6f8;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --font-family: 'Manrope', system-ui, -apple-system, sans-serif;
}

/* Base */
html, body {
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Global keyboard-only visible focus indicator (WCAG 2.2 SC 2.4.7 / 2.4.13) */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 0.25rem;
}

/* Blazor error boundary */
.blazor-error-boundary {
    background: #fff3cd;
    padding: 1rem;
    border: 1px solid #ffc107;
    border-radius: 0.5rem;
    color: #856404;
}

.blazor-error-boundary::after {
    content: "Ha ocurrido un error.";
}

/* Validation */
.validation-message {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Loading indicator */
.loading-spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #e2e8f0;
    border-top-color: #3C0D34;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Celebración "todo repartido" (REV-05 / D-01) — one-shot sutil: fade-in + un único pulso de escala.
   NO infinito. Se re-dispara vía @key en New.razor (D-03): al cambiar la key, Blazor reemplaza el nodo
   y la animación vuelve a reproducirse. Tono contenido, coherente con el portal interno Railsider. */
@keyframes celebrate-pop {
    0%   { opacity: 0; transform: scale(0.96); }
    60%  { opacity: 1; transform: scale(1.03); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes celebrate-icon-pop {
    0%   { transform: scale(0.7); }
    55%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}

.animate-celebrate {
    animation: celebrate-pop 0.42s ease-out 1 both;
}

.animate-celebrate-icon {
    display: inline-block;
    animation: celebrate-icon-pop 0.42s ease-out 1 both;
    transform-origin: center;
}

/* Fallback accesible (T-22-04): sin movimiento para quien lo pide → la caja aparece estática. */
@media (prefers-reduced-motion: reduce) {
    .animate-celebrate,
    .animate-celebrate-icon {
        animation: none !important;
    }
}

/* Sidebar nav items (global — CSS isolation can't reach NavLink-rendered <a>) */
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(148 163 184);
    text-decoration: none;
    transition: all 0.15s ease;
    width: 100%;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

.nav-item.active {
    background: #7B1271;
    color: white;
}

/* Print */
@media print {
    .no-print { display: none !important; }
}
