/* —— Suppliers directory (list / detail / rail, same desk as purchase orders) —— */
.hub-main:has(#suppliers-panel:not([hidden])) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

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

#suppliers-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

#suppliers-panel .ord-po-workspace {
  flex: 1 1 auto;
  min-height: 420px;
  height: calc(100vh - 220px);
  max-height: none;
}

#suppliers-panel .ord-po-list {
  min-height: 0;
  overflow: auto;
}

#suppliers-panel .ord-po-filters,
#suppliers-panel .ord-po-row {
  width: 100%;
  min-width: 0;
}

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

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

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

#suppliers-panel .cat-list-sticky .ord-po-list-tools {
  width: 100%;
}

#suppliers-panel .ord-po-row.is-inactive {
  opacity: 0.6;
}

.cat-supplier-detail {
  padding: var(--nav-gap) var(--nav-gap) var(--nav-gap) 0;
  overflow: auto;
  height: 100%;
  align-content: start;
  box-sizing: border-box;
  font-size: 0.9rem;
  background: var(--bg);
  gap: var(--nav-gap);
}

.cat-supplier-detail .ord-po-number {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--brand);
}

.cat-supplier-detail .ord-po-detail-sub {
  margin: 2px 0 0;
}

.cat-supplier-form-wrap {
  display: grid;
  gap: var(--nav-gap);
  width: 100%;
  max-width: none;
}

#suppliers-panel .cat-detail-section {
  border: 0;
  background: var(--surface);
  border-radius: var(--radius);
}

#suppliers-panel .cat-detail-section-title {
  margin: 0;
  padding: 8px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border-bottom: 0;
}

.cat-supplier-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
}

.cat-supplier-form .field {
  min-width: 0;
  margin: 0;
}

.supplier-order-days-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.supplier-order-days-head span {
  margin-bottom: 0;
}

.supplier-order-days-field [data-order-days] {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.supplier-order-day {
  display: flex;
  align-items: center;
  gap: 8px;
}

.supplier-order-day select {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.supplier-order-days-field .btn-small {
  white-space: nowrap;
}

.cat-supplier-form .field span {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.cat-supplier-form .field input,
.cat-supplier-form .field select,
.cat-supplier-form .field textarea {
  width: 100%;
  box-sizing: border-box;
  font-size: 0.92rem;
  min-height: 34px;
  padding: 8px 10px;
  box-shadow: none;
}

.cat-supplier-form .field textarea {
  min-height: 72px;
  resize: vertical;
}

.cat-supplier-form .field select {
  padding-right: 28px;
}

.cat-supplier-form .field-span-2,
.cat-supplier-form .due.field-span-2 {
  grid-column: span 2;
}

.cat-supplier-form .check-inline,
.cat-supplier-form-wrap > .error {
  grid-column: 1 / -1;
  margin: 0;
}

.cat-supplier-form .check-inline {
  font-size: 0.84rem;
  padding-top: 4px;
}

#suppliers-panel .supplier-orderable {
  font-size: inherit;
}

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

@media (max-width: 900px) {
  #suppliers-panel .ord-po-workspace .ord-po-layout.is-split {
    grid-template-columns: 1fr !important;
  }

  #suppliers-panel .ord-po-workspace .ord-po-split {
    display: none;
  }
}

@media (max-width: 640px) {
  .cat-supplier-form {
    grid-template-columns: 1fr;
  }

  .cat-supplier-form .field-span-2,
  .cat-supplier-form .due.field-span-2 {
    grid-column: auto;
  }
}
