.purchase-line-selection {
  display: flex;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
  gap: 8px;
  margin: 0;
}

.purchase-line-selection input[type="checkbox"] {
  width: auto;
  flex: 0 0 auto;
  margin: 2px 0 0;
}

.purchase-feedback-line {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #e5ece8;
}

.purchase-feedback-line .purchase-line-selection,
.purchase-feedback-line .legacy-purchase-summary {
  grid-column: 1 / -1;
  width: 100%;
}

.purchase-feedback-line > button {
  width: 100%;
}

.purchase-batch-actions {
  margin: 8px 0;
}

.supplier-purchase-heading-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.supplier-purchase-heading-row .supplier-purchase-heading {
  margin: 0;
}

.customer-purchase-order {
  margin-top: 12px;
  border: 1px solid #c9ded4;
  border-radius: 8px;
}

.customer-purchase-order-heading {
  margin: 0;
  padding: 9px 10px;
  border-bottom: 1px solid #c9ded4;
  border-radius: 8px 8px 0 0;
  background: #edf6f1;
  color: #075f43;
  font-size: 14px;
}

.customer-purchase-order .purchase-table {
  padding: 0 4px 4px;
}

.purchase-navigation {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
}

.purchase-stage-tabs,
.purchase-view-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.purchase-stage-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.purchase-view-tabs {
  width: calc(50% - 4px);
  padding-left: 18px;
  border-left: 3px solid #b9d3c7;
}

.purchase-stage-tabs button,
.purchase-view-tabs button {
  width: 100%;
  padding: 8px 10px;
  white-space: normal;
}

.review-purchase-stage,
.review-purchase-view {
  font-weight: 700;
}

.purchase-table {
  overflow: visible;
}

.purchase-table table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 13px;
}

.purchase-table th,
.purchase-table td {
  padding: 6px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.purchase-table-pending th:nth-child(1) { width: 11%; }
.purchase-table-pending th:nth-child(2) { width: 15%; }
.purchase-table-pending th:nth-child(3) { width: 7%; }
.purchase-table-pending th:nth-child(4) { width: 6%; }
.purchase-table-pending th:nth-child(5) { width: 8%; }
.purchase-table-pending th:nth-child(6) { width: 8%; }
.purchase-table-pending th:nth-child(7) { width: 9%; }
.purchase-table-pending th:nth-child(8) { width: 11%; }
.purchase-table-pending th:nth-child(9) { width: 16%; }
.purchase-table-pending th:nth-child(10) { width: 9%; }

.purchase-table-summary th:nth-child(1) { width: 20%; }
.purchase-table-summary th:nth-child(2) { width: 25%; }
.purchase-table-summary th:nth-child(3) { width: 18%; }
.purchase-table-summary th:nth-child(4) { width: 25%; }
.purchase-table-summary th:nth-child(5) { width: 12%; }

.purchase-table button {
  padding: 6px 8px;
  white-space: normal;
}

.purchase-table .purchase-price-editor,
.purchase-table .purchase-feedback-line {
  flex-wrap: wrap;
}

.purchased-logistics-cell {
  display: grid;
  gap: 7px;
  min-width: 0;
  white-space: normal;
}

.purchased-logistics-entry {
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.purchase-logistics-fill {
  justify-self: start;
  padding: 6px 10px;
  white-space: normal;
}

.stock-planning-workspace {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.stock-planning-filters, .stock-planning-status-tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.stock-planning-filters input { flex: 1 1 220px; min-width: 0; max-width: 460px; }
.stock-planning-filters select { width: auto; }
.stock-planning-status-tabs button { min-height: 40px; padding: 8px 12px; }
.stock-planning-workspace td { white-space: pre-line; overflow-wrap: anywhere; }
.stock-planning-workspace table:first-child td:nth-child(2) { overflow-wrap: normal; }
.stock-planning-workspace details > summary { cursor: pointer; }
@media (max-width: 600px) {
  .stock-planning-filters input { flex-basis: 100%; }
  .stock-planning-category-tabs { flex-wrap: wrap; }
}

.stock-planning-workspace h3 {
  margin: 10px 0 0;
}

.stock-planning-note,
.stock-planning-empty {
  margin: 0;
  color: #52655d;
  line-height: 1.55;
}

.stock-planning-actions {
  flex-wrap: wrap;
  min-width: 150px;
}

.stock-planning-category-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.stock-planning-category-tabs button {
  width: 100%;
}

.stock-planning-workspace .table-wrap {
  overflow-x: auto;
}

.stock-planning-workspace table {
  min-width: 1050px;
}

@media (max-width: 640px) {
  .purchase-stage-tabs {
    grid-template-columns: 1fr;
  }
  .purchase-view-tabs {
    width: 100%;
    padding-left: 12px;
  }

  .purchase-table table {
    font-size: 12px;
  }

  .purchase-table th,
  .purchase-table td {
    padding: 4px;
  }

  .customer-purchase-order-heading {
    font-size: 13px;
  }
}
