/* Bonded warehouse reservation list and compact editor. */
.sale-status-pending,
.sale-status-pending:hover {
  border-color: #ef8b35 !important;
  background: #fff0df !important;
  color: #b54708 !important;
  font-weight: 900 !important;
  box-shadow: 0 0 0 2px rgba(239, 139, 53, 0.16);
}

/* Reservation list: compact, balanced columns and product master names. */
.sales-list-table {
  width: 100%;
  table-layout: fixed;
}

.sales-list-table th,
.sales-list-table td {
  padding: 7px 6px;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.sales-list-table th:nth-child(1), .sales-list-table td:nth-child(1) { width: 9%; }
.sales-list-table th:nth-child(2), .sales-list-table td:nth-child(2) { width: 8%; }
.sales-list-table th:nth-child(3), .sales-list-table td:nth-child(3) { width: 7%; }
.sales-list-table th:nth-child(4), .sales-list-table td:nth-child(4) { width: 9%; }
.sales-list-table th:nth-child(5), .sales-list-table td:nth-child(5) { width: 7%; }
.sales-list-table th:nth-child(6), .sales-list-table td:nth-child(6) { width: 10%; }
.sales-list-table th:nth-child(7), .sales-list-table td:nth-child(7) { width: 8%; }
.sales-list-table th:nth-child(8), .sales-list-table td:nth-child(8),
.sales-list-table th:nth-child(9), .sales-list-table td:nth-child(9),
.sales-list-table th:nth-child(10), .sales-list-table td:nth-child(10) { width: 6%; text-align: right; }
.sales-list-table th:nth-child(11), .sales-list-table td:nth-child(11) { width: 7%; }
.sales-list-table th:nth-child(12), .sales-list-table td:nth-child(12) { width: 6%; }
.sales-list-table th:last-child, .sales-list-table td:last-child { width: 17%; }

.sales-list-table td:last-child .table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-start;
}

.sales-list-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-left: auto;
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}

.panel-body > .sales-list-pagination {
  margin-top: 10px;
}

.sales-list-pagination .mini-button {
  min-height: 30px;
  padding: 4px 11px;
}

@media (max-width: 1100px) {
  .sales-list-table { min-width: 1180px; table-layout: fixed; }
}

.sales-order-editor.compact-create-editor {
  max-width: 1040px;
  margin-inline: auto;
}

.sales-order-editor.compact-create-editor .page-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 11px;
}

.sales-order-editor.compact-create-editor .page-fields label {
  gap: 3px;
  font-size: 13px;
  line-height: 1.2;
}

.sales-order-editor.compact-create-editor .page-fields input,
.sales-order-editor.compact-create-editor .page-fields select,
.sales-order-editor.compact-create-editor .page-fields textarea {
  min-height: 31px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 14px;
}

.sales-order-editor.compact-create-editor .sales-field-deliveryType select {
  margin-top: 6px;
}

.sales-order-editor.compact-create-editor .sales-field-note,
.sales-order-editor.compact-create-editor .sales-field-lotId,
.sales-order-editor.compact-create-editor #lot-info-panel,
.sales-order-editor.compact-create-editor #sale-lines-panel {
  grid-column: 1 / -1;
}

@media (max-width: 760px) {
  .sales-order-editor.compact-create-editor .page-fields {
    grid-template-columns: 1fr;
  }
}

dialog.compact-create-editor.sales-create-editor {
  width: min(1100px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
}

dialog.sales-create-editor .fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px 9px;
  padding: 10px 13px;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

dialog.sales-create-editor #lot-info-panel .lot-picker {
  max-height: 340px;
  overflow: auto;
}

dialog.sales-create-editor #lot-info-panel .lot-picker-title {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 7px 9px;
  background: #fff;
}

dialog.sales-create-editor #lot-info-panel table {
  width: 100%;
  min-width: 1040px;
}

dialog.sales-create-editor #lot-info-panel thead th {
  position: sticky;
  top: 33px;
  z-index: 2;
  background: #f2f7f6;
}

dialog.sales-create-editor #lot-info-panel th,
dialog.sales-create-editor #lot-info-panel td {
  padding: 6px 7px;
  font-size: 11px;
}

dialog.sales-create-editor .fields label {
  gap: 2px;
  font-size: 12px;
  line-height: 1.15;
}

dialog.sales-create-editor .fields input,
dialog.sales-create-editor .fields select,
dialog.sales-create-editor .fields textarea {
  min-height: 28px;
  height: 28px;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 13px;
}

dialog.sales-create-editor .fields textarea {
  min-height: 48px;
  height: 48px;
}

dialog.sales-create-editor .sales-field-lotId,
dialog.sales-create-editor .sales-field-note,
dialog.sales-create-editor #lot-info-panel,
dialog.sales-create-editor #sale-lines-panel {
  grid-column: 1 / -1;
}

dialog.sales-create-editor header {
  padding: 10px 14px;
}

dialog.sales-create-editor footer {
  padding: 7px 10px;
}

@media (max-width: 700px) {
  dialog.compact-create-editor.sales-create-editor {
    width: calc(100vw - 12px);
  }
  dialog.sales-create-editor .fields {
    grid-template-columns: 1fr;
  }
}
