/* Seguimiento de abastecimientos. Diseño oscuro como la Matriz de Abastecimiento (AbastecimientoMatrixGrid):
   se ve igual en tema claro y oscuro. Colores de Rigo: naranja en proceso, verde completo, azul se paso o no le
   toca, rojo no alcanzo al cerrar. */
.surtido {
    --s-proceso: #f59e0b; --s-proceso-bg: rgba(245,158,11,.22);
    --s-ok: #22c55e;      --s-ok-bg: rgba(34,197,94,.20);
    --s-mas: #60a5fa;     --s-mas-bg: rgba(59,130,246,.30);
    --s-corto: #f87171;   --s-corto-bg: rgba(239,68,68,.28);
    --s-pendiente: #eab308; --s-pendiente-bg: repeating-linear-gradient(45deg, rgba(234,179,8,.18) 0 6px, rgba(234,179,8,.30) 6px 12px);
    display: flex; flex-direction: column; width: 100%;
    background: #0f172a; color: #e2e8f0; border: 1px solid #1e293b; border-radius: 8px; overflow: hidden;
    font-variant-numeric: tabular-nums;
}
.surtido-nota { font-size: 12px; color: #94a3b8; margin: 0; padding: 8px 16px 12px; }
.surtido-simulacion { margin: 0; padding: 6px 16px; border-left: 4px solid var(--s-proceso); background: var(--s-proceso-bg); font-size: 13px; }
.surtido-error { margin: 0; padding: 6px 16px; border-left: 4px solid var(--s-corto); background: var(--s-corto-bg); font-weight: 600; font-size: 13px; }

/* Encabezado y barra */
.sm-header { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 12px 16px; background: #0f172a; border-bottom: 1px solid #1e293b; }
.sm-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: #e2e8f0; }
.sm-estado { padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; background: #1e293b; color: #cbd5e1; }
.sm-estado-enpicking { background: #78350f; color: #fcd34d; }
.sm-estado-cerrado { background: #334155; color: #e2e8f0; }
.sm-kpis { display: flex; gap: 18px; flex-wrap: wrap; }
.sm-kpi { display: flex; flex-direction: column; align-items: center; }
.sm-kpi-num { font-size: 18px; font-weight: 700; color: #f1f5f9; }
.sm-kpi-label { font-size: 10px; text-transform: uppercase; color: #64748b; letter-spacing: .5px; }
.sm-kpi-alerta .sm-kpi-num { color: #60a5fa; }
.sm-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-left: auto; font-size: 11px; color: #94a3b8; }
.sm-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; border: 1px solid #475569; }
.sm-dot.s-proceso { background: var(--s-proceso-bg); border-color: var(--s-proceso); }
.sm-dot.s-ok { background: var(--s-ok-bg); border-color: var(--s-ok); }
.sm-dot.s-mas { background: var(--s-mas-bg); border-color: var(--s-mas); }
.sm-dot.s-corto { background: var(--s-corto-bg); border-color: var(--s-corto); }
.sm-dot.s-pendiente { background: var(--s-pendiente-bg); border-color: var(--s-pendiente); }
.sm-dot.s-marca { background: transparent; border: 2px solid #ef4444; }
.sm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 8px 16px; background: #0f172a; border-bottom: 1px solid #1e293b; font-size: 12px; color: #94a3b8; }
.sm-search { display: flex; align-items: center; gap: 8px; background: #1e293b; border: 1px solid #334155; border-radius: 6px; padding: 4px 10px; color: #64748b; }
.sm-search input { background: none; border: none; outline: none; color: #e2e8f0; font-size: 13px; width: 240px; }
.sm-search input::placeholder { color: #475569; }
.sm-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: #cbd5e1; }
.sm-info { margin-left: auto; }
.sm-cuenta { margin-left: 4px; color: #93c5fd; font-variant-numeric: tabular-nums; }
.sm-cuenta-tarde { color: #fbbf24; }
.sm-vistas { display: inline-flex; border: 1px solid #334155; border-radius: 6px; overflow: hidden; }
.sm-vistas button, .sm-refrescar { font: inherit; font-size: 12px; padding: 4px 10px; border: 0; background: #1e293b; color: #94a3b8; cursor: pointer; }
.sm-vistas button[aria-pressed="true"] { background: #1e3a8a; color: #93c5fd; font-weight: 600; }
.sm-refrescar { border: 1px solid #334155; border-radius: 6px; }

/* Vista por tienda */
.surtido-tiendas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; padding: 12px 16px; }
.surtido-tienda { border: 1px solid #1e293b; border-left-width: 6px; border-radius: 8px; padding: 10px 12px; font-size: 13px; background: #111c33; }
.surtido-tienda-enc { display: flex; justify-content: space-between; gap: 8px; }
.surtido-tienda-estado { font-weight: 700; margin: 2px 0 4px; }
.surtido-tienda-cifras .m { font-weight: 700; color: #93c5fd; }
.surtido-tienda details { margin-top: 6px; }
.surtido-tienda summary { cursor: pointer; font-weight: 600; }
.surtido-tienda ul { margin: 6px 0 0; padding-left: 18px; }
.surtido-tienda pre { white-space: pre-wrap; font-family: inherit; font-size: 12px; margin: 2px 0 6px; color: #cbd5e1; }
.t-lista { border-left-color: var(--s-ok); background: var(--s-ok-bg); }
.t-lista .surtido-tienda-estado { color: #86efac; }
.t-falta { border-left-color: var(--s-proceso); background: var(--s-proceso-bg); }
.t-falta .surtido-tienda-estado { color: #fcd34d; }
.t-nolista { border-left-color: var(--s-mas); background: var(--s-mas-bg); }
.t-nolista .surtido-tienda-estado { color: #bfdbfe; }
.t-corto { border-left-color: var(--s-corto); background: var(--s-corto-bg); }
.t-corto .surtido-tienda-estado { color: #fecaca; }

/* Vista por SKU: tabla como la matriz */
.sm-scroll { overflow: auto; max-height: calc(95vh - 300px); min-height: 300px; }
.sm-table { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.sm-table th, .sm-table td { padding: 6px 8px; border-bottom: 1px solid #1e293b; border-right: 1px solid #1e293b; white-space: nowrap; background: #0f172a; color: #cbd5e1; }
.sm-table thead th { position: sticky; top: 0; z-index: 2; background: #111827; color: #94a3b8; font-weight: 600; vertical-align: bottom; border-bottom: 2px solid #1e3a8a; }
.sm-table tbody tr:hover td { background: #172036; }
.sm-table .col-img { position: sticky; left: 0; z-index: 1; width: 64px; min-width: 64px; text-align: center; padding: 4px; }
.sm-table thead .col-img, .sm-table tfoot .col-img { z-index: 3; }
.sm-table .product-img { width: 52px; height: 52px; object-fit: contain; border-radius: 4px; background: #fff; display: block; margin: 0 auto; }
.sm-table .no-img { width: 52px; height: 52px; border-radius: 4px; background: #1e293b; color: #475569; display: flex; align-items: center; justify-content: center; margin: 0 auto; }
.sm-table .col-marca { min-width: 110px; }
/* Imagen, Brancode y nombre fijos a la izquierda al desplazarse. Con border-box, los anchos son exactos
   y cada columna empieza donde acaba la anterior (64 px + 140 px). */
.sm-table .col-img, .sm-table .col-brancode, .sm-table .col-nombre { box-sizing: border-box; }
.sm-table .col-brancode { position: sticky; left: 64px; z-index: 1; width: 140px; min-width: 140px; max-width: 140px; white-space: normal; word-break: break-all; font-family: Consolas, monospace; font-size: 11px; }
.sm-table thead .col-brancode, .sm-table tfoot .col-brancode { z-index: 3; }
.sm-table .col-codigo { min-width: 110px; font-family: Consolas, monospace; font-size: 11px; }
.sm-table .col-modelo { min-width: 80px; }
.sm-table .col-nombre { position: sticky; left: 204px; z-index: 1; min-width: 200px; max-width: 220px; width: 220px; white-space: normal; color: #e2e8f0; font-weight: 600; box-shadow: 2px 0 0 #1e3a8a; }
.sm-table thead .col-nombre, .sm-table tfoot .col-nombre { z-index: 3; }
.sm-table .n { text-align: right; }
.sm-table .key { font-weight: 700; color: #f1f5f9; }
.sm-table .dif-mal { color: #fca5a5; font-weight: 700; }
/* Tiendas en vertical, como el HTML «Surtido por tienda»: nombre y porcentaje de lado. */
.sm-table .col-tienda { min-width: 54px; text-align: center; padding: 8px 4px; vertical-align: bottom; }
.sm-table .col-tienda .tienda-nombre, .sm-table .col-tienda .tienda-pct {
    display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; text-align: left;
}
.sm-table .col-tienda .tienda-nombre { color: #cbd5e1; font-size: 11px; }
.sm-table .col-tienda .tienda-pct { color: #64748b; font-size: 10px; margin-left: 2px; }
.sm-table .col-tienda.fuera .tienda-nombre { color: #93c5fd; }
.sm-table .col-tienda.fuera { border-bottom-color: #3b82f6; }
.sm-table td.cell { text-align: center; min-width: 54px; }
.sm-table td.cell b { display: block; font-size: 13px; color: #f1f5f9; }
.sm-table td.cell span { display: block; font-size: 10px; color: #64748b; }
.sm-table td.cell-empty { color: #334155; }
.sm-table td.s-proceso { background: var(--s-proceso-bg); }
.sm-table td.s-proceso b { color: #fcd34d; }
.sm-table td.s-ok { background: var(--s-ok-bg); }
.sm-table td.s-ok b { color: #86efac; }
.sm-table td.s-mas { background: var(--s-mas-bg); }
.sm-table td.s-mas b { color: #bfdbfe; }
.sm-table td.s-corto { background: var(--s-corto-bg); }
.sm-table td.s-corto b { color: #fecaca; }
/* Pendiente de conteo (24-nov): ámbar rayado, sin sonido. */
.sm-table td.s-pendiente { background: var(--s-pendiente-bg); }
.sm-table td.s-pendiente b { color: #fde68a; }
.sm-alertas-tabla tr.a-pendienteconteo td:nth-child(2) { color: var(--s-pendiente); }
.sm-table td.marca { box-shadow: inset 0 0 0 2px #ef4444; }
.sm-table tfoot td { position: sticky; bottom: 0; background: #111827; font-weight: 600; z-index: 1; }

/* Alertas abiertas dentro del seguimiento. */
.sm-alertas { background: #0f172a; border-bottom: 1px solid #1e293b; }
.sm-alertas-enc { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 16px; border: 0; border-left: 4px solid var(--s-mas); background: var(--s-mas-bg); color: #e2e8f0; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.sm-alertas-ayuda { margin-left: auto; font-size: 11px; color: #94a3b8; }
.sm-alertas-scroll { max-height: 260px; overflow: auto; }
.sm-alertas-tabla { width: 100%; border-collapse: collapse; font-size: 12px; color: #cbd5e1; }
.sm-alertas-tabla th { position: sticky; top: 0; background: #1e293b; color: #94a3b8; font-weight: 600; text-align: left; padding: 6px 10px; }
.sm-alertas-tabla td { padding: 6px 10px; border-top: 1px solid #1e293b; vertical-align: top; }
.sm-alertas-tabla .n { text-align: right; font-variant-numeric: tabular-nums; }
.sm-alertas-tabla .quien { color: #e2e8f0; font-weight: 600; }
.sm-alertas-tabla .folios { white-space: pre-line; font-size: 11px; color: #94a3b8; min-width: 280px; }
.sm-alertas-tabla tbody tr { cursor: pointer; }
.sm-alertas-tabla tbody tr:hover { background: #1e293b; }
.sm-alertas-tabla tr.a-sepaso td:nth-child(2), .sm-alertas-tabla tr.a-fueradelabastecimiento td:nth-child(2) { color: var(--s-mas); }
.sm-alertas-tabla tr.a-quedocorto td:nth-child(2) { color: var(--s-corto); }
/* Pantalla de alertas de Picking (20-nov): TV 4K en vertical. Todo en em sobre una letra que crece con el ancho,
   así se lee igual con escala de Windows al 100 % o al 200 %. «Modo TV» tapa el menú del portal. */
.pa {
    --s-mas: #60a5fa; --s-mas-bg: rgba(59,130,246,.30); --s-ok: #22c55e; --s-corto: #f87171;
    display: flex; flex-direction: column; width: 100%; min-height: 70vh;
    background: #0b1220; color: #e2e8f0; border-radius: 8px; overflow: hidden;
    font-size: calc(clamp(13px, 1.3vw, 36px) * var(--pa-escala, 1)); font-variant-numeric: tabular-nums;
}
/* Debajo del aviso de reconexión de Blazor (1050), para que se vea si se cae la conexión. */
.pa.pa-tv { position: fixed; inset: 0; z-index: 1040; border-radius: 0; min-height: 0; }
.pa-enc { display: flex; flex-wrap: wrap; align-items: center; gap: .8em 1.2em; padding: .8em 1em; background: #0f172a; border-bottom: 1px solid #1e293b; }
.pa-titulo { display: flex; align-items: center; gap: .7em; flex: 1 1 auto; min-width: 0; }
.pa-num { font-size: 3em; font-weight: 800; line-height: 1; min-width: 1.3em; text-align: center; }
.pa-num-alerta { color: var(--s-mas); }
.pa-num-ok { color: var(--s-ok); }
.pa-titulo-txt { font-size: 1.5em; font-weight: 700; line-height: 1.25; }
.pa-sub { display: flex; flex-wrap: wrap; gap: .3em; margin-top: .25em; font-size: .85em; color: #94a3b8; }
.pa-chip { padding: .1em .6em; border-radius: 1em; background: #1e293b; color: #cbd5e1; border: 1px solid transparent; font: inherit; cursor: pointer; }
.pa-chip:hover { border-color: #64748b; }
.pa-chip-on { background: #1d4ed8; color: #fff; }
.pa-chip-off { opacity: .45; }
.pa-chip-todos { background: transparent; border-color: #475569; }
.pa-ocultas { align-self: center; color: #60a5fa; font-weight: 600; }
.pa-vacio-ocultas { color: #60a5fa; }
.pa-reloj { text-align: right; }
.pa-hora { font-size: 2.2em; font-weight: 700; line-height: 1; }
.pa-sbx { font-size: .8em; color: #94a3b8; margin-top: .2em; }
.pa-sbx-aviso { color: #fde68a; }
.pa-botones { display: flex; flex-wrap: wrap; gap: .4em; }
.pa-btn { font: inherit; font-size: .8em; padding: .45em .9em; border-radius: .4em; border: 1px solid #334155; background: #1e293b; color: #e2e8f0; cursor: pointer; }
.pa-btn:hover:not(:disabled) { background: #334155; }
.pa-btn:disabled { opacity: .45; cursor: default; }
.pa-btn-sonido { border-color: #f59e0b; color: #fde68a; animation: pa-latido 1.6s ease-in-out infinite; }
.pa-cambio { padding: .55em 1em; border-left: .3em solid #f59e0b; background: rgba(245,158,11,.18); }
.pa-cambio span { margin-left: .8em; color: #94a3b8; font-size: .85em; }
.pa-cambio-res { font-size: .8em; color: #cbd5e1; margin-top: .15em; }
.pa-cambio-nuevo { animation: pa-latido 1.6s ease-in-out 6; background: rgba(245,158,11,.32); }
.pa-error { padding: .5em 1em; border-left: .3em solid var(--s-corto); background: rgba(239,68,68,.25); font-weight: 600; }
.pa-scroll { flex: 1 1 auto; overflow: auto; }
.pa-tabla { width: 100%; border-collapse: collapse; }
.pa-tabla th { position: sticky; top: 0; z-index: 1; background: #1e293b; color: #94a3b8; font-size: .75em; font-weight: 600; text-align: left; padding: .5em .6em; white-space: nowrap; }
.pa-tabla td { padding: .45em .6em; border-top: 1px solid #1e293b; vertical-align: top; }
.pa-tabla tbody tr:nth-child(even) { background: rgba(30,41,59,.35); }
.pa-tabla .n { text-align: right; white-space: nowrap; }
.pa-tabla .hora { white-space: nowrap; color: #94a3b8; }
.pa-tabla .tienda { font-weight: 700; }
.pa-tabla .tipo { color: var(--s-mas); font-weight: 700; white-space: nowrap; }
.pa-tabla .sku { font-size: .75em; color: #94a3b8; margin-top: .1em; }
.pa-tabla .mas { color: var(--s-mas); font-weight: 800; font-size: 1.15em; }
.pa-tabla .est { font-weight: 800; font-size: 1.15em; text-align: center; white-space: nowrap; }
.pa-tabla .quien { font-weight: 600; }
.pa-tabla .folios { white-space: pre; font-weight: 600; color: #e2e8f0; }
.pa-tabla tr.pa-nueva td { background: var(--s-mas-bg); }
.pa-tabla tr.pa-nueva td:first-child { box-shadow: inset .3em 0 0 var(--s-mas); }
.pa-tabla tr.pa-nueva .hora { color: #fff; font-weight: 700; }
.pa-vacio { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3em; padding: 2em; font-size: 2.4em; font-weight: 700; color: var(--s-ok); text-align: center; }
.pa-vacio-ico { font-size: 2.5em; line-height: 1; }
.pa-vacio-sub { font-size: .4em; font-weight: 400; color: #94a3b8; }
.pa-pie { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3em 1.5em; padding: .4em 1em; font-size: .65em; color: #64748b; border-top: 1px solid #1e293b; }
@keyframes pa-latido { 50% { box-shadow: 0 0 0 .3em rgba(245,158,11,.25); } }
