/* The customer counter has one sheet layout: fixed header and actions, independently scrolling body. */
.cw-profile-balances{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:1px 20px 16px}
.cw-balance-card{min-width:0;display:flex;gap:12px;align-items:flex-start;background:#fff;border:1px solid #d6e2ed;border-radius:7px;padding:13px 14px;box-shadow:0 2px 5px #173c6409}
.cw-balance-card>div{min-width:0}.cw-balance-card small,.cw-balance-card strong,.cw-balance-note{display:block}
.cw-balance-card small{font-size:13px;font-weight:700;color:#32597d}.cw-balance-card strong{font-size:clamp(18px,2vw,25px);line-height:1.3;margin-top:3px;font-variant-numeric:tabular-nums}
.cw-balance-note{margin-top:4px;font-size:12px;font-weight:600;line-height:1.5;color:#506984;overflow-wrap:anywhere}
.cw-balance-icon{display:grid;place-items:center;flex:none;width:36px;height:36px;border-radius:6px;background:#e8f4ff;color:#085694}
.cw-balance-icon .iw-icon{width:19px;height:19px}.cw-balance-owed{border-color:#ebbdc5;background:#fff8f9}.cw-balance-owed .cw-balance-icon{color:#a21836;background:#fce7ec}
.cw-due-amount{color:#a31835;background:#fde8ed;display:inline-block;padding:1px 5px;border-radius:4px;font-weight:750;font-variant-numeric:tabular-nums;white-space:nowrap}
.cw-balance-card .cw-due-amount{padding-inline:6px;max-width:100%;white-space:normal;overflow-wrap:anywhere}.cw-balance-card strong{overflow-wrap:anywhere}.cw-balance-note .cw-due-amount{font-size:inherit}
.cw-balance-muted{color:#486581;font-variant-numeric:tabular-nums}.cw-advance-amount{color:#14604c;font-weight:650;font-variant-numeric:tabular-nums}.cw-points-review{color:#844206;text-decoration:underline}
.cw-profile .cw-facts>:not(details){overflow-wrap:anywhere}

.modal:has(.cw-sheet,.cw-single-payment){background:#142e4a80;z-index:80;overflow:hidden}
.modal:has(.cw-sheet){padding:16px}
body:has(.modal :is(.cw-sheet,.cw-single-payment)){overflow:hidden}
body:has(.modal :is(.cw-sheet,.cw-single-payment)) #toast{z-index:81}
.modal:has(.cw-sheet[data-position="bottom"]){place-items:end center;padding:0 14px}
.modal:has(.cw-sheet[data-position="side"]){place-items:center end;padding:0}
.modal .cw-dialog.cw-sheet,.cw-otp-dialog[open]{font:600 14px/1.45 "Amar Inventory Manrope",Manrope,Arial,sans-serif;background:#fff;color:#173453;
 width:min(560px,100%);max-width:100%;max-height:calc(100dvh - 32px);min-height:0;margin:0;overflow:hidden;display:grid;
 grid-template-rows:auto minmax(0,1fr) auto;border:1px solid #ccdae8;border-radius:9px;padding:0;box-shadow:0 18px 62px #102b4a45}
.modal .cw-sheet[data-size="wide"]{width:min(800px,100%)}
.modal .cw-sheet[data-position="bottom"]{max-height:min(810px,94dvh);border-radius:9px 9px 0 0}
.modal .cw-sheet[data-position="side"]{width:min(890px,100%);min-height:min(620px,100dvh);max-height:100dvh;border-radius:9px 0 0 9px}
@media(prefers-reduced-motion:no-preference){
 .modal .cw-sheet{animation:cw-sheet-enter .16s ease-out both}
 @keyframes cw-sheet-enter{from{opacity:.55;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
}
.cw-sheet-head,.cw-dialog.cw-sheet>.cw-sheet-head,.cw-otp-dialog>.cw-sheet-head{padding:12px 16px;min-height:62px;flex-wrap:nowrap;gap:11px;display:grid;align-items:center;grid-template-columns:auto minmax(0,1fr) auto;background:#064d99;color:#fff;position:static}
.cw-sheet-head h2,.cw-dialog.cw-sheet>.cw-sheet-head h2,.cw-otp-dialog .cw-sheet-head h2{font-size:19px;line-height:1.25;margin:0;color:#fff;letter-spacing:0;text-transform:none;overflow-wrap:anywhere;font-weight:750}
.cw-sheet-head p,.cw-otp-dialog .cw-sheet-head p{color:#e4f1ff;font-size:12px;line-height:1.4;margin:3px 0 0;overflow-wrap:anywhere}
.cw-sheet-icon{display:grid;place-items:center;width:37px;height:37px;border:1px solid #ffffff4a;border-radius:6px;background:#ffffff20;color:#fff}
.cw-sheet-head .iw-icon{width:19px;height:19px}
.cw-sheet .cw-sheet-head button,.cw-otp-dialog .cw-sheet-head button{display:grid;place-items:center;min-width:36px;height:36px;border:1px solid #ffffff43;border-radius:6px;background:#ffffff12;color:#fff;padding:5px}
.cw-sheet .cw-sheet-head button:hover,.cw-otp-dialog .cw-sheet-head button:hover{background:#ffffff30}
.cw-sheet-body{min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;padding:16px 18px;scrollbar-gutter:stable;overflow-wrap:anywhere}
.cw-sheet-body>form,.cw-sheet-body>section{min-width:0}.cw-sheet-body>p:first-child{margin-top:0}
.cw-sheet-body .cw-sheet-lede{margin:0 0 12px;color:#3f5a77}.cw-sheet-muted{color:#526b85}
.cw-sheet-footer{background:#f7fafd;border-top:1px solid #d7e2ee;padding:10px 16px max(10px,env(safe-area-inset-bottom));min-width:0;margin:0}
.cw-sheet-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;align-items:center}
.cw-sheet-actions button,.cw-sheet-body button:not([role="switch"]),.cw-otp-dialog .cw-sheet-actions button{min-height:38px;border-radius:5px;padding:7px 12px;text-align:center;font:inherit;line-height:1.3;cursor:pointer}
.cw-sheet-actions button{background:white;border:1px solid #afc3d8;color:#124c83;max-width:100%;flex-shrink:1}
.cw-sheet :is(.cw-sheet-primary,.btn),.cw-otp-dialog .cw-sheet-actions [data-submit]{background:#0878bf;border:1px solid #0878bf;color:white;font-weight:750}
.cw-sheet .cw-sheet-danger{background:#a51c36;border:1px solid #a51c36;color:#fff;font-weight:750}
.cw-sheet-actions button:not(:disabled):hover{filter:brightness(.94)}
.cw-sheet-actions button:disabled,.cw-otp-dialog button:disabled{opacity:.55;cursor:not-allowed}
.cw-sheet :focus-visible,.cw-otp-dialog :focus-visible{outline:2px solid #088bd5;outline-offset:2px}
.cw-sheet-head button:focus-visible{outline-color:#b7e7ff}
.cw-sheet [hidden],.cw-otp-dialog [hidden]{display:none!important}
.cw-sheet-footer [data-error]:empty,.cw-sheet-footer [data-summary]:empty,.cw-sheet [data-review]:empty{display:none}
.cw-sheet-footer [data-error]:not(:empty),.cw-sheet-review:not(:empty),.cw-sheet [data-review]:not(:empty){margin:0 0 9px;padding:8px 10px;background:#edf5ff;border:1px solid #c0d9ee;border-radius:5px;color:#133e68;overflow-wrap:anywhere}
.cw-sheet-footer [data-error]:not(:empty){background:#fff0f2;border-color:#f2c1cb;color:#96213a}
.cw-sheet-body :is(label,legend){font-weight:700;color:#264e73}.cw-sheet-body label{display:grid;min-width:0;gap:5px}
.cw-sheet-body :is(input:not([type="checkbox"],[type="radio"],[type="range"]),select,textarea){
 width:100%;min-width:0;max-width:100%;min-height:40px;font:inherit;font-size:14px;font-weight:600;line-height:1.4;
 color:#183d60;background:white;border:1px solid #b9cbdd;border-radius:5px;padding:8px 10px}
.cw-sheet-body input[readonly]{background:#edf2f8;color:#49637d}.cw-sheet-body textarea{resize:vertical;max-height:34dvh}
.cw-sheet-body :is(.cw-sheet-check,.cw-otp-consent){display:flex;gap:9px;align-items:flex-start;padding:10px;border-radius:5px;background:#f3f8fd;margin:0}
.cw-sheet-check input,.cw-otp-consent input{margin:3px 0 0;flex:none}
.cw-sheet-body :is(.cw-editgrid,.cw-sheet-grid,.cw-voucher-grid){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
.cw-sheet-body .cw-voucher-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.cw-sheet-panel,.cw-sheet-body>form>details{margin:0;padding:12px;border:1px solid #d6e2ee;border-radius:6px;background:#f8fbff;min-width:0}
.cw-sheet-panel h3,.cw-sheet-panel .cw-dialog-line h3{font-size:14px;margin:0 0 9px;color:#174c7d}
.cw-sheet-panel .cw-dialog-line h3{margin:0}.cw-sheet-panel .cw-dialog-line{margin-bottom:8px;flex-wrap:wrap}
.cw-sheet-panel .cw-dialog-line button{display:inline-flex;align-items:center;gap:5px}
.cw-sheet-note{display:flex;gap:9px;align-items:flex-start;padding:9px 11px;background:#edf6ff;border:1px solid #cadff2;color:#244d73;border-radius:5px;font-size:13px;margin:2px 0 8px}
.cw-sheet-note>span{display:grid;place-items:center;color:#175d93;flex:none}.cw-sheet-note .iw-icon{width:17px;height:17px}
.cw-sheet-note[data-tone="warning"]{background:#fff3e6;border-color:#f2d7b4;color:#704319}.cw-sheet-note[data-tone="warning"]>span{color:#954120}
.cw-address-tile{display:flex;gap:9px;align-items:flex-start;padding:7px 9px;border:1px solid #ddE7f3;border-radius:5px;background:#fff;margin:5px 0;color:#2c4c69}
.cw-address-tile .iw-icon{flex:none;color:#176197}.cw-address-tile p{margin:0!important}
.cw-payment-choices{display:grid;gap:9px}
.cw-sheet-body .cw-payment-choices>button{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;gap:10px;align-items:center;
 color:#154f85;background:#f7fbff;border:1px solid #bfd6ea;text-align:left;padding:10px;min-width:0}
.cw-payment-choices>button:hover{background:#eaf6ff}.cw-payment-choices>button>span:first-child{display:grid;place-items:center;width:32px;height:32px;border-radius:5px;background:#e6f2ff}
.cw-payment-choices b,.cw-payment-choices small{display:block}.cw-payment-choices small{font-size:12px;color:#466582;margin-top:3px}
.cw-reminder-summary,.cw-print-totals{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));background:#f2f8ff;border:1px solid #ccdff0;border-radius:6px;padding:11px;gap:10px;margin:0 0 10px}
.cw-reminder-summary :is(small,strong,b),.cw-print-totals dt,.cw-print-totals dd{display:block}.cw-reminder-summary small,.cw-print-totals dt{color:#355b80;font-size:12px;margin:0 0 4px}
.cw-print-totals dd{margin:0}.cw-print-mast{display:flex;align-items:center;gap:9px;margin:0 0 13px;border-bottom:1px solid #dce8f3;padding-bottom:9px}
.cw-print-mast small{display:block;font-size:12px}.cw-print-mast img{width:42px;height:42px;border-radius:50%}.cw-print-preview{border:1px solid #d6e3eb;border-radius:5px;padding:13px}
.cw-print-preview h3,.cw-print-preview h4,.cw-print-preview p{margin:6px 0}.cw-print-address{white-space:pre-line}.cw-receipt-form .cw-reminder-summary{margin:0}
.cw-sheet-table{border:1px solid #d5e2ef;border-radius:5px;overflow-x:auto;min-width:0}
.cw-sheet-table table{border-collapse:collapse;width:100%}.cw-sheet-table th,.cw-sheet-table td{padding:8px;text-align:left;font-size:13px;color:#203e5d}
.cw-sheet-table th{background:#f1f7ff;text-transform:none;letter-spacing:0;white-space:normal}
.cw-sheet-table td input{width:100%;min-width:85px}
.cw-otp-dialog[open]{inset:0;margin:auto;width:min(520px,calc(100vw - 24px));grid-template-rows:auto minmax(0,1fr)}
.cw-otp-dialog>form{padding:0;margin:0;display:grid;grid-template-rows:minmax(0,1fr) auto;min-height:0}
.cw-otp-dialog .cw-sheet-body label{margin:0 0 8px}.cw-otp-dialog .cw-sheet-footer{display:block;padding:10px 14px}
.cw-single-payment .se-dues-amounts #se-due-amount,.cw-single-payment .se-due-bills td:nth-child(4){color:#a31835;font-weight:750;background:#fde8ed}
.cw-single-payment #se-payment-panel{overflow:auto;max-width:100%}
.modal .se-dialog.se-sheet.cw-single-payment{max-height:calc(100dvh - 10px);display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden}
.cw-single-payment>.se-dialog-body{min-width:0;min-height:0;max-height:none;overscroll-behavior:contain}
.cw-single-payment>.se-dialog-head{flex-wrap:wrap;gap:7px}
.cw-single-payment>.se-dialog-head h2{min-width:0;overflow-wrap:anywhere}
@media(max-width:700px){
 .cw-profile-balances{padding:1px 10px 13px;gap:7px}.cw-balance-card{align-items:flex-start;padding:9px;gap:6px}
 .cw-balance-icon{width:26px;height:26px}.cw-balance-card small{font-size:12px}.cw-balance-note{font-size:11px}
 .modal:has(.cw-sheet){place-items:end center;padding:0}
 .modal .cw-dialog.cw-sheet{max-height:95dvh;border-radius:8px 8px 0 0;min-height:0}
 .cw-sheet-body{padding:12px}.cw-sheet-footer{padding-inline:12px}
 .cw-sheet-head,.cw-dialog.cw-sheet>.cw-sheet-head{padding:9px 12px;min-height:53px}
 .cw-receipt-lines table,.cw-receipt-lines tbody{display:block}.cw-receipt-lines thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .cw-receipt-lines tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;border-bottom:1px solid #d8e3ee;padding:4px 6px}
 .cw-receipt-lines tbody td{border:0;padding:5px;min-width:0}.cw-receipt-lines tbody td:first-child{grid-column:1/-1;font-weight:750}
 .cw-receipt-lines tbody td:last-child{grid-column:1/-1}.cw-receipt-lines [data-label]::before{content:attr(data-label);display:block;color:#456684;font-size:11px;margin-bottom:2px;font-weight:700}
 .cw-receipt-lines td input{min-width:0}.cw-receipt-lines tbody tr:last-child{border-bottom:0}
}
@media(max-width:500px){
 .cw-profile-balances{grid-template-columns:1fr 1fr}.cw-balance-card:last-child{grid-column:1/-1}
 .cw-balance-card strong{font-size:19px}.cw-sheet-body .cw-voucher-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .cw-payment-choices>button>svg:last-child{display:none}.cw-sheet-body .cw-payment-choices>button{grid-template-columns:auto minmax(0,1fr) auto;gap:6px}
 .cw-single-payment>.se-dialog-head{padding:9px 12px}
 .cw-single-payment .se-dues-amounts{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.cw-single-payment .se-dues-amounts>span{display:none}
 .cw-single-payment .se-payment-tabs{flex-wrap:wrap}
}
@media(max-width:350px){.cw-profile-balances,.cw-sheet-body :is(.cw-voucher-grid,.cw-sheet-grid,.cw-editgrid){grid-template-columns:1fr}}
@media print{
 body:has(.cw-sheet .cw-print) #app,body:has(.cw-sheet .cw-print) #toast,body:has(.cw-sheet .cw-print) .cw-sheet-head,body:has(.cw-sheet .cw-print) .cw-sheet-footer,
 body:has(.cw-sheet .cw-print) .cw-sheet-body>:not(.cw-print){display:none!important}
 body:has(.cw-sheet .cw-print) .modal,body:has(.cw-sheet .cw-print) .cw-sheet,body:has(.cw-sheet .cw-print) .cw-sheet-body{
 position:static!important;display:block!important;background:white;box-shadow:none!important;border:0!important;padding:0!important;max-height:none!important;overflow:visible!important;width:auto}
 .cw-sheet .cw-print{break-inside:avoid}
}
/* Owner 23 Nov 2026: family payment — one total settles the oldest bills first (customer-family.js). */
.cw-total-received{grid-column:1/-1}
.cw-total-received input{font-size:18px;font-weight:700;text-align:right;border:1.5px solid #42a5f5}
.cw-total-note:not(:empty){margin:6px 0 12px;padding:10px 12px;background:#eef6ff;border:1px solid #cfe3fb;color:#17406f;line-height:21px}
.cw-total-note ul,.cw-sheet-review ul{margin:6px 0 0;padding-left:18px}
.cw-total-extra{margin:8px 0 0;color:#9a3412;font-weight:600}
.cw-receipt-lines tr.cw-settled td{background:#ecf9f0}
.cw-receipt-lines tr.cw-part td{background:#fff8e6}
