.customer-ledger{margin:12px 0;background:#fff;border:1px solid #d7e2ef;border-radius:14px;overflow:hidden}
.customer-ledger>summary{display:flex;justify-content:space-between;align-items:center;gap:8px;cursor:pointer;padding:13px;list-style:none}
.customer-ledger>summary::-webkit-details-marker{display:none}
.customer-ledger>summary b{font-size:14px}
.customer-ledger>summary span,.ledger-state{font-size:11px;color:#5b7089}
.customer-ledger-body{border-top:1px solid #e3ebf4;padding:12px}
.customer-ledger-body>p,.ledger-snapshot>p{margin:5px 0 10px;font-size:11px;color:#52647d}
.ledger-totals{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:10px 0}
.ledger-range{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:9px 0}
.ledger-range label{font-size:10px;color:#53657d}
.ledger-range input{width:100%;margin-top:4px;border:1px solid #cbd9ea;border-radius:8px;padding:9px;background:#fff;font:inherit}
.ledger-range button{border:0;border-radius:8px;background:#1769d2;color:#fff;padding:9px;font:inherit}
.ledger-range button:disabled{opacity:.6}
.ledger-totals span{background:#f1f6fd;border-radius:9px;padding:9px;font-size:10px}
.ledger-totals b{display:block;margin-top:3px;font-size:12px;overflow-wrap:anywhere}
.ledger-row{border-top:1px dashed #dce5ef;padding:10px 2px}
.ledger-row>div:first-child{display:flex;justify-content:space-between;gap:8px;font-size:11px}
.ledger-row small{color:#65758a;white-space:nowrap}
.ledger-row p{margin:5px 0;color:#53657d;font-size:10px;line-height:1.7}
.ledger-amounts{display:flex;flex-wrap:wrap;gap:6px}
.ledger-amounts span{background:#f4f7fb;border-radius:7px;padding:5px 7px;font-size:10px}
.ledger-amounts span:last-child{background:#eaf3ff}
#ledgerMore{display:block;width:100%;margin-top:10px;border:0;border-radius:9px;background:#eaf3ff;color:#1455a0;padding:10px;font:inherit}
#ledgerMore[hidden]{display:none}
#ledgerRebuild{display:block;width:100%;margin-top:7px;border:1px solid #cbd9ea;border-radius:9px;background:#fff;color:#405977;padding:9px;font:inherit;font-size:11px}

.ledger-totals{display:flex;flex-direction:column;gap:4px}
.ledger-totals>div{display:flex;justify-content:space-between;align-items:center;gap:10px;background:#f1f6fd;border-radius:7px;padding:8px 10px}
.ledger-totals span{background:none;padding:0;font-size:12px}
.ledger-totals b{display:inline;margin:0;white-space:nowrap}
.ledger-totals small{color:#65758a;font-weight:normal}
.ledger-table-scroll{overflow:auto;max-width:100%;border:1px solid #d7e2ef;border-radius:8px}
.ledger-table{border-collapse:collapse;width:100%;min-width:760px;direction:rtl;font-size:12px}
.ledger-table th,.ledger-table td{border:1px solid #dce5ef;padding:8px;text-align:right;vertical-align:top}
.ledger-table th{background:#eaf3ff;white-space:nowrap;position:sticky;top:0}
.ledger-table td:not(:nth-child(3)){white-space:nowrap;font-variant-numeric:tabular-nums}
.ledger-table td:nth-child(3){min-width:200px;line-height:1.7}
.ledger-table td:nth-child(3)>b{font-size:11px;color:#65758a}
.ledger-table tr:nth-child(even){background:#f8fbff}

.ledger-totals .ledger-return,.ledger-detail-dialog .ledger-return{background:#fff0f1;color:#b91c1c;border:1px solid #fecaca}
.ledger-summary-link{border:0!important;background:transparent!important;color:inherit!important;font:inherit!important;font-weight:bold!important;padding:0!important;margin:0!important;width:auto!important;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.ledger-zoom-tools{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:8px 0}
.ledger-zoom-tools button{width:auto!important;margin:0!important;padding:6px 10px!important;font:inherit!important}
.ledger-zoom-tools small{color:#65758a}
.ledger-detail-dialog{width:min(94vw,960px);max-width:94vw;max-height:90dvh;border:1px solid #cbd9ea;border-radius:14px;padding:12px;direction:rtl;color:#102b4c;z-index:2147483000}
.ledger-detail-dialog::backdrop{background:#102034aa}
.ledger-detail-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:12px}
.ledger-detail-dialog>header button{width:auto;margin:0}
.ledger-detail-body{overflow:auto;max-height:75dvh;padding:8px 0}
.ledger-detail-body details{border:1px solid #d7e2ef;border-radius:8px;padding:10px;margin:8px 0}
.ledger-detail-body summary{cursor:pointer;font-weight:bold;line-height:1.8}
