:root{--nav:#102c29;--nav2:#163934;--ink:#172520;--muted:#73807b;--bg:#f4f6f2;--panel:#fff;--line:#e4e9e3;--green:#16725b;--green2:#dff2e9;--orange:#d97032;--orange2:#fff0e5;--red:#b84c44;--shadow:0 18px 45px rgba(25,50,41,.08)}
*{box-sizing:border-box}body{margin:0;font-family:"DM Sans",sans-serif;background:var(--bg);color:var(--ink)}button,input,textarea,select{font:inherit}button{cursor:pointer}.hidden{display:none!important}.eyebrow{font-size:10px;letter-spacing:.16em;font-weight:800;color:var(--green);margin-bottom:7px}.eyebrow.light{color:#9ecbc0}.brand-mark{width:40px;height:40px;border-radius:13px;display:grid;place-items:center;background:var(--green);color:#fff;font:800 20px Manrope}.brand-mark.large{width:56px;height:56px;border-radius:17px;background:#e0f3ea;color:#15483d}
.login-view{min-height:100vh;display:grid;grid-template-columns:1.1fr .9fr;background:#fff}.login-art{background:radial-gradient(circle at 75% 18%,#28564e 0 1px,transparent 2px),linear-gradient(145deg,#0f2e2a,#173c36);background-size:20px 20px,auto;color:#fff;padding:9vh 9vw;display:flex;flex-direction:column;justify-content:space-between;position:relative;overflow:hidden}.login-art:after{content:"";position:absolute;width:440px;height:440px;border:1px solid rgba(255,255,255,.1);border-radius:50%;right:-170px;bottom:-150px;box-shadow:0 0 0 70px rgba(255,255,255,.025),0 0 0 140px rgba(255,255,255,.018)}.login-art h1{font:800 clamp(48px,6vw,84px)/1.02 Manrope;margin:10px 0 24px;letter-spacing:-.07em}.login-art p{color:#aec8c1;font-size:17px;max-width:460px;line-height:1.6}.login-stat{position:relative;z-index:1;display:grid;grid-template-columns:auto 1fr;column-gap:14px;width:max-content;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.12);border-radius:16px;padding:15px 18px;backdrop-filter:blur(10px)}.login-stat span{grid-row:span 2;background:#e0f3ea;color:#15483d;border-radius:8px;padding:11px;font-weight:800}.login-stat small{color:#9eb9b2}.login-card{width:min(410px,80%);margin:auto;display:grid;gap:19px}.login-card h2{font:800 34px Manrope;margin:24px 0 6px;letter-spacing:-.04em}.login-card p{margin:0;color:var(--muted)}label{display:grid;gap:7px;font-size:12px;font-weight:700;color:#53605b}input,select,textarea{border:1px solid var(--line);border-radius:10px;padding:12px 13px;background:#fff;color:var(--ink);outline:none}input:focus,select:focus,textarea:focus{border-color:#62a590;box-shadow:0 0 0 3px rgba(22,114,91,.08)}.primary{border:0;border-radius:10px;background:var(--green);color:#fff;padding:12px 16px;font-weight:800}.wide{width:100%;display:flex;justify-content:space-between}.form-error{font-size:12px;color:var(--red);min-height:18px}
.login-consultancy-brand{position:relative;z-index:1;display:grid;gap:9px;width:min(690px,94%)}.login-consultancy-brand img{display:block;width:100%;height:auto}.login-consultancy-brand>span{justify-self:start;border:1px solid rgba(24,183,181,.65);background:rgba(9,40,38,.72);border-radius:999px;padding:6px 13px;color:#dffdfa;font:800 11px Manrope;text-transform:uppercase;letter-spacing:.16em}.login-art-bottom{position:relative;z-index:1;display:grid;gap:16px}.login-form-logo{display:block;width:min(350px,100%);height:auto}.login-copyright{border-top:1px solid var(--line);padding-top:12px;color:#6c7773;font-size:10px;line-height:1.55}.login-copyright strong{color:#087f7d}.login-copyright.light{border-top-color:rgba(255,255,255,.12);color:#9fc1ba;margin:0;max-width:560px;font-size:10px}
.app{min-height:100vh;display:grid;grid-template-columns:236px 1fr}.sidebar{position:fixed;inset:0 auto 0 0;width:236px;background:var(--nav);color:#fff;padding:24px 14px;display:flex;flex-direction:column;z-index:20}.brand{display:flex;align-items:center;gap:11px;padding:0 8px 25px;border-bottom:1px solid rgba(255,255,255,.08)}.brand strong{display:block;font:800 15px Manrope}.brand span{font-size:10px;color:#9dbab3;text-transform:uppercase;letter-spacing:.12em}.sidebar nav{display:grid;gap:5px;padding-top:22px}.sidebar nav button,.logout{border:0;background:transparent;color:#a9c1bb;text-align:left;padding:11px 13px;border-radius:9px;font-weight:600}.sidebar nav button i{display:inline-grid;width:26px;font-style:normal;font-size:17px}.sidebar nav button:hover,.sidebar nav button.active{background:rgba(255,255,255,.08);color:#fff}.sidebar-foot{margin-top:auto;display:grid;gap:13px}.erp-badge{display:flex;gap:9px;align-items:center;border:1px solid rgba(255,255,255,.09);background:rgba(255,255,255,.04);border-radius:11px;padding:10px}.erp-badge>span{width:8px;height:8px;background:#f0a56c;border-radius:50%;box-shadow:0 0 0 4px rgba(240,165,108,.1)}.erp-badge.live>span{background:#64d19d}.erp-badge strong,.erp-badge small{display:block;font-size:10px}.erp-badge small{color:#8facaa;margin-top:2px}.logout{border:1px solid rgba(255,255,255,.09);text-align:center}.app main{grid-column:2;min-width:0}.app header{height:82px;background:rgba(255,255,255,.83);backdrop-filter:blur(15px);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 32px;position:sticky;top:0;z-index:10}.app header h2{font:800 20px Manrope;margin:0;letter-spacing:-.04em}.header-actions{display:flex;gap:10px}.icon-button,.avatar,.menu-btn{border:1px solid var(--line);background:#fff;border-radius:10px;width:39px;height:39px}.avatar{background:var(--nav);color:#fff;border:0;font-size:11px;font-weight:800}.menu-btn{display:none}.content{padding:28px 32px 50px;max-width:1500px;margin:auto}.section-head{display:flex;align-items:end;justify-content:space-between;gap:15px;margin-bottom:20px}.section-head h1{font:800 29px Manrope;letter-spacing:-.05em;margin:0 0 4px}.section-head p{margin:0;color:var(--muted);font-size:13px}.button-row{display:flex;gap:9px}.secondary{border:1px solid var(--line);background:#fff;border-radius:9px;padding:10px 13px;font-weight:700;color:#44514c}
.consultancy-sidebar-brand{display:grid;gap:7px;align-items:start;padding:0 5px 18px}.consultancy-sidebar-brand img{display:block;width:100%;height:auto}.consultancy-sidebar-brand>span{justify-self:start;color:#b8d7d0;font-size:9px;font-weight:900;letter-spacing:.18em}.app-footer{display:flex;align-items:center;justify-content:center;gap:12px;margin:0 32px 18px;padding:12px 16px;border-top:1px solid var(--line);color:#71807a;font-size:10px;text-align:center}.app-footer img{width:150px;height:auto}.app-footer span{line-height:1.45}
.metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:15px;margin-bottom:22px}.metric{background:#fff;border:1px solid var(--line);border-radius:14px;padding:18px;box-shadow:0 5px 20px rgba(25,50,41,.025)}.metric-top{display:flex;justify-content:space-between;color:var(--muted);font-size:11px;font-weight:700}.metric-icon{width:31px;height:31px;display:grid;place-items:center;border-radius:9px;background:var(--green2);color:var(--green);font-size:16px}.metric h3{font:800 26px Manrope;letter-spacing:-.05em;margin:18px 0 4px}.metric p{font-size:11px;color:var(--muted);margin:0}.metric.warn .metric-icon{background:var(--orange2);color:var(--orange)}.dashboard-grid{display:grid;grid-template-columns:1.6fr .9fr;gap:18px}.panel{background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 5px 20px rgba(25,50,41,.025);overflow:hidden}.panel-head{display:flex;align-items:center;justify-content:space-between;padding:18px 19px;border-bottom:1px solid var(--line)}.panel-head h3{font:800 15px Manrope;margin:0}.panel-head span{font-size:11px;color:var(--muted)}.quick-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:15px}.quick{border:1px solid var(--line);background:#fafcf9;border-radius:11px;padding:17px;text-align:left;color:var(--ink)}.quick b{display:block;font-size:19px;color:var(--green);margin-bottom:15px}.quick strong,.quick small{display:block}.quick small{color:var(--muted);font-size:10px;margin-top:3px}.activity{padding:4px 18px}.activity-row{display:grid;grid-template-columns:37px 1fr auto;gap:10px;align-items:center;padding:13px 0;border-bottom:1px solid var(--line)}.activity-row:last-child{border:0}.activity-icon{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--green2);color:var(--green);font-size:12px;font-weight:800}.activity-row strong,.activity-row small{display:block}.activity-row strong{font-size:12px}.activity-row small{font-size:10px;color:var(--muted);margin-top:3px}.activity-row b{font-size:12px}
.toolbar{display:flex;justify-content:space-between;gap:12px;margin-bottom:15px}.search{position:relative;min-width:300px}.search input{width:100%;padding-left:37px}.search span{position:absolute;left:13px;top:11px;color:var(--muted)}.search.has-search-help input{padding-right:42px}.search-help-button{position:absolute;right:10px;top:50%;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:1px solid #c9ddd6;border-radius:50%;background:#f3faf7;color:var(--green);font-family:Georgia,serif;font-size:14px;font-weight:950;line-height:1;z-index:2}.search-help-button:hover{background:#e4f5ee;border-color:#8dc8b8}.generic-search-field.has-search-help,.shelf-search-field.has-search-help{position:relative}.generic-search-field.has-search-help input,.shelf-search-field.has-search-help input{padding-right:48px}.generic-search-field>.search-help-button,.shelf-search-field>.search-help-button{right:14px;top:auto;bottom:15px;transform:none}.search-help-panel{display:grid;gap:12px;max-width:min(680px,86vw)}.search-help-panel div{display:grid;gap:5px;padding:12px;border:1px solid var(--line);border-radius:10px;background:#fbfdfb}.search-help-panel strong{color:#162922;font-size:13px}.search-help-panel span{color:#52625d;font-size:12px;line-height:1.45;font-weight:750}.search-help-panel code{padding:1px 5px;border-radius:5px;background:#eef6f2;color:#0b5b47;font-weight:900}.pager{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px}.pager .secondary{padding:8px 11px}.secondary:disabled{opacity:.45;cursor:not-allowed}.source-pill,.status-pill{display:inline-flex;align-items:center;border-radius:999px;padding:5px 9px;background:var(--green2);color:var(--green);font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.08em}.table-wrap{overflow:auto}.data-table{width:100%;border-collapse:collapse;min-width:850px}.data-table th{background:#f8faf7;color:#7a8781;text-transform:uppercase;letter-spacing:.08em;font-size:9px;text-align:left;padding:11px 16px;border-bottom:1px solid var(--line)}.data-table td{padding:13px 16px;border-bottom:1px solid var(--line);font-size:12px}.data-table tr:last-child td{border-bottom:0}.data-table tbody tr:hover{background:#fbfcfa}.product-name strong,.customer-name strong{display:block}.product-name span,.customer-name span{font-size:10px;color:var(--muted)}.stock-pill{display:inline-flex;min-width:55px;justify-content:center;padding:5px 8px;border-radius:999px;background:var(--green2);color:var(--green);font-weight:800;font-size:10px}.stock-pill.low{background:var(--orange2);color:var(--orange)}.stock-pill.out{background:#f9e9e8;color:var(--red)}.row-action{border:1px solid var(--line);background:#fff;border-radius:7px;padding:6px 9px;font-size:10px;font-weight:800}.balance.due{color:var(--red);font-weight:800}.balance.advance{color:var(--green);font-weight:800}.empty{padding:40px;text-align:center;color:var(--muted)}
.sale-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(480px,34vw);gap:18px;align-items:start}.sale-left{display:grid;gap:16px;min-width:0}.selection-card{padding:18px}.selected-customer{display:flex;justify-content:space-between;gap:15px;align-items:center;background:#f7faf7;border:1px solid var(--line);border-radius:11px;padding:13px}.selected-customer h3{font:800 14px Manrope;margin:0}.selected-customer p{font-size:10px;color:var(--muted);margin:4px 0 0}.cart{position:sticky;top:105px;min-width:0}.cart-lines{max-height:520px;overflow:auto;padding:4px 17px}.cart-line{display:grid;grid-template-columns:1fr 65px 30px;gap:8px;padding:13px 0;border-bottom:1px solid var(--line)}.cart-line strong,.cart-line small{display:block}.cart-line strong{font-size:11px}.cart-line small{font-size:9px;color:var(--muted);margin-top:3px}.cart-line input{padding:7px;width:100%;font-size:11px}.remove{border:0;background:transparent;color:var(--red)}.totals{padding:16px 18px;background:#fafcf9;border-top:1px solid var(--line);display:grid;gap:8px}.total-row{display:flex;justify-content:space-between;color:var(--muted);font-size:11px}.total-row.grand{color:var(--ink);font:800 17px Manrope;border-top:1px dashed #cad2cc;padding-top:12px}.cart-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;padding:0 18px 18px}.cart-actions button:last-child{grid-column:span 2}.notes{margin:0 18px 14px;width:calc(100% - 36px);min-height:65px}
.billing-grid{grid-template-columns:1.2fr 1.2fr .8fr}.billing-modal-form{grid-template-columns:minmax(0,1fr) minmax(560px,42vw);gap:12px}.billing-modal-form .selection-card{padding:12px}.billing-modal-form .panel-head{padding:12px 14px}.billing-modal-form .cart-lines{max-height:62vh}.target-summary{padding:10px 18px;border-bottom:1px solid var(--line);background:#fafcf9}.inline-head{padding:0 0 14px;border-bottom:0}.padded-toolbar{padding:14px 18px;margin:0;border-bottom:1px solid var(--line)}.billing-history-toolbar{align-items:center;margin-bottom:0}.history-filters{display:grid;grid-template-columns:140px 140px minmax(160px,1fr) minmax(210px,1fr);gap:8px;align-items:end}.history-filters input,.history-filters select{padding:9px}.bill-history-list{display:grid;gap:9px;padding:12px}.bill-history-card{display:grid;grid-template-columns:1fr 1.4fr .35fr .75fr .55fr .55fr auto;gap:10px;align-items:center;border:1px solid var(--line);border-radius:12px;background:#fff;padding:12px}.bill-history-card strong,.bill-history-card small{display:block}.bill-history-card small{color:var(--muted);font-size:9px}.save-status{padding:0 18px 10px;min-height:26px}.lookup-results{display:grid;gap:8px;margin-top:12px;max-height:300px;overflow:auto}.lookup-row{border:1px solid var(--line);background:#fafcf9;border-radius:10px;padding:11px;text-align:left;color:var(--ink)}.lookup-row strong,.lookup-row small{display:block}.lookup-row small{color:var(--muted);font-size:10px;margin-top:3px}.product-result{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center}.product-result-actions{display:flex;align-items:center;gap:5px}.product-result-actions button{border:1px solid var(--line);background:#fff;border-radius:999px;width:30px;height:30px;font-size:9px;font-weight:800}.product-result-actions .row-action{width:auto;border-radius:8px;padding:7px 9px}.product-result-actions button:disabled{opacity:.45;cursor:not-allowed}.empty.small{padding:14px;font-size:11px}.customer-billing-card{display:grid;grid-template-columns:1.2fr 2fr auto;gap:12px;align-items:center;width:100%}.customer-billing-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.customer-billing-metrics span{background:#fff;border:1px solid var(--line);border-radius:10px;padding:9px}.customer-billing-metrics small,.payment-box small{display:block;color:var(--muted);font-size:9px;text-transform:uppercase;letter-spacing:.07em}.customer-billing-metrics strong{font-size:11px}.history-box{margin-top:14px;border-top:1px solid var(--line);padding-top:14px}.history-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:260px;overflow:auto}.history-row{min-height:76px}.near-badge{display:inline-flex;vertical-align:middle;margin-left:6px;border-radius:999px;padding:3px 7px;background:var(--orange2);color:var(--orange);font-size:9px;font-weight:800;white-space:nowrap}.billing-line{display:grid;gap:8px;padding:13px 0;border-bottom:1px solid var(--line);min-width:0}.billing-line.stock-warning{background:#fff8f1;margin:0 -10px;padding:13px 10px;border-radius:10px}.billing-line-title{display:flex;justify-content:space-between;gap:10px}.billing-line-title strong{font-size:12px}.billing-line small,.billing-line-foot span{font-size:10px;color:var(--muted)}.billing-line-grid{display:grid;grid-template-columns:.55fr .95fr .72fr .72fr .72fr .55fr;gap:7px}.billing-line-grid label{font-size:9px}.billing-line-grid input,.billing-line-grid select{padding:7px;font-size:11px;min-width:0}.billing-line-foot{display:flex;justify-content:space-between;gap:10px;align-items:center}.button-row.mini{gap:5px;flex-wrap:wrap}.button-row.mini .row-action{font-size:9px;padding:5px 7px}.clear-remove{border:1px solid #f0cfca;background:#fff7f6;border-radius:7px;padding:5px 8px;font-size:9px;font-weight:800}.payment-box{margin:0 18px 14px;border:1px solid var(--line);border-radius:12px;padding:12px;background:#fafcf9;display:grid;gap:9px}.payment-title{display:flex;justify-content:space-between;align-items:center}.payment-options{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.payment-options button{border:1px solid var(--line);background:#fff;border-radius:8px;padding:8px 5px;font-size:10px;font-weight:800}.payment-options button.active{background:var(--green);border-color:var(--green);color:#fff}.compact-table{min-width:0}.secondary[href]{text-decoration:none;display:inline-flex;align-items:center;justify-content:center}.optional-customer-field>span{display:flex;align-items:center;gap:7px;min-height:20px}.optional-customer-field>span input{width:auto;margin:0}.optional-customer-field>input{margin-top:6px}
.document-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.document-card{background:#fff;border:1px solid var(--line);border-radius:13px;padding:17px;display:grid;gap:14px}.document-card-top{display:flex;justify-content:space-between}.document-card h3{font:800 14px Manrope;margin:0}.document-card p{margin:4px 0 0;color:var(--muted);font-size:10px}.document-card strong{font:800 18px Manrope}.document-card .button-row button{flex:1}.status-pill.open{background:var(--orange2);color:var(--orange)}.status-pill.converted{background:#eef0ef;color:#78827e}
.modal-shell{position:fixed;inset:0;background:rgba(8,28,24,.55);z-index:50;display:grid;place-items:center;padding:25px;backdrop-filter:blur(5px)}.modal{width:min(900px,96vw);max-height:90vh;background:#fff;border-radius:16px;box-shadow:var(--shadow);overflow:hidden;display:flex;flex-direction:column}.modal-head{flex:0 0 auto;background:#fff;z-index:2;display:flex;justify-content:space-between;align-items:center;padding:18px 20px;border-bottom:1px solid var(--line)}.modal-head h3{margin:0;font:800 17px Manrope}.modal-close{border:0;background:#f1f4f1;border-radius:8px;width:32px;height:32px}.modal-body{padding:20px;overflow:auto;min-height:0;-webkit-overflow-scrolling:touch}.customer-summary{display:grid;grid-template-columns:1fr repeat(3,auto);gap:24px;background:#f7faf7;border:1px solid var(--line);padding:16px;border-radius:12px;margin-bottom:18px}.customer-summary strong,.customer-summary small{display:block}.customer-summary small{color:var(--muted);font-size:9px;text-transform:uppercase;letter-spacing:.08em;margin-bottom:5px}.invoice-paper{padding:28px}.invoice-title{display:flex;justify-content:space-between;border-bottom:2px solid var(--nav);padding-bottom:18px;margin-bottom:20px}.invoice-title h2{font:800 27px Manrope;margin:0}.invoice-title p{margin:4px 0;color:var(--muted);font-size:11px}.invoice-meta{text-align:right}.invoice-total{margin-left:auto;width:260px;display:grid;gap:8px;margin-top:16px}.toast{position:fixed;right:25px;bottom:25px;background:var(--nav);color:#fff;border-radius:10px;padding:12px 16px;z-index:80;font-size:11px;box-shadow:var(--shadow)}
@media(max-width:1100px){.metrics{grid-template-columns:repeat(2,1fr)}.dashboard-grid,.sale-layout{grid-template-columns:1fr}.cart{position:static}.document-cards{grid-template-columns:repeat(2,1fr)}.bill-history-card{grid-template-columns:1fr 1fr 1fr}.history-filters{grid-template-columns:1fr 1fr 1.4fr}.customer-billing-card{grid-template-columns:1fr}.customer-billing-metrics{grid-template-columns:repeat(2,1fr)}}@media(max-width:760px){.login-view{grid-template-columns:1fr}.login-art{display:none}.login-card{min-height:100vh;align-content:center}.app{display:block}.sidebar{transform:translateX(-100%);transition:.2s}.sidebar.open{transform:translateX(0)}.app main{display:block}.app header{padding:0 16px}.menu-btn{display:block}.header-actions .icon-button{display:none}.content{padding:20px 14px}.metrics,.document-cards,.billing-grid,.history-filters,.customer-billing-metrics,.history-list{grid-template-columns:1fr}.dashboard-grid{grid-template-columns:1fr}.toolbar,.section-head,.billing-history-toolbar{align-items:stretch;flex-direction:column}.search{min-width:0}.sale-layout{display:block}.customer-summary{grid-template-columns:1fr 1fr}.cart{margin-top:16px}.billing-line-grid,.bill-history-card,.product-result{grid-template-columns:1fr}.product-result-actions{justify-content:flex-start;flex-wrap:wrap}.payment-options{grid-template-columns:1fr 1fr}.billing-line-foot{display:grid}.data-table{min-width:0}}
@media print{body>*{display:none!important}#modal{display:block!important;position:static;background:#fff;padding:0}.modal{box-shadow:none;max-height:none;width:100%}.modal-head{display:none}.invoice-paper{display:block}.invoice-paper .row-action{display:none}}
.sidebar nav a{border:0;background:transparent;color:#a9c1bb;text-align:left;padding:11px 13px;border-radius:9px;font-weight:600;text-decoration:none}.sidebar nav a i{display:inline-grid;width:26px;font-style:normal;font-size:17px}.sidebar nav a:hover,.sidebar nav a.active{background:rgba(255,255,255,.08);color:#fff}
.chart-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;padding:16px}.chart-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.chart-card{border:1px solid var(--line);border-radius:12px;padding:14px;background:#fafcf9;text-align:center}.chart-card h3{font:800 13px Manrope;margin:10px 0}.pie{width:130px;height:130px;border-radius:50%;margin:auto;position:relative}.pie:after{content:"";position:absolute;inset:28px;background:#fff;border-radius:50%}.chart-legend{display:grid;gap:6px;text-align:left}.chart-legend div{display:grid;grid-template-columns:8px 1fr auto;gap:6px;align-items:center;font-size:9px}.chart-legend i{width:8px;height:8px;border-radius:50%}.segment-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.segment-grid .panel{max-height:520px}.segment-grid .table-wrap{overflow:auto}
@media(max-width:1200px){.chart-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:760px){.chart-grid,.segment-grid{grid-template-columns:1fr}}
.link-button{border:0;background:transparent;color:var(--green);font-weight:800;text-align:center;padding:4px}.muted{color:var(--muted);font-size:12px;line-height:1.5}.form-grid{display:grid;gap:14px}.form-grid.padded{padding:18px}.check-row{display:flex;align-items:center;gap:8px;color:var(--ink);font-size:12px}.check-row input{width:auto}.branch-checks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:9px;max-height:210px;overflow:auto;border:1px solid var(--line);border-radius:10px;padding:10px;background:#fafcf9}.admin-grid{display:grid;grid-template-columns:360px 1fr;gap:18px;align-items:start}.admin-form{position:sticky;top:104px}@media(max-width:1100px){.admin-grid{grid-template-columns:1fr}.admin-form{position:static}}@media(max-width:760px){.branch-checks{grid-template-columns:1fr}}

.history-filters{grid-template-columns:140px 140px minmax(210px,1fr) minmax(190px,1fr)}
.customer-billing-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}
.branch-balance-list{grid-column:1/-1;display:flex;gap:8px;flex-wrap:wrap}.branch-balance-list span{border:1px solid var(--line);background:#fff;border-radius:999px;padding:6px 10px}.branch-balance-list small{color:var(--muted);font-size:9px;text-transform:uppercase;letter-spacing:.06em;margin-right:6px}.branch-balance-list strong{font-size:11px}
.schedule-badge{display:inline-flex;vertical-align:middle;margin-left:6px;border-radius:999px;padding:3px 7px;background:#e8eefb;color:#3f5f99;font-size:9px;font-weight:800;white-space:nowrap}
.line-error{color:#b42318!important;font-weight:800}.line-warning{color:#8a5200!important;font-weight:900;background:#fff7df;border:1px solid #f0d28c;border-radius:7px;padding:3px 7px;display:inline-block}
.target-flash{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:16px 18px;background:linear-gradient(135deg,#0f6f59,#22a174 55%,#f2a13a);color:#fff}.target-flash div{background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.28);border-radius:16px;padding:16px 17px;box-shadow:0 14px 30px rgba(16,44,41,.2)}.target-flash small{display:block;text-transform:uppercase;letter-spacing:.09em;font-size:10px;opacity:.86;font-weight:800}.target-flash strong{display:block;font:900 28px Manrope;margin-top:4px;letter-spacing:-.05em;text-shadow:0 2px 10px rgba(0,0,0,.15)}
.form-grid .span-2{grid-column:span 2}
.modal:has(.billing-modal-form){width:calc(100vw - 28px);max-width:none;height:calc(100vh - 28px);max-height:none;border-radius:14px}
.modal:has(.billing-modal-form) .modal-body{flex:1 1 auto;height:auto;overflow:auto;padding:14px;overscroll-behavior:contain}
.modal-shell.child{z-index:70;background:rgba(8,28,24,.35)}
.billing-modal-form .cart{top:0}
.billing-readonly{filter:saturate(.85)}
.receipt-paper{width:320px;margin:0 auto;padding:12px 10px;background:#fff;color:#000;font:11px/1.25 "Courier New",monospace}
.receipt-head{text-align:center}.receipt-head h2{font:800 15px "Courier New",monospace;margin:0 0 2px}.receipt-head p{margin:1px 0;color:#000;font-size:10px}.receipt-head strong{display:block;margin:3px 0;font-size:12px}
.receipt-rule{border-top:1px dashed #000;margin:5px 0}
.receipt-grid{display:grid;grid-template-columns:1fr 43px 45px 48px 54px;gap:3px;align-items:start;font-size:9px}.receipt-grid span:nth-child(n+2){text-align:right}.receipt-grid-head{font-weight:800;font-size:9px}
.receipt-item{padding:2px 0}.receipt-item strong{display:block;font-size:10px}.receipt-item small{display:block;font-size:8.5px;color:#000}
.receipt-totals{display:grid;gap:2px}.receipt-totals div{display:flex;justify-content:space-between;font-size:10px}.receipt-net{border-top:1px dashed #000;margin-top:4px;padding-top:4px;font-size:13px!important;font-weight:800}
.receipt-thanks{text-align:center;margin:5px 0 0;font-size:10px}
.receipt-paper{position:relative}
.receipt-secret{position:absolute;right:8px;top:5px;font-size:7px;color:#000}
.receipt-logo{display:block;width:38px;height:auto;margin:0 auto 2px;filter:grayscale(1) contrast(1.4)}
.hot-banners{display:grid;gap:7px;grid-column:1/-1;width:100%}
.hot-banner{border-radius:0;padding:8px 10px;color:#fff;display:grid;grid-template-columns:150px minmax(0,1fr);gap:9px;align-items:center;overflow:hidden;width:100%}
.hot-banner.near{background:#b91c1c}.hot-banner.margin{background:#087a55}.hot-banner.muted{background:#f6faf7;color:var(--muted);border:1px solid var(--line)}
.hot-banner strong{text-transform:uppercase;letter-spacing:.08em;font-size:10px}.hot-banner span{font-size:11px}
.hot-marquee{overflow:hidden;white-space:nowrap}
.hot-track{display:inline-flex;gap:8px;min-width:max-content;animation:hotMarquee 92s linear infinite}
.hot-track:hover{animation-play-state:paused}
.hot-track button{border:1px solid rgba(255,255,255,.45);background:rgba(255,255,255,.14);color:#fff;border-radius:999px;padding:6px 10px;font-size:10px;font-weight:800;cursor:pointer}
@keyframes hotMarquee{from{transform:translateX(0)}to{transform:translateX(-50%)}}
.billing-modal-form{grid-template-columns:minmax(0,1.25fr) minmax(520px,.75fr);min-height:100%;height:auto;overflow:visible;align-items:start}
.billing-modal-form .sale-left{min-height:0;overflow:visible;padding-right:4px}
.billing-modal-form .cart{position:sticky;top:0;max-height:calc(100vh - 118px);min-height:0;display:flex;flex-direction:column}
.billing-modal-form .selection-card{padding:10px}.billing-modal-form .search input{padding:11px 13px}
.billing-modal-form .cart-lines{max-height:none;flex:1;padding:4px 12px}
.billing-modal-form .payment-box{margin:0 12px 8px;padding:9px}.billing-modal-form .totals{padding:10px 12px;gap:4px}
.billing-modal-form .total-row{font-size:10px}.billing-modal-form .total-row.grand{font-size:15px;padding-top:7px}
.billing-modal-form .cart-actions{padding:0 12px 10px;gap:7px;grid-template-columns:1fr 1fr}.billing-modal-form .cart-actions button{padding:10px 12px;font-size:12px}.billing-modal-form .cart-actions button:last-child{grid-column:auto}
.billing-modal-form .notes{margin:0 12px 8px;width:calc(100% - 24px);min-height:44px}
.billing-line{padding:9px 0;gap:6px}.billing-line-grid{grid-template-columns:.45fr .8fr .62fr .58fr .58fr .48fr}
.billing-line-grid input,.billing-line-grid select{padding:6px;font-size:10px}.billing-line-title strong{font-size:11px}
.billing-product-search{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:8px;align-items:center}
.billing-product-search span{left:14px}
.billing-product-search input{grid-column:1;padding-left:37px!important}
.billing-product-search button{height:100%;min-height:42px;border:1px solid var(--line);background:#fff;border-radius:12px;font-weight:900;color:var(--green);cursor:pointer}
.scan-box video{width:100%;max-height:58vh;background:#000;border-radius:14px}
.enhanced-scan-box{display:grid;gap:12px}
.scanner-frame{position:relative;background:#000;border-radius:16px;overflow:hidden;border:1px solid #102c29}
.scanner-frame video{display:block;width:100%;height:min(62vh,620px);max-height:none;object-fit:cover;border-radius:0}
.scanner-reticle{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none;background:linear-gradient(rgba(0,0,0,.28),rgba(0,0,0,.08) 32%,rgba(0,0,0,.08) 68%,rgba(0,0,0,.28))}
.scanner-reticle span{width:min(82%,520px);height:min(38%,170px);border:3px solid rgba(255,255,255,.92);border-radius:14px;box-shadow:0 0 0 999px rgba(0,0,0,.18),0 0 20px rgba(22,114,91,.38) inset;position:relative}
.scanner-reticle span:before{content:"";position:absolute;left:8%;right:8%;top:50%;height:2px;background:#f4c36b;box-shadow:0 0 14px #f4c36b}
.scanner-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.scanner-controls>span{color:var(--muted);font-size:11px;font-weight:800;margin-left:auto}
.scanner-controls .secondary{padding:8px 12px;border-radius:999px;font-size:11px}
.scanner-controls .secondary.active{background:#f4c36b;border-color:#d89d2d;color:#3b2600}
.scanner-zoom{display:flex!important;grid-template-columns:none;align-items:center;gap:8px;border:1px solid var(--line);background:#fff;border-radius:999px;padding:7px 10px;color:#44514c;font-size:10px;font-weight:900}
.scanner-zoom.hidden{display:none!important}
.scanner-zoom input{width:110px;padding:0;border:0;box-shadow:none}
.manual-scan-entry{min-width:0}
.history-modal-actions{position:sticky;top:0;z-index:1;background:#fff;padding:0 0 12px;margin-bottom:10px;border-bottom:1px solid var(--line)}
.order-desk-head{align-items:center;margin-bottom:16px}.order-title-block{min-width:260px}.order-head-tools{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex:1;min-width:0}.order-status-chart{flex:1;max-width:760px;min-width:380px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:10px 12px;box-shadow:0 5px 20px rgba(25,50,41,.025)}.order-status-chart .empty.small{padding:8px}.order-status-chart-title{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:8px;color:var(--muted);font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.08em}.order-status-chart-title strong{color:var(--ink);font-size:11px}.order-status-bars{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px 12px}.order-status-bar{display:grid;grid-template-columns:82px minmax(46px,1fr) 28px;align-items:center;gap:7px;color:var(--ink);font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.04em}.order-status-bar span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.order-status-bar b{text-align:right;font-size:10px}.order-status-track{height:8px;border-radius:999px;background:#eef0ef;overflow:hidden}.order-status-fill{display:block;height:100%;border-radius:999px;background:var(--green)}.order-status-fill.order-pending{background:#d9951d}.order-status-fill.order-partial-stock{background:#d97032}.order-status-fill.order-no-stock{background:#b84c44}.order-status-fill.order-fulfilled{background:#16725b}.order-status-fill.order-partial-fulfilled{background:#3f5f99}.order-status-fill.order-cancelled-fulfilled{background:#0f766e}.order-status-fill.order-cancelled-partial{background:#9a6b12}.order-status-fill.order-cancelled{background:#78827e}
.status-pill.order-pending{background:#fff7e6;color:#9a5b00}.status-pill.order-partial-stock{background:#fff0e5;color:#c05f19}.status-pill.order-no-stock{background:#f9e9e8;color:#b84c44}.status-pill.order-fulfilled{background:var(--green2);color:var(--green)}.status-pill.order-partial-fulfilled{background:#e8eefb;color:#3f5f99}.status-pill.order-cancelled-fulfilled{background:#e0f7f3;color:#0f766e}.status-pill.order-cancelled-partial{background:#fff4d6;color:#9a6b12}.status-pill.order-cancelled{background:#eef0ef;color:#78827e}
@media(max-width:1100px){.order-desk-head{align-items:stretch;flex-direction:column}.order-title-block{min-width:0}.order-head-tools{justify-content:space-between;align-items:stretch}.order-status-chart{max-width:none;min-width:0;width:100%}}@media(max-width:760px){.order-head-tools{display:grid;grid-template-columns:1fr}.order-status-bars{grid-template-columns:1fr}.order-status-bar{grid-template-columns:100px minmax(70px,1fr) 28px}.order-status-chart{padding:10px}}
.order-status-fill.order-pending-cancelled{background:#94643a}.status-pill.order-pending-cancelled{background:#fff1e4;color:#8a4f1c}.order-item-chart{max-width:390px;min-width:320px;flex:.6}.order-item-chart .order-status-bars{grid-template-columns:1fr}.order-item-chart .order-status-bar{grid-template-columns:76px minmax(60px,1fr) 78px}.order-item-chart .order-status-bar b small{display:block;color:var(--muted);font-size:8px;line-height:1.1}.order-cancel-select{display:flex;gap:9px;align-items:flex-start;margin:0}.order-cancel-select input{width:auto;margin-top:2px}
@media(max-width:1100px){.order-item-chart{max-width:none;min-width:0;width:100%}}@media(max-width:760px){.order-item-chart .order-status-bar{grid-template-columns:92px minmax(70px,1fr) 74px}}
.billing-modal-form{grid-template-columns:minmax(320px,1fr) minmax(0,2fr);gap:14px}
.billing-modal-form .hot-banners{grid-column:1/-1}
.billing-modal-form .sale-left{display:grid;gap:10px;align-content:start;padding-right:0}
.billing-control-grid{grid-template-columns:1fr 1fr;gap:8px}
.billing-control-grid label:has(#billingPayment){display:none}
.billing-control-grid label{gap:4px;font-size:10px}
.billing-control-grid select,.billing-control-grid input{padding:8px 9px;border-radius:8px;font-size:11px}
.billing-money-panel{overflow:hidden}
.billing-money-panel .notes{margin:10px;width:calc(100% - 20px);min-height:42px;padding:9px;font-size:11px}
.billing-money-panel .payment-box{margin:0 10px 8px;padding:9px;border-radius:10px}
.billing-money-panel .payment-title strong{font-size:13px}
.billing-money-panel .payment-options{grid-template-columns:repeat(2,1fr)}
.billing-money-panel .payment-options button{padding:7px 4px;font-size:10px}
.billing-money-panel .totals{padding:9px 10px;gap:4px}
.billing-money-panel .total-row{font-size:10px}.billing-money-panel .total-row.grand{font-size:15px;padding-top:7px}
.billing-workspace{position:sticky;top:0;display:grid;grid-template-rows:auto minmax(0,1fr);gap:10px;max-height:calc(100vh - 116px);min-height:0}
.billing-workspace .billing-add-product{padding:10px}
.billing-workspace .billing-add-product .panel-head{padding:0 0 8px}
.billing-workspace .billing-product-search input{padding:9px 11px 9px 37px!important}
.billing-workspace .billing-product-search button{min-height:38px}
.billing-workspace .lookup-results{max-height:176px;margin-top:8px}
.billing-lines-panel{min-height:0;display:flex;flex-direction:column}
.billing-lines-panel .panel-head{padding:10px 14px}
.billing-lines-panel .cart-lines{flex:1;min-height:420px;max-height:none;overflow:auto;padding:3px 12px}
.billing-lines-panel .empty.small{padding:54px 12px}
.billing-lines-panel .save-status{padding:2px 12px 6px;min-height:22px}
.billing-lines-panel .cart-actions{display:grid;grid-template-columns:.8fr .8fr 1fr;gap:7px;padding:0 12px 10px}
.billing-lines-panel .cart-actions button{padding:8px 10px;border-radius:8px;font-size:11px}
.billing-lines-panel .cart-actions button:last-child{grid-column:auto}
.billing-lines-panel .billing-line{padding:7px 0;gap:5px}
.billing-lines-panel .billing-line-grid{grid-template-columns:.42fr .85fr .62fr .56fr .56fr .46fr}
.billing-lines-panel .billing-line-grid input,.billing-lines-panel .billing-line-grid select{padding:5px 6px;font-size:10px}
.billing-lines-panel .billing-line-title strong{font-size:11px}.billing-lines-panel .billing-line small,.billing-lines-panel .billing-line-foot span{font-size:9px}
.billing-modal-form .hot-banners{position:sticky;top:0;z-index:6;gap:5px;background:#fff;padding-bottom:6px}
.billing-modal-form .hot-banner{min-height:31px;padding:5px 8px;grid-template-columns:135px minmax(0,1fr)}
.billing-modal-form .hot-banner strong{font-size:9px}.billing-modal-form .hot-banner span{font-size:10px}
.billing-modal-form .hot-track button{padding:4px 8px;font-size:9px}
.billing-modal-form .selection-card{padding:8px}
.billing-modal-form .inline-head{display:flex;align-items:center;gap:8px;padding:0 0 6px}.billing-modal-form .inline-head h3{font-size:14px}.billing-modal-form .inline-head span{font-size:10px}
.billing-control-grid{gap:6px}.billing-control-grid label{font-size:9px}.billing-control-grid select,.billing-control-grid input{padding:6px 8px;font-size:10px;min-height:32px}
.billing-add-product .lookup-results{max-height:260px;gap:5px;margin-top:6px}.billing-add-product .lookup-row{padding:7px 9px;border-radius:8px}
.billing-add-product .product-result{grid-template-columns:minmax(0,1fr) auto;gap:8px}.billing-add-product .product-result strong{font-size:12px}.billing-add-product .product-result small{font-size:9px;margin-top:1px}
.billing-add-product .product-result-actions{gap:4px}.billing-add-product .product-result-actions button{width:25px;height:25px;font-size:8px}.billing-add-product .product-result-actions .row-action{width:auto;padding:5px 8px}
.mobile-app-only{display:none!important}html.android-webview .mobile-app-only{display:inline-flex!important}html.android-webview .billing-product-search{grid-template-columns:minmax(0,1fr) 44px 44px}.barcode-scan-btn,.voice-search-btn{position:relative}.voice-search-btn{border:1px solid var(--line);background:#fff;color:transparent;border-radius:10px;width:46px;min-width:46px}.voice-search-btn:before{content:"";position:absolute;left:50%;top:9px;width:12px;height:17px;border:3px solid var(--green);border-radius:9px;transform:translateX(-50%)}.voice-search-btn:after{content:"";position:absolute;left:50%;bottom:8px;width:18px;height:10px;border-bottom:3px solid var(--green);border-left:3px solid transparent;border-right:3px solid transparent;transform:translateX(-50%)}.barcode-scan-btn:before{content:"";display:block;width:20px;height:18px;margin:auto;background:repeating-linear-gradient(90deg,var(--green) 0 2px,transparent 2px 4px,var(--green) 4px 5px,transparent 5px 8px);border-top:2px solid var(--green);border-bottom:2px solid var(--green)}
.billing-modal-form .panel-head h3{font-size:14px}.billing-workspace .billing-product-search input{font-size:14px;min-height:36px}.billing-workspace .billing-product-search button{min-height:36px}
.billing-modal-form .customer-billing-card{display:block;padding:8px;background:#f7faf7;border:1px solid var(--line);border-radius:10px}
.customer-billing-main h3{font-size:13px;margin:0}.customer-billing-main p{display:inline;margin:2px 8px 0 0;font-size:9px}
.billing-modal-form .customer-billing-metrics{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}.billing-modal-form .customer-billing-metrics span{padding:5px 7px;border-radius:999px}.billing-modal-form .customer-billing-metrics small{font-size:7px;margin:0}.billing-modal-form .customer-billing-metrics strong{font-size:10px}
.billing-modal-form .branch-balance-list{gap:5px;margin-top:5px}.billing-modal-form .branch-balance-list span{padding:4px 7px}.billing-modal-form .customer-billing-card .row-action{margin-top:6px;padding:5px 10px}
.billing-modal-form .button-row .secondary{padding:7px 10px;font-size:11px}.billing-modal-form .search input{padding:8px 11px 8px 34px!important;font-size:12px;min-height:34px}.billing-modal-form .search span{top:8px}
.billing-modal-form .lookup-results{gap:5px}.billing-modal-form .lookup-row{padding:7px 9px;border-radius:8px}.billing-modal-form .lookup-row strong{font-size:11px}.billing-modal-form .lookup-row small{font-size:9px;margin-top:1px}
.billing-modal-form .history-box{margin-top:8px;padding-top:8px}.billing-modal-form .history-box .button-row{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.billing-money-panel .notes{min-height:34px;margin:8px;width:calc(100% - 16px);font-size:10px;padding:7px}
.billing-money-panel .payment-box{margin:0 8px 6px;padding:8px}.billing-money-panel .payment-title{margin-bottom:2px}.billing-money-panel .payment-title strong{font-size:12px}.billing-money-panel .payment-title span{font-size:14px;font-weight:900}
.billing-money-panel .payment-options{grid-template-columns:repeat(4,1fr)!important;gap:4px}.billing-money-panel .payment-options button{padding:6px 3px;font-size:9px;border-radius:7px}
.billing-money-panel .payment-box small{font-size:8px}.billing-money-panel .payment-box .secondary{padding:6px 8px;font-size:10px}
.billing-money-panel .totals{padding:7px 8px;background:#fff;gap:5px}.billing-money-panel .total-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.billing-money-panel .total-strip span{background:#f7faf7;border:1px solid var(--line);border-radius:999px;padding:5px 6px;font-size:8px;color:var(--muted);white-space:nowrap}.billing-money-panel .total-strip strong{display:block;color:var(--ink);font-size:10px}
.billing-money-panel .total-row.grand{background:var(--nav);color:#fff;border-radius:999px;padding:7px 10px;margin-top:2px;border:0;font-size:14px}.billing-money-panel .total-row.grand strong{color:#fff}
.billing-lines-panel .cart-lines{min-height:500px;padding:2px 10px}.billing-lines-panel .billing-line{padding:5px 0;gap:3px}.billing-lines-panel .billing-line-title{align-items:center}.billing-lines-panel .billing-line-title strong{font-size:10.5px}.billing-lines-panel .billing-line-title span{margin-left:auto;font-size:13px;font-weight:900}.billing-lines-panel .billing-line-title .clear-remove{margin-left:8px;padding:3px 7px;font-size:8px}
.billing-lines-panel .billing-line small{font-size:8.5px}.billing-lines-panel .compact-line-grid{grid-template-columns:minmax(250px,1.75fr) 58px 120px 82px 72px 58px;gap:5px;align-items:end}
.billing-lines-panel .compact-line-grid label{font-size:8px;gap:2px}.billing-lines-panel .compact-line-grid input,.billing-lines-panel .compact-line-grid select{padding:4px 6px;font-size:9px;min-height:28px;border-radius:8px}
.billing-lines-panel .billing-line-foot span{font-size:8.5px}.billing-lines-panel .button-row.mini{gap:4px}.billing-lines-panel .button-row.mini .row-action{font-size:8px;padding:4px 6px}
.child .history-modal-actions{position:sticky;top:0;z-index:3;background:#fff;padding:0 0 8px;margin-bottom:8px}.child .history-modal-actions .button-row button{padding:8px 12px}.child .table-wrap{max-height:62vh;overflow:auto}.child .compact-table thead th{position:sticky;top:0;z-index:2}
.modal:has(.billing-modal-form) .modal-head{position:relative;z-index:12;gap:12px;padding:10px 16px}
.modal:has(.billing-modal-form) .modal-head h3{font-size:18px;white-space:nowrap}
.modal-head-tools{flex:1;min-width:0;display:flex;align-items:center;justify-content:flex-end;gap:8px}
.billing-head-summary{display:flex;flex-direction:column;align-items:flex-end;min-width:118px}.billing-head-summary strong{font:900 18px Manrope}.billing-head-summary span{font-size:9px;color:var(--muted);white-space:nowrap}
.billing-head-payment{display:flex;align-items:center;gap:6px;border:1px solid var(--line);background:#fafcf9;border-radius:999px;padding:4px 6px}.billing-head-payment .payment-title{display:none}.billing-head-payment .payment-options{display:flex!important;gap:3px}.billing-head-payment .payment-options button{border:1px solid var(--line);background:#fff;border-radius:999px;padding:5px 8px;font-size:9px;font-weight:900}.billing-head-payment .payment-options button.active{background:var(--green);border-color:var(--green);color:#fff}.billing-head-payment small{display:none}.billing-head-payment .secondary{padding:5px 8px;border-radius:999px;font-size:9px}.billing-head-payment label{margin-left:4px;min-width:120px}.billing-head-payment select{padding:5px 7px;font-size:9px;border-radius:999px}
.billing-head-totals{min-width:310px}.billing-head-totals .total-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:3px}.billing-head-totals .total-strip span{background:#f7faf7;border:1px solid var(--line);border-radius:999px;padding:4px 6px;font-size:8px;color:var(--muted);white-space:nowrap}.billing-head-totals .total-strip strong{display:block;color:var(--ink);font-size:9px}.billing-head-totals .total-row.grand{display:none}
.billing-head-actions{display:flex;gap:6px}.billing-head-actions .primary{padding:7px 11px;border-radius:8px;font-size:11px;white-space:nowrap}
.billing-money-panel{display:none}
.billing-modal-form .sale-left>.selection-card:first-child{position:sticky;top:0;z-index:7}
.billing-workspace .billing-add-product{position:sticky;top:0;z-index:7}
.billing-workspace .billing-add-product .panel-head{display:none}
.billing-add-product .lookup-results{max-height:230px;overflow:auto}
.billing-modal-form .customer-billing-card{padding:7px 9px}
.customer-billing-main h3{font-size:12px}.customer-billing-main p{font-size:8.5px}
.billing-modal-form .customer-billing-metrics{display:block;margin-top:4px;font-size:9px;line-height:1.45;color:var(--muted)}
.billing-modal-form .customer-billing-metrics span{display:inline;padding:0;border:0;background:transparent;border-radius:0;color:var(--muted)}
.billing-modal-form .customer-billing-metrics span+span:before{content:" · ";color:#a4aca8}
.billing-modal-form .customer-billing-card .row-action{margin-top:4px;padding:4px 9px;font-size:9px}
.toast.toast-strong{left:50%;right:auto;top:50%;bottom:auto;transform:translate(-50%,-50%);width:min(560px,calc(100vw - 42px));background:#102c29;color:#fff;border:2px solid #f4c36b;border-radius:18px;padding:24px 28px;text-align:center;font:900 22px/1.28 Manrope;box-shadow:0 30px 90px rgba(0,0,0,.35);z-index:120}
.modal:has(.billing-modal-form) .modal-body{overflow:hidden;padding:10px 14px}
.billing-modal-form{grid-template-columns:minmax(270px,.72fr) minmax(0,2.28fr);grid-template-rows:auto minmax(0,1fr);height:100%;min-height:0;overflow:hidden;gap:10px 14px}
.billing-modal-form .hot-banners{position:relative;top:auto;z-index:5}
.billing-modal-form .sale-left{min-height:0;height:100%;overflow:hidden;align-self:stretch;background:#f8fbf7;border-right:1px solid var(--line);padding:0 10px 0 0}
.billing-modal-form .sale-left>.selection-card:first-child{position:static;background:#fffaf2;border-color:#eadfcc}
.billing-modal-form .sale-left>.selection-card:nth-child(2){background:#f4faf8;border-color:#dcebe4}
.billing-modal-form .sale-left .selection-card{box-shadow:none}
.billing-workspace{position:static;height:100%;max-height:none;align-self:stretch;display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden}
.billing-workspace .billing-add-product{position:relative;top:auto;z-index:4;background:#fff}
.billing-workspace .billing-add-product .billing-product-search{position:sticky;top:0;z-index:5;background:#fff;padding-bottom:4px}
.billing-add-product .lookup-results{max-height:190px;overflow:auto}
.billing-lines-panel{height:100%;overflow:hidden}
.billing-lines-panel .cart-lines{min-height:0;height:100%;overflow:auto}
.billing-modal-form .customer-billing-metrics{font-size:8.5px;line-height:1.35}
.billing-control-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px 6px}
.billing-control-grid label{min-width:0;overflow:hidden;font-size:8px;line-height:1.15}
.billing-control-grid select,.billing-control-grid input{width:100%;min-width:0;min-height:29px;padding:5px 7px;font-size:9px;border-radius:8px}
.billing-control-grid label:nth-child(1),.billing-control-grid label:nth-child(3){grid-column:1}.billing-control-grid label:nth-child(2),.billing-control-grid label:nth-child(4){grid-column:2}
.billing-modal-form .sale-left>.selection-card:first-child{padding:6px 7px}
.billing-head-actions .secondary{padding:7px 11px;border-radius:8px;font-size:11px;font-weight:900;white-space:nowrap;background:#fff}
.billing-head-actions .primary:last-child{font-size:12px;padding:9px 14px;background:#0d7f60}
.billing-head-summary strong{font-size:24px;color:#0b342d}.billing-head-summary span{font-weight:800}
.billing-head-totals .total-strip span{padding:5px 8px}.billing-head-totals .total-strip strong{font-size:10px}
.billing-modal-form .customer-billing-metrics{display:flex;flex-wrap:wrap;gap:4px;margin-top:5px}
.billing-modal-form .customer-billing-metrics span{display:inline-flex;align-items:center;border-radius:999px;padding:3px 7px;font-size:8px;font-weight:800;color:#21342e;border:1px solid transparent}
.billing-modal-form .customer-billing-metrics span+span:before{content:none}
.billing-modal-form .customer-billing-metrics span:nth-child(1){background:#e9f7ef;border-color:#cce8d8;color:#0f684d}
.billing-modal-form .customer-billing-metrics span:nth-child(2){background:#eef4ff;border-color:#d8e5ff;color:#315c9f}
.billing-modal-form .customer-billing-metrics span:nth-child(3){background:#fff7df;border-color:#f0dfae;color:#86620f}
.billing-modal-form .customer-billing-metrics span:nth-child(4){background:#f7efff;border-color:#eadcff;color:#7050a8}
.billing-modal-form .customer-billing-metrics span:nth-child(5){background:#effaf9;border-color:#d1eae7;color:#27635d}
.billing-modal-form .customer-billing-metrics span:nth-child(6){background:#fff0ea;border-color:#f2d2c8;color:#9a4d32}
.billing-modal-form .customer-billing-metrics span:nth-child(7){background:#edf7e8;border-color:#d3e8cb;color:#456d29}
.billing-modal-form .customer-billing-metrics span:nth-child(n+8){background:#f3f5f2;border-color:#e1e6df;color:#5b665f}
.customer-entry-button{justify-content:space-between;text-align:left}.customer-app{min-height:100vh;background:#f4f6f2}.customer-login-screen{min-height:100vh;display:grid;place-items:center;padding:28px}.customer-login-panel{width:min(460px,100%);background:#fff;border:1px solid var(--line);border-radius:14px;padding:28px;box-shadow:var(--shadow);display:grid;gap:18px}.customer-login-panel img{width:min(310px,100%);height:auto}.customer-login-panel h1{font:800 30px Manrope;margin:0;letter-spacing:-.04em}.customer-auth-form{gap:13px}.customer-auth-switch{display:flex;gap:10px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:14px}.customer-auth-switch button{border:0;background:transparent;color:var(--green);font-weight:900;padding:6px}.customer-check-result{min-height:28px;font-size:12px;color:var(--muted)}.customer-check-result strong{display:block}.customer-check-result .account_exists,.customer-check-result .customer_not_available{color:var(--red)}.customer-check-result .can_create{color:var(--green)}.customer-check-result small{display:block;margin-top:3px}.customer-topbar{position:sticky;top:0;z-index:5;display:flex;justify-content:space-between;align-items:center;gap:12px;background:#fff;border-bottom:1px solid var(--line);padding:15px 24px}.customer-topbar strong,.customer-topbar span{display:block}.customer-topbar span{font-size:11px;color:var(--muted);margin-top:2px}.customer-portal-grid{width:min(1260px,100%);margin:0 auto;padding:22px;display:grid;grid-template-columns:minmax(0,1fr) minmax(360px,.8fr);gap:16px}.customer-portal-grid .span-2{grid-column:1/-1}.customer-order-compose{padding:16px;display:grid;gap:12px}.customer-manual-line{display:grid;grid-template-columns:minmax(0,1fr) 90px auto;gap:8px}.customer-cart{display:grid;gap:8px}.customer-cart-line{display:grid;grid-template-columns:minmax(0,1fr) 78px 30px;gap:8px;align-items:center;border:1px solid var(--line);border-radius:10px;padding:10px;background:#fbfdfb}.customer-cart-line strong,.customer-cart-line small{display:block}.customer-cart-line small{font-size:10px;color:var(--muted);margin-top:2px}.customer-cart-line input{padding:7px}.customer-order-compose textarea{min-height:70px}.customer-doc-tabs{padding:14px;display:grid;gap:10px}.customer-doc-tabs h4{font:800 13px Manrope;margin:8px 0 0}.customer-doc-tabs .data-table{min-width:0}.customer-order-list{padding:14px;display:grid;gap:10px}.customer-order-card{display:grid;grid-template-columns:220px minmax(0,1fr) auto;gap:12px;align-items:center;border:1px solid var(--line);border-radius:12px;background:#fff;padding:12px}.customer-order-card strong,.customer-order-card small,.customer-order-card span{display:block}.customer-order-card small{font-size:10px;color:var(--muted);margin-top:2px}.customer-order-card span{font-size:12px;margin:2px 0}.portal-line-pill{display:inline-flex;margin:2px 4px 2px 0;border-radius:999px;background:#edf7e8;color:#315f28;padding:5px 8px;font-size:10px;font-weight:800}.portal-line-pill.warn{background:#fff0e5;color:#a95118}.portal-admin-list .data-table td:nth-child(3){min-width:280px}.portal-order-editor .customer-summary{margin-bottom:0}.portal-order-editor .data-table input{min-width:110px;padding:8px}
@media(max-width:900px){.customer-portal-grid{grid-template-columns:1fr;padding:14px}.customer-portal-grid .span-2{grid-column:auto}.customer-order-card{grid-template-columns:1fr}.customer-manual-line{grid-template-columns:1fr 90px}.customer-manual-line button{grid-column:1/-1}.customer-login-screen{padding:16px}.customer-login-panel{padding:20px}.customer-topbar{padding:13px 15px}.customer-doc-tabs{overflow:auto}.customer-doc-tabs .data-table{min-width:520px}}
@media print{
  @page{size:80mm auto;margin:1.5mm}
  body{background:#fff!important;color:#000!important}
  #modal{display:block!important;position:static!important;background:#fff!important;padding:0!important}
  .modal{box-shadow:none!important;max-height:none!important;width:80mm!important;border-radius:0!important;overflow:visible!important}
  .modal-body{padding:0!important}.modal-head,.no-print,.invoice-paper .button-row{display:none!important}
  .receipt-paper,.invoice-paper{width:76mm!important;margin:0!important;padding:0!important;font:9px/1.18 "Courier New",monospace!important;color:#000!important}
  .receipt-head h2{font-size:11px!important}.receipt-head p{font-size:8px!important}.receipt-head strong{font-size:9px!important}
  .receipt-grid{grid-template-columns:1fr 30px 32px 34px 38px!important;gap:2px!important;font-size:7px!important}
  .receipt-item strong{font-size:8px!important}.receipt-item small{font-size:7px!important}
  .receipt-totals div,.receipt-thanks{font-size:8px!important}.receipt-net{font-size:10px!important}
}

/* Billing v20260719-18: final winning mobile alignment for lot, qty and unit controls. */
@media(max-width:760px) {
  .billing-modal-form .compact-line-grid,
  .billing-modal-form .compact-line-grid.has-free-qty,
  .billing-modal-form .compact-line-grid.has-scheme-discount,
  .billing-modal-form .compact-line-grid.has-free-qty.has-scheme-discount,
  html.android-webview .billing-modal-form .compact-line-grid,
  html.android-webview .billing-modal-form .compact-line-grid.has-free-qty,
  html.android-webview .billing-modal-form .compact-line-grid.has-scheme-discount,
  html.android-webview .billing-modal-form .compact-line-grid.has-free-qty.has-scheme-discount {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 42px minmax(86px, .42fr) !important;
    grid-template-rows: 30px 30px !important;
    grid-auto-rows: 30px !important;
    column-gap: 4px !important;
    row-gap: 1px !important;
    align-items: stretch !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-lot,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-lot {
    grid-column: 1 / 2 !important;
    grid-row: 1 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-qty,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-qty {
    grid-column: 2 / 3 !important;
    grid-row: 1 !important;
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-unit,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-unit {
    grid-column: 3 / 4 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-rate,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-rate {
    grid-column: 1 / 2 !important;
    grid-row: 2 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-mrp,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-mrp {
    grid-column: 2 / 3 !important;
    grid-row: 2 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-trade,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-trade {
    grid-column: 3 / 4 !important;
    grid-row: 2 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-lot,
  .billing-modal-form .compact-line-grid .billing-field-qty,
  .billing-modal-form .compact-line-grid .billing-field-unit,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-lot,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-qty,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-unit {
    display: block !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    overflow: visible !important;
    align-self: stretch !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-lot select,
  .billing-modal-form .compact-line-grid .billing-field-qty input,
  .billing-modal-form .compact-line-grid .billing-field-unit select,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-lot select,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-qty input,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-unit select {
    display: block !important;
    width: 100% !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
    transform: none !important;
    vertical-align: top !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-qty input,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-qty input {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    padding-left: 1px !important;
    padding-right: 1px !important;
    font-size: 16px !important;
    font-weight: 950 !important;
    border-width: 2px !important;
    border-radius: 8px !important;
    text-align: center !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-lot select,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-lot select {
    font-size: 12.5px !important;
    padding-left: 6px !important;
    padding-right: 14px !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-unit select,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-unit select {
    font-size: 12.5px !important;
    padding-left: 5px !important;
    padding-right: 12px !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-rate,
  .billing-modal-form .compact-line-grid .billing-field-mrp,
  .billing-modal-form .compact-line-grid .billing-field-trade,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-rate,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-mrp,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-trade {
    gap: 1px !important;
    margin: 0 !important;
    line-height: .9 !important;
    font-size: 10px !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-rate input,
  .billing-modal-form .compact-line-grid .billing-field-mrp input,
  .billing-modal-form .compact-line-grid .billing-field-trade input,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-rate input,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-mrp input,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-trade input {
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    font-size: 14px !important;
    padding: 0 6px !important;
  }
}

/* Billing v20260719-17: final mobile alignment for lot, qty and unit controls. */
@media(max-width:760px) {
  .billing-modal-form .compact-line-grid,
  .billing-modal-form .compact-line-grid.has-free-qty,
  .billing-modal-form .compact-line-grid.has-scheme-discount,
  .billing-modal-form .compact-line-grid.has-free-qty.has-scheme-discount,
  html.android-webview .billing-modal-form .compact-line-grid,
  html.android-webview .billing-modal-form .compact-line-grid.has-free-qty,
  html.android-webview .billing-modal-form .compact-line-grid.has-scheme-discount,
  html.android-webview .billing-modal-form .compact-line-grid.has-free-qty.has-scheme-discount {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 42px minmax(86px, .42fr) !important;
    grid-template-rows: 30px 30px !important;
    grid-auto-rows: 30px !important;
    column-gap: 4px !important;
    row-gap: 1px !important;
    align-items: stretch !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-lot,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-lot {
    grid-column: 1 / 2 !important;
    grid-row: 1 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-qty,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-qty {
    grid-column: 2 / 3 !important;
    grid-row: 1 !important;
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-unit,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-unit {
    grid-column: 3 / 4 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-rate,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-rate {
    grid-column: 1 / 2 !important;
    grid-row: 2 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-mrp,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-mrp {
    grid-column: 2 / 3 !important;
    grid-row: 2 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-trade,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-trade {
    grid-column: 3 / 4 !important;
    grid-row: 2 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-lot,
  .billing-modal-form .compact-line-grid .billing-field-qty,
  .billing-modal-form .compact-line-grid .billing-field-unit,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-lot,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-qty,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-unit {
    display: block !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    overflow: visible !important;
    align-self: stretch !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-lot select,
  .billing-modal-form .compact-line-grid .billing-field-qty input,
  .billing-modal-form .compact-line-grid .billing-field-unit select,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-lot select,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-qty input,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-unit select {
    display: block !important;
    width: 100% !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
    transform: none !important;
    vertical-align: top !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-qty input,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-qty input {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    padding-left: 1px !important;
    padding-right: 1px !important;
    font-size: 16px !important;
    font-weight: 950 !important;
    border-width: 2px !important;
    border-radius: 8px !important;
    text-align: center !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-lot select,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-lot select {
    font-size: 12.5px !important;
    padding-left: 6px !important;
    padding-right: 14px !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-unit select,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-unit select {
    font-size: 12.5px !important;
    padding-left: 5px !important;
    padding-right: 12px !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-rate,
  .billing-modal-form .compact-line-grid .billing-field-mrp,
  .billing-modal-form .compact-line-grid .billing-field-trade,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-rate,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-mrp,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-trade {
    gap: 1px !important;
    margin: 0 !important;
    line-height: .9 !important;
    font-size: 10px !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-rate input,
  .billing-modal-form .compact-line-grid .billing-field-mrp input,
  .billing-modal-form .compact-line-grid .billing-field-trade input,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-rate input,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-mrp input,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-trade input {
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    font-size: 14px !important;
    padding: 0 6px !important;
  }
}

/* Billing v20260719-16: hard-align mobile lot / qty / unit controls. */
@media(max-width:760px) {
  .billing-modal-form .compact-line-grid,
  .billing-modal-form .compact-line-grid.has-free-qty,
  .billing-modal-form .compact-line-grid.has-scheme-discount,
  .billing-modal-form .compact-line-grid.has-free-qty.has-scheme-discount {
    grid-template-columns: minmax(0, 1fr) 46px minmax(84px, .44fr) !important;
    grid-auto-rows: min-content !important;
    gap: 3px 4px !important;
    align-items: end !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-lot {
    grid-column: 1 / 2 !important;
    grid-row: 1 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-qty {
    grid-column: 2 / 3 !important;
    grid-row: 1 !important;
    width: 46px !important;
    max-width: 46px !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-unit {
    grid-column: 3 / 4 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-rate {
    grid-column: 1 / 2 !important;
    grid-row: 2 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-mrp {
    grid-column: 2 / 3 !important;
    grid-row: 2 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-trade {
    grid-column: 3 / 4 !important;
    grid-row: 2 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-lot,
  .billing-modal-form .compact-line-grid .billing-field-qty,
  .billing-modal-form .compact-line-grid .billing-field-unit {
    display: grid !important;
    grid-template-rows: 32px !important;
    align-items: end !important;
    gap: 0 !important;
    margin: 0 !important;
    min-height: 32px !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-lot select,
  .billing-modal-form .compact-line-grid .billing-field-qty input,
  .billing-modal-form .compact-line-grid .billing-field-unit select {
    align-self: end !important;
    display: block !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-qty input {
    width: 46px !important;
    max-width: 46px !important;
    padding: 0 2px !important;
    font-size: 17px !important;
    font-weight: 950 !important;
    border-width: 2px !important;
    border-radius: 8px !important;
    text-align: center !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-lot select {
    font-size: 13px !important;
    padding: 0 14px 0 6px !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-unit select {
    font-size: 13px !important;
    padding: 0 14px 0 5px !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-rate,
  .billing-modal-form .compact-line-grid .billing-field-mrp,
  .billing-modal-form .compact-line-grid .billing-field-trade {
    gap: 1px !important;
    margin: 0 !important;
    line-height: .9 !important;
    font-size: 10px !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-rate input,
  .billing-modal-form .compact-line-grid .billing-field-mrp input,
  .billing-modal-form .compact-line-grid .billing-field-trade input {
    height: 31px !important;
    min-height: 31px !important;
    font-size: 14px !important;
    padding: 0 6px !important;
  }
}

/* Billing v20260719-2: mobile lot width, stock visibility, and search flow fixes. */
@media(max-width:760px) {
  html.android-webview .billing-add-product,
  html.android-webview .billing-workspace .billing-add-product,
  html.android-webview .modal-shell:not(.hidden) .billing-add-product {
    position: relative !important;
    top: auto !important;
    z-index: 2 !important;
  }

  html.android-webview .billing-workspace .billing-add-product .billing-product-search {
    position: relative !important;
    top: auto !important;
    z-index: 2 !important;
  }

  html.android-webview .billing-lines-panel,
  html.android-webview .billing-lines-panel .panel-head,
  html.android-webview .billing-lines-panel .cart-lines {
    position: relative !important;
    top: auto !important;
    z-index: 1 !important;
  }

  html.android-webview .billing-line-facts {
    display: grid !important;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr) !important;
    width: 100% !important;
    overflow: visible !important;
    white-space: normal !important;
    gap: 4px !important;
  }

  html.android-webview .billing-line-facts .line-fact {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html.android-webview .billing-line-facts .fact-batch,
  html.android-webview .billing-line-facts .fact-expiry {
    grid-column: span 1;
  }

  html.android-webview .billing-line-facts .fact-shelf,
  html.android-webview .billing-line-facts .fact-stock {
    grid-column: span 1;
  }

  html.android-webview .billing-line-facts .fact-stock {
    text-align: left;
  }

  html.android-webview .compact-line-grid,
  html.android-webview .compact-line-grid.has-free-qty,
  html.android-webview .compact-line-grid.has-scheme-discount,
  html.android-webview .compact-line-grid.has-free-qty.has-scheme-discount {
    grid-template-columns: minmax(0, 1.4fr) 50px 56px minmax(62px, .8fr) !important;
  }

  html.android-webview .compact-line-grid .lot-field {
    grid-column: 1 / 4 !important;
  }

  html.android-webview .compact-line-grid .lot-field select {
    padding-left: 8px !important;
    padding-right: 26px !important;
    font-size: 12px !important;
  }
}

.prominent-error:not(:empty){margin:10px 0 0;padding:12px 14px;border:1px solid #ef9a9a;border-radius:10px;background:#fff0f0;color:#a61b1b;font-size:14px;font-weight:700;line-height:1.4}

/* Receipt desk */
.modal:has(.receipt-form){width:min(1180px,calc(100vw - 50px))}.receipt-form{display:grid;gap:14px}.receipt-top-grid{grid-template-columns:1.1fr .7fr 1fr 1.5fr}.receipt-customer-field{grid-column:auto}.receipt-payment-grid{grid-template-columns:.7fr .7fr 1.6fr}.receipt-bank-grid{grid-template-columns:repeat(4,minmax(150px,1fr));margin-top:2px}.receipt-card-grid{grid-template-columns:minmax(240px,420px)}.receipt-allocation-panel{overflow:hidden}.receipt-allocation-panel .panel-head{gap:18px}.receipt-allocation-panel .panel-head>div:first-child{display:grid;gap:3px}.receipt-allocation-panel .panel-head small{color:var(--muted)}.receipt-invoice-check{width:20px;height:20px;accent-color:var(--green)}.receipt-allocation-value{display:inline-block;min-width:90px;text-align:right}.receipt-allocation-panel tr.selected{background:#edf9f1}.receipt-balance-strip{display:flex;justify-content:flex-end;align-items:center;gap:12px;padding:10px 16px;background:#fff4bf;border-bottom:1px solid #dfc467}.receipt-balance-strip strong{font-size:20px;color:#8f1118}.receipt-save-bar{position:sticky;bottom:0;z-index:5;display:flex;align-items:center;justify-content:flex-end;gap:10px;padding:12px;border:1px solid var(--line);border-radius:12px;background:#fff;box-shadow:0 -5px 18px rgba(20,50,45,.08)}.receipt-save-bar>div:first-child{margin-right:auto}.receipt-mode{display:inline-flex;padding:4px 9px;border-radius:999px;font-size:11px;font-weight:850}.mode-cash{background:#dff5e7;color:#155f36}.mode-cheque{background:#fff0bf;color:#755400}.mode-card{background:#e9ddff;color:#4c2877}.receipt-adjust-head{display:grid;grid-template-columns:repeat(3,auto);align-items:center;gap:8px 14px;padding:12px;margin-bottom:12px;border-radius:12px;background:#eef6f2}.receipt-adjust-head strong{font-size:18px}.receipt-table td{vertical-align:middle}
.modal:has(#receiptOutstanding){width:min(980px,calc(100vw - 50px))}.modal:has(#receiptOutstanding) .data-table{min-width:760px}.modal:has(#receiptOutstanding) .data-table th,.modal:has(#receiptOutstanding) .data-table td{padding:11px 12px}.modal:has(#receiptOutstanding) .data-table th:last-child,.modal:has(#receiptOutstanding) .data-table td:last-child{text-align:right;white-space:nowrap}.modal:has(#receiptOutstanding) .table-wrap{max-height:58vh;overflow:auto}
@media(max-width:1100px) and (min-width:761px){.receipt-top-grid{grid-template-columns:1fr 1fr}.receipt-payment-grid{grid-template-columns:1fr 1fr}.receipt-payment-grid label:last-child{grid-column:1/-1}.receipt-bank-grid{grid-template-columns:1fr 1fr}}
@media(max-width:760px){.modal:has(.receipt-form){width:100vw}.receipt-form,.receipt-form>*,.receipt-form .form-grid>*,.receipt-form label{min-width:0;max-width:100%}.receipt-form input,.receipt-form select{min-width:0;max-width:100%}.receipt-top-grid,.receipt-payment-grid,.receipt-bank-grid,.receipt-card-grid{grid-template-columns:minmax(0,1fr)}.receipt-form .selected-customer{display:grid;grid-template-columns:minmax(0,1fr);gap:4px;align-items:start}.receipt-form .selected-customer span{min-width:0;overflow-wrap:anywhere}.receipt-save-bar{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.receipt-save-bar>div:first-child{grid-column:1/-1;width:100%;margin:0;white-space:normal;overflow-wrap:anywhere}.receipt-save-bar button{width:100%;min-width:0}.receipt-allocation-panel .panel-head{align-items:flex-start}.receipt-allocation-panel .data-table{min-width:720px}.receipt-table{min-width:900px}.receipt-adjust-head{grid-template-columns:1fr 1fr}}

#billingHeaderCustomerBtn.customer-selected{
  background:#94131b!important;
  border-color:#65080d!important;
  color:#fff!important;
}
.billing-add-product .product-result .search-mrp{
  display:inline-block;
  padding:2px 6px;
  border:1px solid #c79b16;
  border-radius:6px;
  background:#ffe58a;
  color:#111;
  font-weight:1000;
  line-height:1.15;
}
.history-actions .row-action{font-weight:900;color:#111}
.history-actions .history-action-open{background:#dceeff;border-color:#6fa7d3;color:#123f68}
.history-actions .history-action-copy{background:#ffe8a8;border-color:#d3a62d;color:#5c4000}
.history-actions .history-action-print{background:#e9ddff;border-color:#ad8ae5;color:#3e246b}
.history-actions .history-action-whatsapp{background:#d9f4df;border-color:#61ad75;color:#155b2b}
.history-actions .history-action-poke{background:#ffe7ef;border-color:#ef9cb7;color:#7d1436}
.history-actions .history-action-cancel,.history-action-cancel{background:#ffe5e2;border-color:#de6c61;color:#8a1d15}
.button-row .danger,.danger{background:#b91c1c;border:1px solid #991b1b;color:#fff;border-radius:8px;padding:10px 14px;font-weight:900}
.history-actions .order-export-excel{background:#ffe082;border-color:#e0a800;color:#3d2c00}
.filter-checklist-field{display:grid;gap:4px;font-size:10px;font-weight:800;color:var(--muted);min-width:0}
.filter-checklist{position:relative;min-width:0}
.filter-checklist summary{height:38px;display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--ink);font-size:12px;font-weight:850;padding:7px 10px;cursor:pointer;list-style:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.filter-checklist summary::-webkit-details-marker{display:none}
.filter-checklist summary::after{content:'⌄';font-size:13px;color:var(--muted);flex:0 0 auto}
.filter-checklist[open] summary::after{content:'⌃'}
.filter-checklist-menu{position:absolute;z-index:30;top:42px;left:0;right:0;display:grid;gap:2px;max-height:245px;overflow:auto;border:1px solid #b8c8c2;border-radius:10px;background:#fff;box-shadow:0 14px 34px rgba(15,43,38,.18);padding:7px}
.filter-checklist-menu label{display:flex!important;align-items:center;gap:7px;margin:0;padding:6px 7px;border-radius:7px;color:var(--ink);font-size:11px;font-weight:800;text-transform:none;letter-spacing:0}
.filter-checklist-menu .filter-checklist-all{border-bottom:1px solid var(--line);border-radius:7px 7px 0 0;margin-bottom:3px;color:var(--green)}
.filter-checklist-menu label:hover{background:#eef6f2}
.filter-checklist-menu input{width:auto!important;height:auto!important;margin:0;accent-color:var(--green)}
.order-poke-cell{min-width:130px}
.order-poke-list{display:grid;gap:2px}
.order-poke-chip{display:block;font-size:10px;font-weight:1000;line-height:1.2;text-transform:uppercase}
.order-poke-chip small{display:inline;margin-left:4px;color:inherit;opacity:.75;text-transform:none}
.poke-call-denied{color:#b84c44}
.poke-order-cancelled{color:#7b2b2b}
.poke-will-come-later{color:#b26a00}
.poke-unreachable{color:#7a4fb3}
.poke-need-delivery{color:#16725b}
.poke-taken-elsewhere{color:#475569}
.poke-will-take-later{color:#0f6f9a}
.poke-stock-part-avail-will-take-full-qty{color:#b7791f}
.poke-odr-cancelled-by-us-prod-na{color:#b42318}
.poke-odr-can-billed-on-another-ac{color:#6d28d9}
.poke-unknown{color:#73807b}
.resend-whatsapp-action{background:#b5121b!important;border-color:#75070c!important;color:#fff!important;font-weight:900!important}

@media(max-width:760px){
  .enhanced-scan-box .scanner-frame video{height:58dvh!important;max-height:none!important}
  .enhanced-scan-box .scanner-controls{gap:7px}
  .enhanced-scan-box .scanner-controls>span{width:100%;margin-left:0}
  .enhanced-scan-box .scanner-zoom{flex:1 1 170px}
  .enhanced-scan-box .scanner-zoom input{width:100%}
}

.pending-orders-btn{
  border-color:#f2b84b!important;
  background:#fff3cd!important;
  color:#6d4300!important;
  box-shadow:0 1px 0 rgba(109,67,0,.08);
}
.pending-orders-btn:hover{
  background:#ffe39a!important;
  border-color:#d99b22!important;
}
.billing-pending-row{display:flex;align-items:center;gap:7px;min-width:0}
.billing-customer-due-badges{display:flex;align-items:center;gap:6px}
.billing-customer-due-badges span{display:grid;gap:1px;min-width:112px;padding:5px 10px;border-radius:9px;line-height:1.05}
.billing-customer-due-badges span:first-child{background:#ffe58a;border:1px solid #d5a91f;color:#5b3c00}
.billing-customer-due-badges span:last-child{background:#ffcbd5;border:1px solid #d95b74;color:#761326}
.billing-customer-due-badges small{color:inherit;font-size:7px;font-weight:900;text-transform:uppercase;letter-spacing:.05em}
.billing-customer-due-badges strong{color:inherit;font-size:11px;font-weight:1000;white-space:nowrap}
@media(max-width:1100px){.history-filters{grid-template-columns:1fr 1fr}}
@media(max-width:760px){.history-filters,.customer-billing-metrics{grid-template-columns:1fr}.form-grid .span-2{grid-column:auto}}
@media(max-width:760px){html,body{max-width:100%;overflow-x:hidden}.modal-shell{padding:0;place-items:stretch}.modal{width:100vw;max-height:100vh;border-radius:0}.modal-body{padding:12px}.modal:has(.billing-modal-form){width:100vw;height:100vh}.modal:has(.billing-modal-form) .modal-body{height:calc(100vh - 70px);overflow:auto}.billing-modal-form{display:block;height:auto;overflow:visible}.billing-modal-form .sale-left{overflow:visible}.billing-modal-form .cart{position:static;margin-top:12px;height:auto}.billing-modal-form .cart-lines{max-height:none}.target-flash{grid-template-columns:1fr 1fr;padding:12px}.target-flash strong{font-size:22px}.admin-grid{display:block}.admin-form{position:static}.bill-history-card{grid-template-columns:1fr}.customer-summary{grid-template-columns:1fr}.data-table{font-size:11px}.content{overflow-x:hidden}}
@media(max-width:760px){
  html.android-webview,html.android-webview body{height:100%;min-height:100%;overflow-x:hidden;overflow-y:auto;touch-action:pan-y}
  html.android-webview .modal-shell:not(.hidden){display:block;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:0}
  html.android-webview .modal{width:100vw;min-height:100%;height:auto;max-height:none;border-radius:0;overflow:visible}
  html.android-webview .modal-head{position:sticky;top:0}
  html.android-webview .modal-body{height:auto;min-height:calc(100dvh - 70px);overflow:visible;padding:12px}
  html.android-webview .modal:has(.billing-modal-form){height:auto;min-height:100%}
  html.android-webview .modal:has(.billing-modal-form) .modal-body{height:auto;min-height:calc(100dvh - 70px);overflow:visible}
  html.android-webview .billing-modal-form{display:block;height:auto;min-height:auto;overflow:visible}
  html.android-webview .billing-modal-form .cart{position:static;max-height:none;height:auto;margin-top:12px}
  html.android-webview .billing-modal-form .cart-lines{max-height:none;overflow:visible}
}
@media(max-width:760px){
  body{overscroll-behavior-y:contain}
  .modal:has(.billing-modal-form){width:100vw;height:100dvh;max-height:100dvh;border-radius:0}
  .modal:has(.billing-modal-form) .modal-head{position:sticky;top:0;z-index:30;display:grid;grid-template-columns:1fr auto;gap:8px;padding:9px 10px}
  .modal:has(.billing-modal-form) .modal-head h3{font-size:15px;line-height:1.1}
  .modal-head-tools{grid-column:1/-1;display:grid;grid-template-columns:1fr;gap:7px;align-items:stretch}
  .billing-head-summary{align-items:flex-start;min-width:0}.billing-head-summary strong{font-size:19px}.billing-head-summary span{white-space:normal;font-size:9px}
  .billing-head-payment{border-radius:10px;overflow-x:auto;justify-content:flex-start;padding:5px;gap:5px}
  .billing-head-payment .payment-options button{padding:7px 9px;font-size:10px}
  .billing-head-payment label{min-width:145px;margin-left:0}.billing-head-payment select{width:100%;min-height:30px}
  .billing-head-totals{min-width:0}.billing-head-totals .total-strip{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}.billing-head-totals .total-strip span{border-radius:8px}
  .billing-head-actions{display:grid;grid-template-columns:.7fr 1fr 1.15fr;gap:6px}.billing-head-actions .primary,.billing-head-actions .secondary{padding:9px 7px;font-size:10px;border-radius:8px}
  .modal:has(.billing-modal-form) .modal-body{height:calc(100dvh - 166px);min-height:0;overflow:auto;-webkit-overflow-scrolling:touch;padding:8px 9px 18px}
  .billing-modal-form{display:grid!important;grid-template-columns:1fr!important;grid-template-rows:auto auto auto!important;height:auto!important;min-height:0!important;overflow:visible!important;gap:9px!important}
  .billing-modal-form .hot-banners{position:sticky;top:0;z-index:9;background:#fff;padding-bottom:4px}
  .billing-modal-form .hot-banner{grid-template-columns:92px minmax(0,1fr);min-height:28px;padding:4px 6px}.billing-modal-form .hot-banner strong{font-size:8px}.billing-modal-form .hot-track button{font-size:8px;padding:3px 7px}
  .billing-modal-form .sale-left{height:auto!important;overflow:visible!important;border-right:0!important;padding:0!important;background:transparent!important}
  .billing-control-grid{grid-template-columns:1fr 1fr!important;gap:6px}.billing-control-grid label:nth-child(n){grid-column:auto!important}.billing-control-grid select,.billing-control-grid input{min-height:36px;font-size:11px}
  .billing-modal-form .selection-card{padding:8px!important;border-radius:10px}
  .billing-modal-form .inline-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.billing-modal-form .inline-head h3{font-size:14px}.billing-modal-form .inline-head span{font-size:8px;line-height:1.25}
  .billing-modal-form .button-row{gap:6px}.billing-modal-form .button-row .secondary{padding:8px 10px;font-size:11px}
  .billing-modal-form .search input{min-height:39px;font-size:13px}
  .billing-modal-form .customer-billing-card{padding:8px;border-radius:10px}.billing-modal-form .customer-billing-metrics{gap:4px}.billing-modal-form .customer-billing-metrics span{font-size:8px;padding:3px 6px}
  .billing-workspace{height:auto!important;display:grid!important;grid-template-rows:auto auto!important;overflow:visible!important;gap:9px}
  .billing-workspace .billing-add-product{position:sticky!important;top:0!important;z-index:12;border-radius:10px}
  .billing-workspace .billing-add-product .billing-product-search{position:sticky;top:0;background:#fff}
  .billing-product-search{grid-template-columns:minmax(0,1fr) 42px}.billing-product-search button{min-height:40px}
  .billing-add-product .lookup-results{max-height:38dvh!important;overflow:auto!important;-webkit-overflow-scrolling:touch}
  .billing-add-product .product-result{grid-template-columns:minmax(0,1fr) auto!important}.billing-add-product .product-result-actions{flex-wrap:wrap;justify-content:flex-end}.billing-add-product .product-result-actions button{width:28px;height:28px}.billing-add-product .product-result-actions .row-action{padding:6px 9px}
  .billing-lines-panel{height:auto!important;overflow:visible!important;border-radius:10px}
  .billing-lines-panel .panel-head{position:sticky;top:52px;z-index:8;background:#fff;padding:9px 10px}
  .billing-lines-panel .cart-lines{height:auto!important;min-height:42dvh!important;max-height:none!important;overflow:visible!important;padding:2px 8px 8px}
  .billing-lines-panel .billing-line-title{display:grid;grid-template-columns:1fr auto auto;align-items:start;gap:5px}.billing-lines-panel .billing-line-title strong{font-size:11px;line-height:1.25}.billing-lines-panel .billing-line-title span{font-size:13px}
  .billing-lines-panel .compact-line-grid{display:grid;grid-template-columns:1fr 74px 92px;gap:6px}.billing-lines-panel .compact-line-grid label:first-child{grid-column:1/-1}.billing-lines-panel .compact-line-grid label{font-size:8px}.billing-lines-panel .compact-line-grid input,.billing-lines-panel .compact-line-grid select{min-height:32px;font-size:10px}
  .billing-lines-panel .button-row.mini{display:flex;overflow-x:auto;flex-wrap:nowrap;padding-bottom:2px}.billing-lines-panel .button-row.mini .row-action{flex:0 0 auto;font-size:9px;padding:6px 8px}
  .child .modal{width:100vw;height:100dvh;max-height:100dvh;border-radius:0}.child .modal-body{height:calc(100dvh - 62px);overflow:auto;-webkit-overflow-scrolling:touch}
  .scan-box video{max-height:54dvh;border-radius:10px}.scan-box .search{display:grid;grid-template-columns:1fr auto;gap:7px}.scan-box .search span{display:none}.scan-box .search input{padding-left:12px!important}
}
@media(max-width:760px){
  html,body{height:auto!important;min-height:100%!important;overflow-y:auto!important;touch-action:pan-y!important}
  .modal-shell:not(.hidden){display:block!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;touch-action:pan-y!important;padding:0!important}
  .modal-shell:not(.hidden) .modal{width:100vw!important;min-height:100%!important;height:auto!important;max-height:none!important;border-radius:0!important;overflow:visible!important}
  .modal-shell:not(.hidden) .modal-head{position:sticky!important;top:0!important;z-index:35!important}
  .modal-shell:not(.hidden) .modal-body{height:auto!important;min-height:calc(100dvh - 70px)!important;overflow:visible!important;-webkit-overflow-scrolling:auto!important}
  .modal-shell:not(.hidden) .billing-modal-form{height:auto!important;min-height:auto!important;overflow:visible!important}
  .modal-shell:not(.hidden) .billing-workspace,.modal-shell:not(.hidden) .billing-lines-panel{height:auto!important;overflow:visible!important}
  .modal-shell:not(.hidden) .billing-lines-panel .cart-lines{height:auto!important;overflow:visible!important}
  .modal-shell:not(.hidden) .billing-add-product{position:sticky!important;top:0!important;z-index:20!important}
  .modal-shell:not(.hidden) .lookup-results{overscroll-behavior:contain}
}
@media(max-width:760px){
  body:not(.modal-open) .app,
  body:not(.modal-open) .app main,
  body:not(.modal-open) #appView{
    height:auto!important;
    min-height:100dvh!important;
    overflow:visible!important;
    touch-action:pan-y!important;
  }
  body:not(.modal-open) .content{
    height:auto!important;
    min-height:calc(100dvh - 82px)!important;
    overflow:visible!important;
    padding-bottom:120px!important;
    -webkit-overflow-scrolling:touch;
  }
  body:not(.modal-open) .dashboard-grid,
  body:not(.modal-open) .metrics,
  body:not(.modal-open) .bill-history-list,
  body:not(.modal-open) .panel{
    overflow:visible!important;
  }
  body:not(.modal-open) .table-wrap{
    overflow-x:auto!important;
    overflow-y:visible!important;
    -webkit-overflow-scrolling:touch!important;
  }
  body:not(.modal-open) .bill-history-card{
    gap:8px!important;
    align-items:start!important;
  }
}
@media(max-width:760px){
  html,body{height:100%!important;min-height:100%!important;overflow:hidden!important}
  body:not(.modal-open) #appView.app{
    display:block!important;
    height:100dvh!important;
    min-height:100dvh!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-y:contain;
    touch-action:pan-y!important;
  }
  body:not(.modal-open) .app main,
  body:not(.modal-open) .content{
    min-height:auto!important;
    height:auto!important;
    overflow:visible!important;
  }
  body:not(.modal-open) .content{padding-bottom:140px!important}
}

.shortcut-list{display:grid;gap:8px;margin-top:6px}
.shortcut-list div{display:grid;grid-template-columns:52px minmax(0,1fr);gap:10px;align-items:center;border:1px solid var(--line);border-radius:8px;background:#fafcf9;padding:8px 10px}
.shortcut-list strong{font-size:13px;color:var(--green)}
.shortcut-list span{font-size:12px;color:var(--ink)}
.billing-add-product .lookup-results{max-height:min(360px,34vh)!important;overflow:auto;padding-bottom:12px;margin-bottom:8px;scroll-padding-bottom:16px}
.billing-add-product .lookup-results .lookup-row:last-child{margin-bottom:8px}
.billing-workspace .billing-add-product .lookup-results{display:block;max-height:min(260px,30vh)!important;overflow-y:auto!important;overscroll-behavior:contain;scrollbar-gutter:stable}
.billing-workspace .billing-add-product .lookup-results .lookup-row{margin-bottom:7px}
@media(max-width:760px){.billing-add-product .lookup-results{max-height:44dvh!important}}
.product-result{cursor:pointer}
.product-result.active{border-color:#16725b!important;background:#e0f5ec!important;box-shadow:0 0 0 2px rgba(22,114,91,.18),0 8px 18px rgba(22,114,91,.08)}
.product-result-actions{cursor:default}
.billing-workspace .billing-add-product{
  background:#fff!important;
  isolation:isolate;
  overflow:visible!important;
}
.billing-workspace .billing-add-product .billing-product-search{
  position:relative!important;
  top:auto!important;
  z-index:45!important;
  background:#fff!important;
  margin:0 0 5px!important;
  padding:0!important;
  box-shadow:none;
  overflow:hidden;
}
.billing-workspace .billing-add-product .billing-product-search input,
.billing-workspace .billing-add-product .billing-product-search button{
  position:relative;
  z-index:2;
  background:#fff!important;
}
.billing-workspace .billing-add-product .lookup-results{
  position:relative;
  z-index:1;
  margin-top:0!important;
  padding:6px 0 72px!important;
  background:#fff;
  scroll-padding-top:6px;
  scroll-padding-bottom:72px;
  max-height:clamp(230px,32vh,360px)!important;
  overflow-y:auto!important;
  margin-bottom:10px!important;
}
.billing-workspace .billing-add-product .lookup-results .lookup-row:last-child,
.billing-workspace .billing-add-product .lookup-results .product-result:last-child{margin-bottom:58px!important}
.billing-payment-summary{padding:10px 18px;border-bottom:1px solid var(--line);background:#fff}
.payment-total-strip{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
.payment-total-strip div,.bill-split{border:1px solid var(--line);background:#fafcf9;border-radius:999px;padding:8px 12px}
.payment-total-strip .pay-cash{background:#fff6c7;border-color:#e5c54f}
.payment-total-strip .pay-card{background:#dff7e8;border-color:#55b979}
.payment-total-strip .pay-credit,.payment-total-strip .pay-due{background:#c91922;border-color:#a70f17;color:#fff}
.payment-total-strip .pay-credit small,.payment-total-strip .pay-due small{color:#fff}
.payment-total-strip .pay-net{background:#eef4f1;border-color:#cad7d1}
.payment-total-strip small,.bill-split small{display:block;color:var(--muted);font-size:9px;text-transform:uppercase;letter-spacing:.05em;font-weight:800}
.payment-total-strip strong{font-size:16px}
.bill-split{display:grid;grid-template-columns:auto 1fr;gap:2px 8px;border-radius:12px;padding:8px 10px}
.bill-split strong{font-size:11px}
.bill-split .amount-alert{background:#c91922;color:#fff!important;font-weight:1000!important;border-radius:4px;padding:2px 5px}
.bill-history-card{grid-template-columns:1fr 1.35fr .32fr .68fr .55fr .72fr .72fr auto}
.bill-history-card.order-history-card{grid-template-columns:minmax(92px,.7fr) minmax(190px,1.2fr) minmax(44px,.25fr) minmax(150px,.75fr) minmax(130px,.7fr) minmax(80px,.42fr) minmax(130px,.62fr) minmax(290px,auto);gap:12px;align-items:center}.order-history-card>div{min-width:0}.order-history-card .history-actions{justify-content:flex-end;white-space:nowrap}.order-history-card .status-pill{max-width:170px}
@media(max-width:760px){.payment-total-strip{grid-template-columns:1fr 1fr}.bill-history-card{grid-template-columns:1fr}}
.billing-page-head{display:grid!important;grid-template-columns:minmax(260px,.62fr) minmax(420px,1.38fr);gap:18px;align-items:center}
.billing-head-summary{display:flex;align-items:center;justify-content:flex-end;gap:10px;min-width:0}
.billing-head-summary small{display:block;font-size:10px;color:var(--muted);font-weight:900;line-height:1}
.profit-total{
  color:#0b553f;
  font-weight:1000;
  background:#dff7e8;
  border:1px solid #75c99a;
  border-radius:10px;
  padding:7px 10px;
}
.profit-total.loss{color:#8f1118;background:#ffe0e4;border-color:#e38a96}
.profit-badge,.profit-text{
  display:inline-flex;
  align-items:center;
  width:max-content;
  max-width:100%;
  background:#dff7e8;
  color:#0b553f!important;
  border:1px solid #75c99a;
  border-radius:999px;
  padding:2px 7px;
  font-size:10px;
  font-weight:1000!important;
  line-height:1.15;
  white-space:nowrap;
}
.profit-badge.excellent,.profit-text.excellent{background:#c9f2d9;color:#075033!important;border-color:#36a96f}
.profit-badge.ok,.profit-text.ok{background:#dff7e8;color:#0b553f!important;border-color:#75c99a}
.profit-badge.fair,.profit-text.fair{background:#eef6c8;color:#425b08!important;border-color:#a8c860}
.profit-badge.bad,.profit-text.bad{background:#fff3bf;color:#775500!important;border-color:#dfbd4b}
.profit-badge.very-bad,.profit-text.very-bad{background:#ffe0e4;color:#8f1118!important;border-color:#e38a96}
.profit-badge.loss,.profit-text.loss{background:#ffe0e4;color:#8f1118!important;border-color:#e38a96}
.billing-total-block{display:grid;gap:2px;align-items:start;justify-items:start;line-height:1}
.target-summary-inline{padding:0!important;border:0!important;background:transparent!important;min-width:min(1040px,100%)}
.target-summary-inline .target-flash{grid-template-columns:repeat(9,minmax(88px,1fr));gap:7px;padding:0;background:transparent;color:var(--ink)}
.target-summary-inline .target-flash div{border-radius:999px;padding:9px 14px;box-shadow:none;text-shadow:none}
.target-summary-inline .target-flash small{font-size:8px;color:var(--muted);opacity:1}
.target-summary-inline .target-flash strong{font-size:14px;letter-spacing:0;text-shadow:none;margin-top:1px}
.target-summary-inline .target-flash div:nth-child(1){background:#eef4f1;border:1px solid #cad7d1}
.target-summary-inline .target-flash div:nth-child(2){background:#dff7e8;border:1px solid #55b979}
.target-summary-inline .target-flash div:nth-child(3){background:#e8f2d7;border:1px solid #95bd61}
.target-summary-inline .target-flash div:nth-child(4){background:#fff6c7;border:1px solid #e5c54f}
.target-summary-inline .target-flash div:nth-child(5){background:#eef4f1;border:1px solid #cad7d1}
.target-summary-inline .target-flash div:nth-child(6){background:#dff7e8;border:1px solid #55b979}
.target-summary-inline .target-flash div:nth-child(7){background:#fff2df;border:1px solid #e1a65c}
.target-summary-inline .target-flash div:nth-child(8){background:#dff7e8;border:1px solid #55b979}
.target-summary-inline .target-flash div:nth-child(9){background:#fff6c7;border:1px solid #e5c54f}
.compact-history-toolbar{display:grid!important;grid-template-columns:auto minmax(0,1fr);gap:10px;align-items:end;padding:10px 14px!important}
.compact-history-toolbar .history-actions{display:flex;gap:7px;align-items:end;white-space:nowrap}
.compact-history-toolbar .history-actions button{min-height:38px;padding:8px 12px;border-radius:10px;font-size:13px}
.compact-history-toolbar .history-actions .primary{padding-inline:15px}
.compact-history-filters{display:grid;grid-template-columns:128px 128px minmax(170px,1fr) minmax(190px,1fr) minmax(170px,.85fr);gap:8px;align-items:end}
.invoice-history-toolbar .compact-history-filters{grid-template-columns:128px 128px minmax(170px,1fr) minmax(190px,1.1fr) minmax(160px,.8fr) minmax(190px,1fr)}
.order-history-toolbar{grid-template-columns:1fr!important;align-items:stretch}
.order-history-toolbar .history-actions{order:2;margin-top:2px}
.order-history-toolbar .compact-history-filters{order:1;grid-template-columns:118px 118px minmax(150px,1fr) minmax(170px,1.1fr) minmax(140px,.8fr) minmax(160px,.9fr) minmax(170px,1fr)}
.compact-history-filters label{gap:4px;font-size:10px}
.compact-history-filters input,.compact-history-filters select{height:38px;padding:7px 10px;font-size:12px}
.order-poke-history{margin:12px 0}
@media(max-width:1280px){
  .billing-page-head{grid-template-columns:1fr}
  .billing-head-summary{justify-content:space-between}
  .target-summary-inline .target-flash{grid-template-columns:repeat(4,minmax(104px,1fr))}
  .compact-history-toolbar{grid-template-columns:1fr}
  .compact-history-toolbar .history-actions{flex-wrap:wrap}
  .compact-history-filters,.invoice-history-toolbar .compact-history-filters,.order-history-toolbar .compact-history-filters{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:760px){
  .billing-page-head{display:block!important}
  .billing-head-summary{display:grid;gap:8px;justify-content:stretch}
  .target-summary-inline .target-flash{grid-template-columns:1fr 1fr}
  .compact-history-toolbar{padding:10px!important}
  .compact-history-toolbar .history-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
  .compact-history-toolbar .history-actions button{padding:8px 7px}
  .compact-history-filters,.invoice-history-toolbar .compact-history-filters,.order-history-toolbar .compact-history-filters{grid-template-columns:1fr 1fr}
  .compact-history-filters label:last-child{grid-column:1/-1}
}

#pageTitle{flex:0 1 auto;min-width:175px}
.app header{gap:14px;justify-content:flex-start}
.header-actions{margin-left:0;flex:0 0 auto}
.header-summary.hidden + .header-actions{margin-left:auto}
.header-summary{flex:1;min-width:0;display:flex;align-items:center;justify-content:flex-end;gap:8px}
.header-summary.hidden{display:none}
.header-target-summary .source-pill{white-space:nowrap;flex:0 0 auto}
.header-target-summary .target-summary-inline{min-width:0!important;max-width:1180px;width:min(1180px,100%)}
.header-target-summary .target-summary-inline .target-flash{display:grid;grid-template-columns:repeat(9,minmax(76px,1fr));gap:5px}
.header-target-summary .target-summary-inline .target-flash div{padding:6px 7px}
.header-target-summary .target-summary-inline .target-flash strong{font-size:11px}
.header-target-summary .target-summary-inline .target-flash small{font-size:7px}
@media(max-width:1240px){
  .header-target-summary .source-pill{display:none}
  .header-target-summary .target-summary-inline .target-flash{grid-template-columns:repeat(4,minmax(92px,1fr))}
}
@media(max-width:760px){
  .header-summary{display:none!important}
  #pageTitle{min-width:0}
}
.admin-page-tools{align-items:center}
.data-link-current{border:1px solid var(--line);background:#f7faf7;border-radius:12px;padding:12px;display:grid;gap:5px}
.data-link-current strong{font-size:15px;font-weight:900}
.admin-page-tools{flex-wrap:wrap;justify-content:flex-end}
.admin-popup-form,.admin-target-popup,.admin-log-popup{min-width:min(760px,82vw)}
.admin-popup-form .branch-checks{max-height:180px}
.admin-target-popup .padded-toolbar,.admin-log-popup .padded-toolbar{border:1px solid var(--line);border-radius:10px}

/* Shelf management: counter-friendly search and high-contrast results. */
.shelf-search-toolbar{align-items:end;gap:16px}.shelf-search-field{min-width:min(760px,calc(100vw - 460px));max-width:900px}.shelf-search-field input{width:100%;min-height:56px;padding:14px 18px;font-size:18px;font-weight:800;color:#000}.shelf-search-toolbar>.primary{min-height:56px;padding:0 28px;font-size:15px}.shelf-management-panel #shelfProductRows .data-table th,.shelf-management-panel #shelfProductRows .data-table td,.shelf-management-panel #shelfProductRows .data-table strong,.shelf-management-panel #shelfProductRows .data-table small{color:#000;font-weight:800}.shelf-management-panel #shelfProductRows .data-table td{font-size:13px}.shelf-management-panel #shelfProductRows .data-table small{font-size:10px}
@media(max-width:760px){.shelf-search-field{min-width:0;max-width:none}.shelf-search-toolbar>.primary{width:100%}}
.generic-master-content{height:calc(100vh - 82px);max-width:none;overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr);padding-bottom:24px}.generic-master-content>.section-head{flex:0 0 auto;margin-bottom:14px}.generic-master-panel{min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden}.generic-search-toolbar{align-items:end;gap:16px;flex:0 0 auto;background:#fff;z-index:2}.generic-search-field{min-width:min(560px,calc(100vw - 760px));max-width:820px}.generic-sort-field{min-width:150px}.generic-schedule-filter{min-width:270px}.generic-search-field input{width:100%;min-height:54px;padding:13px 18px;font-size:17px;font-weight:800;color:#000}.generic-search-toolbar>.primary{min-height:54px;padding:0 26px}.generic-master-panel #genericMasterRows{min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);padding:0;text-align:left;color:var(--ink)}.generic-list-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 18px;border-bottom:1px solid var(--line);font-size:12px;background:#fff;z-index:2}.generic-list-summary strong{font-size:14px}.generic-results-scroll{min-height:0;overflow:auto;-webkit-overflow-scrolling:touch}.generic-results-scroll .data-table th{position:sticky;top:0;z-index:1}.generic-master-table{min-width:1040px}.generic-master-panel .data-table td{vertical-align:top;color:#050505}.generic-master-panel .data-table strong{color:#050505;font-weight:900}.generic-master-panel .data-table small{color:#333;font-weight:750}.generic-remarks-cell{max-width:420px;white-space:normal;line-height:1.35;font-weight:700;color:#111}.generic-master-form{min-width:min(860px,86vw);grid-template-columns:1fr 1fr}.generic-master-form textarea{resize:vertical;min-height:92px;line-height:1.35}.generic-master-form textarea[name="remarks"]{min-height:210px}.generic-linked-summary{margin-bottom:12px}.generic-linked-table{min-width:920px}.generic-info-button{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;border:0;background:#d71920;color:#fff;font-size:13px;font-weight:950;font-family:Georgia,serif;line-height:1;box-shadow:0 2px 7px rgba(215,25,32,.25);vertical-align:middle}.generic-remark-preview{position:fixed;z-index:1000;width:min(320px,calc(100vw - 24px));background:#fff;border:1px solid #efb5b8;border-radius:10px;box-shadow:0 12px 38px rgba(20,20,20,.18);padding:12px;color:#111}.generic-remark-card{display:grid;gap:5px}.generic-remark-card small{color:#8b1b1f;text-transform:uppercase;letter-spacing:.08em;font-size:9px;font-weight:900}.generic-remark-card strong{font-size:13px;color:#111}.generic-remark-card span{font-size:10px;color:#555}.generic-remark-card p{margin:6px 0 0;white-space:pre-wrap;font-size:12px;line-height:1.45;color:#111;font-weight:750}
.generic-row-actions{display:grid;gap:6px}.generic-row-actions .row-action{min-width:82px}.generic-edit-action{background:#d71920!important;border-color:#b9151b!important;color:#fff!important}.generic-linked-action{background:#1769d1!important;border-color:#1055ad!important;color:#fff!important}.generic-edit-meta{display:flex;flex-wrap:wrap;gap:8px 14px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#f7faf7;color:#111;font-size:12px}.modal:has(.generic-linked-popup){width:min(1320px,96vw);max-height:94vh}.modal:has(.generic-linked-popup) .modal-body{padding:16px;overflow:auto}.generic-linked-popup .panel{max-height:none}.generic-linked-popup .table-wrap{overflow:auto}.generic-linked-table{min-width:1040px}.generic-linked-table th,.generic-linked-table td{padding:10px 12px}.product-result-actions .generic-info-button,.billing-line-foot .generic-info-button{flex:0 0 24px!important;width:24px!important;height:24px!important;min-width:24px!important;border:0!important;background:#d71920!important;color:#fff!important;font-size:14px!important;font-weight:950!important;padding:0!important;box-shadow:0 0 0 2px #fff,0 4px 12px rgba(215,25,32,.35)!important}.line-composition-wrap{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:52%;flex:1 1 auto}.line-composition-wrap .line-composition{flex:1 1 auto;min-width:0}
@media(max-width:760px){.generic-master-content{height:auto;overflow:visible}.generic-master-panel,#genericMasterRows{display:block}.generic-results-scroll{max-height:62vh}.generic-search-field,.generic-sort-field,.generic-schedule-filter{min-width:0;max-width:none}.generic-search-toolbar>.primary{width:100%}.generic-list-summary{display:grid}.generic-master-form{min-width:0;grid-template-columns:1fr}.generic-master-form .span-2{grid-column:auto}.generic-master-table{min-width:930px}}
.admin-target-popup .table-wrap,.admin-log-popup .table-wrap{max-height:58vh;overflow:auto}
.admin-log-filters{display:grid;grid-template-columns:170px minmax(220px,1fr) auto auto;gap:8px;align-items:end}
.login-consultancy-brand{width:min(440px,94%)}
@media(max-width:760px){
  .admin-popup-form,.admin-target-popup,.admin-log-popup{min-width:0}
  .admin-log-filters{grid-template-columns:1fr 1fr}
}
.data-link-current small{color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:900}
.data-link-current span{color:var(--muted);font-size:12px}
.data-link-form .check-row{background:#fafcf9;border:1px solid var(--line);border-radius:10px;padding:10px}
.series-scope-note{display:block;color:var(--muted);font-size:10px;margin-top:6px}
.consultancy-credit{display:grid;gap:7px;padding:9px;border-top:1px solid rgba(255,255,255,.08);color:#9dbab3}.consultancy-credit img{display:block;width:100%;height:auto;object-fit:contain}.consultancy-credit small{font-size:8px;line-height:1.4}.consultancy-credit strong{color:#fff;font-size:8px}

/* Counter readability: keep the compact layout while avoiding faint, undersized text. */
.billing-modal-form{color:#090909;font-size:14px}
.billing-modal-form label,.billing-modal-form .billing-control-grid label,.billing-modal-form .billing-line-grid label{color:#090909!important;font-size:10px;font-weight:800}
.billing-modal-form input,.billing-modal-form select,.billing-modal-form textarea{color:#090909!important;font-size:12px;font-weight:650}
.billing-modal-form .muted,.billing-modal-form small,.billing-modal-form .billing-line small,.billing-modal-form .billing-line-foot span,.billing-modal-form .customer-billing-main p,.billing-modal-form .inline-head span{color:#161616!important;font-size:10.5px;line-height:1.35}
.billing-modal-form .billing-line-title strong{color:#090909;font-size:13px}
.billing-modal-form .billing-line-title>span{color:#090909;font-size:14px;font-weight:900}
.billing-modal-form .customer-billing-main h3{color:#090909;font-size:14px}
.billing-modal-form .customer-billing-metrics span{color:#090909!important;font-size:9px}
.billing-modal-form .billing-product-search input{font-size:14px}
.billing-modal-form .lookup-row strong{color:#090909;font-size:12px}
.billing-modal-form .lookup-row small{color:#161616!important;font-size:10.5px}

/* Full-width counter workspace with all setup and customer tools in the modal header. */
.modal:has(.billing-modal-form) .modal-head{align-items:flex-start;flex-wrap:wrap;padding:9px 14px}
.modal:has(.billing-modal-form) .modal-head-tools{display:flex;flex:1;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:6px;min-width:0}
.billing-head-context{order:10;flex:1 0 100%;min-width:0}
.billing-head-context .billing-control-grid{display:grid;grid-template-columns:minmax(180px,1fr) minmax(210px,1.25fr) minmax(180px,1fr) minmax(170px,.9fr);gap:6px;width:100%}
.billing-head-context .billing-control-grid label{font-size:9px;color:#111;gap:3px;overflow:visible}
.billing-head-context .billing-control-grid select,.billing-head-context .billing-control-grid input{height:32px;min-height:32px;padding:5px 8px;color:#090909;font-size:10px;font-weight:750}
.billing-head-context .billing-control-grid label:has(#billingPayment){display:none}
.billing-customer-actions{display:flex;gap:4px;align-items:center}
.billing-customer-actions .secondary{padding:7px 9px;font-size:10px;white-space:nowrap}
.billing-customer-actions .customer-selected{background:#e0f5ec;border-color:#79bda7;color:#064f3c;max-width:190px;overflow:hidden;text-overflow:ellipsis}
.billing-modal-form{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto minmax(0,1fr)!important;gap:10px!important}
.billing-modal-form .hot-banners{grid-column:1;grid-row:1}
.billing-modal-form .sale-left{display:none!important}
.billing-modal-form .billing-workspace{grid-column:1;grid-row:2;width:100%;height:100%;margin:0;position:static}
.billing-customer-popup{display:grid;gap:12px}
.billing-customer-popup .selected-customer,.customer-account-popup{display:block;margin:0}
.customer-popup-actions{flex-wrap:wrap}
@media(max-width:1100px){
  .billing-head-context .billing-control-grid{grid-template-columns:1fr 1fr}
  .billing-head-summary,.billing-head-totals{display:none}
}
@media(max-width:760px){
  .modal:has(.billing-modal-form) .modal-head-tools{display:flex!important;grid-column:1/-1}
  .billing-customer-actions{order:3;width:100%;overflow-x:auto}
  .billing-customer-actions .secondary{flex:0 0 auto}
  .billing-head-context{order:5}
  .billing-head-context .billing-control-grid{grid-template-columns:1fr 1fr!important}
  .billing-head-context .billing-control-grid label:nth-child(n){grid-column:auto!important}
  .billing-modal-form{display:grid!important}
}

/* Two-row counter header: controls stay visible without taking over the workspace. */
.modal:has(.billing-modal-form) .modal-head{
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center!important;
  gap:6px 10px;
  padding:7px 12px!important;
}
.modal:has(.billing-modal-form) .modal-head>h3{align-self:start;padding-top:7px;white-space:nowrap}
.modal:has(.billing-modal-form) .modal-head-tools{
  display:grid!important;
  grid-template-columns:auto auto minmax(250px,1fr) auto auto;
  grid-template-rows:34px 34px;
  align-items:center;
  gap:5px 7px;
  min-width:0;
}
.billing-head-summary{grid-column:1;grid-row:1}
.billing-head-payment{grid-column:2;grid-row:1}
.billing-head-totals{grid-column:3;grid-row:1;min-width:0}
.billing-customer-actions{grid-column:4;grid-row:1}
.billing-head-actions{grid-column:5;grid-row:1;display:flex;gap:4px;align-items:center}
.billing-head-context{grid-column:1/-1;grid-row:2;order:unset;min-width:0}
.billing-head-context .billing-control-grid{
  display:grid;
  grid-template-columns:minmax(130px,.72fr) minmax(190px,1.18fr) minmax(160px,.9fr) minmax(135px,.72fr);
  gap:5px;
}
.billing-head-context .billing-control-grid label{position:relative;display:block!important;font-size:0!important}
.billing-head-context .billing-control-grid label:nth-child(n){grid-column:auto!important;grid-row:auto!important}
.billing-head-context .billing-control-grid label:has(#billingPayment){display:none!important}
.billing-head-context .billing-control-grid select,.billing-head-context .billing-control-grid input{
  width:100%;height:30px!important;min-height:30px!important;padding:4px 8px!important;font-size:10px!important;
}
.billing-head-payment .payment-title,.billing-head-payment>small{display:none}
.billing-head-payment .payment-options{display:flex;gap:3px}
.billing-head-payment .payment-options button{padding:6px 9px;font-size:9px;white-space:nowrap}
.billing-head-payment>label{display:none}
.billing-head-payment .secondary{padding:6px 8px;font-size:9px;white-space:nowrap}
.billing-head-summary{display:grid!important;line-height:1;text-align:right;white-space:nowrap}
.billing-head-summary>strong,.billing-total-block>strong{font-size:20px}.billing-head-summary .billing-summary-meta{font-size:8px}
.billing-head-totals .total-row{display:none}
.billing-head-totals .total-strip{display:grid;grid-template-columns:repeat(4,minmax(56px,1fr));gap:4px}
.billing-head-totals .total-strip span{padding:5px 7px;border:1px solid var(--line);border-radius:999px;font-size:7px;line-height:1}
.billing-head-totals .total-strip strong{display:block;font-size:9px;margin-top:2px}
.billing-customer-actions .secondary,.billing-head-actions .secondary,.billing-head-actions .primary{height:30px;padding:5px 8px;font-size:9px}
.billing-customer-actions .secondary{max-width:92px}
.modal:has(.billing-modal-form) .modal-close{align-self:start;margin-top:1px}

/* Dense horizontal bill lines: preserve readable type while maximizing visible rows. */
.billing-lines-panel .billing-line{display:grid!important;grid-template-rows:auto auto auto;gap:2px!important;padding:4px 6px!important;margin:0!important}
.billing-line-heading{display:grid;grid-template-columns:minmax(240px,.75fr) minmax(360px,1.25fr);gap:10px;align-items:center;min-width:0}
.billing-line-heading>small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:9.5px!important;line-height:1.15}
.billing-lines-panel .billing-line-title{min-width:0;align-items:center}
.billing-lines-panel .billing-line-title strong{font-size:12.5px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.billing-lines-panel .billing-line-title span{font-size:13px!important}
.billing-lines-panel .compact-line-grid{grid-template-columns:minmax(260px,2.5fr) 58px 116px 76px 72px 56px!important;gap:4px!important;align-items:end}
.billing-lines-panel .compact-line-grid label{font-size:8px!important;gap:1px!important;line-height:1}
.billing-lines-panel .compact-line-grid input,.billing-lines-panel .compact-line-grid select{min-height:24px!important;height:24px!important;padding:2px 6px!important;font-size:10px!important}
.billing-line-tail{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
.billing-line-tail .billing-line-foot{display:block;white-space:nowrap;font-size:9px;line-height:1}
.billing-line-tail .button-row{flex-wrap:nowrap;margin-left:auto}
.billing-line-tail .button-row.mini .row-action{font-size:8.5px!important;padding:2px 6px!important;min-height:22px}
.billing-line-tail .line-error{color:#a40000!important;font-weight:900;margin-left:auto}.billing-line-tail .line-warning{margin-left:auto}
@media(max-width:1250px){
  .modal:has(.billing-modal-form) .modal-head-tools{grid-template-columns:auto auto minmax(170px,1fr) auto;grid-template-rows:34px 34px}
  .billing-customer-actions{grid-column:3;grid-row:1;justify-self:end}
  .billing-head-actions{grid-column:4;grid-row:1}
  .billing-head-context{grid-row:2}
  .billing-head-totals{grid-column:3;grid-row:1}
  .billing-customer-actions{display:none}
}
@media(min-width:761px){
  .billing-head-context .billing-control-grid{
    grid-template-columns:minmax(120px,.72fr) minmax(185px,1.18fr) minmax(145px,.9fr) minmax(125px,.72fr)!important;
  }
}
@media(max-width:760px){
  .modal:has(.billing-modal-form) .modal-head{display:flex!important;padding:8px 10px!important}
  .modal:has(.billing-modal-form) .modal-head-tools{display:flex!important}
  .billing-head-context{width:100%}
  .billing-line-heading{grid-template-columns:1fr}
  .billing-line-heading>small{white-space:normal}
  .billing-lines-panel .compact-line-grid{grid-template-columns:1fr 74px 92px!important}
  .billing-line-tail{align-items:flex-start;flex-direction:column}
}

/* Billing counter readability and faster quantity editing. */
@media(min-width:1251px){
  .modal:has(.billing-modal-form) .modal-head-tools{
    grid-template-columns:auto auto 220px minmax(330px,1fr) auto;
    justify-content:stretch;
    width:100%;
  }
  .billing-head-totals .total-strip{grid-template-columns:repeat(4,54px);justify-content:end}
  .billing-head-totals .total-strip span{padding:4px 5px}
  .billing-customer-actions{display:grid;grid-template-columns:minmax(125px,1fr) repeat(3,62px);gap:4px;min-width:325px}
  .billing-customer-actions .secondary{max-width:none;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  #billingHeaderCustomerBtn{font-size:10px;font-weight:900}
  #billingHeaderCustomerBtn.customer-selected{background:#94131b!important;border-color:#65080d!important;color:#fff!important;font-size:14px!important;font-weight:1000!important;line-height:1.1}
  .billing-head-context .billing-control-grid{
    grid-template-columns:minmax(170px,240px) minmax(280px,420px) minmax(220px,300px) minmax(180px,240px)!important;
    justify-content:end;
    margin-left:auto;
  }
  .billing-head-context{padding-left:270px}
  .billing-head-summary .billing-summary-meta{position:absolute;left:14px;top:42px;z-index:3}
}
.billing-head-summary{display:flex!important;align-items:center;justify-content:flex-start;gap:5px;text-align:left}
.billing-head-summary .billing-summary-meta{display:flex;align-items:center;gap:5px;min-width:0}
.billing-head-summary .qty-breakup{display:inline-flex;align-items:center;background:#164f9b;color:#fff!important;border:1px solid #0a3268;border-radius:7px;padding:5px 8px;font-size:9px!important;font-weight:900;line-height:1;white-space:nowrap}
.billing-head-summary .profit-badge{max-width:148px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:8.5px;padding:4px 7px}
.billing-head-payment>label{display:block!important;min-width:130px;margin-left:3px;font-size:0}
.billing-head-payment>label select{display:block;width:100%;height:27px;padding:3px 7px;font-size:10px;font-weight:850;border-radius:8px;background:#fff}
.billing-head-summary>strong,.billing-total-block>strong{display:inline-flex;align-items:center;justify-content:center;background:#8f1118;color:#fff!important;border:1px solid #65080d;border-radius:8px;padding:5px 10px;font-weight:1000;box-shadow:0 1px 2px rgba(77,0,5,.22)}
.billing-customer-actions .header-account-btn{background:#dceeff;border-color:#6fa7d3;color:#174e78}
.billing-customer-actions .header-history-btn{background:#e9ddff;border-color:#ad8ae5;color:#3e246b}
.billing-customer-actions .header-discounts-btn{background:#fff0bf;border-color:#dfbd4b;color:#684d00}
.billing-head-actions .header-shortcuts-btn{background:#dff5e7;border-color:#69b889;color:#155f36}
.billing-lines-panel .billing-line:nth-child(odd){background:#a9d6ed}
.billing-lines-panel .billing-line:nth-child(even){background:#fff}
.billing-lines-panel .billing-line{border-radius:8px;border-bottom-color:#c8dce8}
.billing-line-heading{grid-template-columns:minmax(220px,.7fr) minmax(470px,1.55fr) auto}
.billing-lines-panel .billing-line-title strong{font-size:17px!important;line-height:1.02}
.billing-line-facts{display:flex;align-items:center;gap:4px;min-width:0;white-space:nowrap;overflow:hidden}
.line-fact{display:inline-block;border-radius:6px;padding:2px 5px;font-size:13px;font-weight:850;line-height:1.05;color:#111;background:transparent;border:1px solid rgba(45,85,105,.28)}
.fact-generic{background:#e9ddff;border-color:#bca0ed}
.fact-batch{background:#fff0bf;border-color:#dfbd4b}
.fact-expiry{background:#ffe0dc;border-color:#e79389}
.fact-shelf{background:#dff5e7;border-color:#7bc496}
.fact-stock{background:#dceeff;border-color:#79add8}
.billing-line-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;white-space:nowrap}
.billing-line-total{display:inline-flex;align-items:center;justify-content:center;background:#8f1118;color:#fff;border:1px solid #65080d;border-radius:7px;padding:4px 9px;font-size:19px;font-weight:1000;line-height:1;box-shadow:0 1px 2px rgba(77,0,5,.2)}
.billing-lines-panel .billing-line-actions .clear-remove{margin:0;padding:3px 7px;font-size:11.5px;line-height:1}
.billing-lines-panel .compact-line-grid{grid-template-columns:minmax(248px,2.5fr) 70px 120px 80px 76px 60px!important}
.billing-lines-panel .compact-line-grid.has-free-qty{grid-template-columns:minmax(230px,2.2fr) 64px 64px 112px 76px 72px 68px!important}
.billing-lines-panel .compact-line-grid.has-scheme-discount{grid-template-columns:minmax(210px,2fr) 62px 108px 72px 68px 66px 72px minmax(138px,1fr)!important}
.billing-lines-panel .compact-line-grid.has-free-qty.has-scheme-discount{grid-template-columns:minmax(200px,2fr) 58px 58px 100px 70px 66px 62px 68px minmax(132px,1fr)!important}
.billing-lines-panel .compact-line-grid label{font-size:12.5px!important;line-height:.85!important}
.billing-lines-panel .compact-line-grid input,.billing-lines-panel .compact-line-grid select{font-size:14px!important;font-weight:820;line-height:1!important}
.billing-lines-panel .billing-line:nth-child(odd) .compact-line-grid input,.billing-lines-panel .billing-line:nth-child(odd) .compact-line-grid select{background:#a9d6ed!important}
.billing-lines-panel .billing-line:nth-child(even) .compact-line-grid input,.billing-lines-panel .billing-line:nth-child(even) .compact-line-grid select{background:#fff!important}
.billing-line-tail .billing-line-foot span{font-size:13px!important;font-weight:750;line-height:1!important}
.billing-line-tail .button-row.mini .row-action{font-size:12px!important;padding:2px 7px!important;font-weight:850;line-height:1!important}
.billing-line-options .option-alternatives{background:#e9ddff;border-color:#ad8ae5;color:#3e246b}
.billing-line-options .option-near{background:#ffe0dc;border-color:#df8277;color:#7d2118}
.billing-line-options .option-margin{background:#dff5e7;border-color:#69b889;color:#155f36}
.billing-line-options .option-stores{background:#dceeff;border-color:#6fa7d3;color:#174e78}
.billing-line-options .option-purchase-history{background:#fff3c8;border-color:#d7a522;color:#674300}
.billing-line-options .option-sales-history{background:#e1f2ec;border-color:#66a88d;color:#0e5840}
.billing-option-preview{position:fixed;z-index:2500;max-height:310px;overflow:auto;border:1px solid #aac4b9;border-radius:8px;background:#fff;box-shadow:0 14px 35px rgba(16,44,41,.24);padding:8px;color:var(--ink)}
.billing-option-preview.hidden{display:none}
.billing-preview-head{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:3px 4px 8px;border-bottom:1px solid var(--line)}
.billing-preview-head strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}.billing-preview-head small{flex:0 0 auto;color:var(--muted);font-size:9px}
.billing-preview-list{display:grid}.billing-preview-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 7px;border-bottom:1px solid #b7c9b8;color:#050505;font-weight:900}.billing-preview-row:nth-child(odd){background:#e1f4df}.billing-preview-row:nth-child(even){background:#fff4b8}.billing-preview-row:hover{background:#bfe8c2}.billing-preview-row:last-child{border-bottom:0}.billing-preview-row>div{min-width:0}.billing-preview-row strong,.billing-preview-row small{display:block;color:#050505;font-weight:950}.billing-preview-row strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}.billing-preview-row small{margin-top:2px;font-size:9.5px;line-height:1.3}.billing-preview-row .row-action{flex:0 0 auto;background:#fff;color:#050505;border-color:#718a74;font-weight:950}.billing-preview-row.history-preview-row{cursor:default}.billing-preview-row.history-preview-row small{font-size:10px}.billing-preview-loading,.billing-preview-empty{padding:16px;text-align:center;color:#050505;font-size:10px;font-weight:900}
.billing-line-tail .billing-line-foot{display:flex;align-items:center;gap:10px;min-width:0;flex:1;overflow:hidden}
.billing-line-tail .line-consumption{flex:0 0 auto;white-space:nowrap}
.billing-line-tail .line-composition{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#35185f!important;background:#eadfff;border:1px solid #bca0ed;border-radius:6px;padding:2px 6px}
.billing-lines-panel .compact-line-grid label:nth-child(2) input:not(:disabled){background:#f5b6c2!important;color:#090909!important;border:3px solid #050505!important;box-shadow:inset 0 0 0 1px #d97f91,0 0 0 1px rgba(0,0,0,.35);font-weight:950}
.billing-lines-panel .compact-line-grid label:nth-child(2) input:not(:disabled):focus{border-color:#9b0e17!important;box-shadow:0 0 0 3px rgba(155,14,23,.28)}
.billing-add-product .product-result .search-meta-badge{display:inline-block;border-radius:6px;padding:2px 6px;font-size:10.5px;font-weight:900;line-height:1.15;color:#111}
.billing-add-product .product-result .search-shelf{background:#fff0bf;border:1px solid #d5ae32}
.billing-add-product .product-result .search-location-zero{background:#b5121b;border:1px solid #75070c;color:#fff}
.billing-add-product .product-result .search-location-positive{background:#164f9b;border:1px solid #0a3268;color:#fff}
.billing-add-product .product-result .search-lot-stock{background:#e7ddff;border:1px solid #a98adb;color:#44266d}
.billing-add-product .product-result .zero-stock-danger{display:inline-block;background:#ffdf3d;color:#5b0707;border:2px solid #b5121b;border-radius:6px;padding:1px 6px;font-size:10.5px;font-weight:1000;line-height:1.15;letter-spacing:.02em}
.billing-add-product .product-result-actions .search-option{width:auto;height:28px;border-radius:7px;padding:4px 8px;font-size:10px;font-weight:900;white-space:nowrap}
.billing-add-product .product-result-actions .search-option-alternatives{background:#e9ddff;border-color:#ad8ae5;color:#3e246b}
.billing-add-product .product-result-actions .search-option-near{background:#ffe0dc;border-color:#df8277;color:#7d2118}
.billing-add-product .product-result-actions .search-option-margin{background:#dff5e7;border-color:#69b889;color:#155f36}
.billing-add-product .product-result-actions .search-option-stores{background:#dceeff;border-color:#6fa7d3;color:#174e78}
.billing-add-product .product-result-actions .search-option-purchase-history{background:#fff3c8;border-color:#d7a522;color:#674300}
.billing-add-product .product-result-actions .search-option-sales-history{background:#e1f2ec;border-color:#66a88d;color:#0e5840}
.modal:has(.product-history-table){width:min(1180px,97vw)}
.modal:has(.sales-history-table){width:min(1280px,98vw)}
.product-history-table{width:100%;min-width:0;table-layout:fixed}
.product-history-table th,.product-history-table td{white-space:normal;overflow-wrap:anywhere;padding:11px 10px;vertical-align:top}
.sales-history-table th:nth-child(1){width:12%}.sales-history-table th:nth-child(2){width:24%}.sales-history-table th:nth-child(3){width:8%}.sales-history-table th:nth-child(4){width:16%}.sales-history-table th:nth-child(5){width:14%}.sales-history-table th:nth-child(6){width:13%}.sales-history-table th:nth-child(7){width:13%}
.sales-history-table tbody tr.profit-excellent{background:#e0f5e8}.sales-history-table tbody tr.profit-ok{background:#edf8ef}.sales-history-table tbody tr.profit-low{background:#fff4c7}.sales-history-table tbody tr.profit-loss{background:#ffe1df}
.sales-history-table tbody tr.profit-excellent:hover{background:#c9ecd7}.sales-history-table tbody tr.profit-ok:hover{background:#d9f0df}.sales-history-table tbody tr.profit-low:hover{background:#ffe89b}.sales-history-table tbody tr.profit-loss:hover{background:#ffc9c4}
.sales-history-table .profit-text{font-weight:950;color:#093d25}
.sales-history-table .profit-loss .profit-text{color:#a40000;background:#ffe0e4;border-color:#e38a96}
@media(max-width:1250px) and (min-width:761px){
  .billing-line-heading{grid-template-columns:minmax(200px,.65fr) minmax(360px,1.35fr) auto}
  .billing-line-facts{overflow-x:auto}
}
@media(max-width:760px){
  .billing-line-heading{grid-template-columns:1fr auto}
  .billing-line-facts{grid-column:1/-1;white-space:normal;flex-wrap:wrap;overflow:visible}
  .billing-line-actions{grid-column:2;grid-row:1}
  .billing-line-tail .billing-line-foot{align-items:flex-start;flex-direction:column;gap:3px;width:100%}
  .billing-line-tail .line-composition{max-width:100%}
}
.header-actions .signout-button{display:grid;place-items:center;border-radius:50%;border-color:#7f1d1d;background:#b91c1c;color:#fff;box-shadow:0 2px 6px rgba(127,29,29,.2)}
.header-actions .signout-button:hover{background:#991b1b}
.header-actions .signout-button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round}
@media(max-width:760px){.header-actions .icon-button{display:grid}.header-actions{gap:6px}.header-actions .icon-button,.header-actions .avatar{width:36px;height:36px}}
.billing-workspace-tabs{display:flex;align-items:center;gap:3px;padding:3px;border:1px solid #b9cfe0;border-radius:10px;background:#e8f3fb;flex:0 0 auto}
.billing-workspace-tabs button{border:0;border-radius:7px;background:transparent;color:#315b78;padding:7px 11px;font-size:11px;font-weight:900;cursor:pointer}
.billing-workspace-tabs button.active{background:#176ea3;color:#fff;box-shadow:0 2px 5px rgba(23,110,163,.25)}
@media(max-width:1100px){.billing-workspace-tabs button{padding:6px 8px;font-size:10px}}
.history-modal-actions{display:grid;gap:10px}.history-modal-actions .button-row{align-items:center}.history-search{min-width:0;width:100%}.history-selected-count{margin-left:auto;border-radius:999px;background:#e8f3fb;color:#176ea3;padding:7px 11px;font-size:11px;font-weight:900}.history-table-wrap{max-height:58vh!important}.history-more{display:flex;justify-content:center;align-items:center;padding:12px;border-top:1px solid var(--line)}
.history-bills-btn{background:#e8f3fb;border-color:#75a8c6;color:#123f59}
.customer-product-history-preview{position:fixed;z-index:2800;max-height:300px;overflow:auto;border:1px solid #9bbbab;border-radius:8px;background:#fff;box-shadow:0 16px 38px rgba(16,44,41,.28);padding:8px;color:#050505}.customer-product-history-preview.hidden{display:none}.customer-product-preview-list{display:grid}.customer-product-preview-row{display:grid;gap:2px;padding:8px;border-bottom:1px solid #b8cbbb;color:#050505}.customer-product-preview-row:nth-child(odd){background:#e1f4df}.customer-product-preview-row:nth-child(even){background:#fff4b8}.customer-product-preview-row:last-child{border-bottom:0}.customer-product-preview-row strong,.customer-product-preview-row span{color:#050505;font-weight:900;font-size:10px}.customer-product-preview-row span{font-size:9px}
.customer-product-history-overlay{display:none;position:fixed;inset:0;z-index:3000;place-items:center;background:rgba(8,27,24,.56);padding:24px}.customer-product-history-overlay.open{display:grid}.customer-product-history-dialog{display:grid;grid-template-rows:auto minmax(0,1fr);width:min(980px,96vw);max-height:88vh;border-radius:8px;background:#fff;box-shadow:0 24px 70px rgba(0,0,0,.32);overflow:hidden}.customer-product-history-body{min-height:220px;overflow:auto;padding:18px}.product-bill-history-table{min-width:760px}.product-bill-history-table tbody tr:nth-child(odd){background:#e1f4df}.product-bill-history-table tbody tr:nth-child(even){background:#fff4b8}.product-bill-history-table tbody tr:hover{background:#bfe8c2}.product-bill-history-table tbody td,.product-bill-history-table tbody td strong,.product-bill-history-table tbody td small{color:#050505;font-weight:950}.pending-order-picker-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}.pending-order-picker-head h3{margin:0 0 3px}.pending-order-picker-head span{color:var(--muted);font-size:11px;font-weight:800}
@media(max-width:760px){.pending-order-picker-head{align-items:stretch;flex-direction:column}.pending-order-picker-head .button-row{display:grid;grid-template-columns:1fr 1fr}.customer-product-history-overlay{padding:8px}.customer-product-history-dialog{width:100%;max-height:94vh}.customer-product-history-body{padding:10px}}
.billing-modal-form .billing-line-foot .line-margin-indicator{display:inline-flex;align-items:center;justify-content:space-between;gap:8px;flex:0 0 auto;min-width:142px;border:2px solid transparent;border-radius:7px;padding:3px 4px 3px 8px;font-size:12.5px!important;line-height:1.1!important;font-weight:950!important;white-space:nowrap}.billing-modal-form .billing-line-foot .line-margin-indicator b{border-radius:5px;padding:3px 7px;font-size:10px;line-height:1!important;font-weight:950;letter-spacing:.03em;text-transform:uppercase}.billing-modal-form .billing-line-foot .line-margin-indicator.margin-excellent{background:#08713e;border-color:#034f2a;color:#fff!important}.line-margin-indicator.margin-excellent b{background:#034f2a;color:#fff}.billing-modal-form .billing-line-foot .line-margin-indicator.margin-ok{background:#cef0d5;border-color:#4c9b60;color:#124f25!important}.line-margin-indicator.margin-ok b{background:#65b978;color:#0d3f1d}.billing-modal-form .billing-line-foot .line-margin-indicator.margin-bad{background:#ffe68a;border-color:#c58c00;color:#4f3600!important}.line-margin-indicator.margin-bad b{background:#d99d00;color:#2f1f00}.billing-modal-form .billing-line-foot .line-margin-indicator.margin-very-bad{background:#c91d2e;border-color:#7f101b;color:#fff!important}.line-margin-indicator.margin-very-bad b{background:#7f101b;color:#fff}

/* Android app counter mode: make billing feel native on phones, not like a squeezed desktop modal. */
@media(max-width:760px){
  html.android-webview,html.android-webview body{height:100%!important;overflow:hidden!important;background:#f4f6f2}
  html.android-webview body.modal-open{overflow:hidden!important}
  html.android-webview .modal:has(.billing-modal-form){position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;max-height:100dvh!important;border-radius:0!important;background:#f4f6f2!important}
  html.android-webview .modal:has(.billing-modal-form) .modal-head{position:sticky!important;top:0!important;z-index:60!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:6px!important;padding:7px 8px!important;background:#fff!important;border-bottom:1px solid #dde6df!important}
  html.android-webview .modal:has(.billing-modal-form) .modal-head>h3{grid-column:1;grid-row:1;font-size:16px!important;line-height:1.1!important;padding:0!important;margin:0!important;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis}
  html.android-webview .modal:has(.billing-modal-form) .modal-close{grid-column:2;grid-row:1;width:34px;height:34px;margin:0!important;border-radius:999px}
  html.android-webview .modal:has(.billing-modal-form) .modal-head-tools{grid-column:1/-1!important;display:grid!important;grid-template-columns:1fr auto!important;grid-template-rows:auto auto auto!important;gap:6px!important;align-items:center!important;width:100%!important}
  html.android-webview .billing-workspace-tabs{grid-column:1;grid-row:1;display:grid!important;grid-template-columns:1fr 1fr;background:#e7f0ed;border:1px solid #c9dad3;border-radius:999px;padding:3px}
  html.android-webview .billing-workspace-tabs button{min-height:34px;border:0;border-radius:999px;background:transparent;font-size:12px;font-weight:950;color:#36534a}
  html.android-webview .billing-workspace-tabs button.active{background:#0d7f60;color:#fff}
  html.android-webview .billing-head-summary{grid-column:2;grid-row:1;display:flex!important;align-items:center;justify-content:flex-end;gap:4px;min-width:0}
  html.android-webview .billing-head-summary>strong,html.android-webview .billing-total-block>strong{background:#98131d;color:#fff!important;border-radius:10px;padding:7px 9px;font-size:18px!important;line-height:1}
  html.android-webview .billing-head-summary .billing-summary-meta{display:none!important}
  html.android-webview .billing-head-payment{grid-column:1/-1;grid-row:2;display:flex!important;overflow-x:auto;border:0;background:transparent;padding:0;gap:5px}
  html.android-webview .billing-head-payment .payment-options{display:flex!important;gap:5px}
  html.android-webview .billing-head-payment .payment-options button{height:34px;padding:6px 12px;border-radius:999px;font-size:11px;font-weight:950;white-space:nowrap}
  html.android-webview .billing-head-payment>label,html.android-webview .billing-head-payment .payment-title,html.android-webview .billing-head-payment>small,html.android-webview .billing-head-payment .secondary{display:none!important}
  html.android-webview .billing-head-context,html.android-webview .billing-head-totals,html.android-webview .billing-customer-actions .header-account-btn,html.android-webview .billing-customer-actions .header-history-btn,html.android-webview .billing-customer-actions .header-discounts-btn,html.android-webview .billing-head-actions .header-shortcuts-btn{display:none!important}
  html.android-webview .billing-customer-actions{grid-column:1;grid-row:3;display:flex!important}
  html.android-webview .billing-customer-actions .secondary{height:34px;border-radius:999px;padding:6px 12px;font-size:11px;font-weight:950}
  html.android-webview .billing-head-actions{grid-column:1/-1;grid-row:4;position:fixed!important;left:0;right:0;bottom:0;z-index:80;display:grid!important;grid-template-columns:1fr 1fr;gap:8px;padding:9px 10px calc(9px + env(safe-area-inset-bottom));background:rgba(255,255,255,.96);border-top:1px solid #dfe8e2;box-shadow:0 -12px 30px rgba(16,44,41,.12)}
  html.android-webview .billing-head-actions .primary{height:46px;border-radius:13px;font-size:14px;font-weight:1000}
  html.android-webview .billing-head-actions .primary:first-of-type:last-of-type{grid-column:1/-1}
  html.android-webview .modal:has(.billing-modal-form) .modal-body{height:calc(100dvh - 122px)!important;min-height:0!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;padding:0 8px 84px!important;background:#f4f6f2!important}
  html.android-webview .billing-modal-form{display:block!important;height:auto!important;min-height:0!important;overflow:visible!important}
  html.android-webview .billing-modal-form .hot-banners,html.android-webview .billing-modal-form .sale-left,html.android-webview .billing-add-product .panel-head{display:none!important}
  html.android-webview .billing-workspace{display:block!important;height:auto!important;margin:0!important;overflow:visible!important}
  html.android-webview .billing-add-product{position:sticky!important;top:0!important;z-index:45!important;margin:0 -8px 8px!important;border-radius:0!important;border-left:0!important;border-right:0!important;padding:8px!important;background:#fff!important}
  html.android-webview .billing-product-search{display:grid!important;grid-template-columns:minmax(0,1fr) 48px 48px!important;gap:7px!important;margin:0!important}
  html.android-webview .billing-product-search span{display:none!important}
  html.android-webview .billing-product-search input{height:48px!important;border-radius:14px!important;padding:0 12px!important;font-size:15px!important;font-weight:850!important;background:#f9fbfa!important}
  html.android-webview .billing-product-search button{height:48px!important;min-height:48px!important;border-radius:14px!important;background:#eef8f4!important}
  html.android-webview .billing-add-product .lookup-results{max-height:48dvh!important;overflow:auto!important;margin-top:8px!important;padding:0 0 8px!important;background:#fff!important}
  html.android-webview .billing-add-product .lookup-row{border-radius:13px!important;padding:10px!important}
  html.android-webview .billing-add-product .product-result{grid-template-columns:1fr!important}
  html.android-webview .billing-add-product .product-result-actions{justify-content:flex-start!important;overflow-x:auto;flex-wrap:nowrap!important}
  html.android-webview .billing-lines-panel{border-radius:14px!important;margin-bottom:10px!important;overflow:hidden!important}
  html.android-webview .billing-lines-panel .panel-head{position:sticky!important;top:64px!important;z-index:35!important;padding:12px!important;background:#fff!important}
  html.android-webview .billing-lines-panel .panel-head h3{font-size:16px!important}
  html.android-webview .billing-lines-panel .cart-lines{min-height:54dvh!important;height:auto!important;overflow:visible!important;padding:4px 10px 16px!important}
  html.android-webview .billing-line{padding:12px 0!important;gap:8px!important}
  html.android-webview .billing-line-title strong{font-size:15px!important;line-height:1.25!important}
  html.android-webview .billing-line-heading{display:grid!important;gap:6px}
  html.android-webview .billing-line-actions{display:flex!important;align-items:center;justify-content:space-between}
  html.android-webview .billing-line-total{font-size:20px!important;border-radius:10px!important;padding:6px 10px!important}
  html.android-webview .compact-line-grid{display:grid!important;grid-template-columns:1fr 78px 104px!important;gap:8px!important}
  html.android-webview .compact-line-grid.has-free-qty,html.android-webview .compact-line-grid.has-scheme-discount,html.android-webview .compact-line-grid.has-free-qty.has-scheme-discount{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html.android-webview .compact-line-grid .lot-field{grid-column:1/-1!important}
  html.android-webview .compact-line-grid label{font-size:10px!important}
  html.android-webview .compact-line-grid input,html.android-webview .compact-line-grid select{min-height:40px!important;font-size:13px!important;border-radius:11px!important}
  html.android-webview .billing-line-tail .button-row{display:flex!important;overflow-x:auto!important;flex-wrap:nowrap!important}
  html.android-webview .billing-line-tail .row-action{flex:0 0 auto;height:34px;border-radius:999px;font-size:11px!important;padding:7px 10px!important}
  html.android-webview .cart-actions{display:none!important}
}

/* Android app v6: safer top touch area, visible back, customer + doctor/ref controls. */
@media(max-width:760px){
  html.android-webview .modal:has(.billing-modal-form) .modal-head{padding-top:16px!important;padding-bottom:8px!important;grid-template-rows:auto auto auto!important}
  html.android-webview .modal:has(.billing-modal-form) .modal-body{height:calc(100dvh - 178px)!important;padding-bottom:92px!important}
  html.android-webview .mobile-back-btn{grid-column:1;grid-row:1;display:inline-flex!important;align-items:center;justify-content:center;width:64px;height:34px;border-radius:999px;background:#eef4f1;border-color:#c9dad3;color:#183a33;font-size:12px;font-weight:1000}
  html.android-webview .billing-workspace-tabs{grid-column:1/-1!important;grid-row:2!important;margin-left:0!important}
  html.android-webview .billing-head-summary{grid-column:2!important;grid-row:1!important}
  html.android-webview .billing-head-payment{grid-row:3!important}
  html.android-webview .billing-customer-actions{grid-column:1/-1!important;grid-row:4!important;display:grid!important;grid-template-columns:minmax(0,1fr)!important;margin-top:0}
  html.android-webview #billingHeaderCustomerBtn{height:42px!important;justify-content:flex-start!important;max-width:none!important;border-radius:13px!important;background:#94131b!important;border-color:#65080d!important;color:#fff!important;font-size:16px!important;font-weight:1000!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:8px 12px!important;text-align:left}
  html.android-webview #billingHeaderCustomerBtn:not(.customer-selected){font-size:13px!important;color:#52645f!important;background:#f7faf7!important}
  html.android-webview .billing-head-context{display:block!important;grid-column:1/-1!important;grid-row:5!important;padding:0!important;width:100%!important}
  html.android-webview .billing-head-context .billing-control-grid{display:grid!important;grid-template-columns:1fr 1fr!important;gap:7px!important;width:100%!important}
  html.android-webview .billing-head-context .billing-control-grid label{display:block!important;font-size:0!important;min-width:0!important}
  html.android-webview .billing-head-context .billing-control-grid label:nth-child(1),html.android-webview .billing-head-context .billing-control-grid label:nth-child(2),html.android-webview .billing-head-context .billing-control-grid label:has(#billingPayment){display:none!important}
  html.android-webview .billing-head-context .billing-control-grid select,html.android-webview .billing-head-context .billing-control-grid input{display:block!important;width:100%!important;height:40px!important;min-height:40px!important;border-radius:12px!important;padding:7px 10px!important;font-size:12px!important;font-weight:850!important;background:#fff!important}
  html.android-webview #billingDoctor{background:#fff!important}
  html.android-webview #billingReference{background:#fff!important}
  html.android-webview .billing-head-actions{grid-template-columns:1fr 1fr!important}
  html.android-webview .billing-add-product{top:0!important}
}

/* Mobile billing balances and compact recent-bill totals. */
@media(max-width:760px){
  html.android-webview .modal:has(.billing-modal-form) .modal-head-tools{grid-template-columns:64px minmax(0,1fr) auto!important}
  html.android-webview .mobile-back-btn{grid-column:1!important;grid-row:1!important}
  html.android-webview .billing-pending-row{display:contents!important}
  html.android-webview .billing-customer-due-badges{grid-column:2!important;grid-row:1!important;display:grid;grid-template-columns:1fr 1fr;gap:4px;min-width:0}
  html.android-webview .billing-customer-due-badges.hidden{display:none!important}
  html.android-webview .billing-customer-due-badges span{min-width:0;padding:5px 6px;border-radius:8px;overflow:hidden}
  html.android-webview .billing-customer-due-badges small{font-size:6px;white-space:nowrap}
  html.android-webview .billing-customer-due-badges strong{font-size:9px;overflow:hidden;text-overflow:ellipsis}
  html.android-webview .billing-head-summary{grid-column:3!important;grid-row:1!important}
  html.android-webview .billing-pending-row>.pending-orders-btn{grid-column:1/-1!important;grid-row:7!important;width:100%}
  html.android-webview .billing-payment-summary{padding:8px!important}
  html.android-webview .payment-total-strip{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;width:100%!important}
  html.android-webview .payment-total-strip>div{min-width:0;border-radius:12px!important;padding:8px!important}
  html.android-webview .payment-total-strip small{font-size:7px!important;line-height:1.15;min-height:16px}
  html.android-webview .payment-total-strip strong{display:block;font-size:14px!important;white-space:nowrap;overflow:visible}
}

@media(max-width:760px){
  html.android-webview .modal-back-btn{display:inline-flex!important;align-items:center;justify-content:center;height:36px;border-radius:999px;padding:7px 13px;font-size:12px;font-weight:1000;background:#eef4f1;border-color:#c9dad3;color:#183a33}
  html.android-webview .modal:has(.billing-modal-form)>.modal-head>.modal-back-btn{display:none!important}
  html.android-webview .modal:not(:has(.billing-modal-form)) .modal-head{padding-top:16px!important;gap:8px!important}
  html.android-webview .modal:not(:has(.billing-modal-form)) .modal-head h3{font-size:17px!important;line-height:1.15!important}
}

/* Android app v8: fixed recent invoice/order pages, no browser-like page drift. */
@media(max-width:760px){
  html.android-webview body:not(.modal-open) #appView{height:100dvh!important;overflow:hidden!important;background:#f4f6f2!important}
  html.android-webview body:not(.modal-open) .app{height:100dvh!important;overflow:hidden!important}
  html.android-webview body:not(.modal-open) .app main{height:100dvh!important;display:grid!important;grid-template-rows:auto minmax(0,1fr)!important;overflow:hidden!important}
  html.android-webview body:not(.modal-open) .app header{min-height:64px!important;height:64px!important;padding:12px 12px 8px!important;align-items:center!important;background:#fff!important;border-bottom:1px solid #dde6df!important}
  html.android-webview body:not(.modal-open) .app header .title-block small{font-size:10px!important;line-height:1!important}
  html.android-webview body:not(.modal-open) .app header .title-block h1{font-size:21px!important;line-height:1.05!important;margin:2px 0 0!important}
  html.android-webview body:not(.modal-open) .content{height:100%!important;min-height:0!important;overflow:hidden!important;padding:8px!important;display:flex!important;flex-direction:column!important;gap:8px!important}
  html.android-webview body:not(.modal-open) .section-head{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:8px!important;align-items:center!important;margin:0!important;padding:0!important}
  html.android-webview body:not(.modal-open) .section-head h1{font-size:20px!important;line-height:1.05!important;margin:0!important}
  html.android-webview body:not(.modal-open) .section-head p{display:none!important}
  html.android-webview body:not(.modal-open) .section-head .db-pill{font-size:9px!important;padding:5px 8px!important;white-space:nowrap!important}
  html.android-webview body:not(.modal-open) .content>.panel.table-wrap{flex:1 1 auto!important;min-height:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;border-radius:13px!important;margin:0!important}
  html.android-webview .content>.panel.table-wrap>.panel-head{flex:0 0 auto!important;padding:9px 11px!important}
  html.android-webview .content>.panel.table-wrap>.panel-head h3{font-size:15px!important;line-height:1.1!important}
  html.android-webview .content>.panel.table-wrap>.panel-head .muted{font-size:10px!important}
  html.android-webview .compact-history-toolbar{flex:0 0 auto!important;display:grid!important;grid-template-columns:1fr!important;gap:7px!important;padding:8px!important;border-bottom:1px solid #e1e8e3!important}
  html.android-webview .compact-history-toolbar .history-actions{display:grid!important;grid-template-columns:1fr 1fr 1fr!important;gap:6px!important;white-space:normal!important}
  html.android-webview .compact-history-toolbar .history-actions button{min-height:38px!important;height:38px!important;border-radius:11px!important;padding:7px 5px!important;font-size:12px!important;font-weight:950!important}
  html.android-webview .compact-history-toolbar .history-filters{display:grid!important;grid-template-columns:1fr 1fr!important;gap:6px!important}
  html.android-webview .compact-history-toolbar .history-filters label,html.android-webview .compact-history-toolbar .filter-checklist-field{font-size:9px!important;line-height:1!important;font-weight:900!important;min-width:0!important}
  html.android-webview .compact-history-toolbar .history-filters label:nth-child(3),
  html.android-webview .compact-history-toolbar .history-filters label:nth-child(4),
  html.android-webview .compact-history-toolbar .history-filters .filter-checklist-field:nth-child(3),
  html.android-webview .compact-history-toolbar .history-filters .filter-checklist-field:nth-child(4){display:none!important}
  html.android-webview .compact-history-toolbar .history-filters label:last-child{grid-column:1/-1!important}
  html.android-webview .compact-history-toolbar .history-filters input,html.android-webview .compact-history-toolbar .history-filters select,html.android-webview .compact-history-toolbar .filter-checklist summary{height:36px!important;min-height:36px!important;border-radius:11px!important;padding:6px 9px!important;font-size:12px!important;font-weight:850!important}
  html.android-webview .billing-payment-summary{flex:0 0 auto!important;display:block!important;width:100%!important;padding:8px!important;border-bottom:1px solid #e1e8e3!important;background:#fff!important}
  html.android-webview .billing-payment-summary .payment-box{margin:0!important;padding:8px!important;border-radius:11px!important;min-height:0!important}
  html.android-webview .billing-payment-summary .payment-box small{font-size:8px!important;line-height:1!important}
  html.android-webview .billing-payment-summary .payment-box strong{font-size:14px!important;line-height:1.05!important}
  html.android-webview #billingHistory,html.android-webview #billingOrders{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch!important;padding:8px!important;display:grid!important;gap:7px!important;align-content:start!important}
  html.android-webview .bill-history-card{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:6px 8px!important;align-items:center!important;width:100%!important;min-width:0!important;border-radius:12px!important;padding:9px!important}
  html.android-webview .bill-history-card>div{min-width:0!important}
  html.android-webview .bill-history-card strong{font-size:13px!important;line-height:1.1!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  html.android-webview .bill-history-card small{font-size:8.5px!important;line-height:1.15!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  html.android-webview .bill-history-card>div:nth-child(2){grid-column:1!important}
  html.android-webview .bill-history-card>div:nth-child(3),html.android-webview .bill-history-card>div:nth-child(4),html.android-webview .bill-history-card>div:nth-child(6),html.android-webview .bill-history-card>div:nth-child(7){display:none!important}
  html.android-webview .bill-history-card>div:nth-child(5){grid-column:2!important;grid-row:1 / span 2!important;text-align:right!important}
  html.android-webview .bill-history-card>div:last-child{grid-column:1/-1!important;display:flex!important;gap:5px!important;overflow-x:auto!important;padding-top:3px!important}
  html.android-webview .bill-history-card .button-row.mini .row-action{flex:1 0 auto!important;min-width:68px!important;height:32px!important;border-radius:999px!important;padding:6px 8px!important;font-size:10px!important;font-weight:950!important}
  html.android-webview #billingOrders .bill-history-card>div:nth-child(4){display:block!important;grid-column:2!important;grid-row:1 / span 2!important;text-align:right!important}
  html.android-webview #billingOrders .bill-history-card>div:nth-child(5){display:none!important}
  html.android-webview #billingOrders .status-pill{font-size:9px!important;padding:4px 7px!important;white-space:nowrap!important}
}

/* Android app v9: restore normal scrolling outside bill/order history. */
@media(max-width:760px){
  html.android-webview,html.android-webview body{height:auto!important;min-height:100%!important;overflow-y:auto!important;overflow-x:hidden!important;background:#f4f6f2}
  html.android-webview body.modal-open{height:100%!important;overflow:hidden!important}
  html.android-webview body:not(.modal-open) #appView,
  html.android-webview body:not(.modal-open) .app,
  html.android-webview body:not(.modal-open) .app main,
  html.android-webview body:not(.modal-open) #content{
    height:auto!important;
    min-height:100dvh!important;
    overflow-y:visible!important;
    overflow-x:hidden!important;
    display:block!important;
  }
  html.android-webview body:not(.modal-open) #appView{overflow-y:auto!important;-webkit-overflow-scrolling:touch!important}
  html.android-webview body:not(.modal-open) #content{
    padding:12px!important;
    padding-bottom:120px!important;
  }
  html.android-webview body:not(.modal-open) #content:not(:has(#billingHistory)):not(:has(#billingOrders))>.panel.table-wrap,
  html.android-webview body:not(.modal-open) #content:not(:has(#billingHistory)):not(:has(#billingOrders)) .table-wrap{
    display:block!important;
    height:auto!important;
    min-height:0!important;
    overflow:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }
  html.android-webview body:not(.modal-open) #content:has(#billingHistory),
  html.android-webview body:not(.modal-open) #content:has(#billingOrders){
    height:calc(100dvh - 64px)!important;
    min-height:0!important;
    overflow:hidden!important;
    padding:8px!important;
    display:flex!important;
    flex-direction:column!important;
    gap:8px!important;
  }
  html.android-webview body:not(.modal-open) #content:has(#billingHistory)>.panel.table-wrap,
  html.android-webview body:not(.modal-open) #content:has(#billingOrders)>.panel.table-wrap{
    flex:1 1 auto!important;
    min-height:0!important;
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
    margin:0!important;
  }
  html.android-webview body:not(.modal-open) #content:has(#billingHistory) #billingHistory,
  html.android-webview body:not(.modal-open) #content:has(#billingOrders) #billingOrders{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    touch-action:pan-y!important;
    -webkit-overflow-scrolling:touch!important;
  }
}

/* Android app v10: explicit page modes for reports vs compact history. */
@media(max-width:760px){
  html.android-webview body:not(.modal-open) #appView.app{
    height:100dvh!important;
    min-height:100dvh!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    touch-action:auto!important;
  }
  html.android-webview body:not(.modal-open) #content.mobile-free-scroll{
    display:block!important;
    height:auto!important;
    min-height:0!important;
    overflow:visible!important;
    padding:12px 12px 120px!important;
    touch-action:auto!important;
  }
  html.android-webview body:not(.modal-open) #content.mobile-free-scroll .table-wrap{
    display:block!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:auto!important;
    -webkit-overflow-scrolling:touch!important;
    touch-action:auto!important;
  }
  html.android-webview body:not(.modal-open) #content.mobile-free-scroll .data-table{
    min-width:900px!important;
  }
  html.android-webview body:not(.modal-open) #content.mobile-history-page{
    height:calc(100dvh - 64px)!important;
    min-height:0!important;
    overflow:hidden!important;
    padding:8px!important;
    display:flex!important;
    flex-direction:column!important;
    gap:8px!important;
    touch-action:pan-y!important;
  }
  html.android-webview body:not(.modal-open) #content.mobile-history-page>.panel.table-wrap{
    flex:1 1 auto!important;
    min-height:0!important;
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
  }
  html.android-webview body:not(.modal-open) #content.mobile-history-page #todayBills,
  html.android-webview body:not(.modal-open) #content.mobile-history-page #billingOrders{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    touch-action:pan-y!important;
  }
}
.purchase-location-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.purchase-location-strip > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.purchase-location-strip strong,
.purchase-location-strip small {
  overflow-wrap: anywhere;
}

.purchase-location-strip small {
  color: var(--muted);
}

.sidebar nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 3px;
  overscroll-behavior: contain;
}

.sidebar-foot {
  flex: 0 0 auto;
}

.sidebar-data-link {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: #fff;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.sidebar-data-link:hover {
  background: rgba(255,255,255,.13);
}

.modal:has(.purchase-entry-form) {
  width: calc(100vw - 28px);
  max-width: none;
  height: calc(100vh - 28px);
  max-height: none;
  border-radius: 14px;
}

.modal:has(.purchase-entry-form) .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  background: #f6f8f5;
}

.purchase-entry-form {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 100%;
  color: #090909;
}

.purchase-entry-form .panel {
  box-shadow: none;
}

.purchase-header-grid {
  grid-template-columns: 1.1fr 1.3fr .65fr .65fr 1fr .55fr .45fr;
  gap: 9px;
}

.purchase-header-grid input,
.purchase-header-grid select {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #090909;
}

.purchase-entry-main {
  display: grid;
  grid-template-columns: minmax(320px, .95fr) minmax(360px, 1.05fr);
  gap: 12px;
}

.purchase-entry-main .panel {
  padding: 12px;
}

.purchase-entry-main .search {
  min-width: 0;
}

.purchase-entry-lines {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.purchase-entry-lines #purchaseEntryLines {
  min-height: 0;
  overflow: auto;
}

.purchase-entry-table {
  min-width: 1480px;
}

.purchase-entry-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.purchase-entry-table td {
  padding: 7px 8px;
  vertical-align: middle;
}

.purchase-entry-table input,
.purchase-entry-table select {
  width: 100%;
  min-width: 68px;
  padding: 6px 7px;
  font-size: 11px;
  font-weight: 700;
  color: #090909;
}

.purchase-payment-box:empty {
  display: none;
}

.purchase-payment-split {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.purchase-payment-split input {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
}

.purchase-entry-table td:first-child {
  min-width: 220px;
}

.purchase-entry-table td:nth-child(2) {
  min-width: 230px;
}

.purchase-batch-cell {
  display: grid;
  gap: 6px;
}

.purchase-batch-picks {
  display: grid;
  gap: 5px;
  max-height: 118px;
  overflow: auto;
}

.batch-pick {
  width: 100%;
  border: 1px solid #dce6e0;
  border-radius: 6px;
  background: #fbfdfb;
  color: #20302a;
  text-align: left;
  padding: 6px 7px;
}

.batch-pick strong,
.batch-pick small {
  display: block;
}

.batch-pick small {
  color: #77847d;
  font-size: 10px;
  margin-top: 2px;
}

.batch-pick.active {
  border-color: #0f7d63;
  background: #e8f6f1;
}

.purchase-batch-empty {
  color: #84918b;
  font-weight: 700;
}

.purchase-entry-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.purchase-totals {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.purchase-totals span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
}

.purchase-totals small,
.purchase-totals strong {
  display: block;
}

.purchase-totals small {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 900;
}

.purchase-totals strong {
  font-size: 13px;
  color: #090909;
}

@media(max-width:1100px) {
  .purchase-header-grid,
  .purchase-entry-main {
    grid-template-columns: 1fr 1fr;
  }

  .purchase-entry-footer {
    grid-template-columns: 1fr;
  }

  .purchase-totals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media(max-width:760px) {
  .modal:has(.purchase-entry-form) {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .modal:has(.purchase-entry-form) .modal-body {
    padding: 8px;
  }

  .purchase-entry-form {
    display: block;
  }

  .purchase-entry-main {
    display: block;
  }

  .purchase-entry-main .panel {
    margin-bottom: 10px;
  }

  .purchase-header-grid {
    grid-template-columns: 1fr;
  }

  .purchase-entry-lines {
    max-height: none;
  }

  .purchase-totals {
    grid-template-columns: 1fr 1fr;
  }

  .purchase-entry-footer .button-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .purchase-entry-footer .primary {
    grid-column: 1 / -1;
  }
}

/* Billing workspace balance: keep search usable without starving the bill lines. */
.modal:has(.billing-modal-form) .modal-body {
  padding-top: 8px;
}

.modal:has(.billing-modal-form) .billing-modal-form {
  gap: 8px 12px;
}

.modal:has(.billing-modal-form) .hot-banners {
  gap: 3px;
  padding-bottom: 4px;
}

.modal:has(.billing-modal-form) .hot-banner {
  min-height: 25px;
  padding: 4px 8px;
}

.modal:has(.billing-modal-form) .hot-track button {
  padding: 3px 7px;
}

.modal:has(.billing-modal-form) .billing-workspace {
  grid-template-rows: max-content minmax(300px, 1fr);
  gap: 8px;
}

.modal:has(.billing-modal-form) .billing-workspace .billing-add-product {
  padding: 8px 10px !important;
  overflow: visible !important;
}

.modal:has(.billing-modal-form) .billing-workspace .billing-add-product .lookup-results {
  max-height: clamp(158px, 22vh, 238px) !important;
  padding: 4px 0 22px !important;
  margin: 0 0 4px !important;
  scroll-padding-bottom: 26px !important;
  border-radius: 10px;
}

.modal:has(.billing-modal-form) .billing-workspace .billing-add-product .lookup-results .lookup-row {
  margin-bottom: 5px !important;
  padding: 6px 8px !important;
}

.modal:has(.billing-modal-form) .billing-workspace .billing-add-product .lookup-results .lookup-row:last-child,
.modal:has(.billing-modal-form) .billing-workspace .billing-add-product .lookup-results .product-result:last-child {
  margin-bottom: 16px !important;
}

.modal:has(.billing-modal-form) .billing-add-product .product-result {
  gap: 8px;
}

.modal:has(.billing-modal-form) .billing-add-product .product-result strong {
  font-size: 11.5px !important;
  line-height: 1.15;
}

.modal:has(.billing-modal-form) .billing-add-product .product-result small {
  font-size: 8.8px !important;
  line-height: 1.25;
}

.modal:has(.billing-modal-form) .billing-add-product .product-result-actions .search-option {
  height: 25px;
  padding: 3px 7px;
  font-size: 9px;
}

.modal:has(.billing-modal-form) .billing-lines-panel {
  min-height: 300px;
}

.modal:has(.billing-modal-form) .billing-lines-panel .panel-head {
  padding: 8px 12px;
}

.modal:has(.billing-modal-form) .billing-lines-panel .cart-lines {
  min-height: 0 !important;
  padding-bottom: 18px;
}

html.android-webview .billing-add-product .lookup-results {
  max-height: 34dvh !important;
  padding-bottom: 12px !important;
  scroll-padding-bottom: 18px !important;
}

html.android-webview .billing-lines-panel .cart-lines {
  min-height: 46dvh !important;
}

/* Billing line density: more items visible while keeping every control available. */
.modal:has(.billing-modal-form) .billing-lines-panel .billing-line {
  padding: 3px 6px !important;
  gap: 1px !important;
}

.modal:has(.billing-modal-form) .billing-line-heading {
  grid-template-columns: minmax(210px, .78fr) minmax(360px, 1.5fr) auto !important;
  gap: 7px !important;
}

.modal:has(.billing-modal-form) .billing-lines-panel .billing-line-title strong {
  font-size: 15px !important;
  line-height: 1 !important;
}

.modal:has(.billing-modal-form) .line-fact {
  padding: 1px 4px !important;
  font-size: 11px !important;
  line-height: 1 !important;
}

.modal:has(.billing-modal-form) .billing-line-total {
  font-size: 16px !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
}

.modal:has(.billing-modal-form) .billing-lines-panel .billing-line-actions .clear-remove {
  padding: 2px 6px !important;
  font-size: 10px !important;
}

.modal:has(.billing-modal-form) .billing-lines-panel .compact-line-grid {
  gap: 3px !important;
}

.modal:has(.billing-modal-form) .billing-lines-panel .compact-line-grid label {
  font-size: 10.5px !important;
  line-height: .82 !important;
}

.modal:has(.billing-modal-form) .billing-lines-panel .compact-line-grid input,
.modal:has(.billing-modal-form) .billing-lines-panel .compact-line-grid select {
  height: 22px !important;
  min-height: 22px !important;
  padding: 1px 5px !important;
  font-size: 12px !important;
  border-radius: 6px !important;
}

.modal:has(.billing-modal-form) .billing-line-tail {
  gap: 5px !important;
}

.modal:has(.billing-modal-form) .billing-line-tail .billing-line-foot span,
.modal:has(.billing-modal-form) .billing-line-tail .line-consumption,
.modal:has(.billing-modal-form) .billing-line-tail .line-composition {
  font-size: 10.5px !important;
  line-height: 1 !important;
}

.modal:has(.billing-modal-form) .billing-modal-form .billing-line-foot .line-margin-indicator {
  min-width: 118px;
  padding: 2px 4px 2px 6px;
  font-size: 10.5px !important;
}

.modal:has(.billing-modal-form) .billing-modal-form .billing-line-foot .line-margin-indicator b {
  padding: 2px 5px;
  font-size: 8px;
}

.modal:has(.billing-modal-form) .billing-line-tail .button-row.mini .row-action {
  min-height: 20px !important;
  padding: 2px 6px !important;
  font-size: 10px !important;
}

@media(max-width:760px) {
  .modal:has(.billing-modal-form) .billing-workspace {
    grid-template-rows: max-content minmax(44dvh, 1fr);
  }

  .modal:has(.billing-modal-form) .billing-workspace .billing-add-product .lookup-results {
    max-height: 30dvh !important;
  }

  .modal:has(.billing-modal-form) .billing-line-heading,
  html.android-webview .billing-line-heading {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 4px !important;
  }

  .modal:has(.billing-modal-form) .billing-line-facts,
  html.android-webview .billing-line-facts {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    gap: 3px !important;
    padding-bottom: 1px;
  }

  .modal:has(.billing-modal-form) .billing-lines-panel .billing-line,
  html.android-webview .billing-line {
    padding: 5px 6px !important;
    gap: 3px !important;
  }

  .modal:has(.billing-modal-form) .billing-lines-panel .billing-line-title strong,
  html.android-webview .billing-line-title strong {
    font-size: 13px !important;
    line-height: 1.08 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .modal:has(.billing-modal-form) .billing-line-total,
  html.android-webview .billing-line-total {
    font-size: 15px !important;
    padding: 3px 8px !important;
    border-radius: 7px !important;
  }

  .modal:has(.billing-modal-form) .compact-line-grid,
  html.android-webview .compact-line-grid,
  html.android-webview .compact-line-grid.has-free-qty,
  html.android-webview .compact-line-grid.has-scheme-discount,
  html.android-webview .compact-line-grid.has-free-qty.has-scheme-discount {
    grid-template-columns: 1.4fr 54px 54px 78px 62px 62px !important;
    gap: 3px !important;
  }

  .modal:has(.billing-modal-form) .compact-line-grid .lot-field,
  html.android-webview .compact-line-grid .lot-field {
    grid-column: 1 / -1 !important;
  }

  .modal:has(.billing-modal-form) .compact-line-grid.has-free-qty.has-scheme-discount label:last-child,
  html.android-webview .compact-line-grid.has-free-qty.has-scheme-discount label:last-child {
    grid-column: span 3;
  }

  .modal:has(.billing-modal-form) .compact-line-grid label,
  html.android-webview .compact-line-grid label {
    font-size: 8.8px !important;
    line-height: .85 !important;
  }

  .modal:has(.billing-modal-form) .compact-line-grid input,
  .modal:has(.billing-modal-form) .compact-line-grid select,
  html.android-webview .compact-line-grid input,
  html.android-webview .compact-line-grid select {
    height: 27px !important;
    min-height: 27px !important;
    padding: 2px 5px !important;
    font-size: 11px !important;
    border-radius: 7px !important;
  }

  .modal:has(.billing-modal-form) .billing-line-tail,
  html.android-webview .billing-line-tail {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center !important;
    gap: 4px !important;
  }

  .modal:has(.billing-modal-form) .billing-line-tail .billing-line-foot,
  html.android-webview .billing-line-tail .billing-line-foot {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 4px !important;
    overflow: hidden !important;
  }

  .modal:has(.billing-modal-form) .billing-line-tail .line-consumption,
  html.android-webview .billing-line-tail .line-consumption {
    display: none !important;
  }

  .modal:has(.billing-modal-form) .billing-line-tail .line-composition,
  html.android-webview .billing-line-tail .line-composition {
    max-width: 45vw;
    font-size: 9px !important;
    padding: 1px 4px;
  }

  .modal:has(.billing-modal-form) .billing-line-tail .button-row,
  html.android-webview .billing-line-tail .button-row {
    display: flex !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    gap: 3px !important;
    margin-left: 0 !important;
  }

  .modal:has(.billing-modal-form) .billing-line-tail .row-action,
  html.android-webview .billing-line-tail .row-action {
    height: 25px !important;
    min-height: 25px !important;
    padding: 4px 7px !important;
    font-size: 9px !important;
    border-radius: 999px !important;
  }
}

/* Billing v20260719: readable dense desktop lines and mobile-first counter layout. */
.modal:has(.billing-modal-form) .billing-line-title strong {
  font-size: 16.5px !important;
  font-weight: 1000 !important;
  letter-spacing: 0 !important;
}

.modal:has(.billing-modal-form) .line-fact {
  font-size: 12px !important;
  font-weight: 950 !important;
}

.modal:has(.billing-modal-form) .compact-line-grid label {
  font-size: 11.5px !important;
  font-weight: 950 !important;
}

.modal:has(.billing-modal-form) .compact-line-grid input,
.modal:has(.billing-modal-form) .compact-line-grid select {
  font-size: 13px !important;
  font-weight: 950 !important;
}

.modal:has(.billing-modal-form) .billing-line-tail .billing-line-foot span,
.modal:has(.billing-modal-form) .line-margin-indicator {
  font-weight: 950 !important;
}

@media(max-width:760px) {
  html.android-webview .modal:has(.billing-modal-form) .modal-head {
    padding: 8px !important;
    gap: 5px !important;
  }

  html.android-webview .modal:has(.billing-modal-form) .modal-body {
    height: calc(100dvh - 150px) !important;
    padding: 0 8px 76px !important;
  }

  html.android-webview .billing-add-product {
    padding: 6px 8px !important;
    margin: 0 -8px 4px !important;
  }

  html.android-webview .billing-product-search {
    grid-template-columns: minmax(0, 1fr) 44px 44px !important;
    gap: 6px !important;
  }

  html.android-webview .billing-product-search input,
  html.android-webview .billing-product-search button {
    height: 42px !important;
    min-height: 42px !important;
    border-radius: 12px !important;
  }

  html.android-webview .billing-add-product .lookup-results {
    max-height: 18dvh !important;
    padding: 0 0 6px !important;
    margin-top: 5px !important;
  }

  html.android-webview .billing-add-product .lookup-results:empty {
    display: none !important;
  }

  html.android-webview .billing-add-product .lookup-row {
    padding: 7px 8px !important;
    border-radius: 10px !important;
  }

  html.android-webview .billing-add-product .product-result strong {
    font-size: 12px !important;
    font-weight: 1000 !important;
  }

  html.android-webview .billing-add-product .product-result small {
    font-size: 9px !important;
    line-height: 1.15 !important;
  }

  html.android-webview .billing-add-product .product-result-actions .search-option {
    height: 25px !important;
    padding: 3px 7px !important;
    font-size: 9px !important;
  }

  html.android-webview .billing-lines-panel {
    border-radius: 11px !important;
    margin-bottom: 8px !important;
    overflow: hidden !important;
  }

  html.android-webview .billing-lines-panel .panel-head {
    top: 54px !important;
    padding: 8px 10px !important;
  }

  html.android-webview .billing-lines-panel .panel-head h3 {
    font-size: 18px !important;
    font-weight: 1000 !important;
  }

  html.android-webview .billing-lines-panel .cart-lines {
    min-height: 52dvh !important;
    padding: 4px 6px 12px !important;
  }

  html.android-webview .billing-lines-panel .billing-line {
    padding: 6px 7px !important;
    gap: 4px !important;
    border-radius: 12px !important;
  }

  html.android-webview .billing-line-heading {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 5px !important;
  }

  html.android-webview .billing-line-title strong {
    font-size: 15px !important;
    font-weight: 1000 !important;
    line-height: 1.08 !important;
  }

  html.android-webview .billing-line-facts {
    font-size: 0 !important;
    gap: 4px !important;
  }

  html.android-webview .line-fact {
    font-size: 12px !important;
    font-weight: 1000 !important;
    padding: 2px 5px !important;
  }

  html.android-webview .billing-line-total {
    font-size: 18px !important;
    padding: 4px 8px !important;
  }

  html.android-webview .billing-lines-panel .billing-line-actions .clear-remove {
    font-size: 11px !important;
    font-weight: 1000 !important;
    padding: 4px 8px !important;
  }

  html.android-webview .compact-line-grid,
  html.android-webview .compact-line-grid.has-free-qty,
  html.android-webview .compact-line-grid.has-scheme-discount,
  html.android-webview .compact-line-grid.has-free-qty.has-scheme-discount {
    grid-template-columns: 52px 58px minmax(72px, 1fr) minmax(66px, 1fr) !important;
    gap: 4px !important;
  }

  html.android-webview .compact-line-grid .lot-field {
    grid-column: 1 / -1 !important;
  }

  html.android-webview .compact-line-grid label:has([data-billing-field="schemeDiscType"]) {
    grid-column: 1 / -1 !important;
  }

  html.android-webview .compact-line-grid label {
    font-size: 10px !important;
    font-weight: 1000 !important;
  }

  html.android-webview .compact-line-grid input,
  html.android-webview .compact-line-grid select {
    height: 31px !important;
    min-height: 31px !important;
    font-size: 13px !important;
    font-weight: 1000 !important;
  }

  html.android-webview .compact-line-grid .lot-field select {
    font-size: 13px !important;
  }

  html.android-webview .billing-line-tail {
    display: block !important;
  }

  html.android-webview .billing-line-tail .billing-line-foot {
    display: flex !important;
    gap: 5px !important;
    overflow: hidden !important;
    margin-bottom: 4px;
  }

  html.android-webview .billing-line-tail .line-consumption,
  html.android-webview .billing-line-tail .line-composition {
    display: none !important;
  }

  html.android-webview .billing-modal-form .billing-line-foot .line-margin-indicator {
    min-width: 0 !important;
    padding: 4px 7px !important;
    font-size: 13px !important;
  }

  html.android-webview .billing-line-tail .button-row {
    display: flex !important;
    gap: 4px !important;
    overflow-x: auto !important;
  }

  html.android-webview .billing-line-tail .row-action {
    height: 31px !important;
    min-height: 31px !important;
    font-size: 11px !important;
    font-weight: 1000 !important;
    padding: 5px 9px !important;
  }
}

/* Billing v20260719-2 final mobile override: compact lot selector and unclipped stock. */
@media(max-width:760px) {
  html.android-webview .billing-add-product,
  html.android-webview .billing-workspace .billing-add-product,
  html.android-webview .modal-shell:not(.hidden) .billing-add-product,
  html.android-webview .billing-add-product .billing-product-search {
    position: relative !important;
    top: auto !important;
    z-index: 2 !important;
  }

  html.android-webview .billing-lines-panel,
  html.android-webview .billing-lines-panel .panel-head,
  html.android-webview .billing-lines-panel .cart-lines {
    position: relative !important;
    top: auto !important;
    z-index: 1 !important;
  }

  html.android-webview .billing-line-facts {
    display: grid !important;
    grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr) !important;
    width: 100% !important;
    gap: 3px !important;
    white-space: normal !important;
  }

  html.android-webview .billing-line-facts .line-fact {
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 2px 4px !important;
    line-height: 1.08 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html.android-webview .billing-line-facts .fact-shelf,
  html.android-webview .billing-line-facts .fact-stock {
    grid-column: span 1 !important;
  }

  html.android-webview .billing-line-facts .fact-stock {
    text-align: left !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  html.android-webview .compact-line-grid,
  html.android-webview .compact-line-grid.has-free-qty,
  html.android-webview .compact-line-grid.has-scheme-discount,
  html.android-webview .compact-line-grid.has-free-qty.has-scheme-discount {
    grid-template-columns: minmax(0, 1.35fr) 48px 60px minmax(64px, .95fr) !important;
    align-items: end !important;
  }

  html.android-webview .compact-line-grid .lot-field {
    grid-column: 1 / 4 !important;
  }

  html.android-webview .compact-line-grid .lot-field select {
    padding-left: 8px !important;
    padding-right: 24px !important;
    font-size: 12px !important;
  }

  html.android-webview .compact-line-grid label:has([data-billing-field="schemeDiscType"]) {
    grid-column: 1 / -1 !important;
  }
}

/* Billing v20260719-3: keep mobile margin percentage readable. */
@media(max-width:760px) {
  html.android-webview .billing-modal-form .billing-line-foot .line-margin-indicator {
    justify-content: flex-start !important;
    max-width: 128px !important;
    min-width: 92px !important;
    padding: 4px 6px !important;
    font-size: 13px !important;
    overflow: hidden !important;
    text-overflow: clip !important;
  }

  html.android-webview .billing-modal-form .billing-line-foot .line-margin-indicator b {
    display: none !important;
  }
}

/* Billing v20260719-9: Android keyboard focus mode. */
@media(max-width:760px) {
  html.android-webview.billing-keyboard-open body.modal-open {
    overflow: hidden !important;
  }

  html.android-webview.billing-keyboard-open .modal:has(.billing-modal-form) {
    height: 100dvh !important;
    max-height: 100dvh !important;
  }

  html.android-webview.billing-keyboard-open .modal:has(.billing-modal-form) .modal-head,
  html.android-webview.billing-keyboard-open .billing-modal-form .sale-left,
  html.android-webview.billing-keyboard-open .billing-modal-form .hot-banners,
  html.android-webview.billing-keyboard-open .billing-head-context,
  html.android-webview.billing-keyboard-open .billing-head-summary,
  html.android-webview.billing-keyboard-open .billing-head-payment,
  html.android-webview.billing-keyboard-open .billing-head-totals,
  html.android-webview.billing-keyboard-open .billing-customer-actions,
  html.android-webview.billing-keyboard-open .billing-head-actions,
  html.android-webview.billing-keyboard-open .billing-control-grid,
  html.android-webview.billing-keyboard-open .billing-money-panel,
  html.android-webview.billing-keyboard-open .billing-pending-row {
    display: none !important;
  }

  html.android-webview.billing-keyboard-open .modal:has(.billing-modal-form) .modal-body {
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    padding: 0 8px 8px !important;
  }

  html.android-webview.billing-keyboard-open .billing-modal-form {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(0, 1fr) !important;
    gap: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  html.android-webview.billing-keyboard-open .billing-workspace {
    display: grid !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: 6px !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  html.android-webview.billing-keyboard-open .billing-add-product,
  html.android-webview.billing-keyboard-open .billing-workspace .billing-add-product {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    margin: 0 -8px !important;
    padding: 6px 8px !important;
    border-radius: 0 0 12px 12px !important;
    background: #fff !important;
    box-shadow: 0 6px 18px rgba(15, 42, 36, .08) !important;
  }

  html.android-webview.billing-keyboard-open .billing-add-product .panel-head {
    display: none !important;
  }

  html.android-webview.billing-keyboard-open .billing-product-search {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 46px 46px !important;
    gap: 6px !important;
  }

  html.android-webview.billing-keyboard-open .billing-product-search input,
  html.android-webview.billing-keyboard-open .billing-product-search button {
    height: 44px !important;
    min-height: 44px !important;
    font-size: 18px !important;
    font-weight: 1000 !important;
  }

  html.android-webview.billing-keyboard-searching .billing-add-product .lookup-results {
    max-height: 46dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  html.android-webview.billing-keyboard-line-editing .billing-add-product .lookup-results {
    display: none !important;
  }

  html.android-webview.billing-keyboard-open .billing-lines-panel {
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    margin: 0 -8px !important;
    border-radius: 0 !important;
  }

  html.android-webview.billing-keyboard-open .billing-lines-panel .panel-head {
    position: sticky !important;
    top: 0 !important;
    z-index: 8 !important;
    background: #fff !important;
    padding: 8px 12px !important;
  }

  html.android-webview.billing-keyboard-open .billing-lines-panel .cart-lines {
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 4px 8px 18px !important;
  }

  html.android-webview.billing-keyboard-searching .billing-lines-panel .cart-lines {
    max-height: 32dvh !important;
  }

  html.android-webview.billing-keyboard-open .billing-lines-panel .cart-actions,
  html.android-webview.billing-keyboard-open .billing-lines-panel .save-status:empty {
    display: none !important;
  }
}

/* Billing v20260719-10: mobile bill-line editor row balance. */
@media(max-width:760px) {
  html.android-webview .compact-line-grid,
  html.android-webview .compact-line-grid.has-free-qty,
  html.android-webview .compact-line-grid.has-scheme-discount,
  html.android-webview .compact-line-grid.has-free-qty.has-scheme-discount {
    display: grid !important;
    grid-template-columns: minmax(0, 1.45fr) minmax(74px, .56fr) minmax(112px, .9fr) !important;
    gap: 5px !important;
    align-items: end !important;
  }

  html.android-webview .compact-line-grid .lot-field {
    grid-column: 1 / 2 !important;
  }

  html.android-webview .compact-line-grid label:has([data-billing-field="qty"]) {
    grid-column: 2 / 3 !important;
  }

  html.android-webview .compact-line-grid label:has([data-billing-field="qtyUnit"]) {
    grid-column: 3 / 4 !important;
  }

  html.android-webview .compact-line-grid label:has([data-billing-field="rate"]),
  html.android-webview .compact-line-grid label:has([data-billing-field="mrp"]),
  html.android-webview .compact-line-grid label:has([data-billing-field="tradeDisc"]) {
    grid-row: 2 !important;
  }

  html.android-webview .compact-line-grid label:has([data-billing-field="rate"]) {
    grid-column: 1 / 2 !important;
  }

  html.android-webview .compact-line-grid label:has([data-billing-field="mrp"]) {
    grid-column: 2 / 3 !important;
  }

  html.android-webview .compact-line-grid label:has([data-billing-field="tradeDisc"]) {
    grid-column: 3 / 4 !important;
  }

  html.android-webview .compact-line-grid label:has([data-billing-field="freeQty"]),
  html.android-webview .compact-line-grid label:has([data-billing-field="schemeDisc"]) {
    grid-row: 3 !important;
  }

  html.android-webview .compact-line-grid label:has([data-billing-field="freeQty"]) {
    grid-column: 1 / 2 !important;
  }

  html.android-webview .compact-line-grid label:has([data-billing-field="schemeDisc"]) {
    grid-column: 2 / 3 !important;
  }

  html.android-webview .compact-line-grid label:has([data-billing-field="schemeDiscType"]) {
    grid-column: 1 / -1 !important;
    grid-row: 4 !important;
  }

  html.android-webview .compact-line-grid label {
    min-width: 0 !important;
    font-size: 10px !important;
    font-weight: 1000 !important;
    line-height: 1 !important;
  }

  html.android-webview .compact-line-grid input,
  html.android-webview .compact-line-grid select {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 36px !important;
    height: 36px !important;
    padding: 4px 7px !important;
    font-size: 17px !important;
    font-weight: 1000 !important;
    line-height: 1.05 !important;
  }

  html.android-webview .compact-line-grid label:has([data-billing-field="qty"]) input {
    font-size: 20px !important;
    padding: 3px 5px !important;
    text-align: center !important;
  }

  html.android-webview .compact-line-grid label:has([data-billing-field="qtyUnit"]) select {
    font-size: 15px !important;
    padding-left: 6px !important;
    padding-right: 22px !important;
  }

  html.android-webview .compact-line-grid .lot-field select {
    font-size: 15px !important;
    padding-left: 8px !important;
    padding-right: 24px !important;
  }

  html.android-webview .billing-line-tail .billing-line-foot {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: 5px !important;
    align-items: center !important;
    width: 100% !important;
  }

  html.android-webview .billing-modal-form .billing-line-foot .line-margin-indicator {
    grid-column: 1 / 2 !important;
    grid-row: 1 !important;
    max-width: 156px !important;
    min-width: 96px !important;
    padding: 4px 7px !important;
    font-size: 14px !important;
  }

  html.android-webview .billing-line-tail .billing-line-foot .line-composition {
    grid-column: 2 / 3 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html.android-webview .billing-line-tail .billing-line-foot .line-consumption {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
}

/* Billing v20260719-11: compact mobile bill-line controls. */
@media(max-width:760px) {
  html.android-webview .billing-modal-form .compact-line-grid,
  html.android-webview .billing-modal-form .compact-line-grid.has-free-qty,
  html.android-webview .billing-modal-form .compact-line-grid.has-scheme-discount,
  html.android-webview .billing-modal-form .compact-line-grid.has-free-qty.has-scheme-discount {
    display: grid !important;
    grid-template-columns: minmax(0, 1.35fr) minmax(90px, .55fr) minmax(120px, .82fr) !important;
    gap: 4px !important;
    align-items: end !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .lot-field {
    grid-column: 1 / 2 !important;
    grid-row: 1 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="qty"]) {
    grid-column: 2 / 3 !important;
    grid-row: 1 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="unit"]) {
    grid-column: 3 / 4 !important;
    grid-row: 1 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="rate"]) {
    grid-column: 1 / 2 !important;
    grid-row: 2 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="mrp"]) {
    grid-column: 2 / 3 !important;
    grid-row: 2 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="tradeDisc"]) {
    grid-column: 3 / 4 !important;
    grid-row: 2 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="freeQty"]),
  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="schemeDisc"]) {
    grid-row: 3 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="schemeDiscType"]) {
    grid-column: 1 / -1 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label {
    min-width: 0 !important;
    font-size: 9px !important;
    font-weight: 1000 !important;
    line-height: 1 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid input,
  html.android-webview .billing-modal-form .compact-line-grid select {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 34px !important;
    height: 34px !important;
    padding: 3px 7px !important;
    font-size: 17px !important;
    font-weight: 1000 !important;
    line-height: 1.05 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .lot-field select {
    font-size: 15px !important;
    padding-left: 8px !important;
    padding-right: 24px !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="qty"]) input {
    min-height: 38px !important;
    height: 38px !important;
    padding: 2px 5px !important;
    font-size: 22px !important;
    text-align: center !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="unit"]) select {
    font-size: 15px !important;
    padding-left: 6px !important;
    padding-right: 22px !important;
  }

  html.android-webview .billing-line-tail {
    display: grid !important;
    grid-template-columns: minmax(74px, 92px) minmax(0, 1fr) !important;
    gap: 5px !important;
    align-items: center !important;
    margin-top: 4px !important;
  }

  html.android-webview .billing-line-tail .billing-line-foot {
    display: block !important;
    min-width: 0 !important;
    width: auto !important;
  }

  html.android-webview .billing-line-tail .line-consumption,
  html.android-webview .billing-line-tail .line-composition {
    display: none !important;
  }

  html.android-webview .billing-modal-form .billing-line-foot .line-margin-indicator {
    max-width: 92px !important;
    min-width: 74px !important;
    width: 100% !important;
    padding: 6px 7px !important;
    font-size: 14px !important;
    line-height: 1 !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  html.android-webview .billing-line-options {
    display: flex !important;
    grid-column: 2 / 3 !important;
    justify-content: flex-end !important;
    gap: 5px !important;
    min-width: 0 !important;
  }

  html.android-webview .billing-line-options .row-action {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    border-radius: 999px !important;
    font-size: 17px !important;
    font-weight: 1000 !important;
    line-height: 1 !important;
    text-align: center !important;
  }
}

/* Billing v20260719-12: shorter mobile bill lines with lot details in selector. */
@media(max-width:760px) {
  html.android-webview .billing-modal-form .billing-line-heading .billing-line-facts .fact-batch,
  html.android-webview .billing-modal-form .billing-line-heading .billing-line-facts .fact-expiry {
    display: none !important;
  }

  html.android-webview .billing-modal-form .billing-line-heading .billing-line-facts {
    display: grid !important;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr) !important;
    gap: 4px !important;
    margin-top: 3px !important;
  }

  html.android-webview .billing-modal-form .billing-line-heading .billing-line-facts .fact-shelf,
  html.android-webview .billing-modal-form .billing-line-heading .billing-line-facts .fact-stock {
    min-width: 0 !important;
    width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid,
  html.android-webview .billing-modal-form .compact-line-grid.has-free-qty,
  html.android-webview .billing-modal-form .compact-line-grid.has-scheme-discount,
  html.android-webview .billing-modal-form .compact-line-grid.has-free-qty.has-scheme-discount {
    grid-template-columns: minmax(0, 1fr) 58px minmax(86px, .38fr) !important;
    gap: 3px !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="qty"]) {
    max-width: 58px !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="qty"]) input {
    min-height: 34px !important;
    height: 34px !important;
    padding: 1px 3px !important;
    font-size: 18px !important;
    border-width: 2px !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="unit"]) select {
    font-size: 13px !important;
    padding-left: 5px !important;
    padding-right: 18px !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .lot-field select {
    font-size: 14px !important;
    padding-left: 7px !important;
    padding-right: 20px !important;
  }

  html.android-webview .billing-line-tail {
    grid-template-columns: minmax(78px, 92px) minmax(0, 1fr) !important;
    margin-top: 3px !important;
  }

  html.android-webview .billing-line-options .row-action {
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    font-size: 15px !important;
  }
}

/* Billing v20260719-13: align mobile qty control and tighten bill-line rows. */
@media(max-width:760px) {
  html.android-webview .billing-modal-form .billing-lines-panel .billing-line {
    gap: 2px !important;
    padding: 5px 6px !important;
  }

  html.android-webview .billing-modal-form .billing-line-heading {
    gap: 3px !important;
  }

  html.android-webview .billing-modal-form .billing-line-heading .billing-line-facts {
    gap: 3px !important;
    margin-top: 1px !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid,
  html.android-webview .billing-modal-form .compact-line-grid.has-free-qty,
  html.android-webview .billing-modal-form .compact-line-grid.has-scheme-discount,
  html.android-webview .billing-modal-form .compact-line-grid.has-free-qty.has-scheme-discount {
    grid-template-columns: minmax(0, 1fr) 50px minmax(82px, .42fr) !important;
    column-gap: 3px !important;
    row-gap: 1px !important;
    align-items: end !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label {
    gap: 0 !important;
    line-height: .95 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid input,
  html.android-webview .billing-modal-form .compact-line-grid select,
  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="qty"]) input {
    min-height: 31px !important;
    height: 31px !important;
    max-height: 31px !important;
    padding-top: 1px !important;
    padding-bottom: 1px !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="qty"]) {
    max-width: 50px !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="qty"]) input {
    width: 50px !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
    font-size: 17px !important;
    border-width: 2px !important;
    text-align: center !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .lot-field select {
    font-size: 13px !important;
    padding-left: 6px !important;
    padding-right: 18px !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="unit"]) select,
  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="rate"]) input,
  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="mrp"]) input,
  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="tradeDisc"]) input {
    font-size: 14px !important;
  }

  html.android-webview .billing-line-tail {
    gap: 3px !important;
    margin-top: 1px !important;
  }

  html.android-webview .billing-modal-form .billing-line-foot .line-margin-indicator {
    padding: 5px 6px !important;
    font-size: 13px !important;
  }

  html.android-webview .billing-line-options {
    gap: 4px !important;
  }

  html.android-webview .billing-line-options .row-action {
    width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    font-size: 14px !important;
  }
}

/* Billing v20260719-14: level lot, qty and unit as one compact mobile row. */
@media(max-width:760px) {
  html.android-webview .billing-modal-form .compact-line-grid,
  html.android-webview .billing-modal-form .compact-line-grid.has-free-qty,
  html.android-webview .billing-modal-form .compact-line-grid.has-scheme-discount,
  html.android-webview .billing-modal-form .compact-line-grid.has-free-qty.has-scheme-discount {
    grid-template-columns: minmax(0, 1fr) 46px minmax(86px, .42fr) !important;
    column-gap: 4px !important;
    row-gap: 1px !important;
    align-items: end !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .lot-field,
  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="qty"]),
  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="unit"]) {
    font-size: 0 !important;
    line-height: 0 !important;
    gap: 0 !important;
    min-height: 32px !important;
    align-self: end !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .lot-field {
    grid-column: 1 / 2 !important;
    grid-row: 1 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="qty"]) {
    grid-column: 2 / 3 !important;
    grid-row: 1 !important;
    width: 46px !important;
    max-width: 46px !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="unit"]) {
    grid-column: 3 / 4 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .lot-field select,
  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="qty"]) input,
  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="unit"]) select {
    display: block !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    margin: 0 !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="qty"]) input {
    width: 46px !important;
    padding: 0 2px !important;
    font-size: 18px !important;
    border-width: 2px !important;
    border-radius: 8px !important;
    text-align: center !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .lot-field select {
    font-size: 14px !important;
    padding: 0 18px 0 7px !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="unit"]) select {
    font-size: 14px !important;
    padding: 0 17px 0 5px !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="rate"]),
  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="mrp"]),
  html.android-webview .billing-modal-form .compact-line-grid label:has([data-billing-field="tradeDisc"]) {
    margin-top: 0 !important;
  }
}

/* Billing v20260719-15: class-based mobile bill-line alignment for Android WebView. */
@media(max-width:760px) {
  html.android-webview .billing-modal-form .compact-line-grid,
  html.android-webview .billing-modal-form .compact-line-grid.has-free-qty,
  html.android-webview .billing-modal-form .compact-line-grid.has-scheme-discount,
  html.android-webview .billing-modal-form .compact-line-grid.has-free-qty.has-scheme-discount {
    grid-template-columns: minmax(0, 1fr) 48px minmax(82px, .42fr) !important;
    grid-auto-rows: min-content !important;
    column-gap: 4px !important;
    row-gap: 2px !important;
    align-items: end !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .billing-field-lot {
    grid-column: 1 / 2 !important;
    grid-row: 1 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .billing-field-qty {
    grid-column: 2 / 3 !important;
    grid-row: 1 !important;
    width: 48px !important;
    max-width: 48px !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .billing-field-unit {
    grid-column: 3 / 4 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .billing-field-rate {
    grid-column: 1 / 2 !important;
    grid-row: 2 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .billing-field-mrp {
    grid-column: 2 / 3 !important;
    grid-row: 2 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .billing-field-trade {
    grid-column: 3 / 4 !important;
    grid-row: 2 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .billing-field-lot,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-qty,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-unit {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    gap: 0 !important;
    margin: 0 !important;
    min-height: 32px !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .billing-field-rate,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-mrp,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-trade {
    gap: 1px !important;
    margin: 0 !important;
    line-height: .9 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .billing-field-lot select,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-qty input,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-unit select {
    display: block !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .billing-field-qty input {
    width: 48px !important;
    padding: 0 2px !important;
    font-size: 18px !important;
    border-width: 2px !important;
    border-radius: 8px !important;
    text-align: center !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .billing-field-lot select {
    font-size: 13.5px !important;
    padding: 0 16px 0 6px !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .billing-field-unit select {
    font-size: 13.5px !important;
    padding: 0 16px 0 5px !important;
  }

  html.android-webview .billing-modal-form .compact-line-grid .billing-field-rate input,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-mrp input,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-trade input {
    height: 31px !important;
    min-height: 31px !important;
    font-size: 14px !important;
    padding: 0 6px !important;
  }
}

/* Billing v20260719-19: compact, non-overlapping mobile bill-line editor. */
@media(max-width:760px) {
  .billing-modal-form .billing-lines-panel .billing-line,
  html.android-webview .billing-modal-form .billing-lines-panel .billing-line {
    padding: 5px 6px !important;
    gap: 3px !important;
    border-radius: 12px !important;
  }

  .billing-modal-form .billing-line-heading,
  html.android-webview .billing-modal-form .billing-line-heading {
    gap: 3px !important;
  }

  .billing-modal-form .billing-line-facts,
  html.android-webview .billing-modal-form .billing-line-facts {
    gap: 3px !important;
    margin-top: 2px !important;
  }

  .billing-modal-form .billing-line-facts .line-fact,
  html.android-webview .billing-modal-form .billing-line-facts .line-fact {
    padding: 2px 5px !important;
    line-height: 1.05 !important;
  }

  .billing-modal-form .compact-line-grid,
  .billing-modal-form .compact-line-grid.has-free-qty,
  .billing-modal-form .compact-line-grid.has-scheme-discount,
  .billing-modal-form .compact-line-grid.has-free-qty.has-scheme-discount,
  html.android-webview .billing-modal-form .compact-line-grid,
  html.android-webview .billing-modal-form .compact-line-grid.has-free-qty,
  html.android-webview .billing-modal-form .compact-line-grid.has-scheme-discount,
  html.android-webview .billing-modal-form .compact-line-grid.has-free-qty.has-scheme-discount {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 48px minmax(98px, .46fr) !important;
    grid-template-rows: 32px 42px !important;
    grid-auto-rows: 42px !important;
    column-gap: 4px !important;
    row-gap: 2px !important;
    align-items: stretch !important;
    overflow: visible !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-lot,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-lot {
    grid-column: 1 / 2 !important;
    grid-row: 1 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-qty,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-qty {
    grid-column: 2 / 3 !important;
    grid-row: 1 !important;
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-unit,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-unit {
    grid-column: 3 / 4 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-lot,
  .billing-modal-form .compact-line-grid .billing-field-qty,
  .billing-modal-form .compact-line-grid .billing-field-unit,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-lot,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-qty,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-unit {
    display: block !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    overflow: visible !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-lot select,
  .billing-modal-form .compact-line-grid .billing-field-qty input,
  .billing-modal-form .compact-line-grid .billing-field-unit select,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-lot select,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-qty input,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-unit select {
    display: block !important;
    width: 100% !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
    transform: none !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-qty input,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-qty input {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    padding-left: 1px !important;
    padding-right: 1px !important;
    font-size: 18px !important;
    font-weight: 950 !important;
    border-width: 2px !important;
    border-radius: 8px !important;
    text-align: center !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-lot select,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-lot select {
    font-size: 14px !important;
    padding-left: 6px !important;
    padding-right: 14px !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-unit select,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-unit select {
    font-size: 13.5px !important;
    padding-left: 6px !important;
    padding-right: 12px !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-rate,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-rate {
    grid-column: 1 / 2 !important;
    grid-row: 2 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-mrp,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-mrp {
    grid-column: 2 / 3 !important;
    grid-row: 2 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-trade,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-trade {
    grid-column: 3 / 4 !important;
    grid-row: 2 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-rate,
  .billing-modal-form .compact-line-grid .billing-field-mrp,
  .billing-modal-form .compact-line-grid .billing-field-trade,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-rate,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-mrp,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-trade {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    gap: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #111 !important;
    font-size: 10px !important;
    font-weight: 850 !important;
    line-height: 10px !important;
    overflow: hidden !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-rate input,
  .billing-modal-form .compact-line-grid .billing-field-mrp input,
  .billing-modal-form .compact-line-grid .billing-field-trade input,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-rate input,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-mrp input,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-trade input {
    display: block !important;
    width: 100% !important;
    height: 31px !important;
    min-height: 31px !important;
    max-height: 31px !important;
    margin: 0 !important;
    padding: 0 7px !important;
    box-sizing: border-box !important;
    font-size: 15px !important;
    font-weight: 850 !important;
    line-height: 1 !important;
  }

  .billing-modal-form .compact-line-grid .billing-field-mrp input,
  html.android-webview .billing-modal-form .compact-line-grid .billing-field-mrp input {
    padding-left: 4px !important;
    padding-right: 4px !important;
    text-align: center !important;
  }

  .billing-modal-form .billing-line-tail,
  html.android-webview .billing-modal-form .billing-line-tail {
    gap: 3px !important;
    margin-top: 0 !important;
  }

  .billing-modal-form .billing-line-foot,
  html.android-webview .billing-modal-form .billing-line-foot {
    gap: 4px !important;
  }

  .billing-modal-form .billing-line-foot .line-margin-indicator,
  html.android-webview .billing-modal-form .billing-line-foot .line-margin-indicator {
    min-width: 112px !important;
    max-width: 122px !important;
    height: 31px !important;
    min-height: 31px !important;
    padding: 3px 7px !important;
    font-size: 13px !important;
  }

  .billing-modal-form .billing-line-options,
  html.android-webview .billing-modal-form .billing-line-options {
    gap: 4px !important;
  }

  .billing-modal-form .billing-line-options .row-action,
  html.android-webview .billing-modal-form .billing-line-options .row-action {
    width: 31px !important;
    min-width: 31px !important;
    height: 31px !important;
    min-height: 31px !important;
    font-size: 13px !important;
  }
}

/* Billing v20260720-1: expose mobile series and card/UPI account picker. */
@media(max-width:760px) {
  html.android-webview .billing-head-context {
    display: block !important;
    grid-column: 1 / -1 !important;
    grid-row: 5 !important;
    width: 100% !important;
    padding: 0 !important;
  }

  html.android-webview .billing-head-context .billing-control-grid {
    display: grid !important;
    grid-template-columns: minmax(84px, .72fr) minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 5px !important;
    width: 100% !important;
  }

  html.android-webview .billing-head-context .billing-control-grid label {
    display: block !important;
    min-width: 0 !important;
    font-size: 0 !important;
  }

  html.android-webview .billing-head-context .billing-control-grid label:nth-child(2),
  html.android-webview .billing-head-context .billing-control-grid label:has(#billingPayment) {
    display: none !important;
  }

  html.android-webview .billing-head-context .billing-control-grid label:nth-child(1) {
    display: block !important;
  }

  html.android-webview .billing-head-context .billing-control-grid select,
  html.android-webview .billing-head-context .billing-control-grid input {
    display: block !important;
    width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    border-radius: 11px !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
    font-weight: 850 !important;
    background: #fff !important;
    min-width: 0 !important;
  }

  html.android-webview #billingSeries {
    background: #fff8d8 !important;
    border-color: #e2bf44 !important;
  }

  html.android-webview .billing-head-payment>label {
    display: none !important;
  }
}

/* Billing v20260720-2: inline mobile Card / UPI selector, no popup. */
@media(max-width:760px) {
  html.android-webview .billing-head-payment {
    align-items: center !important;
  }

  html.android-webview .billing-head-payment:has(#billingCardAccount) {
    display: grid !important;
    grid-template-columns: auto minmax(96px, 1fr) !important;
    gap: 5px !important;
    overflow: visible !important;
  }

  html.android-webview .billing-head-payment:has(#billingCardAccount) .payment-options {
    min-width: 0 !important;
    overflow-x: auto !important;
  }

  html.android-webview .billing-head-payment>label:has(#billingCardAccount) {
    display: block !important;
    min-width: 96px !important;
    max-width: 128px !important;
    margin: 0 !important;
    font-size: 0 !important;
  }

  html.android-webview #billingCardAccount {
    display: block !important;
    width: 100% !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    border-radius: 999px !important;
    padding: 5px 9px !important;
    font-size: 11px !important;
    font-weight: 950 !important;
    background: #dff5e7 !important;
    border-color: #48a970 !important;
  }
}

/* Billing v20260721-2: mobile browser parity with app view, plus tablet rotation support. */
@media(max-width:760px) {
  html.mobile-browser-billing body.modal-open {
    overflow: hidden !important;
  }

  html.mobile-browser-billing .modal-shell:not(.hidden) {
    align-items: stretch !important;
    padding: 0 !important;
  }

  html.mobile-browser-billing .modal:has(.billing-modal-form) {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
  }

  html.mobile-browser-billing .modal:has(.billing-modal-form) .modal-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 7px !important;
    padding: calc(7px + env(safe-area-inset-top)) 8px 7px !important;
    align-items: center !important;
  }

  html.mobile-browser-billing .modal:has(.billing-modal-form) .modal-head h3,
  html.mobile-browser-billing .modal:has(.billing-modal-form) .modal-back-btn {
    display: none !important;
  }

  html.mobile-browser-billing .modal:has(.billing-modal-form) .modal-close {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    grid-column: 2 !important;
    grid-row: 1 !important;
  }

  html.mobile-browser-billing .modal-head-tools {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 6px !important;
    align-items: center !important;
    justify-content: stretch !important;
    width: 100% !important;
  }

  html.mobile-browser-billing .billing-workspace-tabs {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 4px !important;
    padding: 4px !important;
    border-radius: 999px !important;
    background: #e9f2ee !important;
  }

  html.mobile-browser-billing .billing-workspace-tabs button {
    min-height: 34px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
  }

  html.mobile-browser-billing .billing-pending-row {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 5px !important;
  }

  html.mobile-browser-billing .pending-orders-btn {
    width: 100% !important;
    min-height: 38px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
  }

  html.mobile-browser-billing .billing-head-context {
    display: block !important;
    grid-column: 1 / -1 !important;
    width: 100% !important;
    padding: 0 !important;
  }

  html.mobile-browser-billing .billing-head-context .billing-control-grid {
    display: grid !important;
    grid-template-columns: minmax(86px, .75fr) minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 5px !important;
    width: 100% !important;
  }

  html.mobile-browser-billing .billing-head-context .billing-control-grid label {
    display: block !important;
    min-width: 0 !important;
    font-size: 0 !important;
  }

  html.mobile-browser-billing .billing-head-context .billing-control-grid label:nth-child(2),
  html.mobile-browser-billing .billing-head-context .billing-control-grid label:has(#billingPayment) {
    display: none !important;
  }

  html.mobile-browser-billing .billing-head-context .billing-control-grid select,
  html.mobile-browser-billing .billing-head-context .billing-control-grid input {
    width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    border-radius: 11px !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
    font-weight: 850 !important;
    background: #fff !important;
  }

  html.mobile-browser-billing #billingSeries {
    background: #fff8d8 !important;
    border-color: #e2bf44 !important;
  }

  html.mobile-browser-billing .billing-head-summary {
    grid-column: 2 !important;
    grid-row: 2 !important;
    min-width: 104px !important;
    align-items: flex-end !important;
  }

  html.mobile-browser-billing .billing-head-summary strong,
  html.mobile-browser-billing .billing-total-block>strong {
    font-size: 20px !important;
    background: #98131d !important;
    color: #fff !important;
  }

  html.mobile-browser-billing .billing-head-payment {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    overflow: hidden !important;
  }

  html.mobile-browser-billing .billing-head-payment .payment-options {
    min-width: 0 !important;
    overflow-x: auto !important;
  }

  html.mobile-browser-billing .billing-head-payment>label {
    display: none !important;
  }

  html.mobile-browser-billing .billing-head-payment:has(#billingCardAccount) {
    display: grid !important;
    grid-template-columns: auto minmax(96px, 1fr) !important;
  }

  html.mobile-browser-billing .billing-head-payment>label:has(#billingCardAccount) {
    display: block !important;
    min-width: 96px !important;
    max-width: 128px !important;
    margin: 0 !important;
    font-size: 0 !important;
  }

  html.mobile-browser-billing #billingCardAccount {
    width: 100% !important;
    height: 34px !important;
    min-height: 34px !important;
    border-radius: 999px !important;
    padding: 5px 9px !important;
    font-size: 11px !important;
    font-weight: 950 !important;
    background: #dff5e7 !important;
    border-color: #48a970 !important;
  }

  html.mobile-browser-billing .billing-head-totals,
  html.mobile-browser-billing .billing-customer-actions,
  html.mobile-browser-billing .billing-head-actions {
    grid-column: 1 / -1 !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  html.mobile-browser-billing .billing-head-totals .total-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  html.mobile-browser-billing .billing-customer-actions,
  html.mobile-browser-billing .billing-head-actions {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 5px !important;
  }

  html.mobile-browser-billing .billing-customer-actions button,
  html.mobile-browser-billing .billing-head-actions button {
    min-width: 0 !important;
    min-height: 34px !important;
    padding: 6px 5px !important;
    border-radius: 9px !important;
    font-size: 10px !important;
    white-space: nowrap !important;
  }

  html.mobile-browser-billing .billing-head-actions {
    grid-template-columns: .8fr 1fr 1fr !important;
  }

  html.mobile-browser-billing .modal:has(.billing-modal-form) .modal-body {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 0 8px calc(8px + env(safe-area-inset-bottom)) !important;
  }

  html.mobile-browser-billing .billing-modal-form {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(0, 1fr) !important;
    gap: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  html.mobile-browser-billing .billing-modal-form .hot-banners,
  html.mobile-browser-billing .billing-modal-form .sale-left,
  html.mobile-browser-billing .billing-money-panel {
    display: none !important;
  }

  html.mobile-browser-billing .billing-workspace {
    grid-column: 1 !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: 6px !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  html.mobile-browser-billing .billing-add-product {
    margin: 0 -8px 0 !important;
    padding: 6px 8px !important;
    border-radius: 0 0 12px 12px !important;
  }

  html.mobile-browser-billing .billing-add-product .panel-head {
    display: none !important;
  }

  html.mobile-browser-billing .billing-product-search {
    grid-template-columns: minmax(0, 1fr) 46px !important;
    gap: 6px !important;
  }

  html.mobile-browser-billing .billing-product-search.has-search-help {
    grid-template-columns: minmax(0, 1fr) 46px !important;
    overflow: visible !important;
  }

  html.mobile-browser-billing .billing-product-search.has-search-help .search-help-button {
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    align-self: center !important;
    position: relative !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    margin-right: 42px !important;
    width: 24px !important;
    min-width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    border: 1px solid #bfe4d9 !important;
    border-radius: 50% !important;
    background: #f7fffb !important;
    color: var(--green) !important;
    font-size: 15px !important;
    line-height: 1 !important;
    padding: 0 !important;
  }

  html.mobile-browser-billing .billing-product-search.has-search-help input {
    grid-column: 1 !important;
    grid-row: 1 !important;
    padding-right: 96px !important;
  }

  html.mobile-browser-billing .billing-product-search input,
  html.mobile-browser-billing .billing-product-search button {
    height: 44px !important;
    min-height: 44px !important;
    border-radius: 12px !important;
  }

  html.mobile-browser-billing .billing-add-product .lookup-results {
    max-height: 30dvh !important;
    overflow: auto !important;
    margin-top: 6px !important;
  }

  html.mobile-browser-billing .billing-lines-panel {
    min-height: 0 !important;
    overflow: hidden !important;
    border-radius: 12px !important;
  }

  html.mobile-browser-billing .billing-lines-panel .panel-head {
    padding: 8px 10px !important;
  }

  html.mobile-browser-billing .billing-lines-panel .cart-lines {
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: auto !important;
    padding: 4px 6px 12px !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

@media(min-width:761px) and (max-width:1180px) {
  html.tablet-browser .modal:has(.billing-modal-form) {
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
  }

  html.tablet-browser .modal:has(.billing-modal-form) .modal-body {
    height: calc(100dvh - 74px) !important;
    overflow: hidden !important;
    padding: 10px !important;
  }

  html.tablet-browser .billing-modal-form {
    display: grid !important;
    grid-template-columns: minmax(270px, .78fr) minmax(0, 1.72fr) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
    gap: 9px !important;
  }

  html.tablet-browser.touch-portrait .billing-modal-form {
    grid-template-columns: minmax(230px, .62fr) minmax(0, 1.38fr) !important;
  }

  html.tablet-browser .billing-modal-form .hot-banners {
    grid-column: 1 / -1 !important;
    position: relative !important;
  }

  html.tablet-browser .billing-modal-form .sale-left,
  html.tablet-browser .billing-workspace {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  html.tablet-browser .billing-workspace {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    max-height: none !important;
    position: static !important;
  }

  html.tablet-browser .billing-lines-panel .cart-lines {
    min-height: 0 !important;
    max-height: none !important;
    overflow: auto !important;
  }

  html.tablet-browser.touch-landscape .billing-modal-form {
    grid-template-columns: minmax(320px, .86fr) minmax(0, 2fr) !important;
  }

  html.tablet-browser.touch-landscape .billing-head-totals {
    min-width: 250px !important;
  }

  html.tablet-browser.touch-portrait .billing-head-totals {
    display: none !important;
  }
}

.billing-card-account-picker {
  display: grid;
  gap: 8px;
}

.billing-card-account-picker button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 13px 14px;
  text-align: left;
  color: var(--ink);
}

.billing-card-account-picker button.active {
  background: #dff5e7;
  border-color: #48a970;
}

.billing-card-account-picker strong,
.billing-card-account-picker span {
  display: block;
}

.billing-card-account-picker span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

/* Billing v20260721-3: sales credit-note visibility and adjustment UI. */
.credit-note-attachment-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  padding: 7px 8px;
  border: 1px solid #ead69a;
  border-radius: 9px;
  background: #fff8dd;
  color: #5f460a;
}

.credit-note-attachment-strip strong {
  font-size: 11px;
}

.credit-note-attachment-strip .row-action {
  background: #fff;
  border-color: #e4c96d;
  color: #583d00;
}

.credit-note-desk .receipt-table td:last-child,
.credit-note-desk .receipt-table th:last-child {
  text-align: right;
}

.modal:has(.credit-note-history-modal) {
  width: calc(100vw - 28px);
  max-width: none;
  height: calc(100vh - 28px);
  max-height: none;
  border-radius: 14px;
}

.modal:has(.credit-note-history-modal) .modal-body {
  flex: 1 1 auto;
  height: auto;
  overflow: auto;
  padding: 14px;
  overscroll-behavior: contain;
}

.credit-note-history-modal {
  min-height: 100%;
}

.credit-note-history-list .credit-note-history-card {
  grid-template-columns: 1fr 1.35fr .35fr .55fr .55fr .62fr auto;
}

.credit-note-form {
  display: grid;
  gap: 12px;
}

.credit-note-modal-form {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.modal-head-tools:has(.credit-note-head-tools) {
  display: grid !important;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.modal:has(.credit-note-modal-form) .modal-head {
  display: grid !important;
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr) auto !important;
  grid-template-rows: auto !important;
  align-items: start !important;
  gap: 6px 10px !important;
  padding: 8px 12px !important;
  overflow: visible !important;
}

.modal:has(.credit-note-modal-form) .modal-head>h3 {
  grid-column: 1 !important;
  grid-row: 1 !important;
  padding-top: 7px;
  max-width: 255px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal:has(.credit-note-modal-form) .modal-head-tools {
  grid-column: 2 !important;
  grid-row: 1 !important;
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
}

.modal:has(.credit-note-modal-form) .modal-close {
  grid-column: 3 !important;
  grid-row: 1 !important;
  margin-top: 2px;
}

.credit-note-head-tools {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(250px, max-content) minmax(210px, 1fr);
  grid-template-areas:
    "customer payment totals"
    "controls controls controls";
  gap: 6px 8px;
  align-items: center;
  width: 100%;
  min-width: 0;
  overflow: visible;
}

.credit-note-head-tools .billing-header-customer {
  grid-area: customer;
  height: 36px;
  min-width: 170px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  border-color: #850b18;
  font-weight: 1000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credit-note-payment {
  grid-area: payment !important;
  justify-self: start;
  max-width: 100%;
}

.credit-note-payment .payment-options button {
  height: 27px;
  padding: 5px 9px;
}

.credit-note-payment>label {
  min-width: 118px;
}

.credit-note-top-controls {
  grid-area: controls;
  display: grid;
  grid-template-columns: minmax(190px, .78fr) minmax(320px, 1.25fr) minmax(190px, .8fr);
  gap: 5px;
  min-width: 0;
}

.credit-note-top-controls label {
  font-size: 0 !important;
  line-height: 1;
}

.credit-note-top-controls select,
.credit-note-top-controls input {
  width: 100%;
  height: 32px !important;
  min-height: 32px !important;
  padding: 4px 8px !important;
  font-size: 10px !important;
  font-weight: 850 !important;
}

.credit-note-header-totals {
  grid-area: totals;
  display: grid;
  grid-template-columns: repeat(4, minmax(54px, 1fr));
  gap: 4px;
  justify-self: end;
  min-width: min(100%, 260px);
}

.credit-note-header-totals .billing-mini-total {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 6px;
  line-height: 1;
  min-width: 0;
}

.credit-note-header-totals .billing-mini-total small {
  display: block;
  font-size: 7px !important;
  color: var(--muted) !important;
}

.credit-note-header-totals .billing-mini-total strong {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  white-space: nowrap;
}

@media(max-width:1250px) {
  .modal:has(.credit-note-modal-form) .modal-head {
    grid-template-columns: minmax(180px, auto) minmax(0, 1fr) auto !important;
  }
  .credit-note-head-tools {
    grid-template-columns: minmax(175px, 220px) minmax(220px, max-content) minmax(190px, 1fr);
  }
  .credit-note-top-controls {
    grid-template-columns: minmax(160px, .8fr) minmax(240px, 1.15fr) minmax(165px, .8fr);
  }
  .credit-note-header-totals {
    min-width: 218px;
  }
}

@media(max-width:760px) {
  .modal:has(.credit-note-modal-form) .modal-head {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }
  .modal:has(.credit-note-modal-form) .modal-head>h3 {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    max-width: none;
  }
  .modal:has(.credit-note-modal-form) .modal-close {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }
  .modal-head-tools:has(.credit-note-head-tools) {
    grid-column: 1 / -1 !important;
  }
  .modal:has(.credit-note-modal-form) .modal-head-tools {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
  }
  .credit-note-head-tools {
    grid-template-columns: 1fr;
    grid-template-areas:
      "customer"
      "payment"
      "controls"
      "totals";
  }
  .credit-note-payment {
    width: 100%;
    justify-self: stretch;
    overflow-x: auto;
  }
  .credit-note-top-controls {
    grid-template-columns: 1fr;
  }
  .credit-note-header-totals {
    justify-self: stretch;
    min-width: 0;
  }
}

.credit-note-head-grid {
  margin-bottom: 0;
}

.credit-note-head-grid .billing-grid {
  grid-template-columns: minmax(220px, .9fr) minmax(260px, 1.2fr) minmax(130px, .45fr) minmax(220px, .9fr);
  gap: 8px;
}

.credit-note-modal-form .sale-left {
  grid-column: 1;
  display: none !important;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .42fr);
  grid-template-areas: "head customer" "head totals";
  gap: 8px;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
  padding: 0 !important;
  border-right: 0 !important;
  background: transparent !important;
}

.credit-note-modal-form .credit-note-head-grid {
  grid-area: head;
}

.credit-note-modal-form .sale-left > .selection-card:nth-child(2) {
  grid-area: customer;
}

.credit-note-modal-form .credit-note-money-panel {
  grid-area: totals;
}

.credit-note-money-panel {
  gap: 8px;
}

.credit-note-total-strip {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.credit-note-total-strip strong {
  font-size: 14px;
}

.credit-note-workspace {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-rows: minmax(128px, 190px) minmax(0, 1fr);
  gap: 10px;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.credit-note-source-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.credit-note-source-panel .lookup-results {
  flex: 1 1 auto;
  max-height: 124px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.credit-note-workspace:has(.credit-note-create-line) {
  grid-template-rows: minmax(112px, 156px) minmax(0, 1fr);
}

.credit-note-workspace:has(.credit-note-create-line) .credit-note-source-panel .lookup-results {
  max-height: 92px;
}

.credit-note-form-columns {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
  gap: 12px;
}

.credit-note-source-row small {
  line-height: 1.25;
}

.credit-note-selected-panel {
  margin: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.credit-note-selected-panel .cart-lines {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.credit-note-create-line .compact-line-grid {
  grid-template-columns:minmax(210px,2fr) 62px 108px 72px 68px 66px 72px minmax(138px,1fr) !important;
  gap: 6px;
  align-items: end;
}

.credit-note-create-line {
  padding: 7px 10px !important;
  border-radius: 8px;
}

.credit-note-create-line .billing-line-heading {
  display: grid;
  grid-template-columns: minmax(220px,.7fr) minmax(320px,1.2fr) auto;
  gap: 8px;
  align-items: start;
  margin-bottom: 5px;
}

.credit-note-create-line .billing-line-title strong {
  font-size: 13px;
}

.credit-note-create-line .billing-line-tail {
  display: flex;
  align-items: center;
  gap: 6px;
}

.credit-note-create-line .billing-line-actions {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
}

.credit-note-create-line .billing-line-total,
.credit-note-create-line .line-amount {
  background: var(--red);
  color: #fff;
  border-radius: 8px;
  padding: 5px 9px;
  font-weight: 900;
  white-space: nowrap;
}

.credit-note-create-line .compact-line-grid label {
  font-size: 9px;
  font-weight: 800;
  color: var(--ink);
}

.credit-note-create-line .compact-line-grid input,
.credit-note-create-line .compact-line-grid select {
  min-height: 30px;
  padding: 5px 7px;
  font-size: 11px;
  border-radius: 7px;
}

.credit-note-create-line .compact-line-grid input:disabled {
  opacity:1;
  color:#111!important;
  background:#eef4f2!important;
}

.credit-note-create-line.line-invalid {
  border:2px solid #b41120!important;
}

.credit-note-create-line.line-invalid .billing-line-total {
  background:#b41120;
}

.credit-note-create-line label small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
  margin-top: 2px;
}

@media (max-width: 900px) {
  .credit-note-form-columns {
    grid-template-columns: 1fr;
  }
  .credit-note-history-list .credit-note-history-card {
    grid-template-columns: 1fr;
  }
  .credit-note-modal-form {
    grid-template-columns: 1fr;
  }
  .credit-note-head-tools {
    grid-template-columns: 1fr;
    grid-template-areas:
      "customer"
      "payment"
      "controls"
      "totals";
  }
  .credit-note-top-controls {
    grid-template-columns: 1fr 1fr;
  }
  .credit-note-header-totals {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .credit-note-head-grid .billing-grid {
    grid-template-columns: 1fr 1fr;
  }
  .credit-note-workspace {
    grid-template-rows: minmax(116px, 178px) minmax(0, 1fr);
  }
  .credit-note-create-line .compact-line-grid {
    grid-template-columns:1fr 74px 92px !important;
  }
  .credit-note-create-line .compact-line-grid .lot-field,
  .credit-note-create-line .compact-line-grid .billing-field-scheme-type {
    grid-column:1/-1;
  }
}

html.mobile-browser-billing .credit-note-modal-form {
  grid-template-rows: auto minmax(0, 1fr) !important;
  gap: 8px !important;
  overflow: auto !important;
}

html.mobile-browser-billing .credit-note-modal-form .billing-money-panel {
  display: grid !important;
}

html.mobile-browser-billing .credit-note-modal-form .sale-left {
  display: none !important;
}

html.mobile-browser-billing .credit-note-modal-form .billing-workspace {
  height: auto !important;
  min-height: 460px !important;
}

html.mobile-browser-billing .credit-note-modal-form .credit-note-head-grid .billing-grid {
  grid-template-columns: 1fr 1fr !important;
}

html.mobile-browser-billing .credit-note-head-tools {
  grid-template-columns: 1fr !important;
  grid-template-areas:
    "customer"
    "payment"
    "controls"
    "totals" !important;
  gap: 6px !important;
}

html.mobile-browser-billing .credit-note-top-controls {
  grid-template-columns: 1fr 1fr !important;
}

html.mobile-browser-billing .credit-note-header-totals {
  display: none !important;
}

html.mobile-browser-billing .credit-note-modal-form .credit-note-head-grid label:nth-child(4),
html.mobile-browser-billing .credit-note-modal-form .credit-note-head-grid label:nth-child(2) {
  grid-column: 1 / -1 !important;
}

html.mobile-browser-billing .credit-note-modal-form .lookup-results {
  max-height: 190px !important;
}

html.mobile-browser-billing .credit-note-create-line .compact-line-grid {
  grid-template-columns: 1fr 72px 90px !important;
  gap: 4px !important;
}

html.mobile-browser-billing .credit-note-create-line .compact-line-grid .lot-field,
html.mobile-browser-billing .credit-note-create-line .compact-line-grid .billing-field-scheme-type {
  grid-column: 1 / -1 !important;
}

html.mobile-browser-billing .credit-note-create-line .compact-line-grid input,
html.mobile-browser-billing .credit-note-create-line .compact-line-grid select {
  min-height: 28px !important;
  font-size: 10px !important;
  padding: 4px 5px !important;
}

html.tablet-browser .credit-note-modal-form .billing-money-panel {
  display: grid !important;
}

html.tablet-browser .credit-note-modal-form .sale-left {
  display: none !important;
}

html.tablet-browser .credit-note-modal-form .billing-workspace {
  grid-template-rows: minmax(170px, .36fr) minmax(0, 1fr) !important;
}

.alternative-options-panel {
  padding: 0 !important;
  overflow: hidden;
}

.alternative-sort-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.alternative-sort-bar span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.sort-chip {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.sort-chip.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.sort-chip.clear {
  color: var(--muted);
}

@media (max-width: 760px) {
  .alternative-sort-bar {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* Responsive shell v20260729-1: keep ERP pages stable across laptop, desktop and odd aspect-ratio monitors. */
@media (min-width: 761px) {
  :root {
    --sidebar-w: clamp(196px, 14.5vw, 236px);
    --screen-pad-x: clamp(16px, 1.8vw, 32px);
    --screen-pad-y: clamp(14px, 2vh, 28px);
  }

  .app {
    height: 100dvh;
    min-height: 0;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    overflow: hidden;
  }

  .sidebar {
    width: var(--sidebar-w);
    padding: clamp(16px, 2vh, 24px) 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .sidebar nav {
    gap: 3px;
    padding-top: clamp(14px, 2vh, 22px);
  }

  .sidebar nav a,
  .sidebar nav button {
    min-width: 0;
    padding: 9px 10px;
    font-size: 12px;
  }

  .app main {
    height: 100dvh;
    min-width: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .app header {
    position: relative;
    min-width: 0;
    height: auto;
    min-height: clamp(66px, 8vh, 82px);
    padding: 10px var(--screen-pad-x);
  }

  .content {
    width: 100%;
    max-width: min(100%, 1640px);
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: var(--screen-pad-y) var(--screen-pad-x) clamp(18px, 2.4vh, 34px);
  }

  .app-footer {
    flex: 0 0 auto;
    margin: 0 var(--screen-pad-x) 10px;
    padding: 9px 12px;
  }

  .header-summary {
    min-width: 0;
  }

  .header-target-summary .target-summary-inline {
    max-width: none;
    width: 100%;
  }

  .header-target-summary .target-summary-inline .target-flash,
  .target-summary-inline .target-flash {
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  }

  .header-target-summary .target-summary-inline .target-flash div,
  .target-summary-inline .target-flash div {
    min-width: 0;
    padding: 6px 8px;
  }

  .header-target-summary .target-summary-inline .target-flash strong,
  .target-summary-inline .target-flash strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-history-page {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .mobile-history-page > .panel.table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .mobile-history-page > .panel.table-wrap > .panel-head,
  .mobile-history-page > .panel.table-wrap > .compact-history-toolbar,
  .mobile-history-page > .panel.table-wrap > .billing-payment-summary {
    flex: 0 0 auto;
  }

  .mobile-history-page .bill-history-list,
  .mobile-history-page #todayBills,
  .mobile-history-page #billingOrders {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
  }

  .compact-history-toolbar {
    grid-template-columns: minmax(0, auto) minmax(320px, 1fr);
  }

  .compact-history-filters,
  .invoice-history-toolbar .compact-history-filters,
  .order-history-toolbar .compact-history-filters {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  }

  .compact-history-toolbar .history-actions {
    min-width: 0;
  }

  .compact-history-toolbar .history-actions button {
    min-width: 0;
    white-space: nowrap;
  }

  .payment-total-strip {
    grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  }

  .payment-total-strip div {
    min-width: 0;
    border-radius: 12px;
  }

  .payment-total-strip strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bill-history-card:not(.order-history-card) {
    grid-template-columns: minmax(116px, .85fr) minmax(190px, 1.35fr) minmax(46px, .25fr) minmax(118px, .72fr) minmax(98px, .58fr) minmax(142px, .86fr) minmax(112px, .6fr) minmax(196px, auto);
    min-width: 0;
  }

  .bill-history-card > div {
    min-width: 0;
  }

  .bill-history-card strong,
  .bill-history-card small {
    overflow-wrap: anywhere;
  }

  .bill-history-card .history-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .bill-history-card .history-actions .row-action {
    min-height: 27px;
    white-space: nowrap;
  }
}

@media (min-width: 761px) and (max-width: 1380px) {
  .app header {
    gap: 10px;
  }

  #pageTitle {
    flex-basis: 150px;
    min-width: 150px;
  }

  .header-target-summary .source-pill {
    display: none;
  }

  .header-target-summary .target-summary-inline .target-flash {
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  }

  .bill-history-card:not(.order-history-card) {
    grid-template-columns: minmax(124px, .85fr) minmax(190px, 1.25fr) minmax(44px, .22fr) minmax(122px, .7fr) minmax(104px, .58fr) minmax(150px, .8fr);
  }

  .bill-history-card:not(.order-history-card) > div:nth-child(7) {
    grid-column: 1 / 3;
  }

  .bill-history-card:not(.order-history-card) > div:nth-child(8) {
    grid-column: 3 / -1;
  }
}

@media (min-width: 761px) and (max-width: 1060px) {
  .app {
    grid-template-columns: 188px minmax(0, 1fr);
  }

  .sidebar {
    width: 188px;
  }

  .consultancy-sidebar-brand > span,
  .consultancy-credit small,
  .app-footer span {
    font-size: 9px;
  }

  .compact-history-toolbar {
    grid-template-columns: 1fr;
  }

  .compact-history-toolbar .history-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    white-space: normal;
  }

  .bill-history-card:not(.order-history-card) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .bill-history-card:not(.order-history-card) > div:nth-child(n) {
    grid-column: auto;
  }

  .bill-history-card:not(.order-history-card) > div:nth-child(6),
  .bill-history-card:not(.order-history-card) > div:nth-child(8) {
    grid-column: 1 / -1;
  }

  .bill-history-card:not(.order-history-card) > div:nth-child(8) .history-actions {
    justify-content: flex-start;
  }
}

@media (min-width: 761px) and (max-height: 760px) {
  .app header {
    min-height: 62px;
  }

  .content {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .panel-head {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .bill-history-list {
    gap: 7px;
    padding: 9px;
  }

  .bill-history-card {
    padding: 9px;
  }
}

/* Mobile browser v20260729-1: allow full billing scroll and an opt-in desktop workspace. */
.browser-desktop-toggle {
  display: none !important;
}

@media (max-width: 760px) {
  html.mobile-browser-billing .browser-desktop-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 11px;
    font-weight: 950;
  }

  html.mobile-browser-billing body.modal-open {
    height: 100dvh !important;
    overflow: hidden !important;
  }

  html.mobile-browser-billing .modal-shell:not(.hidden) {
    position: fixed !important;
    inset: 0 !important;
    display: block !important;
    overflow: hidden !important;
    padding: 0 !important;
  }

  html.mobile-browser-billing .modal:has(.billing-modal-form) {
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border-radius: 0 !important;
  }

  html.mobile-browser-billing .modal:has(.billing-modal-form) .modal-head {
    position: sticky !important;
    top: 0 !important;
    flex: 0 0 auto !important;
    z-index: 70 !important;
    background: #fff !important;
  }

  html.mobile-browser-billing .modal:has(.billing-modal-form) .modal-body {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    padding: 8px 8px calc(18px + env(safe-area-inset-bottom)) !important;
  }

  html.mobile-browser-billing .billing-modal-form,
  html.mobile-browser-billing .billing-workspace,
  html.mobile-browser-billing .billing-lines-panel {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  html.mobile-browser-billing .billing-modal-form {
    display: block !important;
  }

  html.mobile-browser-billing .billing-workspace {
    display: grid !important;
    grid-template-rows: auto auto !important;
  }

  html.mobile-browser-billing .billing-add-product {
    position: sticky !important;
    top: 0 !important;
    z-index: 20 !important;
  }

  html.mobile-browser-billing .billing-lines-panel .cart-lines {
    height: auto !important;
    min-height: 38dvh !important;
    max-height: none !important;
    overflow: visible !important;
  }

  html.mobile-browser-billing .billing-head-actions {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 65 !important;
    background: rgba(255,255,255,.96) !important;
    padding-bottom: calc(6px + env(safe-area-inset-bottom)) !important;
  }

  html.erp-desktop-mode body.modal-open {
    overflow: auto !important;
  }

  html.erp-desktop-mode .modal-shell:not(.hidden) {
    align-items: start !important;
    overflow: auto !important;
    padding: 10px !important;
  }

  html.erp-desktop-mode .modal:has(.billing-modal-form) {
    width: max(1180px, 100vw) !important;
    max-width: none !important;
    height: auto !important;
    min-height: 760px !important;
    max-height: none !important;
    border-radius: 12px !important;
    overflow: visible !important;
  }

  html.erp-desktop-mode .modal:has(.billing-modal-form) .modal-body {
    height: auto !important;
    min-height: 680px !important;
    overflow: visible !important;
  }

  html.erp-desktop-mode .browser-desktop-toggle {
    display: inline-flex !important;
  }
}

/* Layout correction v20260729-3: normal scroll + Mac-style dense desktop billing. */
@media (min-width: 761px) {
  html,
  body {
    height: auto !important;
    min-height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .app {
    min-height: 100vh !important;
    height: auto !important;
    overflow: visible !important;
  }

  .app main {
    min-height: 100vh !important;
    height: auto !important;
    display: block !important;
    overflow: visible !important;
  }

  .app header {
    position: sticky !important;
    top: 0 !important;
    min-height: 78px !important;
  }

  .content {
    overflow: visible !important;
    max-width: min(100%, 1640px) !important;
    padding-bottom: 22px !important;
  }

  .app-footer {
    position: static !important;
    margin-bottom: 12px !important;
  }

  .mobile-history-page,
  .mobile-history-page > .panel.table-wrap {
    display: block !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .mobile-history-page .bill-history-list,
  .mobile-history-page #todayBills,
  .mobile-history-page #billingOrders {
    min-height: 0 !important;
    overflow: visible !important;
  }

  .header-target-summary .target-summary-inline {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: thin;
  }

  .header-target-summary .target-summary-inline .target-flash,
  .target-summary-inline .target-flash {
    display: grid !important;
    grid-template-columns: repeat(9, minmax(112px, 1fr)) !important;
    min-width: 1120px !important;
  }

  .content > .panel.table-wrap {
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
  }

  .compact-history-toolbar,
  .billing-payment-summary,
  .bill-history-list {
    min-width: 1180px !important;
  }

  .compact-history-toolbar {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }

  .invoice-history-toolbar .compact-history-filters {
    grid-template-columns: 128px 128px minmax(170px,1fr) minmax(190px,1.1fr) minmax(160px,.8fr) minmax(190px,1fr) !important;
  }

  .payment-total-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  .bill-history-card:not(.order-history-card) {
    grid-template-columns: minmax(132px,.82fr) minmax(250px,1.35fr) minmax(56px,.25fr) minmax(150px,.72fr) minmax(120px,.55fr) minmax(168px,.72fr) minmax(124px,.58fr) minmax(232px,auto) !important;
    gap: 12px !important;
    min-width: 1160px !important;
    align-items: center !important;
  }

  .bill-history-card:not(.order-history-card) > div:nth-child(n) {
    grid-column: auto !important;
  }

  .bill-history-card .history-actions {
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 760px) {
  html.mobile-browser-billing .global-desktop-toggle,
  html.erp-desktop-mode .global-desktop-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 72px;
    height: 39px;
    padding: 8px 11px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 900;
  }

  html.erp-desktop-mode,
  html.erp-desktop-mode body {
    min-width: 1280px !important;
    overflow: auto !important;
  }

  html.erp-desktop-mode .app {
    display: grid !important;
    grid-template-columns: 236px minmax(1040px, 1fr) !important;
    min-height: 100vh !important;
    height: auto !important;
    overflow: visible !important;
  }

  html.erp-desktop-mode .sidebar {
    transform: none !important;
    position: fixed !important;
    width: 236px !important;
  }

  html.erp-desktop-mode .app main {
    grid-column: 2 !important;
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }

  html.erp-desktop-mode .menu-btn {
    display: none !important;
  }

  html.erp-desktop-mode .header-summary {
    display: flex !important;
  }

  html.mobile-browser-billing .modal:has(.billing-modal-form) .modal-body {
    overflow-y: scroll !important;
  }
}

/* Browser native responsive mode v20260729-4: no custom desktop toggle, fit Windows desktop width. */
.browser-desktop-toggle {
  display: none !important;
}

html.erp-desktop-mode,
html.erp-desktop-mode body {
  min-width: 0 !important;
  overflow-x: hidden !important;
}

@media (min-width: 761px) {
  .header-target-summary .target-summary-inline {
    overflow-x: hidden !important;
  }

  .header-target-summary .target-summary-inline .target-flash,
  .target-summary-inline .target-flash {
    grid-template-columns: repeat(9, minmax(84px, 1fr)) !important;
    gap: 4px !important;
    min-width: 0 !important;
  }

  .target-summary-inline .target-flash div {
    padding: 5px 7px !important;
    min-width: 0 !important;
  }

  .target-summary-inline .target-flash small {
    font-size: 7px !important;
  }

  .target-summary-inline .target-flash strong {
    font-size: 10px !important;
    line-height: 1.15 !important;
  }

  .content > .panel.table-wrap {
    overflow-x: hidden !important;
  }

  .compact-history-toolbar,
  .billing-payment-summary,
  .bill-history-list {
    min-width: 0 !important;
  }

  .invoice-history-toolbar .compact-history-filters {
    grid-template-columns: minmax(118px,.72fr) minmax(118px,.72fr) minmax(152px,1fr) minmax(158px,1fr) minmax(142px,.82fr) minmax(152px,.9fr) !important;
    gap: 8px !important;
  }

  .payment-total-strip {
    gap: 8px !important;
  }

  .payment-total-strip .payment-total-card {
    padding: 8px 10px !important;
    min-width: 0 !important;
  }

  .payment-total-strip .payment-total-card strong {
    font-size: 17px !important;
  }

  .bill-history-card:not(.order-history-card) {
    grid-template-columns: minmax(94px,.74fr) minmax(206px,1.44fr) minmax(38px,.25fr) minmax(112px,.74fr) minmax(86px,.58fr) minmax(138px,.84fr) minmax(104px,.66fr) minmax(172px,auto) !important;
    gap: 8px !important;
    min-width: 0 !important;
    padding: 10px !important;
  }

  .bill-history-card .history-actions {
    flex-wrap: wrap !important;
    gap: 4px !important;
    justify-content: flex-end !important;
    white-space: normal !important;
  }

  .bill-history-card .history-actions .row-action {
    font-size: 9px !important;
    min-height: 26px !important;
    padding: 5px 7px !important;
  }

  .bill-split {
    padding: 7px 8px !important;
  }

  .bill-split .bill-split-row {
    gap: 5px !important;
  }

  .bill-history-card h3 {
    font-size: 17px !important;
    line-height: 1.15 !important;
  }
}

@media (max-width: 760px) {
  html.erp-desktop-mode .app {
    display: block !important;
    min-width: 0 !important;
  }

  html.erp-desktop-mode .sidebar {
    position: fixed !important;
    width: min(84vw, 300px) !important;
    transform: translateX(-100%) !important;
  }

  html.erp-desktop-mode .sidebar.open {
    transform: translateX(0) !important;
  }

  html.erp-desktop-mode .app main {
    display: block !important;
    min-width: 0 !important;
  }

  html.erp-desktop-mode .menu-btn {
    display: inline-flex !important;
  }

  html.erp-desktop-mode .header-summary {
    display: none !important;
  }
}

/* Desktop bill-row density v20260729-5: keep medium monitors compact by truncating, not wrapping. */
@media (min-width: 761px) {
  .bill-history-card:not(.order-history-card) {
    align-items: center !important;
  }

  .bill-history-card:not(.order-history-card) > div {
    min-width: 0 !important;
  }

  .bill-history-card:not(.order-history-card) strong,
  .bill-history-card:not(.order-history-card) small {
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .bill-history-card:not(.order-history-card) h3,
  .bill-history-card:not(.order-history-card) > div:nth-child(2) strong,
  .bill-history-card:not(.order-history-card) > div:nth-child(4) strong,
  .bill-history-card:not(.order-history-card) > div:nth-child(5) strong,
  .bill-history-card:not(.order-history-card) > div:nth-child(6) strong,
  .bill-history-card:not(.order-history-card) > div:nth-child(8) .row-action {
    white-space: nowrap !important;
  }

  .bill-history-card:not(.order-history-card) > div:nth-child(2) strong {
    font-size: 16px !important;
    line-height: 1.08 !important;
  }

  .bill-history-card:not(.order-history-card) > div:nth-child(2) small {
    white-space: nowrap !important;
    line-height: 1.15 !important;
  }

  .bill-history-card:not(.order-history-card) > div:nth-child(4) strong,
  .bill-history-card:not(.order-history-card) > div:nth-child(5) strong {
    font-size: 16px !important;
    line-height: 1.12 !important;
  }

  .bill-history-card:not(.order-history-card) > div:nth-child(7) strong {
    font-size: 15px !important;
    line-height: 1.12 !important;
  }

  .bill-split {
    grid-template-columns: minmax(58px, auto) minmax(68px, 1fr) !important;
    gap: 1px 6px !important;
    align-items: center !important;
    align-self: center !important;
    padding: 6px 7px !important;
  }

  .bill-split small,
  .bill-split strong {
    white-space: nowrap !important;
    line-height: 1.1 !important;
  }

  .bill-split small {
    font-size: 8px !important;
  }

  .bill-split strong {
    font-size: 10px !important;
  }

  .bill-split .amount-alert {
    padding: 2px 4px !important;
  }
}

@media (min-width: 761px) and (max-width: 1450px) {
  .content {
    padding-inline: 24px !important;
  }

  .bill-history-list {
    gap: 7px !important;
    padding: 10px !important;
  }

  .bill-history-card:not(.order-history-card) {
    grid-template-columns: minmax(88px,.7fr) minmax(196px,1.42fr) minmax(34px,.22fr) minmax(108px,.74fr) minmax(84px,.58fr) minmax(128px,.82fr) minmax(98px,.64fr) minmax(178px,auto) !important;
    gap: 7px !important;
    padding: 9px 10px !important;
    min-height: 112px !important;
  }

  .bill-history-card:not(.order-history-card) h3,
  .bill-history-card:not(.order-history-card) > div:first-child strong {
    font-size: 16px !important;
  }

  .bill-history-card:not(.order-history-card) > div:nth-child(2) strong {
    font-size: 15px !important;
  }

  .bill-history-card:not(.order-history-card) small {
    font-size: 8px !important;
  }

  .bill-history-card:not(.order-history-card) > div:nth-child(4) strong,
  .bill-history-card:not(.order-history-card) > div:nth-child(5) strong {
    font-size: 15px !important;
  }

  .bill-history-card:not(.order-history-card) .profit-badge {
    font-size: 9px !important;
    padding: 2px 6px !important;
    white-space: nowrap !important;
  }

  .bill-history-card .history-actions .row-action {
    font-size: 8.5px !important;
    min-height: 24px !important;
    padding: 4px 6px !important;
  }
}

/* Windows medium-desktop font fit v20260729-6. */
@media (min-width: 761px) and (max-width: 1450px) {
  .bill-history-card:not(.order-history-card) {
    grid-template-columns: minmax(84px, .55fr) minmax(188px, 1fr) 32px 120px 90px 150px 92px 210px !important;
    gap: 7px !important;
    width: 100% !important;
    min-height: 96px !important;
    overflow: hidden !important;
  }

  .bill-history-card:not(.order-history-card) > div:nth-child(3),
  .bill-history-card:not(.order-history-card) > div:nth-child(4),
  .bill-history-card:not(.order-history-card) > div:nth-child(5),
  .bill-history-card:not(.order-history-card) > div:nth-child(7) {
    overflow: hidden !important;
  }

  .bill-history-card:not(.order-history-card) > div:first-child strong,
  .bill-history-card:not(.order-history-card) > div:nth-child(2) strong {
    font-size: 14px !important;
    line-height: 1.08 !important;
  }

  .bill-history-card:not(.order-history-card) > div:nth-child(3) strong,
  .bill-history-card:not(.order-history-card) > div:nth-child(4) strong,
  .bill-history-card:not(.order-history-card) > div:nth-child(5) strong,
  .bill-history-card:not(.order-history-card) > div:nth-child(7) strong {
    font-size: 13.5px !important;
    line-height: 1.08 !important;
  }

  .bill-history-card:not(.order-history-card) small {
    font-size: 7.2px !important;
    line-height: 1.08 !important;
  }

  .bill-history-card:not(.order-history-card) > div:nth-child(7) strong {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  .bill-split {
    grid-template-columns: 54px minmax(0, 1fr) !important;
    gap: 1px 5px !important;
    padding: 5px 6px !important;
    overflow: hidden !important;
  }

  .bill-split small,
  .bill-split strong,
  .bill-split .amount-alert {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .bill-split small {
    font-size: 7px !important;
  }

  .bill-split strong {
    font-size: 8.5px !important;
  }

  .bill-split .amount-alert {
    padding: 1px 3px !important;
  }

  .bill-history-card .history-actions {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    overflow: hidden !important;
  }

  .bill-history-card .history-actions .row-action {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    font-size: 8px !important;
    line-height: 1 !important;
    min-height: 22px !important;
    padding: 4px 6px !important;
  }
}

/* Windows browser scale v20260729-7: match Chrome's 67% layout without changing browser zoom. */
@media (min-width: 761px) and (max-width: 1450px) {
  html.windows-desktop-shell,
  html.windows-desktop-shell body {
    width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  html.windows-desktop-shell .app {
    width: 149.253731% !important;
    min-height: 149.253731vh !important;
    zoom: .67;
  }

  html.windows-desktop-shell .content {
    max-width: min(100%, 1640px) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-inline: 32px !important;
  }

  html.windows-desktop-shell .bill-history-list {
    gap: 9px !important;
    padding: 12px !important;
  }

  html.windows-desktop-shell .bill-history-card:not(.order-history-card) {
    grid-template-columns: minmax(132px,.82fr) minmax(250px,1.35fr) minmax(56px,.25fr) minmax(150px,.72fr) minmax(120px,.55fr) minmax(168px,.72fr) minmax(124px,.58fr) minmax(232px,auto) !important;
    gap: 12px !important;
    min-height: 0 !important;
    padding: 12px !important;
    overflow: visible !important;
  }

  html.windows-desktop-shell .bill-history-card:not(.order-history-card) h3,
  html.windows-desktop-shell .bill-history-card:not(.order-history-card) > div:first-child strong,
  html.windows-desktop-shell .bill-history-card:not(.order-history-card) > div:nth-child(2) strong,
  html.windows-desktop-shell .bill-history-card:not(.order-history-card) > div:nth-child(3) strong,
  html.windows-desktop-shell .bill-history-card:not(.order-history-card) > div:nth-child(4) strong,
  html.windows-desktop-shell .bill-history-card:not(.order-history-card) > div:nth-child(5) strong,
  html.windows-desktop-shell .bill-history-card:not(.order-history-card) > div:nth-child(7) strong {
    font-size: 16px !important;
    line-height: 1.15 !important;
  }

  html.windows-desktop-shell .bill-history-card:not(.order-history-card) small {
    font-size: 9px !important;
    line-height: 1.2 !important;
  }

  html.windows-desktop-shell .bill-history-card:not(.order-history-card) > div:nth-child(7) strong {
    white-space: normal !important;
    overflow-wrap: normal !important;
  }

  html.windows-desktop-shell .bill-split {
    grid-template-columns: auto 1fr !important;
    gap: 2px 8px !important;
    padding: 8px 10px !important;
    overflow: visible !important;
  }

  html.windows-desktop-shell .bill-split small {
    font-size: 9px !important;
  }

  html.windows-desktop-shell .bill-split strong {
    font-size: 11px !important;
  }

  html.windows-desktop-shell .bill-split .amount-alert {
    padding: 2px 5px !important;
  }

  html.windows-desktop-shell .bill-history-card .history-actions {
    flex-wrap: nowrap !important;
    gap: 5px !important;
    overflow: visible !important;
  }

  html.windows-desktop-shell .bill-history-card .history-actions .row-action {
    flex: 0 0 auto !important;
    font-size: 10px !important;
    min-height: 0 !important;
    padding: 6px 9px !important;
  }
}

/* Windows scaled layout anchor v20260729-8: prevent centered empty band before content. */
@media (min-width: 761px) and (max-width: 1450px) {
  html.windows-desktop-shell .app main {
    overflow: visible !important;
  }

  html.windows-desktop-shell .content {
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }
}

/* Windows width completion v20260729-9: fill right side, keep filters/header inside screen. */
@media (min-width: 761px) and (max-width: 1450px) {
  html.windows-desktop-shell .content > .panel.table-wrap {
    width: 100% !important;
    max-width: none !important;
  }

  html.windows-desktop-shell .app header {
    overflow: hidden !important;
  }

  html.windows-desktop-shell .header-summary {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow: hidden !important;
  }

  html.windows-desktop-shell .header-target-summary .target-summary-inline {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow: hidden !important;
  }

  html.windows-desktop-shell .header-target-summary .target-summary-inline .target-flash {
    grid-template-columns: repeat(9, minmax(0, 1fr)) !important;
    min-width: 0 !important;
    width: 100% !important;
    gap: 5px !important;
  }

  html.windows-desktop-shell .header-target-summary .target-summary-inline .target-flash div {
    min-width: 0 !important;
    padding: 6px 7px !important;
    overflow: hidden !important;
  }

  html.windows-desktop-shell .header-target-summary .target-summary-inline .target-flash small,
  html.windows-desktop-shell .header-target-summary .target-summary-inline .target-flash strong {
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html.windows-desktop-shell .header-target-summary .target-summary-inline .target-flash small {
    font-size: 7px !important;
  }

  html.windows-desktop-shell .header-target-summary .target-summary-inline .target-flash strong {
    font-size: 10px !important;
  }

  html.windows-desktop-shell .order-history-toolbar {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: end !important;
    gap: 10px !important;
  }

  html.windows-desktop-shell .order-history-toolbar .history-actions {
    order: 1 !important;
    margin-top: 0 !important;
    flex-wrap: nowrap !important;
  }

  html.windows-desktop-shell .order-history-toolbar .compact-history-filters {
    order: 2 !important;
    display: grid !important;
    grid-template-columns: 118px 118px minmax(140px, 1fr) minmax(150px, 1fr) minmax(126px, .8fr) minmax(145px, .9fr) minmax(150px, 1fr) !important;
    gap: 8px !important;
    align-items: end !important;
    min-width: 0 !important;
  }
}

/* Desktop order filters + Windows billing reset v20260729-10. */
@media (min-width: 761px) {
  .order-history-toolbar {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    align-items: stretch !important;
    padding: 10px 14px !important;
  }

  .order-history-toolbar .order-filter-grid {
    order: 1 !important;
    display: grid !important;
    grid-template-columns: 118px 118px minmax(140px, 1fr) minmax(140px, 1fr) minmax(128px, .82fr) minmax(132px, .86fr) minmax(150px, 1fr) minmax(156px, 1fr) !important;
    gap: 8px !important;
    align-items: end !important;
    min-width: 0 !important;
  }

  .order-history-toolbar .order-action-row {
    order: 2 !important;
    display: flex !important;
    gap: 7px !important;
    align-items: center !important;
    justify-content: flex-start !important;
    margin-top: 0 !important;
    white-space: nowrap !important;
  }

  .order-history-toolbar .order-filter-grid label,
  .order-history-toolbar .order-filter-grid .filter-checklist-field {
    min-width: 0 !important;
  }

  .order-history-toolbar .order-filter-grid input,
  .order-history-toolbar .order-filter-grid select,
  .order-history-toolbar .order-filter-grid summary {
    width: 100% !important;
    min-width: 0 !important;
  }
}

@media (min-width: 761px) and (max-width: 1280px) {
  .order-history-toolbar .order-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 761px) and (max-width: 1450px) {
  html.windows-desktop-shell .app {
    width: 100% !important;
    min-height: 100vh !important;
    zoom: 1 !important;
  }

  html.windows-desktop-shell .content {
    max-width: min(100%, 1640px) !important;
    padding-inline: 18px !important;
  }

  html.windows-desktop-shell .content > .panel.table-wrap {
    overflow-x: hidden !important;
  }

  html.windows-desktop-shell .compact-history-toolbar,
  html.windows-desktop-shell .billing-payment-summary,
  html.windows-desktop-shell .bill-history-list {
    min-width: 0 !important;
  }

  html.windows-desktop-shell .invoice-history-toolbar .compact-history-filters {
    grid-template-columns: 104px 104px minmax(134px, .95fr) minmax(134px, .95fr) minmax(116px, .72fr) minmax(138px, .95fr) !important;
    gap: 7px !important;
  }

  html.windows-desktop-shell .payment-total-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  html.windows-desktop-shell .payment-total-strip div {
    padding: 7px 9px !important;
  }

  html.windows-desktop-shell .payment-total-strip strong {
    font-size: 14px !important;
  }

  html.windows-desktop-shell .bill-history-card:not(.order-history-card) {
    grid-template-columns: 92px minmax(190px, 1fr) 34px 112px 88px 132px 104px 180px !important;
    gap: 7px !important;
    min-width: 0 !important;
    padding: 9px 10px !important;
    overflow: hidden !important;
  }

  html.windows-desktop-shell .bill-history-card:not(.order-history-card) > div {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  html.windows-desktop-shell .bill-history-card:not(.order-history-card) strong,
  html.windows-desktop-shell .bill-history-card:not(.order-history-card) small {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  html.windows-desktop-shell .bill-history-card:not(.order-history-card) > div:first-child strong,
  html.windows-desktop-shell .bill-history-card:not(.order-history-card) > div:nth-child(2) strong,
  html.windows-desktop-shell .bill-history-card:not(.order-history-card) > div:nth-child(3) strong,
  html.windows-desktop-shell .bill-history-card:not(.order-history-card) > div:nth-child(4) strong,
  html.windows-desktop-shell .bill-history-card:not(.order-history-card) > div:nth-child(5) strong {
    font-size: 13px !important;
    line-height: 1.08 !important;
    white-space: nowrap !important;
  }

  html.windows-desktop-shell .bill-history-card:not(.order-history-card) > div:nth-child(7) strong {
    font-size: 13px !important;
    line-height: 1.08 !important;
    white-space: normal !important;
  }

  html.windows-desktop-shell .bill-history-card:not(.order-history-card) small {
    font-size: 7px !important;
    line-height: 1.08 !important;
    white-space: nowrap !important;
  }

  html.windows-desktop-shell .bill-split {
    grid-template-columns: 48px minmax(0, 1fr) !important;
    gap: 1px 5px !important;
    padding: 5px 6px !important;
    overflow: hidden !important;
  }

  html.windows-desktop-shell .bill-split small {
    font-size: 6.8px !important;
  }

  html.windows-desktop-shell .bill-split strong {
    font-size: 8px !important;
  }

  html.windows-desktop-shell .bill-split .amount-alert {
    padding: 1px 3px !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  html.windows-desktop-shell .bill-history-card .history-actions {
    flex-wrap: nowrap !important;
    gap: 4px !important;
    overflow: hidden !important;
  }

  html.windows-desktop-shell .bill-history-card .history-actions .row-action {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    font-size: 8px !important;
    min-height: 22px !important;
    padding: 4px 6px !important;
  }
}

/* Order chart and Windows filter/header fit v20260729-11. */
@media (min-width: 761px) {
  .order-desk-head {
    display: grid !important;
    grid-template-columns: minmax(260px, .62fr) minmax(700px, 1.38fr) !important;
    gap: 16px !important;
    align-items: center !important;
  }

  .order-head-tools {
    display: grid !important;
    grid-template-columns: minmax(560px, 1.45fr) minmax(300px, .75fr) auto !important;
    gap: 10px !important;
    align-items: center !important;
  }

  .order-status-chart {
    min-width: 0 !important;
    max-width: none !important;
    width: 100% !important;
    padding: 10px 12px !important;
  }

  .order-status-bars {
    gap: 7px 12px !important;
  }

  .order-status-bar {
    grid-template-columns: 86px minmax(72px, 1fr) 26px !important;
    gap: 8px !important;
  }

  .order-status-bar b {
    white-space: nowrap !important;
  }
}

@media (min-width: 761px) and (max-width: 1450px) {
  html.windows-desktop-shell .app header {
    gap: 8px !important;
    padding-inline: 18px !important;
  }

  html.windows-desktop-shell #pageTitle {
    flex: 0 0 132px !important;
    min-width: 132px !important;
  }

  html.windows-desktop-shell .header-actions {
    gap: 6px !important;
  }

  html.windows-desktop-shell .header-actions .icon-button,
  html.windows-desktop-shell .header-actions .avatar {
    width: 34px !important;
    height: 34px !important;
  }

  html.windows-desktop-shell .header-target-summary .source-pill {
    display: none !important;
  }

  html.windows-desktop-shell .header-target-summary .target-summary-inline .target-flash {
    grid-template-columns: .82fr .9fr .72fr .86fr .78fr 1.28fr .8fr .82fr .58fr !important;
    gap: 4px !important;
  }

  html.windows-desktop-shell .header-target-summary .target-summary-inline .target-flash div {
    padding: 5px 6px !important;
  }

  html.windows-desktop-shell .header-target-summary .target-summary-inline .target-flash small {
    font-size: 6.5px !important;
  }

  html.windows-desktop-shell .header-target-summary .target-summary-inline .target-flash strong {
    font-size: 8.6px !important;
    line-height: 1.08 !important;
  }

  html.windows-desktop-shell .invoice-history-toolbar {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    align-items: stretch !important;
  }

  html.windows-desktop-shell .invoice-history-toolbar .history-actions {
    order: 2 !important;
    flex-wrap: nowrap !important;
  }

  html.windows-desktop-shell .invoice-history-toolbar .compact-history-filters {
    order: 1 !important;
    grid-template-columns: 108px 108px minmax(140px, 1fr) minmax(140px, 1fr) minmax(120px, .78fr) minmax(142px, .95fr) !important;
    gap: 7px !important;
  }

  html.windows-desktop-shell .order-history-toolbar {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  html.windows-desktop-shell .order-history-toolbar .order-filter-grid {
    grid-template-columns: 104px 104px minmax(132px, .95fr) minmax(132px, .95fr) minmax(112px, .72fr) minmax(118px, .76fr) minmax(136px, .92fr) minmax(136px, .92fr) !important;
    gap: 7px !important;
  }

  html.windows-desktop-shell .order-history-toolbar .order-action-row {
    flex-wrap: nowrap !important;
  }

  html.windows-desktop-shell .compact-history-filters label,
  html.windows-desktop-shell .compact-history-filters .filter-checklist-field {
    font-size: 8px !important;
  }

  html.windows-desktop-shell .compact-history-filters input,
  html.windows-desktop-shell .compact-history-filters select,
  html.windows-desktop-shell .compact-history-filters summary {
    height: 34px !important;
    min-height: 34px !important;
    padding: 6px 8px !important;
    font-size: 10px !important;
  }

  html.windows-desktop-shell .order-desk-head {
    grid-template-columns: minmax(240px, .5fr) minmax(640px, 1.5fr) !important;
    gap: 12px !important;
  }

  html.windows-desktop-shell .order-head-tools {
    grid-template-columns: minmax(480px, 1.4fr) minmax(250px, .75fr) auto !important;
    gap: 8px !important;
  }

  html.windows-desktop-shell .order-status-chart {
    padding: 8px 10px !important;
  }

  html.windows-desktop-shell .order-status-bars {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px 10px !important;
  }

  html.windows-desktop-shell .order-item-chart .order-status-bars {
    grid-template-columns: 1fr !important;
  }

  html.windows-desktop-shell .order-status-bar {
    grid-template-columns: 78px minmax(60px, 1fr) 22px !important;
    gap: 6px !important;
    font-size: 7.5px !important;
  }

  html.windows-desktop-shell .order-status-chart-title {
    margin-bottom: 6px !important;
    font-size: 8px !important;
  }

  html.windows-desktop-shell .order-status-chart-title strong {
    font-size: 9px !important;
  }
}

/* Order chart readability + Windows order actions v20260729-12. */
@media (min-width: 761px) {
  .order-desk-head {
    grid-template-columns: minmax(260px, .52fr) minmax(760px, 1.48fr) !important;
  }

  .order-head-tools {
    grid-template-columns: minmax(0, 1fr) minmax(300px, .52fr) auto !important;
    align-items: stretch !important;
  }

  #orderStatusChart .order-status-bars {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px 18px !important;
  }

  #orderStatusChart .order-status-bar {
    grid-template-columns: 118px minmax(120px, 1fr) 34px !important;
    gap: 9px !important;
  }

  #orderStatusChart .order-status-bar span {
    text-overflow: clip !important;
  }

  #orderItemChart .order-status-bars {
    grid-template-columns: 1fr !important;
  }

  #orderItemChart .order-status-bar {
    grid-template-columns: 88px minmax(100px, 1fr) 34px !important;
  }
}

@media (min-width: 761px) and (max-width: 1450px) {
  html.windows-desktop-shell .order-desk-head {
    grid-template-columns: minmax(210px, .42fr) minmax(700px, 1.58fr) !important;
  }

  html.windows-desktop-shell .order-head-tools {
    grid-template-columns: minmax(0, 1fr) minmax(250px, .5fr) auto !important;
  }

  html.windows-desktop-shell #orderStatusChart .order-status-bars {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px 12px !important;
  }

  html.windows-desktop-shell #orderStatusChart .order-status-bar {
    grid-template-columns: 96px minmax(78px, 1fr) 24px !important;
    gap: 6px !important;
  }

  html.windows-desktop-shell #orderItemChart .order-status-bar {
    grid-template-columns: 72px minmax(78px, 1fr) 24px !important;
  }

  html.windows-desktop-shell .bill-history-card.order-history-card {
    grid-template-columns: 86px minmax(150px, 1fr) 34px minmax(154px, .9fr) 64px 78px 108px minmax(228px, auto) !important;
    gap: 7px !important;
    overflow: visible !important;
  }

  html.windows-desktop-shell .order-history-card > div {
    min-width: 0 !important;
  }

  html.windows-desktop-shell .order-history-card .history-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    gap: 4px !important;
    white-space: normal !important;
    overflow: visible !important;
  }

  html.windows-desktop-shell .order-history-card .history-actions .row-action {
    flex: 0 0 auto !important;
    font-size: 8px !important;
    line-height: 1 !important;
    min-height: 23px !important;
    padding: 4px 6px !important;
  }
}

/* Order chart inline percentages v20260729-13. */
@media (min-width: 761px) {
  #orderStatusChart .order-status-bar {
    grid-template-columns: 118px minmax(100px, 1fr) 54px !important;
  }

  #orderItemChart .order-status-bar {
    grid-template-columns: 88px minmax(90px, 1fr) 54px !important;
  }

  .order-status-bar b {
    font-size: 9px !important;
  }
}

@media (min-width: 761px) and (max-width: 1450px) {
  html.windows-desktop-shell #orderStatusChart .order-status-bar {
    grid-template-columns: 92px minmax(70px, 1fr) 48px !important;
  }

  html.windows-desktop-shell #orderItemChart .order-status-bar {
    grid-template-columns: 66px minmax(70px, 1fr) 48px !important;
  }

  html.windows-desktop-shell .order-status-bar b {
    font-size: 7.5px !important;
  }
}

/* Main-area text contrast v20260729-14: make muted grey text black, keep sidebar unchanged. */
:root {
  --muted: var(--ink);
}

.app main label,
.app main .secondary,
.app main .panel-head span,
.app main .data-table th,
.app main .order-status-chart-title,
.app main .app-footer,
.app main .app-footer span,
.login-card p,
.login-copyright {
  color: var(--ink) !important;
}

/* Global floating calculator v20260803-6. */
.floating-calculator{position:fixed;right:22px;bottom:22px;z-index:78;display:grid;justify-items:end;gap:10px;pointer-events:none}.calculator-toggle{pointer-events:auto;width:48px;height:48px;border-radius:999px;border:1px solid rgba(16,44,41,.18);background:rgba(255,255,255,.48);color:#0f5f4d;box-shadow:0 10px 28px rgba(16,44,41,.18);backdrop-filter:blur(10px);display:grid;place-items:center;opacity:.64;transition:.16s}.calculator-toggle:hover,.calculator-toggle.active{opacity:1;background:#fff;transform:translateY(-1px)}.calculator-toggle svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.calculator-panel{pointer-events:auto;width:min(280px,calc(100vw - 28px));border:1px solid rgba(16,44,41,.18);border-radius:14px;background:rgba(255,255,255,.96);box-shadow:0 18px 48px rgba(16,44,41,.24);backdrop-filter:blur(14px);overflow:hidden}.calculator-head{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-bottom:1px solid var(--line);color:var(--ink)}.calculator-head strong{font:900 13px Manrope}.calculator-head-actions{display:flex;align-items:center;gap:6px}.calculator-head button{height:28px;border:0;border-radius:8px;background:#eef3ef;color:var(--ink);font-size:18px;font-weight:900}.calculator-head button:not(.calculator-history-button){width:28px}.calculator-head .calculator-history-button{width:auto;padding:0 9px;font:900 11px Manrope}.calculator-screen{margin:12px 12px 8px;padding:9px 12px;border-radius:10px;background:#102c29;color:#fff;text-align:right;min-height:70px;display:grid;align-content:center;gap:3px}.calculator-formula{display:block;min-height:18px;color:#b8d6d0;font:800 12px "DM Sans";overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.calculator-display{display:block;font:900 25px Manrope;line-height:1.1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.calculator-history{margin:0 12px 2px;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#fff}.calculator-history button{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;padding:7px 9px;border:0;border-bottom:1px solid var(--line);background:#fff;color:var(--ink);text-align:left}.calculator-history button:last-child{border-bottom:0}.calculator-history button:hover{background:#f3f8f4}.calculator-history span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:800 11px "DM Sans"}.calculator-history strong{font:900 12px Manrope}.calculator-history-empty{padding:9px;color:var(--ink);font:800 11px "DM Sans";text-align:center}.calculator-keys{display:grid;grid-template-columns:repeat(4,1fr);grid-template-areas:"clear back percent divide" "one two three multiply" "four five six minus" "seven eight nine plus" "open close decimal equals" "zero zero zero equals";gap:7px;padding:12px}.calculator-keys button{min-height:42px;border:1px solid var(--line);border-radius:10px;background:#f8faf7;color:#101c18;font-weight:900}.calculator-keys button:hover{background:#eaf3ed}.calculator-keys .key-clear{grid-area:clear}.calculator-keys .key-back{grid-area:back}.calculator-keys .key-percent{grid-area:percent}.calculator-keys .key-divide{grid-area:divide}.calculator-keys .key-seven{grid-area:seven}.calculator-keys .key-eight{grid-area:eight}.calculator-keys .key-nine{grid-area:nine}.calculator-keys .key-multiply{grid-area:multiply}.calculator-keys .key-open{grid-area:open}.calculator-keys .key-close{grid-area:close}.calculator-keys .key-minus{grid-area:minus}.calculator-keys .key-plus{grid-area:plus}.calculator-keys .key-four{grid-area:four}.calculator-keys .key-five{grid-area:five}.calculator-keys .key-six{grid-area:six}.calculator-keys .key-one{grid-area:one}.calculator-keys .key-two{grid-area:two}.calculator-keys .key-three{grid-area:three}.calculator-keys .key-zero{grid-area:zero}.calculator-keys .key-decimal{grid-area:decimal}.calculator-keys .equals-key{grid-area:equals;background:var(--green);border-color:var(--green);color:#fff}@media(max-width:760px){.floating-calculator{right:14px;bottom:18px}.calculator-toggle{width:52px;height:52px}.calculator-panel{width:min(292px,calc(100vw - 20px))}}html.android-webview .floating-calculator{bottom:84px;right:12px}
.billing-bulk-discount{
  display:flex;
  align-items:flex-end;
  gap:8px;
  padding:8px 12px;
  border-bottom:1px solid var(--line);
  background:#fbfdfb;
}
.billing-bulk-discount label{
  width:150px;
  margin:0;
}
.billing-bulk-discount input{
  height:36px;
}
.billing-bulk-discount .apply-discount-btn{
  height:36px;
  border:1px solid #d6a31b;
  border-radius:9px;
  background:#ffdc73;
  color:#4f3000;
  padding:0 14px;
  font-weight:900;
  box-shadow:0 2px 0 rgba(79,48,0,.08);
}
.billing-bulk-discount .apply-discount-btn:hover{
  background:#ffd35a;
}
.billing-bulk-discount .apply-discount-btn:disabled{
  opacity:.55;
  cursor:not-allowed;
}
.customer-discount-form .table-wrap{
  max-height:min(60vh,620px);
  overflow:auto;
}
.customer-discount-form input{
  width:90px;
  min-width:74px;
  height:34px;
}
.discount-audit-note{
  margin-top:10px;
  color:#172520;
  font:800 11px "DM Sans";
}

.billing-modal-form .billing-line-foot .line-composition-wrap,
html.android-webview .billing-modal-form .billing-line-foot .line-composition-wrap{
  display:inline-flex!important;
  align-items:center!important;
  gap:6px!important;
  min-width:0!important;
  max-width:54%!important;
  flex:1 1 auto!important;
}
.billing-modal-form .billing-line-foot .line-composition-wrap .line-composition,
html.android-webview .billing-modal-form .billing-line-foot .line-composition-wrap .line-composition{
  flex:1 1 auto!important;
  min-width:0!important;
  max-width:none!important;
}
.billing-modal-form .billing-line-foot .generic-info-button,
html.android-webview .billing-modal-form .billing-line-foot .generic-info-button,
.product-result-actions .generic-info-button{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:0 0 24px!important;
  width:24px!important;
  height:24px!important;
  min-width:24px!important;
  border:0!important;
  border-radius:50%!important;
  background:#d71920!important;
  color:#fff!important;
  font:950 14px/1 Georgia,serif!important;
  padding:0!important;
  box-shadow:0 0 0 2px #fff,0 4px 12px rgba(215,25,32,.35)!important;
}
.product-image-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:24px;
  height:24px;
  min-width:24px;
  border:0;
  border-radius:50%;
  background:#1769d1;
  color:#fff;
  font:950 12px/1 Manrope,sans-serif;
  padding:0;
  vertical-align:middle;
  box-shadow:0 0 0 2px #fff,0 4px 12px rgba(23,105,209,.32);
}
.product-image-button:hover{
  background:#0f55ad;
}
.product-image-button.no-image{
  background:#7b838c;
  color:#fff;
  box-shadow:0 0 0 2px #fff,0 4px 12px rgba(91,99,108,.26);
}
.product-image-button.no-image:hover{
  background:#646c75;
}
.product-image-button.pending-image{
  background:#e83e8c;
  color:#fff;
  box-shadow:0 0 0 2px #fff,0 4px 12px rgba(232,62,140,.32);
}
.product-image-button.pending-image:hover{
  background:#c92873;
}
.product-image-button.mixed-image{
  background:var(--product-image-gradient,#7b838c);
  color:#fff;
  box-shadow:0 0 0 2px #fff,0 4px 12px rgba(99,79,185,.34);
}
.product-image-button.mixed-image:hover{
  background:var(--product-image-gradient,#7b838c);
}
.product-image-button,
.product-image-button:hover,
.product-image-button.no-image,
.product-image-button.no-image:hover,
.product-image-button.pending-image,
.product-image-button.pending-image:hover,
.product-image-button.mixed-image,
.product-image-button.mixed-image:hover{
  background:var(--product-image-gradient,#7b838c);
}
.product-image-button:hover{
  filter:brightness(.92);
}
.product-image-preview{
  position:fixed;
  z-index:240;
  width:320px;
  min-height:96px;
  border:1px solid rgba(16,44,41,.16);
  border-radius:12px;
  background:#fff;
  padding:10px;
  box-shadow:0 18px 50px rgba(16,44,41,.24);
  display:grid;
  gap:8px;
}
.product-image-preview.hidden{
  display:none;
}
.product-image-preview strong,
.product-image-preview span{
  color:#172520;
  font-size:12px;
  font-weight:900;
}
.product-image-preview img{
  width:100%;
  max-height:190px;
  object-fit:contain;
  border-radius:10px;
  background:#f4f7f5;
}
.product-image-preview-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.product-image-preview-grid div{
  min-width:0;
}
.product-image-preview-grid small{
  display:block;
  margin-bottom:4px;
  color:#52625d;
  font-size:9px;
  font-weight:900;
}
.product-image-preview-grid img{
  height:112px;
  max-height:112px;
}
.product-image-zoom-preview{
  position:fixed;
  z-index:2600;
  width:min(390px,calc(100vw - 28px));
  min-height:180px;
  border:1px solid rgba(16,44,41,.18);
  border-radius:12px;
  background:#fff;
  padding:10px;
  box-shadow:0 22px 70px rgba(16,44,41,.28);
  display:grid;
  gap:8px;
  pointer-events:none;
}
.product-image-zoom-preview.hidden{
  display:none;
}
.product-image-zoom-preview strong{
  color:#172520;
  font-size:12px;
  font-weight:950;
}
.product-image-zoom-preview img{
  width:100%;
  max-height:340px;
  object-fit:contain;
  border-radius:10px;
  background:#f4f7f5;
}
.product-image-full{
  display:grid;
  place-items:center;
  min-height:min(72vh,720px);
}
.product-image-full img{
  max-width:100%;
  max-height:72vh;
  object-fit:contain;
  border-radius:12px;
  background:#f4f7f5;
}
.product-picture-dialog{
  display:grid;
  gap:14px;
}
.product-picture-section{
  display:grid;
  gap:8px;
}
.product-picture-section h4{
  margin:0;
  color:#172520;
  font-size:13px;
}
.product-picture-section .product-image-full{
  min-height:0;
  max-height:52vh;
}
.product-picture-section .product-image-full img{
  max-height:52vh;
}
.product-picture-section.pending{
  border:1px solid #f3bfd3;
  background:#fff6fa;
  border-radius:12px;
  padding:12px;
}
.product-picture-actions{
  margin-top:4px;
}
.product-image-slot-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:fit-content;
  border-radius:999px;
  padding:4px 8px;
  background:#eef0ef;
  color:#52625d;
  font-size:9px;
  font-weight:950;
}
.product-image-slot-status.approved{
  background:#e8f1ff;
  color:#1769d1;
}
.product-image-slot-status.pending{
  background:#fff0f7;
  color:#c92873;
}
.row-actions-stack{
  display:grid;
  gap:6px;
  justify-items:start;
}
.customer-master-audit{
  color:#64736d;
  background:#f7faf8;
  border:1px solid #e4ebe7;
  border-radius:10px;
  padding:10px 12px;
}
.customer-flag-badge{
  display:inline-block;
  width:fit-content;
  margin-top:4px;
  padding:3px 7px;
  border-radius:6px;
  border:1px solid rgba(220,38,38,.25);
  background:#fff1f2;
  color:#9f1239;
  font-size:12px;
  font-weight:800;
}
.customer-flag-confirm p{
  margin:0 0 10px;
}

.product-master-content{
  height:calc(100vh - 82px);
  max-width:none;
  overflow:hidden;
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  padding-bottom:24px;
}
.product-master-content>.section-head{
  flex:0 0 auto;
  margin-bottom:14px;
}
.product-master-panel{
  min-height:0;
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  overflow:hidden;
}
.product-master-toolbar{
  align-items:center;
  gap:12px;
  background:#fff;
  z-index:2;
}
.product-master-toolbar .search{
  min-width:min(480px,calc(100vw - 900px));
}
.product-master-toolbar select{
  min-width:220px;
}
.product-master-toolbar #productMasterPager{
  margin-left:auto;
}
.product-master-scroll{
  min-height:0;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}
.product-master-scroll .data-table th{
  position:sticky;
  top:0;
  z-index:1;
}
.product-master-table{
  min-width:1180px;
}
.product-view-action{
  background:#16725b;
  border-color:#16725b;
  color:#fff;
}
.product-edit-action{
  background:#d71920;
  border-color:#d71920;
  color:#fff;
}
.product-attribute-action{
  background:#6d28d9;
  border-color:#5b21b6;
  color:#fff;
}
.product-image-upload-action{
  background:#1769d1;
  border-color:#1769d1;
  color:#fff;
}
.customer-edit-action{
  background:#d71920;
  border-color:#d71920;
  color:#fff;
}
.customer-credit-action{
  background:#1769d1;
  border-color:#1055ad;
  color:#fff;
}
.customer-flag-action{
  background:#b7791f;
  border-color:#966014;
  color:#fff;
}
.customer-analytics-action{
  background:#16725b;
  border-color:#16725b;
  color:#fff;
}
.product-picture-source-actions{
  padding:8px 0 2px;
  gap:10px;
  flex-wrap:wrap;
}
.product-picture-source-actions button,
.product-picture-source-actions .product-picture-file-button{
  min-height:44px;
  flex:0 1 auto;
}
.product-picture-file-button{
  align-items:center;
  cursor:pointer;
  display:inline-flex;
  justify-content:center;
  margin:0;
  max-width:210px;
  overflow:hidden;
  padding:10px 13px;
  position:relative;
}
.product-picture-file-button::file-selector-button{
  background:transparent;
  border:0;
  color:inherit;
  cursor:pointer;
  font:inherit;
  font-weight:900;
  margin:0 8px 0 0;
  padding:0;
}
.product-picture-file-button::-webkit-file-upload-button{
  background:transparent;
  border:0;
  color:inherit;
  cursor:pointer;
  font:inherit;
  font-weight:900;
  margin:0 8px 0 0;
  padding:0;
}
html.android-webview .product-picture-source-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  width:100%;
}
html.android-webview .product-picture-source-actions button{
  min-width:0;
  width:100%;
}
html.android-webview .product-picture-source-actions button:last-child{
  grid-column:1 / -1;
}
.product-camera-box{
  display:grid;
  gap:12px;
  width:min(720px,calc(100vw - 42px));
}
.product-camera-box video{
  width:100%;
  max-height:min(62vh,560px);
  border-radius:14px;
  background:#0f1f1b;
  object-fit:cover;
}
.product-camera-box .muted{
  font-weight:850;
}
.product-image-upload-success{
  display:grid;
  gap:12px;
  width:min(720px,calc(100vw - 42px));
}
.product-image-upload-success .product-image-full{
  min-height:0;
}
.product-image-upload-success .product-image-full img{
  max-height:min(54vh,460px);
}
.product-image-slot-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:10px;
}
.product-image-slot{
  display:grid;
  align-content:start;
  gap:6px;
  border:1px solid var(--line);
  border-radius:8px;
  padding:8px;
  background:#fff;
}
.product-image-slot .product-image-full{
  min-height:120px;
  display:grid;
  place-items:center;
}
.product-image-slot .product-image-openable{
  width:100%;
  border:0;
  border-radius:10px;
  background:#f4f7f5;
  cursor:zoom-in;
  padding:0;
}
.product-image-slot .product-image-openable:hover{
  box-shadow:0 0 0 2px #b9d9cd;
}
.product-image-slot .product-image-full img{
  max-width:100%;
  max-height:170px;
  object-fit:contain;
}
.product-image-full-view{
  display:grid;
  place-items:center;
  width:min(1100px,92vw);
  height:min(74vh,760px);
  max-height:78vh;
  overflow:hidden;
  touch-action:none;
  cursor:grab;
  border-radius:12px;
  background:#f4f7f5;
}
.product-image-full-view:active{
  cursor:grabbing;
}
.product-image-full-view img{
  max-width:100%;
  max-height:76vh;
  object-fit:contain;
  border-radius:12px;
  background:#f4f7f5;
  transform-origin:center center;
  transition:transform .08s ease-out;
  user-select:none;
  -webkit-user-drag:none;
  touch-action:none;
}
.product-image-full-tools{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.product-image-full-tools .secondary{
  min-width:44px;
}
.product-image-full-tools span{
  min-width:54px;
  text-align:center;
  color:#172520;
  font-size:12px;
  font-weight:950;
}
.product-master-form{
  min-width:min(980px,88vw);
  grid-template-columns:1fr 1fr;
}
.product-master-form fieldset{
  border:1px solid var(--line);
  border-radius:12px;
  padding:14px;
}
.product-master-form legend{
  padding:0 8px;
  font-weight:900;
  color:#172520;
}
.product-master-form textarea{
  resize:vertical;
  min-height:82px;
}
.product-master-meta{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#f7faf7;
  font-size:12px;
}
.product-master-title{
  display:grid;
  grid-template-columns:1.4fr 1fr;
  gap:12px;
}
.product-master-title>div,
.product-generic-card{
  border:1px solid var(--line);
  background:#f7faf7;
  border-radius:12px;
  padding:13px 14px;
}
.product-master-image-field{
  background:#fff;
}
.product-master-image-box{
  display:grid;
  grid-template-columns:minmax(0,440px) minmax(220px,1fr);
  gap:14px;
  align-items:start;
}
.product-master-image-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  width:100%;
  max-width:440px;
}
.product-master-image-slot{
  display:grid;
  align-content:start;
  gap:6px;
  min-height:0;
  padding:8px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#f7faf7;
  overflow:hidden;
}
.product-master-image-slot small{
  color:#37443f;
  font-weight:900;
}
.product-master-image-slot .product-image-full{
  min-height:86px!important;
  height:86px!important;
  max-height:86px!important;
  display:grid;
  place-items:center;
  overflow:hidden;
}
.product-master-image-slot .product-image-openable{
  width:100%;
  min-height:86px!important;
  height:86px!important;
  max-height:86px!important;
  border:0;
  border-radius:8px;
  background:#fff;
  cursor:zoom-in;
  padding:0;
}
.product-master-image-slot .product-image-full img{
  width:100%;
  height:100%;
  max-height:86px!important;
  object-fit:contain;
}
.product-master-image-slot .secondary{
  width:100%;
  min-height:34px;
  padding:8px 10px;
}
.product-image-thumb{
  width:170px;
  height:128px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#f7faf7;
  padding:0;
  overflow:hidden;
  display:grid;
  place-items:center;
}
.product-image-thumb img{
  width:100%;
  height:100%;
  object-fit:contain;
}
.product-image-empty{
  padding:12px;
  color:#64736d;
  text-align:center;
  font-weight:900;
  font-size:12px;
}
.product-master-image-box>div{
  display:grid;
  gap:6px;
}
.product-master-image-box strong{
  color:#172520;
  font-weight:950;
}
.product-master-image-box span{
  color:#53635d;
  font-weight:750;
  font-size:12px;
}
.product-master-image-box .secondary{
  justify-self:start;
  margin-top:4px;
}
.product-master-title small,
.product-generic-card small{
  display:block;
  color:#64736d;
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:900;
  margin-bottom:5px;
}
.product-master-title strong,
.product-generic-card strong{
  display:block;
  color:#0e201b;
  font-size:15px;
  font-weight:950;
  line-height:1.25;
}
.product-master-title span,
.product-generic-card span{
  display:block;
  color:#4f5d58;
  font-size:11px;
  font-weight:750;
  margin-top:4px;
}
.product-master-checks,
.checks-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:8px 14px;
}
.product-master-lookup{
  margin-top:6px;
  align-items:center;
}
.product-master-lookup .secondary{
  padding:7px 10px;
  font-size:11px;
}
.product-master-actions{
  justify-content:flex-end;
}
.product-master-field-form{
  display:grid;
  grid-template-columns:minmax(360px,.9fr) minmax(460px,1.1fr);
  gap:14px;
  align-items:start;
}
.product-field-edit-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.product-field-edit-row{
  display:grid;
  gap:6px;
  min-width:0;
  align-content:start;
  padding:9px;
  border:1px solid #edf2ef;
  border-radius:10px;
  background:#fff;
}
.product-field-selector{
  display:inline-flex;
  width:max-content;
  max-width:100%;
  align-items:center;
  gap:6px;
  font-size:11px;
  font-weight:950;
  color:#687972;
  background:#f6faf7;
  border:1px solid var(--line);
  border-radius:999px;
  padding:5px 9px;
  cursor:pointer;
}
.product-field-edit-row.active .product-field-selector{
  color:#0f6f5a;
  background:#e6f6ef;
  border-color:#8fd2bd;
}
.product-field-edit-body{
  display:block;
  opacity:.42;
  transition:opacity .16s ease;
  pointer-events:none;
}
.product-field-edit-row.active .product-field-edit-body{
  opacity:1;
  pointer-events:auto;
}
.product-field-edit-body label,
.product-field-edit-body input,
.product-field-edit-body select,
.product-field-edit-body textarea{
  width:100%;
  min-width:0;
}
.product-field-edit-body input:disabled,
.product-field-edit-body select:disabled,
.product-field-edit-body textarea:disabled{
  color:#6e7974;
  background:#fafafa;
  border-color:#e7ece9;
}
.product-field-edit-body button:disabled{
  opacity:.45;
  cursor:not-allowed;
}
.product-boolean-edit-row .product-field-edit-body{
  margin-top:2px;
}
.product-boolean-edit-row .product-field-edit-body .check-row{
  background:#fbfdfb;
  border-style:dashed;
}
.product-boolean-edit-row.active .product-field-edit-body .check-row{
  background:#fff;
  border-style:solid;
}
.product-field-edit-body .product-generic-card{
  background:#fff;
}
.product-field-edit-row:has(textarea){
  grid-column:1 / -1;
}
.product-field-checks .product-field-edit-row{
  gap:5px;
  min-height:78px;
}
.product-field-checks .product-field-edit-body .check-row{
  min-height:34px;
}
.product-field-generic-grid .product-field-edit-row{
  border:1px solid var(--line);
  border-radius:10px;
  padding:10px;
  background:#fbfdfb;
}
.modal:has(.product-master-form){
  width:min(1320px,calc(100vw - 44px));
}
.modal:has(.product-master-form) .modal-body{
  overflow:auto;
  overflow-x:hidden;
}
.product-generic-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.product-generic-card{
  display:grid;
  gap:8px;
}
.product-generic-card .button-row{
  margin-top:2px;
}
.product-master-form{
  width:100%;
  min-width:0;
}
.product-master-form .form-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.product-master-form label,
.product-master-form input,
.product-master-form select,
.product-master-form textarea{
  min-width:0;
  max-width:100%;
}
.product-master-generic-highlight{
  display:inline!important;
  padding:1px 5px;
  border-radius:5px;
  background:#fff1a8;
  color:#111!important;
  font-weight:900;
}
.modal:has(.product-generic-search){
  width:min(1280px,calc(100vw - 44px));
}
.modal:has(.product-generic-search) .modal-body{
  overflow:hidden;
}
.product-generic-search{
  width:100%;
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  min-height:min(650px,76vh);
  min-width:0;
}
.product-generic-search-results{
  min-height:0;
  overflow:auto;
}
.product-generic-search-results .generic-master-table{
  width:100%;
  min-width:0;
  table-layout:fixed;
}
.product-generic-search-results .generic-master-table th:first-child,
.product-generic-search-results .generic-master-table td:first-child{
  width:auto;
  white-space:normal;
  overflow-wrap:anywhere;
}
.product-generic-search-results .generic-master-table th:nth-child(2),
.product-generic-search-results .generic-master-table td:nth-child(2){
  width:160px;
}
.product-generic-search-results .generic-master-table th:last-child,
.product-generic-search-results .generic-master-table td:last-child{
  width:150px;
  text-align:right;
}
.generic-picker-actions{
  display:grid;
  gap:6px;
  justify-items:stretch;
}
.generic-picker-actions .row-action{
  width:100%;
}
.generic-picker-actions .generic-select-action{
  background:#d71920;
  border-color:#b9151b;
  color:#fff;
}
.product-generic-search-results .data-table th{
  position:sticky;
  top:0;
  z-index:1;
}
.generic-search-preview{
  margin:7px 0 0;
  max-width:620px;
  color:#172520;
  font-size:11px;
  line-height:1.35;
  font-weight:700;
}
.product-image-approval-panel{
  min-height:0;
  overflow:auto;
}
.product-image-approval-bulkbar{
  position:sticky;
  top:0;
  z-index:2;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 4px 12px;
  background:#fff;
  border-bottom:1px solid var(--line);
  margin-bottom:8px;
}
.product-image-approval-bulkbar > span{
  color:#51625d;
  font-size:12px;
  font-weight:850;
  margin-right:auto;
}
.product-image-approval-select-all,
.product-image-approval-select{
  display:flex;
  align-items:center;
  gap:8px;
  color:#263a34;
  font-size:12px;
  font-weight:900;
}
.product-image-approval-select-all input,
.product-image-approval-select input{
  width:18px;
  height:18px;
  accent-color:var(--green);
}
.product-image-approval-select{
  align-self:start;
  padding-top:6px;
}
.product-image-approval-list{
  display:grid;
  gap:12px;
  padding:4px;
}
.product-image-approval-card{
  display:grid;
  grid-template-columns:72px 150px minmax(0,1fr) auto;
  gap:14px;
  align-items:center;
  padding:12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
}
.product-image-approval-card.selected{
  border-color:#8ecfbf;
  background:#f7fffb;
}
.product-image-approval-card .button-row.mini{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  width:320px;
  max-width:100%;
  justify-content:flex-end;
}
.product-image-approval-card .button-row.mini button{
  width:100%;
}
.product-image-name-action{
  color:#7a4d00;
  background:#fff4cf;
  border-color:#f0c85d;
}
.product-image-generic-action{
  color:#1557a6;
  background:#e8f2ff;
  border-color:#9dc8ff;
}
.product-image-approve-action{
  color:#fff;
  background:#137c63;
  border-color:#137c63;
}
.product-image-reject-action{
  color:#b71920;
  background:#fff0f0;
  border-color:#ffc7c7;
}
.product-name-change-form{
  grid-template-columns:1fr 1fr;
}
.product-name-copy-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 220px;
  align-items:end;
  gap:12px;
}
.product-name-copy-check{
  align-self:end;
  display:flex;
  align-items:center;
  gap:8px;
  min-height:44px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#f8fbf8;
  color:#33433d;
  font-size:12px;
  font-weight:850;
}
.product-name-copy-check input{
  width:18px;
  height:18px;
  accent-color:var(--green);
}
@media(max-width:760px){
  .product-name-change-form{
    grid-template-columns:1fr;
  }
  .product-name-copy-row{
    grid-template-columns:1fr;
    gap:8px;
  }
}
.product-image-approval-preview{
  width:150px;
  height:112px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#f7faf7;
  padding:0;
  overflow:hidden;
}
.product-image-approval-preview img{
  width:100%;
  height:100%;
  object-fit:contain;
}
.product-image-approval-info{
  min-width:0;
  display:grid;
  gap:4px;
}
.product-image-approval-info small{
  color:#8a2c2c;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:9px;
  font-weight:950;
}
.product-image-approval-info strong{
  color:#172520;
  font-size:15px;
  font-weight:950;
  line-height:1.25;
}
.product-image-approval-info span{
  color:#52625d;
  font-size:12px;
  font-weight:750;
}
.product-image-approval-info .product-image-existing-generic{
  margin-top:3px;
  color:#16559a;
  font-weight:850;
}
.product-image-approval-info .product-image-existing-generic strong{
  color:#102c29;
  font-size:12px;
}
.danger-action{
  color:#b71920;
  border-color:#ffd1d1;
  background:#fff4f4;
}
.search.has-search-help input{
  padding-right:42px!important;
}
.billing-product-search.has-search-help{
  grid-template-columns:minmax(0,1fr) 44px;
  overflow:visible!important;
}
.billing-product-search.has-search-help .search-help-button{
  grid-column:1!important;
  grid-row:1!important;
  justify-self:end!important;
  align-self:center!important;
  position:relative!important;
  right:auto!important;
  top:auto!important;
  transform:none!important;
  margin-right:42px!important;
  width:24px!important;
  min-width:24px!important;
  height:24px!important;
  min-height:24px!important;
  border:1px solid #bfe4d9!important;
  border-radius:50%!important;
  background:#f7fffb!important;
  color:#0b6f58!important;
  font-family:Arial,sans-serif!important;
  font-size:15px!important;
  font-weight:900!important;
  line-height:1!important;
  padding:0!important;
  box-shadow:none!important;
  z-index:5!important;
}
.billing-product-search.has-search-help input{
  grid-column:1!important;
  grid-row:1!important;
  padding-right:96px!important;
}

@media(max-width:760px){
  .product-master-content{
    height:auto;
    overflow:visible;
  }
  .product-master-panel{
    display:block;
  }
  .product-master-toolbar .search,
  .product-master-toolbar select,
  .product-master-toolbar #productMasterPager{
    min-width:0;
    width:100%;
    margin-left:0;
  }
  .product-master-scroll{
    max-height:62vh;
  }
  .product-master-form{
    min-width:0;
    grid-template-columns:1fr;
  }
  .product-master-field-form,
  .product-master-form .form-grid{
    grid-template-columns:1fr;
  }
  .product-field-edit-grid{
    grid-template-columns:1fr;
  }
  .product-master-form .span-2{
    grid-column:auto;
  }
  .product-master-title,
  .product-generic-grid{
    grid-template-columns:1fr;
  }
  .product-image-approval-bulkbar{
    flex-wrap:wrap;
  }
  .product-image-approval-bulkbar > span{
    margin-right:0;
  }
  .product-image-approval-bulkbar button{
    flex:1 1 150px;
  }
  .product-master-image-box,
  .product-image-approval-card{
    grid-template-columns:1fr;
  }
  .product-master-image-grid{
    grid-template-columns:repeat(2,minmax(120px,1fr));
  }
  .product-image-approval-select{
    padding-top:0;
  }
  .product-image-thumb,
  .product-image-approval-preview{
    width:100%;
    height:180px;
  }
  .modal:has(.product-master-form),
  .modal:has(.product-generic-search){
    width:100vw;
  }
  .modal:has(.product-master-form) .modal-body,
  .modal:has(.product-generic-search) .modal-body{
    overflow:auto;
  }
  .product-generic-search-results .generic-master-table{
    min-width:720px;
  }
}
html.android-webview .billing-product-search.has-search-help{
  grid-template-columns:minmax(0,1fr) 48px 48px!important;
  overflow:visible!important;
}
html.android-webview .billing-product-search.has-search-help .search-help-button{
  grid-column:1!important;
  grid-row:1!important;
  justify-self:end!important;
  align-self:center!important;
  position:relative!important;
  right:auto!important;
  top:auto!important;
  transform:none!important;
  margin-right:42px!important;
  height:24px!important;
  min-height:24px!important;
  width:24px!important;
  min-width:24px!important;
  border-radius:50%!important;
  background:#f7fffb!important;
  font-size:15px!important;
  padding:0!important;
}
html.android-webview .billing-product-search.has-search-help input{
  grid-column:1!important;
  grid-row:1!important;
  padding:0 96px 0 12px!important;
}

.product-attribute-tag{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:22px;
  height:18px;
  padding:0 6px;
  border-radius:4px;
  background:#b91c1c;
  color:#fff;
  font-size:11px;
  font-weight:900;
  line-height:1;
  vertical-align:middle;
  margin-left:4px;
  letter-spacing:0;
}
.product-attribute-tag.nr-tag{
  background:#dc2626;
}
.credit-note-source-row.non-returnable-source{
  border-color:#fecaca;
  background:#fff1f2;
  cursor:not-allowed;
  opacity:1;
}
.credit-note-source-row.non-returnable-source strong{
  color:#7f1d1d;
}
