.inventory-screen {
  min-height: calc(100vh - var(--header-height));
}

.toolbar-root {
  position: sticky;
  top: var(--header-height);
  z-index: 40;
  min-height: var(--toolbar-height);
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
  background: rgba(20, 20, 19, 0.42);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(5px);
}

.inventory-toolbar {
  display: grid;
  width: 100%;
  height: var(--toolbar-height);
  padding: 0 var(--page-gutter);
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
}

.toolbar-search-zone {
  display: flex;
  min-width: 0;
  justify-content: flex-end;
  padding-right: 14px;
}

.search-control {
  display: flex;
  width: 36px;
  height: 34px;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  border-bottom: 1px solid transparent;
  transition: width 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.search-control.is-open {
  width: 226px;
  border-color: rgba(215, 219, 216, 0.3);
  background: rgba(0, 0, 0, 0.16);
}

.search-toggle {
  display: grid;
  width: 36px;
  height: 34px;
  flex: 0 0 36px;
  padding: 0;
  place-items: center;
  cursor: pointer;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
}

.search-toggle img {
  width: 21px;
  height: 21px;
  filter: invert(1) drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.search-input {
  width: 0;
  min-width: 0;
  height: 32px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.91);
  font-size: 12px;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  opacity: 0;
  transition: width 150ms ease, opacity 100ms ease, padding 150ms ease;
}

.search-control.is-open .search-input {
  width: 188px;
  padding: 0 8px 0 3px;
  opacity: 1;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.inventory-filters {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.filter-button {
  height: 30px;
  padding: 2px 12px 0;
  cursor: pointer;
  background: transparent;
  color: rgba(242, 241, 234, 0.76);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.027em;
  line-height: 28px;
  white-space: nowrap;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

.filter-button:hover {
  color: rgba(255, 255, 255, 0.96);
  background: rgba(255, 255, 255, 0.055);
}

.filter-button.is-selected {
  color: #b9e1f1;
  background: var(--blue-fill);
  box-shadow: inset 0 -1px 0 rgba(135, 206, 234, 0.34);
}

.toolbar-sort-zone {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 13px;
  padding-left: 18px;
}

.item-count {
  color: rgba(242, 241, 234, 0.55);
  font-size: 11px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.sort-control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
}

.sort-icon {
  width: 20px;
  height: 20px;
  opacity: 0.92;
}

.sort-icon img {
  width: 20px;
  height: 20px;
  filter: invert(1);
}

.sort-trigger {
  display: flex;
  width: 204px;
  height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 1px 12px 0 13px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(16, 17, 15, 0.28);
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: left;
}

.sort-trigger:hover,
.sort-trigger[aria-expanded="true"] {
  border-color: rgba(255, 255, 255, 0.23);
  background: rgba(16, 17, 15, 0.43);
}

.sort-chevron {
  width: 12px;
  height: 12px;
  opacity: 0.85;
  filter: invert(1);
  transition: transform 100ms ease;
}

.sort-trigger[aria-expanded="true"] .sort-chevron {
  transform: rotate(180deg);
}

.sort-menu {
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  z-index: 55;
  width: 204px;
  padding: 4px 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(27, 28, 26, 0.97);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.sort-option {
  width: 100%;
  height: 31px;
  padding: 1px 13px 0;
  cursor: pointer;
  background: transparent;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  letter-spacing: 0.035em;
  text-align: left;
}

.sort-option:hover,
.sort-option.is-selected {
  color: #c4e6f3;
  background: rgba(66, 133, 160, 0.48);
}

.status-strip {
  position: sticky;
  top: calc(var(--header-height) + var(--toolbar-height));
  z-index: 35;
  min-height: 31px;
  padding: 7px var(--page-gutter) 6px;
  border-bottom: 1px solid rgba(244, 174, 83, 0.25);
  background: rgba(53, 40, 27, 0.94);
  color: rgba(255, 224, 184, 0.83);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-strip button {
  margin-left: 10px;
  padding: 0;
  cursor: pointer;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: #fff0d3;
  font-size: inherit;
  letter-spacing: inherit;
}

.inventory-content {
  min-height: calc(100vh - var(--header-height) - var(--toolbar-height));
  padding: 45px var(--page-gutter) 74px;
}

.state-root:empty,
.state-root[hidden] {
  display: none;
}

.loading-state,
.error-state,
.empty-state {
  display: grid;
  min-height: 42vh;
  place-content: center;
  text-align: center;
}

.loading-title,
.error-title,
.empty-title {
  color: rgba(255, 255, 255, 0.87);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.loading-state p,
.error-state p,
.empty-state p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.43);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.loading-dots {
  display: inline-flex;
  width: 25px;
  margin-left: 5px;
  align-items: flex-end;
  justify-content: space-between;
}

.loading-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  animation: loading-dot 900ms infinite ease-in-out;
}

.loading-dots i:nth-child(2) { animation-delay: 110ms; }
.loading-dots i:nth-child(3) { animation-delay: 220ms; }

@keyframes loading-dot {
  0%, 55%, 100% { transform: translateY(0); opacity: 0.42; }
  28% { transform: translateY(-4px); opacity: 1; }
}

.state-action {
  justify-self: center;
  margin-top: 17px;
  padding: 8px 18px 7px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(12, 12, 12, 0.25);
  color: rgba(255, 255, 255, 0.83);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.state-action:hover {
  border-color: rgba(151, 204, 226, 0.65);
  background: rgba(54, 116, 141, 0.35);
}

@media (max-width: 1500px) {
  :root { --page-gutter: 52px; }
  .inventory-toolbar { grid-template-columns: minmax(150px, 1fr) auto minmax(230px, 1fr); }
  .filter-button { padding-inline: 9px; font-size: 12px; }
  .sort-trigger { width: 176px; }
  .sort-menu { width: 176px; }
}

@media (max-width: 1180px) {
  :root { --page-gutter: 36px; }
  .inventory-toolbar { grid-template-columns: 50px auto minmax(184px, 1fr); }
  .toolbar-search-zone { padding-right: 7px; }
  .search-control.is-open {
    position: absolute;
    top: 11px;
    left: var(--page-gutter);
    z-index: 4;
    width: 210px;
    background: rgba(24, 24, 23, 0.97);
  }
  .inventory-filters { gap: 2px; }
  .filter-button { padding-inline: 7px; font-size: 11px; }
  .item-count { display: none; }
  .sort-trigger, .sort-menu { width: 152px; }
}
