.inventory-page {
  --inv-code-width: clamp(175px, 18vw, 262px);
  --inv-cost-width: 96px;
  --inv-rule: #dce5db;
}
.inventory-page [hidden],
.inventory-page[data-sales='false'] .inv-extra {
  display: none;
}
.inventory-page .inv-sales {
  min-height: 39px;
  font-size: 0.875rem;
  color: #345944;
  border-color: #b8cbb9;
}
.inv-sales[aria-pressed='true'] {
  background: #e8f2e6;
  border-color: #9db69e;
}
.inv-track {
  display: inline-flex;
  align-items: center;
  width: 28px;
  height: 16px;
  padding: 2px;
  border-radius: 10px;
  background: #a9b6ab;
}
.inv-track:before {
  content: '';
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
}
.inv-sales[aria-pressed='true'] .inv-track {
  background: #4d8056;
}
.inv-sales[aria-pressed='true'] .inv-track:before {
  margin-left: auto;
}
.inventory-work {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.inventory-work > .inv-panel {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  width: 100%;
  max-width: none;
  min-height: 280px;
  container-type: inline-size;
}
.inv-toolbar,
.inv-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 17px;
  flex: none;
  flex-wrap: wrap;
}
.inv-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.inv-heading h2 {
  font-size: 1.025rem;
  font-weight: 640;
}
.inv-heading > span,
.inv-pager > span {
  font-size: 0.82rem;
  color: #566a5c;
}
.inv-toolbar search {
  display: block;
  max-width: 100%;
  flex: 0 1 286px;
}
.inv-search {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 35px;
  padding: 0 9px;
  border: 1px solid #d2ded2;
  border-radius: 7px;
  color: #617967;
  background: #f8faf7;
}
.inv-search:focus-within {
  outline: 2px solid #477252;
  outline-offset: 1px;
}
.inv-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.875rem;
  outline: 0;
  appearance: none;
}
.inv-search input:focus-visible {
  outline: 0;
}
.inv-search input::-webkit-search-cancel-button {
  display: none;
}
.inv-search button {
  display: grid;
  place-content: center;
  min-width: 26px;
  min-height: 30px;
}
.inv-tools {
  flex: none;
  display: grid;
  align-items: start;
}
.inv-tools > * {
  grid-area: 1 / 1;
}
.inv-pan {
  display: none;
  justify-self: end;
  margin-inline-end: 14px;
  font-size: 0.8rem;
  color: var(--pine);
}
.inv-pan span {
  display: flex;
  align-items: center;
  gap: 2px;
}
.inv-pan:not([data-at-end]) span:last-child,
.inv-pan[data-at-end] span:first-child {
  display: none;
}
@container (max-width: 1139px) {
  .inventory-page[data-sales='true'] .inv-pan {
    display: inline-flex;
  }
}
.inv-notes {
  padding: 0 17px 9px;
  font-size: 0.8rem;
  color: #516658;
  flex: none;
}
.inv-notes summary {
  cursor: pointer;
  display: list-item;
  width: fit-content;
}
.inv-notes div {
  border-inline-start: 2px solid #b9cdb4;
  margin: 8px 0 1px;
  padding: 0 10px;
  line-height: 1.6;
  max-width: 82ch;
}
.inv-notes p + p {
  margin-top: 3px;
}
.inv-sales-note {
  margin: 0;
  padding: 0 17px 9px;
  color: #65562b;
  font-size: 0.8rem;
  flex: none;
}
.inv-table-wrap {
  contain: size;
  overflow: auto;
  position: relative;
  flex: 1 1 auto;
  min-height: 125px;
  border-block: 1px solid var(--inv-rule);
  background: #fff;
  overscroll-behavior-x: contain;
  scrollbar-color: #b4c3b7 #f4f7f3;
}
.inv-table-wrap:focus-visible {
  outline: 2px solid #688d6d;
  outline-offset: -2px;
}
#inventory-table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  width: 100%;
  min-width: calc(var(--inv-code-width) + 485px + var(--inv-cost-width));
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
}
@media (min-width: 761px) {
  .inventory-page[data-sales='true'] {
    --inv-code-width: clamp(158px, 13.2vw, 210px);
  }
  .inventory-page[data-sales='true'] #inventory-table {
    min-width: 1140px;
  }
  .inventory-page[data-sales='true'] #inventory-table thead th > button {
    padding-inline: 6px;
    gap: 3px;
  }
  .inventory-page[data-sales='true'] #inventory-table thead th:first-child > button {
    padding-inline-start: 14px;
  }
  .inventory-page[data-sales='true'] #inventory-table th[data-col='sales120'] {
    width: 85px;
  }
  .inventory-page[data-sales='true'] #inventory-table td {
    padding-inline: 8px;
  }
}
#inventory-table thead th {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  font-weight: 590;
  background: #eff4ee;
  border-bottom: 1px solid #d4e0d2;
  color: #455d4c;
}
#inventory-table thead th:first-child,
#inventory-table tbody th {
  width: var(--inv-code-width);
  inset-inline-start: 0;
  position: sticky;
  border-inline-end: 1px solid #dce5db;
}
#inventory-table thead th:first-child {
  z-index: 3;
}
#inventory-table thead th[data-col='cost'] {
  width: var(--inv-cost-width);
}
#inventory-table thead th > button {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-height: 43px;
  width: 100%;
  padding: 0 11px;
  color: inherit;
  font-size: 0.84rem;
  white-space: nowrap;
}
#inventory-table thead th:first-child > button {
  justify-content: flex-start;
  padding-inline-start: 18px;
}
#inventory-table th[aria-sort] {
  color: #285f3c;
  background: #e7f0e3;
}
#inventory-table [data-sort]:focus-visible,
#inventory-table [data-inv='expand']:focus-visible {
  outline-offset: -3px;
}
.inv-sort-mark {
  display: grid;
  gap: 2px;
}
.inv-sort-mark::before,
.inv-sort-mark::after {
  content: '';
  width: 0;
  height: 0;
  border-inline: 3px solid transparent;
}
.inv-sort-mark::before {
  border-bottom: 4px solid #a0b2a4;
}
.inv-sort-mark::after {
  border-top: 4px solid #a0b2a4;
}
th[aria-sort='ascending'] .inv-sort-mark::before {
  border-bottom-color: #24623e;
}
th[aria-sort='descending'] .inv-sort-mark::after {
  border-top-color: #24623e;
}
#inventory-table tbody th,
#inventory-table td {
  border-bottom: 1px solid #e4ebe3;
  background: #fff;
  padding: 0;
}
.inv-cost-input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 3px 5px;
  border: 1px solid #d3dfd4;
  border-radius: 5px;
  background: #fff;
  color: #254735;
  text-align: end;
  font-variant-numeric: tabular-nums;
  cursor: text;
}
.inv-cost-input:focus {
  outline: 2px solid #477252;
  outline-offset: 0;
}
.inv-cost-input::placeholder {
  opacity: 1;
  color: #66786b;
}
.inv-cost-input.is-inherited:not(:focus) {
  border-style: dashed;
}
.inv-cost-input[aria-invalid='true'] {
  border-color: #a74936;
  outline-color: #a74936;
  background: #fff5f1;
}
.inv-cost-feedback {
  flex: none;
  color: #913f2e;
  font-size: 0.8rem;
  padding: 0 12px 6px;
}
.inv-cost-feedback:empty {
  display: none;
}
#inventory-table tbody th {
  z-index: 1;
  text-align: start;
}
#inventory-table td {
  text-align: end;
  padding: 7px 12px;
  font-size: 0.875rem;
}
#inventory-table .inv-totals th,
#inventory-table .inv-totals td {
  background: #f1f6ed;
  color: #34583d;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
#inventory-table .inv-totals th {
  padding: 8px 17px;
  font-size: 0.82rem;
}
#inventory-table [data-col='withReturns'] {
  color: #2b603e;
  font-weight: 620;
}
#inventory-table [data-col='sales1'],
#inventory-table [data-col='restock'] {
  border-inline-start: 1px solid var(--inv-rule);
}
#inventory-table .inv-sku > *,
#inventory-table .inv-open > * {
  background: #f4f8f2;
}
#inventory-table .inv-sku td {
  color: #52675a;
}
#inventory-table .inv-style:hover > * {
  background: #f2f7f0;
}
#inventory-table .inv-negative {
  color: #a23e32;
}
#inventory-table td.inv-missing {
  color: #7a877c;
  font-weight: 400;
}
.inv-partial {
  text-decoration: underline dotted #a8b7aa;
  text-underline-offset: 4px;
}
.inv-identity {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.inv-identity strong {
  font-size: 0.89rem;
  font-weight: 610;
  color: #2a4233;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.inv-identity small {
  font-size: 0.735rem;
  color: #627467;
  font-weight: 400;
  line-height: 1.3;
}
#inventory-table [data-inv='expand'],
.inv-child {
  display: flex;
  align-items: center;
  gap: 7px;
  text-align: start;
  padding: 8px 10px;
  min-height: 48px;
  width: 100%;
  line-height: 1.4;
}
.inv-caret {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border: 1px solid #d1ddcf;
  border-radius: 5px;
  background: white;
  color: #52735a;
}
.inv-open .inv-caret svg {
  transform: rotate(90deg);
}
.inv-child {
  padding-inline-start: 19px;
  min-height: 41px;
}
.inv-child i {
  width: 11px;
  height: 8px;
  flex: none;
  border-inline-start: 1px solid #afc4af;
  border-bottom: 1px solid #afc4af;
  align-self: flex-start;
  margin-top: 3px;
}
.inv-child strong {
  font-size: 0.815rem;
  font-weight: 500;
}
#inventory-table td.inv-flag-cell {
  padding: 0 8px;
}
.inv-flag {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-height: 36px;
  min-width: 35px;
  cursor: pointer;
}
.inv-flag:has(input:disabled) {
  cursor: default;
}
.inv-flag input {
  margin: 0;
  width: 17px;
  height: 17px;
}
.inv-flag span {
  font-size: 0.72rem;
  color: #607364;
}
.inv-pager {
  padding-block: 10px;
}
.inv-pager > div {
  display: flex;
  gap: 6px;
  align-items: center;
}
.inv-jump {
  display: inline-flex;
  align-items: center;
  position: relative;
}
.inv-jump select {
  appearance: none;
  padding: 4px 23px 4px 9px;
  border: 1px solid #d9e1d8;
  border-radius: 6px;
  background: #fff;
  font-size: 0.8rem;
  min-height: 30px;
}
.inv-jump svg {
  position: absolute;
  right: 6px;
  pointer-events: none;
}
.inv-empty .empty {
  padding: 22px;
}
.inv-panel:has(.inv-empty:not([hidden])) .inv-table-wrap {
  flex: none;
  min-height: 0;
  contain: none;
}
@media (max-width: 760px) {
  .inventory-page {
    --inv-code-width: clamp(98px, 25.3vw, 180px);
    --inv-cost-width: 62px;
  }
  .inventory-page .page-head {
    align-items: center;
    flex-wrap: nowrap;
  }
  .inventory-page .inv-sales {
    gap: 5px;
    min-height: 40px;
    padding-inline: 9px;
  }
  .inv-toolbar {
    align-items: stretch;
    gap: 8px;
    padding: 11px 12px 8px;
  }
  .inv-toolbar search {
    flex: 1 1 220px;
  }
  .inv-search {
    min-height: 40px;
  }
  .inv-search input {
    font-size: 1rem;
  }
  .inv-notes,
  .inv-sales-note {
    padding-inline: 12px;
  }
  #inventory-table {
    min-width: calc(var(--inv-code-width) + 202px + var(--inv-cost-width));
  }
  .inventory-page[data-sales='true'] #inventory-table {
    min-width: calc(var(--inv-code-width) + 744px + var(--inv-cost-width));
  }
  #inventory-table thead th > button {
    padding: 4px 2px;
    gap: 2px;
    white-space: normal;
    font-size: 0.76rem;
    line-height: 1.25;
    text-wrap: balance;
  }
  #inventory-table thead th:first-child > button {
    padding-inline-start: 7px;
  }
  #inventory-table .inv-sort-mark {
    flex-shrink: 0;
  }
  #inventory-table td {
    padding: 5px 3px;
    font-size: 0.83rem;
    white-space: nowrap;
  }
  #inventory-table td.inv-flag-cell {
    padding: 0 3px;
  }
  .inv-cost-input {
    min-height: 31px;
    padding-inline: 1px;
    font-size: 1rem;
  }
  #inventory-table [data-inv='expand'] {
    display: grid;
    grid-template-columns: 27px minmax(0, 1fr);
    gap: 5px;
    padding: 5px;
  }
  #inventory-table .inv-thumb,
  #inventory-table .inv-caret {
    grid-area: 1/1;
  }
  #inventory-table .inv-thumb {
    width: 27px;
    border-radius: 5px;
  }
  #inventory-table .inv-thumb svg {
    width: 16px;
  }
  #inventory-table .inv-identity {
    grid-area: 1/2;
  }
  #inventory-table .inv-style .inv-identity strong {
    font-size: 0.83rem;
  }
  #inventory-table .inv-caret {
    width: 14px;
    height: 14px;
    justify-self: end;
    transform: translate(2px, 9px);
  }
  #inventory-table .inv-caret svg {
    width: 11px;
    height: 11px;
  }
  #inventory-table .inv-totals th {
    padding-inline: 7px;
  }
  #inventory-table .inv-totals td {
    padding-inline: 2px;
    font-size: 0.72rem;
    border-inline-start: 1px solid #dce5db;
  }

  #inventory-table .inv-flag {
    gap: 3px;
  }
  .inv-child {
    padding: 4px 2px 4px 6px;
    gap: 3px;
  }
  .inv-child .inv-identity {
    gap: 1px;
  }
  .inv-child i {
    width: 6px;
  }
  .inv-pager {
    padding: 8px 10px;
  }
  .inv-pager > span {
    font-size: 0.76rem;
  }
}
@media (pointer: coarse) {
  #inventory-table thead th > button,
  .inv-flag,
  .inv-pager button,
  .inv-jump select {
    min-height: 44px;
  }
}
.inv-thumb {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  aspect-ratio: 1;
  border: 1px dashed #9fb5a4;
  border-radius: 7px;
  background: #eaf1e9;
  color: #64836d;
}
.inv-style .inv-caret {
  margin-inline-start: auto;
}

.page-size {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 5px;
  color: #506858;
  font-size: 0.8rem;
}
.page-size select {
  min-height: 32px;
  max-width: 100%;
  border: 1px solid #cfdbd0;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 3px 5px;
}
.page-steppers,
.inv-layout-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}
.inv-layout {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid #d5e0d4;
  border-radius: 7px;
  background: #f4f7f2;
  white-space: nowrap;
}
.inv-layout button {
  min-height: 29px;
  padding: 3px 10px;
  border-radius: 5px;
  color: #4c6856;
  font-size: 0.84rem;
}
.inv-layout button[aria-pressed='true'] {
  color: #174c36;
  background: #fff;
  font-weight: 650;
  box-shadow: 0 1px 2px #18382920;
}
.inventory-page[data-layout='list'] :is(.inv-card-scroll, .inv-card-sort),
.inventory-page[data-layout='cards'] :is(.inv-table-wrap, .inv-pan),
.inv-panel:has(.inv-empty:not([hidden])) .inv-card-scroll {
  display: none;
}
.inv-card-scroll {
  flex: 1 1 auto;
  min-height: 125px;
  contain: size;
  overflow: auto;
  border-block: 1px solid var(--inv-rule);
  background: #f5f8f4;
}
.inv-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  align-items: start;
  gap: 9px;
  padding: 9px;
}
.inv-card {
  min-width: 0;
  border: 1px solid var(--inv-rule);
  border-radius: 8px;
  background: white;
  padding: 8px 10px 10px;
}
.inv-card [data-inv='expand'] {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: start;
  width: 100%;
  min-height: 42px;
}
.inv-card .inv-caret {
  margin-inline-start: auto;
}
.inv-card-values {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  text-align: center;
  gap: 7px 2px;
  margin: 6px 0 0;
  padding: 7px 4px;
  border-radius: 6px;
  background: #f0f5ef;
  font-variant-numeric: tabular-nums;
}
.inv-card-values dt {
  color: #56685c;
  font-size: 0.7rem;
}
.inv-card-values dd {
  margin: 2px 0 0;
  font-size: 0.83rem;
  overflow-wrap: anywhere;
}
.inv-card-values .inv-negative {
  color: #943e30;
}
.inv-card-cost {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-block-start: 5px;
  color: #48624f;
  font-size: 0.8rem;
}
.inv-card-cost .inv-cost-input {
  width: 96px;
}
.inv-card-marks {
  display: flex;
  flex-wrap: wrap;
  column-gap: 12px;
}
.inv-card-marks .inv-flag {
  font-size: 0.75rem;
  color: #48624f;
}
.inv-card-marks .inv-flag-count:empty {
  display: none;
}
.inv-card-items {
  margin-block-start: 6px;
  border-inline-start: 2px solid #d5e2d4;
  padding-inline-start: 8px;
}
.inv-card-sku + .inv-card-sku {
  border-top: 1px solid var(--inv-rule);
}
.inv-card-sku .inv-child {
  padding: 7px 2px 0;
  min-height: 34px;
}
.inv-card-sku .inv-card-values {
  margin: 4px 0;
}

@media (max-width: 760px) {
  .inv-toolbar search {
    flex: 1 1 160px;
  }
  .inv-pager > div {
    flex-wrap: wrap;
  }
  .inv-layout button {
    min-height: 32px;
  }
  .page-size select {
    min-height: 34px;
  }
}
