/* Contagem de inventário, entry form (Blazor only, wms-inventory "Blazor: Contagem de inventário"); layout only, sizes in forms.css.
   Every caption stays on one line, so the inputs of the row share the same top: each column is at least as wide as its caption (min-content of a
   nowrap label; the hint under a field still wraps and never widens the column, unlike max-content, which a long product description would blow up).
   In an apartment that fractions, the "Unidades avulsas" checkbox gets its own column between the validity and the quantity (React put it in the
   5-column grid and pushed "Lançar" to a new row), aligned with the inputs. Loaded after inventory.css: the 2-column rule of narrow screens is
   repeated here, otherwise these templates would win over it. */
.inventory-count-entry {
    grid-template-columns: minmax(min-content, 1.6fr) minmax(min-content, 1fr) minmax(min-content, 1fr) minmax(min-content, .9fr) auto
}

/* Apartment that fractions: six items did not fit one row of the sheet (~770 px at 1600 px wide: "Lote" shrank to 24 px and "Lançar" spilled
   out of the form, measured 2026-10-05). Two rows instead: product, batch, validity on the first; "Unidades avulsas" (under product + batch),
   quantity and "Lançar" on the second, with the quantity under the validity. */
.inventory-count-entry.is-fraction {
    grid-template-columns: minmax(min-content, 1.6fr) minmax(min-content, 1fr) minmax(min-content, 1fr) auto
}

.inventory-count-entry.is-fraction > .inventory-loose-toggle {
    grid-column: 1 / span 2;
    grid-row: 2
}

.inventory-count-entry.is-fraction > .user-field:nth-child(5) {
    grid-column: 3;
    grid-row: 2
}

.inventory-count-entry.is-fraction > .inventory-entry-save {
    grid-column: 4;
    grid-row: 2
}

.inventory-count-entry .user-field label {
    white-space: nowrap
}

.inventory-count-entry .inventory-loose-toggle {
    margin: 19px 0 0;
    min-height: var(--field-height);
    white-space: nowrap
}

.inventory-count-entry .inventory-loose-toggle input {
    margin: 0
}

@media(max-width:1300px) {

    .inventory-count-entry,
    .inventory-count-entry.is-fraction {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .inventory-count-entry .user-field label {
        white-space: normal
    }

    .inventory-count-entry .inventory-loose-toggle {
        margin-top: 0;
        white-space: normal
    }

    .inventory-count-entry.is-fraction > .inventory-loose-toggle,
    .inventory-count-entry.is-fraction > .user-field:nth-child(5),
    .inventory-count-entry.is-fraction > .inventory-entry-save {
        grid-column: auto;
        grid-row: auto
    }
}
