/* Inventario EDS Zumbico · identidad rojo + amarillo + crema · mobile-first */
:root {
  --rojo: #C8102E; --rojo-oscuro: #9E0B22; --rojo-tinte: #FBE3E6;
  --amarillo: #FFC20E; --amarillo-oscuro: #8A6400; --amarillo-tinte: #FFF3C4;
  --crema: #FFF8E7; --crema-2: #F7ECD2; --blanco: #FFFFFF;
  --tinta: #1F1B16; --tinta-2: #5C5347; --tinta-3: #8A8072; --linea: #E8DCC3; --linea-2: #F1E8D6;
  --ok: #1B7A3E; --ok-tinte: #DFF3E5; --bajo: #8A6400; --bajo-tinte: #FFF3C4; --agotado: #B3261E; --agotado-tinte: #FBE3E6;
  --radio: 14px; --radio-s: 10px; --sombra: 0 1px 2px rgba(31,27,22,.06), 0 6px 18px rgba(31,27,22,.06);
  --nav-h: 66px; --top-h: 56px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--crema); color: var(--tinta); line-height: 1.45; font-size: 16px; }
a { color: var(--rojo); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
h2 { font-size: 17px; font-weight: 800; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
.ico { width: 22px; height: 22px; flex-shrink: 0; }
.oculto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--tinta-2); font-size: 13px; }
.mini { font-size: 12px; color: var(--tinta-3); }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tabnum { font-variant-numeric: tabular-nums; }

/* Layout */
#app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top-h); background: var(--rojo); color: #fff; display: flex; align-items: center; gap: 8px; padding: 0 12px; box-shadow: 0 2px 8px rgba(158,11,34,.25); }
.topbar .marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; min-height: 44px; }
.topbar .marca-logo { width: 34px; height: 34px; border-radius: 9px; background: var(--amarillo); color: var(--rojo-oscuro); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13px; letter-spacing: .5px; }
.topbar .marca-txt { display: flex; flex-direction: column; line-height: 1.05; }
.topbar .marca-txt b { font-size: 15px; font-weight: 800; }
.topbar .marca-txt span { font-size: 11px; opacity: .9; font-weight: 600; }
.topbar .espacio { flex-grow: 1; }
.topbar .btn-icono { color: #fff; }
.topbar .usuario-chip { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.14); border-radius: 999px; padding: 4px 10px 4px 4px; font-size: 13px; font-weight: 700; min-height: 36px; }
.topbar .usuario-chip .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--amarillo); color: var(--rojo-oscuro); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13px; }
.sin-conexion { background: var(--amarillo); color: var(--tinta); font-size: 12px; font-weight: 700; text-align: center; padding: 4px 8px; }
main#vista { flex-grow: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 14px 14px calc(var(--nav-h) + 20px); }
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; height: var(--nav-h); background: var(--blanco); border-top: 1px solid var(--linea); display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--tinta-2); font-size: 11px; font-weight: 700; border-radius: 10px; min-height: 44px; }
.bottomnav a.activo { color: var(--rojo); }
.bottomnav a.central { color: var(--rojo-oscuro); }
.bottomnav a.central .ico-central { width: 50px; height: 50px; margin-top: -26px; border-radius: 50%; background: var(--amarillo); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(138,100,0,.35); border: 4px solid var(--blanco); }
.bottomnav a.central .ico-central .ico { width: 26px; height: 26px; }
.sidebar { display: none; }

@media (min-width: 1024px) {
  #app-shell { flex-direction: row; }
  .topbar { display: none; }
  .sidebar { display: flex; flex-direction: column; justify-content: space-between; width: 250px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; background: var(--blanco); border-right: 1px solid var(--linea); padding: 22px 14px; }
  .sidebar .marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tinta); padding: 0 8px 18px; }
  .sidebar .marca-logo { width: 38px; height: 38px; border-radius: 10px; background: var(--rojo); color: var(--amarillo); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 14px; }
  .sidebar .marca-txt { display: flex; flex-direction: column; line-height: 1.1; }
  .sidebar .marca-txt b { font-size: 15px; font-weight: 800; }
  .sidebar .marca-txt span { font-size: 11px; color: var(--tinta-3); font-weight: 700; }
  .sidebar nav { display: flex; flex-direction: column; gap: 2px; }
  .sidebar nav a { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border-radius: 10px; text-decoration: none; color: var(--tinta-2); font-size: 14px; font-weight: 600; }
  .sidebar nav a.activo { background: var(--rojo-tinte); color: var(--rojo-oscuro); font-weight: 800; }
  .sidebar nav a .ico { width: 20px; height: 20px; }
  .sidebar .seccion { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--tinta-3); padding: 14px 12px 6px; }
  .sidebar .pie { display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid var(--linea-2); }
  .sidebar .pie .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--amarillo-tinte); color: var(--amarillo-oscuro); display: flex; align-items: center; justify-content: center; font-weight: 900; }
  .sidebar .pie .nombre { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; font-size: 13px; font-weight: 700; }
  .sidebar .pie .nombre span { font-size: 11px; color: var(--tinta-3); font-weight: 600; }
  main#vista { max-width: 1100px; padding: 28px 32px 40px; }
  .bottomnav { display: none; }
  .solo-movil { display: none !important; }
}

/* Cabecera de vista */
.vista-cab { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; min-height: 44px; }
.vista-cab .titulos { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.vista-cab .titulos .sub { font-size: 13px; color: var(--tinta-2); font-weight: 600; }
.btn-icono { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--tinta); text-decoration: none; padding: 0; }
.btn-icono:hover { background: rgba(31,27,22,.06); }
.btn-icono.atras { margin-left: -10px; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 800; font-size: 15px; cursor: pointer; text-decoration: none; transition: background .15s; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--rojo); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--rojo-oscuro); }
.btn-amarillo { background: var(--amarillo); color: var(--tinta); }
.btn-amarillo:hover:not(:disabled) { background: #E8B000; }
.btn-secondary { background: var(--blanco); color: var(--tinta); border-color: var(--linea); }
.btn-secondary:hover:not(:disabled) { background: var(--crema-2); }
.btn-ghost { background: transparent; color: var(--tinta-2); }
.btn-danger { background: var(--agotado); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--agotado); border-color: #F2B8B1; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-bloque { width: 100%; }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-xl { min-height: 56px; font-size: 16px; }
.acciones { display: grid; gap: 10px; }
.acciones.dos { grid-template-columns: 1fr 1fr; }
.acciones.tres { grid-template-columns: 1fr 1fr 1fr; }
.acciones.tres .btn { padding: 0 8px; font-size: 14px; gap: 6px; }
.acciones.tres .btn .ico { width: 18px; height: 18px; }
.fila-botones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Tarjetas */
.card { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); padding: 16px; box-shadow: var(--sombra); }
.card + .card, .card + .grid, .grid + .card { margin-top: 12px; }
.card-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 720px) { .grid-md-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-md-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-md-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .grid-md-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* Inicio: buscador grande y mosaico */
.hero-buscar { background: var(--blanco); border: 2px solid var(--amarillo); border-radius: 18px; padding: 14px; box-shadow: var(--sombra); }
.hero-buscar .titulo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; margin-bottom: 10px; color: var(--rojo-oscuro); }
.campo-buscar { position: relative; display: flex; }
.campo-buscar .ico-izq { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--tinta-3); }
.campo-buscar input { width: 100%; height: 54px; border: 1px solid var(--linea); border-radius: 14px; padding: 0 54px 0 46px; font-size: 17px; background: var(--crema); }
.campo-buscar input:focus { outline: 3px solid rgba(200,16,46,.18); border-color: var(--rojo); background: #fff; }
.campo-buscar .btn-cam { position: absolute; right: 5px; top: 5px; width: 44px; height: 44px; border-radius: 11px; border: 0; background: var(--amarillo); color: var(--tinta); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.mosaico { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
@media (min-width: 560px) { .mosaico { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mosaico a { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); padding: 14px; text-decoration: none; color: var(--tinta); min-height: 96px; box-shadow: var(--sombra); }
.mosaico a .ico-caja { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--rojo-tinte); color: var(--rojo); }
.mosaico a.amarillo .ico-caja { background: var(--amarillo-tinte); color: var(--amarillo-oscuro); }
.mosaico a b { font-size: 14px; font-weight: 800; }
.mosaico a small { font-size: 12px; color: var(--tinta-3); }

/* KPI */
.kpi { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); padding: 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--sombra); }
.kpi .eti { font-size: 12px; font-weight: 700; color: var(--tinta-2); }
.kpi .val { font-size: 28px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--tinta-3); }
.kpi.bajo .val { color: var(--bajo); } .kpi.agotado .val { color: var(--agotado); } .kpi.ok .val { color: var(--ok); }

/* Listas de productos */
.lista { display: flex; flex-direction: column; gap: 8px; }
.item-prod { display: flex; align-items: center; gap: 12px; background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); padding: 12px 14px; text-decoration: none; color: var(--tinta); min-height: 64px; }
.item-prod:hover { border-color: #D8C9A3; }
.item-prod .info { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item-prod .nombre { font-weight: 700; font-size: 14px; line-height: 1.25; }
.item-prod .cod { font-size: 12px; color: var(--tinta-3); font-variant-numeric: tabular-nums; }
.item-prod .stock { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.item-prod .stock b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.badge-ok { background: var(--ok-tinte); color: var(--ok); }
.badge-bajo { background: var(--bajo-tinte); color: var(--bajo); }
.badge-agotado { background: var(--agotado-tinte); color: var(--agotado); }
.badge-neutro { background: var(--crema-2); color: var(--tinta-2); }
.badge-rojo { background: var(--rojo-tinte); color: var(--rojo-oscuro); }
.badge-amarillo { background: var(--amarillo-tinte); color: var(--amarillo-oscuro); }
.badge-pend { background: #EAE3FF; color: #4B2FA5; }
.punto { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.punto.ok { background: var(--ok); } .punto.bajo { background: #E0A400; } .punto.agotado { background: var(--agotado); }

/* Ficha de producto */
.ficha-cab { display: flex; flex-direction: column; gap: 8px; }
.ficha-cab .nombre { font-size: 20px; font-weight: 800; line-height: 1.2; }
.ficha-stock { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ficha-stock .celda { background: var(--crema); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.ficha-stock .celda .eti { font-size: 11px; font-weight: 800; color: var(--tinta-3); text-transform: uppercase; letter-spacing: .4px; }
.ficha-stock .celda .val { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.datos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.datos .d { display: flex; flex-direction: column; gap: 1px; }
.datos .d .eti { font-size: 11px; color: var(--tinta-3); font-weight: 700; }
.datos .d .val { font-size: 14px; font-weight: 600; word-break: break-word; }
.sugerencia { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--amarillo-oscuro); background: var(--amarillo-tinte); border-radius: 8px; padding: 3px 8px; }
.sugerencia button { border: 0; background: var(--amarillo); border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 800; cursor: pointer; min-height: 28px; }

/* Formularios */
.form { display: flex; flex-direction: column; gap: 14px; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > span, .campo > label { font-size: 13px; font-weight: 700; }
.campo .ayuda { font-size: 12px; color: var(--tinta-3); font-weight: 500; }
.campo input, .campo select, .campo textarea { min-height: 48px; border: 1px solid #D8CBAA; border-radius: 12px; padding: 10px 14px; background: #fff; font-size: 16px; width: 100%; }
.campo textarea { min-height: 84px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: 3px solid rgba(200,16,46,.16); border-color: var(--rojo); }
.campo input[readonly] { background: var(--crema); color: var(--tinta-2); }
.campo.error input, .campo.error select { border-color: var(--agotado); }
.campo .msg-error { font-size: 12px; color: var(--agotado); font-weight: 700; }
.fila-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 54px; height: 54px; border-radius: 14px; border: 1px solid #D8CBAA; background: #fff; font-size: 26px; font-weight: 800; cursor: pointer; }
.stepper button.mas { background: var(--amarillo-tinte); border-color: var(--amarillo); }
.stepper input { flex-grow: 1; height: 54px; text-align: center; font-size: 26px; font-weight: 800; border: 1px solid #D8CBAA; border-radius: 14px; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid #D8CBAA; background: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
.chip.activo { background: var(--rojo); color: #fff; border-color: var(--rojo); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 600; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--rojo); margin: 2px 0 0; flex-shrink: 0; }
.aviso { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.aviso .ico { margin-top: 1px; }
.aviso-info { background: #EAF2FF; color: #1F3F7A; }
.aviso-alerta { background: var(--amarillo-tinte); color: var(--amarillo-oscuro); }
.aviso-peligro { background: var(--agotado-tinte); color: var(--agotado); }
.aviso-ok { background: var(--ok-tinte); color: var(--ok); }
.barra-fija { position: sticky; bottom: calc(var(--nav-h) + 8px); background: var(--crema); padding-top: 8px; }
@media (min-width: 1024px) { .barra-fija { bottom: 12px; } }

/* Selector de producto (dentro de formularios) */
.prod-sel { display: flex; align-items: center; gap: 12px; background: var(--crema); border: 1px solid var(--linea); border-radius: 12px; padding: 10px 12px; }
.prod-sel .info { flex-grow: 1; min-width: 0; }
.prod-sel .info b { display: block; font-size: 14px; }
.prod-sel .info span { font-size: 12px; color: var(--tinta-3); }
.resultados { position: relative; }
.resultados .desplegable { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--linea); border-radius: 12px; box-shadow: var(--sombra); max-height: 300px; overflow: auto; }
.resultados .desplegable button { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 10px; text-align: left; border: 0; background: transparent; padding: 10px 14px; min-height: 48px; cursor: pointer; border-bottom: 1px solid var(--linea-2); font-size: 14px; }
.resultados .desplegable button:hover { background: var(--crema); }
.resultados .desplegable button small { color: var(--tinta-3); display: block; font-size: 12px; }
.resultados .desplegable .vacio { padding: 12px 14px; font-size: 13px; color: var(--tinta-2); }

/* Tablas */
.tabla-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tabla th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--tinta-3); padding: 8px 8px; border-bottom: 1px solid var(--linea); white-space: nowrap; }
table.tabla td { padding: 9px 8px; border-bottom: 1px solid var(--linea-2); vertical-align: top; }
table.tabla td.num, table.tabla th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tabla tr.tachado td { color: var(--tinta-3); }

/* Movimientos */
.mov { display: flex; gap: 12px; align-items: flex-start; background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); padding: 12px 14px; }
.mov .tipo { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mov .tipo.ENTRADA { background: var(--ok-tinte); color: var(--ok); }
.mov .tipo.SALIDA { background: var(--rojo-tinte); color: var(--rojo); }
.mov .tipo.AJUSTE { background: var(--amarillo-tinte); color: var(--amarillo-oscuro); }
.mov .tipo.IMPORTACION { background: #EAF2FF; color: #1F3F7A; }
.mov .tipo.CORRECCION { background: #EAE3FF; color: #4B2FA5; }
.mov .cuerpo { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mov .cuerpo .l1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.mov .cuerpo .l1 b { font-size: 14px; }
.mov .cuerpo .cant { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mov .cuerpo .cant.pos { color: var(--ok); } .mov .cuerpo .cant.neg { color: var(--rojo); }
.mov .cuerpo .meta { font-size: 12px; color: var(--tinta-3); }
.mov.corregido { opacity: .7; }

/* Escáner */
.escaner-marco { position: relative; background: #000; border-radius: 16px; overflow: hidden; min-height: 300px; }
.escaner-marco video { width: 100%; display: block; }
#lector { width: 100%; }
#lector video { border-radius: 16px; }
.escaner-ayuda { text-align: center; font-size: 13px; color: var(--tinta-2); margin-top: 10px; }
.entrada-manual { display: flex; gap: 8px; margin-top: 12px; }
.entrada-manual input { flex-grow: 1; min-height: 48px; border: 1px solid #D8CBAA; border-radius: 12px; padding: 0 14px; font-size: 16px; }

/* Conteo */
.conteo-linea { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--linea); border-radius: var(--radio); padding: 12px 14px; }
.conteo-linea .difs { display: flex; gap: 10px; font-size: 12px; color: var(--tinta-3); flex-wrap: wrap; }
.dif-pos { color: var(--ok); font-weight: 800; } .dif-neg { color: var(--rojo); font-weight: 800; } .dif-cero { color: var(--tinta-3); font-weight: 700; }

/* Gráficos */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: inherit; }
.leyenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--tinta-2); margin-top: 6px; }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.barras-h { display: flex; flex-direction: column; gap: 8px; }
.barras-h .fila { display: grid; grid-template-columns: minmax(90px, 40%) 1fr 44px; gap: 8px; align-items: center; font-size: 13px; }
.barras-h .fila .eti { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.barras-h .fila .pista { height: 14px; background: var(--crema-2); border-radius: 4px; overflow: hidden; }
.barras-h .fila .pista i { display: block; height: 100%; background: var(--rojo); border-radius: 0 4px 4px 0; }
.barras-h .fila .pista i.amarillo { background: var(--amarillo); }
.barras-h .fila .num { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Diálogos y toasts */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(31,27,22,.45); display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
@media (min-width: 600px) { .overlay { align-items: center; } }
.dialog { background: #fff; border-radius: 18px; padding: 20px; width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 14px; max-height: 90vh; overflow: auto; }
.dialog h2 { font-size: 18px; }
.dialog-body { font-size: 14px; color: var(--tinta-2); line-height: 1.5; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }
#toasts { position: fixed; top: 12px; left: 12px; right: 12px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
@media (min-width: 600px) { #toasts { left: auto; width: 380px; } }
.toast { background: var(--tinta); color: #fff; border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 600; box-shadow: var(--sombra); animation: toast-in .2s ease-out; }
.toast.out { opacity: 0; transition: opacity .3s; }
.toast-ok { background: var(--ok); } .toast-error { background: var(--agotado); } .toast-alerta { background: var(--amarillo); color: var(--tinta); }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Login */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 28px 20px; background: linear-gradient(180deg, var(--crema) 0%, var(--crema-2) 100%); }
.login-caja { width: 100%; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.login-marca { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.login-marca .logo { width: 76px; height: 76px; border-radius: 22px; background: var(--rojo); color: var(--amarillo); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 26px; box-shadow: 0 8px 20px rgba(158,11,34,.3); }
.login-marca h1 { font-size: 24px; }
.login-marca p { color: var(--tinta-2); font-size: 14px; font-weight: 600; }
.login-pie { text-align: center; font-size: 12px; color: var(--tinta-3); }

/* Etiquetas para impresión */
.etiquetas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.etiqueta { border: 1px dashed #C9B98F; border-radius: 8px; padding: 8px; text-align: center; background: #fff; }
.etiqueta .n { font-size: 11px; font-weight: 700; line-height: 1.2; min-height: 26px; }
.etiqueta svg { width: 100%; height: 56px; }
.etiqueta .c { font-size: 11px; font-variant-numeric: tabular-nums; }
@media print {
  body { background: #fff; }
  .topbar, .bottomnav, .sidebar, .no-print { display: none !important; }
  main#vista { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .etiquetas-grid { grid-template-columns: repeat(3, 1fr); }
}
.vacio-estado { text-align: center; padding: 28px 12px; color: var(--tinta-2); font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.vacio-estado .ico { width: 34px; height: 34px; color: var(--tinta-3); }
.filtros { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filtros .campo input, .filtros .campo select { min-height: 42px; font-size: 14px; padding: 6px 10px; }
.filtros .campo > span { font-size: 12px; }
.filtros .ancho { grid-column: 1 / -1; }
@media (min-width: 720px) { .filtros { grid-template-columns: repeat(4, minmax(0, 1fr)); } .filtros .ancho { grid-column: span 2; } }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; }
.tabs button { flex-shrink: 0; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--linea); background: #fff; font-weight: 700; font-size: 13px; cursor: pointer; }
.tabs button.activo { background: var(--tinta); color: #fff; border-color: var(--tinta); }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.timeline .ev { display: flex; gap: 10px; font-size: 13px; }
.timeline .ev i { width: 10px; height: 10px; border-radius: 50%; background: var(--rojo); margin-top: 5px; flex-shrink: 0; }
.timeline .ev .t { display: flex; flex-direction: column; gap: 1px; }
.timeline .ev .t small { color: var(--tinta-3); }
.progreso { height: 8px; background: var(--crema-2); border-radius: 999px; overflow: hidden; }
.progreso i { display: block; height: 100%; background: var(--rojo); }
.numero-grande { font-size: 40px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
