/* GASCA · Almacén › Toma de inventario (gasca_sga_inventario.js). Prefijo ti-. Mismo estilo que Albaranes de compra (cp-). */
#inventario-view { --ti-pri: #0f766e; --ti-pri2: #0d9488; --ti-azul: #1d4ed8; --ti-verde: #16a34a; --ti-rojo: #dc2626; --ti-ambar: #d97706; --ti-gris: #64748b;
  --ti-linea: #e6ebf1; --ti-fondo: #f6f8fb; color: #0f172a; }
#inventario-view *, .ti-modal *, .ti-cnt * { box-sizing: border-box; }
.ti-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px 22px; border-radius: 18px; color: #fff;
  background: radial-gradient(1100px 300px at 90% -40%, rgba(255,255,255,.2), transparent), linear-gradient(120deg, #134e4a, #0d9488);
  box-shadow: 0 14px 40px -18px rgba(15,118,110,.6); margin-bottom: 14px; }
.ti-hero-ico { width: 52px; height: 52px; border-radius: 14px; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex: none; }
.ti-hero h2 { margin: 0; font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; color: #fff; }
.ti-hero p { margin: 3px 0 0; opacity: .88; font-size: .9rem; }
.ti-hero-acc { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ti-chip-h { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 5px 11px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.ti-volver { border: 0; background: rgba(255,255,255,.18); color: #fff; width: 40px; height: 40px; border-radius: 12px; cursor: pointer; font-size: 1rem; flex: none; }
.ti-btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--ti-linea, #e6ebf1); background: #fff; color: #0f172a; border-radius: 10px;
  padding: 8px 13px; font-size: .85rem; font-weight: 600; cursor: pointer; transition: all .15s; white-space: nowrap; font-family: inherit; }
.ti-btn:hover { border-color: #94a3b8; box-shadow: 0 2px 8px rgba(15,23,42,.08); }
.ti-btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.ti-btn.prim { background: #0f766e; color: #fff; border-color: #0f766e; }
.ti-btn.blanco { background: rgba(255,255,255,.95); border-color: transparent; color: #0f766e; }
.ti-btn.rojo { background: #fff; color: #b91c1c; border-color: #fecaca; }
.ti-btn.rojo.lleno { background: #b91c1c; color: #fff; border-color: #b91c1c; }
.ti-btn.ambar { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.ti-btn.peq { padding: 5px 9px; font-size: .76rem; border-radius: 8px; }
.ti-btn.grande { padding: 12px 18px; font-size: 1rem; border-radius: 12px; }

/* Stepper */
.ti-pasos { display: flex; gap: 0; background: #fff; border: 1px solid var(--ti-linea); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; overflow-x: auto; }
.ti-paso { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 130px; color: #94a3b8; font-weight: 700; font-size: .82rem; position: relative; }
.ti-paso + .ti-paso::before { content: ''; flex: 0 0 24px; height: 2px; background: #e2e8f0; margin-right: 8px; }
.ti-paso b { width: 28px; height: 28px; border-radius: 50%; background: #f1f5f9; color: #94a3b8; display: flex; align-items: center; justify-content: center; flex: none; font-size: .8rem; }
.ti-paso.hecho { color: #0f766e; } .ti-paso.hecho b { background: #ccfbf1; color: #0f766e; }
.ti-paso.on { color: #0f172a; } .ti-paso.on b { background: #0f766e; color: #fff; box-shadow: 0 0 0 4px #ccfbf1; }
.ti-acciones { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.ti-acciones .ti-sep { flex: 1; }

/* KPIs */
.ti-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
/* INC-00134: filas iguales según cuántos KPI hay, para que ninguno se quede solo en una fila (8 → 8 o 4+4; 5 → 5 o 3+2; 3 → 3) */
.ti-kpis:has(> :nth-child(8):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ti-kpis:has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ti-kpis:has(> :nth-child(5):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ti-kpis:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ti-kpis:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1100px) { .ti-kpis:has(> :nth-child(5):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1300px) { .ti-kpis:has(> :nth-child(6):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 1500px) {
  .ti-kpis:has(> :nth-child(8):last-child) { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
  .ti-kpis:has(> :nth-child(8):last-child) > .ti-kpi { padding: 12px; }
  .ti-kpis:has(> :nth-child(8):last-child) .ti-kpi-val { font-size: 1.3rem; }
}
.ti-kpi { background: #fff; border: 1px solid var(--ti-linea); border-radius: 16px; padding: 14px 15px; position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.ti-kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(15,23,42,.35); }
.ti-kpi-top { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.ti-kpi-ico { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: .95rem; flex: none; }
.ti-kpi-tit { font-size: .74rem; font-weight: 700; color: var(--ti-gris); text-transform: uppercase; letter-spacing: .03em; line-height: 1.2; }
.ti-kpi-val { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.ti-kpi-sub { font-size: .76rem; color: var(--ti-gris); margin-top: 5px; line-height: 1.35; }
.ti-barra { height: 7px; border-radius: 999px; background: #eef2f7; overflow: hidden; margin-top: 8px; }
.ti-barra i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #0d9488, #14b8a6); }
.ti-neg { color: #b91c1c; } .ti-pos { color: #15803d; } .ti-mut { color: var(--ti-gris); }

/* Tarjetas */
.ti-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; margin-bottom: 14px; }
.ti-card { background: #fff; border: 1px solid var(--ti-linea); border-radius: 16px; padding: 14px 16px; min-width: 0; }
.ti-c12 { grid-column: span 12; } .ti-c8 { grid-column: span 8; } .ti-c7 { grid-column: span 7; } .ti-c6 { grid-column: span 6; } .ti-c5 { grid-column: span 5; } .ti-c4 { grid-column: span 4; }
.ti-card h3 { margin: 0; font-size: .98rem; font-weight: 800; display: flex; align-items: center; gap: 8px; color: #0f172a; }
.ti-card h3 i { color: #0d9488; }
.ti-card-sub { font-size: .78rem; color: var(--ti-gris); margin: 3px 0 10px; }
.ti-lienzo { position: relative; height: 280px; } .ti-lienzo.bajo { height: 220px; } .ti-lienzo.alto { height: 340px; }
.ti-vacio { padding: 36px 10px; text-align: center; color: var(--ti-gris); }
.ti-vacio i { font-size: 2rem; display: block; margin-bottom: 8px; color: #cbd5e1; }
.ti-error { padding: 14px; border-radius: 14px; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; margin-bottom: 12px; }
.ti-aviso { border-radius: 12px; padding: 10px 12px; font-size: .84rem; background: #fffbeb; color: #92400e; border: 1px solid #fde68a; margin-bottom: 10px; display: flex; gap: 8px; align-items: flex-start; }
.ti-aviso.verde { background: #f0fdf4; color: #166534; border-color: #bbf7d0; } .ti-aviso.azul { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.ti-aviso.rojo { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.ti-esqueleto { background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%); background-size: 200% 100%; animation: tiBrillo 1.2s infinite; border-radius: 16px; }
@keyframes tiBrillo { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Tarjetas de inventario (portada) */
.ti-invs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-bottom: 14px; }
.ti-inv { background: #fff; border: 1px solid var(--ti-linea); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: all .15s; }
.ti-inv:hover { border-color: #5eead4; box-shadow: 0 14px 30px -18px rgba(15,118,110,.5); transform: translateY(-2px); }
.ti-inv-cab { display: flex; gap: 12px; align-items: center; }
.ti-anillo { --p: 0; width: 64px; height: 64px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(#0d9488 calc(var(--p) * 1%), #e2e8f0 0); }
.ti-anillo span { width: 50px; height: 50px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .86rem; }
.ti-inv h4 { margin: 0; font-size: 1.02rem; font-weight: 800; color: #0f172a; }
.ti-inv-sub { font-size: .78rem; color: var(--ti-gris); margin-top: 2px; }
.ti-inv-kp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ti-inv-kp div { background: var(--ti-fondo); border-radius: 10px; padding: 7px 8px; font-size: .7rem; color: var(--ti-gris); text-transform: uppercase; font-weight: 700; letter-spacing: .02em; }
.ti-inv-kp b { display: block; color: #0f172a; font-size: .98rem; text-transform: none; letter-spacing: 0; }
.ti-inv-pie { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ti-nuevo { border: 2px dashed #99f6e4; background: #f0fdfa; color: #0f766e; align-items: center; justify-content: center; text-align: center; min-height: 190px; font-weight: 800; }
.ti-nuevo i { font-size: 2rem; margin-bottom: 6px; }

/* Etiquetas */
.ti-badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 7px; padding: 2px 8px; font-size: .72rem; font-weight: 700; background: #f1f5f9; color: #475569; white-space: nowrap; }
.ti-badge.verde { background: #dcfce7; color: #166534; } .ti-badge.rojo { background: #fee2e2; color: #991b1b; } .ti-badge.ambar { background: #fef3c7; color: #92400e; }
.ti-badge.azul { background: #dbeafe; color: #1e40af; } .ti-badge.teal { background: #ccfbf1; color: #115e59; } .ti-badge.morado { background: #ede9fe; color: #5b21b6; } .ti-badge.gris { background: #e2e8f0; color: #334155; }
.ti-balda { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-weight: 800; letter-spacing: .02em; background: #0f172a; color: #fff; border-radius: 6px; padding: 1px 7px; font-size: .78rem; white-space: nowrap; }
.ti-balda.no { background: #e2e8f0; color: #64748b; }

/* Pestañas y tablas */
.ti-tabs { display: flex; gap: 4px; background: #eef2f7; border-radius: 12px; padding: 4px; width: fit-content; max-width: 100%; overflow-x: auto; margin-bottom: 12px; }
.ti-tab { border: 0; background: none; padding: 8px 14px; border-radius: 9px; font-weight: 700; font-size: .85rem; color: #475569; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; font-family: inherit; }
.ti-tab.on { background: #fff; color: #0f766e; box-shadow: 0 2px 8px rgba(15,23,42,.1); }
.ti-tab .ti-n { background: #e2e8f0; color: #334155; border-radius: 999px; padding: 1px 7px; font-size: .7rem; }
.ti-tab .ti-n.rojo { background: #fee2e2; color: #991b1b; }
.ti-barra-t { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.ti-barra-t input, .ti-barra-t select, .ti-campo input, .ti-campo select, .ti-campo textarea { border: 1px solid var(--ti-linea, #e6ebf1); border-radius: 9px; padding: 7px 10px; font: inherit; font-size: .85rem; background: #fff; color: #0f172a; }
.ti-barra-t .ti-der { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ti-sel-barra { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 12px; padding: 8px 10px; margin-bottom: 10px; font-size: .85rem; }
.ti-tabla-wrap { overflow: auto; border: 1px solid var(--ti-linea); border-radius: 14px; background: #fff; max-height: calc(100vh - 230px); }
.ti-tabla { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .84rem; }
.ti-tabla th { position: sticky; top: 0; z-index: 2; background: #f8fafc; text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; color: #475569; padding: 9px 9px; border-bottom: 1px solid var(--ti-linea); white-space: nowrap; }
.ti-tabla th.num, .ti-tabla td.num { text-align: right; }
.ti-tabla td { padding: 7px 9px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.ti-tabla tbody tr.fila { cursor: pointer; transition: background .1s; }
.ti-tabla tbody tr.fila:hover { background: #f0fdfa; }
.ti-tabla tr.zona td { background: #f0fdfa; color: #115e59; font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; position: sticky; top: 33px; z-index: 1; }
.ti-tabla .art { max-width: 340px; } .ti-tabla .art b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ti-tabla .art small { color: var(--ti-gris); }
.ti-mas { text-align: center; padding: 10px; }

/* Modal */
.ti-modal { position: fixed; inset: 0; z-index: 13500; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; padding: 16px; font-family: 'Inter', sans-serif; color: #0f172a; }
.ti-modal-box { background: #fff; border-radius: 18px; width: min(720px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 30px 80px -30px rgba(15,23,42,.6); }
.ti-modal-box.ancho { width: min(980px, 100%); }
.ti-modal-cab { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-bottom: 1px solid #eef2f7; }
.ti-modal-cab h3 { margin: 0; font-size: 1.12rem; font-weight: 800; color: #0f172a; }
.ti-modal-cab .ti-sub { font-size: .82rem; color: #64748b; margin-top: 2px; }
.ti-x { margin-left: auto; border: 0; background: #f1f5f9; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 1rem; flex: none; }
.ti-modal-cuerpo { padding: 16px 18px; overflow-y: auto; flex: 1; }
.ti-modal-pie { padding: 12px 18px; border-top: 1px solid #eef2f7; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.ti-campo { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.ti-campo label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.ti-fila2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ti-opciones { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.ti-opcion { border: 2px solid #e2e8f0; border-radius: 14px; padding: 12px; cursor: pointer; background: #fff; text-align: left; font-family: inherit; transition: all .12s; }
.ti-opcion:hover { border-color: #5eead4; }
.ti-opcion.on { border-color: #0d9488; background: #f0fdfa; box-shadow: 0 0 0 3px #ccfbf1; }
.ti-opcion b { display: block; font-size: 1rem; color: #0f172a; } .ti-opcion span { display: block; font-size: .78rem; color: #64748b; margin-top: 3px; }
.ti-opcion .big { font-size: 1.4rem; font-weight: 800; color: #0f766e; margin-top: 4px; }
.ti-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ti-chipz { border: 2px solid #e2e8f0; border-radius: 999px; padding: 7px 12px; cursor: pointer; background: #fff; font: 600 .84rem 'Inter', sans-serif; color: #334155; }
.ti-chipz.on { border-color: #0d9488; background: #f0fdfa; color: #0f766e; }
.ti-chipz small { color: #64748b; font-weight: 600; margin-left: 4px; }
.ti-switch { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 12px; margin-bottom: 12px; cursor: pointer; }
.ti-switch input { width: 18px; height: 18px; margin-top: 2px; accent-color: #0f766e; }
.ti-switch b { display: block; font-size: .9rem; } .ti-switch span { font-size: .8rem; color: #64748b; }
.ti-resumen { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 6px 0 12px; }
.ti-resumen div { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 12px; padding: 9px 11px; font-size: .72rem; color: #64748b; text-transform: uppercase; font-weight: 700; }
.ti-resumen b { display: block; font-size: 1.05rem; color: #0f172a; text-transform: none; }
.ti-lecturas { display: grid; gap: 8px; }
.ti-lect { border: 1px solid #e2e8f0; border-radius: 12px; padding: 9px 11px; font-size: .84rem; }
.ti-lect h5 { margin: 0 0 5px; font-size: .78rem; text-transform: uppercase; color: #64748b; letter-spacing: .03em; }

/* Toast */
.ti-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); z-index: 14000; background: #0f172a; color: #fff; padding: 11px 18px; border-radius: 12px;
  font: 600 .9rem 'Inter', sans-serif; opacity: 0; transition: all .2s; pointer-events: none; max-width: calc(100vw - 32px); box-shadow: 0 14px 30px -12px rgba(0,0,0,.5); }
.ti-toast.on { opacity: 1; transform: translateX(-50%); } .ti-toast.mal { background: #b91c1c; } .ti-toast.bien { background: #15803d; }

/* Leyenda */
.ti-leyenda { margin-top: 16px; border: 1px dashed #cbd5e1; border-radius: 14px; padding: 10px 14px; font-size: .8rem; color: #475569; background: #fff; }
.ti-leyenda summary { cursor: pointer; font-weight: 700; color: #334155; }
.ti-leyenda ul { margin: 6px 0 0; padding-left: 18px; } .ti-leyenda li { margin-bottom: 3px; }
.ti-leyenda code { background: #f1f5f9; border-radius: 5px; padding: 0 4px; font-size: .76rem; }

/* ───────────── Modo recuento (móvil / tablet) ───────────── */
.ti-cnt { position: fixed; inset: 0; z-index: 13000; background: #f1f5f9; display: flex; flex-direction: column; font-family: 'Inter', sans-serif; color: #0f172a; }
.ti-cnt-cab { background: linear-gradient(120deg, #134e4a, #0d9488); color: #fff; padding: 10px 12px; display: flex; gap: 10px; align-items: center; flex: none; }
.ti-cnt-cab .tit { font-weight: 800; font-size: .95rem; line-height: 1.15; min-width: 0; }
.ti-cnt-cab .tit small { display: block; font-weight: 600; opacity: .85; font-size: .74rem; }
.ti-cnt-cab button { border: 0; background: rgba(255,255,255,.18); color: #fff; height: 40px; min-width: 40px; border-radius: 11px; cursor: pointer; font-size: .95rem; padding: 0 10px; font-family: inherit; font-weight: 700; }
.ti-cnt-cab .der { margin-left: auto; display: flex; gap: 6px; }
.ti-cnt-prog { height: 5px; background: rgba(15,118,110,.15); flex: none; } .ti-cnt-prog i { display: block; height: 100%; background: #14b8a6; transition: width .3s; }
.ti-cnt-busca { display: flex; gap: 8px; padding: 10px 12px 0; flex: none; }
.ti-cnt-busca input { flex: 1; min-width: 0; border: 2px solid #cbd5e1; border-radius: 12px; padding: 11px 12px; font: 600 1rem 'Inter', sans-serif; background: #fff; }
.ti-cnt-busca input:focus { outline: none; border-color: #0d9488; }
.ti-cnt-busca button { border: 0; background: #0f172a; color: #fff; border-radius: 12px; width: 48px; font-size: 1.1rem; cursor: pointer; flex: none; }
.ti-cnt-cuerpo { flex: 1; overflow-y: auto; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 10px; max-width: 720px; width: 100%; margin: 0 auto; }
.ti-cnt-art { background: #fff; border-radius: 18px; padding: 14px 16px; box-shadow: 0 6px 20px -14px rgba(15,23,42,.4); }
.ti-cnt-art .fila1 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.ti-cnt-art .balda { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.6rem; font-weight: 900; background: #0f172a; color: #fff; border-radius: 10px; padding: 3px 12px; letter-spacing: .03em; }
.ti-cnt-art .balda.no { background: #e2e8f0; color: #475569; font-size: 1rem; padding: 6px 10px; }
.ti-cnt-art h2 { margin: 0; font-size: 1.35rem; font-weight: 800; line-height: 1.2; color: #0f172a; }
.ti-cnt-art .cod { font-size: .88rem; color: #475569; margin-top: 5px; }
.ti-cnt-art .ya { margin-top: 8px; font-size: .84rem; }
.ti-cnt-cant { background: #fff; border-radius: 18px; padding: 12px 14px; box-shadow: 0 6px 20px -14px rgba(15,23,42,.4); }
.ti-cnt-visor { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; border: 2px solid #0d9488; border-radius: 14px; padding: 8px 14px; min-height: 66px; background: #f0fdfa; cursor: text; }
.ti-cnt-visor b { font-size: 2.4rem; font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ti-cnt-visor span { font-size: 1rem; color: #475569; font-weight: 700; }
.ti-cnt-visor.vacio b { color: #94a3b8; }
.ti-cnt-lote { display: grid; grid-template-columns: 1fr 1fr 110px 36px; gap: 6px; align-items: center; margin-bottom: 8px; padding: 6px; border-radius: 12px; border: 2px solid transparent; }
.ti-cnt-lote.on { border-color: #0d9488; background: #f0fdfa; }
.ti-cnt-lote input { width: 100%; min-width: 0; border: 1px solid #cbd5e1; border-radius: 10px; padding: 9px 8px; font: 600 .92rem 'Inter', sans-serif; background: #fff; }
.ti-cnt-lote .q { border: 2px solid #0d9488; border-radius: 10px; padding: 7px 8px; font-weight: 900; font-size: 1.15rem; text-align: right; background: #fff; cursor: pointer; min-height: 40px; }
.ti-cnt-lote .q.vacio { color: #94a3b8; }
.ti-cnt-lote button { border: 0; background: #fee2e2; color: #b91c1c; border-radius: 10px; height: 36px; cursor: pointer; }
.ti-cnt-lote-cab { display: grid; grid-template-columns: 1fr 1fr 110px 36px; gap: 6px; font-size: .68rem; font-weight: 800; text-transform: uppercase; color: #64748b; padding: 0 8px 4px; }
.ti-teclado { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 10px; }
.ti-teclado button { border: 0; background: #f1f5f9; border-radius: 13px; height: 56px; font: 800 1.4rem 'Inter', sans-serif; color: #0f172a; cursor: pointer; touch-action: manipulation; user-select: none; }
.ti-teclado button:active { background: #ccfbf1; transform: scale(.97); }
.ti-teclado button.fn { background: #e2e8f0; font-size: 1rem; }
.ti-cnt-pie { flex: none; background: #fff; border-top: 1px solid #e2e8f0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: auto 1fr 2fr; gap: 8px; }
.ti-cnt-pie button { border: 0; border-radius: 14px; height: 56px; font: 800 .95rem 'Inter', sans-serif; cursor: pointer; padding: 0 12px; }
.ti-cnt-pie .ant { background: #f1f5f9; color: #334155; width: 56px; }
.ti-cnt-pie .sin { background: #fef3c7; color: #92400e; }
.ti-cnt-pie .ok { background: #0f766e; color: #fff; font-size: 1.05rem; }
.ti-cnt-pie button:disabled { opacity: .5; }
.ti-cnt-lista { display: grid; gap: 6px; }
.ti-cnt-item { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 9px 11px; cursor: pointer; text-align: left; font-family: inherit; width: 100%; }
.ti-cnt-item.on { border-color: #0d9488; box-shadow: 0 0 0 2px #ccfbf1; }
.ti-cnt-item .d { flex: 1; min-width: 0; } .ti-cnt-item .d b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.ti-cnt-item .d small { color: #64748b; }
.ti-cnt-fin { text-align: center; padding: 40px 16px; } .ti-cnt-fin i { font-size: 3rem; color: #14b8a6; } .ti-cnt-fin h2 { margin: 10px 0 6px; }
.ti-cam { width: 100%; max-width: 420px; margin: 0 auto; border-radius: 14px; overflow: hidden; }

@media (max-width: 1100px) { .ti-c8, .ti-c7, .ti-c6, .ti-c5, .ti-c4 { grid-column: span 12; } }
@media (max-width: 760px) {
  .ti-hero { padding: 16px; border-radius: 14px; } .ti-hero h2 { font-size: 1.2rem; } .ti-hero-acc { margin-left: 0; width: 100%; }
  .ti-kpis, .ti-kpis:has(> :nth-child(3):last-child), .ti-kpis:has(> :nth-child(4):last-child), .ti-kpis:has(> :nth-child(5):last-child), .ti-kpis:has(> :nth-child(6):last-child), .ti-kpis:has(> :nth-child(8):last-child) { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ti-kpis > :last-child:nth-child(odd) { grid-column: span 2; }   /* impar en móvil: el último ocupa la fila entera */
  .ti-kpi { padding: 11px; } .ti-kpi-val { font-size: 1.2rem; } .ti-kpi-ico { display: none; }
  .ti-invs { grid-template-columns: 1fr; } .ti-lienzo { height: 240px; }
  .ti-tabs { width: 100%; } .ti-tabla-wrap { max-height: none; }
  .ti-fila2 { grid-template-columns: 1fr; }
  .ti-modal { padding: 0; align-items: stretch; } .ti-modal-box { border-radius: 0; max-height: 100vh; height: 100%; }
  .ti-cnt-lote-cab { display: none; }
  .ti-cnt-lote { grid-template-columns: 1fr 1fr 40px; }                     /* en el móvil: lote y caducidad arriba, cantidad debajo */
  .ti-cnt-lote > :nth-child(2), .ti-cnt-lote > :nth-child(3) { grid-column: span 2; }
  .ti-cnt-lote > :nth-child(2) { grid-column: 2 / span 2; }
  .ti-cnt-art h2 { font-size: 1.15rem; } .ti-cnt-art .balda { font-size: 1.35rem; }
  .ti-teclado button { height: 52px; }
}
@media print { .ti-cnt, .ti-modal, .ti-toast { display: none !important; } }
