/* Kanokphan D39-R31 · AR ledger UI only; no backend or transaction changes. */
#page-content:has(.ar-r31-page){background:#f5faf7!important;}
.ar-r31-page{max-width:1600px!important;margin:0 auto!important;padding:15px 18px 22px!important;font-family:Tahoma,"Noto Sans Thai",Arial,sans-serif;}
.ar-r31-page .ar-r31-heading{display:flex!important;justify-content:space-between!important;align-items:center!important;margin-bottom:16px!important;border:0!important;align-items:center!important;flex-wrap:wrap;gap:12px;}
.ar-r31-page .ops-finance-title{padding-left:73px;min-height:66px;}
.ar-r31-page .ops-finance-title::before{content:'฿';width:58px;height:58px;top:2px;background:#e6f7ef;color:#087e54;border-radius:13px;font-size:26px;border:1px solid #d4eee1;}
.ar-r31-page .ops-finance-title h1{font-size:27px!important;line-height:1.22!important;font-weight:900!important;color:#13273b!important;}
.ar-r31-page .ops-finance-title p{font-size:12.5px!important;margin-top:5px!important;}
.ar-r31-page .ops-page-kicker{font-size:10px!important;letter-spacing:.6px;color:#47718a!important;}
.ar-r31-page .ops-finance-actions{display:flex!important;gap:9px!important;flex-wrap:wrap;}
.ar-r31-page .ops-finance-actions button{border-radius:9px!important;min-height:43px!important;height:43px!important;font-weight:750!important;padding:8px 16px!important;box-shadow:0 3px 12px #193a2820;}
.ar-r31-page .ops-finance-actions [data-deposit-new]{background:#047a50!important;border:1px solid #047a50!important;color:#fff!important;}
.ar-r31-page .ops-finance-actions button:not([data-deposit-new]){background:white!important;color:#1674be!important;border:1px solid #d4e3e8!important;}
.ar-r31-page .ar-r31-kpis{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:12px!important;margin:0 0 15px!important;}
.ar-r31-page .ar-r31-kpi{display:flex!important;align-items:center;gap:12px;min-height:106px!important;padding:17px 18px!important;border:1px solid #e2ebea!important;border-radius:12px!important;background:#fff!important;box-shadow:0 4px 16px #0a30250b!important;}
.ar-r31-kpi-icon{display:flex!important;align-items:center;justify-content:center;flex-shrink:0;width:50px;height:50px;border-radius:13px;background:var(--ar-kpi-bg)!important;color:var(--ar-kpi-color)!important;font-size:26px;font-weight:800;}
.ar-r31-kpi-copy{display:flex!important;flex:1;min-width:0;flex-direction:column;align-items:flex-start;gap:4px;}
.ar-r31-page .ar-r31-kpi-copy .ar-r31-kpi-label{font-size:13px!important;font-weight:750!important;color:#456174!important;}
.ar-r31-page .ar-r31-kpi-copy strong{font-size:21px!important;color:#102944!important;white-space:nowrap;line-height:1.15;}
.ar-r31-kpi-copy small{color:#72869d;font-size:11px;}
.ar-r31-kpi-chevron{font-size:25px;color:#607e90;font-weight:300;}
.ar-r31-page .ar-r31-filter-card{margin:0 0 8px!important;padding:16px!important;border:1px solid #deebe8!important;border-radius:12px!important;box-shadow:0 4px 14px #123f2710!important;background:#fff!important;}
.ar-r31-page .ops-receipt-filter{display:grid!important;grid-template-columns:minmax(300px,1fr) minmax(210px,280px) 146px!important;align-items:end!important;gap:13px!important;}
.ar-r31-page .ops-receipt-filter label{display:flex!important;flex-direction:column;gap:6px!important;font-size:12px!important;font-weight:700!important;color:#173a52!important;min-width:0;}
.ar-r31-page .ops-receipt-filter .ar-r31-label{display:block;font-weight:700;font-size:12px;color:#20415b;}
.ar-r31-page .ops-receipt-filter :is(input,select){height:45px!important;border:1px solid #cce0df!important;border-radius:9px!important;background:white!important;color:#1e3750!important;padding:8px 13px!important;font-size:13px!important;min-width:0;}
.ar-r31-page .ops-receipt-filter button{min-height:45px!important;height:45px!important;border-radius:9px!important;background:#047a50!important;color:white!important;font-weight:800!important;}
.ar-r31-tabs{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 11px!important;padding:0 2px;}
.ar-r31-page .ar-r31-tabs button{border:1px solid #d8e5e7!important;background:#fff!important;color:#355570!important;font-weight:750!important;min-height:38px;padding:8px 15px!important;border-radius:9px!important;font-size:12px!important;display:inline-flex;align-items:center;gap:8px;cursor:pointer;}
.ar-r31-page .ar-r31-tabs button.is-active{background:#067e54!important;border-color:#067e54!important;color:#fff!important;box-shadow:0 3px 10px #067e5430;}
.ar-r31-tabs button[data-debt-tab="OPEN"]{color:#bb2f4c!important;}
.ar-r31-tabs button[data-debt-tab="REFUND_PENDING"]{color:#ab6a06!important;}
.ar-r31-tabs button[data-debt-tab="PARTIAL"]{color:#1970c5!important;}
.ar-r31-tabs button b{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;background:#ebf1f5;border-radius:999px;color:#526b81;font-size:10px;}
.ar-r31-tabs button.is-active b{background:#ffffff2b;color:white;}
.ar-r31-page .ar-r31-table-card{border:1px solid #dae9e3!important;border-radius:13px!important;background:white!important;box-shadow:0 6px 24px #123e3010!important;}
.ar-r31-page .ops-table-heading{min-height:59px!important;padding:12px 18px!important;display:flex!important;gap:10px;}
.ar-r31-page .ops-table-heading strong{color:#122d47!important;font-size:17px!important;font-weight:850!important;}
.ar-r31-page .ops-table-heading span{font-size:11.5px!important;color:#71869b!important;}
.ar-r31-page .ops-table-heading>small{color:#647f92;font-size:11px;white-space:nowrap;}
.ar-r31-page .ar-r31-table-scroll{overflow:auto!important;max-height:calc(100dvh - 470px)!important;min-height:180px!important;}
.ar-r31-page .ar-r31-table{width:100%;min-width:1170px;border-collapse:collapse;font-variant-numeric:tabular-nums;}
.ar-r31-page .ar-r31-table thead th{position:sticky;top:0;z-index:2;padding:11px 10px!important;height:41px!important;border-bottom:1px solid #d8ece6!important;background:#e8f8f1!important;color:#274b57!important;text-align:left!important;font-size:11.5px!important;white-space:nowrap;}
.ar-r31-page .ar-r31-sort{background:transparent!important;border:0!important;color:inherit!important;font-size:inherit!important;padding:0!important;min-height:0!important;height:auto!important;box-shadow:none!important;font-weight:800!important;cursor:pointer;}
.ar-r31-page .ar-r31-table td{height:42px!important;padding:8px 10px!important;background:#fff!important;border-bottom:1px solid #e5efed!important;color:#243e55;font-size:12px!important;vertical-align:middle;}
.ar-r31-page .ar-r31-table tbody tr:nth-child(even) td{background:#fbfdfc!important;}
.ar-r31-page .ar-r31-table tbody tr:hover td{background:#f0fbf5!important;}
.ar-r31-page .ar-r31-table tbody tr.ar-r31-partial-row td{background:#fffdf5!important;}
.ar-r31-page .ar-r31-table .ar-r31-code{font-weight:800!important;color:#182f4a;white-space:nowrap;}
.ar-r31-page .ar-r31-customer-name{min-width:240px;max-width:390px;}
.ar-r31-page .ar-r31-customer-name strong{font-size:12px!important;font-weight:750!important;color:#193149;display:block;line-height:1.4;}
.ar-r31-page .ar-r31-table .ar-r31-number{text-align:right!important;white-space:nowrap;font-size:12px!important;}
.ar-r31-page .ar-r31-table .ar-r31-paid{color:#05905d!important;font-weight:750;}
.ar-r31-page .ar-r31-table .ar-r31-due{color:#d21c37!important;font-weight:800;}
.ar-r31-page .ar-r31-due small{display:block;white-space:nowrap;color:#68788a;font-size:10px;font-weight:400;}
.ar-r31-page .ar-r31-date{color:#45617c!important;white-space:nowrap;}
.ar-r31-page .ar-r31-bill-count{padding:5px 11px!important;min-height:26px!important;height:27px!important;border:1px solid #cce3f6!important;background:#eaf4ff!important;color:#1672cc!important;font-weight:800!important;border-radius:7px!important;white-space:nowrap;}
.ar-r31-status{display:inline-flex;align-items:center;justify-content:center;padding:6px 12px;white-space:nowrap;border-radius:7px;background:#ffe5e8;color:#c72e43;font-weight:800;font-size:11px;}
.ar-r31-status-partial{background:#e3f2ff;color:#1873bb;}
.ar-r31-status-refund_pending{background:#fff0c3;color:#936400;}
.ar-r31-status-paid,.ar-r31-status-refunded{background:#e2f6eb;color:#097c4f;}
.ar-r31-page .ar-r31-actions{white-space:nowrap!important;text-align:right!important;}
.ar-r31-page .ar-r31-actions button{height:32px!important;min-height:32px!important;padding:5px 11px!important;border-radius:8px!important;font-size:11.5px!important;font-weight:800!important;margin:0 3px!important;}
.ar-r31-history{background:#fff!important;border:1px solid #cbdde9!important;color:#1764b7!important;}
.ar-r31-receive{background:#078053!important;border:1px solid #078053!important;color:white!important;box-shadow:0 3px 7px #07673b24;}
.ar-r31-refund{background:#fff0e7!important;border:1px solid #f2cdb7!important;color:#b04d11!important;}
.ar-r31-deposit{background:#eff8f5!important;border:1px solid #b9e0cf!important;color:#067c53!important;}
.ar-r31-page .ar-r31-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;min-height:53px;padding:10px 16px;color:#637d94;font-size:11.5px!important;}
.ar-r31-pagination>div{display:flex;align-items:center;gap:7px;}
.ar-r31-pagination label{display:flex;align-items:center;gap:9px;color:#526f87;}
.ar-r31-pagination :is(select,button){border:1px solid #d7e3e9!important;border-radius:7px!important;background:#fff!important;color:#365b75!important;height:33px!important;min-height:33px!important;}
.ar-r31-pagination select{padding:2px 8px;}
.ar-r31-pagination button{width:33px;cursor:pointer;font-size:20px!important;}
.ar-r31-pagination button:disabled{opacity:.38;cursor:not-allowed;}
.ar-r31-pagination [data-ledger-page-current]{display:grid;place-items:center;width:33px;height:33px;border-radius:7px;background:#088056;color:#fff;}
@media (max-width:1100px){.ar-r31-page .ar-r31-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}.ar-r31-page .ops-receipt-filter{grid-template-columns:minmax(260px,1fr) 200px 110px!important}.ar-r31-page{padding:12px!important}}
@media (max-width:700px){.ar-r31-page .ar-r31-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}.ar-r31-page .ar-r31-kpi{min-height:90px!important;padding:10px!important}.ar-r31-page .ar-r31-kpi-copy strong{font-size:16px!important}.ar-r31-page .ar-r31-kpi-icon{width:38px;height:38px;font-size:19px}.ar-r31-page .ar-r31-heading{padding:0!important}.ar-r31-page .ops-finance-actions{width:100%;justify-content:stretch}.ar-r31-page .ops-finance-actions button{flex:1 1 130px}.ar-r31-page .ops-receipt-filter{grid-template-columns:1fr!important}.ar-r31-page .ar-r31-filter-card{padding:10px!important}.ar-r31-page .ar-r31-tabs button{flex:1 1 122px;justify-content:center}.ar-r31-page .ops-table-heading{flex-direction:column;align-items:flex-start}.ar-r31-page .ar-r31-table-scroll{max-height:55dvh!important}.ar-r31-page .ar-r31-pagination{justify-content:center}}
