/* The inventory screens (UI-6), on the shell's tokens. */

/* Filters above a list: one row of fields that wraps. */
.inventory-filter { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.inventory-filter .field { flex: 0 1 180px; min-width: 140px; }
.inventory-filter .field--grow { flex: 1 1 260px; }

/* A page made of panels. */
.inventory-page { display: flex; flex-direction: column; gap: 16px; }

/* Stock on hand: a serialized row expands to its units. */
.stock-table td { vertical-align: top; }
.stock-units { margin-top: 4px; }
.stock-units summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.stock-units__list { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.stock-units__list li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.stock-units__list .num { margin-left: auto; color: var(--warn-ink); }

/* Older / newer pages of the ledger. */
.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

/* A cost typed into a table cell. */
.inline-cost { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.inline-cost .input--num { max-width: 110px; }

/* Unit statuses and reservations. */
.badge--unit-consumed, .badge--unit-dismantled, .badge--unit-returned_to_supplier { background: var(--bg-muted); color: var(--ink-muted); }
.badge--reservation-active { background: var(--info-bg); color: var(--info-ink); }
.badge--reservation-expired { background: var(--warn-bg); color: var(--warn-ink); }
.badge--reservation-released { background: var(--bg-muted); color: var(--ink-muted); }

/* Count lines: missing in red, found in green. */
#count_lines tr.is-short td, #count_lines tr.is-over td { font-weight: 600; }

/* The dispatch note (inventory/transfers/print, without the shell). */
.dispatch__signatures { display: flex; justify-content: space-between; gap: 24px; margin-top: 48px; }

@media (max-width: 900px) {
  .inventory-filter .field { flex: 1 1 100%; }
}

/* A stone left out of a dismantle, added back by hand. */
.left-out { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.left-out:last-child { border-bottom: 0; }

/* The item editor (WP-25): one form, several sections, the pieces as collapsible blocks. */
.editor .form__row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.editor .form__row .field { flex: 0 1 160px; min-width: 120px; }
.editor .form__row .field--grow { flex: 1 1 220px; }
.editor .form__row .checkbox { flex: 0 0 auto; }
.editor__section { display: flex; flex-direction: column; gap: 10px; }
.editor__section + .editor__section { margin-top: 12px; }
.editor .input--short { max-width: 90px; }
.editor .input--static { display: inline-block; background: var(--bg-muted); color: var(--ink-muted); }
.editor__unit { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-muted); margin-top: 10px; }
.editor__unit-summary { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; padding: 10px 14px; cursor: pointer; list-style: none; }
.editor__unit-summary::-webkit-details-marker { display: none; }
.editor__unit-summary::before { content: "+"; color: var(--accent); font-weight: 700; }
.editor__unit[open] > .editor__unit-summary::before { content: "−"; }
.editor__unit-summary .num { margin-left: auto; }
.editor__unit-body { display: flex; flex-direction: column; gap: 10px; padding: 0 14px 14px; }
.editor__stones th, .editor__stones td { padding: 4px 6px; vertical-align: bottom; }
.editor__stones .input { min-width: 70px; }
.editor__price { white-space: nowrap; }
.editor__price .input { display: inline-block; width: auto; }

/* The costing of a manufactured good (WP-26): stone and part rows outside the form, the new-stone fields folded, the sum by group. */
.editor .recipe-editor__row { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.editor .recipe-editor__row:last-child { border-bottom: 0; }
.editor__new-stone { margin-top: 4px; }
.editor__new-stone > summary { cursor: pointer; }
.editor__summary { margin-top: 16px; max-width: 480px; }
.editor__summary .figures-table th { text-align: left; font-weight: 400; padding: 4px 8px; }
.editor__summary .figures-table td { padding: 4px 8px; }
.editor__summary .figures-table tfoot th { font-weight: 700; border-top: 1px solid var(--line); }

/* The products list: an item row, then its pieces folded under it. */
.products td { vertical-align: top; }
.products .product__maker { display: block; font-size: 12px; }
.products .product__places { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.products .product__places li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.products tr.product--with-pieces > td { border-bottom: 0; }
.products tr.product-pieces > td { padding-top: 0; }
.products tr.product-pieces summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.products tr.product-pieces .table-wrap { margin: 6px 0 4px; }
.inventory-filter .check { display: inline-flex; gap: 6px; align-items: center; height: var(--control-h); }
.pieces .pieces__actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
