:root{font-family:Segoe UI,Arial,sans-serif;color:#133045;background:#f3f7fa;font-size:15px;--teal:#00878b;--navy:#0b293d}*{box-sizing:border-box}body{margin:0}h1{font-size:30px;margin:7px 0 20px}h2{font-size:21px;margin:0}p{line-height:1.6}.eyebrow{font-size:11px;font-weight:700;letter-spacing:2px;color:var(--teal)}.login-card{max-width:460px;margin:8vh auto;padding:38px;background:white;border:1px solid #dbe5ed;border-radius:16px;box-shadow:0 16px 50px #1533490b}.login-card h1{font-size:35px}.muted,small{color:#698091;font-size:12px}label{display:flex;flex-direction:column;gap:7px;margin:14px 0;font-size:13px;font-weight:600}input,select,textarea{padding:12px;border:1px solid #cddbe5;border-radius:7px;font:inherit;background:white;color:#18344b;min-width:0}input:focus,select:focus{outline:2px solid #00878b55;border-color:var(--teal)}input[type=checkbox]{width:20px;height:20px}button{background:var(--teal);border:1px solid transparent;border-radius:7px;color:white;min-height:42px;padding:10px 17px;font:inherit;font-weight:600;cursor:pointer}button:hover{filter:brightness(.96)}button:disabled{opacity:.5;cursor:wait}.secondary{background:white;border-color:#cfdae4;color:#23465a}.danger{color:#b12838;border:1px solid #edb6bc;background:#fff4f4}.login-card button{width:100%;margin:12px 0}aside{position:fixed;inset:0 auto 0 0;width:230px;background:var(--navy);color:white;padding:28px 18px;display:flex;flex-direction:column;overflow-y:auto}.brand{font-weight:800;font-size:24px;padding:0 14px 30px;letter-spacing:.5px}.brand strong{color:#1ac7bc}.brand small{display:block;margin-top:12px;color:#a5bdce;letter-spacing:1px;font-weight:400}.brand img{max-width:160px}nav{flex:1}nav button{width:100%;text-align:left;background:none;color:#d9e7f0;font-weight:400;margin:3px 0}nav button.active{background:var(--teal);color:white}.workspace{margin-left:230px;padding:26px 36px;max-width:1800px}header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #dce6ed;margin-bottom:20px}#identity{font-size:13px;color:#60788c}.pilot{background:#fff6e3;color:#865a12;padding:12px 16px;border:1px solid #f4dfaf;border-radius:8px;font-size:13px;margin-bottom:20px}#toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:18px}#toolbar label{margin:0;min-width:170px}.card{background:white;padding:22px;border:1px solid #dbe5ed;border-radius:10px;margin:14px 0}.metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px}.metric{background:white;padding:24px;border:1px solid #dbe5ed;border-radius:10px}.metric strong{display:block;font-size:28px;margin-top:10px;color:#087f81}.table-wrap{overflow:auto;background:white;border:1px solid #dae5ed;border-radius:9px}table{border-collapse:collapse;width:100%;font-size:13px}th{background:#edf3f7;color:#486173;font-size:11px;letter-spacing:.5px;text-align:left}td,th{padding:15px;border-bottom:1px solid #e5edf2;white-space:nowrap}td button{min-height:30px;font-size:12px;padding:6px 12px}.empty{padding:45px;text-align:center;color:#718798}.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px}.badge{background:#e5f6f3;color:#087e78;border-radius:20px;padding:5px 10px;font-size:11px}dialog{border:1px solid #cbdbe7;border-radius:13px;padding:26px;max-width:800px;width:calc(100% - 30px);max-height:90vh;overflow:auto;color:#17364c}dialog::backdrop{background:#102f4866}.dialog-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:16px}form .grid{display:grid;grid-template-columns:1fr 1fr;gap:0 16px}#status{position:fixed;bottom:20px;right:20px;max-width:470px;background:#102f45;color:white;border-radius:8px;padding:16px;z-index:100}#status:empty{display:none}#report{background:white;padding:30px;max-width:900px;margin:20px auto}#report table td{white-space:normal}#report .report-actions{margin:20px 0;display:flex;gap:12px}@media(max-width:800px){aside{position:relative;width:100%;padding:18px}.brand{padding:0 0 14px;font-size:20px}nav{display:flex;overflow-x:auto}nav button{width:auto;white-space:nowrap}aside #logout{align-self:flex-end}.workspace{margin:0;padding:20px}header{align-items:start;gap:10px}h1{font-size:25px}.login-card{margin:5vh 16px}form .grid{grid-template-columns:1fr}}@media print{@page{size:A4;margin:14mm}body{background:white}body>*{display:none!important}body>#report{display:block!important;padding:0;margin:0;max-width:none;border:none}#report .report-actions{display:none}#report table{font-size:10px}#report td,#report th{padding:8px}tr{break-inside:avoid}thead{display:table-header-group}}
/* Windows Duka aligned selling workspace */
:root{font-size:13px}aside{width:185px;padding:24px 14px}.brand{padding:0 0 18px}.brand img{display:block;max-width:157px;width:100%;background:white}.brand small{font-size:12px;letter-spacing:0}nav button{border:none;background:transparent!important;color:#dce9ef;border-radius:0;font-size:13px;padding:12px 16px;margin:2px 0}nav button.active{background:#00878b!important;color:white}aside #logout{background:transparent;color:white;border:none;text-align:left}.workspace{margin-left:185px;padding:20px;max-width:none}h1{font-size:24px;margin:3px 0 10px}.pilot{font-size:11px;padding:7px 12px;margin-bottom:10px}header{margin-bottom:10px}#toolbar{margin-bottom:10px}.sale-layout{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(300px,1fr);gap:12px;min-height:calc(100vh - 245px)}.sale-left,.sale-right{min-width:0;display:flex;flex-direction:column;gap:12px}.sale-find{background:#e8f2f6;padding:14px;display:flex;align-items:end;flex-wrap:wrap;gap:10px}.sale-find label{margin:0}.sale-find label:first-child{flex:1;min-width:220px}.sale-find input{width:100%}.sale-find .muted{display:block;width:100%}.sale-card{background:white;padding:20px}.sale-card h2,.sale-basket h2{font-size:16px;margin:0 0 18px}.sale-card>select{width:100%;margin-bottom:8px}.sale-basket{background:white;flex:1;min-height:340px;padding:0}.sale-basket h2{padding:14px;margin:0}.sale-basket .table-wrap{border-radius:0;border:0}.sale-basket th{font-size:12px;background:#edf3f7}.sale-basket td,.sale-basket th{padding:12px}.sale-basket td:first-child{white-space:normal;min-width:140px}.sale-basket .actions{margin:0;flex-wrap:nowrap}.sale-basket .empty{padding:70px 20px}.summary-line{display:flex;justify-content:space-between;gap:12px;margin:20px 0}.sale-total{font-size:23px;font-weight:bold}.sale-change strong{color:green}.discount-controls{display:flex;gap:10px}.discount-controls input{width:100%}.discount-controls select{max-width:80px}.payment-modes{display:flex;gap:5px;flex-wrap:wrap}.payment-modes button{flex:1;padding:10px 6px;font-size:12px}.sale-actions{display:flex;gap:6px;margin-top:14px;flex-wrap:wrap}.sale-actions button{flex:1;min-width:100px;border-radius:0;min-height:48px;font-size:12px}.sale-actions .complete-sale{background:#008d22;color:white;font-size:14px;flex:2}.config-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:18px}.sale-card label{font-weight:400}#status{font-size:12px;max-width:420px;padding:12px}.sale-card:last-child{flex:1}@media(max-width:1000px){.sale-layout{grid-template-columns:minmax(0,1fr) minmax(270px,.8fr)}.workspace{padding:14px}.sale-card{padding:15px}.sale-total{font-size:20px}}@media(max-width:800px){aside{width:100%;padding:12px}.brand img{max-width:135px}.brand small{display:none}.workspace{margin:0}.sale-layout{display:flex;flex-direction:column}.sale-basket{min-height:220px}nav button{min-width:max-content}.sale-find label:first-child{min-width:160px}.sale-actions{position:static}}nav button.secondary{color:#dce9ef;border:none;background:transparent}nav button.active.secondary{color:white}.sale-layout{min-height:calc(100vh - 270px)}.sale-card{padding:14px}.sale-card h2{margin-bottom:12px}.sale-card input,.sale-card select{padding:8px}.sale-card label{margin:10px 0}.sale-card .summary-line{margin:14px 0}.sale-card .sale-total{margin-bottom:0}.sale-card .muted{font-size:11px;line-height:1.5;margin:10px 0}.sale-right>.sale-card:first-child{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center}.sale-right>.sale-card:first-child h2{grid-column:1/-1;margin-bottom:0}.sale-right>.sale-card:first-child select{margin:0}.sale-right>.sale-card:first-child button{font-size:12px;padding:9px}.payment-modes button{min-height:35px}.discount-controls select{min-width:80px;width:80px;flex-shrink:0}.sale-actions button{min-height:44px}#status{bottom:8px;right:8px}aside nav button{font-weight:400}@media(max-width:800px){.sale-layout{min-height:0}.sale-right>.sale-card:first-child{display:block}.sale-right>.sale-card:first-child h2{margin-bottom:10px}}.config-group-title{font-size:10px;font-weight:700;color:#a9c4d4;margin:18px 4px 6px}.config-group-title~button{font-size:12px;min-height:30px;padding:7px 12px}.configuration-form{max-width:1000px}.configuration-form .grid{gap:4px 24px}.configuration-form label{font-weight:500}.configuration-form input[type=checkbox]{align-self:flex-start}.connection-pending{padding:12px;background:#fff5df;border-left:3px solid #d99e21;font-size:12px}.receipt-logo{display:block;width:150px;max-width:80%;margin:0 auto 20px}#report.receipt80{max-width:80mm;font-size:11px}#report.receipt58{max-width:58mm;font-size:10px}#report.receipt58 h1,#report.receipt80 h1{font-size:17px}#report.receipt58 td,#report.receipt80 td,#report.receipt58 th,#report.receipt80 th{padding:5px;white-space:normal;font-size:9px}@media print{#report.receipt80{width:72mm;max-width:72mm!important}#report.receipt58{width:50mm;max-width:50mm!important}}/* Receipt rolls and A4 invoices use separate layouts. */
#report.thermal-receipt{font-family:Arial,sans-serif;background:white;color:#000;padding:4mm;margin:20px auto;border:1px solid #bbb;box-sizing:content-box;line-height:1.25;font-size:10px}
#report.thermal80{width:72mm;max-width:72mm!important}#report.thermal58{width:50mm;max-width:50mm!important}
#report.thermal-receipt p{font-size:10px;line-height:1.25;margin:4px 0;overflow-wrap:anywhere}#report.thermal-receipt h2{font-size:15px;margin:5px 0}#report.thermal-receipt h3{font-size:11px;border-top:1px dashed #000;border-bottom:1px dashed #000;padding:5px 0;margin:7px 0}
#report .thermal-center{text-align:center}#report .thermal-logo{display:block;width:38mm;height:auto;max-height:18mm;object-fit:contain;margin:0 auto 6px}
#report.thermal-receipt .table-wrap{border:0;border-radius:0;overflow:visible}#report.thermal-receipt table{table-layout:fixed;width:100%;font-size:10px}#report.thermal-receipt td,#report.thermal-receipt th{font-size:10px;padding:4px 1px;background:white;color:black;white-space:normal;overflow-wrap:anywhere;letter-spacing:0;border-bottom:1px dashed #999;text-align:right}
#report.thermal-receipt td:first-child,#report.thermal-receipt th:first-child{width:43%;text-align:left}#report.thermal-receipt td:nth-child(2),#report.thermal-receipt th:nth-child(2){width:13%}#report.thermal-receipt td:nth-child(3),#report.thermal-receipt th:nth-child(3){width:21%}
.thermal-amount{display:flex;justify-content:space-between;gap:6px;margin:5px 0}.thermal-amount span:last-child{text-align:right;white-space:nowrap}.thermal-strong{font-weight:700;font-size:12px;border-top:1px dashed black;padding-top:5px}#report.thermal-receipt .report-actions{flex-wrap:wrap}#report.thermal-receipt .report-actions button{font-size:11px;min-height:32px;padding:6px}
@media print{#report.thermal-receipt{padding:0!important;margin:0!important;border:0!important;box-sizing:border-box;color:black}#report.thermal-receipt .report-actions{display:none!important}#report.invoice-a4{width:auto!important;max-width:none!important}#report.thermal-receipt tr{break-inside:avoid}}
.company-logo-preview{display:block;max-width:260px;max-height:140px;object-fit:contain;margin:16px 0;border:1px solid #dce5ed;padding:10px;background:white}.company-logo-print{display:block;max-width:45mm;max-height:22mm;object-fit:contain;margin:0 0 10px}

.thermal-controls{display:flex;justify-content:center;flex-wrap:wrap;gap:10px;margin:24px auto 8px;padding:12px}.thermal-controls button{font-size:13px}@media print{body>#thermal-controls{display:none!important}}

.report-selector{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin:12px 0 22px}.report-selector button{text-align:left;background:white;color:#17374a;border:1px solid #ccdce5;padding:18px}.report-selector button small{display:block;font-weight:400;margin-top:8px}.report-selector button.selected{border:2px solid #00878b}.report-filters{display:flex;flex-wrap:wrap;gap:16px}.report-filters label{min-width:180px}

#report.detailed-sales-report{max-width:1200px}#report.detailed-sales-report table{font-size:11px}#report.detailed-sales-report td,#report.detailed-sales-report th{white-space:normal;overflow-wrap:anywhere;padding:7px}#report.detailed-sales-report td:nth-child(n+5):nth-child(-n+9){text-align:right}@media print{#report.detailed-sales-report table{font-size:9px}#report.detailed-sales-report thead{display:table-header-group}#report.detailed-sales-report tr{break-inside:avoid}}

.invoice-clickable{cursor:pointer}.invoice-clickable:hover{background:#e6f4f3}.invoice-clickable:focus{outline:2px solid #00878b;outline-offset:-2px}.invoice-reference{color:#006b91;text-decoration:underline}@media print{.invoice-reference{color:black;text-decoration:none}.invoice-clickable{cursor:default}}

.company-save-footer{position:sticky;bottom:-26px;background:white;border-top:1px solid #dce5ed;padding:12px 0;z-index:2;display:flex;justify-content:space-between;align-items:center;gap:12px}.company-save-feedback{margin:0;font-size:12px}

.brand img.brand-symbol{display:block;width:88px;height:88px;object-fit:contain;background:white;border-radius:10px;padding:8px;margin:0 auto}.brand:has(.brand-symbol){padding:0 0 22px}

.fiscal-identity{padding:16px;background:#edf5f8;border:1px solid #dbe5ed;border-radius:8px;margin-bottom:18px}.fiscal-proof{border-top:1px solid #ccd8e0;margin-top:16px;padding-top:12px;break-inside:avoid}.fiscal-proof p{overflow-wrap:anywhere}.fiscal-qr{margin:12px 0}.fiscal-qr img,.fiscal-qr canvas{width:30mm!important;height:30mm!important}@media print{.fiscal-proof a{font-size:10px}}

.fiscal-identity-fields{display:grid;grid-template-columns:1fr 1.5fr;gap:16px}.fiscal-identity-fields input[readonly]{background:#f1f4f6;font-weight:600}@media(max-width:600px){.fiscal-identity-fields{grid-template-columns:1fr}}

.product-classification-layout{display:grid;grid-template-columns:minmax(0,2fr) minmax(280px,1fr);gap:18px}.product-classification-layout .card{display:flex;flex-direction:column;gap:12px}@media(max-width:850px){.product-classification-layout{grid-template-columns:1fr}}

/* Shared Android phone/tablet workspace. */
.mobile-menu{display:none}@media screen and (max-width:800px){#workspace>aside{display:none;position:fixed;top:0;bottom:0;left:0;width:245px;z-index:60;overflow-y:auto;box-shadow:12px 0 40px #0004}body.mobile-menu-open #workspace>aside{display:block}.mobile-menu-open .mobile-menu{position:fixed;right:12px;top:12px;z-index:61}.mobile-menu{display:block;min-width:44px;min-height:44px;font-size:22px;padding:6px}.workspace{margin-left:0!important;padding:12px!important;min-width:0}#workspace header{display:flex;align-items:center;gap:12px;flex-wrap:wrap}#workspace header h1{font-size:23px;margin:4px 0}#identity{margin-left:auto}.pilot{font-size:11px;padding:8px}.sale-layout{display:flex;flex-direction:column;gap:12px;min-height:0}.sale-left,.sale-right{min-width:0}.sale-basket{min-height:180px}.sale-card{padding:12px}.sale-find{flex-wrap:wrap}.sale-find label{width:100%;min-width:0!important}.sale-find input{width:100%}.sale-right>.sale-card:first-child{display:block}.sale-right select{width:100%}.sale-actions{display:flex;position:static;gap:6px;flex-wrap:wrap}.sale-actions button{flex:1 1 28%;min-width:90px;min-height:46px}.sale-actions .complete-sale{flex-basis:100%;order:-1}.table-wrap{max-width:100%;overflow-x:auto}dialog{max-width:calc(100vw - 20px);padding:16px}.grid{grid-template-columns:1fr!important}input,select,textarea{font-size:16px}button{min-height:42px}.brand-symbol{width:70px;height:70px}#status{max-width:calc(100vw - 20px)}}

@media screen and (max-width:800px){
 #workspace>aside #nav{display:flex;flex-direction:column;align-items:stretch;gap:6px;overflow-x:hidden;width:100%}
 #workspace>aside #nav button{display:block;flex:none;width:100%;min-width:0;max-width:100%;white-space:normal;text-align:left;min-height:46px;padding:12px 14px;margin:0}
 #workspace>aside #nav .config-group-title{width:100%;margin:16px 4px 4px}
 #workspace>aside #logout{display:block;width:100%;text-align:left;margin-top:16px;min-height:46px}
}
.mobile-print-last{display:none}@media screen and (max-width:800px){#toolbar .mobile-print-last{display:block;width:100%;min-height:46px;background:var(--teal);color:white}.sale-actions{padding-bottom:calc(28px + env(safe-area-inset-bottom,0px));height:auto;overflow:visible}.sale-actions button{white-space:normal}#workspace .workspace{padding-bottom:calc(32px + env(safe-area-inset-bottom,0px))!important}}

/* Content-sized phone panels; retain desktop/tablet workspace heights. */
@media screen and (max-width:800px){
 .sale-layout,.sale-left,.sale-right{height:auto!important;min-height:0!important;gap:8px}
 .sale-basket,.sale-right>.sale-card,.sale-card:last-child{flex:0 0 auto!important;min-height:0!important;height:auto!important}
 .sale-basket .empty{padding:18px 10px}
 .sale-card{padding:10px;margin:0}
 .sale-card h2,.sale-basket h2{font-size:16px;margin:0 0 8px}
 .sale-card .summary-line{margin:8px 0}
 .sale-card label{margin:8px 0;gap:5px}
 .sale-card .muted{margin:6px 0;font-size:11px}
 .sale-find{padding:10px;gap:8px}
 .sale-find label{margin:0!important}
 .sale-find label:first-child{flex:1 1 100%}
 .sale-find label:not(:first-child){width:auto!important;flex:1 1 100px}
 .sale-find>button{flex:1 1 100px}
 .sale-find>.muted{flex-basis:100%;margin:0}
 .sale-right>.sale-card:first-child{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}
 .sale-right>.sale-card:first-child h2,.sale-right>.sale-card:first-child label{grid-column:1/-1}
 .sale-right>.sale-card:first-child select{width:100%}
 #toolbar{gap:6px;margin-bottom:8px}
 #toolbar .mobile-print-last{width:auto;min-height:42px;padding:8px 12px}
 #workspace header{margin-bottom:8px;padding-bottom:8px}
 .payment-modes{gap:5px;flex-wrap:wrap}.payment-modes button{min-width:0;flex:1 1 28%;padding:9px 5px}
 .sale-actions{gap:5px;margin-top:8px;padding-top:4px}
}
@media screen and (max-width:800px){.mobile-menu{font-size:14px;font-weight:700;min-width:64px;padding:10px 12px}}

.mobile-sections{display:none}
@media screen and (max-width:800px){.mobile-sections:not([hidden]){display:block;min-height:44px;padding:10px 12px;font-weight:700}.mobile-menu-open .mobile-menu{position:static}.mobile-menu-open .mobile-sections{position:fixed;right:12px;top:12px;z-index:61}}

.product-picker-tools{display:flex;gap:8px;align-items:center;position:sticky;top:0;background:white;padding:8px 0;z-index:2}.product-picker-tools input{flex:1;width:100%}.product-picker-tools button{flex-shrink:0}.product-picker-results{max-height:65vh;overflow-y:auto}.product-picker-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid #e0e8ee;min-height:60px}.product-picker-row>div:first-child{min-width:0}.product-picker-row strong,.product-picker-row small{display:block;overflow-wrap:anywhere}.product-picker-actions{display:flex;gap:5px;flex-shrink:0}.product-picker-actions button{padding:8px 10px;min-height:40px}dialog:has(.product-picker){max-height:90dvh;overflow-y:auto}#dialog-content.product-picker{height:auto;min-height:0}@media(max-width:800px){.product-picker-tools{flex-wrap:wrap}.product-picker-tools input{flex-basis:100%;padding:10px}.product-picker-tools button{padding:8px 12px}.product-picker-row{padding:8px 0;font-size:13px;min-height:58px}.product-picker-row small{font-size:11px;margin-top:3px}.product-picker-results{max-height:60dvh}.product-picker-actions button{font-size:12px;padding:8px;min-height:40px}}

/* Android viewport: keep controls inside the screen and basket lines readable. */
@media screen and (max-width:800px){
 html{min-width:0;scroll-padding-bottom:24px}
 body{min-width:0;overflow-wrap:anywhere}
 #workspace,.workspace,#content,#toolbar,.sale-layout,.sale-left,.sale-right{min-width:0;max-width:100%}
 #workspace .workspace{padding:10px max(10px,env(safe-area-inset-right,0px)) calc(16px + env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px))!important}
 #workspace header{gap:8px}
 #workspace header>div{min-width:0}
 #workspace header>div:has(#title){flex:1 1 120px}
 #workspace header h1{font-size:20px}
 #company{letter-spacing:1px;margin:4px 0}
 #identity{flex-basis:100%;font-size:12px;text-align:right}
 .login-card{width:auto;max-width:460px;margin:20px auto;padding:22px}
 input,select,textarea{max-width:100%;min-height:44px}
 label{min-width:0}
 #toolbar>label,.report-filters>label{min-width:0;flex:1 1 160px;max-width:100%}
 #toolbar input,#toolbar select,.report-filters input,.report-filters select,.configuration-form input,.configuration-form select,.configuration-form textarea{width:100%}
 .card,.metric{min-width:0;padding:14px}
 .metrics{grid-template-columns:repeat(auto-fit,minmax(min(140px,100%),1fr));gap:8px}
 .metric strong{font-size:24px}
 .report-selector{grid-template-columns:repeat(auto-fit,minmax(min(200px,100%),1fr))}
 .report-filters{gap:8px}
 .summary-line>*{min-width:0}
 .summary-line strong{text-align:right}
 .sale-right>.sale-card:first-child{grid-template-columns:minmax(0,1fr)}
 .sale-right>.sale-card:first-child button{width:100%}
 .sale-basket .table-wrap{overflow:visible;background:transparent}
 .sale-basket table,.sale-basket tbody{display:block;width:100%}
 .sale-basket thead{display:none}
 .sale-basket tbody tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:12px;border-top:1px solid #dae5ed}
 .sale-basket td{display:block;min-width:0!important;padding:0;border:0;white-space:normal;overflow-wrap:anywhere}
 .sale-basket td::before{display:block;color:#60788c;font-size:11px;margin-bottom:3px}
 .sale-basket td:first-child{grid-column:1/-1;font-weight:600;font-size:14px}
 .sale-basket td:nth-child(2){grid-column:span 2}
 .sale-basket td:nth-child(2)::before{content:'SKU'}
 .sale-basket td:nth-child(3)::before{content:'Unit'}
 .sale-basket td:nth-child(4)::before{content:'Qty'}
 .sale-basket td:nth-child(5)::before{content:'Rate'}
 .sale-basket td:nth-child(6)::before{content:'Amount'}
 .sale-basket td:last-child{grid-column:1/-1}
 .sale-basket .actions{flex-wrap:wrap;gap:8px}
 .sale-basket td button{min-height:44px;flex:1}
 .sale-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding-bottom:0}
 .sale-actions button{min-width:0;width:100%;min-height:46px}
 .sale-actions .complete-sale{grid-column:1/-1}
 dialog{width:calc(100% - 16px);max-width:640px;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);padding:14px;overscroll-behavior:contain}
 .dialog-heading{gap:10px;align-items:flex-start}
 .dialog-heading h2{min-width:0;font-size:18px}
 .dialog-heading button{flex-shrink:0}
 #dialog-content{min-width:0}
 .product-picker-results{max-height:50vh;max-height:50dvh}
 .product-picker-row{flex-wrap:wrap}
 .product-picker-row>div:first-child{flex:1 1 140px}
 .product-picker-actions{margin-left:auto}
 .company-save-footer{bottom:-14px;flex-wrap:wrap;padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}
 #status{left:10px;right:10px;bottom:calc(10px + env(safe-area-inset-bottom,0px));max-width:none}
 #report{padding:12px;max-width:100%;overflow-x:auto}
 #report .report-actions{flex-wrap:wrap}
 #report.thermal-receipt{box-sizing:border-box;max-width:calc(100% - 16px)!important}
 #workspace>aside{max-width:calc(100vw - 64px);padding-top:max(12px,env(safe-area-inset-top,0px));padding-bottom:max(12px,env(safe-area-inset-bottom,0px))}
}
@media screen and (max-width:480px){.login-card{margin:16px 10px}.payment-modes button{flex-basis:30%}}

/* Leave room for the Android status bar when the WebView draws edge to edge. */
@media screen and (max-width:800px){
 body{padding-top:max(32px,env(safe-area-inset-top,0px))}
 #workspace>aside{top:max(32px,env(safe-area-inset-top,0px));padding-top:12px}
 .mobile-menu-open .mobile-sections{top:calc(12px + max(32px,env(safe-area-inset-top,0px)))}
 dialog{max-height:calc(100vh - 64px);max-height:calc(100dvh - 64px)}
}

.remember-login{flex-direction:row;align-items:center;gap:10px;font-weight:400;cursor:pointer}
.remember-login input[type=checkbox]{flex:0 0 22px;width:22px;height:22px;min-height:22px;margin:0;accent-color:var(--teal)}

/* Compact sign-in spacing on phones while retaining comfortable touch targets. */
@media screen and (max-width:800px){
 #login.login-card{margin:8px auto;padding:16px;width:calc(100% - 20px);max-width:420px;border-radius:10px}
 #login .eyebrow{margin:0 0 6px;font-size:10px;letter-spacing:1px}
 #login h1{font-size:26px;margin:0 0 6px}
 #login p{margin:6px 0;line-height:1.4}
 #login form label{margin:10px 0;gap:4px}
 #login input:not([type=checkbox]){padding:10px;min-height:44px;width:100%}
 #login form .remember-login{margin:10px 0}
 #login button{margin:4px 0;min-height:44px;padding:10px}
 #login>p:last-child{font-size:11px;margin-bottom:0}
}

/* Compact phone selling screen: remove repeated panel spacing. */
@media screen and (max-width:800px){
 .sale-layout,.sale-left,.sale-right{gap:6px}
 .sale-find{padding:8px;gap:6px}
 .sale-find label:first-child{flex-basis:100%}
 .sale-find label:not(:first-child){flex:1 1 80px}
 .sale-find>button{flex:1 1 140px}
 .sale-find>.muted{display:none}
 .sale-find input,.sale-find select{padding:8px;min-height:44px}
 .sale-card{padding:8px}
 .sale-card h2{font-size:14px;margin-bottom:6px}
 .sale-card label{margin:6px 0;gap:4px}
 .sale-card .summary-line{margin:6px 0;gap:8px}
 .sale-card .sale-total{font-size:20px;margin:8px 0 0}
 .sale-card .muted{margin:4px 0;line-height:1.35}
 .sale-basket h2{padding:8px;margin:0;font-size:13px}
 .sale-basket .empty{padding:10px 8px;font-size:12px}
 .sale-basket tbody tr{padding:8px;gap:6px}
 .sale-right>.sale-card:first-child{grid-template-columns:minmax(0,1fr) auto;gap:6px}
 .sale-right>.sale-card:first-child h2,.sale-right>.sale-card:first-child label{grid-column:1/-1}
 .sale-right>.sale-card:first-child button{width:auto;min-height:44px;padding:8px;font-size:12px}
 .sale-right>.sale-card:first-child select{min-width:0;margin:0}
 .payment-modes{gap:4px}
 .payment-modes button{padding:8px 4px;min-height:44px;flex:1 1 17%;font-size:11px}
 .sale-actions{gap:5px;margin-top:6px;padding-top:0}
 #workspace .workspace{padding-top:6px!important}
 #workspace header{padding-bottom:5px;margin-bottom:6px;gap:6px}
 #workspace header h1{font-size:18px;margin:2px 0}
 #company{margin:2px 0}
 #identity{font-size:11px}
 #toolbar{margin-bottom:6px}
 .pilot{padding:6px 8px;margin-bottom:6px;line-height:1.3;font-size:10px}
}

@media screen and (max-width:800px){
 .sale-basket{min-height:0!important}
 .sale-basket .empty{padding:8px!important;min-height:0!important}
 .sale-right>.sale-card:first-child{padding-bottom:8px}
 .sale-right>.sale-card:first-child>label{margin:4px 0 0}
 #workspace header #identity{flex-basis:auto;margin-left:auto;max-width:100%;font-size:10px}
}

.developer-banner{display:flex;align-items:center;flex-wrap:wrap;gap:10px;background:#fff4db;border:1px solid #e7c277;border-radius:8px;padding:10px 12px;margin-bottom:12px;color:#67430c}.developer-banner span{font-size:12px}.developer-banner button{margin-left:auto;font-size:12px;padding:8px;min-height:40px}

.subscription-banner{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;padding:10px 12px;margin-bottom:10px;border:1px solid #e7c277;border-radius:8px;background:#fff8e8;font-size:12px}.subscription-banner button{padding:8px;font-size:12px}.subscription-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(180px,100%),1fr));gap:12px;margin:16px 0}.subscription-option{border:1px solid #dce5ec;border-radius:8px;padding:14px}.subscription-option button{width:100%}

/* Android feedback stays in the page instead of covering checkout controls. */
@media screen{body.android-app #status{position:static;inset:auto;z-index:auto;width:100%;max-width:none;margin:8px 0;padding:10px 12px;background:#e8f2f6;color:#17364c;border:1px solid #cddde7;border-radius:6px;font-size:12px;overflow-wrap:anywhere}}

/* Shared compact Android/phone layout; preserve 44px touch controls and print paper sizes. */
@media screen and (max-width:800px){
 :root{font-size:13px}
 #workspace .workspace{padding-left:max(8px,env(safe-area-inset-left,0px))!important;padding-right:max(8px,env(safe-area-inset-right,0px))!important;padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))!important}
 #content{display:flow-root}
 #content>p{margin:6px 0;line-height:1.4}
 #content>.card{margin:8px 0;padding:12px}
 #content>.card:first-child{margin-top:0}
 #content>.card:last-child{margin-bottom:0}
 h2{font-size:18px;line-height:1.25}
 h3{font-size:15px;margin:10px 0 6px}
 .card p,.metric p,dialog p{margin:6px 0;line-height:1.4}
 label,.sale-card label{margin:7px 0;gap:4px;min-width:0;line-height:1.3}
 input:not([type=checkbox]),select,textarea{padding:9px 10px;min-height:44px;max-width:100%;font-size:16px}
 input[type=checkbox],.configuration-form input[type=checkbox]{width:20px!important;max-width:20px;min-width:20px;min-height:20px;height:20px;flex:0 0 20px;margin:0}
 label:has(>input[type=checkbox]){flex-direction:row;align-items:center;gap:8px}
 button{min-height:44px;padding:9px 12px;white-space:normal;overflow-wrap:anywhere}
 .actions{gap:6px;margin-top:8px}
 #toolbar{gap:6px;margin-bottom:8px}
 #toolbar>label{flex:1 1 140px;margin:0;min-width:0}
 #toolbar input,#toolbar select{width:100%}
 .config-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-top:10px}
 .config-actions button{min-width:0;width:100%;font-size:12px}
 .configuration-form{max-width:100%;margin:0}
 .configuration-form .grid,form .grid{gap:2px 10px}
 .company-save-footer{gap:8px;padding:8px 0 calc(8px + env(safe-area-inset-bottom,0px))}
 .company-logo-preview{margin:8px 0;max-height:100px;max-width:100%;padding:6px}
 .empty{padding:14px 10px}
 td,th{padding:10px 8px}
 td button{min-height:44px}
 .table-wrap{margin:0;max-width:100%;overscroll-behavior-x:contain}
 .metrics{gap:8px}
 .metric{padding:14px}
 .metric strong{font-size:23px;margin-top:6px}
 dialog{padding:12px;margin:auto;max-height:calc(100dvh - 20px);width:calc(100% - 16px);min-height:0}
 .dialog-heading{gap:8px;margin-bottom:8px;align-items:center}
 .dialog-heading h2{font-size:18px;line-height:1.25}
 .dialog-heading button{padding:8px 10px;min-height:44px}
 #dialog-content{min-width:0;max-width:100%}
 #dialog-content>p:first-child{margin-top:0}
 #dialog-content form>button{margin-top:8px}
 .product-picker-tools{gap:6px;padding:6px 0}
 .product-picker-row{gap:6px;padding:6px 0;min-height:52px}
 .product-picker-actions button{min-height:44px}
 .product-picker-results{max-height:50dvh}
 .product-classification-layout{gap:8px}
 .product-classification-layout .card{padding:10px;gap:8px;margin:0}
 .fiscal-identity{padding:10px;margin-bottom:8px}
 .fiscal-identity-fields{gap:6px}
 .report-selector{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:8px 0 12px}
 .report-selector button{padding:10px;font-size:12px}
 .report-selector button small{margin-top:5px;font-size:11px}
 .report-filters{gap:6px}
 .report-filters label{flex:1 1 140px;min-width:0;margin:4px 0}
 .report-filters input,.report-filters select{width:100%}
 .report-actions,.thermal-controls{gap:6px;margin:8px auto;padding:8px;flex-wrap:wrap}
 #report:not(.thermal-receipt){margin:8px auto;padding:12px}
 .subscription-options{gap:8px;margin:8px 0}
 .subscription-option{padding:10px}
 .subscription-banner,.developer-banner{padding:8px;gap:6px;margin-bottom:8px}
 .goods-scanner{margin:10px 0;padding-top:8px;border-top:1px solid #dce6ed}
 .goods-scanner h2,.scanned-existing-stock h2{margin:0 0 6px;font-size:17px}
 .goods-scanner input{width:100%}
 .goods-scanner td input{width:110px}
 .goods-camera-picker,.product-camera-tools{margin:0 0 6px}
 .product-camera-tools p{margin:4px 0}
 .scanned-existing-stock>button{margin:6px 6px 0 0}
 #status:not(:empty){margin:6px 0}
}
@media screen and (min-width:600px) and (max-width:800px){
 form .grid,.configuration-form .grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .config-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media screen and (min-width:801px) and (max-width:1100px) and (max-height:600px){
 body.android-app #workspace>aside{display:none;position:fixed;inset:0 auto 0 0;width:245px;max-width:calc(100vw - 64px);padding:12px;z-index:60;overflow-y:auto;background:var(--navy)}
 body.android-app.mobile-menu-open #workspace>aside{display:block}
 body.android-app #workspace>aside #nav{display:flex;flex-direction:column;overflow-x:hidden}
 body.android-app #workspace>aside #nav button{width:100%;min-width:0;white-space:normal;margin:2px 0;min-height:44px}
 body.android-app #workspace .workspace{margin-left:0;padding:8px!important}
 body.android-app .mobile-menu,body.android-app .mobile-sections:not([hidden]){display:block;min-height:44px;font-size:13px;padding:8px 12px}
 body.android-app.mobile-menu-open .mobile-sections{position:fixed;top:10px;right:10px;z-index:61}
 body.android-app .sale-layout{min-height:0}
 body.android-app .sale-card:last-child{flex:0 0 auto}
 body.android-app dialog{max-height:calc(100dvh - 16px);padding:12px}
}
@media screen and (max-width:800px){.product-classification-layout{grid-template-columns:minmax(0,1fr)}.product-classification-layout>*{min-width:0;max-width:100%}}
@media screen and (max-width:1100px){dialog,dialog:has(.product-picker){max-height:calc(100dvh - max(32px,env(safe-area-inset-top,0px)) - max(24px,env(safe-area-inset-bottom,0px)) - 16px)}}
@media screen and (min-width:801px) and (max-width:1100px) and (max-height:600px){body.android-app{padding-top:max(32px,env(safe-area-inset-top,0px))}body.android-app #workspace>aside{top:max(32px,env(safe-area-inset-top,0px))}}
@media screen and (min-width:801px) and (max-width:1100px) and (max-height:600px){
 body.android-app .sale-layout{align-items:start;gap:8px}
 body.android-app .sale-left,body.android-app .sale-right{align-self:start;gap:8px}
 body.android-app .sale-basket{min-height:0;flex:0 0 auto}
 body.android-app .sale-basket .empty{padding:12px 10px}
 body.android-app .sale-card{padding:10px}
 body.android-app .sale-card label{margin:6px 0;gap:4px}
 body.android-app .sale-card .summary-line{margin:8px 0}
 body.android-app button,body.android-app .payment-modes button{min-height:44px}
 body.android-app input:not([type=checkbox]),body.android-app select{min-height:44px;font-size:16px;padding:8px}
}
@media screen and (max-width:800px){.company-save-footer{bottom:-12px}dialog label{margin:5px 0}dialog form .grid{row-gap:0}}
@media screen and (min-width:801px) and (max-width:1100px) and (max-height:600px){
 body.android-app .sale-find{padding:8px;gap:6px}
 body.android-app .sale-find label{min-width:0!important;margin:0}
 body.android-app .sale-find label:first-child{flex:1 1 100%}
 body.android-app .sale-find label:not(:first-child){flex:1 1 80px}
 body.android-app .sale-find>button{flex:1 1 100px}
 body.android-app .sale-find>.muted{display:none}
 body.android-app .company-save-footer{bottom:-12px}
}

/* Compact report reading on phones; printed reports keep their paper styling. */
@media screen and (max-width:600px){
 .report-selector button{font-size:11px;padding:8px}
 .report-selector button small{font-size:10px;line-height:1.3}
 #content:has(.report-selector) .card h2{font-size:16px}
 #content:has(.report-selector) .report-filters label{font-size:11px}
 #content:has(.report-selector) .card>p{font-size:11px;line-height:1.35}
 #content:has(.report-selector) .table-wrap table{font-size:10px}
 #content:has(.report-selector) .table-wrap th{font-size:9px;letter-spacing:0;white-space:normal}
 #content:has(.report-selector) .table-wrap td,#content:has(.report-selector) .table-wrap th{padding:6px 5px}
 #content:has(.report-selector) .table-wrap td{white-space:normal;overflow-wrap:anywhere}
 #report:not(.thermal-receipt){font-size:11px;padding:8px}
 #report:not(.thermal-receipt) h1{font-size:19px;margin:4px 0 8px}
 #report:not(.thermal-receipt) h2{font-size:16px;margin:6px 0}
 #report:not(.thermal-receipt) p{font-size:11px;line-height:1.35;margin:6px 0}
 #report:not(.thermal-receipt) table,#report.detailed-sales-report table{font-size:10px}
 #report:not(.thermal-receipt) td,#report:not(.thermal-receipt) th{font-size:10px;padding:5px 4px;white-space:normal;overflow-wrap:anywhere;letter-spacing:0}
 #report:not(.thermal-receipt) th{font-size:9px}
}

/* Fiscal document lists stay compact even with long provider references/errors. */
.fiscal-error summary,.fiscal-recovery summary{cursor:pointer;color:var(--teal)}.fiscal-error p{max-height:140px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere}.fiscal-recovery button{display:block;margin:4px 0}
@media screen and (max-width:800px){
 .fiscal-documents{width:100%;min-width:0;margin:6px 0}
 .fiscal-documents table{width:100%;table-layout:fixed;font-size:10px}
 .fiscal-documents th{font-size:9px;letter-spacing:0}
 .fiscal-documents td,.fiscal-documents th{padding:6px 4px;white-space:normal;overflow-wrap:anywhere;vertical-align:top}
 .fiscal-documents th:nth-child(1){width:10%}.fiscal-documents th:nth-child(2){width:24%}.fiscal-documents th:nth-child(3){width:15%}.fiscal-documents th:nth-child(4){width:12%}.fiscal-documents th:nth-child(5){width:15%}.fiscal-documents th:last-child{width:24%}
 .fiscal-documents .actions{margin:0;gap:4px;display:block}
 .fiscal-documents button{font-size:10px;line-height:1.25;min-height:44px;width:100%;padding:5px}
 .fiscal-documents summary{font-size:10px;line-height:1.25;min-height:44px;display:flex;align-items:center}
 .fiscal-documents .fiscal-error p{font-size:10px;margin:4px 0;max-height:120px}
 .fiscal-documents .fiscal-recovery button{margin:4px 0 0}
 .fiscal-registration-recovery th:nth-child(4){width:22%}
}

.fiscal-reference summary{cursor:pointer;color:var(--teal);font-family:inherit}.fiscal-reference code{display:block;white-space:normal;overflow-wrap:anywhere;font-size:inherit;margin-top:4px}

/* Export the original print layout independently of the compact phone preview. */
@media screen{
 body.original-pdf-export{margin:0!important;padding:0!important;background:white;color:black}
 body.original-pdf-export>*:not(#report){display:none!important}
 body.original-pdf-export>#report{display:block!important;position:static!important;margin:0!important;border:0!important;box-shadow:none!important;overflow:visible!important;transform:none!important}
 body.original-pdf-export #report .report-actions,body.original-pdf-export #report button{display:none!important}
 body.original-pdf-export #report:not(.thermal-receipt){width:182mm!important;max-width:182mm!important;padding:0!important;box-sizing:border-box;font-size:13px;color:#133045}
 body.original-pdf-export #report:not(.thermal-receipt) h1{font-size:24px;margin:7px 0 20px}
 body.original-pdf-export #report:not(.thermal-receipt) h2{font-size:21px;margin:0}
 body.original-pdf-export #report:not(.thermal-receipt) p{font-size:13px;line-height:1.6;margin:13px 0}
 body.original-pdf-export #report:not(.thermal-receipt) table{font-size:10px;table-layout:auto;width:100%}
 body.original-pdf-export #report:not(.thermal-receipt) td,body.original-pdf-export #report:not(.thermal-receipt) th{font-size:10px;padding:8px;white-space:normal;overflow-wrap:anywhere}
 body.original-pdf-export #report .table-wrap{overflow:visible;max-width:none}
 body.original-pdf-export #report.thermal-receipt{padding:0!important;border:0!important;box-sizing:content-box!important}
 body.original-pdf-export #report.thermal80{width:72mm!important;max-width:72mm!important}
 body.original-pdf-export #report.thermal58{width:50mm!important;max-width:50mm!important}
}
/* Strong ink for invoice previews, printed invoices and original PDF sharing. */
#report.invoice-a4,#report.thermal-receipt{font-family:Arial,Helvetica,sans-serif!important;color:#000!important;background:#fff!important}
#report.invoice-a4 :is(h1,h2,h3,p,td,th,span,small,a),
#report.thermal-receipt :is(h1,h2,h3,p,td,th,span,small,a){font-family:Arial,Helvetica,sans-serif!important;color:#000!important;-webkit-text-fill-color:#000;opacity:1}
#report.invoice-a4 :is(p,td,small),#report.thermal-receipt :is(p,td,small){font-weight:600}
#report.invoice-a4 :is(h1,h2,h3,th),#report.thermal-receipt :is(h1,h2,h3,th){font-weight:700}
#report.invoice-a4 :is(td,th){border-bottom:1px solid #777}
#report.invoice-a4 th{background:#eee;letter-spacing:0}
#report.invoice-a4 .table-wrap,#report.invoice-a4 .fiscal-proof{border-color:#777}
#report.invoice-a4 .invoice-tax-summary tr:last-child{font-weight:700}
@media print{#report.invoice-a4,#report.thermal-receipt{print-color-adjust:exact;-webkit-print-color-adjust:exact}}
