/* This module extends the existing page; inputs and async actions keep anchors. */
#import-panel .template-download-grid {grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch}
.customer-rebate-dialog {width:min(1100px,calc(100vw - 32px));max-height:92dvh;padding:0}
.customer-rebate-dialog .dialog-shell {display:flex;flex-direction:column;max-height:92dvh;min-width:0}
.customer-rebate-body {overflow:auto;min-height:0;padding:0 24px 20px}
.customer-rebate-body>p,.customer-rebate-body details>p {color:var(--muted);line-height:1.65}
.customer-rebate-fields {display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:16px;align-items:start}
.customer-rebate-fields label {margin:0;min-width:0;display:flex;flex-direction:column;gap:8px;font-size:13px;line-height:20px}
.customer-rebate-fields input,.customer-rebate-fields select,.customer-rebate-fields button {box-sizing:border-box;width:100%;min-width:0;height:40px;margin:0;font:inherit;line-height:20px}
.customer-rebate-fields input,.customer-rebate-fields select,.customer-rebate-fields textarea {border:1px solid var(--line);border-radius:9px;background:var(--surface);padding:9px 11px;color:var(--ink)}
.customer-rebate-fields textarea {box-sizing:border-box;min-width:0;width:100%;resize:vertical;font:inherit;line-height:20px}
.rebate-month {grid-column:span 2}.rebate-project {grid-column:span 3}.rebate-load {grid-column:span 1;padding-top:28px}
.rebate-amount,.rebate-approval {grid-column:span 3}.rebate-reason {grid-column:span 6}
.customer-rebate-summary {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:18px;align-items:stretch}
.customer-rebate-summary>div {border:1px solid var(--line);border-radius:10px;background:var(--canvas);padding:12px;min-width:0}
.customer-rebate-summary small {display:block;color:var(--muted);line-height:1.5}
.customer-rebate-summary strong {display:block;margin-top:6px;font-size:18px;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.customer-rebate-remainder {font-size:13px;font-variant-numeric:tabular-nums}
.customer-rebate-table table {font-size:12px;width:100%}.customer-rebate-table th,.customer-rebate-table td {padding:10px 8px;white-space:nowrap}
.customer-rebate-table td small {display:block;color:var(--muted);margin-top:4px}.customer-rebate-pagination {display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:12px 0;font-size:13px}
.customer-rebate-pagination span {margin-right:auto;font-variant-numeric:tabular-nums}
#customer-rebate-history {border-top:1px solid var(--line);margin-top:14px;padding-top:16px}#customer-rebate-history summary {cursor:pointer;font-weight:600}
.customer-rebate-record {padding:12px;border:1px solid var(--line);border-radius:10px;margin-top:10px;overflow-wrap:anywhere}
.customer-rebate-record>div:first-child {display:flex;align-items:start;justify-content:space-between;gap:12px}.customer-rebate-record p {font-size:13px;color:var(--muted);margin:7px 0;white-space:pre-wrap}.customer-rebate-record-actions {display:flex;gap:14px}
#customer-rebate-record-detail {padding:12px;border:1px solid var(--line);border-radius:10px;margin-top:12px;overflow-wrap:anywhere;font-size:13px;line-height:1.7}
#customer-rebate-record-detail ul {padding-left:20px}
.customer-rebate-status {margin:0 24px;min-height:56px;white-space:normal;overflow-wrap:anywhere;line-height:1.55}
#customer-rebate-dialog #billing-pending-actions {position:static;width:100%;max-height:none;margin-top:12px;box-shadow:none}
.customer-rebate-actions {flex-shrink:0;gap:10px;padding:16px 24px;flex-wrap:nowrap}.customer-rebate-actions .button {height:40px;min-width:110px;white-space:nowrap}
.customer-rebate-actions #customer-rebate-close {margin-right:auto}.customer-rebate-actions #customer-rebate-save {width:154px}
@media(max-width:900px){#import-panel .template-download-grid {grid-template-columns:1fr}.customer-rebate-summary {grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.customer-rebate-dialog {width:100%;max-width:100%;margin:0;inset:auto 0 0;border-radius:16px 16px 0 0;max-height:96dvh}.customer-rebate-dialog .dialog-shell {max-height:96dvh}.customer-rebate-body {padding:0 16px 16px}.customer-rebate-dialog .dialog-heading {padding:16px}.customer-rebate-fields {grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.rebate-month,.rebate-project,.rebate-amount,.rebate-approval {grid-column:span 1}.rebate-reason,.rebate-load {grid-column:span 2}.rebate-load {padding:0}.customer-rebate-status {margin:0 16px;min-height:70px}.customer-rebate-actions {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:12px 16px calc(12px + env(safe-area-inset-bottom));gap:8px}.customer-rebate-actions .button,.customer-rebate-actions #customer-rebate-save {width:100%;min-width:0}.customer-rebate-actions #customer-rebate-close {margin:0}.customer-rebate-table {overflow:visible}.customer-rebate-table table,.customer-rebate-table tbody,.customer-rebate-table tr,.customer-rebate-table td {display:block;width:100%}.customer-rebate-table thead {display:none}.customer-rebate-table tr {padding:8px;border:1px solid var(--line);border-radius:10px;margin-bottom:10px}.customer-rebate-table td {display:flex;justify-content:space-between;gap:12px;white-space:normal;overflow-wrap:anywhere;border:none;padding:5px}.customer-rebate-table td::before {content:attr(data-label);color:var(--muted);flex-shrink:0}.customer-rebate-table td small {margin:0}.customer-rebate-summary strong {font-size:16px}}
