/* ============================================================
   MonTech · Casa Médica · vista inventario
   Clases prefijadas v-inventario-…  ·  solo var(--token), nunca hex
   ============================================================ */

/* ---------- MonTech: filtros, custodia y montos por moneda ---------- */
.v-inv-barra { gap: 12px; align-items: center; }
.v-inv-chk { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-13); color: var(--text-secondary); cursor: pointer; }
.v-inv-montos { font-size: var(--fs-20); white-space: nowrap; }

/* ---------- Registrar ingreso: elegir cómo ---------- */
.v-inv-opciones { display: grid; gap: var(--s-3); }
.v-inv-opcion {
  display: flex; align-items: flex-start; gap: var(--s-3); width: 100%;
  padding: var(--s-4); text-align: left; cursor: pointer;
  background: var(--bg-surface); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--r);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.v-inv-opcion:hover { border-color: var(--brand); background: var(--brand-soft); }
.v-inv-opcion:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.v-inv-opcion > svg { width: 22px; height: 22px; flex: 0 0 auto; color: var(--brand); margin-top: 1px; }
.v-inv-opcion b { display: block; font-size: var(--fs-15); }
.v-inv-opcion small { display: block; margin-top: 2px; font-size: var(--fs-12); color: var(--text-secondary); line-height: 1.45; }

/* ---------- Escanear etiquetas ---------- */
.v-esc__visor {
  position: relative; overflow: hidden; margin-bottom: var(--s-3);
  aspect-ratio: 4 / 3; max-height: 46vh; max-height: 46dvh; width: 100%;
  background: var(--mt-navy-900); border-radius: var(--r);
  touch-action: manipulation;
}
.v-esc__visor[hidden] { display: none; }
.v-esc__visor video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* En el iPhone la imagen se copia a un lienzo encima del video (ver lector.js) */
.v-esc__visor canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* Marco del centro: ahí mira el lector */
.v-esc__marco {
  position: absolute; left: 50%; top: 50%; width: 58%; aspect-ratio: 1; max-height: 78%;
  transform: translate(-50%, -50%); border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 999px rgba(5, 12, 24, 0.38);
  border: 2px solid rgba(255, 255, 255, 0.9);
}
.v-esc__estado {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px;
  font-size: var(--fs-12); font-weight: 700; text-align: center; color: var(--mt-navy-050);
  background: linear-gradient(transparent, rgba(5, 12, 24, 0.7));
}
.v-esc__leido {
  position: absolute; left: 10px; right: 10px; bottom: 10px; display: grid; gap: 10px;
  padding: 12px; border-radius: var(--r); background: var(--bg-elevated); box-shadow: var(--sh-3);
  border-left: 3px solid var(--ok);
}
.v-esc__leido.is-warn { border-left-color: var(--warn); }
.v-esc__leido[hidden] { display: none; }
.v-esc__leido-txt { font-size: var(--fs-13); font-weight: 700; line-height: 1.4; }

.v-esc__botones { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.v-esc__botones .btn { flex: 1 1 180px; }
.v-esc__subir { position: relative; overflow: hidden; cursor: pointer; }
/* El selector de archivo va invisible dentro del botón (iPhone no abre uno oculto con display:none) */
.v-esc__archivo { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.v-esc__subir:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }

.v-esc__aviso { min-height: 0; margin: var(--s-2) 0 0; font-size: var(--fs-12); color: var(--text-secondary); }
.v-esc__aviso:empty { display: none; }
.v-esc__aviso.is-warn { color: var(--warn-ink); }
.v-esc__aviso.is-ok { color: var(--ok-ink); }

.v-esc__titulo { display: flex; align-items: baseline; justify-content: space-between; margin: var(--s-4) 0 var(--s-2); font-size: var(--fs-13); }
.v-esc__titulo span { color: var(--text-muted); font-size: var(--fs-12); }
.v-esc__vacio {
  margin-top: var(--s-4); padding: var(--s-4); text-align: center;
  font-size: var(--fs-12); color: var(--text-muted);
  border: 1px dashed var(--border-strong); border-radius: var(--r);
}
.v-esc__fila {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; gap: var(--s-3);
  padding: var(--s-3) 0; border-top: 1px solid var(--border);
}
.v-esc__fila.is-falta .v-esc__info > b { color: var(--warn-ink); }
.v-esc__info { display: grid; gap: 4px; min-width: 0; }
.v-esc__info > b { font-size: var(--fs-13); line-height: 1.35; }
.v-esc__datos { font-size: var(--fs-12); color: var(--text-muted); overflow-wrap: anywhere; }
.v-esc__nota { font-size: var(--fs-11); color: var(--warn-ink); font-weight: 700; }
.v-esc__nota--info { color: var(--text-secondary); font-weight: 600; }
.v-esc__campo { display: grid; gap: 3px; margin-top: 4px; font-size: var(--fs-11); font-weight: 700; color: var(--text-secondary); }
.v-esc__info .select { margin-top: 4px; }
.v-esc__cant { display: flex; align-items: center; gap: 2px; }
.v-esc__cant .input { width: 52px; height: 34px; padding: 0 4px; text-align: center; font-variant-numeric: tabular-nums; }
.v-esc__cant > b { min-width: 34px; text-align: center; font-size: var(--fs-15); font-variant-numeric: tabular-nums; }
.v-esc__cant .iconbtn { width: 34px; height: 34px; }
.v-esc__quitar { width: 34px; height: 34px; color: var(--text-muted); }

@media (max-width: 640px) {
  .v-esc__fila { grid-template-columns: minmax(0, 1fr) auto; }
  .v-esc__cant { grid-column: 1; grid-row: 2; }
  .v-esc__quitar { grid-column: 2; grid-row: 1; }
}
