/* AffiniBilling 1.3.3 — ERP-density style: scoped to authenticated portal, preserving mobile controls and POS checkout. */
@media (min-width:791px){
 .app-body:not(.pos-page) .topbar{height:56px;min-height:56px;padding:0 17px}
 .app-body:not(.pos-page):not(.invoice-entry-page) .content{padding:13px 17px 20px;max-width:none}
 .app-body .page-heading{margin-bottom:10px;gap:10px}
 .app-body .page-heading h1{font-size:20px;margin:0;letter-spacing:-.45px}
 .app-body .page-heading p{font-size:11px;line-height:1.35}
 .app-body .eyebrow{font-size:9px;letter-spacing:.9px}
 .app-body:not(.invoice-entry-page):not(.pos-page) .panel{padding:12px 14px;margin-bottom:12px;border-radius:11px}
 .app-body .panel-head{margin-bottom:9px;gap:9px}
 .app-body .panel-head h2{font-size:14px;margin:0 0 2px}
 .app-body .panel-head p{font-size:10px}
 .app-body:not(.invoice-entry-page):not(.pos-page) .data-table{font-size:11px}
 .app-body:not(.invoice-entry-page):not(.pos-page) .data-table th{padding:7px 8px;font-size:9px;letter-spacing:.4px}
 .app-body:not(.invoice-entry-page):not(.pos-page) .data-table td{padding:7px 8px;line-height:1.3}
 .app-body .data-table small{font-size:10px;margin-top:2px}
 .app-body .row-actions{gap:4px;flex-wrap:nowrap}
 .app-body .row-actions .btn-icon{width:28px;height:28px;min-width:28px;border-radius:7px}
 .app-body .form-stack{gap:9px}
 .app-body .form-grid{gap:8px 10px}
 .app-body:not(.invoice-entry-page):not(.pos-page) .field{gap:3px}
 .app-body:not(.invoice-entry-page):not(.pos-page) .field input,.app-body .field select{min-height:33px;padding:6px 9px;border-radius:7px;font-size:12px}
 .app-body:not(.invoice-entry-page):not(.pos-page) .field textarea{min-height:55px;padding:7px 9px;font-size:12px}
 .app-body:not(.invoice-entry-page):not(.pos-page) .field label{font-size:10px}
 .app-body .btn:not(.btn-icon){padding:7px 10px;font-size:11px;min-height:32px;border-radius:7px}
 .app-body .stats-grid{gap:9px;margin-bottom:10px}
 .app-body .stat-card{padding:10px 12px;gap:10px;border-radius:11px}
 .app-body .stat-icon{width:33px;height:33px;font-size:19px;border-radius:9px}
 .app-body .stat-card strong{font-size:18px}
 .app-body .stat-card small{font-size:10px;margin-bottom:3px}
 .app-body .sidebar .brand{padding:12px 15px}
 .app-body .sidebar .brand-mark{width:35px;height:35px}
 .app-body .sidebar .brand-text{font-size:18px}
 .app-body .sidebar .nav-heading{padding:12px 12px 4px;font-size:9px}
 .app-body .sidebar-links .nav-link{padding:6px 9px;min-height:33px;font-size:11px}
 .app-body .sidebar-links .nav-group summary{padding:6px 9px;font-size:11px}
 .app-body .sidebar-links .nav-group-links .nav-link{min-height:31px;padding:5px 8px}
 .app-body .sidebar .sidebar-bottom{padding:7px 10px}
 .app-body .sidebar .sidebar-note{padding:6px 9px;font-size:10px}
 .app-body .sidebar .sidebar-bottom small{margin-top:5px}
 .app-body .masters-layout{grid-template-columns:minmax(0,1.9fr) minmax(260px,.8fr);gap:12px}
 .app-body .master-editor{top:66px;max-height:calc(100vh - 76px);overflow-y:auto}
 .app-body .masters-layout .master-editor .panel-head{margin-bottom:9px}
 .app-body .masters-layout .master-editor .form-stack{gap:7px}
 .app-body .masters-layout .master-editor .field textarea{min-height:45px}
 .app-body .master-table{max-height:calc(100vh - 255px);overflow:auto}
 .app-body .master-table .data-table td{padding:5px 7px;height:35px}
 .app-body .master-table .data-table th{position:sticky;top:0;z-index:1}
 .app-body .report-menu{padding:5px}
 .app-body .reports-layout{grid-template-columns:185px minmax(0,1fr);gap:10px}
 .app-body .report-type{padding:7px 9px;gap:6px;margin:1px 0}
 .app-body .report-type>span{font-size:16px}
 .app-body .report-type b{font-size:11px}
 .app-body .report-type small{display:none}
 .app-body .report-toolbar{gap:7px;margin-bottom:9px}
 .app-body .report-toolbar .field input{min-height:31px}
 .app-body .two-cols{gap:12px}
 .app-body .invoice-detail-header{margin-bottom:9px;padding-bottom:9px}
 .app-body .invoice-totals{margin-top:10px;padding:9px 11px}
 .app-body .invoice-totals>div{padding:3px 0}
 .app-body .expense-register .data-table td{padding:5px 7px}
}
/* Item master: searchable, small rows, and no oversize editor columns. */
.master-list-tools{display:flex;align-items:center;gap:6px;min-width:145px}
.master-list-tools input{width:100%;max-width:215px;height:31px;min-height:31px;border-radius:7px;border:1px solid #d8e7eb;padding:5px 10px;font-size:11px;color:#274458}
[data-master-row][hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
/* Dashboard: show period KPIs, trend, and best sellers in one compact viewport. */
.dashboard-dense .dashboard-heading{margin-bottom:9px}
.dashboard-dense .dashboard-stats{margin-bottom:9px}
.dashboard-dense .dashboard-stats .stat-card{min-height:62px}
.dashboard-dense .period-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-bottom:10px}
.dashboard-dense .period-tile{padding:9px 11px;min-width:0;border-radius:10px}
.dashboard-dense .period-tile small{font-size:10px}
.dashboard-dense .period-tile strong{font-size:17px;line-height:1.1;margin:3px 0}
.dashboard-dense .period-tile span{font-size:10px;line-height:1.2}
.dashboard-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.03fr);gap:10px;align-items:start}
.dashboard-dense .dashboard-grid .panel{margin-bottom:10px}
.dashboard-dense .sales-trend{height:136px;margin:8px 0 0}
.dashboard-dense .dashboard-top .table-scroll{max-height:245px;overflow-y:auto}
.dashboard-dense .dashboard-top .data-table{min-width:0}
.dashboard-dense .dashboard-top .data-table th,.dashboard-dense .dashboard-top .data-table td{padding:5px 7px}
.dashboard-dense .dashboard-top .data-table td:nth-child(2){max-width:245px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dashboard-dense .dashboard-recent .table-scroll{max-height:225px;overflow-y:auto}
/* Native cancellation dialog: outside the table scroll container, works on desktop and mobile. */
.invoice-cancel-modal{border:1px solid #e9cfd3;border-radius:13px;padding:0;max-width:min(92vw,430px);width:430px;color:#263c54;box-shadow:0 24px 70px rgba(20,40,61,.25)}
.invoice-cancel-modal::backdrop{background:rgba(20,36,54,.43)}
.invoice-cancel-modal form{padding:19px;display:flex;flex-direction:column;gap:10px}
.invoice-cancel-modal h2{font-size:18px;margin:0}
.invoice-cancel-modal p{font-size:12px;line-height:1.5;color:#76889a;margin:0}
.invoice-cancel-modal label{font-weight:800;color:#704b55;font-size:11px}
.invoice-cancel-modal textarea{width:100%;padding:10px 11px;border:1px solid #dac6d2;border-radius:9px;min-height:90px;font-size:12px;resize:vertical}
.invoice-cancel-modal .action-row{justify-content:flex-end;gap:7px}
.cancellation-note{display:block;max-width:190px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#a85a69;font-size:10px;margin-top:3px}
.invoice-cancellation-note{margin-bottom:9px}
@media(max-width:1000px){.dashboard-grid{grid-template-columns:1fr}.app-body .masters-layout{grid-template-columns:1fr}.dashboard-dense .period-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:790px){.dashboard-dense .dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.dashboard-dense .period-grid{grid-template-columns:1fr 1fr}.dashboard-grid{grid-template-columns:1fr}.app-body .master-list-tools{flex:1}.master-records .panel-head{align-items:flex-start}.invoice-cancel-form{right:-15px}.app-body:not(.pos-page) .content{padding:12px}}
@media(max-width:480px){.dashboard-dense .period-grid{grid-template-columns:1fr}.master-list-tools input{max-width:170px}.dashboard-dense .dashboard-stats .stat-card{padding:11px}}
