/* Admin → Inventory and Admin → Reorder (src/views-inventory.js) */
.inv-panel { background: var(--surface); padding: 20px 22px; }
.inv-panel h2 { margin-bottom: 6px; }
.inv-upload { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 6px; }
.inv-upload input[type=file] { flex: 1 1 260px; min-width: 0; max-width: 100%; min-height: 44px; padding: 8px; border: 1px dashed var(--line); border-radius: calc(var(--radius) * .7); background: var(--bg); font: inherit; }
.inv-needs ul { margin: 8px 0 0; padding-left: 1.2em; display: grid; gap: 4px; }

/* position: relative keeps the hidden labels inside the scroll box, so wide tables never widen the page */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 16px 0; }
.table-wrap .table { margin: 0; }
.inv-table { font-size: .92rem; }
.inv-table th, .inv-table td { padding: 9px 8px; }
.inv-table td:last-child { text-align: left; }
.inv-table .num, .inv-table td.num:last-child, .inv-table tfoot td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-table tbody th { font-weight: 500; }
.inv-lines td { vertical-align: top; }
.inv-lines input:not([type=checkbox]), .inv-lines select { min-height: 40px; padding: 7px 9px; }
.inv-lines select { min-width: 170px; }
.inv-lines [data-newname] { margin-top: 6px; }
.inv-lines [data-newname][hidden] { display: none; }
.inv-lines .check { margin: 8px 0 0; }
.inv-num { width: 6.5em !important; text-align: right; font-variant-numeric: tabular-nums; }
.inv-src { min-width: 180px; max-width: 320px; font-size: .85rem; color: var(--muted); }
.inv-src span:first-child { display: block; overflow-wrap: anywhere; }
.is-new { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.tag { display: inline-block; margin-top: 4px; font-size: .72rem; font-weight: 600; letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--text); white-space: nowrap; }
.tag-new { background: #FEF0C7; color: #93370D; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.nowrap { white-space: nowrap; }
.inv-skipped { margin: 0; padding-left: 1.2em; font-size: .85rem; color: var(--muted); display: grid; gap: 2px; }

.inv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.inv-grid .field.wide { grid-column: 1 / -1; }
.inv-review { max-width: none; margin-bottom: 36px; }
.inv-review fieldset { margin: 20px 0; }

.inv-settings { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; margin-bottom: 12px; }
.inv-settings .field label { font-size: .875rem; font-weight: 500; }
.inv-settings .inline input { width: 5em; flex: none; }

.inv-supplier { display: grid; grid-template-columns: 1.6fr 1fr 1.6fr auto; gap: 10px; align-items: end; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.inv-supplier:last-child { border-bottom: 0; }
.inv-supplier-name { font-weight: 500; padding-bottom: 12px; }
.inv-supplier input { min-height: 40px; }

.status.po-draft { background: #E0EAFF; color: #3538CD; }
.status.po-sent { background: #FEF0C7; color: #93370D; }
.status.po-received { background: #D1FADF; color: #05603A; }
.theme-midnight .tag-new, .theme-midnight .status.po-sent { background: #4a3410; color: #FEDF89; }
.theme-midnight .status.po-draft { background: #1f2a5c; color: #C7D7FE; }
.theme-midnight .status.po-received { background: #0b3b26; color: #A6F4C5; }

.po-sheet { max-width: 760px; }
.po-sheet table { width: 100%; }
@media print {
  .no-print, .skip, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .po-sheet { padding: 0; max-width: none; }
}

@media (max-width: 860px) {
  .inv-grid { grid-template-columns: 1fr 1fr; }
  .inv-supplier { grid-template-columns: 1fr 1fr; }
  .inv-supplier > .field:first-of-type { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .inv-grid { grid-template-columns: 1fr; }
  .inv-upload .btn { flex: 1 1 auto; }
  .inv-settings .field { flex: 1 1 40%; }
  .inv-supplier { grid-template-columns: 1fr; }
  .inv-src { min-width: 140px; }
}
