.warehouse-workspace-active .warehouse-workspace-host > *:not(#warehouse-workspace-root) {
  display: none !important;
}

.whx-movement-help {
  display: block;
  min-height: 18px;
  margin-top: 6px;
  color: #667085;
  font-size: 13px;
  line-height: 1.4;
}

.warehouse-workspace-host {
  padding: 0 !important;
  overflow: auto !important;
  background: #f6f8fa;
}

#warehouse-workspace-root,
#warehouse-workspace-root * {
  box-sizing: border-box;
}

#warehouse-workspace-root {
  min-width: 0;
  color: #182230;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

#warehouse-workspace-root button,
#warehouse-workspace-root input,
#warehouse-workspace-root select {
  font: inherit;
}

.whx-page {
  width: 100%;
  min-height: 100%;
  padding: 24px 28px 40px;
}

.whx-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.whx-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: #176b37;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.whx-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
}

.whx-header p {
  margin: 4px 0 0;
  color: #667085;
  font-size: 14px;
}

.whx-controlbar,
.whx-filterbar,
.whx-statistics,
.whx-content {
  border: 1px solid #dbe2ea;
  background: #fff;
}

.whx-controlbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 12px;
  border-radius: 7px 7px 0 0;
}

.whx-primary-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
}

.whx-primary-tabs button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid #d6dde6;
  border-radius: 5px;
  background: #f4f6f8;
  color: #667085;
  cursor: pointer;
  font-weight: 600;
}

.whx-primary-tabs button.active {
  border-color: #42aa5b;
  background: #effaf1;
  color: #176b37;
  box-shadow: inset 0 0 0 1px #42aa5b;
}

.whx-period {
  display: flex;
  align-items: center;
  flex: 0 0 400px;
  min-width: 400px;
  height: 40px;
  border: 1px solid #d6dde6;
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
}

.whx-period label {
  display: flex;
  align-items: center;
  flex: 0 0 185px;
  gap: 5px;
  min-width: 0;
}

.whx-period label span {
  flex: 0 0 auto;
  padding-left: 10px;
  color: #98a2b3;
  font-size: 12px;
}

.whx-period input {
  flex: 0 0 128px;
  width: 128px;
  min-width: 128px;
  height: 38px;
  padding: 0 4px 0 6px;
  border: 0;
  outline: 0;
  color: #344054;
  background: transparent;
}

.whx-period i {
  flex: 0 0 28px;
  color: #667085;
  font-style: normal;
  font-weight: 600;
  text-align: center;
}

.whx-season {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  color: #475467;
}

.whx-season input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #23823e;
}

.whx-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.whx-btn,
.whx-icon-btn,
.whx-purchase,
.whx-link,
.whx-more {
  border: 1px solid #ccd6e2;
  background: #fff;
  color: #263547;
  cursor: pointer;
  font-weight: 600;
}

.whx-btn {
  min-height: 40px;
  padding: 0 15px;
  border-radius: 5px;
}

.whx-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 5px;
  font-size: 18px;
}

.whx-btn:hover,
.whx-icon-btn:hover,
.whx-purchase:hover,
.whx-link:hover,
.whx-more:hover {
  border-color: #78b889;
  color: #176b37;
}

.whx-btn.primary {
  border-color: #2d9148;
  background: #2d9148;
  color: #fff;
}

.whx-btn.danger {
  border-color: #f4b4b4;
  color: #d92d20;
}

.whx-filterbar {
  display: grid;
  grid-template-columns: minmax(180px, .85fr) minmax(180px, .85fr) minmax(260px, 1.5fr) auto;
  gap: 12px;
  padding: 12px;
  border-top: 0;
  border-radius: 0 0 7px 7px;
}

.whx-filterbar label,
.whx-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.whx-filterbar label > span,
.whx-form label > span {
  color: #475467;
  font-size: 12px;
  font-weight: 600;
}

.whx-filterbar input,
.whx-filterbar select,
.whx-form input,
.whx-form select {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 11px;
  border: 1px solid #ccd6e2;
  border-radius: 5px;
  outline: 0;
  background: #fff;
  color: #182230;
}

.whx-filterbar input:focus,
.whx-filterbar select:focus,
.whx-form input:focus,
.whx-form select:focus {
  border-color: #47a961;
  box-shadow: 0 0 0 3px rgba(71, 169, 97, .12);
}

.whx-filterbar > .whx-btn {
  align-self: end;
}

.whx-statistics {
  margin-top: 14px;
  border-radius: 7px;
  overflow: hidden;
}

.whx-stat-toggle {
  display: grid;
  grid-template-columns: 1fr auto 22px;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  background: #fff;
  color: #344054;
  cursor: pointer;
  text-align: left;
}

.whx-stat-toggle span:nth-child(2) {
  color: #667085;
  font-size: 13px;
}

.whx-stat-toggle b {
  text-align: right;
}

.whx-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid #e4e9ef;
  background: #fafbfc;
}

.whx-kpis > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 14px 18px;
  border-right: 1px solid #e4e9ef;
}

.whx-kpis > div:last-child {
  border-right: 0;
}

.whx-kpis span,
.whx-kpis small {
  color: #667085;
}

.whx-kpis strong {
  font-size: 19px;
  font-weight: 700;
}

.whx-content {
  margin-top: 14px;
  border-radius: 7px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .04);
}

.whx-table-meta,
.whx-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 10px 16px;
  border-bottom: 1px solid #dbe2ea;
}

.whx-table-meta > div,
.whx-section-head > div {
  display: grid;
  gap: 2px;
}

.whx-table-meta strong,
.whx-section-head h2 {
  margin: 0;
  font-size: 16px;
}

.whx-table-meta span,
.whx-section-head p {
  margin: 0;
  color: #667085;
  font-size: 12px;
}

.whx-table-wrap {
  width: 100%;
  overflow: auto;
}

.whx-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.whx-stock-table {
  min-width: 1370px;
}

.whx-table th,
.whx-table td {
  padding: 11px 12px;
  border-right: 1px solid #e1e6ec;
  border-bottom: 1px solid #e1e6ec;
  vertical-align: middle;
  text-align: left;
}

.whx-table th:last-child,
.whx-table td:last-child {
  border-right: 0;
}

.whx-table tbody tr:last-child td {
  border-bottom: 0;
}

.whx-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f1f3f5;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  white-space: normal;
}

.whx-table td {
  color: #344054;
  font-size: 13px;
}

.whx-table tbody tr:hover td {
  background: #fbfdfb;
}

.whx-table td > small {
  display: block;
  margin-top: 3px;
  color: #98a2b3;
}

.whx-table .number {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.positive {
  color: #1f8a3b !important;
}

.danger {
  color: #e5484d !important;
}

.warning {
  color: #b54708 !important;
}

.whx-name-link {
  max-width: 230px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #20823d;
  cursor: pointer;
  font-weight: 700;
  text-align: left;
}

.whx-type {
  color: #278b45;
  font-weight: 600;
}

.whx-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.whx-purchase,
.whx-link {
  min-height: 30px;
  padding: 0 10px;
  border-color: #b9ddc2;
  border-radius: 4px;
  color: #258543;
  white-space: nowrap;
}

.whx-more {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 4px;
  font-size: 17px;
}

.whx-movement,
.whx-ok {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #edf7ef;
  color: #21783a;
  font-size: 12px;
  font-weight: 600;
}

.whx-movement.write_off {
  background: #fff0f0;
  color: #c43232;
}

.whx-movement.reserve {
  background: #fff7e6;
  color: #9f6400;
}

.whx-needs-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid #dbe2ea;
}

.whx-needs-summary > div {
  display: grid;
  gap: 2px;
  padding: 16px;
  border-right: 1px solid #e4e9ef;
}

.whx-needs-summary strong {
  font-size: 20px;
}

.whx-needs-summary span {
  color: #667085;
}

.whx-directory {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
}

.whx-directory > section + section {
  border-left: 1px solid #dbe2ea;
}

.whx-directory-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 1px solid #e4e9ef;
  background: #fff;
  color: #344054;
  cursor: pointer;
  text-align: left;
}

.whx-directory-row span:first-child {
  display: grid;
  gap: 2px;
}

.whx-directory-row small {
  color: #667085;
}

.whx-empty,
.whx-loader {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 28px;
  color: #667085;
  text-align: center;
}

.whx-loader span {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  border: 3px solid #dce8df;
  border-top-color: #2d9148;
  border-radius: 50%;
  animation: whx-spin .8s linear infinite;
}

@keyframes whx-spin { to { transform: rotate(360deg); } }

.whx-alert {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 10020;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 420px;
  padding: 12px 14px;
  border: 1px solid #b7dec1;
  border-radius: 6px;
  background: #effaf2;
  color: #176b37;
  box-shadow: 0 12px 30px rgba(16, 24, 40, .14);
}

.whx-alert.error {
  border-color: #ffc5c5;
  background: #fff1f1;
  color: #b42318;
}

.whx-alert button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 18px;
}

.whx-category-section,
.whx-insight-section {
  margin-bottom: 14px;
}

.whx-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.whx-section-title strong {
  display: block;
  color: #172033;
  font-size: 17px;
}

.whx-section-title span {
  display: block;
  margin-top: 2px;
  color: #667085;
  font-size: 13px;
}

.whx-category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.whx-category-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid #dbe2ea;
  border-radius: 7px;
  background: #fff;
  color: #344054;
  text-align: left;
  cursor: pointer;
}

.whx-category-card:hover,
.whx-category-card.active {
  border-color: #2f8a46;
  box-shadow: inset 0 0 0 1px #2f8a46;
}

.whx-category-card header,
.whx-category-card footer,
.whx-category-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.whx-category-card header strong { color: #172033; font-size: 15px; }
.whx-category-card header span,
.whx-category-card footer { color: #667085; font-size: 12px; }
.whx-category-value { margin: 15px 0 10px; }
.whx-category-value span { display: block; color: #667085; font-size: 12px; }
.whx-category-value b { display: block; margin-top: 3px; color: #172033; font-size: 18px; }
.whx-category-flow { padding: 8px 0; border-top: 1px solid #eef1f4; border-bottom: 1px solid #eef1f4; font-size: 12px; }
.whx-category-card footer { margin-top: 9px; }

.whx-insights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.whx-insight-card {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #dbe2ea;
  border-radius: 7px;
  background: #f8fafc;
  color: #344054;
  text-align: left;
}

button.whx-insight-card { cursor: pointer; }
button.whx-insight-card:hover { border-color: #2f8a46; }
.whx-insight-card span,
.whx-insight-card small { display: block; color: #667085; font-size: 12px; }
.whx-insight-card strong { display: block; margin: 7px 0 3px; color: #172033; font-size: 16px; }
.whx-empty-row { padding: 34px 18px !important; color: #667085; text-align: center !important; }

.whx-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10010;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background: rgba(16, 24, 40, .56);
}

.whx-modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(16, 24, 40, .24);
}

.whx-modal > header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 20px;
  border-bottom: 1px solid #dbe2ea;
  background: #fff;
}

.whx-modal h2 {
  margin: 0;
  font-size: 21px;
}

.whx-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 20px;
}

.whx-form .span-2 {
  grid-column: 1 / -1;
}

.whx-form footer {
  position: sticky;
  bottom: -20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 6px -20px -20px;
  padding: 14px 20px;
  border-top: 1px solid #dbe2ea;
  background: #fff;
}

@media (max-width: 1500px) {
  .whx-controlbar { flex-wrap: wrap; }
  .whx-period { flex-basis: 400px; }
  .whx-actions { margin-left: 0; }
  .whx-filterbar { grid-template-columns: 1fr 1fr; }
  .whx-kpis { grid-template-columns: 1fr 1fr; }
  .whx-kpis > div:nth-child(2) { border-right: 0; }
  .whx-kpis > div:nth-child(-n+2) { border-bottom: 1px solid #e4e9ef; }
  .whx-category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .whx-insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .whx-page { padding: 16px 12px 28px; }
  .whx-header h1 { font-size: 24px; }
  .whx-header p { max-width: 520px; }
  .whx-controlbar { align-items: stretch; }
  .whx-primary-tabs { width: 100%; }
  .whx-primary-tabs button { flex: 1; padding: 0 8px; }
  .whx-period { width: 100%; min-width: 0; flex-basis: 100%; }
  .whx-period label { flex: 1 1 0; }
  .whx-period input { flex: 1 1 128px; width: auto; }
  .whx-season { min-height: 36px; }
  .whx-actions { width: 100%; overflow-x: auto; }
  .whx-actions .whx-btn { flex: 1; }
  .whx-filterbar { grid-template-columns: 1fr; }
  .whx-stat-toggle { grid-template-columns: 1fr 20px; }
  .whx-stat-toggle span:nth-child(2) { display: none; }
  .whx-kpis { grid-template-columns: 1fr; }
  .whx-kpis > div { border-right: 0; border-bottom: 1px solid #e4e9ef; }
  .whx-kpis > div:last-child { border-bottom: 0; }
  .whx-directory { grid-template-columns: 1fr; }
  .whx-directory > section + section { border-left: 0; border-top: 1px solid #dbe2ea; }
  .whx-needs-summary { grid-template-columns: 1fr; }
  .whx-needs-summary > div { border-right: 0; border-bottom: 1px solid #e4e9ef; }
  .whx-category-grid,
  .whx-insights { grid-template-columns: 1fr; }
  .whx-form { grid-template-columns: 1fr; padding: 16px; }
  .whx-form .span-2 { grid-column: auto; }
  .whx-form footer { margin: 4px -16px -16px; padding: 12px 16px; }
  .whx-modal-backdrop { align-items: end; padding: 0; }
  .whx-modal { max-height: 94vh; border-radius: 10px 10px 0 0; }
}
