/* Keep the history and its pagination within the payment panel. */
#receivableInvoiceDetails {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: minmax(0, 1fr);
}
#receivableInvoiceDetails.hidden { display: none !important; }
#receivableInvoiceDetails .receivable-invoice-card { min-width: 0; max-width: 100%; }
#receivableInvoiceDetails .erp-pagination,
#receivablePaymentHistory .erp-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}
#receivableInvoiceDetails .invoice-pagination-pages,
#receivablePaymentHistory .invoice-pagination-pages { flex-wrap: wrap; }
#receivableInvoiceDetails .receivable-invoice-columns,
#receivableInvoiceDetails .receivable-invoice-link .receivable-invoice-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .7fr) minmax(0, 1fr);
  column-gap: 16px;
  padding: 8px 10px;
}
#receivableInvoiceDetails .receivable-invoice-columns { font-size: 10px; color: #6e6e73; }
#receivableInvoiceDetails .receivable-invoice-columns > :not(:first-child) { text-align: right; }
#receivableInvoiceDetails .receivable-invoice-line > * {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.65;
}
#receivableInvoiceDetails .receivable-invoice-line b { font-weight: 500; }
#receivableInvoiceDetails .receivable-invoice-total { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
#receivableInvoiceDetails .receivable-invoice-total b { text-align: right; overflow-wrap: anywhere; }
#receivableInvoiceDetails .receivable-invoice-head > * { min-width: 0; overflow-wrap: anywhere; }

/* Payment entry uses the same quiet, unboxed hierarchy as order entry. */
.receivable-payment-panel { min-width: 0; container-type: inline-size; }
.receivable-payment-panel > .panel-head {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #dedee2;
}
.receivable-payment-panel > .panel-head h2 { font-size: 17px; font-weight: 600; line-height: 1.7; }
.receivable-payment-panel #receivableSelectedMeta {
  padding: 0;
  margin: 0 0 16px;
  min-height: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
#receivableSelectedMeta strong { font-size: 14px; font-weight: 500; line-height: 1.7; }
#receivableSelectedMeta .receivable-customer-label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.7;
  color: #6e6e73;
}
#receivableSelectedMeta small { display: block; margin-top: 3px; font-size: 11px; font-weight: 400; color: #6e6e73; }
#receivablePaymentSummary .receivable-grand-total {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  padding: 0 0 14px;
  margin: 0 0 16px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #dedee2;
  border-radius: 0;
}
#receivablePaymentSummary .receivable-total-box { min-width: 0; background: transparent; padding: 0; }
#receivablePaymentSummary .receivable-total-box span { font-size: 11px; font-weight: 400; color: #6e6e73; line-height: 1.7; }
#receivablePaymentSummary .receivable-total-box b { display: block; font-size: 17px; font-weight: 500; color: #36363b; overflow-wrap: anywhere; line-height: 1.65; }
#receivablePaymentSummary .receivable-total-box.due b { font-size: 19px; font-weight: 600; color: #9d3535; }
#receivablePaymentSummary .receivable-grand-total > small { grid-column: 1 / -1; font-size: 11px; font-weight: 400; color: #6e6e73; }
#receivablePaymentForm { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
#receivablePaymentForm label { min-width: 0; margin: 0; }
#receivablePaymentForm label > span { font-size: 12px; font-weight: 400; line-height: 1.65; color: #62626b; }
#receivablePaymentForm input, #receivablePaymentForm select { width: 100%; min-width: 0; height: 44px; min-height: 44px; font-size: 13px; box-sizing: border-box; }
#receivablePaymentForm .form-actions { margin-top: 2px; gap: 10px; flex-wrap: wrap; }
.receivable-payment-panel .receivable-history-toggle { min-height: 42px; font-size: 12px; font-weight: 500; }
@container (min-width: 330px) {
  #receivablePaymentForm { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  #receivablePaymentForm > label,
  #receivablePaymentForm > .form-actions { grid-column: 1 / -1; }
  #receivablePaymentForm > .receivable-entry-date,
  #receivablePaymentForm > .receivable-entry-method { grid-column: auto; }
}
