/* =====================================================
   MÓDULO: Análisis de Rotación de Productos
   Inventa v1.0 - rotacion.css
   ===================================================== */

#rotation-view {
    animation: rot-fadein 0.35s ease;
}

@keyframes rot-fadein {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── KPI Cards ─────────────────────────────────────── */
.rot-kpi-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius, 12px);
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: transform .2s, box-shadow .2s;
    position: relative;
    overflow: hidden;
}
.rot-kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--kpi-accent, var(--primary-color, #2563eb));
    border-radius: var(--radius, 12px) var(--radius, 12px) 0 0;
}
.rot-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,.1);
}
.rot-kpi-card .kpi-label {
    font-size: .78rem;
    color: var(--text-muted, #64748b);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.rot-kpi-card .kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-color, #1e293b);
    line-height: 1;
}
.rot-kpi-card .kpi-sub {
    font-size: .75rem;
    color: var(--text-muted, #64748b);
}

/* ── Estado badges en tabla ─────────────────────────── */
.rot-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    white-space: nowrap;
}
.rot-badge.alta   { background: #dcfce7; color: #16a34a; }
.rot-badge.media  { background: #fef9c3; color: #ca8a04; }
.rot-badge.baja   { background: #fee2e2; color: #dc2626; }
.rot-badge.nula   { background: #f1f5f9; color: #64748b; }

/* ── Tabla row-highlight ────────────────────────────── */
#rotation-table tbody tr.rot-baja { background: rgba(239,68,68,.04); }
#rotation-table tbody tr.rot-alta { background: rgba(22,163,74,.04); }

/* ── Loader de cálculo ──────────────────────────────── */
#rotation-loader {
    display: none;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: 2rem;
    color: var(--text-muted);
    font-size: .9rem;
}
#rotation-loader .spinner {
    width: 24px; height: 24px;
    border: 3px solid var(--border-color, #e2e8f0);
    border-top-color: var(--primary-color, #2563eb);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
