/* Price Lists — same list / detail window as the other stock tables. */
.hub-main:has(#price-lists-panel:not([hidden])) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hub-main:has(#price-lists-panel:not([hidden])) > .subnav {
  flex: 0 0 auto;
}

.hub-main:has(#price-lists-panel:not([hidden])) > .stage {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#price-lists-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#price-lists-panel .ord {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#price-lists-panel .ord-po-workspace {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
}

#price-lists-panel .ord-po-list,
#price-lists-panel .price-lines {
  min-height: 0;
  overflow: auto;
}

#price-lists-panel .ord-po-table,
#price-lists-panel .price-lines.ord-po-table {
  overflow: visible;
}

#price-lists-panel .cat-list-sticky {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface-2);
  width: max-content;
  min-width: 100%;
}

#price-lists-panel .cat-list-sticky .ord-po-list-tools,
#price-lists-panel .cat-list-sticky .ord-po-filters {
  position: static;
  background: var(--surface-2);
}

#price-lists-panel .ord-po-filters input {
  height: var(--list-row-height);
  min-height: var(--list-row-height);
  max-height: var(--list-row-height);
  padding: 0 8px;
  font-size: 0.86rem;
  box-shadow: none;
}

#price-lists-panel .ord-po-filters .ord-sort-head,
#price-lists-panel .ord-po-col strong,
#price-lists-panel .ord-po-row .ord-po-col {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#price-lists-panel .ord-po-detail-pane {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#price-lists-panel .cat-price-detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 0;
  gap: 0;
  box-sizing: border-box;
}

#price-lists-panel .cat-price-detail .ord-po-detail-head {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

#price-lists-panel .ord-po-detail-sub {
  margin: 2px 0 0;
}

/* Same scroller as the list on the left. The table is only as tall as its rows. */
#price-lists-panel .price-lines {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 0;
  border-top: 0;
  background: var(--surface);
}

#price-lists-panel .price-lines > .ord-po-table {
  display: block;
  flex: 0 0 auto;
  height: auto;
  overflow: visible;
}

#price-lists-panel .price-lines .ord-po-row {
  width: max-content;
  min-width: var(--ord-po-min, 100%);
  cursor: default;
  background: var(--surface);
}

#price-lists-panel .price-lines .ord-po-row:hover {
  background: var(--surface-2);
}

#price-lists-panel .ord-po-row input,
#price-lists-panel .ord-po-row select {
  min-height: 22px;
  height: 22px;
  max-height: 22px;
  padding: 0 8px;
  font-size: 0.92rem;
  color: var(--ink);
  background-color: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  background-clip: padding-box;
  color-scheme: dark;
}

#price-lists-panel .ord-po-row input[type="number"] {
  appearance: auto;
  -webkit-appearance: auto;
}

html[data-theme="light"] #price-lists-panel .ord-po-row input,
html[data-theme="light"] #price-lists-panel .ord-po-row select {
  background-color: #ffffff;
  border-color: rgba(0, 0, 0, 0.18);
  color-scheme: light;
}

#price-lists-panel .ord-po-row input:focus,
#price-lists-panel .ord-po-row select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
}

html[data-theme="light"] #price-lists-panel .ord-po-row input:focus,
html[data-theme="light"] #price-lists-panel .ord-po-row select:focus {
  border-color: rgba(0, 0, 0, 0.35);
}

#price-lists-panel .ord-po-col input,
#price-lists-panel .ord-po-col select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#price-lists-panel .ord-po-row select {
  padding-right: 28px;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 8px center;
}

#price-lists-panel .ord-po-actions-rail .ord-po-action-btn.is-selected {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
}

#price-lists-panel .price-readonly {
  color: var(--muted);
}

#price-lists-panel .price-history {
  list-style: none;
  margin: 0;
  padding: 0 4px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#price-lists-panel .price-history li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

#price-lists-panel .price-history span,
#price-lists-panel .ord-po-detail .ord-po-actions-title {
  color: var(--muted);
  font-size: 12px;
}

#price-lists-panel .ord-po-number {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand);
}
