/* Listados con filtros, paginación y selección, y formularios de administración. */

/* --- Listados con filtros y paginación (historial de ventas, ingresos) ----------- */

.filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  align-items: flex-end;
}

.filtros label {
  flex: 1 1 10rem;
  margin-bottom: 0;
}

.filtros .botones {
  flex-wrap: nowrap;
  margin-bottom: var(--pico-spacing);
}

.totales-filtro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.tabla-clic tbody tr {
  cursor: pointer;
}

.tabla-clic tbody tr:hover td {
  background: var(--azul-suave);
}

tr.anulada .monto {
  color: var(--texto-suave);
  text-decoration: line-through;
}

.paginacion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.paginacion [role="button"] {
  margin: 0;
  padding: 0.4rem 0.9rem;
}

/* --- Formularios de administración ------------------------------------------------ */

.fila-campos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  gap: 0 1rem;
}

.barra .acciones {
  display: flex;
  gap: 0.5rem;
}

.barra .acciones [role="button"] {
  margin: 0;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

[role="button"].exito {
  border-color: var(--verde);
  background: var(--verde);
}

fieldset.roles label {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--borde);
  border-radius: 8px;
}

fieldset.roles label:has(input:checked) {
  border-color: var(--azul);
  background: var(--azul-suave);
}

.barra-seleccion button {
  width: auto;
  margin: 0;
  padding: 0.35rem 0.8rem;
  font-size: 0.9rem;
}

.columna-tilde {
  width: 2.5rem;
}

form.aplicar-ajuste {
  margin-top: 1rem;
}

.del-filtro {
  font-size: 0.9rem;
}

label.casilla {
  margin-bottom: 0.25rem;
}

small.ayuda-casilla {
  display: block;
  margin: 0 0 var(--pico-spacing) 1.9rem;
  color: var(--texto-suave);
}

/* --- Stock: tipos de movimiento y lotes -------------------------------------------- */

.tipo-ingreso {
  background: var(--verde-suave);
  color: var(--verde);
}

.tipo-venta {
  background: var(--azul-suave);
  color: var(--azul);
}

.tipo-ajuste {
  background: var(--ambar-suave);
  color: var(--ambar);
}

.tipo-baja_vencimiento {
  background: var(--rojo-suave);
  color: var(--rojo);
}

td.cantidad-positiva {
  color: var(--verde);
  font-weight: 600;
}

td.cantidad-negativa {
  color: var(--rojo);
  font-weight: 600;
}

.lote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--borde);
}

.lote > div:first-child {
  flex: 1;
}

.lote-cantidad {
  font-weight: 700;
}

.lote button,
.lote summary[role="button"] {
  width: auto;
  margin: 0;
  padding: 0.35rem 0.8rem;
  font-size: 0.9rem;
}

details.ajustar summary {
  display: inline-block;
}

details.ajustar[open] {
  flex-basis: 100%;
}

td.sin-corte {
  white-space: nowrap;
}

details.ajustar form {
  margin-top: 0.75rem;
}
