/* ============================================================================
   GASCA · SGA (gestor de almacén) — pantalla «Almacén» de Reparto (gasca_sga.js).
   Mismas variables que gasca_reparto.css (--rp-*). Prefijo .sg-.
   ============================================================================ */
.sg-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.sg-tab { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--rp-line); background: #fff; font: inherit; font-weight: 700; font-size: .84rem; color: var(--rp-ink); cursor: pointer; }
.sg-tab:hover { border-color: var(--rp-red); }
.sg-tab.sg-on { background: var(--rp-ink); border-color: var(--rp-ink); color: #fff; }
.sg-metrics { margin-bottom: 16px; }
.sg-muted { color: var(--rp-muted); font-size: .78rem; }
.sg-pad { padding: 16px 4px; }
.sg-pad-s { padding: 4px 2px 10px; margin: 0; }
.sg-ok { color: var(--rp-green); font-weight: 700; font-size: .78rem; }
.sg-warn { color: var(--rp-amber); font-weight: 700; }
.sg-bad { color: var(--rp-red); font-weight: 800; }
.sg-oculto { display: none !important; }
.sg-left { justify-content: flex-start; }
.sg-ubc { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }
.sg-filtros { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; flex: 1 1 auto; }
.sg-filtros label { display: inline-flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 600; }
.sg-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.sg-q { flex: 1 1 220px; width: auto; min-width: 180px; max-width: 420px; }
.sg-chk { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; cursor: pointer; }
.sg-mini { height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--rp-line); background: #fff; font: inherit; font-size: .76rem; font-weight: 700; color: var(--rp-ink); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.sg-mini:hover:not(:disabled) { border-color: var(--rp-red); }
.sg-mini:disabled { opacity: .35; cursor: default; }
.sg-danger { color: var(--rp-red) !important; }
.sg-num-inp { max-width: 110px; text-align: right; }
.sg-ubi-inp { max-width: 150px; }
.sg-tr-warn td { background: var(--rp-amber-soft); }

/* caducidad */
.sg-cad { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--rp-bg); }
.sg-cad-soon { background: #fef9c3; color: #854d0e; }
.sg-cad-warn { background: var(--rp-amber-soft); color: var(--rp-amber); }
.sg-cad-bad { background: var(--rp-red-soft); color: var(--rp-red); }

/* lectura (Ubicar) */
.sg-scanbox { display: flex; gap: 14px; align-items: stretch; background: var(--rp-card); border: 2px solid var(--rp-ink); border-radius: var(--rp-radius); padding: 14px 16px; box-shadow: var(--rp-shadow); margin-bottom: 14px; }
.sg-scanbox.sg-scan-hueco { border-color: var(--rp-red); background: var(--rp-red-soft); }
.sg-scan-paso { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; background: var(--rp-ink); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 1.3rem; }
.sg-scan-hueco .sg-scan-paso { background: var(--rp-red); }
.sg-scan-main { flex: 1 1 auto; min-width: 0; display: grid; gap: 8px; }
.sg-scan-lbl { font-weight: 800; font-size: .95rem; }
.sg-scan-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sg-scan-inp { flex: 1 1 220px; width: auto; height: 52px; font-size: 1.2rem; font-weight: 700; letter-spacing: .03em; }
.sg-cam-btn { min-height: 52px; }
.sg-ucard { background: var(--rp-card); border: 1px solid var(--rp-line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--rp-shadow); }
.sg-ucard-big { border-left: 5px solid var(--rp-red); }
.sg-ucard-t { font-weight: 800; font-size: 1rem; margin-bottom: 6px; }
.sg-ucard-big .sg-ucard-t { font-size: 1.15rem; }
.sg-ucard-g { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .86rem; align-items: center; }
.sg-ucard-g b { font-weight: 800; }
.sg-prop { display: grid; gap: 8px; margin: 6px 0 14px; }
.sg-prop-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; background: var(--rp-card); border: 1px solid var(--rp-line); border-radius: 12px; padding: 10px 14px; }
.sg-prop-row .sg-ubc { font-size: 1.15rem; }
.sg-prop-row > button { margin-left: auto; }
.sg-prop-1 { border-color: var(--rp-green); background: var(--rp-green-soft); }
.sg-consulta { margin-top: 10px; }
.sg-hist { margin-top: 16px; display: grid; gap: 4px; font-size: .82rem; color: var(--rp-muted); }
.sg-hist div { display: flex; align-items: center; gap: 6px; }

/* ubicaciones */
.sg-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px; border-radius: 12px; background: var(--rp-red-soft); border: 1px solid rgba(180,0,12,.2); }
.sg-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 14px; }
.sg-form .rp-dialog-actions, .sg-form .sg-chk { grid-column: 1 / -1; }

/* ruta de picking */
.sg-ruta { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 6px; max-width: 720px; }
.sg-ruta li { display: flex; align-items: center; gap: 12px; background: var(--rp-card); border: 1px solid var(--rp-line); border-radius: 10px; padding: 8px 12px; }
.sg-ruta-n { width: 28px; height: 28px; border-radius: 50%; background: var(--rp-bg); display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: 0 0 auto; }
.sg-ruta-b { margin-left: auto; display: inline-flex; gap: 4px; }

/* cámara y avisos (cuelgan de <body>, fuera de la pantalla) */
.sg-dlg-cam { max-width: 460px; }
.sg-cam-reader { width: 100%; min-height: 260px; border-radius: 12px; overflow: hidden; background: #000; }
.sg-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 10050; max-width: calc(100vw - 32px); background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: .92rem; font-weight: 700; box-shadow: 0 10px 30px rgba(15,23,42,.3); }
.sg-toast-bad { background: #b4000c; }

@media (max-width: 640px) {
    .sg-scanbox { padding: 12px; gap: 10px; }
    .sg-scan-paso { width: 36px; height: 36px; font-size: 1.1rem; }
    .sg-tab { height: 34px; padding: 0 10px; font-size: .78rem; }
    .sg-q { max-width: none; }
}

/* ---------- fases 2-5: Preparar, Recepción, Devoluciones, Calidad (gasca_sga_ops.js) ---------- */
.sg-h2 { margin: 2px 0; font-size: 1.25rem; }
.sg-nowrap { white-space: nowrap; }
.sg-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; background: var(--rp-bg); color: var(--rp-ink); border: 1px solid var(--rp-line); white-space: nowrap; }
.sg-chip-verde { background: var(--rp-green-soft); color: var(--rp-green); border-color: transparent; }
.sg-chip-ambar { background: var(--rp-amber-soft); color: var(--rp-amber); border-color: transparent; }
.sg-chip-rojo { background: var(--rp-red-soft); color: var(--rp-red); border-color: transparent; }
.sg-chip-azul { background: #eff6ff; color: #1d4ed8; border-color: transparent; }
.sg-nota-s { margin: 0 0 12px; }
.sg-nota-warn { background: var(--rp-amber-soft); }
.rp-btn-cargo.sg-reiniciar { min-height: 48px; justify-content: center; background: #b4000c; border-color: #b4000c; color: #fff; }
.rp-btn-cargo.sg-reiniciar:hover { background: #8f000a; border-color: #8f000a; color: #fff; }
.sg-btn-bad { background: var(--rp-red) !important; }
.sg-ta { height: auto; padding: 8px 12px; }
.sg-pedir .lg-inp-big { height: 64px; font-size: 1.8rem; }

/* cola de preparación */
.sg-cola { display: grid; gap: 6px; }
.sg-cola-fecha { margin: 12px 0 2px; }
.sg-cola-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 14px; text-align: left; width: 100%; background: var(--rp-card);
    border: 1px solid var(--rp-line); border-left: 4px solid var(--rp-line); border-radius: 12px; padding: 10px 14px; font: inherit; color: var(--rp-ink); cursor: pointer; }
.sg-cola-item:hover { border-color: var(--rp-red); }
.sg-cola-item.sg-est-en_curso { border-left-color: var(--rp-amber); }
.sg-cola-item.sg-est-en_espera { border-left-color: #1d4ed8; }
.sg-cola-item.sg-est-terminada { border-left-color: var(--rp-green); opacity: .75; }
.sg-cola-item.sg-no-disp { background: var(--rp-bg); }
.sg-cola-main { display: grid; gap: 2px; min-width: 0; }
.sg-cola-side { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* pedido / tarea */
.sg-tarea-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 16px; margin-bottom: 14px; }
.sg-tarea-head > div { flex: 1 1 260px; min-width: 0; }
.sg-lineas { display: grid; gap: 8px; margin: 10px 0 14px; }
.sg-lin { background: var(--rp-card); border: 1px solid var(--rp-line); border-radius: 12px; padding: 10px 14px; display: grid; gap: 6px; }
.sg-lin-ok { background: var(--rp-green-soft); border-color: rgba(5,150,105,.25); }
.sg-lin-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; }
.sg-lin-cant { text-align: right; font-size: .9rem; }
.sg-lin-cant b { font-size: 1.1rem; }
.sg-lin-prop { font-size: .88rem; }
.sg-lin-st { font-size: .84rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sg-lin-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.sg-lin-lect { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--rp-muted); }
.sg-lin-lect > span { display: inline-flex; align-items: center; gap: 6px; }
.sg-tarea-acts { position: sticky; bottom: 0; background: var(--rp-bg); padding: 10px 0; }
.sg-bloqueo { border: 2px solid var(--rp-red); background: var(--rp-red-soft); border-radius: var(--rp-radius); padding: 14px 16px; display: grid; gap: 10px; }
.sg-bloqueo h3 { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--rp-red); font-size: 1.05rem; }
.sg-bloqueo p { margin: 0; }
.sg-bloqueo .sg-scanbox { margin: 0; }
.sg-bloqueo-azul { border-color: #1d4ed8; background: #eff6ff; }
.sg-bloqueo-azul h3 { color: #1d4ed8; }
.sg-exp { border-bottom: 1px solid var(--rp-line); padding: 8px 0; display: grid; gap: 4px; }
.sg-exp ul { margin: 4px 0 0 18px; padding: 0; font-size: .86rem; }
.sg-exp-on { background: var(--rp-amber-soft); }

/* recepción */
.sg-ctrl { background: var(--rp-card); border: 1px solid var(--rp-line); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.sg-ctrl summary { cursor: pointer; }
.sg-ctrl .sg-form { margin-top: 10px; }
.sg-subs { display: grid; gap: 4px; }
.sg-sub { font-size: .82rem; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sg-subform { border-top: 1px dashed var(--rp-line); padding-top: 8px; }
.sg-taras { grid-column: 1 / -1; display: grid; gap: 6px; }
.sg-tara-row { display: flex; gap: 6px; }
.sg-tara-row .sg-num-inp { max-width: 80px; }

/* devoluciones */
.sg-dev-nueva { background: var(--rp-card); border: 1px solid var(--rp-line); border-radius: var(--rp-radius); padding: 12px 14px; margin-bottom: 18px; display: grid; gap: 10px; }
.sg-dev-nueva p { margin: 0; }
.sg-opciones { display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.sg-opcion { display: grid; gap: 2px; text-align: left; background: #fff; border: 1px solid var(--rp-line); border-radius: 10px; padding: 8px 12px; font: inherit; color: var(--rp-ink); cursor: pointer; }
.sg-opcion:hover { border-color: var(--rp-red); }
.sg-opcion-radio { display: flex; align-items: flex-start; gap: 10px; }
.sg-opcion-radio > span { display: grid; gap: 2px; }

/* calidad */
.sg-subtabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.sg-ret { background: var(--rp-card); border: 1px solid var(--rp-line); border-radius: var(--rp-radius); padding: 12px 14px; margin-bottom: 12px; display: grid; gap: 8px; }
.sg-ret-abierta { border-left: 4px solid var(--rp-red); }
.sg-balance { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .84rem; background: var(--rp-bg); border-radius: 10px; padding: 8px 12px; }

/* ---------- devoluciones con código, carga del camión y festivos ---------- */
.sg-fecha { width: auto; }
.sg-dev-cod { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 900; letter-spacing: .18em; background: var(--rp-ink); color: #fff; border-radius: 8px; padding: 4px 10px; font-size: 1.1rem; }
.sg-dev-cod-s { font-size: .74rem; padding: 1px 6px; letter-spacing: .12em; vertical-align: middle; }
.sg-dev-cod-xl { font-size: 3rem; padding: 10px 24px; margin: 6px 0 12px; }
.sg-dev-camion { background: var(--rp-amber-soft); border: 1px solid rgba(180,83,9,.25); border-radius: var(--rp-radius); padding: 12px 14px; margin-bottom: 14px; display: grid; gap: 8px; }
.sg-dev-camion p { margin: 0; }
.sg-dev-item { display: flex; align-items: center; gap: 12px; font-size: .88rem; }
.sg-dev-fresco { color: var(--rp-red); font-weight: 700; }
.sg-dev-recibir { margin-bottom: 14px; }
.sg-dev-recibir p { margin: 0 0 6px; }
.sg-foto { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sg-foto > span { width: 100%; }
.sg-foto-btn { cursor: pointer; }
.sg-foto-min { max-height: 120px; max-width: 200px; border-radius: 8px; border: 1px solid var(--rp-line); }
.sg-bultos { display: flex; flex-wrap: wrap; gap: 6px; }
.sg-bulto { display: inline-flex; align-items: center; gap: 4px; border: 1px dashed var(--rp-line); border-radius: 8px; padding: 3px 8px; font-size: .78rem; font-weight: 700; color: var(--rp-muted); }
.sg-bulto-ok { border-style: solid; border-color: var(--rp-green); background: var(--rp-green-soft); color: var(--rp-green); }
.sg-bulto .sg-mini { height: 20px; padding: 0 6px; }

/* ---------- migración de RPS (gasca_erp.js) ---------- */
.sg-erp-info { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .84rem; margin: 0 0 12px; }
.sg-erp-info code { font-size: .78rem; }
.sg-erp-tablas { font-size: .78rem; line-height: 1.6; }
.sg-erp-tablas > span { display: inline-block; margin-right: 8px; }
.sg-erp-msg { max-width: 360px; font-size: .78rem; }
.sg-barra { height: 10px; background: #dbeafe; border-radius: 999px; overflow: hidden; }
.sg-barra > div { height: 100%; background: #1d4ed8; transition: width .4s; }

/* ---------- pedidos de venta (gasca_ventas.js) ---------- */
.vn-fila { cursor: pointer; }
.vn-fila:hover td { background: var(--rp-red-soft); }
.vn-cab { display: grid; grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(130px, 1fr)); gap: 10px 14px; background: var(--rp-card); border: 1px solid var(--rp-line); border-radius: var(--rp-radius); padding: 12px 14px; margin-bottom: 14px; }
.vn-cliente { grid-row: span 2; }
.vn-coment { grid-column: 2 / -1; }
.vn-cli { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.vn-opciones { margin: 6px 0 10px; max-height: 40vh; }
.vn-num { max-width: 120px; text-align: right; }
.vn-lineas { margin-top: 8px; }
@media (max-width: 760px) { .vn-cab { grid-template-columns: 1fr; } .vn-cliente, .vn-coment { grid-column: auto; grid-row: auto; } }

/* ---------- leyenda «Origen de los datos» (RP.origen, gasca_sga.js) ---------- */
.sg-origen .sg-origen-f { margin-top: 6px; }
.sg-origen .sg-origen-l { font-size: .78rem; margin-left: 8px; word-break: break-word; }
.sg-origen .sg-origen-extra { margin-top: 6px; font-size: .78rem; }
.sg-origen .sg-origen-extra:empty { display: none; }

/* INC-00112/115: incidencias del pedido de compra y propuesta de ubicación tras recibir */
.sg-incs { display: grid; gap: 8px; margin: 10px 0; }
.sg-incs-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.sg-inc { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px; background: #fff; }
.sg-inc-ab { border-color: #fecaca; background: #fef2f2; }
.sg-ubica { margin: 8px 0; }

/* INC-00154: Ubicaciones › Esquema (sección × altura × posición) */
.sg-vista { display: inline-flex; border: 1px solid var(--rp-line); border-radius: 10px; overflow: hidden; margin-left: 4px; }
.sg-vista button { border: 0; background: var(--rp-card); padding: 6px 12px; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--rp-muted, #64748b); }
.sg-vista button.sg-on { background: #0f172a; color: #fff; }
.sg-esq { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 8px; }
.sg-esq-rack { background: var(--rp-card); border: 1px solid var(--rp-line); border-radius: 12px; padding: 10px; }
.sg-esq-h { display: flex; flex-direction: column; margin-bottom: 8px; }
.sg-esq-h span { font-size: .72rem; color: var(--rp-muted, #64748b); }
.sg-esq-g { display: grid; gap: 4px; align-items: stretch; border-bottom: 4px solid #94a3b8; padding-bottom: 4px; }
.sg-esq-th { text-align: center; font-size: .7rem; font-weight: 800; color: #64748b; }
.sg-esq-alt { display: grid; place-items: center; font-size: .72rem; font-weight: 800; color: #475569; background: #f1f5f9; border-radius: 6px; }
.sg-esq-c { border: 1px solid transparent; border-radius: 7px; min-height: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; font: inherit; padding: 2px; }
.sg-esq-c b { font-size: .8rem; } .sg-esq-c small { font-size: .66rem; opacity: .85; }
.sg-esq-vacio { background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 4px, #eef2f7 4px, #eef2f7 8px); cursor: default; }
.sg-esq-libre { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.sg-esq-media { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.sg-esq-llena { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.sg-esq-exc { background: #dc2626; color: #fff; }
.sg-esq-bloq { background: #e2e8f0; color: #475569; border-color: #94a3b8; text-decoration: line-through; }
.sg-esq-inac { background: #fff; color: #94a3b8; border: 1px dashed #cbd5e1; }
.sg-esq-c:hover { outline: 2px solid #2563eb; outline-offset: 1px; }
.sg-esq-ley { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; font-size: .72rem; }
.sg-esq-ley span { border-radius: 999px; padding: 2px 10px; border: 1px solid transparent; }
/* INC-00155: arrastrar en la ruta de picking */
.sg-ruta li[draggable="true"] { cursor: grab; }
.sg-ruta-asa { color: #94a3b8; }
.sg-ruta li.sg-drag-on { opacity: .45; }
.sg-ruta li.sg-drop-a { box-shadow: 0 -3px 0 #2563eb; }
.sg-ruta li.sg-drop-b { box-shadow: 0 3px 0 #2563eb; }

/* INC-00157: «Nuevo módulo» con dibujo */
.sg-mod { display: grid; grid-template-columns: minmax(240px, 300px) 1fr; gap: 18px; align-items: start; }
.sg-mod-f { display: grid; gap: 8px; }
.sg-mod-v { min-width: 0; overflow: auto; }
.sg-mod-rack { max-width: 640px; }
@media (max-width: 760px) { .sg-mod { grid-template-columns: 1fr; } }

/* INC-00164: grupos de pestañas de Almacén */
.sg-tabs:has(.sg-tgrp) { align-items: stretch; gap: 14px; }
.sg-tgrp { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 10px; border: 1px solid var(--rp-line, #e2e8f0); border-radius: 14px; background: rgba(248, 250, 252, .7); }
.sg-tgrp-t { font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--rp-muted, #64748b); padding-left: 2px; }
.sg-tgrp-b { display: flex; flex-wrap: wrap; gap: 8px; }
/* INC-00165: Packing › bultos de un pedido */
.sg-pk { background: var(--rp-card, #fff); border: 1px solid var(--rp-line, #e2e8f0); border-radius: 14px; padding: 14px; display: grid; gap: 12px; }
.sg-pk-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.sg-pk-tipos { display: flex; gap: 10px; flex-wrap: wrap; }
.sg-pk-tipos label { display: flex; flex-direction: column; gap: 3px; font-size: .74rem; font-weight: 700; color: #475569; }
.sg-pk-tipos input { width: 90px; }
.sg-pk-ped { background: #f8fafc; border-radius: 10px; padding: 8px 12px; }
.sg-modos { display: inline-flex; border: 1px solid var(--rp-line); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.sg-modos button { border: 0; background: var(--rp-card); padding: 7px 14px; font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; color: var(--rp-muted, #64748b); }
.sg-modos button.sg-on { background: #0f172a; color: #fff; }

/* INC-00169: ubicar al terminar la recepción */
.sg-ubrec { margin: 10px 0; scroll-margin-block-start: var(--sg-altura-barra, 4.5rem); }
.sg-ubrec-l { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 6px; margin: 8px 0; }
.sg-ubrec-u { text-align: left; border: 1px solid var(--rp-line, #e2e8f0); background: #fff; border-radius: 10px; padding: 7px 10px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 2px; min-height: 52px; overflow-wrap: anywhere; }
.sg-ubrec-u span { font-size: .875rem; color: #64748b; }
.sg-ubrec-u.sg-on { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, .2); }
.sg-ubrec-u { cursor: default; }
.sg-ub-destino { display: grid; gap: 6px; }
.sg-ub-destino strong { color: #0f766e; font-size: 1.15rem; }
.sg-impresoras { display: grid; gap: 6px; min-width: 0; border: 0; padding: 0; }
.sg-impresoras label { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 12px; border: 1px solid var(--rp-line, #cbd5e1); border-radius: 8px; overflow-wrap: anywhere; }
.sg-ubrec-u strong { color: #0f766e; }
.sg-ubrec-p { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .82rem; margin-bottom: 6px; }

/* INC-00182: ubicación de expedición del cliente */
.sg-ubx { display: inline-block; font-weight: 800; font-size: .8rem; background: #0f172a; color: #fff; border-radius: 6px; padding: 1px 8px; white-space: nowrap; }

/* INC-00188: casilla «Cargado» por albarán en Cargar / Carga de camiones */
.sg-man { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 700; margin-right: 8px; cursor: pointer; }
.sg-man input { width: 18px; height: 18px; }

/* INC-00231: fecha de reparto por bulto en Packing */
.sg-pk-fr { padding: 4px 6px; font-size: .8rem; max-width: 150px; }
.sg-pk-fr-propia { border-color: #d97706 !important; background: #fffbeb; }

/* INC-00233: sin precio ni importe en los pedidos de solo consulta */
.vn-sin-precio th:nth-child(4), .vn-sin-precio td:nth-child(4), .vn-sin-precio th:nth-child(5), .vn-sin-precio td:nth-child(5) { display: none; }

/* INC-00251: ruta del pedido en Pedidos */
.vn-ruta { margin: 6px 0 12px; font-size: .9rem; }

/* INC-00262: tipo de pedido con icono y color */
.vn-tipo { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .8rem; padding: 3px 10px 3px 4px; border-radius: 999px; white-space: nowrap; }
.vn-tipo i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; color: #fff; }
.vn-t-alim { background: #ecfdf5; color: #047857; } .vn-t-alim i { background: #10b981; }
.vn-t-carne { background: #fef2f2; color: #b91c1c; } .vn-t-carne i { background: #dc2626; }
.vn-t-vest { background: #eef2ff; color: #4338ca; } .vn-t-vest i { background: #6366f1; }
.vn-t-limp { background: #ecfeff; color: #0e7490; } .vn-t-limp i { background: #06b6d4; }
.vn-t-limpper { background: #f0fdfa; color: #0f766e; } .vn-t-limpper i { background: #14b8a6; }
.vn-t-otro { background: #f1f5f9; color: #475569; } .vn-t-otro i { background: #94a3b8; }
.rp-field > span .vn-tipo { padding: 0; background: none; margin-left: 4px; vertical-align: middle; }
/* INC-00610/611: impresión directa en la TSC del almacén (diálogo de Packing) */
.sg-tsc { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.sg-tsc-prev { background: #e2e8f0; border-radius: 12px; overflow: hidden; height: 460px; }
.sg-tsc-prev iframe { width: 100%; height: 100%; border: 0; }
.sg-tsc-f .rp-field { display: flex; flex-direction: column; gap: 4px; }
.sg-tsc-log { list-style: none; margin: 6px 0 0; padding: 0; font-size: .76rem; display: flex; flex-direction: column; gap: 4px; }
.sg-tsc-log li span { color: #64748b; }
@media (max-width: 760px) { .sg-tsc { grid-template-columns: 1fr; } .sg-tsc-prev { height: 340px; } }

/* INC-00669: cámara continua en la carga */
.sg-cam-msg { margin-top: 10px; padding: 12px 14px; border-radius: 12px; font-weight: 700; font-size: 1rem; background: #f1f5f9; }
.sg-cam-ok { background: #dcfce7; color: #14532d; }
.sg-cam-mal { background: #fee2e2; color: #7f1d1d; }
.sg-cam-hist { margin: 8px 0 0; padding-left: 20px; font-size: .82rem; color: #475569; max-height: 140px; overflow: auto; }

/* INC-00865 / INC-00867 / INC-00869: planos de las naves. Sin scroll (escala al ancho), iconos por estado, relieve opcional. */
.sg-pl-naves { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 12px; }
.sg-pl-naves .sg-acts { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.sg-pl-seg { display: inline-flex; gap: 3px; padding: 4px; background: #eef2f7; border-radius: 14px; flex-wrap: wrap; }
.sg-pl-seg button { border: 0; background: transparent; border-radius: 10px; padding: 7px 14px; cursor: pointer; font: inherit; color: #475569; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.sg-pl-seg button b { font-size: .7rem; padding: 1px 6px; border-radius: 6px; background: #dbe3ec; color: #334155; }
.sg-pl-seg button:hover:not(:disabled):not(.sg-on) { background: #fff; }
.sg-pl-seg button.sg-on { background: #fff; color: #0f2a47; box-shadow: 0 2px 8px rgba(15,42,71,.15); }
.sg-pl-seg button.sg-on b { background: #0f2a47; color: #fff; }
.sg-pl-seg button:disabled { opacity: .45; cursor: default; }
.sg-pl-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
.sg-pl-kpi { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid #e6ebf1; border-radius: 14px; padding: 10px 12px; box-shadow: 0 1px 3px rgba(15,23,42,.05); }
.sg-pl-kpi-i { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #eef2f7; color: #475569; flex: none; }
.sg-pl-kpi b { display: block; font-size: 1.3rem; color: #0f172a; line-height: 1.1; }
.sg-pl-kpi span { font-size: .75rem; color: #64748b; }
.sg-pl-k-lib .sg-pl-kpi-i { background: #dcfce7; color: #15803d; } .sg-pl-k-lib b { color: #15803d; }
.sg-pl-k-ocu .sg-pl-kpi-i { background: #fee2e2; color: #b91c1c; } .sg-pl-k-ocu b { color: #b91c1c; }
.sg-pl-k-av .sg-pl-kpi-i { background: #fef3c7; color: #b45309; } .sg-pl-k-av b { color: #b45309; }
.sg-pl-ley { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .8rem; margin-bottom: 10px; }
.sg-pl-ley > span:not(.sg-muted) { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.sg-pl-ley .sg-pl-ley-av { background: #fef3c7; color: #92400e; }
/* INC-00872: escenario de nave. Fondo de pared y luz arriba, suelo de hormigón con baldosas y cinta de seguridad; en 3D el suelo se
   inclina y cada hueco es una caja con cara frontal. Escala al ancho (ajustarPlano), sin barras de desplazamiento. */
.sg-pl-wrap { border-radius: 20px; padding: 18px 14px 22px; overflow: hidden; position: relative;
  background: linear-gradient(180deg, #1e293b 0%, #334155 22%, #64748b 38%, #cbd5e1 62%, #e2e8f0 100%);
  box-shadow: inset 0 2px 18px rgba(0,0,0,.35); }
.sg-pl-wrap::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 34%; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 2px, transparent 2px 120px),
              radial-gradient(600px 120px at 20% 0%, rgba(255,255,220,.35), transparent 70%), radial-gradient(600px 120px at 80% 0%, rgba(255,255,220,.35), transparent 70%); }
.sg-pl-fit { position: relative; width: 100%; overflow: hidden; }
.sg-pl-esc { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.sg-pl-suelo { position: absolute; left: 0; top: 0; border-radius: 14px;
  background: repeating-linear-gradient(0deg, rgba(15,23,42,.06) 0 1px, transparent 1px 38px), repeating-linear-gradient(90deg, rgba(15,23,42,.06) 0 1px, transparent 1px 66px),
              linear-gradient(160deg, #eef2f6, #d9e0e8);
  box-shadow: inset 0 0 0 7px #f1f5f9, inset 0 0 0 11px #eab308, inset 0 0 0 13px #1f2937, 0 20px 40px rgba(0,0,0,.35); }
.sg-pl-rotulo { position: absolute; right: 22px; bottom: 16px; font-weight: 800; font-size: 1.1rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(15,23,42,.18); display: flex; gap: 8px; align-items: center; }
.sg-pl { position: absolute; }
.sg-pl-3d .sg-pl-esc { perspective: 2600px; perspective-origin: 50% -30%; }
.sg-pl-3d .sg-pl-suelo { transform: rotateX(52deg); transform-origin: 50% 0; transform-style: preserve-3d; }
.sg-pl-3d .sg-pl, .sg-pl-3d .sg-pl-t { transform-style: preserve-3d; }
.sg-pl-3d .sg-pl-c { transform: translateZ(16px); transform-style: preserve-3d; }
.sg-pl-3d .sg-pl-c::after { content: ''; position: absolute; left: -1px; right: -1px; top: 100%; height: 16px; transform-origin: 0 0; transform: rotateX(-90deg);
  border-radius: 0 0 4px 4px; background: linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,.32)); pointer-events: none; }
.sg-pl-3d .sg-pl-c:hover { transform: translateZ(26px); }
.sg-pl-3d .sg-pl-t { background: #94a3b8; box-shadow: 0 0 0 3px #f59e0b, 0 18px 24px -8px rgba(15,23,42,.55); }
.sg-pl-t { position: absolute; border-radius: 10px; background: #dbe3ec; box-shadow: 0 1px 0 #fff inset, 0 6px 16px -8px rgba(15,23,42,.35); }
.sg-pl-c { position: absolute; width: 60px; height: 32px; border: 1px solid transparent; border-radius: 7px; padding: 0 4px 0 18px; cursor: pointer; font: inherit; line-height: 1;
  display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; align-content: center; justify-content: start; column-gap: 3px; row-gap: 2px;
  transition: transform .12s ease, box-shadow .12s ease; text-align: left; }
.sg-pl-c b { font-size: .8rem; font-weight: 800; color: inherit; } .sg-pl-c em { font-style: normal; font-size: .62rem; font-weight: 800; padding: 1px 4px; border-radius: 4px; background: rgba(255,255,255,.75); align-self: center; }
.sg-pl-c small { grid-column: 1 / span 2; font-size: .58rem; opacity: .8; }
.sg-pl-i { position: absolute; left: 5px; top: 50%; transform: translateY(-50%); font-size: .72rem; }
.sg-pl-av { position: absolute; right: 3px; top: 2px; font-size: .55rem; color: #b45309; }
.sg-pl-c:hover { transform: translateY(-2px); z-index: 3; box-shadow: 0 6px 12px rgba(15,23,42,.25), 0 0 0 2px #2563eb; }
.sg-pl-lib { background: #ecfdf3; color: #166534; border-color: #bbf7d0; }
.sg-pl-ocu { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.sg-pl-bloq { background: repeating-linear-gradient(45deg, #f1f5f9 0 5px, #e2e8f0 5px 10px); color: #475569; border-color: #cbd5e1; }
.sg-pl-sin { background: #fff; color: #94a3b8; border: 1px dashed #cbd5e1; }
.sg-pl-ley .sg-pl-lib, .sg-pl-ley .sg-pl-ocu, .sg-pl-ley .sg-pl-bloq, .sg-pl-ley .sg-pl-sin { border-width: 1px; border-style: solid; }
.sg-pl-ley .sg-pl-sin { border-style: dashed; }
/* relieve («3D»): cada hueco es una caja con grosor y el tramo proyecta sombra */
.sg-pl-3d .sg-pl-c { box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 3px 0 rgba(15,23,42,.18); }
.sg-pl-3d .sg-pl-lib { background: linear-gradient(180deg, #f0fdf4, #bbf7d0); }
.sg-pl-3d .sg-pl-ocu { background: linear-gradient(180deg, #fef2f2, #fca5a5); }
.sg-pl-3d .sg-pl-sin { background: linear-gradient(180deg, #ffffff, #eef2f6); }
/* INC-00873: «Nuevo hueco» — cuadrícula del plano para elegir la casilla. (Se perdió al reescribir este fichero en la INC-00872, plano 3D,
   y las casillas quedaban de 4 px: Hugo «no me deja pinchar en el plano». Si se vuelve a reescribir el CSS, conservar este bloque.) */
.sg-nh .sg-nh-f { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.sg-nh .rp-field { display: flex; flex-direction: column; gap: 4px; }
.sg-nh-wrap { max-width: 100%; overflow: auto; padding: 8px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; }
.sg-nh-g { display: grid !important; gap: 2px; width: max-content; max-width: 100%; }
.sg-nh-g > * { display: block; aspect-ratio: 1; min-width: 12px; min-height: 12px; border-radius: 3px; box-sizing: border-box; }
.sg-nh-o { background: #94a3b8; }
.sg-nh-l { border: 1px dashed #cbd5e1; background: #fff; padding: 0; cursor: pointer; }
.sg-nh-l:hover { background: #dcfce7; border-color: #16a34a; }
.sg-nh-l.sg-on { background: #16a34a; border-color: #15803d; box-shadow: 0 0 0 2px #bbf7d0; }
/* INC-00967: mover y redimensionar huecos en el plano (siempre en la cuadrícula) */
.sg-pl-edit .sg-pl { background-image: linear-gradient(rgba(37,99,235,.10) 1px, transparent 1px), linear-gradient(90deg, rgba(37,99,235,.10) 1px, transparent 1px);
  background-size: 66px 38px; }
.sg-pl-edit .sg-pl-c { cursor: grab; touch-action: none; user-select: none; }
.sg-pl-edit .sg-pl-c:active { cursor: grabbing; }
.sg-pl-edit .sg-pl-c:hover { transform: none; }
.sg-pl-c.sg-pl-sel { box-shadow: 0 0 0 3px #2563eb, 0 6px 14px rgba(37,99,235,.35); z-index: 4; }
.sg-pl-rs { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 3px; background: #2563eb; border: 2px solid #fff; cursor: nwse-resize; z-index: 2; }
.sg-pl-edit-ayuda { margin: 6px 0 8px; padding: 8px 12px; border-radius: 10px; background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; font-size: .84rem; }

/* INC-01013: recuadro para elegir varios huecos del plano */
.sg-pl-caja { position: absolute; z-index: 6; border: 2px dashed #2563eb; background: rgba(37,99,235,.10); pointer-events: none; border-radius: 4px; }
.sg-pl-edit .sg-pl { cursor: crosshair; }
.sg-pl-wrap.sg-pl-edit { cursor: crosshair; }

/* INC-01069 (reabierta): lo leído del albarán con IA */
.sg-alb-ia { margin-top: 10px; padding: 10px 12px; border: 1px dashed #93c5fd; border-radius: 10px; background: #eff6ff; }

.sg-cab-albaran [data-sgm="r-ia-cerrar"] { justify-content: center; }

/* Cabecera del albarán en la PDA, el móvil y la tableta. */
@media (max-width: 900px), (pointer: coarse) {
  #recepcion-view:has(.sg-cab-albaran) .rp-root { gap: 6px; }
  #recepcion-view:has(.sg-cab-albaran) .rp-head { display: none; }
  #recepcion-view .sg-tarea-head:has(+ .sg-cab-albaran) {
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 10px; margin: 0;
  }
  #recepcion-view .sg-tarea-head:has(+ .sg-cab-albaran) > button { min-height: 52px; grid-row: span 2; }
  #recepcion-view .sg-tarea-head:has(+ .sg-cab-albaran) .sg-h2 { font-size: 1rem; line-height: 1.15; overflow-wrap: anywhere; }
  #recepcion-view .sg-cab-albaran { margin-top: 6px; padding: 8px; }
  #recepcion-view .sg-cab-albaran .sg-cab-pedido,
  #recepcion-view .sg-cab-albaran .sg-cab-detalle { display: none; }
  #recepcion-view .sg-cab-albaran .sg-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #recepcion-view .sg-cab-albaran .rp-field { min-width: 0; justify-content: flex-end; gap: 3px; font-size: .82rem; line-height: 1.15; }
  #recepcion-view .sg-cab-albaran .rp-field:last-child:nth-child(odd) { grid-column: 1 / -1; }
  #recepcion-view .sg-cab-albaran .lg-inp,
  #recepcion-view .sg-cab-albaran button {
    box-sizing: border-box; min-width: 0; width: 100%; min-height: 52px; padding: 6px 8px; font-size: 1rem;
  }
  #recepcion-view .sg-cab-albaran .rp-dialog-actions {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 8px;
  }
  #recepcion-view .sg-cab-albaran .rp-dialog-actions > span { display: none; }
}
@media (min-width: 600px) and (max-width: 900px), (min-width: 600px) and (pointer: coarse) {
  #recepcion-view .sg-cab-albaran .sg-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #recepcion-view .sg-cab-albaran .rp-field:last-child:nth-child(odd) { grid-column: auto; }
  #recepcion-view .sg-cab-albaran .rp-field:last-child:nth-child(3n+2) { grid-column: span 2; }
}

@media (max-width: 380px) {
  #recepcion-view .sg-tarea-head:has(+ .sg-cab-albaran) > button { grid-row: 1; }
  #recepcion-view .sg-tarea-head:has(+ .sg-cab-albaran) > span { grid-column: 2; grid-row: 1; }
  #recepcion-view .sg-tarea-head:has(+ .sg-cab-albaran) > div { grid-column: 1 / -1; }
}
@media (max-width: 380px) and (max-height: 600px) {
  #recepcion-view .sg-cab-albaran .sg-form { row-gap: 4px; }
  #recepcion-view .sg-cab-albaran { padding-block: 4px; }
}
@media (max-height: 600px) and (max-width: 900px) {
  .content-area:has(#recepcion-view.active .sg-cab-albaran) { padding: 4px 8px; }
}
@media (min-width: 600px) and (max-width: 900px) and (max-height: 500px) {
  #recepcion-view:has(.sg-cab-albaran) .rp-root {
    display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 3fr);
    grid-template-rows: auto 1fr; align-items: start; gap: 4px 8px;
  }
  #recepcion-view:has(.sg-cab-albaran) :is(#rp-content, #sg-cuerpo) { display: contents; }
  #recepcion-view .sg-tarea-head:has(+ .sg-cab-albaran) { display: flex; flex-direction: column; }
  #recepcion-view .sg-tarea-head:has(+ .sg-cab-albaran) > div { flex: none; }
  #recepcion-view .sg-cab-albaran { grid-column: 2; grid-row: 1 / 3; margin: 0; }
}
.sg-alb-ia-l { display: grid; gap: 6px; margin-top: 6px; }
.sg-alb-ia-f { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 6px 0; border-top: 1px solid #dbeafe; }
@media (max-width: 600px) { .sg-alb-ia-f { flex-direction: column; align-items: stretch; } .sg-alb-ia-f .rp-btn-cargo { width: 100%; min-height: 44px; justify-content: center; } }

/* INC-01107 (Hugo, 24/11/2026): recepción en tablet Albarán → artículo → bulto → lotes (gasca_sga_ops.js, tabletHTML) */
#recepcion-view .sg-t-bar { display: flex; align-items: center; gap: 12px; background: #0f2a47; color: #fff; border-radius: 12px; padding: 12px 14px; margin: 4px 0 12px; }
#recepcion-view .sg-t-bar h2 { color: #fff; margin: 0; font-size: 1.25rem; line-height: 1.25; }
#recepcion-view .sg-t-back { background: transparent; border: 0; color: #fff; min-width: 44px; min-height: 44px; display: grid; place-items: center; cursor: pointer; }
#recepcion-view .sg-t-card { background: var(--rp-card); border: 1px solid var(--rp-line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
#recepcion-view .sg-t-prov { display: flex; gap: 14px; align-items: flex-start; }
#recepcion-view .sg-t-prov > div { flex: 1; min-width: 0; }
#recepcion-view .sg-t-prov > div > b { font-size: 1.1rem; display: block; }
#recepcion-view .sg-t-prov small { color: var(--rp-muted); display: block; }
#recepcion-view .sg-t-ico { width: 52px; height: 52px; border-radius: 12px; background: #eef4f8; display: grid; place-items: center; flex: none; color: #0f2a47; }
#recepcion-view .sg-t-av { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; font-size: .9rem; }
#recepcion-view .sg-t-dif { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-top: 4px; }
#recepcion-view .sg-t-prog { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; margin: 4px 2px 12px; }
#recepcion-view .sg-t-prog > div:first-child { grid-column: 1 / -1; display: flex; justify-content: space-between; }
#recepcion-view .sg-t-barra { height: 12px; border-radius: 6px; background: #e2e8f0; overflow: hidden; }
#recepcion-view .sg-t-barra i { display: block; height: 100%; background: #0d9488; border-radius: 6px; }
#recepcion-view .sg-t-pct { background: #ccfbf1; color: #0f766e; font-weight: 800; border-radius: 8px; padding: 2px 10px; }
#recepcion-view .sg-t-arts { border: 1px solid var(--rp-line); border-radius: 12px; overflow: hidden; margin-bottom: 14px; background: var(--rp-card); }
#recepcion-view .sg-t-arts-h, #recepcion-view .sg-t-art { display: grid; grid-template-columns: 1fr 110px 130px 36px; gap: 10px; align-items: center; padding: 10px 14px; }
#recepcion-view .sg-t-arts-h { background: #f1f5f9; font-weight: 700; font-size: .85rem; color: var(--rp-muted); }
#recepcion-view .sg-t-art { width: 100%; border: 0; border-top: 1px solid var(--rp-line); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; min-height: 64px; }
#recepcion-view .sg-t-art .sg-t-ico { width: 40px; height: 40px; border-radius: 10px; }
#recepcion-view .sg-t-art-n { min-width: 0; }
#recepcion-view .sg-t-art-n b { display: block; }
#recepcion-view .sg-t-art-n small { color: var(--rp-muted); }
#recepcion-view .sg-t-art small.sg-t-mal { display: block; }
#recepcion-view .sg-t-ok { background: #f0fdf4; }
#recepcion-view .sg-t-ok .sg-t-est { color: #16a34a; }
#recepcion-view .sg-t-mal { color: #b91c1c; }
#recepcion-view .sg-t-bien { color: #15803d; }
#recepcion-view .sg-t-prim { width: 100%; min-height: 56px; border: 0; border-radius: 12px; background: #0f2a47; color: #fff; font-size: 1.15rem; font-weight: 700; cursor: pointer; margin: 4px 0 12px; }
#recepcion-view .sg-t-prim.sg-t-verde { background: #0f766e; }
#recepcion-view .sg-t-prim:disabled { opacity: .6; }
#recepcion-view .sg-t-sec { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
#recepcion-view .sg-t-sec .rp-btn-cargo { min-height: 44px; }
/* INC-01121 (Hugo, 24/11/2026): Pedido / Recibido / Pendiente en filas (etiqueta a la izquierda y valor a la derecha), no en botones */
#recepcion-view .sg-t-kpis { display: grid; grid-template-columns: 1fr; gap: 0; margin-top: 12px; border-top: 1px solid var(--rp-line); }
#recepcion-view .sg-t-kpis > div, #recepcion-view .sg-t-kpis > label { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--rp-line); background: none; border-radius: 0; margin: 0; }
#recepcion-view .sg-t-resumen-bultos { border-top: 0; }
#recepcion-view .sg-t-resumen-bultos > div:last-child { border-bottom: 0; }
#recepcion-view .sg-t-kpis small { color: var(--rp-muted); font-size: .95rem; }
#recepcion-view .sg-t-kpis b { font-size: 1.15rem; text-align: right; }
#recepcion-view .sg-t-kpis .sg-t-kpen b { color: #0f766e; }
#recepcion-view .sg-t-kpis .sg-t-kmal b { color: #b91c1c; }
#recepcion-view .sg-t-kpis .sg-t-krec small { color: var(--rp-ink); font-weight: 600; }
#recepcion-view .sg-t-kpis .sg-t-krec input { width: 160px; max-width: 50%; text-align: right; font-size: 1.15rem; font-weight: 700; border: 2px solid #0f766e; }
#recepcion-view .sg-t-kpis > .sg-t-dato-bulto { padding-block: 4px; }
#recepcion-view .sg-t-dato-bulto .lg-inp { box-sizing: border-box; width: min(60%, 210px); min-width: 0; min-height: 52px; font-size: 1rem; }
#recepcion-view .sg-t-h3 { font-size: 1.1rem; margin: 6px 2px 8px; }
#recepcion-view .sg-t-bultos { display: grid; gap: 6px; margin-bottom: 12px; }
#recepcion-view .sg-t-bulto { display: flex; justify-content: space-between; gap: 10px; align-items: center; border: 1px solid var(--rp-line); border-radius: 10px; padding: 8px 12px; background: var(--rp-card); }
#recepcion-view .sg-t-o { text-align: center; color: var(--rp-muted); margin: 6px 0; }
#recepcion-view .sg-t-man { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
#recepcion-view .sg-t-man small { display: block; color: var(--rp-muted); margin-bottom: 4px; }
#recepcion-view .sg-t-big { min-height: 48px; font-size: 1.1rem; }
#recepcion-view .sg-t-step { display: inline-flex; align-items: center; border: 1px solid var(--rp-line); border-radius: 10px; overflow: hidden; background: #fff; }
#recepcion-view .sg-t-step button { min-width: 44px; min-height: 44px; border: 0; background: #f1f5f9; font-size: 1.3rem; cursor: pointer; }
#recepcion-view .sg-t-step b { min-width: 48px; text-align: center; font-size: 1.1rem; }
#recepcion-view .sg-t-step input { width: 80px; border: 0; text-align: center; min-height: 44px; font-size: 1.05rem; }
#recepcion-view .sg-t-total { display: flex; justify-content: space-between; align-items: center; background: #ccfbf1; border-radius: 10px; padding: 10px 14px; margin: 10px 0; font-size: 1.05rem; }
#recepcion-view .sg-t-total b { display: inline-flex; align-items: center; gap: 6px; font-size: 1.2rem; }
#recepcion-view .sg-t-cant { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
#recepcion-view .sg-t-cant input { width: 110px; min-height: 44px; font-size: 1.05rem; }
#recepcion-view .sg-t-lotes { border: 1px solid var(--rp-line); border-radius: 12px; overflow: hidden; background: var(--rp-card); }
#recepcion-view .sg-t-lotes-h, #recepcion-view .sg-t-lote { display: grid; grid-template-columns: 1.2fr 1fr auto 44px; gap: 8px; align-items: center; padding: 8px 12px; }
#recepcion-view .sg-t-lotes-h { background: #f1f5f9; font-weight: 700; font-size: .85rem; color: var(--rp-muted); }
#recepcion-view .sg-t-lote { border-top: 1px solid var(--rp-line); }
#recepcion-view .sg-t-lote > input { min-height: 44px; min-width: 0; }
#recepcion-view .sg-t-add { width: 100%; min-height: 52px; margin-top: 10px; border: 1.5px solid #0f2a47; color: #0f2a47; background: #fff; border-radius: 12px; font-size: 1.05rem; font-weight: 600; cursor: pointer; }
#recepcion-view .sg-t-rech { margin: 8px 0; }
@media (max-width: 700px) {
  #recepcion-view .sg-t-art, #recepcion-view .sg-t-arts-h { grid-template-columns: 1fr 76px 86px 24px; gap: 6px; padding: 8px 10px; font-size: .9rem; }
  #recepcion-view .sg-t-lotes-h { display: none; }
  #recepcion-view .sg-t-lote { grid-template-columns: 1fr 1fr; }
  #recepcion-view .sg-t-man { grid-template-columns: 1fr; }
}
/* Pantalla de alta: el resumen y los bultos generados preceden a las acciones. */
#recepcion-view .sg-t-alta-bultos { scroll-margin-block-start: 4.5rem; }
#recepcion-view .sg-t-alta-bultos .sg-t-card {
  position: sticky; top: var(--sg-altura-barra, 0px); z-index: 2;
  margin: 0; padding: 5px 16px; background: var(--rp-card, #fff);
}
#recepcion-view .sg-t-alta-bultos .sg-t-resumen-bultos { margin: 0; }
#recepcion-view .sg-t-alta-bultos.sg-t-con-teclado .sg-t-card {
  top: max(var(--sg-altura-barra, 0px), var(--sg-tope-teclado, 0px));
}
#recepcion-view .sg-t-con-teclado .sg-t-resumen-bultos > div:not(.sg-t-kpen),
#recepcion-view .sg-t-con-teclado .sg-t-card > .sg-muted { display: none; }
#recepcion-view .sg-t-alta-bultos .sg-scanbox { margin-top: 12px; }
#recepcion-view .sg-t-lote.sg-t-nb {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 6px 10px; padding: 10px;
}
#recepcion-view .sg-t-nb:first-child { border-top: 0; }
#recepcion-view .sg-t-id-bulto { grid-column: 1 / -1; overflow-wrap: anywhere; }
#recepcion-view .sg-t-nb .rp-field { min-width: 0; color: var(--rp-ink); }
#recepcion-view .sg-t-nb .lg-inp { box-sizing: border-box; width: 100%; min-width: 0; min-height: 52px; font-size: 1rem; }
#recepcion-view .sg-t-nb button { min-height: 52px; justify-content: center; }
@media (max-width: 700px) {
  #recepcion-view:has(.sg-t-alta-bultos) .rp-head { display: none; }
  #recepcion-view .sg-t-lote.sg-t-nb { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.sg-cam-full .content-area { z-index: 2147482000 !important; }
.sg-cam-alb { position: fixed; inset: 0; z-index: 2147483000; display: flex; flex-direction: column; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom)); background: #0d1925; color: white; }
.sg-cam-alb h2 { margin: 0; color: white; font-size: 1.15rem; }
.sg-cam-alb p { margin: 0; font-size: .94rem; }
.sg-cam-alb [data-cam-msg]:empty { display: none; }
.sg-cam-visor { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; overflow: hidden; background: #080d13; container-type: size; }
.sg-cam-visor video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sg-cam-marco { --papel: .707; pointer-events: none; aspect-ratio: var(--papel); width: min(92cqw, calc(92cqh * var(--papel)), calc(92cqw / var(--sg-cam-proporcion, 1) * var(--papel)), calc(92cqh * var(--sg-cam-proporcion, 1))); border: 2px dashed #fff; box-shadow: 0 0 0 1px #15263899; z-index: 1; }
.sg-cam-acciones { display: flex; align-items: stretch; justify-content: center; flex-wrap: wrap; gap: 6px; }
.sg-cam-acciones > :not([hidden]) { min-height: 48px; display: inline-flex; justify-content: center; align-items: center; flex: 1 1 auto; margin: 0; cursor: pointer; }
.sg-cam-acciones [data-sgm="r-cam-foto"] { flex-basis: 100%; }
.sg-cam-acciones :disabled { opacity: .65; }
@media (orientation: landscape) {
  .sg-cam-marco { --papel: 1.414; }
  .sg-cam-acciones [data-sgm="r-cam-foto"] { flex-basis: auto; }
}
/* INC-01180: n.º de bultos con − y + (el campo dentro del selector, sin borde propio) */
#recepcion-view .sg-t-step .lg-inp, #recepcion-view .sg-t-dato-bulto .sg-t-step .lg-inp { width: 72px; min-width: 0; min-height: 52px; border: 0; border-radius: 0; text-align: center; font-size: 1.15rem; box-shadow: none; }
#recepcion-view .sg-t-step button { min-width: 52px; min-height: 52px; font-weight: 700; }
#recepcion-view .sg-t-step input::-webkit-outer-spin-button, #recepcion-view .sg-t-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#recepcion-view .sg-t-nbultos { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 8px; }
#recepcion-view .sg-t-nbultos .sg-t-h3 { margin: 0; }
