.payment-dialog{width:min(1440px,96vw);max-width:96vw;max-height:92vh;padding:24px;border:1px solid var(--line,#dde3ec);border-radius:16px;color:var(--ink,#172033);background:var(--surface,#fff)}
.payment-dialog::backdrop{background:#10182866}.payment-dialog form{min-width:0}.payment-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.payment-fields label,.payment-candidates label{display:grid;gap:6px}.payment-dialog input:not([type=checkbox]),.payment-dialog select,.payment-dialog textarea{width:100%;min-width:0;box-sizing:border-box;padding:10px;border:1px solid #ccd4df;border-radius:8px;font:inherit;background:#fff;color:#172033}.payment-group{border:1px solid #dde3ec;border-radius:12px;padding:16px;margin:16px 0}.payment-group-heading{display:flex;flex-wrap:wrap;align-items:center;gap:16px;justify-content:space-between}.payment-group-heading label{display:flex;align-items:center;gap:8px}.payment-candidates{min-width:1100px}.payment-candidates td{vertical-align:top;min-width:140px}.payment-candidates small,#paymentList small{display:block;margin-top:5px;color:#687386}.payment-candidates .payment-invoice{display:flex;align-items:center;margin-top:8px}.payment-note{padding:12px;background:#f3f6fa;border-radius:8px;line-height:1.7}.payment-total{font-size:18px;font-weight:700}.payment-issue{color:#a13434!important}.payment-dialog .dialog-actions{position:sticky;bottom:-24px;background:#fff;padding:16px 0;display:flex;flex-wrap:wrap;gap:8px}.payment-dialog [role=alert]{white-space:pre-wrap}.payment-dialog a{overflow-wrap:anywhere}.payment-group p{line-height:1.7}
@media(max-width:800px){.payment-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){.payment-dialog{padding:12px}.payment-fields{grid-template-columns:1fr}.payment-dialog button,.payment-dialog input:not([type=checkbox]),.payment-dialog select{min-height:44px}.payment-group{padding:10px}.payment-group-heading{display:grid}.payment-dialog .dialog-actions{bottom:-12px}}

.payment-dialog .dialog-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}
.payment-dialog .dialog-header h2{margin:0;font-size:22px}.payment-dialog .dialog-header button{flex:0 0 auto}
.payment-dialog input[type=checkbox]{width:18px;height:18px;min-width:18px;margin:0;flex:0 0 auto}
.payment-candidates .payment-order-choice{display:flex;align-items:center;gap:8px;font-weight:600}
.payment-group-heading select{width:auto;min-width:130px}.payment-group-heading label{white-space:normal}
.payment-dialog [role=alert]:not(:empty){padding:12px;border-radius:8px;background:#f3f6fa}
@media(max-width:800px){
 .payment-dialog .invoice-scroll .payment-candidates{display:block;min-width:0;width:100%}.payment-candidates thead{display:none}.payment-candidates tbody{display:grid;gap:14px}
 .payment-candidates tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:14px;border:1px solid #dde3ec;border-radius:10px}
 .payment-candidates td{display:block;min-width:0;padding:0;border:0;overflow-wrap:anywhere}.payment-candidates td[data-label]::before{content:attr(data-label);display:block;font-weight:600;color:#344054;margin-bottom:8px}
 .payment-candidates td[colspan]{grid-column:1/-1}.payment-group .invoice-scroll:has(.payment-candidates){overflow:visible}
}
@media(max-width:600px){.payment-candidates tr{grid-template-columns:1fr}.payment-group-heading{gap:12px}.payment-dialog .dialog-header h2{font-size:19px}.payment-dialog .dialog-actions{gap:10px}.payment-dialog .dialog-actions button{flex:1 1 140px}}

.payment-supplier-section{margin:20px 0 32px;min-width:0}.payment-supplier-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap}.payment-supplier-heading h3{margin:0 0 6px}.payment-supplier-search{display:grid;gap:8px;margin:16px 0;max-width:640px}.payment-supplier-table{width:100%;min-width:1100px}.payment-supplier-table .payment-number{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}.payment-supplier-table .payment-balance{color:#087e82;font-weight:700}.payment-supplier-actions{display:flex;align-items:center;gap:8px;white-space:nowrap}.payment-supplier-actions button{white-space:nowrap}.payment-supplier-detail>td{padding:16px 24px;background:#f5f8fa}.payment-supplier-detail[hidden]{display:none}.payment-supplier-detail p{margin:0 0 12px}@media(max-width:600px){.payment-supplier-search input,.payment-supplier-actions button{min-height:44px}}

.payment-percent-input{display:flex;align-items:center;gap:8px;min-width:0}.payment-percent-input>input{flex:1;min-width:0}.payment-percent-input>span{flex:0 0 auto;font-weight:600}.payment-dialog input[readonly]{background:#f3f6fa;color:#52635a}

.payment-contract-order{padding:12px 0;border-top:1px solid #dde3ec;overflow-wrap:anywhere}.payment-contract-file{margin:8px 0}.payment-contract-order label{display:grid;gap:8px;margin-top:12px}.payment-contract-order input[type=file]{max-width:100%;min-width:0}

.payment-receipt-link{display:block;margin:4px 0;white-space:normal}.payment-receipt-link button{white-space:normal;overflow-wrap:anywhere}.payment-receipt-link a{margin-left:6px}

/* Payment editor: compact sections, contextual empty state, one action footer. */
.payment-dialog{width:min(1440px,96vw);padding:24px;max-height:94vh}
.payment-dialog h3{font-size:16px;margin:0 0 16px;color:#172033}
.payment-dialog [hidden]{display:none!important}
.payment-basic{padding:0 0 20px;border-bottom:1px solid #e4e9ef}
.payment-fields{gap:16px 20px}
.payment-fields label>span{font-size:13px;font-weight:500;color:#526174}
.payment-fields input:not([type=checkbox]),.payment-fields select{height:42px}
.payment-fields textarea{height:42px;min-height:42px;resize:vertical}
.payment-bank-note{margin:16px 0 0;padding:10px 12px;font-size:13px}
.payment-orders-section{padding-top:22px}
.payment-section-heading{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;margin-bottom:12px}
.payment-section-heading h3{margin:0}
.payment-section-hint{font-size:13px;color:#687386;line-height:1.6;margin:0 0 12px}
.payment-section-heading .payment-section-hint{margin:0}
.payment-empty{padding:28px 16px;text-align:center;background:#f7f9fb;border:1px dashed #d8e0e9;border-radius:10px;color:#687386;font-size:14px}
.payment-group{margin:12px 0;padding:16px;background:#fff}
.payment-group-heading{justify-content:flex-start;gap:12px}
.payment-group-heading>label:first-child{font-weight:600;white-space:nowrap}
.payment-group-heading select{width:150px;height:40px}
.payment-group-heading .payment-other-orders{font-size:13px;font-weight:400;color:#687386;margin-left:auto}
.payment-group-heading>button{font-size:13px}
.payment-group-heading+p{font-size:13px;color:#687386;margin:10px 0 14px}
.payment-no-orders{min-width:0!important;width:100%}
.payment-no-orders thead{display:none}
.payment-no-orders td{padding:24px!important;text-align:center;color:#687386;background:#f7f9fb;border:0!important}
.payment-candidates th{font-size:12px;white-space:nowrap}
.payment-candidates td{padding:14px 10px;line-height:1.6;font-size:13px}
.payment-candidates td:nth-child(5){background:#f8fbfb}
.payment-candidates label{font-size:13px}
.payment-candidates input:not([type=checkbox]){padding:8px}
#paymentContracts{margin:20px 0 0;background:#fafbfc}
#paymentContracts h3{margin-bottom:8px}
.payment-contract-order{padding:12px 0;border-top:1px solid #e4e9ef}
.payment-contract-order>p{font-size:13px;margin:5px 0 10px;color:#687386}
.payment-footer{position:sticky;bottom:-24px;z-index:3;display:flex;align-items:center;justify-content:space-between;gap:16px;background:#fff;border-top:1px solid #e4e9ef;margin-top:22px;padding:16px 0 4px}
.payment-footer .payment-total{font-size:16px;margin:0;line-height:1.5}
.payment-footer .dialog-actions{position:static;padding:0;margin:0;justify-content:flex-end}
@media(max-width:900px){.payment-group-heading .payment-other-orders{margin-left:0}.payment-footer{align-items:flex-start;flex-wrap:wrap}.payment-section-hint{font-size:12px}}
@media(max-width:600px){.payment-dialog{padding:16px}.payment-footer{bottom:-16px;padding:12px 0 4px;gap:10px}.payment-footer .dialog-actions{width:100%}.payment-footer .dialog-actions button{flex:1 1 auto}.payment-group-heading{display:flex}.payment-group-heading .payment-other-orders{flex-basis:100%}.payment-section-heading{gap:6px}.payment-basic{padding-bottom:16px}}

.payment-payer-dialog{width:min(720px,94vw);max-width:94vw;max-height:90vh;padding:24px;border:1px solid #dde3ec;border-radius:14px;color:#172033;background:#fff}
.payment-payer-dialog::backdrop{background:#10182866}
.payment-payer-dialog .dialog-header{display:flex;align-items:center;justify-content:space-between;gap:16px}
.payment-payer-dialog [data-payer-form]{display:grid;gap:14px;margin-top:18px}
.payment-payer-dialog [data-payer-form] label{display:flex;align-items:center;gap:8px}
.payment-payer-dialog [data-payer-form] label:has([name=name]){display:grid}
.payment-payer-dialog [name=name]{width:100%;box-sizing:border-box;padding:10px;border:1px solid #ccd4df;border-radius:8px;font:inherit}
.payment-payer-dialog .dialog-actions{display:flex;justify-content:flex-end;gap:8px}
.payment-payer-dialog .invoice-scroll{max-height:38vh;overflow:auto}
@media(max-width:600px){.payment-payer-dialog{padding:16px}.payment-payer-dialog button,.payment-payer-dialog [name=name]{min-height:44px}}

.payment-buyer-filter{display:flex;align-items:center;gap:8px;margin-left:auto;white-space:nowrap;font-size:13px;color:#526174}
.payment-buyer-filter select{width:auto;min-width:150px;height:40px}
.payment-candidates:not(.payment-no-orders){min-width:1200px}
.payment-candidates td:nth-child(6){background:#f8fbfb}
.payment-candidates td:nth-child(5){background:transparent}
@media(max-width:900px){.payment-buyer-filter{margin-left:0}}
@media(max-width:800px){.payment-candidates:not(.payment-no-orders){min-width:0}}
