/* Inventory pages (lane B2; ARCHITECTURE 9.1, 9.9, 9.10). Linked in the staff head (AddStaffStylesheet, CR-sales-001).
   Layout rule 15: no horizontal page scroll at 390 px and 1366 px; wide tables scroll inside their own box, and lists stack
   into cards below 600 px. Touch targets >= 44 px. */

.inv-page { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.inv-page > * { min-width: 0; }

.inv-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.inv-header__title { min-width: 0; flex: 1 1 260px; }
.inv-header__subtitle { margin: 4px 0 0; color: #555555; overflow-wrap: anywhere; }
.inv-header__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.inv-links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: -8px; }
.inv-links__link { display: inline-flex; align-items: center; min-height: 32px; color: #3B5E26; font-weight: 600; text-decoration: none; }
.inv-links__link:hover { text-decoration: underline; }

.inv-section { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.inv-section__title { margin: 0; font-size: 1.1rem; font-weight: 700; }
.inv-muted { color: #616161; }
.inv-small { font-size: 0.85rem; }
.inv-wrap { overflow-wrap: anywhere; }

.inv-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.inv-toolbar > .inv-field { flex: 1 1 200px; }

.inv-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px 16px; align-items: end; }
.inv-form--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.inv-form__full { grid-column: 1 / -1; }
.inv-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.inv-field label, .inv-label { font-size: 0.85rem; font-weight: 600; color: #424242; }
.inv-field select.ic-input, select.ic-input { appearance: auto; }
.inv-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.inv-check input { width: 20px; height: 20px; }
.inv-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.inv-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 8px 16px; margin: 0; }
.inv-kv > div { min-width: 0; }
.inv-kv dt { font-size: 0.8rem; color: #616161; }
.inv-kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.inv-figures { display: flex; flex-wrap: wrap; gap: 12px; }
.inv-figure { flex: 1 1 120px; padding: 12px; border: 1px solid #DADADA; border-radius: 8px; background: #FFFFFF; }
.inv-figure__value { font-size: 1.5rem; font-weight: 700; }
.inv-figure__label { font-size: 0.85rem; color: #616161; }
.inv-figure--warning { border-color: #E0A100; background: #FFF8E1; }
.inv-figure--critical { border-color: #B3261E; background: #FDECEA; }

.inv-table-wrap { width: 100%; max-width: 100%; overflow-x: auto; border: 1px solid #E0E0E0; border-radius: 8px; background: #FFFFFF; }
.inv-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.inv-table th, .inv-table td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid #EEEEEE; }
.inv-table th { font-size: 0.8rem; font-weight: 700; color: #424242; background: #F7F7F4; white-space: nowrap; }
.inv-table td.inv-num, .inv-table th.inv-num { text-align: right; white-space: nowrap; }
.inv-table tr:last-child td { border-bottom: 0; }
.inv-table a { color: #3B5E26; font-weight: 600; }
.inv-table .ic-input { height: 40px; }
.inv-table__empty { padding: 16px; color: #616161; }

@media (max-width: 599.98px) {
  .inv-table--stack thead { display: none; }
  .inv-table--stack, .inv-table--stack tbody, .inv-table--stack tr, .inv-table--stack td { display: block; width: 100%; box-sizing: border-box; }
  .inv-table--stack tr { padding: 8px 0; border-bottom: 1px solid #E0E0E0; }
  .inv-table--stack tr:last-child { border-bottom: 0; }
  .inv-table--stack td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 12px; border: 0; text-align: right; }
  .inv-table--stack td::before { content: attr(data-label); flex: 0 0 auto; font-weight: 600; color: #616161; text-align: left; }
  .inv-table--stack td.inv-num { text-align: right; }
  .inv-table--stack td:not([data-label])::before, .inv-table--stack td[data-label=""]::before { content: none; }
  .inv-table--stack td:not([data-label]) { justify-content: flex-start; text-align: left; }
}

.inv-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 12px; font-size: 0.8rem; font-weight: 700;
  background: #ECEFF1; color: #263238; white-space: nowrap; }
.inv-chip--ok { background: #E8F5E9; color: #1B5E20; }
.inv-chip--info { background: #E3F2FD; color: #0D47A1; }
.inv-chip--warning { background: #FFF3E0; color: #8A4B00; }
.inv-chip--critical { background: #FDECEA; color: #8C1D18; }
.inv-chips { display: flex; flex-wrap: wrap; gap: 4px; }

.inv-card { padding: 12px; border: 1px solid #DADADA; border-radius: 8px; background: #FFFFFF; min-width: 0; }
.inv-card--active { border-color: #538135; box-shadow: 0 0 0 2px rgba(83, 129, 53, .25); }
.inv-card__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
.inv-card__title { margin: 0; font-size: 1rem; font-weight: 700; overflow-wrap: anywhere; }
.inv-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; }

.inv-serial-grid { display: flex; flex-direction: column; gap: 8px; }
.inv-serial-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 8px; padding: 8px;
  border: 1px dashed #C8C8C8; border-radius: 6px; align-items: end; }
.inv-serial-row--empty { border-color: #E0A100; background: #FFFCF2; }
.inv-serial-row__no { grid-column: 1 / -1; font-weight: 700; font-size: 0.85rem; color: #424242; }

.inv-timeline { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.inv-timeline li { padding: 6px 10px; border-left: 3px solid #538135; background: #FAFAF7; overflow-wrap: anywhere; }

.inv-lookup__results { display: flex; flex-direction: column; gap: 10px; }
.inv-lookup__photo { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; background: #EEEEEE; flex: 0 0 auto; }
.inv-lookup__row { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.inv-lookup__body { min-width: 0; flex: 1 1 auto; }
.inv-lookup__price { font-size: 1.3rem; font-weight: 800; }
.inv-camera { width: 100%; max-width: 480px; border-radius: 8px; background: #000000; }

.inv-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.inv-thumbs img { width: 88px; height: 88px; object-fit: cover; border-radius: 6px; background: #EEEEEE; }

/* Tags and labels (/print/tags): 2.25 x 1.25 in label stock, printed on a sheet or a label printer. */
.inv-tags { display: flex; flex-wrap: wrap; gap: 0.1in; justify-content: flex-start; max-width: 100%; }
.inv-tag { box-sizing: border-box; width: 2.25in; max-width: 100%; height: 1.25in; padding: 0.06in 0.08in; border: 1px dashed #9E9E9E; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; page-break-inside: avoid; break-inside: avoid; background: #FFFFFF; color: #000000; }
.inv-tag__title { font: 700 9pt/1.15 system-ui, "Segoe UI", Arial, sans-serif; max-height: 2.3em; overflow: hidden; }
.inv-tag__detail { font: 7.5pt/1.1 system-ui, "Segoe UI", Arial, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-tag__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 4px; }
.inv-tag__price { font: 800 13pt/1 system-ui, "Segoe UI", Arial, sans-serif; white-space: nowrap; }
.inv-tag__code { flex: 1 1 auto; min-width: 0; }
.inv-tag__code svg { width: 100%; height: 0.5in; }
@media print {
  .inv-tag { border: 0; }
  .inv-tags { gap: 0; }
}
