/* Kanokphan D39-R33 · Compact AR ledger only.
   Scoped to .ar-r31-page: no payment calculation, deposit, posting, CN, or modal changes.
   Loaded AFTER ar-receipt-mockup-r31.css to resolve legacy .flow-stat vertical layout. */

/* Keep the dense layout above the fold, without affecting other POS-X screens. */
.workspace:has(.ar-r31-page){padding:11px 15px 18px!important}
.ar-r31-page{padding:4px 8px 16px!important}
.ar-r31-page .ar-r31-heading{min-height:55px!important;margin:0 0 9px!important;padding:0!important;gap:9px!important;border:0!important}
.ar-r31-page .ops-finance-title{padding-left:56px!important;min-height:51px!important}
.ar-r31-page .ops-finance-title::before{width:45px!important;height:45px!important;top:3px!important;font-size:22px!important;border-radius:11px!important}
.ar-r31-page .ops-finance-title h1{font-size:23px!important;line-height:1.22!important}
.ar-r31-page .ops-finance-title p{font-size:11.2px!important;margin:2px 0 0!important}
.ar-r31-page .ops-page-kicker{font-size:9.5px!important}
.ar-r31-page .ops-finance-actions{gap:6px!important;align-items:center!important}
.ar-r31-page .ops-finance-actions button{height:36px!important;min-height:36px!important;padding:5px 11px!important;font-size:11.2px!important;box-shadow:none!important;border-radius:7px!important}

/* Four horizontal, compact cards. Explicit direction fixes inherited .flow-stat{flex-direction:column}. */
.ar-r31-page .ar-r31-kpis{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:9px!important;margin:0 0 9px!important}
.ar-r31-page .ar-r31-kpi{box-sizing:border-box!important;display:flex!important;flex-direction:row!important;justify-content:flex-start!important;align-items:center!important;gap:10px!important;min-width:0!important;min-height:77px!important;height:77px!important;padding:9px 12px!important;border-radius:10px!important}
.ar-r31-page .ar-r31-kpi .ar-r31-kpi-icon{width:39px!important;height:39px!important;min-width:39px!important;display:flex!important;align-items:center!important;justify-content:center!important;border-radius:10px!important;font-size:21px!important;line-height:1!important;color:var(--ar-kpi-color)!important;margin:0!important}
.ar-r31-page .ar-r31-kpi .ar-r31-kpi-copy{display:flex!important;flex:1 1 auto!important;flex-direction:column!important;align-items:flex-start!important;justify-content:center!important;min-width:0!important;gap:1px!important;margin:0!important}
.ar-r31-page .ar-r31-kpi .ar-r31-kpi-copy .ar-r31-kpi-label{font-size:11.5px!important;line-height:1.2!important;color:#456174!important;font-weight:750!important}
.ar-r31-page .ar-r31-kpi .ar-r31-kpi-copy strong{font-size:18.5px!important;line-height:1.24!important;color:#122d47!important;white-space:nowrap!important}
.ar-r31-page .ar-r31-kpi .ar-r31-kpi-copy small{font-size:10px!important;line-height:1.2!important;color:#7a8da0!important;margin:0!important;white-space:nowrap!important}
.ar-r31-page .ar-r31-kpi .ar-r31-kpi-chevron{margin-left:auto!important;font-size:18px!important;line-height:1!important;flex:0 0 auto!important;color:#7893a0!important}

/* Search in one lean row. Field labels remain readable and accessible. */
.ar-r31-page .ar-r31-filter-card{padding:9px 12px!important;margin:0 0 7px!important;border-radius:10px!important}
.ar-r31-page .ops-receipt-filter{grid-template-columns:minmax(220px,1fr) minmax(160px,245px) 120px!important;gap:9px!important;align-items:end!important}
.ar-r31-page .ops-receipt-filter label{gap:3px!important;line-height:1.2!important;font-size:11.2px!important}
.ar-r31-page .ops-receipt-filter .ar-r31-label{font-size:11.2px!important;line-height:1.2!important}
.ar-r31-page .ops-receipt-filter :is(input,select){height:37px!important;min-height:37px!important;padding:6px 10px!important;font-size:12px!important;border-radius:7px!important}
.ar-r31-page .ops-receipt-filter button{height:37px!important;min-height:37px!important;padding:5px 11px!important;font-size:11.8px!important;border-radius:7px!important}

.ar-r31-page .ar-r31-tabs{gap:6px!important;margin:0 0 7px!important;padding:0!important}
.ar-r31-page .ar-r31-tabs button{min-height:31px!important;height:31px!important;padding:4px 10px!important;gap:6px!important;font-size:11px!important;border-radius:7px!important}
.ar-r31-page .ar-r31-tabs button b{height:18px!important;min-width:18px!important;font-size:10px!important}

/* Prefer one natural page scroll to a nested scrollbar; keep horizontal scrolling on narrow displays. */
.ar-r31-page .ar-r31-table-card{border-radius:10px!important;overflow:hidden!important}
.ar-r31-page .ops-table-heading{min-height:42px!important;padding:7px 12px!important;gap:5px!important}
.ar-r31-page .ops-table-heading strong{font-size:14px!important;line-height:1.25!important}
.ar-r31-page .ops-table-heading span,.ar-r31-page .ops-table-heading>small{font-size:10px!important;line-height:1.2!important}
.ar-r31-page .ar-r31-table-scroll{max-height:none!important;height:auto!important;min-height:0!important;overflow-x:auto!important;overflow-y:visible!important}
.ar-r31-page .ar-r31-table{min-width:1060px!important}
.ar-r31-page .ar-r31-table thead th{height:33px!important;padding:6px 8px!important;font-size:10.5px!important}
.ar-r31-page .ar-r31-table td{height:34px!important;padding:4px 8px!important;font-size:11.2px!important;line-height:1.25!important}
.ar-r31-page .ar-r31-customer-name{min-width:200px!important}
.ar-r31-page .ar-r31-customer-name strong{font-size:11.3px!important;line-height:1.25!important}
.ar-r31-page .ar-r31-table .ar-r31-number{font-size:11.2px!important}
.ar-r31-page .ar-r31-bill-count{min-height:24px!important;height:24px!important;padding:3px 9px!important;font-size:10.6px!important;border-radius:6px!important}
.ar-r31-page .ar-r31-status{padding:4px 9px!important;font-size:10.3px!important;border-radius:6px!important}
.ar-r31-page .ar-r31-actions button{height:27px!important;min-height:27px!important;padding:3px 8px!important;margin:0 2px!important;font-size:10.6px!important;border-radius:6px!important}
.ar-r31-page .ar-r31-pagination{margin-top:0!important;min-height:40px!important;padding:5px 12px!important;font-size:10.8px!important}
.ar-r31-page .ar-r31-pagination :is(select,button){height:28px!important;min-height:28px!important}
.ar-r31-page .ar-r31-pagination [data-ledger-page-current]{width:28px!important;height:28px!important}

@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(200px,1fr) minmax(155px,215px) 110px!important}
}
@media(max-width:700px){
 .workspace:has(.ar-r31-page){padding:8px 7px 14px!important}
 .ar-r31-page{padding:3px 2px 12px!important}
 .ar-r31-page .ar-r31-heading{gap:8px!important}
 .ar-r31-page .ops-finance-title{padding-left:47px!important;min-height:42px!important}
 .ar-r31-page .ops-finance-title::before{width:38px!important;height:38px!important;top:2px!important;font-size:18px!important}
 .ar-r31-page .ops-finance-title h1{font-size:18px!important}
 .ar-r31-page .ops-finance-title p{font-size:10px!important}
 .ar-r31-page .ops-finance-actions{width:100%!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
 .ar-r31-page .ops-finance-actions button{width:100%!important;min-width:0!important;padding:5px!important;font-size:10.2px!important}
 .ar-r31-page .ar-r31-kpis{gap:6px!important;margin-bottom:7px!important}
 .ar-r31-page .ar-r31-kpi{min-height:68px!important;height:68px!important;gap:6px!important;padding:7px 8px!important}
 .ar-r31-page .ar-r31-kpi .ar-r31-kpi-icon{width:30px!important;height:30px!important;min-width:30px!important;font-size:16px!important;border-radius:7px!important}
 .ar-r31-page .ar-r31-kpi .ar-r31-kpi-copy .ar-r31-kpi-label{font-size:10px!important}
 .ar-r31-page .ar-r31-kpi .ar-r31-kpi-copy strong{font-size:14px!important}
 .ar-r31-page .ar-r31-kpi .ar-r31-kpi-copy small{font-size:9px!important;white-space:normal!important}
 .ar-r31-page .ar-r31-kpi .ar-r31-kpi-chevron{display:none!important}
 .ar-r31-page .ops-receipt-filter{grid-template-columns:1fr!important;gap:7px!important}
 .ar-r31-page .ar-r31-filter-card{padding:8px!important}
 .ar-r31-page .ar-r31-tabs button{flex:1 1 115px!important;justify-content:center!important}
 .ar-r31-page .ops-table-heading{align-items:flex-start!important}
 .ar-r31-page .ar-r31-table{min-width:1060px!important}
}
