/* ══════════════════════════════════════════════════════════════════
   Modulo Inventarios — CSS propio (regla: un archivo por modulo).
   Prefijos por componente: .mcat- grupos de articulos / categorias.
   ══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════════
   Grupos de artículos / categorías (CategoriaListPage) — prefijo .mcat-
   Reusa .pcta-* (filtros, botones, pie) del plan de cuentas y .cmas-* del
   modal de cambio masivo: son el mismo patrón de trabajo.
   ══════════════════════════════════════════════════════════════════════ */
.mcat-ico-folder { color: #e6a817; font-size: 12px; }
.mcat-ico-leaf { color: #94a3b8; font-size: 10px; }
.mcat-ico-alerta { color: #c77700; }

.mcat-buscar { display: flex; gap: 6px; margin-left: auto; min-width: 260px; }
.mcat-buscar .ccta-inp { height: 32px; }

.mcat-tabla { width: 100%; }
.mcat-tabla thead th { font-size: 0.65rem; text-transform: uppercase; letter-spacing: .4px; color: #94a3b8; font-weight: 700; }
.mcat-tabla thead th:first-child,
.mcat-tabla tbody td:first-child {
    width: 34px; min-width: 34px; max-width: 34px;
    padding-left: 0; padding-right: 0; text-align: center;
}
.mcat-tabla thead th:first-child { font-size: 0; }
.mcat-tabla thead th:first-child input { font-size: .95rem; margin-left: 0 !important; }

.mcat-row { cursor: pointer; }
.mcat-row:hover { background: #f8fafc; }
.mcat-row.is-sel { background: #eef4fd; box-shadow: inset 3px 0 0 var(--primario, #284A70); }
.mcat-row.is-off { opacity: .55; text-decoration: line-through; }

.mcat-n0 td:nth-child(2) { border-left: 3px solid var(--primario, #284A70); }
.mcat-n1 td:nth-child(2) { border-left: 3px solid #60a5fa; }
.mcat-n2 td:nth-child(2) { border-left: 3px solid #93c5fd; }
.mcat-n3 td:nth-child(2) { border-left: 3px solid #cbd5e1; }
.mcat-n4 td:nth-child(2) { border-left: 3px solid #e2e8f0; }

.mcat-cod { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.mcat-cod > b { font-family: Consolas, monospace; font-size: 0.78rem; color: #1e3a5f; }
.mcat-abrev {
    background: #eef2f8; color: #475569; border-radius: 5px;
    padding: 0 6px; font-size: 0.67rem; font-weight: 700;
}

.mcat-nom { font-size: 0.83rem; color: #1e3a5f; font-weight: 600; }
.mcat-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.mcat-tag {
    background: #f1f5f9; color: #475569; border-radius: 5px;
    padding: 0 7px; font-size: 0.67rem; font-weight: 600;
}
.mcat-flag {
    background: #e8f1fb; color: #1976d2; border-radius: 5px;
    padding: 0 7px; font-size: 0.67rem; font-weight: 600;
}

.mcat-ctas { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.mcat-ctas__cont {
    border-radius: 999px; padding: 1px 9px; font-size: 0.68rem; font-weight: 700; flex-shrink: 0;
}
.mcat-ctas__cont.is-cero { background: #fdecec; color: #c62828; }
.mcat-ctas__cont.is-parcial { background: #fff4e5; color: #c77700; }
.mcat-ctas__cont.is-ok { background: #e7f6e9; color: #2e7d32; }

.mcat-cta {
    display: inline-flex; align-items: center; gap: 4px;
    border: 1px solid #e0e4ec; border-radius: 6px; padding: 1px 6px;
    font-size: 0.66rem; font-weight: 700; color: #94a3b8; background: #fff;
}
.mcat-cta > b { font-family: Consolas, monospace; font-weight: 600; color: #475569; }
.mcat-cta.is-on { border-color: #cfe0f7; color: #1976d2; background: #f7fbff; }
.mcat-cta.is-off { border-style: dashed; color: #c0c8d4; }
.mcat-nocta { font-size: 0.72rem; color: #cbd5e1; font-style: italic; }

.mcat-btn-ctas {
    border: 1px solid #e0e4ec; background: #fff; color: #475569;
    border-radius: 7px; padding: 4px 10px; font-size: 0.73rem; font-weight: 600; cursor: pointer;
    white-space: nowrap;
}
.mcat-btn-ctas:hover { border-color: var(--primario, #284A70); color: var(--primario, #284A70); background: #f5f8fd; }

.mcat-vacio { text-align: center; padding: 26px; color: #94a3b8; font-size: 0.84rem; }
.mcat-vacio i { display: block; font-size: 1.5rem; margin-bottom: 8px; opacity: .5; }
.mcat-acciones { display: flex; gap: 6px; }

/* Acciones por FILA: el pie de la tabla queda fuera de pantalla con muchos grupos. */
.mcat-acc-fila { display: inline-flex; align-items: center; gap: 4px; justify-content: center; }
.mcat-btn-ico {
    border: 1px solid #e0e4ec; background: #fff; color: #64748b;
    border-radius: 7px; padding: 4px 8px; font-size: 0.75rem; cursor: pointer; line-height: 1;
}
.mcat-btn-ico:hover { border-color: var(--primario, #284A70); color: var(--primario, #284A70); background: #f5f8fd; }
.mcat-btn-ico.is-anular:hover { border-color: #c62828; color: #c62828; background: #fdecec; }
.mcat-btn-ico.is-activar { color: #2e7d32; }
.mcat-btn-ico.is-activar:hover { border-color: #2e7d32; color: #2e7d32; background: #e7f6e9; }

/* Selector de cuenta dentro del modal de categorías */
.mcat-picker { display: flex; align-items: center; gap: 6px; margin: 9px 0 0 25px; }
.mcat-picker .form-control { flex: 1 1 auto; }

/* ============================================================================
   G7.3 — Panel de excepciones de lote. Prefijo .exl-
   ============================================================================ */
.exl-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--primario, #1e3a5f) 0%, #2c5282 100%);
    border-bottom: 3px solid #d4af37;
    border-radius: 6px 6px 0 0;
    padding: 14px 18px;
    margin-bottom: 12px;
    color: #fff;
}

.exl-titulo {
    margin: 0;
    font-weight: 700;
}

.exl-sub {
    font-size: 12px;
    opacity: .88;
}

/* ── KPIs ─────────────────────────────────────────────────────────────────── */
/* Tres colores distintos a propósito: error de stock, trazabilidad perdida y
   deuda reparable no son la misma gravedad. */
.exl-kpis {
    margin-bottom: 4px;
}

.exl-kpi {
    background: #fff;
    border: 1px solid var(--linea-suave, #e0e4ec);
    border-left: 4px solid #6b7a90;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 12px;
    min-height: 118px;
}

.exl-kpi-num {
    display: block;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--primario, #1e3a5f);
}

.exl-kpi-lbl {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: #4a5a70;
    margin-bottom: 4px;
}

.exl-kpi-hint {
    display: block;
    font-size: 11.5px;
    color: #6b7a90;
    line-height: 1.35;
}

.exl-kpi.exl-ok {
    border-left-color: #2e7d32;
}

.exl-kpi.exl-ok .exl-kpi-num {
    color: #2e7d32;
}

.exl-kpi.exl-mal {
    border-left-color: #c62828;
    background: #fffafa;
}

.exl-kpi.exl-mal .exl-kpi-num {
    color: #c62828;
}

.exl-kpi.exl-warn {
    border-left-color: #c77700;
}

.exl-kpi.exl-warn .exl-kpi-num {
    color: #c77700;
}

.exl-kpi.exl-info {
    border-left-color: #1976d2;
}

.exl-kpi.exl-info .exl-kpi-num {
    color: #1976d2;
}

/* ── Estado limpio ────────────────────────────────────────────────────────── */
.exl-limpio {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: #edf7ee;
    border-left: 4px solid #2e7d32;
    border-radius: 6px;
    padding: 11px 14px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #1f5c23;
}

.exl-limpio code {
    background: #d9ecdb;
    color: #1f5c23;
    padding: 0 4px;
    border-radius: 3px;
}

/* ── Tablas ───────────────────────────────────────────────────────────────── */
.exl-h6 {
    font-weight: 700;
    color: var(--primario, #1e3a5f);
    margin-bottom: 6px;
}

.exl-nota {
    font-size: 11.5px;
    color: #6b7a90;
    margin-bottom: 10px;
}

.exl-tabla thead th {
    background: var(--primario, #1e3a5f);
    color: #fff;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .3px;
    border: 0;
    white-space: nowrap;
}

.exl-tabla tbody tr:nth-child(even) {
    background: #f7f9fc;
}

.exl-neg {
    color: #c62828;
    font-weight: 700;
}

.exl-repa {
    color: #1976d2;
    font-weight: 600;
}

/* ============================================================================
   Conversión de presentación (abrir y armar cajas). Prefijo .cvp-
   _planes/PLAN_Conversion_Presentacion_Inventario.md
   ============================================================================ */
.cvp-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--primario, #1e3a5f) 0%, #2c5282 100%);
    border-bottom: 3px solid #d4af37;
    border-radius: 6px 6px 0 0;
    padding: 14px 18px;
    margin-bottom: 12px;
    color: #fff;
}

.cvp-titulo { margin: 0; font-weight: 700; }
.cvp-sub { font-size: 12px; opacity: .88; }

.cvp-preparar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: #fff8e6;
    border: 1px solid #f0d49a;
    border-left: 4px solid #c77700;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.cvp-config {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 12px;
    background: #f5f7fb;
    border: 1px solid #e0e4ec;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

/* Con más de un concepto marcado «Conversión», el concepto se elige en la misma barra. */
.cvp-concepto {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cvp-concepto select {
    width: auto;
    min-width: 220px;
    height: 26px;
    padding: 0 6px;
    font-size: 12px;
}

.cvp-card {
    background: #fff;
    border: 1px solid #e0e4ec;
    border-radius: 8px;
    padding: 14px 16px;
    height: 100%;
}

.cvp-card-titulo {
    font-weight: 700;
    color: var(--primario, #1e3a5f);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cvp-paso {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primario, #1e3a5f);
    color: #fff;
    font-size: 12px;
}

.cvp-vacio {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #5b6b7f;
    font-size: 13px;
    padding: 18px 8px;
}
.cvp-vacio > i { font-size: 22px; color: #9aa7b8; }

/* ── Lista de pares caja → unidad ─────────────────────────────────────────── */
.cvp-pares { display: flex; flex-direction: column; gap: 6px; max-height: 460px; overflow-y: auto; }

.cvp-par {
    text-align: left;
    background: #fff;
    border: 1px solid #e0e4ec;
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
}
.cvp-par:hover { border-color: #1976d2; }
.cvp-par.is-sel { border-color: #1976d2; background: #eef5fd; box-shadow: inset 3px 0 0 #1976d2; }

.cvp-par-nombre { font-weight: 600; font-size: 13px; color: #1e3a5f; }
.cvp-par-flecha { font-size: 12px; color: #5b6b7f; }
.cvp-par-stock { display: flex; gap: 14px; font-size: 12px; margin-top: 2px; }

/* ── Sentido ──────────────────────────────────────────────────────────────── */
.cvp-sentidos { display: flex; gap: 8px; flex-wrap: wrap; }

.cvp-sentido {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
    background: #fff;
    border: 1px solid #e0e4ec;
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
}
.cvp-sentido > i { font-size: 18px; color: #9aa7b8; }
.cvp-sentido > span { font-size: 12px; color: #5b6b7f; }
.cvp-sentido.is-sel { border-color: #d4af37; background: #fffaf0; box-shadow: inset 0 -3px 0 #d4af37; }
.cvp-sentido.is-sel > i { color: #c77700; }

/* ── Vista previa ─────────────────────────────────────────────────────────── */
.cvp-previa {
    background: #f5f7fb;
    border: 1px solid #e0e4ec;
    border-radius: 6px;
    padding: 12px;
    min-height: 60px;
}

.cvp-flujo { display: flex; align-items: stretch; gap: 10px; }
.cvp-flecha { display: flex; align-items: center; color: #9aa7b8; font-size: 18px; }

.cvp-lado {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 6px;
    padding: 8px 12px;
    border: 1px solid #e0e4ec;
}
.cvp-sale { border-left: 4px solid #c62828; }
.cvp-entra { border-left: 4px solid #2e7d32; }

.cvp-lado-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #5b6b7f; }
.cvp-lado-num { font-size: 20px; font-weight: 700; color: #1e3a5f; }
.cvp-lado-prod { font-size: 12px; font-weight: 600; }
.cvp-lado-hint { font-size: 11px; color: #5b6b7f; }

.cvp-valor {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-size: 12px;
    margin: 10px 0 6px;
}

.cvp-lotes { background: #fff; }

/* ── Historial ────────────────────────────────────────────────────────────── */
.cvp-hist-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.cvp-rango { display: flex; align-items: center; gap: 6px; }

@media (max-width: 576px) {
    .cvp-flujo { flex-direction: column; }
    .cvp-flecha { justify-content: center; }
    .cvp-preparar { flex-direction: column; align-items: flex-start; }
}

/* ══════════════════════════════════════════════════════════════════════
   Trazabilidad del lote (ModalTrazabilidadLoteComponent) — prefijo .trl-
   Dónde terminó un lote: resumen, a quién llegó, paso a paso y mapa.
   ══════════════════════════════════════════════════════════════════════ */
.trl-dialog { max-width: min(1200px, 96vw); }
.trl-header {
    background: linear-gradient(135deg, var(--primario, #1e3a5f) 0%, #2c5282 100%);
    color: #fff;
    border-bottom: 3px solid #d4af37;
    align-items: flex-start;
}
.trl-header__texto { min-width: 0; }
.trl-eyebrow { font-size: .68rem; text-transform: uppercase; letter-spacing: .6px; opacity: .8; font-weight: 700; }
.trl-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; margin: 2px 0; color: #fff; }
.trl-sub { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; opacity: .9; }
.trl-sub i { margin-right: 4px; }
.trl-close { color: #fff; opacity: .85; text-shadow: none; }
.trl-close:hover { color: #fff; opacity: 1; }
.trl-body { max-height: calc(100vh - 190px); overflow-y: auto; background: #f5f7fb; padding: 14px 18px; }

.trl-codigo {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    background: var(--primario, #1e3a5f); color: #fff; font-weight: 700; font-size: .85rem; white-space: nowrap;
}
.trl-header .trl-codigo { background: #d4af37; color: #1e3a5f; }
.trl-codigo--sm { font-size: .72rem; padding: 1px 6px; }
.trl-fuerte { font-weight: 600; color: #1e3a5f; }
.trl-tag { display: inline-block; font-size: .68rem; padding: 1px 7px; border-radius: 10px; background: #e0e4ec; color: #475569; white-space: nowrap; }
.trl-pendiente { display: inline-block; font-size: .68rem; padding: 1px 7px; border-radius: 10px; background: #fff4e0; color: #c77700; font-weight: 600; white-space: nowrap; }
.trl-nota { font-size: .8rem; color: #64748b; padding: 4px 0; }
.trl-nota--mapa { margin-bottom: 8px; }

.trl-tabs { margin-bottom: 12px; }
.trl-tabs .nav-link { cursor: pointer; font-size: .85rem; }
.trl-tabs .nav-link i { margin-right: 4px; }

.trl-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.trl-kpi { background: #fff; border: 1px solid #e0e4ec; border-left: 4px solid var(--primario, #1e3a5f); border-radius: 6px; padding: 8px 12px; }
.trl-kpi--prod { border-left-color: #c77700; }
.trl-kpi--venta { border-left-color: #1976d2; }
.trl-kpi--salida { border-left-color: #c62828; }
.trl-kpi--stock { border-left-color: #2e7d32; }
.trl-kpi__label { font-size: .68rem; text-transform: uppercase; letter-spacing: .4px; color: #64748b; font-weight: 700; }
.trl-kpi__valor { font-size: 1.15rem; font-weight: 700; color: #1e3a5f; }
.trl-kpi__valor small { font-size: .72rem; color: #64748b; font-weight: 600; }

.trl-avisos { background: #fff8e6; border: 1px solid #f3d38a; border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; font-size: .8rem; color: #7a4f00; }
.trl-avisos i { margin-right: 6px; color: #c77700; }

.trl-seccion { background: #fff; border: 1px solid #e0e4ec; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
.trl-seccion__titulo { font-weight: 700; color: #1e3a5f; font-size: .9rem; margin-bottom: 8px; }
.trl-seccion__titulo i { color: #d4af37; margin-right: 6px; }
.trl-tabla { margin: 0; font-size: .8rem; }
.trl-tabla thead th { font-size: .68rem; text-transform: uppercase; letter-spacing: .4px; color: #94a3b8; border-top: 0; }
.trl-tabla td { vertical-align: middle; }

.trl-lote { border: 1px solid #e0e4ec; border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; background: #fcfdff; }
.trl-lote--hijo { margin-left: calc(min(var(--trl-nivel, 1), 4) * 18px); border-left: 3px solid #d4af37; }
.trl-lote__cab { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; font-size: .85rem; }
.trl-lote__stock { margin-left: auto; font-size: .8rem; color: #2e7d32; }

.trl-pasos { list-style: none; margin: 0; padding: 0; }
.trl-paso { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px dashed #e0e4ec; }
.trl-paso:last-child { border-bottom: 0; }
.trl-paso__icono {
    flex: 0 0 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: .75rem; color: #fff; background: #94a3b8;
}
.trl-paso--ingreso .trl-paso__icono, .trl-paso--producido .trl-paso__icono { background: #2e7d32; }
.trl-paso--subproducto .trl-paso__icono, .trl-paso--devuelto .trl-paso__icono, .trl-paso--devventa .trl-paso__icono { background: #558b2f; }
.trl-paso--consumo .trl-paso__icono { background: #c77700; }
.trl-paso--venta .trl-paso__icono { background: #1976d2; }
.trl-paso--salida .trl-paso__icono { background: #c62828; }
.trl-paso--traslado .trl-paso__icono { background: #64748b; }
.trl-paso__cuerpo { flex: 1 1 auto; min-width: 0; }
.trl-paso__linea { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: .82rem; }
.trl-paso__fecha { color: #64748b; font-size: .75rem; white-space: nowrap; }
.trl-paso__desc { color: #1e293b; }
.trl-paso__cant { margin-left: auto; font-weight: 700; color: #1e3a5f; white-space: nowrap; }
.trl-paso__meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: .74rem; color: #64748b; margin-top: 2px; }
.trl-paso__meta i { margin-right: 3px; }
.trl-paso__resultado {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; padding: 5px 8px;
    background: #fff8e6; border-radius: 4px; font-size: .76rem; color: #7a4f00;
}
.trl-resultado { background: #fff; border: 1px solid #f3d38a; border-radius: 4px; padding: 1px 6px; }
/* Hacia atrás: de qué se hizo (verde, el color de un ingreso) y lo que es de otro recorrido (gris, sin alarma). */
.trl-paso--producido .trl-paso__resultado, .trl-paso--subproducto .trl-paso__resultado { background: #eef7ef; color: #1b5e20; }
.trl-resultado--origen { border-color: #a5d6a7; }
.trl-fuera { font-size: .72rem; color: #64748b; font-style: italic; }
.trl-tag--origen { background: #e6f4ea; color: #2e7d32; }

.trl-tramo { display: flex; align-items: center; gap: 6px; margin: 12px 0 6px; font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: #64748b; }
.trl-tramo:first-of-type { margin-top: 2px; }
.trl-tramo::after { content: ""; flex: 1 1 auto; height: 1px; background: #e0e4ec; }
.trl-tramo--atras i { color: #2e7d32; }
.trl-tramo--lote i { color: var(--primario, #1e3a5f); }
.trl-tramo--adelante i { color: #d4af37; }
.trl-lote--origen { border-left: 3px solid #2e7d32; }

.trl-stock { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; font-size: .78rem; color: #2e7d32; }
.trl-stock__item { background: #eaf5ec; border-radius: 4px; padding: 1px 8px; }

.trl-vacio { text-align: center; color: #64748b; padding: 36px 12px; }
.trl-vacio i { font-size: 1.8rem; margin-bottom: 8px; }

@media (max-width: 576px) {
    .trl-body { padding: 10px; }
    .trl-lote--hijo { margin-left: 8px; }
    .trl-paso__cant { margin-left: 0; }
    .trl-lote__stock { margin-left: 0; }
}

/* ══════════════════════════════════════════════════════════════════════
   Stock por lote y movimientos del lote — prefijo .slt-
   StockPorLoteComponent (pestaña «Por lote» del modal de stock), MovimientosLoteComponent,
   ModalMovimientosLoteComponent y la página /inventarios/stockporlotepage.
   ══════════════════════════════════════════════════════════════════════ */
.slt-modal { max-width: min(1100px, 96vw); }
.slt-modal__body { max-height: calc(100vh - 220px); overflow-y: auto; }
.slt-tabs { margin-bottom: 10px; }
.slt-tabs .nav-link { cursor: pointer; font-size: .85rem; }
.slt-tabs .nav-link i { margin-right: 4px; }

.slt-fuerte { font-weight: 600; color: #1e3a5f; }
.slt-sub { font-size: .75rem; color: #64748b; }
.slt-nowrap { white-space: nowrap; }
.slt-neg { color: #c62828 !important; }
.slt-entra { color: #2e7d32; }
.slt-sale { color: #c62828; }
.slt-nota { font-size: .8rem; color: #64748b; padding: 6px 0; }
.slt-nota i { margin-right: 4px; }
.slt-codigo {
    display: inline-block; padding: 2px 8px; border-radius: 4px; white-space: nowrap;
    background: var(--primario, #1e3a5f); color: #fff; font-weight: 700; font-size: .8rem;
}
.slt-pendiente { display: inline-block; margin-left: 6px; font-size: .68rem; padding: 1px 7px; border-radius: 10px; background: #fff4e0; color: #c77700; font-weight: 600; }
.slt-badge { display: inline-block; margin-left: 4px; font-size: .68rem; padding: 1px 7px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.slt-badge--mal { background: #fdecec; color: #c62828; }
.slt-badge--warn { background: #fff4e0; color: #c77700; }

/* Aviso: el ícono a la izquierda y TODO el texto dentro de .slt-aviso__txt. Suelto, cada trozo (texto, <b>, un ícono
   en medio de la frase) era un elemento flex aparte: en pantallas angostas el ícono quedaba solo en su renglón y la
   frase se partía en pedazos. */
.slt-aviso { display: flex; gap: 6px; align-items: baseline; font-size: .8rem; color: #475569;
             background: #eef4fd; border: 1px solid #d6e3f5; border-radius: 6px; padding: 7px 10px; margin-bottom: 10px; }
.slt-aviso--warn { background: #fff8e6; border-color: #f3d38a; color: #7a4f00; }
.slt-aviso i { margin-right: 2px; }
.slt-aviso__txt { flex: 1 1 auto; min-width: 0; }
.slt-aviso__txt .slt-sub { display: block; margin-top: 2px; }

.slt-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.slt-barra__lbl { margin: 0; font-size: .78rem; font-weight: 600; color: #475569; }
.slt-barra__alm { width: auto; min-width: 200px; max-width: 280px; }
.slt-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.slt-chip { border: 1px solid #d0d7e2; background: #fff; color: #475569; border-radius: 14px; padding: 2px 10px; font-size: .78rem; cursor: pointer; }
.slt-chip:hover { border-color: var(--primario, #1e3a5f); }
.slt-chip--on { background: var(--primario, #1e3a5f); border-color: var(--primario, #1e3a5f); color: #fff; }
.slt-chip--mal:not(.slt-chip--on) { border-color: #f1b5b5; color: #c62828; }
.slt-chip__n { font-weight: 700; margin-left: 3px; }

.slt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 10px; }
.slt-kpis--pagina { margin: 0 0 10px; }
.slt-kpi { background: #fff; border: 1px solid #e0e4ec; border-left: 4px solid var(--primario, #1e3a5f); border-radius: 6px; padding: 6px 10px; }
.slt-kpi span { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .4px; color: #64748b; font-weight: 700; }
.slt-kpi b { font-size: 1.05rem; color: #1e3a5f; }
.slt-kpi small { font-size: .7rem; color: #64748b; font-weight: 600; }
.slt-kpi--ok { border-left-color: #2e7d32; }
.slt-kpi--warn { border-left-color: #c77700; background: #fffaf0; }
.slt-kpi--mal { border-left-color: #c62828; background: #fff6f6; }

.slt-tabla { margin: 0; font-size: .8rem; }
.slt-tabla thead th { font-size: .68rem; text-transform: uppercase; letter-spacing: .4px; color: #64748b; border-top: 0; white-space: nowrap; }
.slt-tabla td { vertical-align: middle; }
.slt-tabla-wrap { border: 1px solid #e0e4ec; border-radius: 6px; }
.slt-fila--sel { background: #eef4fd !important; box-shadow: inset 3px 0 0 var(--primario, #1e3a5f); }

.slt-detalle { margin-top: 12px; border: 1px solid #e0e4ec; border-left: 3px solid #d4af37; border-radius: 6px; padding: 8px 12px; background: #fcfdff; }
.slt-detalle__titulo { font-weight: 700; color: #1e3a5f; font-size: .85rem; margin-bottom: 6px; display: flex; align-items: center; }
.slt-detalle__cerrar { margin-left: auto; font-size: 1.2rem; }

.slt-mov__cab { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .85rem; }
.slt-mov__saldo { margin-left: auto; color: #475569; }
.slt-mov__tabla { max-height: 340px; overflow-y: auto; }
.slt-mov__productos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; padding: 6px 8px;
    background: #f5f7fb; border: 1px dashed #d0d7e2; border-radius: 6px; }
.slt-mov__productos .slt-chip[disabled] { opacity: .6; cursor: wait; }

.slt-vacio { text-align: center; color: #64748b; padding: 28px 12px; font-size: .85rem; }
.slt-vacio i { font-size: 1.6rem; margin-bottom: 6px; display: block; }

@media (max-width: 576px) {
    .slt-chips { margin-left: 0; }
    .slt-barra__alm { max-width: 100%; }
    .slt-mov__saldo { margin-left: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════
   Modal Stock del producto (rediseño 2026-10-14) — prefijo .skx-
   ModalStockComponent y sus vistas: StockAlmacenesComponent (stock por almacén), KardexAlmacenComponent (kárdex),
   PendientesAlmacenComponent (por recibir / por entregar). Reemplaza a los bloques .kxa- y .sta-.
   ⚠️ Sin transform/filter en ningún ancestro: adentro se abren modales y editores con position: fixed.
   ═══════════════════════════════════════════════════════════════════════════════════════════ */
.skx-fondo { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1040; background: rgba(15, 23, 42, .45); }
.skx-modal {
    position: fixed; top: 24px; bottom: 24px; left: 0; right: 0; margin: 0 auto; z-index: 1050;
    width: min(1320px, calc(100vw - 32px));
    display: flex; flex-direction: column; overflow: hidden;
    background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
    font-size: 14px; color: #1e293b; text-align: left;
}
.skx-modal:focus { outline: none; }
.skx-oculto { display: none !important; }

/* ── Cabecera ── */
.skx-cab { display: flex; align-items: flex-start; gap: 12px 16px; padding: 18px 24px 14px; border-bottom: 1px solid #e9edf3; }
.skx-cab__txt { flex: 1 1 auto; min-width: 0; }
.skx-cab__ruta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: #475569; }
.skx-cab__sep { color: #94a3b8; }
.skx-volver { border: 0; background: none; padding: 0; color: #1d4ed8; font-weight: 600; font-size: 13px; cursor: pointer; }
.skx-volver:hover { text-decoration: underline; }
.skx-cab__titulo { margin: 3px 0 0; font-size: 20px; font-weight: 700; color: #0f172a; line-height: 1.25; overflow-wrap: anywhere; }
.skx-cab__sub { margin-top: 4px; font-size: 14px; color: #64748b; }
.skx-cab__acc { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 10px; }
.skx-cerrar {
    flex: 0 0 36px; width: 36px; height: 36px; border: 0; border-radius: 8px; background: #f1f5f9; color: #334155;
    font-size: 20px; line-height: 1; cursor: pointer;
}
.skx-cerrar:hover { background: #e2e8f0; }
.skx-cerrar:focus-visible, .skx-btn:focus-visible, .skx-seg__btn:focus-visible, .skx-chip:focus-visible,
.skx-dos button:focus-visible, .skx-enlace:focus-visible, .skx-ver:focus-visible, .skx-volver:focus-visible,
.skx-mas__btn:focus-visible { outline: 2px solid #1976d2; outline-offset: 2px; }

/* Selector con rótulo (el almacén del kárdex) */
.skx-sel {
    display: inline-flex; align-items: center; gap: 6px; height: 40px; margin: 0; padding: 0 8px 0 14px;
    border: 1px solid #d5dce6; border-radius: 8px; background: #fff; font-size: 14px; font-weight: 400; color: #64748b;
}
.skx-sel select { border: 0; background: transparent; padding: 0 2px; font-size: 14px; font-weight: 700; color: #0f172a; cursor: pointer; max-width: 280px; }
.skx-sel select:focus { outline: none; }
.skx-sel:focus-within { border-color: #1976d2; box-shadow: 0 0 0 3px rgba(25, 118, 210, .15); }

/* Control segmentado: período, pestañas, «Por almacén / Por lote», unidad */
.skx-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 9px; background: #f1f5f9; }
.skx-seg__btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 0; border-radius: 7px;
    background: transparent; color: #334155; font-size: 14px; white-space: nowrap; cursor: pointer;
}
.skx-seg__btn:hover:not(:disabled) { color: #0f172a; }
.skx-seg__btn:disabled { opacity: .55; cursor: default; }
.skx-seg__btn--on { background: #fff; color: #1d4ed8; font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, .14); }
.skx-seg__n { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 10px; background: #e2e8f0; color: #475569; font-size: 12px; font-weight: 600; line-height: 19px; text-align: center; }
.skx-seg__btn--on .skx-seg__n { background: #1d4ed8; color: #fff; }
.skx-seg--sm .skx-seg__btn { padding: 4px 10px; font-size: 13px; }

/* ── Cuerpo y pie ── */
.skx-cuerpo { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; }
/* El kárdex: la lista ocupa el alto que queda y desplaza adentro; si no queda alto (pantalla baja, gráfico abierto) la
   lista guarda un mínimo usable y desplaza el cuerpo entero, en vez de esconderse debajo del borde. */
.skx-cuerpo--fijo { display: flex; flex-direction: column; overflow: auto; }
.skx-pad { padding: 18px 24px; }
.skx-pad--arriba { padding-bottom: 0; }
.skx-pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; border-top: 1px solid #e9edf3; background: #fafbfc; }
.skx-pie__txt { min-width: 0; font-size: 14px; color: #475569; }
.skx-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 22px; border: 1px solid #d5dce6; border-radius: 8px;
    background: #fff; color: #0f172a; font-size: 15px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.skx-btn:hover:not(:disabled) { background: #f8fafc; border-color: #b6c2d2; }
.skx-btn:disabled { opacity: .6; cursor: default; }
.skx-btn--sm { padding: 7px 16px; font-size: 14px; font-weight: 600; }
.skx-btn--excel { color: #15803d; border-color: #bbf7d0; }
.skx-btn--excel:hover:not(:disabled) { background: #f0fdf4; border-color: #86efac; }
.skx-btn--doc { color: #1d4ed8; border-color: #bfdbfe; }
.skx-btn--doc:hover:not(:disabled) { background: #eff6ff; border-color: #93c5fd; }
.skx-btn--primario { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.skx-btn--primario:hover:not(:disabled) { background: #1e40af; border-color: #1e40af; }
.skx-cargando { padding: 40px 24px; }
.skx-vacio { padding: 36px 16px !important; text-align: center; color: #64748b; }
.skx-vacio i { display: block; margin-bottom: 8px; font-size: 26px; color: #94a3b8; }
.skx-link { border: 0; background: none; padding: 0; color: #1d4ed8; font-weight: 600; cursor: pointer; }
.skx-link:hover { text-decoration: underline; }

/* ── La cuenta en una tira: en almacén − por entregar = disponible + por recibir = proyectado ── */
.skx-ecuacion { display: flex; align-items: stretch; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; background: #fff; }
.skx-ec { flex: 1 1 0; min-width: 0; padding: 12px 18px; }
.skx-ec--foco { background: #eff6ff; }
.skx-ec__op { flex: 0 0 auto; display: flex; align-items: center; padding: 0 4px; color: #94a3b8; font-size: 20px; }
.skx-ec__lbl { font-size: 14px; font-weight: 500; color: #1e293b; }
.skx-ec .skx-ec__lbl--gris { color: #64748b; }
.skx-ec__num { margin-top: 2px; font-size: 26px; font-weight: 700; line-height: 1.15; color: #0f172a; white-space: nowrap; font-variant-numeric: tabular-nums; }
.skx-ec__num small { margin-left: 3px; font-size: 14px; font-weight: 600; }
.skx-ec__nota { margin-top: 3px; font-size: 13px; color: #64748b; }
.skx-ec__valor { margin-top: 2px; font-size: 12.5px; color: #64748b; font-variant-numeric: tabular-nums; }
.skx-ec--entrega .skx-ec__lbl, .skx-ec--entrega .skx-ec__num { color: #c2410c; }
.skx-ec--recibe .skx-ec__lbl, .skx-ec--recibe .skx-ec__num { color: #15803d; }
.skx-ec--sale .skx-ec__lbl, .skx-ec--sale .skx-ec__num { color: #b91c1c; }
.skx-ec--foco .skx-ec__lbl, .skx-ec--foco .skx-ec__num { color: #1d4ed8; }
.skx-ec .skx-ec__num--neg { color: #b91c1c; }

/* Avisos */
.skx-aviso { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 10px; margin-top: 14px; padding: 10px 14px; border: 1px solid transparent; border-radius: 8px; font-size: 14px; }
.skx-aviso > i { margin-top: 3px; }
.skx-aviso__txt { flex: 1 1 220px; min-width: 0; }
.skx-aviso__sub { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; opacity: .9; }
.skx-aviso__extra { flex: 0 0 auto; margin-left: auto; font-size: 13px; font-weight: 600; white-space: nowrap; }
.skx-aviso ul { margin: 6px 0 2px; padding-left: 18px; font-weight: 400; }
.skx-aviso li { margin-bottom: 2px; }
.skx-aviso--ok { background: #ecfdf3; color: #15803d; }
.skx-aviso--ok .skx-aviso__txt { font-weight: 600; }
.skx-aviso--mal { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.skx-aviso--warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* ── Tablas ── */
.skx-tabla-wrap { overflow-x: auto; }
.skx-tabla { width: 100%; margin: 0; border-collapse: collapse; font-size: 14px; }
.skx-tabla th {
    padding: 10px 14px; border-top: 1px solid #e9edf3; border-bottom: 1px solid #e9edf3; background: #f8fafc;
    color: #334155; font-size: 14px; font-weight: 600; text-align: left; white-space: nowrap;
}
.skx-tabla td { padding: 9px 14px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
.skx-tabla th:first-child, .skx-tabla td:first-child { padding-left: 24px; }
.skx-tabla th:last-child, .skx-tabla td:last-child { padding-right: 24px; }
.skx-tabla .skx-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.skx-tabla tfoot td { border-bottom: 0; background: #f8fafc; font-weight: 700; }
.skx-fila { cursor: pointer; }
.skx-fila:hover td { background: #f8fafc; }
.skx-tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap; }
.skx-tag--gris { background: #f1f5f9; color: #475569; }
.skx-tag--entra { background: #dcfce7; color: #15803d; }
.skx-tag--sale { background: #fee2e2; color: #b91c1c; }
.skx-tag--tras { background: #ede9fe; color: #6d28d9; }
.skx-tag--bonif { background: #fef3c7; color: #b45309; }
.skx-tag--mal { background: #fee2e2; color: #b91c1c; }
.skx-tag--warn { background: #fef3c7; color: #b45309; }

/* Stock por almacén */
.skx-tabla--stock td.skx-num { font-size: 16px; }
.skx-alm__nombre { font-size: 15px; font-weight: 600; color: #0f172a; }
.skx-alm__det { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 1px; font-size: 13px; color: #64748b; }
.skx-cuadre { margin-left: 6px; color: #b45309; font-size: 13px; }
.skx-enlace {
    padding: 0; border: 0; background: none; color: #1d4ed8; font-size: inherit; font-weight: 600; cursor: pointer;
    text-decoration: underline; text-underline-offset: 3px; font-variant-numeric: tabular-nums;
}
.skx-enlace--sutil { text-decoration: none; }
.skx-enlace--sutil:hover { text-decoration: underline; }
.skx-c-entrega { color: #c2410c; }
.skx-c-recibe { color: #15803d; }
.skx-c-dispo { color: #1d4ed8; }
.skx-aviso__sub--linea { display: inline; }
.skx-guion { color: #94a3b8; }
.skx-pill { display: inline-block; min-width: 44px; padding: 2px 10px; border-radius: 12px; background: #e7f6ec; color: #15803d; font-weight: 700; text-align: center; }
.skx-pill--neg { background: #fee2e2; color: #b91c1c; }
.skx-falta { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; color: #b91c1c; }
.skx-ultimo { color: #64748b; }
.skx-ver { padding: 0; border: 0; background: none; color: #1d4ed8; font-weight: 600; white-space: nowrap; cursor: pointer; }
.skx-ver:hover { text-decoration: underline; }
.skx-nota { padding: 8px 24px 0; font-size: 13px; color: #64748b; }

/* ── Kárdex ── */
.skx-kx { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.skx-kx__top { padding: 14px 24px 0; }
.skx-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.skx-barra__lbl { font-size: 14px; font-weight: 600; color: #334155; }
.skx-barra__fechas { font-size: 14px; color: #64748b; }
.skx-barra__der { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.skx-rango { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; color: #475569; }
.skx-rango input { width: auto; height: 36px; }
.skx-resumen { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 14px; margin-top: 14px; }
.skx-hoy { padding: 12px 18px; border: 1px solid #bbf7d0; border-radius: 10px; background: #f0fdf4; }
.skx-hoy--mal { border-color: #fde68a; background: #fffbeb; }
.skx-hoy__lbl { font-size: 14px; color: #475569; }
.skx-hoy__num { margin-top: 2px; font-size: 24px; font-weight: 700; line-height: 1.15; color: #0f172a; font-variant-numeric: tabular-nums; }
.skx-hoy__num small { margin-left: 3px; font-size: 14px; font-weight: 600; color: #475569; }
.skx-hoy__est { margin-top: 4px; font-size: 13.5px; font-weight: 600; color: #15803d; }
.skx-hoy--mal .skx-hoy__est { color: #b45309; }

.skx-filtros { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 12px; }
.skx-buscar { position: relative; flex: 1 1 260px; min-width: 200px; }
.skx-buscar input { width: 100%; height: 40px; padding: 0 34px; border: 1px solid #d5dce6; border-radius: 8px; font-size: 14px; color: #0f172a; }
.skx-buscar input:focus { border-color: #1976d2; outline: none; box-shadow: 0 0 0 3px rgba(25, 118, 210, .15); }
.skx-buscar__ico { position: absolute; top: 0; left: 12px; height: 40px; display: flex; align-items: center; color: #94a3b8; font-size: 13px; pointer-events: none; }
.skx-buscar__x { position: absolute; top: 0; right: 4px; height: 40px; padding: 0 8px; border: 0; background: none; color: #94a3b8; font-size: 18px; line-height: 1; cursor: pointer; }
.skx-buscar__x:hover { color: #475569; }
.skx-filtrado { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -4px 0 10px; font-size: 13px; color: #475569; }

.skx-mas { position: relative; }
.skx-mas__btn {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid #d5dce6;
    border-radius: 8px; background: #fff; color: #0f172a; font-size: 14px; font-weight: 600; cursor: pointer;
}
.skx-mas__btn:hover { border-color: #b6c2d2; }
.skx-mas__btn--on { border-color: #93c5fd; color: #1d4ed8; }
.skx-mas__btn i { font-size: 10px; color: #64748b; }
.skx-mas__n { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #1d4ed8; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.skx-mas__cubre { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 20; }
.skx-mas__panel {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 21; width: 380px; max-width: calc(100vw - 48px);
    max-height: 62vh; overflow: auto; padding: 16px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .18);
}
.skx-op + .skx-op { margin-top: 16px; }
.skx-op__tit { margin-bottom: 8px; font-size: 14px; font-weight: 700; color: #0f172a; }
.skx-op__ayuda { margin-top: 6px; font-size: 13px; color: #64748b; }
.skx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.skx-chip { padding: 4px 12px; border: 1px solid #cbd5e1; border-radius: 16px; background: #fff; color: #334155; font-size: 13.5px; cursor: pointer; }
.skx-chip:hover { border-color: #94a3b8; }
.skx-chip--on { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; font-weight: 600; }
.skx-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.skx-dos button { padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #334155; font-size: 14px; line-height: 1.2; cursor: pointer; }
.skx-dos .skx-dos--on { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; font-weight: 600; }
.skx-dos--sub { margin-top: 8px; }
.skx-switch { position: relative; display: flex; align-items: flex-start; gap: 10px; margin: 0; font-weight: 400; cursor: pointer; }
.skx-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.skx-switch__pista { position: relative; flex: 0 0 36px; height: 20px; margin-top: 1px; border-radius: 10px; background: #cbd5e1; transition: background .15s; }
.skx-switch__pista::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: left .15s;
}
.skx-switch input:checked + .skx-switch__pista { background: #1d4ed8; }
.skx-switch input:checked + .skx-switch__pista::after { left: 18px; }
.skx-switch input:focus-visible + .skx-switch__pista { outline: 2px solid #1976d2; outline-offset: 2px; }
.skx-switch__txt b { display: block; font-size: 14px; color: #0f172a; }
.skx-switch__txt span { display: block; font-size: 13px; color: #64748b; }

/* La lista: lo único que se desplaza en el kárdex */
.skx-kx__lista { position: relative; flex: 1 1 auto; min-height: 260px; overflow: auto; }
.skx-kx__lista .skx-tabla th { position: sticky; top: 0; z-index: 2; }
.skx-kx--suelto .skx-kx__top { padding: 0; }
.skx-kx--suelto .skx-kx__lista { flex: 0 1 auto; max-height: calc(100vh - 430px); border: 1px solid #e9edf3; border-radius: 8px; }
.skx-kx--suelto .skx-tabla th { border-top: 0; }
.skx-kx--suelto .skx-tabla th:first-child, .skx-kx--suelto .skx-tabla td:first-child { padding-left: 14px; }
.skx-kx--suelto .skx-tabla th:last-child, .skx-kx--suelto .skx-tabla td:last-child { padding-right: 14px; }
.skx-kx__pie { padding: 10px 0 0; font-size: 13px; color: #64748b; }

.skx-f__dia { font-weight: 600; color: #0f172a; white-space: nowrap; }
.skx-f__hora { font-size: 13px; color: #64748b; }
.skx-m { min-width: 260px; }
.skx-m__linea { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.skx-m__doc { font-weight: 700; color: #0f172a; letter-spacing: .02em; }
.skx-m__sub { max-width: 560px; margin-top: 2px; overflow: hidden; font-size: 13px; color: #64748b; text-overflow: ellipsis; white-space: nowrap; }
.skx-cant { font-size: 16px; font-weight: 700; }
.skx-cant--entra { color: #15803d; }
.skx-cant--sale { color: #b91c1c; }
.skx-saldo { color: #334155; }
.skx-saldo--neg { color: #b91c1c; font-weight: 600; }
.skx-total { font-weight: 600; color: #0f172a; }
.skx-conv { margin-left: 4px; color: #b45309; font-size: 11px; }
.skx-chev { width: 36px; color: #94a3b8; font-size: 11px; text-align: center; }
.skx-fila--abierta td { background: #f8fafc; border-bottom-color: transparent; }
.skx-det td { padding-top: 2px; padding-bottom: 14px; background: #f8fafc; }
.skx-det__caja { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 36px; }
.skx-det__campo span { display: block; font-size: 13px; color: #64748b; }
.skx-det__campo b { display: block; margin-top: 2px; font-size: 14px; font-weight: 600; color: #0f172a; }
.skx-det__acc { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.skx-diaf td { padding-top: 6px; padding-bottom: 6px; background: #f1f5f9; font-size: 13px; color: #334155; }
.skx-diaf__fecha { margin-right: 12px; font-weight: 700; color: #0f172a; }
.skx-diaf__dato { margin-right: 10px; }
.skx-diaf__cierre { float: right; font-weight: 700; color: #0f172a; }
.skx-cargar td { padding: 12px !important; text-align: center; }

/* El gráfico del stock (se enciende en «Más opciones») */
.skx-grafico { margin-top: 14px; padding: 8px 12px 6px; border: 1px solid #e2e8f0; border-radius: 10px; }
.skx-grafico__cab { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: #334155; }
.skx-grafico__cab span + span { font-weight: 400; color: #64748b; }
.skx-grafico__svg { display: block; width: 100%; height: 90px; overflow: visible; }
.skx-grafico__neg { fill: #fee2e2; }
.skx-grafico__cero { stroke: #cbd5e1; stroke-width: 1; stroke-dasharray: 4 3; }
.skx-grafico__linea { fill: none; stroke: #1d4ed8; stroke-width: 2; stroke-linejoin: round; }
.skx-grafico__min { stroke: #94a3b8; stroke-width: 2; stroke-linecap: round; }
.skx-grafico__min--neg { stroke: #b91c1c; }
.skx-grafico__tramo { fill: transparent; cursor: pointer; }
.skx-grafico__tramo:hover { fill: rgba(29, 78, 216, .10); }
.skx-grafico__ejes { display: flex; justify-content: space-between; font-size: 12px; color: #94a3b8; }

/* Pendientes (por recibir / por entregar) */
.skx-pend__barra { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 12px; }
.skx-pend__barra .skx-barra__der { margin-left: auto; }
.skx-antig { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }

/* El documento abierto desde el kárdex (venta, compra, pedido, movimiento) */
.skx-doc { padding: 4px 8px 16px; }

@media (max-width: 760px) {
    .skx-modal { top: 8px; bottom: 8px; width: calc(100vw - 16px); border-radius: 12px; }
    .skx-cab { flex-wrap: wrap; padding: 14px 16px 12px; }
    .skx-cab__txt { flex: 1 1 calc(100% - 52px); }
    .skx-cerrar { order: 2; }
    .skx-cab__acc { order: 3; flex: 1 1 100%; justify-content: flex-start; }
    .skx-cab__titulo { font-size: 17px; }
    .skx-sel { width: 100%; }
    .skx-sel select { flex: 1 1 auto; max-width: none; }
    .skx-pad, .skx-kx__top { padding-left: 16px; padding-right: 16px; }
    .skx-pie { padding: 10px 16px; }
    .skx-pie__txt { font-size: 12.5px; }
    .skx-ecuacion { flex-wrap: wrap; }
    .skx-ec { flex: 1 1 45%; padding: 10px 14px; }
    .skx-ec__op { display: none; }
    .skx-ec__num { font-size: 22px; }
    .skx-resumen { grid-template-columns: 1fr; }
    .skx-barra__der { margin-left: 0; }
    .skx-tabla th:first-child, .skx-tabla td:first-child { padding-left: 16px; }
    .skx-tabla th:last-child, .skx-tabla td:last-child { padding-right: 16px; }
    .skx-nota { padding-left: 16px; padding-right: 16px; }
    .skx-mas { flex: 1 1 auto; }
    .skx-mas__btn { width: 100%; justify-content: center; }
    .skx-mas__panel { position: fixed; top: auto; right: 8px; bottom: 8px; left: 8px; width: auto; max-width: none; max-height: 70vh; }
    .skx-det__acc { margin-left: 0; }
    /* En el celular la lista se despliega entera y desplaza el cuerpo: dos barras anidadas no se manejan con el dedo. */
    .skx-kx__lista { flex: 0 0 auto; min-height: 0; overflow-x: auto; overflow-y: hidden; }
    .skx-diaf__cierre { float: none; display: inline-block; }
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════
   Control de stock negativo en la ficha del almacén (SQL 97, PLAN_Cierre_Periodo_Control_Stock C0).
   Prefijo .alm-neg
   ═══════════════════════════════════════════════════════════════════════════════════════════ */
.alm-neg {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #e0e4ec;
    border-radius: 6px;
    background: #f5f7fb;
}
.alm-neg__ayuda {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: #5a6478;
    line-height: 1.4;
}
.alm-neg__aviso {
    margin-top: 8px;
    padding: 8px 10px;
    border-left: 3px solid #c77700;
    border-radius: 4px;
    background: #fff7e6;
    font-size: 12.5px;
    color: #4a3a12;
}
.alm-neg__aviso--info {
    border-left-color: var(--primario, #284A70);
    background: #eef3fa;
    color: #2c3e57;
}
.alm-neg__lista {
    margin: 6px 0 0 0;
    padding-left: 18px;
    max-height: 160px;
    overflow-y: auto;
}
.alm-neg__lista li { margin: 1px 0; }
.alm-neg__stock {
    font-weight: 600;
    color: #c62828;
    white-space: nowrap;
    margin-left: 4px;
}
.alm-neg__mas { list-style: none; margin-left: -18px; color: #5a6478; font-style: italic; }
