.prestec-page-header {
  align-items: center;
  background: var(--prestec-ui-panel);
  border: 1px solid var(--prestec-ui-border);
  border-radius: var(--prestec-ui-radius-lg);
  box-shadow: var(--prestec-ui-shadow-sm);
  display: flex;
  gap: var(--prestec-ui-space-4);
  justify-content: space-between;
  padding: var(--prestec-ui-space-4) var(--prestec-ui-space-5);
}

.prestec-page-header h1 {
  color: var(--prestec-ui-text);
  font-size: 22px;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 0;
}

.prestec-page-header p {
  color: var(--prestec-ui-text-secondary);
  line-height: 1.45;
  margin: 5px 0 0;
}

.prestec-page-header__actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--prestec-ui-space-2);
  justify-content: flex-end;
}

.prestec-kpi-grid {
  display: grid;
  gap: var(--prestec-ui-space-3);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.prestec-kpi-card {
  background: var(--prestec-ui-panel);
  border: 1px solid var(--prestec-ui-border);
  border-radius: var(--prestec-ui-radius-lg);
  box-shadow: var(--prestec-ui-shadow-sm);
  display: grid;
  gap: var(--prestec-ui-space-1);
  min-height: 74px;
  padding: var(--prestec-ui-space-3) var(--prestec-ui-space-4);
}

.prestec-kpi-card span {
  color: var(--prestec-ui-text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.prestec-kpi-card strong {
  color: var(--prestec-ui-text);
  font-size: 21px;
  font-weight: 800;
  line-height: 1.15;
}

.prestec-warning-banner {
  align-items: flex-start;
  background: var(--prestec-ui-warning-bg);
  border: 1px solid #f4c875;
  border-radius: var(--prestec-ui-radius-lg);
  color: #744210;
  display: flex;
  gap: var(--prestec-ui-space-3);
  padding: var(--prestec-ui-space-3) var(--prestec-ui-space-4);
}

.prestec-warning-banner__icon {
  align-items: center;
  background: #f59e0b;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 800;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.data-table-card {
  background: var(--prestec-ui-panel);
  border: 1px solid var(--prestec-ui-border);
  border-radius: var(--prestec-ui-radius-lg);
  box-shadow: var(--prestec-ui-shadow-sm);
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  width: 100%;
}

.data-table-card__header {
  align-items: center;
  border-bottom: 1px solid var(--prestec-ui-border);
  display: flex;
  justify-content: space-between;
  min-height: 48px;
  padding: 10px var(--prestec-ui-space-4);
}

.data-table-card__header strong {
  color: var(--prestec-ui-text);
  font-size: 14px;
}

.data-table-scroll {
  box-sizing: border-box;
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-gutter: stable both-edges;
  width: 100%;
}

.pagination {
  align-items: center;
  border-top: 1px solid var(--prestec-ui-border);
  display: flex;
  gap: var(--prestec-ui-space-2);
  justify-content: flex-end;
  padding: 10px var(--prestec-ui-space-4);
}

.prestec-split-action {
  display: inline-flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  position: relative;
}

.prestec-split-action .button {
  border-radius: 0;
  min-height: 30px;
}

.prestec-split-action .button:first-child {
  border-radius: var(--prestec-ui-radius-sm) 0 0 var(--prestec-ui-radius-sm);
}

.prestec-split-action .button:last-child {
  border-left: 0;
  border-radius: 0 var(--prestec-ui-radius-sm) var(--prestec-ui-radius-sm) 0;
  min-width: 32px;
  padding-left: 8px;
  padding-right: 8px;
}

.prestec-action-menu-portal {
  background: var(--prestec-ui-panel);
  border: 1px solid var(--prestec-ui-border);
  border-radius: var(--prestec-ui-radius-md);
  box-shadow: var(--prestec-ui-shadow-popover);
  display: grid;
  gap: 4px;
  min-width: 158px;
  padding: 6px;
  position: fixed;
  z-index: 3000;
}

.prestec-action-menu-portal[hidden] {
  display: none;
}

.prestec-action-menu-portal .button {
  justify-content: flex-start;
  text-align: left;
  width: 100%;
}

.prestec-action-menu-portal .danger-button {
  color: var(--prestec-ui-danger);
}

.prestec-toast-region {
  bottom: 18px;
  display: grid;
  gap: 8px;
  pointer-events: none;
  position: fixed;
  right: 18px;
  z-index: 3500;
}

.prestec-tooltip {
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

@media (max-width: 1180px) {
  .prestec-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prestec-page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .prestec-page-header__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .prestec-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.inventory-total-header-card {
  margin-bottom: var(--prestec-ui-space-3);
}

.content:has(#inventoryWorkspaceView),
.workspace:has(> #inventoryWorkspaceView),
#inventoryWorkspaceView,
#inventoryWorkspaceView .inventory-view-panel {
  max-width: 100%;
  min-width: 0;
}

.workspace:has(> #inventoryWorkspaceView) > .workspace-tabs {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
}

.workspace:has(> #inventoryWorkspaceView) > .workspace-tabs a {
  flex: 0 0 auto;
  white-space: nowrap;
}

.inventory-total-header-card .inventory-status {
  background: var(--prestec-ui-panel-soft);
  border: 1px solid var(--prestec-ui-border);
  border-radius: var(--prestec-ui-radius-sm);
  color: var(--prestec-ui-text-secondary);
  font-weight: 700;
  min-height: 32px;
  padding: 7px 10px;
}

.inventory-valuation-summary--dashboard {
  margin-bottom: var(--prestec-ui-space-3);
}

.inventory-valuation-summary--dashboard .inventory-valuation-card {
  border-radius: var(--prestec-ui-radius-lg);
}

.inventory-valuation-summary--dashboard {
  display: grid;
  gap: var(--prestec-ui-space-3);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.inventory-valuation-warning-strip {
  grid-column: 1 / -1;
}

.inventory-all-filter-pilot {
  margin-bottom: var(--prestec-ui-space-3);
}

.inventory-all-filter-pilot .inventory-items-filter-grid {
  align-items: end;
  display: grid;
  gap: var(--prestec-ui-space-3);
  grid-template-columns: minmax(260px, 1.5fr) repeat(4, minmax(150px, 1fr)) auto;
}

.inventory-all-filter-pilot label {
  display: grid;
  gap: 5px;
  margin: 0;
}

.inventory-all-filter-pilot label > span {
  color: var(--prestec-ui-text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.inventory-all-filter-pilot input,
.inventory-all-filter-pilot select,
.inventory-all-filter-pilot .inventory-searchable-code-filter input {
  height: var(--prestec-ui-control-height);
}

.inventory-all-filter-pilot .inventory-filter-actions {
  align-items: end;
  display: flex;
  min-height: var(--prestec-ui-control-height);
}

.inventory-all-filter-pilot .inventory-readonly-hint {
  border-top: 1px solid var(--prestec-ui-border);
  color: var(--prestec-ui-text-secondary);
  margin: var(--prestec-ui-space-3) 0 0;
  padding-top: var(--prestec-ui-space-3);
}

.inventory-valuation-table-card {
  margin-top: var(--prestec-ui-space-3);
}

.inventory-valuation-table-card.data-table-card {
  border-radius: var(--prestec-ui-radius-lg);
  overflow: visible;
}

.inventory-valuation-table-card .data-table-scroll {
  border-radius: 0;
  max-width: 100%;
  min-width: 0;
  width: 100%;
}

.inventory-valuation-table-card .inventory-list-table--autofit {
  min-width: 1620px;
  table-layout: fixed;
}

.inventory-valuation-table-card .inventory-list-table--autofit .col-stdCode {
  width: 132px;
}

.inventory-valuation-table-card .inventory-list-table--autofit .col-mainName {
  width: 176px;
}

.inventory-valuation-table-card .inventory-list-table--autofit .col-spec {
  width: 164px;
}

.inventory-valuation-table-card .inventory-list-table--autofit .col-unit {
  width: 58px;
}

.inventory-valuation-table-card .inventory-list-table--autofit .col-inventoryCategory {
  width: 132px;
}

.inventory-valuation-table-card .inventory-list-table--autofit .col-actualQty {
  width: 78px;
}

.inventory-valuation-table-card .inventory-list-table--autofit .col-averageCost,
.inventory-valuation-table-card .inventory-list-table--autofit .col-stockValue {
  width: 126px;
}

.inventory-valuation-table-card .inventory-list-table--autofit .col-rack {
  width: 104px;
}

.inventory-valuation-table-card .inventory-list-table--autofit .col-ownerDepartment {
  width: 162px;
}

.inventory-valuation-table-card .inventory-list-table--autofit .col-managerUser {
  width: 172px;
}

.inventory-valuation-table-card .inventory-list-table--autofit .col-status {
  width: 102px;
}

.inventory-valuation-table-card .inventory-list-table--autofit .col-_actions {
  width: 112px;
}

.inventory-valuation-table-card .inventory-list-table th,
.inventory-valuation-table-card .inventory-list-table td {
  font-size: var(--prestec-ui-font-table);
}

.inventory-row-split-action {
  width: max-content;
}

.inventory-row-split-action .button {
  line-height: 1;
}

.inventory-row-action-menu .mini-button {
  min-height: 30px;
}

.inventory-row-actions--pilot .inventory-row-secondary-actions {
  display: none;
}

.inventory-table-pagination .icon-toolbar-button {
  min-width: 34px;
}

@media (max-width: 1366px) {
  .inventory-all-filter-pilot .inventory-items-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .inventory-all-filter-pilot .inventory-filter-actions {
    align-items: stretch;
  }
}

@media (max-width: 900px) {
  .inventory-valuation-summary--dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
