.inventory-page { max-width: none; }
.inventory-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.inventory-search { display: flex; align-items: center; flex: 1; gap: 12px; min-width: 0; }
.inventory-search-control { position: relative; flex: 0 1 360px; min-width: 0; }
.inventory-search-control > svg { position: absolute; top: 50%; left: 12px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.inventory-search .text-input { width: 100%; min-width: 0; height: 38px; min-height: 38px; padding: 8px 12px 8px 36px; font-size: var(--text-dense); }
.inventory-tools > .text-link { white-space: nowrap; font-size: var(--text-dense); }
.inventory-sheet-caption { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; color: var(--muted); font-size: var(--text-meta); }
.inventory-sheet-caption > p { margin: 0; }
.inventory-guide { position: relative; flex: 0 0 auto; }
.inventory-guide > summary { min-height: 36px; display: flex; align-items: center; cursor: pointer; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.inventory-guide > summary:hover { color: var(--accent); }
.inventory-guide > p { position: absolute; right: 0; top: 100%; z-index: 6; width: min(360px, calc(100vw - 40px)); margin: 0; padding: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-menu); font-size: var(--text-dense); line-height: 1.6; }
.inventory-sheet-scroll { width: 100%; height: var(--inventory-draft-height, auto); max-height: calc(100dvh - 300px); min-height: 180px; overflow: auto; border: 1px solid var(--line); background: var(--surface); padding-bottom: var(--inventory-draft-clearance, 0px); }
.inventory-sheet { --inventory-actions-width: 88px; width: 100%; min-width: 1040px; border-spacing: 0; table-layout: fixed; font-size: var(--text-dense); }
.inventory-sheet > thead th { position: sticky; top: 0; z-index: 4; height: 44px; padding: 6px 16px; background: var(--table-header); border-bottom: 1px solid var(--line); color: var(--muted); font-size: var(--text-meta); font-weight: 500; text-align: left; white-space: nowrap; }
.inventory-sheet > thead th:first-child { width: 25%; left: 0; z-index: 5; }
.inventory-sheet > thead th:nth-child(2) { width: 92px; }
.inventory-sheet > thead th:nth-child(3) { width: 98px; }
.inventory-sheet > thead th:nth-child(4) { width: 116px; }
.inventory-sheet > thead th:nth-child(5) { width: auto; }
.inventory-sheet > thead th:nth-child(6) { width: 116px; }
.inventory-sheet .inventory-actions { width: var(--inventory-actions-width); position: sticky; right: 0; z-index: 2; background: var(--surface); border-left: 1px solid var(--line); }
.inventory-sheet > thead .inventory-actions { background: var(--table-header); z-index: 5; }
.inventory-product-block + .inventory-product-block .inventory-product-heading > th { border-top: 3px solid var(--muted); }
.inventory-product-heading > th { padding: 10px 12px 10px 16px; background: var(--paper); border-bottom: 1px solid var(--line); font-weight: 600; text-align: left; }
.inventory-product-heading__content { display: flex; justify-content: space-between; align-items: center; gap: 24px; min-height: 48px; }
.inventory-product-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.inventory-product-label { display: grid; gap: 4px; min-width: 0; }
.inventory-product-name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
a.inventory-product-name:hover { color: var(--accent); text-decoration: underline; }
.inventory-product-count { color: var(--muted); font-size: var(--text-meta); font-weight: 400; }
.inventory-product-image-state { color: var(--ink); font-size: var(--text-meta); font-weight: 500; }
.inventory-add-image { display: inline-flex; align-items: center; min-height: 44px; margin-right: 8px; white-space: nowrap; font-size: var(--text-meta); }
.inventory-product-photo { flex: 0 0 48px; width: 48px; height: 48px; display: block; background: var(--surface); border: 1px solid var(--line); }
.inventory-product-photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.inventory-product-photo__empty { display: flex; height: 100%; align-items: center; justify-content: center; color: var(--muted); }
.inventory-product-photo__empty > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.inventory-product-actions { position: sticky; right: 0; background: var(--paper); display: flex; align-items: center; flex: 0 0 auto; gap: 8px; font-weight: 400; }
.inventory-add-component { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 10px; color: var(--ink); font-size: var(--text-meta); text-decoration: none; white-space: nowrap; }
.workspace-shell .order-actions-menu .inventory-product-menu-add { display: none; }
.inventory-add-component:hover { color: var(--accent); background: var(--accent-wash); }
.inventory-add-component > span { font-size: 18px; line-height: 1; }
.inventory-part-row > th, .inventory-part-row > td { padding: 6px 16px; height: 52px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; font-weight: 400; text-align: left; background: var(--surface); white-space: nowrap; }
.inventory-part-row:last-child > th, .inventory-part-row:last-child > td { border-bottom: 0; }
.inventory-part-row:hover > th, .inventory-part-row:hover > td, .inventory-part-row:focus-within > th, .inventory-part-row:focus-within > td { background-color: var(--paper); }
.inventory-part-row > .inventory-identity { position: sticky; left: 0; z-index: 1; }
.inventory-part-identity { display: flex; align-items: center; gap: 8px; min-width: 0; }
.inventory-part-name { display: block; min-width: 0; color: var(--ink); font-weight: 500; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; text-decoration: none; }
a.inventory-part-name:hover { color: var(--accent); text-decoration: underline; }
.inventory-shared { flex: 0 0 auto; font-size: var(--text-meta); color: var(--muted); }
.inventory-number { font-variant-numeric: tabular-nums; }
.inventory-part-row > .inventory-editable:has(.inventory-cell-input) { padding: 0; }
.inventory-cell-input { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 10px 16px; border: 0; border-radius: 0; background: transparent; color: var(--ink); font: 400 var(--text-dense)/1.5 var(--sans); font-variant-numeric: tabular-nums; outline: none; text-overflow: ellipsis; }
.inventory-cell-input:not(:disabled):hover { background: var(--paper-deep); }
.inventory-cell-input:focus { background: var(--surface); box-shadow: inset 0 0 0 2px var(--focus-ring); text-overflow: clip; }
.inventory-cell-input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.inventory-cell-input[type=number] { appearance: textfield; -moz-appearance: textfield; }
.inventory-cell-input::-webkit-inner-spin-button, .inventory-cell-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.inventory-cell-input::placeholder { color: var(--muted); }
.inventory-cell-input[aria-invalid=true] { box-shadow: inset 0 0 0 2px var(--red); background: var(--red-wash); }
.inventory-cell-input[aria-invalid=true]:focus-visible { outline-color: var(--red); }
.inventory-cell-input:disabled { color: var(--muted); }
.inventory-fabricator { display: block; padding: 6px 16px 0; color: var(--muted); font-size: var(--text-meta); overflow: hidden; text-overflow: ellipsis; }
.inventory-fabricator + .inventory-cell-input { min-height: 30px; padding-top: 3px; padding-bottom: 6px; }
.inventory-supplier > span:not(.inventory-fabricator) { display: block; overflow: hidden; text-overflow: ellipsis; }
.inventory-muted { color: var(--muted); font-weight: 400; }
.inventory-stock-status { font-size: var(--text-meta); color: var(--muted); white-space: nowrap; }
.inventory-stock-status--low { display: inline-block; padding: 4px 8px; color: var(--red); background: var(--red-wash); font-weight: 600; }
.inventory-part-row > .inventory-actions { padding: 4px; }
.inventory-row-actions { display: flex; align-items: center; justify-content: flex-end; }
.inventory-open-part { display: inline-grid; place-items: center; width: 36px; height: 40px; color: var(--muted); }
.inventory-open-part:hover { background: var(--accent-wash); color: var(--accent); }
.inventory-actions .button_to { margin: 0; }
.inventory-empty-row > td { padding: 16px; color: var(--muted); font-size: var(--text-dense); }
.inventory-footer { margin-top: 16px; color: var(--muted); font-size: var(--text-meta); }
.inventory-draft-actions[hidden] { display: none; }
.inventory-removal { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.inventory-removal h2 { margin-bottom: 12px; font-size: var(--title-section); }
.inventory-removal .field-hint { margin-bottom: 12px; }
.inventory-create-part { margin-top: 24px; }
@media (max-width: 760px) {
  .inventory-tools { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .inventory-search { width: 100%; flex-basis: 100%; }
  .inventory-search-control { flex-basis: 100%; }
  .inventory-search .text-input, .inventory-cell-input { font-size: var(--text-body); }
  .inventory-sheet-caption { align-items: flex-start; gap: 8px; }
  .inventory-sheet-caption > p { padding-top: 8px; }
  .inventory-sheet { --inventory-actions-width: 96px; min-width: 1030px; }
  .inventory-sheet-scroll { max-height: 65dvh; }
  .inventory-sheet > thead th:first-child { width: 160px; }
  .inventory-sheet > thead th:nth-child(2) { width: 84px; }
  .inventory-sheet > thead th:first-child, .inventory-part-row > .inventory-identity { position: static; }
  .inventory-product-actions > .inventory-add-component { display: none; }
  .workspace-shell .order-actions-menu .inventory-product-menu-add { display: flex; }
  .inventory-open-part, .inventory-actions .row-actions-button { width: 44px; min-height: 44px; }
  .inventory-add-component, .inventory-product-actions > .row-actions-button { min-height: 44px; }
}
.inventory-edit-page { max-width: 920px; }
.inventory-component-fields { border: 1px solid var(--line); background: var(--surface); }
.inventory-component-field { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px 16px; }
.inventory-component-field + .inventory-component-field { border-top: 1px solid var(--line); }
.inventory-component-field > label { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.inventory-component-field > div { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; color: var(--muted); font-size: var(--text-meta); }
.inventory-component-field .text-input { width: 90px; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .inventory-component-field { align-items: flex-start; gap: 12px; padding: 12px; }
  .inventory-component-field .text-input { font-size: var(--text-body); width: 76px; }
  .inventory-component-field > div { flex-direction: column; gap: 4px; }
}
.inventory-movements { margin-top: 32px; }
.inventory-movements h2 { margin-bottom: 16px; font-size: var(--title-section); }
.inventory-movement-table { width: 100%; min-width: 650px; border-spacing: 0; font-size: var(--text-dense); }
.inventory-movement-table th, .inventory-movement-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.inventory-movement-table th { background: var(--table-header); color: var(--muted); font-weight: 500; }
.inventory-refresh-status { margin: 0 0 16px; color: var(--muted); font-size: var(--text-dense); }
.inventory-refresh-status:empty { display: none; }
.order-panel .inventory-edit-page .page-header { padding-right: 48px; margin-bottom: 24px; }
.order-panel .inventory-edit-page .page-header h1 { font-size: var(--title-panel); }
.order-panel .inventory-edit-page .page-header__actions { align-self: flex-start; }
.order-panel .inventory-edit-page .page-header__actions button.text-link { padding: 0; border: 0; background: transparent; font: inherit; cursor: pointer; }
.order-panel .inventory-edit-page .form-actions { z-index: 1; border-top: 1px solid var(--line); }
.order-panel .inventory-edit-page .inventory-removal { margin-top: 24px; padding-top: 24px; }
.order-panel .inventory-edit-page .inventory-create-part { padding-top: 20px; border-top: 1px solid var(--line); }
