:root{--bg:#f4f7fb;--panel:#fff;--ink:#0f172a;--muted:#64748b;--line:#dbe4ee;--brand:#0f766e;--brand2:#14b8a6;--brand-soft:#ecfdf5;--blue:#2563eb;--red:#dc2626;--orange:#ea580c;--shadow:0 18px 45px rgba(15,23,42,.09)}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:"SolaimanLipi","Noto Sans Bengali","Segoe UI",Arial,sans-serif;color:var(--ink);background:var(--bg)}button,input,select,textarea{font:inherit}button,a{transition:.16s ease}.hidden{display:none!important}.toast{position:fixed;right:22px;top:20px;z-index:2000;max-width:420px;padding:12px 16px;border-radius:12px;background:#0f172a;color:#fff;opacity:0;pointer-events:none;transform:translateY(-8px);transition:.2s}.toast.show{opacity:1;transform:none}.toast.error{background:#991b1b}.toast.success{background:#166534}
.auth-page{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at top left,#ccfbf1 0,transparent 32%),radial-gradient(circle at bottom right,#dbeafe 0,transparent 34%),#f8fafc}.auth-card{width:min(1180px,100%);min-height:690px;display:grid;grid-template-columns:1.08fr .92fr;background:#fff;border:1px solid #dbe7ef;border-radius:28px;overflow:hidden;box-shadow:0 30px 80px rgba(15,23,42,.12)}.auth-showcase{padding:56px;background:linear-gradient(150deg,#042f2e 0%,#0f766e 58%,#115e59 100%);color:#fff;display:flex;flex-direction:column;justify-content:center}.brand-icon{width:96px;height:96px;border-radius:24px;box-shadow:0 16px 40px rgba(0,0,0,.22);margin-bottom:22px}.eyebrow{font-family:Arial,sans-serif;font-size:12px;letter-spacing:1.6px;color:#99f6e4;font-weight:800}.auth-showcase h1{font-size:46px;line-height:1.08;margin:12px 0 18px}.auth-showcase>p{font-size:18px;line-height:1.7;color:#d9fffa;max-width:610px}.feature-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:22px}.feature-grid div{padding:13px 14px;border:1px solid rgba(255,255,255,.17);background:rgba(255,255,255,.08);border-radius:14px;font-weight:700}.privacy-note{margin-top:24px;font-size:12px;line-height:1.6;color:#ccfbf1;background:rgba(0,0,0,.12);padding:12px 14px;border-radius:12px}.auth-panel{padding:36px;display:flex;flex-direction:column;justify-content:center}.installer-strip{border:1px solid #cbd5e1;border-radius:16px;padding:14px;background:#f8fafc;margin-bottom:18px}.installer-strip>div:first-child{display:flex;justify-content:space-between;gap:12px;align-items:baseline}.installer-strip small{color:var(--muted)}.installer-links{display:flex;flex-wrap:wrap;gap:7px;margin-top:10px}.installer-links a,.installer-links button,.all-installers{border:1px solid #99f6e4;background:#ecfdf5;color:#115e59;text-decoration:none;border-radius:9px;padding:7px 10px;font-size:12px;font-weight:800;cursor:pointer}.all-installers{display:block;text-align:center;margin-top:12px}.auth-tabs{display:grid;grid-template-columns:1fr 1fr;border-bottom:1px solid var(--line);margin-bottom:20px}.auth-tabs button{border:0;background:none;padding:12px;font-weight:900;color:#64748b;border-bottom:3px solid transparent}.auth-tabs button.active{color:var(--brand);border-color:var(--brand)}.auth-form h2{font-size:27px;margin:0 0 4px}.auth-form h2 span{font-size:11px;padding:4px 7px;border-radius:999px;background:#ccfbf1;color:#115e59;vertical-align:middle}.auth-form>p{margin:0 0 18px;color:var(--muted);font-size:13px}.auth-form label,.form-grid label{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:900;color:#334155}.auth-form input,.form-grid input,.form-grid select,.form-grid textarea,.toolbar input,.toolbar select,.pos-search input{border:1px solid #cbd5e1;border-radius:10px;padding:10px 11px;background:#fff;color:var(--ink);outline:none;min-width:0}.auth-form input:focus,.form-grid input:focus,.form-grid select:focus,.form-grid textarea:focus,.toolbar input:focus,.pos-search input:focus{border-color:#2dd4bf;box-shadow:0 0 0 3px rgba(45,212,191,.14)}.auth-form{display:grid;gap:12px}.primary,.secondary,.ghost,.danger-btn,.icon-btn,.mini-btn{border-radius:10px;border:1px solid transparent;cursor:pointer;font-weight:900}.primary{background:var(--brand);border-color:var(--brand);color:#fff;padding:10px 14px}.primary:hover{background:#115e59}.secondary{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8;padding:10px 14px}.ghost{background:#fff;border-color:#cbd5e1;color:#334155;padding:9px 12px}.danger-btn{background:#fff1f2;border-color:#fecdd3;color:#be123c;padding:8px 11px}.full{width:100%}.small{padding:8px 11px;font-size:12px}.auth-status{padding:10px 12px;border-radius:10px;margin-top:12px;font-size:12px}.auth-status.error{background:#fff1f2;color:#9f1239;border:1px solid #fecdd3}.auth-status.success{background:#f0fdf4;color:#166534;border:1px solid #bbf7d0}.device-line{display:flex;justify-content:space-between;gap:10px;color:#64748b;font-size:10px;margin-top:12px;word-break:break-all}
.app-shell{min-height:100vh;display:grid;grid-template-columns:268px 1fr}.sidebar{position:sticky;top:0;height:100vh;background:linear-gradient(180deg,#0b1f2a,#0f3e46 48%,#115e59);color:#fff;display:flex;flex-direction:column;z-index:50;box-shadow:18px 0 40px rgba(15,23,42,.08)}.side-brand{display:flex;align-items:center;gap:11px;padding:18px 14px;border-bottom:1px solid rgba(255,255,255,.1)}.side-brand img{width:44px;height:44px;border-radius:12px}.side-brand strong{display:block;font-size:16px}.side-brand small{display:block;color:#99f6e4;font-size:10px}.side-brand>div{flex:1}.side-brand button{display:none;background:none;border:0;color:#fff;font-size:25px}.nav-search{padding:10px 10px 2px}.nav-search input{width:100%;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.09);color:#fff;border-radius:10px;padding:9px 10px;outline:none}.nav-search input::placeholder{color:#d1fae5}.sidebar nav{padding:10px;overflow:auto;display:grid;gap:5px}.nav-btn{border:1px solid transparent;background:transparent;color:#d7fffa;text-align:left;padding:10px 11px;border-radius:11px;cursor:pointer;font-weight:800}.nav-btn:hover,.nav-btn.active{background:rgba(255,255,255,.11);border-color:rgba(255,255,255,.13);color:#fff}.side-bottom{margin-top:auto;padding:12px;border-top:1px solid rgba(255,255,255,.1);display:grid;gap:8px}.side-bottom button{border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.08);color:#fff;border-radius:10px;padding:9px;cursor:pointer;font-weight:800}.side-bottom .danger{color:#fecaca}.workspace{min-width:0}.topbar{position:sticky;top:0;z-index:40;min-height:76px;background:rgba(255,255,255,.92);backdrop-filter:blur(10px);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:14px;padding:12px 20px}.topbar h2{margin:0;font-size:23px}.topbar p{margin:3px 0 0;color:var(--muted);font-size:11px}.icon-btn{display:none;background:#fff;border-color:#cbd5e1;padding:8px 10px}.top-actions{margin-left:auto;display:flex;gap:8px;align-items:center}.badge{display:inline-flex;align-items:center;padding:6px 9px;border-radius:999px;background:#ecfdf5;border:1px solid #99f6e4;color:#115e59;font-size:10px;font-weight:900}.content{padding:20px;max-width:1700px;margin:auto}.page-head{display:flex;justify-content:space-between;align-items:flex-end;gap:14px;margin-bottom:14px}.page-head h3{margin:0;font-size:20px}.page-head p{margin:4px 0 0;color:var(--muted);font-size:12px}.head-actions{display:flex;gap:8px;flex-wrap:wrap}.stats-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin-bottom:18px}.stat-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:15px;box-shadow:0 8px 20px rgba(15,23,42,.04)}.stat-card span{display:block;color:var(--muted);font-size:11px;font-weight:800}.stat-card strong{display:block;font-family:"Times New Roman",serif;font-size:22px;margin-top:6px}.stat-card.em{background:linear-gradient(135deg,#ecfdf5,#f0fdfa);border-color:#99f6e4}.stat-card.warn{background:#fff7ed;border-color:#fed7aa}.stat-card.red{background:#fff1f2;border-color:#fecdd3}.panel{background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:0 10px 25px rgba(15,23,42,.045);overflow:hidden}.panel-head{padding:13px 15px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:10px;align-items:center}.panel-head h4{margin:0}.panel-body{padding:15px}.two-col{display:grid;grid-template-columns:1fr 1fr;gap:14px}.three-col{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:12px}.toolbar input[type=search]{min-width:260px;flex:1}.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:12px}.data-table{width:100%;border-collapse:collapse;min-width:900px;background:#fff}.data-table th{position:sticky;top:0;background:#f8fafc;color:#475569;font-size:10px;text-transform:none;letter-spacing:.1px;text-align:left;padding:9px;border-bottom:1px solid var(--line);z-index:1}.data-table td{padding:9px;border-bottom:1px solid #edf2f7;font-size:12px;vertical-align:middle}.data-table tr:hover td{background:#fbfefd}.money{font-family:"Times New Roman",serif;font-weight:700;white-space:nowrap}.due{color:#b91c1c;font-weight:900}.paid{color:#166534;font-weight:900}.low-stock{color:#c2410c;font-weight:900}.thumb{width:48px;height:48px;object-fit:cover;border-radius:9px;border:1px solid #dbe4ee;background:#f8fafc}.actions{display:flex;gap:5px;white-space:nowrap}.mini-btn{padding:5px 8px;background:#fff;border-color:#cbd5e1;color:#334155;font-size:10px}.mini-btn.edit{color:#1d4ed8;border-color:#bfdbfe;background:#eff6ff}.mini-btn.delete{color:#be123c;border-color:#fecdd3;background:#fff1f2}.mini-btn.print{color:#0f766e;border-color:#99f6e4;background:#ecfdf5}.empty{padding:32px;text-align:center;color:#94a3b8}.form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.form-grid .span2{grid-column:span 2}.form-grid .span3{grid-column:1/-1}.form-grid textarea{min-height:80px;resize:vertical}.form-actions{grid-column:1/-1;display:flex;justify-content:flex-end;gap:8px;padding-top:5px}.image-picker{display:flex;gap:10px;align-items:center}.image-preview{width:86px;height:86px;object-fit:cover;border-radius:12px;border:1px solid var(--line);background:#f8fafc}.help{font-size:10px;color:var(--muted);font-weight:500}
.product-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}.product-card{border:1px solid var(--line);border-radius:15px;background:#fff;overflow:hidden;cursor:pointer;text-align:left;padding:0}.product-card:hover{transform:translateY(-2px);box-shadow:0 12px 24px rgba(15,23,42,.09)}.product-card img{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;background:#f1f5f9}.product-card .pc-body{padding:10px}.product-card b{display:block;font-size:13px}.product-card small{color:var(--muted);display:block;margin-top:3px}.product-card .pc-foot{display:flex;justify-content:space-between;gap:8px;margin-top:8px;font-size:11px}.pos-layout{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(380px,.65fr);gap:14px}.pos-catalog,.pos-cart{background:#fff;border:1px solid var(--line);border-radius:16px;overflow:hidden}.pos-search{padding:12px;border-bottom:1px solid var(--line)}.pos-search input{width:100%}.pos-products{padding:12px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;max-height:calc(100vh - 210px);overflow:auto}.pos-product{border:1px solid var(--line);background:#fff;border-radius:12px;overflow:hidden;text-align:left;cursor:pointer}.pos-product:hover{border-color:#5eead4;box-shadow:0 7px 15px rgba(15,118,110,.08)}.pos-product img{width:100%;aspect-ratio:4/3;object-fit:cover}.pos-product div{padding:8px}.pos-product b{font-size:11px;display:block}.pos-product small{font-size:9px;color:var(--muted)}.pos-cart{display:flex;flex-direction:column;max-height:calc(100vh - 112px);position:sticky;top:92px}.cart-head{padding:12px 14px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between}.cart-list{overflow:auto;min-height:160px;flex:1}.cart-row{display:grid;grid-template-columns:1fr 72px 86px 28px;gap:6px;align-items:center;padding:8px 10px;border-bottom:1px solid #edf2f7}.cart-row b{font-size:11px}.cart-row small{display:block;color:var(--muted);font-size:9px}.cart-row input{width:100%;border:1px solid #cbd5e1;border-radius:7px;padding:6px;font-size:11px}.cart-row button{border:0;background:#fff1f2;color:#be123c;border-radius:7px;padding:5px;cursor:pointer}.cart-footer{border-top:1px solid var(--line);padding:12px;display:grid;gap:8px}.cart-footer .row{display:grid;grid-template-columns:1fr 1fr;gap:8px}.cart-footer label{font-size:10px;font-weight:800;color:#475569}.cart-footer input,.cart-footer select{width:100%;border:1px solid #cbd5e1;border-radius:8px;padding:7px}.totals{background:#f8fafc;border-radius:10px;padding:9px;display:grid;gap:4px}.totals div{display:flex;justify-content:space-between}.totals strong{font-size:16px}.list-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.list-card{border:1px solid var(--line);border-radius:14px;padding:13px;background:#fff}.list-card h4{margin:0 0 8px}.list-card p{margin:3px 0;color:#475569;font-size:11px}.progress{height:8px;background:#e2e8f0;border-radius:999px;overflow:hidden}.progress i{display:block;height:100%;background:#14b8a6}.summary-list{display:grid;gap:8px}.summary-row{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px dashed #e2e8f0}.summary-row:last-child{border-bottom:0}.invoice-paper{font-family:"Times New Roman","SolaimanLipi",serif;background:#fff;color:#111;width:780px;max-width:100%;margin:auto;padding:28px}.invoice-header{text-align:center;border-bottom:2px solid #111;padding-bottom:12px}.invoice-header h1{margin:0;font-size:28px}.invoice-meta{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:16px 0}.invoice-paper table{width:100%;border-collapse:collapse}.invoice-paper th,.invoice-paper td{border:1px solid #777;padding:7px;font-size:12px}.invoice-totals{margin-left:auto;width:310px;margin-top:12px}.invoice-totals div{display:flex;justify-content:space-between;border-bottom:1px solid #ddd;padding:5px}.invoice-footer{margin-top:28px;display:flex;justify-content:space-between;color:#555;font-size:11px}.modal{position:fixed;inset:0;background:rgba(15,23,42,.48);display:grid;place-items:center;padding:18px;z-index:1000}.modal-card{width:min(1050px,96vw);max-height:92vh;background:#fff;border-radius:18px;box-shadow:0 28px 80px rgba(15,23,42,.3);display:flex;flex-direction:column;overflow:hidden}.modal-head{display:flex;justify-content:space-between;align-items:center;padding:13px 16px;border-bottom:1px solid var(--line)}.modal-head h3{margin:0}.modal-head button{border:0;background:#f1f5f9;border-radius:9px;width:34px;height:34px;font-size:20px;cursor:pointer}.modal-body{padding:16px;overflow:auto}.line-items{grid-column:1/-1;border:1px solid var(--line);border-radius:12px;overflow:hidden}.line-head,.line-row{display:grid;grid-template-columns:2fr .8fr .9fr .8fr 34px;gap:7px;padding:7px 9px;align-items:center}.line-head{background:#f8fafc;font-size:10px;font-weight:900;color:#475569}.line-row{border-top:1px solid #edf2f7}.line-row select,.line-row input{width:100%;border:1px solid #cbd5e1;border-radius:7px;padding:7px}.line-row button{border:0;background:#fff1f2;color:#be123c;border-radius:7px;height:30px}.line-add{margin:8px}.report-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.report-card{padding:14px;border:1px solid var(--line);border-radius:14px;background:#fff}.report-card span{font-size:10px;color:var(--muted)}.report-card strong{display:block;font-size:20px;margin-top:5px}.sidebar-backdrop{display:none}
@media(max-width:1350px){.stats-grid{grid-template-columns:repeat(3,1fr)}.product-grid{grid-template-columns:repeat(4,1fr)}.pos-products{grid-template-columns:repeat(3,1fr)}}
@media(max-width:1000px){.app-shell{grid-template-columns:1fr}.sidebar{position:fixed;left:-285px;width:268px;transition:.2s}.sidebar.open{left:0}.side-brand button,.icon-btn{display:block}.sidebar-backdrop{display:block;position:fixed;inset:0;background:rgba(15,23,42,.38);z-index:45;border:0;opacity:0;pointer-events:none}.sidebar-backdrop.show{opacity:1;pointer-events:auto}.pos-layout{grid-template-columns:1fr}.pos-cart{position:static;max-height:none}.auth-card{grid-template-columns:1fr}.auth-showcase{display:none}.product-grid{grid-template-columns:repeat(3,1fr)}.form-grid{grid-template-columns:1fr 1fr}.stats-grid{grid-template-columns:repeat(2,1fr)}.report-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:650px){.content{padding:10px}.topbar{padding:10px}.top-actions .badge,.top-actions .ghost{display:none}.product-grid{grid-template-columns:repeat(2,1fr)}.pos-products{grid-template-columns:repeat(2,1fr)}.form-grid{grid-template-columns:1fr}.form-grid .span2,.form-grid .span3{grid-column:1}.two-col,.three-col,.list-cards{grid-template-columns:1fr}.auth-panel{padding:24px}.feature-grid{grid-template-columns:1fr}.stats-grid{grid-template-columns:1fr 1fr}.page-head{align-items:flex-start;flex-direction:column}.invoice-paper{padding:14px}.invoice-meta{grid-template-columns:1fr}.line-head{display:none}.line-row{grid-template-columns:1fr 1fr}.line-row>*:first-child{grid-column:1/-1}.line-row button{grid-column:1/-1}}
@media print{body>*:not(#modal){display:none!important}.modal{position:static;background:#fff;padding:0;display:block!important}.modal-card{box-shadow:none;max-height:none;width:100%;border-radius:0}.modal-head{display:none}.modal-body{padding:0;overflow:visible}.invoice-paper{width:100%;padding:0}.toast{display:none}}

/* V2: cash/credit indicators, quick payment and printable lists */
.pay-mode-buttons{display:flex;gap:7px;flex-wrap:wrap;margin:7px 0 10px}.pay-mode-buttons .mini-btn{flex:1;min-width:110px;font-weight:900}.payment-chip{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;border-radius:999px;font-size:10px;font-weight:900;white-space:nowrap}.payment-chip.cash{background:#ecfdf5;color:#166534;border:1px solid #bbf7d0}.payment-chip.partial{background:#fff7ed;color:#c2410c;border:1px solid #fed7aa}.payment-chip.credit{background:#fff1f2;color:#be123c;border:1px solid #fecdd3}.print-actions{text-align:center;margin-top:18px}.list-report table{width:100%;border-collapse:collapse;margin-top:14px}.list-report th,.list-report td{border:1px solid #cbd5e1;padding:7px 8px;text-align:left;font-size:11px}.list-report th{background:#f8fafc}.list-report .invoice-totals{margin-left:auto;max-width:420px}.demo-note{background:#ecfeff;border:1px solid #a5f3fc;border-radius:12px;padding:10px;color:#155e75}
@media print{.print-actions{display:none!important}.payment-chip{border:0!important;padding:0!important;background:none!important;color:#111!important}}

/* V3: customer search, previous due and editable combo boxes */
.editable-combo{display:flex;gap:5px;align-items:center;width:100%}.editable-combo select{flex:1;min-width:0}.combo-actions{display:flex;gap:3px;flex:0 0 auto}.combo-actions .mini-btn{padding:6px 7px;min-width:29px}.entity-combo select{min-width:0}.customer-search-box{border:1px solid #cbd5e1;border-radius:11px;padding:9px;background:#f8fafc}.customer-search-head{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-bottom:7px}.customer-search-head b{font-size:11px}.customer-search-box>input{width:100%;border:1px solid #cbd5e1;border-radius:8px;padding:8px;background:#fff}.customer-results{max-height:170px;overflow:auto;margin-top:6px;display:grid;gap:4px}.customer-result{display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;border:1px solid #dbe4ee;background:#fff;border-radius:9px;padding:7px 8px;text-align:left;cursor:pointer}.customer-result:hover{border-color:#5eead4;background:#f0fdfa}.customer-result span{min-width:0}.customer-result b{display:block;font-size:11px}.customer-result small,.customer-hint{display:block;color:#64748b;font-size:9px}.customer-result strong{font-size:10px;white-space:nowrap}.customer-not-found{font-size:10px;color:#64748b;padding:7px;background:#fff7ed;border:1px solid #fed7aa;border-radius:8px}.selected-customer-card{margin-top:7px;border:1px solid #99f6e4;background:#ecfdf5;border-radius:9px;padding:8px;display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:10px}.selected-customer-card>div{display:flex;flex-direction:column;gap:2px}.selected-customer-card>div:last-child{align-items:flex-end}.selected-customer-card b{font-size:11px}.selected-customer-card small{color:#475569}.previous-due-row{border-top:1px dashed #fecaca;padding-top:5px;margin-top:3px}.grand-due-row{border-top:2px solid #fecaca;padding-top:5px;margin-top:3px}.grand-invoice-due{font-size:14px;border-top:2px solid #111!important;margin-top:4px;padding-top:7px!important}.combo-manager-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.combo-manager-item{border:1px solid #dbe4ee;border-radius:12px;padding:10px;background:#f8fafc}.combo-manager-item>b{display:block;font-size:11px;margin-bottom:7px}
@media(max-width:1000px){.combo-manager-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:650px){.combo-manager-grid{grid-template-columns:1fr}.selected-customer-card{align-items:flex-start;flex-direction:column}.selected-customer-card>div:last-child{align-items:flex-start}}

/* V5: Live Talk-to-Text and voice-enabled combo/select controls */
.voice-input-wrap{position:relative;display:flex;width:100%;min-width:0;align-items:stretch}.voice-input-wrap>input,.voice-input-wrap>textarea{width:100%!important;min-width:0;padding-right:38px!important}.voice-input-wrap>textarea{min-height:76px}.voice-mic-btn{position:absolute;right:5px;top:50%;transform:translateY(-50%);width:28px;height:28px;border:1px solid #99f6e4;border-radius:8px;background:#ecfdf5;color:#0f766e;display:grid;place-items:center;padding:0;cursor:pointer;z-index:2;font-size:14px;line-height:1}.voice-textarea-wrap .voice-mic-btn{top:6px;transform:none}.voice-mic-btn:hover,.voice-select-btn:hover{background:#ccfbf1}.voice-mic-btn.listening,.voice-select-btn.listening{background:#fff1f2;border-color:#fecdd3;color:#be123c;animation:voicePulse 1s infinite}.voice-select-wrap{display:flex;align-items:center;gap:4px;width:100%;min-width:0}.voice-select-wrap>select{flex:1;min-width:0}.voice-select-btn{border:1px solid #99f6e4!important;background:#ecfdf5!important;color:#0f766e!important;border-radius:8px!important;min-width:30px;height:30px;padding:4px 6px!important;cursor:pointer}.editable-combo .voice-select-btn{height:auto;min-height:29px}.voice-toolbar{position:fixed;left:50%;right:auto;bottom:max(4px,env(safe-area-inset-bottom));transform:translateX(-50%);z-index:1200;display:flex;align-items:center;justify-content:center;gap:7px;background:rgba(15,23,42,.94);color:#fff;border:1px solid rgba(255,255,255,.18);border-radius:999px;padding:6px 8px;box-shadow:0 10px 30px rgba(15,23,42,.25);backdrop-filter:blur(8px);max-width:calc(100vw - 20px);white-space:nowrap}.voice-toolbar.voice-toolbar-docked{z-index:1320}.voice-toolbar-anchor-scope{padding-bottom:0!important}.voice-lang-toggle{border:0;background:#0f766e;color:#fff;border-radius:999px;padding:7px 10px;font-size:10px;font-weight:900;cursor:pointer}.voice-privacy{font-size:9px;opacity:.86;padding-right:5px}.voice-prompt-overlay{position:fixed;inset:0;z-index:1400;background:rgba(15,23,42,.52);display:grid;place-items:center;padding:16px}.voice-prompt-card{width:min(460px,95vw);background:#fff;border-radius:16px;padding:16px;box-shadow:0 25px 70px rgba(15,23,42,.35);display:grid;gap:10px}.voice-prompt-card h4{margin:0;font-size:15px}.voice-prompt-card label{font-size:10px;font-weight:900}.voice-prompt-card input{margin-top:5px;width:100%;border:1px solid #cbd5e1;border-radius:9px;padding:9px}.voice-prompt-card small{color:#64748b}.voice-prompt-actions{display:flex;justify-content:flex-end;gap:7px}.customer-search-box>.voice-input-wrap{width:100%}.customer-search-box>.voice-input-wrap>input{border:1px solid #cbd5e1;border-radius:8px;padding:8px 38px 8px 8px;background:#fff}.cart-row>.voice-input-wrap{min-width:0}.line-row>.voice-input-wrap,.line-row>.voice-select-wrap{min-width:0}@keyframes voicePulse{0%,100%{box-shadow:0 0 0 0 rgba(225,29,72,.25)}50%{box-shadow:0 0 0 7px rgba(225,29,72,0)}}
@media(max-width:650px){.voice-toolbar{left:50%;right:auto;bottom:max(4px,env(safe-area-inset-bottom));transform:translateX(-50%);max-width:calc(100vw - 12px);overflow-x:auto}.voice-toolbar-anchor-scope{padding-bottom:0!important}.voice-privacy{display:none}.voice-mic-btn{width:30px;height:30px}.voice-select-btn{min-width:32px}}
@media print{.voice-toolbar,.voice-mic-btn,.voice-select-btn,.voice-prompt-overlay{display:none!important}.voice-input-wrap,.voice-select-wrap{display:contents!important}}

.voice-support-state{font-size:11px;opacity:.85;white-space:nowrap}.voice-toolbar .voice-support-state{margin-left:6px}

/* V7: everywhere Text Search + Continuous Live Mic Search */
.select-search-shell{display:grid;grid-template-columns:1fr;gap:4px;min-width:0;flex:1}.select-text-search{width:100%;min-width:0;border:1px solid #cbd5e1;border-radius:8px;padding:6px 36px 6px 8px!important;background:#f8fafc;color:#0f172a;font-size:10px}.editable-combo>.select-search-shell{flex:1}.voice-select-wrap>.select-search-shell{flex:1}.line-row .select-search-shell{min-width:0}.line-row .select-text-search{padding-top:5px!important;padding-bottom:5px!important}.global-search{position:relative;min-width:300px;max-width:420px;flex:1}.global-search>.voice-input-wrap{width:100%}.global-search input{width:100%;border:1px solid #cbd5e1;border-radius:999px;padding:9px 42px 9px 14px;background:#fff;outline:none}.global-search input:focus{border-color:#14b8a6;box-shadow:0 0 0 3px rgba(20,184,166,.12)}.global-search-results{position:absolute;left:0;right:0;top:calc(100% + 7px);z-index:800;background:#fff;border:1px solid #cbd5e1;border-radius:13px;box-shadow:0 18px 45px rgba(15,23,42,.16);max-height:360px;overflow:auto;padding:6px}.global-search-results button{display:flex;flex-direction:column;gap:2px;width:100%;text-align:left;border:0;background:#fff;border-radius:9px;padding:8px 9px;cursor:pointer}.global-search-results button:hover{background:#ecfdf5}.global-search-results small{font-size:9px;color:#0f766e;font-weight:900}.global-search-results b{font-size:11px;color:#0f172a}.global-search-empty{padding:12px;color:#64748b;font-size:11px;text-align:center}.toolbar .voice-input-wrap{flex:1;min-width:220px}.toolbar .voice-input-wrap input[type="search"]{width:100%}.nav-search .voice-input-wrap{width:100%}.nav-search .voice-input-wrap input{width:100%}.voice-input-wrap>input[type="search"]{padding-right:40px!important}.voice-mic-btn[aria-label="Talk-to-Text"]{font-weight:700}.search-live-note{font-size:9px;color:#64748b}
@media(max-width:1000px){.global-search{min-width:180px;max-width:none}.topbar{gap:8px}.global-search input{font-size:11px}}
@media(max-width:650px){.global-search{order:3;width:100%;min-width:100%;max-width:100%}.topbar{flex-wrap:wrap}.global-search-results{position:fixed;left:10px;right:10px;top:112px;max-height:50vh}}
@media print{.global-search,.global-search-results,.select-text-search{display:none!important}}

/* V7: continuous mic stays active until user presses stop; selected input text is replaced at dictation start. */

/* V11 Voice Button Control */
.voice-command-toggle{border:1px solid rgba(255,255,255,.22);background:#134e4a;color:#fff;border-radius:999px;padding:7px 10px;font-size:10px;font-weight:900;cursor:pointer;white-space:nowrap}.voice-command-toggle:hover{background:#0f766e}.voice-command-toggle.listening{background:#9f1239;border-color:#fecdd3;animation:voicePulse 1s infinite}
@media(max-width:650px){.voice-command-toggle{padding:7px 9px;font-size:9px}}
@media print{.voice-command-toggle{display:none!important}}

/* V11: editable entity/product combos */
.line-product-combo{align-items:flex-start}.line-product-combo>.select-search-shell{min-width:0}.line-product-combo .combo-actions{flex-direction:column;gap:2px}.line-product-combo .combo-actions .mini-btn{min-width:26px;padding:4px 5px}.toolbar>.editable-combo{max-width:480px;flex:0 1 480px}.toolbar>.editable-combo .select-search-shell{min-width:180px}


/* V12 Voice Action Arm + OK/NO confirmation */
.voice-action-armed{position:relative!important;outline:3px solid #f59e0b!important;outline-offset:2px!important;background:#f59e0b!important;border-color:#d97706!important;color:#fff!important;box-shadow:0 0 0 5px rgba(245,158,11,.18)!important;animation:voiceActionReady 1.15s ease-in-out infinite!important}
.voice-action-pending{outline:3px solid #7c3aed!important;outline-offset:2px!important;background:#7c3aed!important;border-color:#6d28d9!important;color:#fff!important;box-shadow:0 0 0 6px rgba(124,58,237,.18)!important;animation:none!important}
.voice-action-confirmed{outline:3px solid #16a34a!important;box-shadow:0 0 0 6px rgba(22,163,74,.2)!important}
@keyframes voiceActionReady{0%,100%{box-shadow:0 0 0 4px rgba(245,158,11,.14)}50%{box-shadow:0 0 0 9px rgba(245,158,11,.04)}}
.voice-action-confirm-overlay{position:fixed;inset:0;z-index:1900;background:rgba(15,23,42,.58);display:grid;place-items:center;padding:18px;backdrop-filter:blur(3px)}
.voice-action-confirm-card{width:min(430px,95vw);background:#fff;border-radius:18px;padding:20px;box-shadow:0 28px 80px rgba(15,23,42,.38);text-align:center;border:2px solid #ddd6fe}
.voice-action-confirm-icon{width:52px;height:52px;border-radius:50%;display:grid;place-items:center;margin:0 auto 9px;background:#ede9fe;font-size:25px}.voice-action-confirm-card h3{margin:0;color:#4c1d95;font-size:19px}.voice-action-confirm-card p{margin:8px 0 4px;font-weight:800}.voice-action-confirm-card small{display:block;color:#64748b;margin-bottom:15px}.voice-action-confirm-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.voice-action-confirm-actions button{border:0;border-radius:11px;padding:12px 14px;font-weight:900;cursor:pointer;font-size:14px}.voice-confirm-no{background:#fee2e2;color:#991b1b;outline:2px solid #fecaca}.voice-confirm-ok{background:#16a34a;color:#fff;outline:3px solid #86efac;animation:voiceConfirmPulse 1s ease-in-out infinite}@keyframes voiceConfirmPulse{0%,100%{box-shadow:0 0 0 0 rgba(22,163,74,.22)}50%{box-shadow:0 0 0 8px rgba(22,163,74,0)}}
@media print{.voice-action-confirm-overlay{display:none!important}.voice-action-armed,.voice-action-pending,.voice-action-confirmed{outline:none!important;box-shadow:none!important;animation:none!important}}

/* V13 live voice action fix */
.voice-action-confirm-overlay .voice-confirm-ok,.voice-action-confirm-overlay .voice-confirm-no{min-height:48px}
#voiceSupportState{font-weight:800}

/* V14: text field click auto-started mic. V15 adds blank-form button voice mode. V16 keeps voice typing locked to the clicked field and suppresses browser autofill suggestions. */


/* V15: every actionable button shows a mic badge; blank form click arms all visible buttons in that form. */
.voice-capable-button::after{content:'🎤';display:inline-block;margin-left:.36em;font-size:.72em;line-height:1;opacity:.46;filter:grayscale(.15);vertical-align:middle;pointer-events:none}
.voice-button-ready:not(.voice-action-armed):not(.voice-action-pending):not(.voice-action-confirmed){outline:2px solid #14b8a6!important;outline-offset:2px!important;box-shadow:0 0 0 4px rgba(20,184,166,.11)!important}
.voice-button-ready::after{opacity:1;filter:none;animation:voiceButtonMicPulse 1s ease-in-out infinite}
@keyframes voiceButtonMicPulse{0%,100%{transform:scale(1)}50%{transform:scale(1.22)}}
.voice-action-confirm-overlay .voice-button-ready{outline-width:3px!important}
@media print{.voice-capable-button::after{display:none!important}.voice-button-ready{outline:none!important;box-shadow:none!important}}

/* V17: visual feedback when Talk-to-Text resolves to an app-local saved suggestion. */
.voice-suggestion-hit{animation:voiceSuggestionHit .9s ease}
@keyframes voiceSuggestionHit{0%{box-shadow:0 0 0 0 rgba(13,148,136,.45);background:#ecfeff}45%{box-shadow:0 0 0 5px rgba(13,148,136,.18);background:#f0fdfa}100%{box-shadow:inherit;background:inherit}}

/* V18: app-owned record suggestions. A unique/exact match is auto-selected and fills the whole saved record. */
.app-record-suggestions{position:absolute;left:0;top:calc(100% + 6px);width:min(440px,calc(100vw - 48px));z-index:1875;background:#fff;border:1px solid #99f6e4;border-radius:12px;box-shadow:0 18px 45px rgba(15,23,42,.22);padding:5px;max-height:300px;overflow:auto}
.app-record-suggestions.hidden{display:none!important}.app-record-suggestion{position:relative;display:grid;grid-template-columns:1fr auto;grid-template-areas:'title tag' 'sub tag';gap:2px 8px;width:100%;text-align:left;border:0;background:#fff;border-radius:9px;padding:9px 10px;cursor:pointer;color:#0f172a}.app-record-suggestion:hover,.app-record-suggestion:focus{background:#ecfdf5;outline:2px solid #5eead4}.app-record-suggestion b{grid-area:title;font-size:12px}.app-record-suggestion small{grid-area:sub;color:#64748b;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.app-record-suggestion em{grid-area:tag;align-self:center;font-style:normal;font-size:8px;font-weight:900;color:#0f766e;background:#ccfbf1;border:1px solid #99f6e4;padding:3px 5px;border-radius:999px}.voice-input-wrap:has(.app-record-suggestions:not(.hidden)){z-index:1880}.modal-card .voice-input-wrap:has(.app-record-suggestions:not(.hidden)){position:relative}
@media(max-width:650px){.app-record-suggestions{width:min(92vw,440px)}}
@media print{.app-record-suggestions{display:none!important}}

/* V19: toolbar is dynamically centered on the active form/modal lower edge. */

/* V21: reliable Login/Register Bengali audio guidance */
.auth-welcome-audio{display:flex;align-items:center;gap:10px;margin:0 0 14px;padding:10px 12px;border:1px solid #99f6e4;border-radius:12px;background:#f0fdfa;color:#115e59}
.auth-welcome-audio button{flex:0 0 auto;border:1px solid #14b8a6;background:#0f766e;color:#fff;border-radius:10px;padding:9px 12px;font-weight:900;cursor:pointer}
.auth-welcome-audio button.playing{background:#b91c1c;border-color:#991b1b}
.auth-welcome-audio small{font-size:10px;line-height:1.4;color:#475569;font-weight:700}
@media(max-width:650px){.auth-welcome-audio{align-items:flex-start;flex-direction:column}.auth-welcome-audio button{width:100%}}

/* V22: taskbar-edge center dock + space so content stays usable behind the fixed voice bar. */
.voice-toolbar.voice-toolbar-taskbar{position:fixed!important;left:50%!important;right:auto!important;top:auto!important;bottom:max(4px,env(safe-area-inset-bottom))!important;transform:translateX(-50%)!important;z-index:1995!important;margin:0!important}
.content{padding-bottom:76px}.modal-body{padding-bottom:76px}.auth-panel{padding-bottom:76px}
.auth-welcome-audio small::after{content:'  •  ডিভাইসে Microsoft Nabanita বাংলা মহিলা কণ্ঠ থাকলে সেটিই অগ্রাধিকার পাবে।';font-weight:800;color:#0f766e}
@media(max-width:650px){.content,.modal-body,.auth-panel{padding-bottom:72px}.voice-toolbar.voice-toolbar-taskbar{bottom:max(3px,env(safe-area-inset-bottom))!important}}

/* V23 deterministic Bengali female voice selector */
.auth-welcome-audio{align-items:flex-start;flex-wrap:wrap}
.auth-voice-picker{display:grid;grid-template-columns:minmax(220px,1fr) auto auto;gap:7px;align-items:center;flex:1;min-width:0}
.auth-voice-picker select{min-width:0;width:100%;border:1px solid #99f6e4;border-radius:9px;padding:8px 9px;background:#fff;color:#134e4a;font-weight:800}
.auth-voice-picker button{padding:8px 10px;white-space:nowrap}
.auth-voice-picker .secondary-voice{background:#fff;color:#64748b;border-color:#cbd5e1;font-weight:800}
.auth-voice-picker small{grid-column:1/-1;display:block;font-size:10px;line-height:1.35;color:#0f766e;font-weight:800}
.auth-voice-picker small.warn{color:#b45309}
@media(max-width:760px){.auth-voice-picker{grid-template-columns:1fr 1fr}.auth-voice-picker select{grid-column:1/-1}.auth-voice-picker small{grid-column:1/-1}}

/* V25: fixed direction-voice panel; compact, no overflow, same guide voice can be used across all pages. */
.auth-welcome-audio[data-no-voice-ui]{
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr)!important;
  align-items:start!important;
  gap:10px 12px!important;
  overflow:hidden!important;
  width:100%!important;
  box-sizing:border-box!important;
}
.auth-welcome-audio[data-no-voice-ui] #authWelcomeListenBtn{
  grid-column:1;
  grid-row:1;
  align-self:start;
  min-height:38px;
  white-space:nowrap;
}
.auth-welcome-audio[data-no-voice-ui] .auth-voice-picker{
  grid-column:2;
  grid-row:1;
  display:grid!important;
  grid-template-columns:minmax(180px,1fr) auto!important;
  gap:7px!important;
  align-items:center!important;
  min-width:0!important;
  width:100%!important;
}
.auth-welcome-audio[data-no-voice-ui] #authVoiceSelect{
  grid-column:1;
  min-width:0!important;
  width:100%!important;
  height:38px;
  box-sizing:border-box;
}
.auth-welcome-audio[data-no-voice-ui] #authVoiceTestBtn{
  grid-column:2;
  min-height:38px;
  white-space:nowrap;
}
.auth-welcome-audio[data-no-voice-ui] #authOfflineVoiceBtn{
  grid-column:2;
  justify-self:end;
  padding:5px 9px;
  font-size:9px;
  min-height:30px;
}
.auth-welcome-audio[data-no-voice-ui] #authVoiceStatus{
  grid-column:1/-1!important;
  display:block!important;
  min-width:0!important;
  width:100%!important;
  max-width:100%!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  line-height:1.45!important;
  padding-top:1px;
}
.auth-welcome-audio[data-no-voice-ui] small::after{content:none!important}
.auth-welcome-audio[data-no-voice-ui] .select-search-shell,
.auth-welcome-audio[data-no-voice-ui] .voice-select-wrap,
.auth-welcome-audio[data-no-voice-ui] .voice-input-wrap,
.auth-welcome-audio[data-no-voice-ui] .voice-mic-btn,
.auth-welcome-audio[data-no-voice-ui] .voice-select-btn{display:none!important}
.auth-welcome-audio[data-no-voice-ui] button::after{display:none!important}
@media(max-width:760px){
  .auth-welcome-audio[data-no-voice-ui]{grid-template-columns:1fr!important}
  .auth-welcome-audio[data-no-voice-ui] #authWelcomeListenBtn{grid-column:1;grid-row:auto;width:100%}
  .auth-welcome-audio[data-no-voice-ui] .auth-voice-picker{grid-column:1;grid-row:auto;grid-template-columns:1fr auto!important}
}
@media(max-width:480px){
  .auth-welcome-audio[data-no-voice-ui] .auth-voice-picker{grid-template-columns:1fr!important}
  .auth-welcome-audio[data-no-voice-ui] #authVoiceSelect,
  .auth-welcome-audio[data-no-voice-ui] #authVoiceTestBtn,
  .auth-welcome-audio[data-no-voice-ui] #authOfflineVoiceBtn{grid-column:1;width:100%;justify-self:stretch}
}


/* V25 persistent guide voice panel */
.auth-welcome-audio[data-no-voice-ui]{
  display:grid!important;
  grid-template-columns:minmax(145px,auto) minmax(0,1fr)!important;
  gap:8px 10px!important;
  align-items:center!important;
  padding:9px 10px!important;
  overflow:visible!important;
}
.auth-welcome-audio[data-no-voice-ui] #authWelcomeListenBtn{grid-column:1;grid-row:1;min-height:38px;max-width:180px;}
.auth-welcome-audio[data-no-voice-ui] .auth-voice-picker{
  grid-column:2;grid-row:1;display:grid!important;grid-template-columns:minmax(210px,1fr) auto!important;
  gap:7px!important;align-items:center!important;min-width:0!important;width:100%!important;
}
.auth-welcome-audio[data-no-voice-ui] #authVoiceSelect{grid-column:1!important;min-width:0!important;width:100%!important;height:38px!important;}
.auth-welcome-audio[data-no-voice-ui] #authVoiceTestBtn{grid-column:2!important;min-height:38px!important;white-space:nowrap!important;}
.auth-welcome-audio[data-no-voice-ui] #authVoiceStatus{
  grid-column:1/-1!important;display:block!important;margin:0!important;padding:2px 2px 0!important;
  font-size:10px!important;line-height:1.35!important;white-space:normal!important;overflow-wrap:anywhere!important;
}
.auth-welcome-audio[data-no-voice-ui] #authOfflineVoiceBtn{display:none!important;}
@media(max-width:760px){
  .auth-welcome-audio[data-no-voice-ui]{grid-template-columns:1fr!important;}
  .auth-welcome-audio[data-no-voice-ui] #authWelcomeListenBtn{grid-column:1!important;grid-row:auto!important;width:100%!important;max-width:none!important;}
  .auth-welcome-audio[data-no-voice-ui] .auth-voice-picker{grid-column:1!important;grid-row:auto!important;grid-template-columns:minmax(0,1fr) auto!important;}
}
@media(max-width:520px){
  .auth-welcome-audio[data-no-voice-ui] .auth-voice-picker{grid-template-columns:1fr!important;}
  .auth-welcome-audio[data-no-voice-ui] #authVoiceSelect,.auth-welcome-audio[data-no-voice-ui] #authVoiceTestBtn{grid-column:1!important;width:100%!important;}
}
.voice-guide-btn{border:1px solid rgba(255,255,255,.22);background:#0f766e;color:#fff;border-radius:999px;padding:7px 10px;font-size:10px;font-weight:900;cursor:pointer;white-space:nowrap}.voice-guide-btn:hover{background:#115e59}@media(max-width:650px){.voice-guide-btn{padding:7px 9px;font-size:9px}}@media print{.voice-guide-btn{display:none!important}}

/* V29 local Nabanita guide voice */
#authVoiceStatus.warn{color:#b45309}
#authVoiceStatus{display:block;max-width:100%;overflow-wrap:anywhere}


/* V31: page-aware voice assistant command help */
.voice-help-btn{border:1px solid rgba(255,255,255,.22);background:#4338ca;color:#fff;border-radius:999px;padding:7px 10px;font-size:10px;font-weight:900;cursor:pointer;white-space:nowrap}
.voice-help-btn:hover{background:#3730a3}
.voice-command-help{display:grid;gap:12px;line-height:1.55}
.voice-command-help p{margin:0}
.voice-command-chips{display:flex;flex-wrap:wrap;gap:7px}
.voice-command-chips span{background:#ecfeff;border:1px solid #a5f3fc;color:#155e75;border-radius:999px;padding:6px 9px;font-size:11px;font-weight:800}
.voice-command-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.voice-command-grid>div{border:1px solid #e2e8f0;background:#f8fafc;border-radius:10px;padding:8px}
.voice-command-grid b{display:block;font-size:11px;color:#0f172a}
.voice-command-grid small{display:block;margin-top:2px;color:#475569}
.voice-command-note{background:#fff7ed;border:1px solid #fed7aa;border-radius:10px;padding:9px;color:#9a3412;font-size:11px}
@media(max-width:650px){.voice-help-btn{padding:7px 9px;font-size:9px}.voice-command-grid{grid-template-columns:1fr}}
@media print{.voice-help-btn{display:none!important}}

/* V32 — Barge-in guide voice: mic remains visibly active while narration is speaking. */
.voice-toolbar .voice-support-state{font-weight:800}
.voice-command-toggle.listening{box-shadow:0 0 0 3px rgba(45,212,191,.18),0 0 18px rgba(45,212,191,.28)}
.voice-guide-btn.guide-paused{background:#92400e!important;border-color:#fbbf24!important}


/* =====================================================================
   V37 — ALL DEVICE RESPONSIVE LAYOUT
   Desktop / Laptop / Mac / Tablet / iPad / Android / iPhone / PWA
   ===================================================================== */
html{width:100%;max-width:100%;overflow-x:hidden;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{width:100%;max-width:100%;overflow-x:hidden}
img,svg,video,canvas{max-width:100%;height:auto}
button,a,input,select,textarea{max-width:100%}
button,[role="button"],a,.nav-btn,.product-card,.pos-product{touch-action:manipulation}
.auth-page,.app-shell{min-height:100vh;min-height:100dvh}
.workspace,.content,.panel,.panel-body,.toolbar,.page-head,.head-actions,.top-actions{min-width:0}
.table-wrap,.cart-list,.pos-products,.sidebar nav,.modal-body{-webkit-overflow-scrolling:touch}
.table-wrap{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
.data-table{max-width:none}
.modal-card{max-width:calc(100vw - 28px);max-height:calc(100vh - 28px);max-height:calc(100dvh - 28px)}
.modal-body{overscroll-behavior:contain}
.form-grid>*{min-width:0}
.form-grid input,.form-grid select,.form-grid textarea,
.auth-form input,.toolbar input,.toolbar select,.pos-search input,
.cart-footer input,.cart-footer select,.line-row input,.line-row select{width:100%}
.actions,.combo-actions,.print-actions,.pay-mode-buttons{flex-wrap:wrap}
.head-actions>*{max-width:100%}
.voice-toolbar{scrollbar-width:none}
.voice-toolbar::-webkit-scrollbar{display:none}

/* Very large desktop / 2K / 4K */
@media(min-width:1800px){
  .content{max-width:1820px;padding-left:28px;padding-right:28px}
  .stats-grid{grid-template-columns:repeat(6,minmax(180px,1fr))}
  .product-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
  .pos-products{grid-template-columns:repeat(5,minmax(0,1fr))}
  .modal-card{width:min(1180px,90vw)}
}

/* Standard desktop / laptop */
@media(min-width:1001px) and (max-width:1450px){
  .app-shell{grid-template-columns:240px minmax(0,1fr)}
  .sidebar{width:240px}
  .content{padding:16px}
  .topbar{padding:11px 16px}
  .global-search{min-width:220px}
  .pos-layout{grid-template-columns:minmax(0,1.25fr) minmax(350px,.75fr)}
}

/* Tablet + small laptop */
@media(max-width:1000px){
  .app-shell{display:block}
  .sidebar{
    width:min(82vw,310px)!important;
    left:calc(-1 * min(82vw,310px) - 16px)!important;
    height:100vh;height:100dvh;
    padding-left:env(safe-area-inset-left);
    box-shadow:18px 0 45px rgba(15,23,42,.26);
  }
  .sidebar.open{left:0!important}
  .sidebar-backdrop{inset:0}
  .workspace{width:100%;max-width:100vw}
  .topbar{
    padding-left:max(12px,env(safe-area-inset-left));
    padding-right:max(12px,env(safe-area-inset-right));
  }
  .content{
    width:100%;max-width:100%;
    padding-left:max(14px,env(safe-area-inset-left));
    padding-right:max(14px,env(safe-area-inset-right));
  }
  .auth-page{
    padding:max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right))
            max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));
  }
  .auth-card{width:min(720px,100%);min-height:auto}
  .auth-panel{min-width:0}
  .modal{padding:12px}
  .modal-card{width:min(920px,100%);max-height:calc(100dvh - 24px)}
  .toolbar input[type=search]{min-width:min(260px,100%)}
  .line-row{min-width:0}
}

/* Tablet portrait / large phones */
@media(max-width:820px){
  .topbar{flex-wrap:wrap;align-items:center}
  .topbar>div:nth-of-type(1){min-width:0;flex:1}
  .topbar h2{font-size:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .global-search{order:3;flex:1 0 100%;width:100%;max-width:100%}
  .top-actions{margin-left:0;max-width:100%;overflow-x:auto;white-space:nowrap;scrollbar-width:none}
  .top-actions::-webkit-scrollbar{display:none}
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .product-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .pos-products{grid-template-columns:repeat(3,minmax(0,1fr))}
  .report-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .three-col{grid-template-columns:1fr 1fr}
  .three-col>*:last-child:nth-child(odd){grid-column:1/-1}
  .invoice-paper{width:100%;padding:18px}
  .invoice-totals{width:min(310px,100%)}
  .installer-strip>div:first-child{align-items:flex-start;flex-direction:column;gap:3px}
}

/* Phones */
@media(max-width:650px){
  :root{--mobile-gap:10px}
  body{font-size:14px}
  .auth-page{padding:0;background:#fff;display:block}
  .auth-card{
    width:100%;min-height:100vh;min-height:100dvh;
    border:0;border-radius:0;box-shadow:none;
  }
  .auth-panel{
    padding:18px max(14px,env(safe-area-inset-right))
            max(86px,calc(18px + env(safe-area-inset-bottom)))
            max(14px,env(safe-area-inset-left));
    justify-content:flex-start;
  }
  .installer-strip{padding:11px;margin-bottom:12px}
  .installer-links{
    display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;
  }
  .installer-links a,.installer-links button{
    width:100%;min-width:0;text-align:center;padding:8px 5px;font-size:11px;
  }
  .all-installers{padding:9px 8px}
  .auth-tabs{margin-bottom:14px}
  .auth-tabs button{min-height:44px}
  .auth-form{gap:10px}
  .auth-form h2{font-size:23px}
  .auth-form input,.auth-form select,.auth-form textarea,
  .form-grid input,.form-grid select,.form-grid textarea,
  .toolbar input,.toolbar select,.pos-search input,
  .cart-footer input,.cart-footer select,.line-row input,.line-row select{
    font-size:16px!important; /* prevents iOS auto zoom */
    min-height:44px;
  }
  .primary,.secondary,.ghost,.danger-btn,.icon-btn,.mini-btn,
  .nav-btn,.side-bottom button{min-height:42px}
  .primary.full,.secondary.full{min-height:46px}

  .topbar{
    min-height:auto;padding:9px max(10px,env(safe-area-inset-right)) 9px max(10px,env(safe-area-inset-left));
    gap:8px;
  }
  .icon-btn{min-width:42px;min-height:42px;display:grid;place-items:center}
  .topbar h2{font-size:18px}
  .topbar p{font-size:10px}
  .global-search{order:3;width:100%;min-width:100%;max-width:100%}
  .global-search input{min-height:42px;font-size:16px}
  .global-search-results{
    left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));
    top:104px;max-height:55dvh;
  }
  .top-actions{
    order:4;width:100%;display:flex!important;gap:7px;overflow-x:auto;padding-bottom:1px;
  }
  .top-actions .badge{display:none!important}
  .top-actions .ghost{display:inline-flex!important}
  .top-actions button{flex:0 0 auto;min-height:38px}

  .content{
    padding:10px max(9px,env(safe-area-inset-right))
            max(88px,calc(78px + env(safe-area-inset-bottom)))
            max(9px,env(safe-area-inset-left));
  }
  .page-head{gap:9px;margin-bottom:10px}
  .page-head h3{font-size:18px}
  .head-actions{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  .head-actions>button,.head-actions>a,.head-actions>select{width:100%;min-width:0}

  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .stat-card{padding:11px;border-radius:13px}
  .stat-card strong{font-size:18px}
  .two-col,.three-col,.list-cards,.report-grid{grid-template-columns:1fr!important}
  .panel{border-radius:13px}
  .panel-head{padding:11px 12px;align-items:flex-start;flex-wrap:wrap}
  .panel-body{padding:11px}
  .toolbar{display:grid;grid-template-columns:1fr 1fr;gap:7px;align-items:stretch}
  .toolbar>input[type=search],.toolbar>.voice-input-wrap,.toolbar>.select-search-shell{grid-column:1/-1;min-width:0;width:100%}
  .toolbar>button,.toolbar>select{width:100%;min-width:0}
  .table-wrap{border-radius:10px;margin-left:0;margin-right:0}
  .data-table{min-width:720px}
  .data-table th,.data-table td{padding:8px 7px}
  .actions{gap:4px}
  .mini-btn{min-height:34px;padding:5px 7px}

  .form-grid{grid-template-columns:1fr!important;gap:10px}
  .form-grid .span2,.form-grid .span3{grid-column:1!important}
  .form-actions{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;
    position:sticky;bottom:0;background:rgba(255,255,255,.96);z-index:8;
    padding:10px 0 max(4px,env(safe-area-inset-bottom));margin-top:4px;
  }
  .form-actions>button{width:100%;min-height:44px}

  .product-grid,.pos-products{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px}
  .product-card .pc-body{padding:8px}
  .product-card b{font-size:12px}
  .pos-layout{display:block}
  .pos-catalog{margin-bottom:10px}
  .pos-products{max-height:none;padding:9px}
  .pos-cart{position:static;max-height:none}
  .cart-row{
    grid-template-columns:minmax(0,1fr) 78px;gap:6px;padding:8px;
  }
  .cart-row>*:first-child{grid-column:1/-1}
  .cart-row button{min-height:36px}
  .cart-footer{padding:10px}
  .cart-footer .row{grid-template-columns:1fr 1fr}
  .pay-mode-buttons{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .pay-mode-buttons button{width:100%;min-width:0}

  .line-items{overflow:visible}
  .line-head{display:none!important}
  .line-row{
    grid-template-columns:1fr 1fr!important;
    gap:7px;padding:9px 8px;border-top:1px solid #edf2f7;
  }
  .line-row>*:first-child{grid-column:1/-1!important}
  .line-row button{grid-column:1/-1!important;width:100%;min-height:38px}
  .line-add{width:calc(100% - 16px);min-height:40px}

  .modal{
    padding:0;align-items:stretch;place-items:stretch;
    height:100vh;height:100dvh;
  }
  .modal-card{
    width:100vw!important;max-width:100vw!important;
    height:100vh;height:100dvh;max-height:100dvh!important;
    border-radius:0;box-shadow:none;
  }
  .modal-head{
    position:sticky;top:0;z-index:20;background:#fff;
    padding:max(10px,env(safe-area-inset-top)) 12px 10px;
  }
  .modal-head h3{font-size:18px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .modal-head button{min-width:42px;min-height:42px}
  .modal-body{
    padding:11px max(10px,env(safe-area-inset-right))
            max(92px,calc(82px + env(safe-area-inset-bottom)))
            max(10px,env(safe-area-inset-left));
    flex:1;min-height:0;overflow:auto;
  }
  .invoice-paper{padding:10px;font-size:12px}
  .invoice-header h1{font-size:22px}
  .invoice-meta{grid-template-columns:1fr!important}
  .invoice-paper table{min-width:620px}
  .invoice-paper{overflow-x:auto}
  .invoice-totals{width:100%;margin-left:0}
  .invoice-footer{gap:10px;flex-wrap:wrap}

  .voice-toolbar.voice-toolbar-taskbar,.voice-toolbar{
    left:max(6px,env(safe-area-inset-left))!important;
    right:max(6px,env(safe-area-inset-right))!important;
    transform:none!important;
    width:auto!important;max-width:none!important;
    bottom:max(4px,env(safe-area-inset-bottom))!important;
    justify-content:flex-start;overflow-x:auto;overscroll-behavior-x:contain;
    padding:5px 6px;
  }
  .voice-lang-toggle,.voice-command-toggle,.voice-guide-btn,.voice-help-btn{
    min-height:34px;flex:0 0 auto;
  }
  .voice-privacy{display:none!important}
  .voice-action-confirm-overlay,.voice-prompt-overlay{
    padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right))
            max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));
  }
  .voice-action-confirm-card,.voice-prompt-card{width:100%;max-width:460px}
  .voice-action-confirm-actions,.voice-prompt-actions{
    display:grid!important;grid-template-columns:1fr 1fr;gap:8px;
  }
  .voice-action-confirm-actions button,.voice-prompt-actions button{width:100%;min-height:48px}

  .app-record-suggestions{
    left:8px!important;right:8px!important;width:auto!important;max-width:none!important;
    max-height:48dvh;
  }
  .combo-manager-grid{grid-template-columns:1fr!important}
  .combo-actions{width:100%}
  .combo-actions button{flex:1 1 auto}
  .selected-customer-card{align-items:flex-start!important;flex-direction:column!important}

  .device-line{flex-direction:column;gap:4px}
}

/* Small phones */
@media(max-width:430px){
  .installer-links{grid-template-columns:repeat(2,minmax(0,1fr))}
  .stats-grid{gap:7px}
  .stat-card{padding:10px}
  .stat-card span{font-size:10px}
  .stat-card strong{font-size:17px}
  .product-grid,.pos-products{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .head-actions{grid-template-columns:1fr}
  .toolbar{grid-template-columns:1fr}
  .toolbar>*{grid-column:1!important}
  .cart-footer .row{grid-template-columns:1fr}
  .pay-mode-buttons{grid-template-columns:1fr}
  .form-actions{grid-template-columns:1fr 1fr}
  .auth-welcome-audio[data-no-voice-ui]{padding:8px!important}
  .auth-welcome-audio[data-no-voice-ui] .auth-voice-picker{grid-template-columns:1fr!important}
  .auth-welcome-audio[data-no-voice-ui] #authVoiceSelect,
  .auth-welcome-audio[data-no-voice-ui] #authVoiceTestBtn{grid-column:1!important;width:100%!important}
  .voice-action-confirm-card{padding:14px}
}

/* Very narrow / foldable outer screen */
@media(max-width:340px){
  .stats-grid{grid-template-columns:1fr}
  .product-grid,.pos-products{grid-template-columns:1fr!important}
  .form-actions,.voice-action-confirm-actions,.voice-prompt-actions{grid-template-columns:1fr!important}
  .installer-links{grid-template-columns:1fr 1fr}
  .topbar h2{font-size:16px}
}

/* Short landscape phones/tablets */
@media(max-height:560px) and (orientation:landscape){
  .auth-page{place-items:start center;padding:8px}
  .auth-card{min-height:auto}
  .auth-panel{padding-top:12px;padding-bottom:68px}
  .installer-strip{margin-bottom:8px}
  .modal{padding:4px}
  .modal-card{max-height:calc(100dvh - 8px)}
  .modal-head{padding:8px 12px}
  .modal-body{padding-top:8px}
  .sidebar nav{padding-top:6px}
  .side-brand{padding:10px 12px}
  .voice-toolbar{bottom:max(2px,env(safe-area-inset-bottom))!important}
}

/* Touch devices: comfortable hit areas without changing mouse desktop density */
@media(pointer:coarse){
  button,[role="button"],a.btn,a.button,.nav-btn,.mini-btn,.voice-select-btn,.voice-mic-btn{
    min-height:40px;
  }
  .voice-mic-btn{min-width:34px}
  .nav-btn{padding-top:11px;padding-bottom:11px}
}

/* Standalone PWA / notched phones */
@media(display-mode:standalone){
  .topbar{padding-top:max(10px,env(safe-area-inset-top))}
  .sidebar{padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
  .content{padding-bottom:max(88px,calc(78px + env(safe-area-inset-bottom)))}
}


/* =====================================================================
   V38 — FIXED PROFESSIONAL DESKTOP MODE
   Applies only to real desktop/laptop widths. Mobile/tablet keeps V37.
   ===================================================================== */
@media (min-width:1100px){
  html,body{
    min-width:1100px;
    overflow-x:auto;
  }

  /* Login/Register desktop shell */
  .auth-page{
    display:grid!important;
    place-items:center!important;
    padding:12px 18px!important;
    min-height:100vh!important;
    min-height:100dvh!important;
  }
  .auth-card{
    width:1180px!important;
    max-width:1180px!important;
    min-width:1180px!important;
    min-height:720px!important;
    height:auto!important;
    display:grid!important;
    grid-template-columns:536px 644px!important;
    align-items:stretch!important;
    border-radius:30px!important;
    overflow:hidden!important;
  }
  .auth-hero{
    width:536px!important;
    min-width:536px!important;
    padding:52px 56px!important;
  }
  .auth-panel{
    width:644px!important;
    min-width:644px!important;
    padding:54px 36px 34px!important;
    overflow:visible!important;
  }

  /* Stable two-column login visual proportions */
  .auth-hero h1{
    font-size:52px!important;
    line-height:1.02!important;
    max-width:430px!important;
  }
  .auth-hero .lead{
    max-width:455px!important;
    font-size:17px!important;
    line-height:1.72!important;
  }
  .feature-grid{
    grid-template-columns:1fr 1fr!important;
    gap:12px!important;
  }
  .feature-card{
    min-height:72px!important;
  }

  /* Right login controls should never wrap like mobile */
  .installer-strip{
    width:470px!important;
    max-width:470px!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
  .installer-links{
    display:flex!important;
    flex-wrap:wrap!important;
    gap:8px!important;
  }
  .auth-welcome-audio[data-no-voice-ui]{
    width:470px!important;
    max-width:470px!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
  .auth-welcome-audio[data-no-voice-ui] .auth-voice-picker{
    display:grid!important;
    grid-template-columns:160px 1fr 150px!important;
    align-items:center!important;
    gap:9px!important;
  }
  .auth-welcome-audio[data-no-voice-ui] #authVoiceSelect,
  .auth-welcome-audio[data-no-voice-ui] #authVoiceTestBtn{
    width:100%!important;
  }
  .auth-tabs,.auth-form,.device-line,.all-installers{
    width:470px!important;
    max-width:470px!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
  .auth-form input,.auth-form select,.auth-form textarea{
    width:100%!important;
  }

  /* Main app fixed desktop proportions */
  .app-shell{
    display:grid!important;
    grid-template-columns:252px minmax(0,1fr)!important;
    width:100%!important;
    min-width:1100px!important;
    max-width:none!important;
  }
  .sidebar{
    width:252px!important;
    min-width:252px!important;
    left:0!important;
    position:fixed!important;
    top:0!important;
    bottom:0!important;
    height:100vh!important;
    height:100dvh!important;
    transform:none!important;
  }
  .workspace{
    margin-left:252px!important;
    width:calc(100% - 252px)!important;
    min-width:848px!important;
  }
  .topbar{
    min-height:74px!important;
    flex-wrap:nowrap!important;
    padding:12px 20px!important;
  }
  .global-search{
    flex:0 1 520px!important;
    width:520px!important;
    max-width:520px!important;
    min-width:300px!important;
    order:initial!important;
  }
  .top-actions{
    width:auto!important;
    order:initial!important;
    overflow:visible!important;
    flex-wrap:nowrap!important;
  }
  .content{
    width:100%!important;
    max-width:none!important;
    padding:18px 22px 88px!important;
  }

  /* Desktop page grids */
  .stats-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  .product-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  .report-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .two-col{grid-template-columns:1fr 1fr!important}
  .three-col{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .pos-layout{
    display:grid!important;
    grid-template-columns:minmax(0,1.35fr) minmax(360px,.65fr)!important;
    gap:14px!important;
  }
  .pos-products{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  .pos-cart{
    position:sticky!important;
    top:90px!important;
    align-self:start!important;
    max-height:calc(100vh - 116px)!important;
  }

  /* Desktop toolbars stay horizontal */
  .page-head{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    flex-wrap:nowrap!important;
  }
  .head-actions{
    width:auto!important;
    display:flex!important;
    grid-template-columns:none!important;
    flex-wrap:wrap!important;
    justify-content:flex-end!important;
  }
  .toolbar{
    display:flex!important;
    grid-template-columns:none!important;
    flex-wrap:wrap!important;
    align-items:center!important;
  }
  .toolbar>input[type=search],
  .toolbar>.voice-input-wrap,
  .toolbar>.select-search-shell{
    grid-column:auto!important;
    width:auto!important;
    min-width:240px!important;
    flex:1 1 280px!important;
  }

  /* Desktop modal — centered window, never fullscreen */
  .modal{
    display:grid!important;
    place-items:center!important;
    padding:22px!important;
    height:100vh!important;
    height:100dvh!important;
  }
  .modal-card{
    width:min(1040px,calc(100vw - 64px))!important;
    max-width:1040px!important;
    height:auto!important;
    max-height:calc(100vh - 44px)!important;
    border-radius:20px!important;
    box-shadow:0 30px 90px rgba(15,23,42,.28)!important;
  }
  .modal-head{
    position:static!important;
    padding:16px 18px!important;
  }
  .modal-body{
    padding:16px 18px 20px!important;
    max-height:calc(100vh - 115px)!important;
    overflow:auto!important;
  }
  .form-actions{
    position:static!important;
    display:flex!important;
    grid-template-columns:none!important;
    justify-content:flex-end!important;
    background:transparent!important;
    padding:8px 0 0!important;
  }
  .form-actions>button{
    width:auto!important;
    min-width:120px!important;
  }

  /* Desktop tables/invoice */
  .table-wrap{overflow:auto!important}
  .data-table{min-width:100%!important}
  .invoice-paper{
    width:900px!important;
    max-width:100%!important;
    margin:0 auto!important;
    padding:26px!important;
    overflow:visible!important;
  }
  .invoice-meta{grid-template-columns:1fr 1fr!important}
  .invoice-totals{
    width:340px!important;
    margin-left:auto!important;
  }

  /* Voice bar stays desktop-sized and centered above taskbar */
  .voice-toolbar.voice-toolbar-taskbar,.voice-toolbar{
    left:50%!important;
    right:auto!important;
    transform:translateX(-50%)!important;
    width:auto!important;
    max-width:calc(100vw - 70px)!important;
    bottom:6px!important;
    overflow-x:auto!important;
    justify-content:center!important;
  }
}

/* Wide desktop keeps the same fixed shell, only main workspace gets more room. */
@media (min-width:1500px){
  .auth-card{
    width:1180px!important;
    max-width:1180px!important;
  }
  .content{padding-left:26px!important;padding-right:26px!important}
  .stats-grid{grid-template-columns:repeat(5,minmax(0,1fr))!important}
  .product-grid{grid-template-columns:repeat(5,minmax(0,1fr))!important}
  .pos-products{grid-template-columns:repeat(5,minmax(0,1fr))!important}
}


/* =====================================================================
   V39 — CLEAN DESKTOP LOGIN / APP VIEW EXCLUSIVITY
   Login/Register and Main App may never appear at the same time.
   ===================================================================== */

/* Hard UI-mode guard: JS sets html[data-ui-mode]. */
html[data-ui-mode="auth"] #appView{display:none!important}
html[data-ui-mode="auth"] #authView{display:grid!important}
html[data-ui-mode="auth"] #modal{display:none!important}
html[data-ui-mode="app"] #authView{display:none!important}
html[data-ui-mode="app"] #appView{display:grid!important}

/* The markup uses .auth-showcase (not .auth-hero). */
@media (min-width:1100px){
  html[data-ui-mode="auth"],html[data-ui-mode="auth"] body{
    min-width:1100px;
    overflow:auto;
  }
  html[data-ui-mode="auth"] body{
    background:#f5f8fb;
  }
  html[data-ui-mode="auth"] .auth-page{
    min-height:100vh!important;
    min-height:100dvh!important;
    display:grid!important;
    place-items:center!important;
    padding:18px!important;
  }
  html[data-ui-mode="auth"] .auth-card{
    width:1180px!important;
    max-width:1180px!important;
    min-width:1180px!important;
    min-height:720px!important;
    grid-template-columns:536px 644px!important;
    margin:0 auto!important;
    position:relative;
    z-index:2;
  }
  html[data-ui-mode="auth"] .auth-showcase{
    width:536px!important;
    min-width:536px!important;
    padding:48px 54px!important;
    justify-content:center!important;
  }
  html[data-ui-mode="auth"] .auth-panel{
    width:644px!important;
    min-width:644px!important;
    padding:46px 52px 36px!important;
    justify-content:center!important;
  }
  html[data-ui-mode="auth"] .auth-showcase h1{
    font-size:48px!important;
    line-height:1.05!important;
    max-width:430px!important;
  }
  html[data-ui-mode="auth"] .auth-showcase>p{
    font-size:16px!important;
    line-height:1.65!important;
    max-width:430px!important;
  }
  html[data-ui-mode="auth"] .feature-grid{
    grid-template-columns:1fr 1fr!important;
    gap:10px!important;
  }
  html[data-ui-mode="auth"] .feature-grid>div{
    min-height:58px!important;
    display:flex!important;
    align-items:center!important;
    padding:11px 13px!important;
  }
  html[data-ui-mode="auth"] .privacy-note{
    margin-top:18px!important;
  }
  html[data-ui-mode="auth"] .installer-strip,
  html[data-ui-mode="auth"] .auth-welcome-audio[data-no-voice-ui],
  html[data-ui-mode="auth"] .auth-tabs,
  html[data-ui-mode="auth"] .auth-form,
  html[data-ui-mode="auth"] .device-line,
  html[data-ui-mode="auth"] .all-installers,
  html[data-ui-mode="auth"] #authStatus{
    width:470px!important;
    max-width:470px!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
  html[data-ui-mode="auth"] .auth-welcome-audio[data-no-voice-ui]{
    overflow:hidden!important;
  }
  html[data-ui-mode="auth"] .auth-voice-picker{
    min-width:0!important;
  }
  html[data-ui-mode="auth"] .auth-voice-picker>*{
    min-width:0!important;
  }
}

/* When already logged in, only the real desktop app remains. */
@media (min-width:1100px){
  html[data-ui-mode="app"] body{background:var(--bg)}
  html[data-ui-mode="app"] .app-shell{
    min-height:100vh!important;
    min-height:100dvh!important;
  }
}

/* Never show an empty generic modal. */
#modal:not(.hidden) #modalBody:empty{display:none}
#modal:not(.hidden):has(#modalBody:empty){display:none!important}


/* =====================================================================
   V40 — PROFESSIONAL COMPACT DESKTOP LOGIN
   Balanced, centered, fixed desktop UI. Mobile/tablet keeps responsive UI.
   ===================================================================== */
@media (min-width:1100px){
  html[data-ui-mode="auth"],html[data-ui-mode="auth"] body{
    min-width:1100px;
    overflow:auto;
  }
  html[data-ui-mode="auth"] body{
    background:
      radial-gradient(circle at 12% 18%,rgba(20,184,166,.10),transparent 26%),
      radial-gradient(circle at 88% 82%,rgba(59,130,246,.08),transparent 28%),
      #f4f7fb;
  }
  html[data-ui-mode="auth"] .auth-page{
    min-height:100vh!important;
    min-height:100dvh!important;
    display:grid!important;
    place-items:center!important;
    padding:18px!important;
  }

  html[data-ui-mode="auth"] .auth-card{
    width:1040px!important;
    max-width:1040px!important;
    min-width:1040px!important;
    min-height:620px!important;
    height:auto!important;
    grid-template-columns:430px 610px!important;
    border-radius:24px!important;
    border:1px solid #dce6ef!important;
    box-shadow:0 28px 70px rgba(15,23,42,.16)!important;
    overflow:hidden!important;
    margin:0 auto!important;
  }

  /* LEFT: professional product showcase */
  html[data-ui-mode="auth"] .auth-showcase{
    width:430px!important;
    min-width:430px!important;
    padding:38px 38px 34px!important;
    justify-content:center!important;
    background:
      linear-gradient(155deg,rgba(4,47,46,.98),rgba(15,118,110,.96)),
      #064e3b!important;
  }
  html[data-ui-mode="auth"] .brand-icon{
    width:72px!important;
    height:72px!important;
    border-radius:18px!important;
    margin-bottom:16px!important;
  }
  html[data-ui-mode="auth"] .eyebrow{
    font-size:11px!important;
    letter-spacing:1.35px!important;
  }
  html[data-ui-mode="auth"] .auth-showcase h1{
    font-size:38px!important;
    line-height:1.08!important;
    margin:8px 0 12px!important;
    max-width:350px!important;
  }
  html[data-ui-mode="auth"] .auth-showcase>p{
    font-size:14px!important;
    line-height:1.58!important;
    max-width:350px!important;
    margin:0!important;
  }
  html[data-ui-mode="auth"] .feature-grid{
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
    margin-top:16px!important;
  }
  html[data-ui-mode="auth"] .feature-grid>div{
    min-height:46px!important;
    padding:9px 10px!important;
    border-radius:11px!important;
    font-size:12px!important;
    line-height:1.25!important;
    display:flex!important;
    align-items:center!important;
  }
  html[data-ui-mode="auth"] .privacy-note{
    margin-top:14px!important;
    padding:9px 11px!important;
    border-radius:10px!important;
    font-size:10.5px!important;
    line-height:1.45!important;
  }

  /* RIGHT: compact login workstation */
  html[data-ui-mode="auth"] .auth-panel{
    width:610px!important;
    min-width:610px!important;
    padding:28px 42px 26px!important;
    justify-content:center!important;
    gap:0!important;
    background:#fff!important;
  }

  /* Installer area */
  html[data-ui-mode="auth"] .installer-strip{
    width:452px!important;
    max-width:452px!important;
    margin:0 auto 10px!important;
    padding:10px 11px!important;
    border-radius:13px!important;
    background:#f8fafc!important;
  }
  html[data-ui-mode="auth"] .installer-strip>div:first-child{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:10px!important;
  }
  html[data-ui-mode="auth"] .installer-strip>div:first-child b{
    font-size:13px!important;
  }
  html[data-ui-mode="auth"] .installer-strip small{
    font-size:9.5px!important;
    white-space:nowrap!important;
  }
  html[data-ui-mode="auth"] .installer-links{
    display:flex!important;
    flex-wrap:wrap!important;
    gap:6px!important;
    margin-top:8px!important;
  }
  html[data-ui-mode="auth"] .installer-links a,
  html[data-ui-mode="auth"] .installer-links button{
    padding:6px 8px!important;
    border-radius:8px!important;
    font-size:10.5px!important;
    min-height:30px!important;
  }

  /* Voice guide row */
  html[data-ui-mode="auth"] .auth-welcome-audio[data-no-voice-ui]{
    width:452px!important;
    max-width:452px!important;
    margin:0 auto 10px!important;
    padding:8px!important;
    border-radius:12px!important;
    grid-template-columns:132px minmax(0,1fr)!important;
    gap:8px!important;
    overflow:hidden!important;
  }
  html[data-ui-mode="auth"] .auth-welcome-audio[data-no-voice-ui] #authWelcomeListenBtn{
    width:132px!important;
    max-width:132px!important;
    min-height:36px!important;
    padding:7px 8px!important;
    font-size:12px!important;
  }
  html[data-ui-mode="auth"] .auth-welcome-audio[data-no-voice-ui] .auth-voice-picker{
    min-width:0!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 112px!important;
    gap:6px!important;
    align-items:center!important;
  }
  html[data-ui-mode="auth"] .auth-welcome-audio[data-no-voice-ui] #authVoiceSelect{
    width:100%!important;
    min-width:0!important;
    height:36px!important;
    font-size:11px!important;
  }
  html[data-ui-mode="auth"] .auth-welcome-audio[data-no-voice-ui] #authVoiceTestBtn{
    width:112px!important;
    min-width:112px!important;
    min-height:36px!important;
    padding:7px 8px!important;
    font-size:11px!important;
  }
  html[data-ui-mode="auth"] .auth-welcome-audio[data-no-voice-ui] #authVoiceStatus{
    grid-column:1/-1!important;
    font-size:9.5px!important;
    line-height:1.25!important;
    margin-top:0!important;
  }

  /* Tabs / forms */
  html[data-ui-mode="auth"] .auth-tabs,
  html[data-ui-mode="auth"] .auth-form,
  html[data-ui-mode="auth"] .device-line,
  html[data-ui-mode="auth"] .all-installers,
  html[data-ui-mode="auth"] #authStatus{
    width:452px!important;
    max-width:452px!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
  html[data-ui-mode="auth"] .auth-tabs{
    margin-bottom:14px!important;
  }
  html[data-ui-mode="auth"] .auth-tabs button{
    padding:10px!important;
    min-height:40px!important;
    font-size:12px!important;
  }
  html[data-ui-mode="auth"] .auth-form{
    gap:9px!important;
  }
  html[data-ui-mode="auth"] .auth-form h2{
    font-size:24px!important;
    line-height:1.1!important;
    margin-bottom:2px!important;
  }
  html[data-ui-mode="auth"] .auth-form>p{
    margin:0 0 10px!important;
    font-size:11px!important;
    line-height:1.35!important;
  }
  html[data-ui-mode="auth"] .auth-form label{
    gap:4px!important;
    font-size:10.5px!important;
  }
  html[data-ui-mode="auth"] .auth-form input,
  html[data-ui-mode="auth"] .auth-form select{
    min-height:40px!important;
    padding:8px 10px!important;
    border-radius:9px!important;
    font-size:13px!important;
  }
  html[data-ui-mode="auth"] .auth-form .primary,
  html[data-ui-mode="auth"] .auth-form .secondary{
    min-height:42px!important;
    padding:9px 12px!important;
    border-radius:9px!important;
    font-size:12px!important;
  }
  html[data-ui-mode="auth"] .device-line{
    margin-top:8px!important;
    font-size:8.5px!important;
  }
  html[data-ui-mode="auth"] .all-installers{
    margin-top:8px!important;
    padding:7px 8px!important;
    min-height:32px!important;
    font-size:10px!important;
  }

  /* Register can be taller, but still stays compact and inside the card. */
  html[data-ui-mode="auth"] #registerForm{
    max-height:355px!important;
    overflow:auto!important;
    padding-right:4px!important;
  }

  /* Main app remains the fixed desktop UI after login */
  html[data-ui-mode="app"] .app-shell{
    grid-template-columns:252px minmax(0,1fr)!important;
  }
}

/* 1100–1199: fit the same desktop UI without making it giant */
@media (min-width:1100px) and (max-width:1199px){
  html[data-ui-mode="auth"] .auth-card{
    width:1000px!important;
    min-width:1000px!important;
    grid-template-columns:410px 590px!important;
  }
  html[data-ui-mode="auth"] .auth-showcase{
    width:410px!important;
    min-width:410px!important;
    padding-left:32px!important;
    padding-right:32px!important;
  }
  html[data-ui-mode="auth"] .auth-panel{
    width:590px!important;
    min-width:590px!important;
    padding-left:34px!important;
    padding-right:34px!important;
  }
}


/* =====================================================================
   V41 — PROFESSIONAL DESKTOP APP UI
   All functions preserved; visual system redesigned.
   ===================================================================== */
:root{
  --v41-bg:#f5f7fb;
  --v41-surface:#ffffff;
  --v41-surface-2:#f8fafc;
  --v41-ink:#0f172a;
  --v41-muted:#64748b;
  --v41-line:#e2e8f0;
  --v41-line-strong:#cbd5e1;
  --v41-sidebar:#0b1626;
  --v41-sidebar-2:#0f2136;
  --v41-accent:#0f766e;
  --v41-accent-2:#14b8a6;
  --v41-blue:#2563eb;
  --v41-red:#dc2626;
  --v41-amber:#d97706;
  --v41-green:#15803d;
  --v41-shadow:0 12px 32px rgba(15,23,42,.07);
  --v41-shadow-lg:0 24px 70px rgba(15,23,42,.18);
  --v41-radius:16px;
}

/* App canvas */
html[data-ui-mode="app"] body{background:var(--v41-bg)!important;color:var(--v41-ink)}
html[data-ui-mode="app"] #appView{background:var(--v41-bg)!important}

/* Sidebar */
html[data-ui-mode="app"] .sidebar{
  width:260px!important;
  min-width:260px!important;
  background:
    radial-gradient(circle at 20% 5%,rgba(20,184,166,.12),transparent 24%),
    linear-gradient(180deg,var(--v41-sidebar) 0%,var(--v41-sidebar-2) 100%)!important;
  border-right:1px solid rgba(148,163,184,.13)!important;
  box-shadow:10px 0 28px rgba(15,23,42,.08)!important;
  padding:0 12px 14px!important;
}
html[data-ui-mode="app"] .workspace{
  margin-left:260px!important;
  width:calc(100% - 260px)!important;
  background:var(--v41-bg)!important;
}
html[data-ui-mode="app"] .side-brand{
  min-height:86px!important;
  padding:16px 8px 14px!important;
  border-bottom:1px solid rgba(148,163,184,.14)!important;
  margin:0 0 12px!important;
}
html[data-ui-mode="app"] .side-brand img{
  width:42px!important;height:42px!important;border-radius:12px!important;
  background:rgba(255,255,255,.08)!important;
  box-shadow:0 8px 24px rgba(0,0,0,.20)!important;
}
html[data-ui-mode="app"] .side-brand strong{
  color:#f8fafc!important;font-size:14px!important;line-height:1.2!important;
}
html[data-ui-mode="app"] .side-brand small{
  color:#7dd3fc!important;font-size:9px!important;letter-spacing:.25px!important;
}
html[data-ui-mode="app"] .nav-search{
  display:block!important;margin:0 0 10px!important;
}
html[data-ui-mode="app"] .nav-search input{
  width:100%!important;height:38px!important;
  background:rgba(255,255,255,.06)!important;
  color:#e2e8f0!important;
  border:1px solid rgba(148,163,184,.16)!important;
  border-radius:11px!important;
  padding:8px 11px!important;
  outline:none!important;
}
html[data-ui-mode="app"] .nav-search input::placeholder{color:#7890aa!important}
html[data-ui-mode="app"] .sidebar nav{
  padding:0!important;
  display:flex!important;
  flex-direction:column!important;
  gap:4px!important;
}
html[data-ui-mode="app"] .nav-btn{
  width:100%!important;
  min-height:42px!important;
  border:0!important;
  border-radius:11px!important;
  background:transparent!important;
  color:#b8c7d9!important;
  font-size:13px!important;
  font-weight:800!important;
  text-align:left!important;
  padding:9px 11px!important;
  box-shadow:none!important;
  outline:none!important;
}
html[data-ui-mode="app"] .nav-btn:hover{
  background:rgba(255,255,255,.07)!important;
  color:#fff!important;
  transform:none!important;
}
html[data-ui-mode="app"] .nav-btn.active{
  background:linear-gradient(135deg,#0f766e,#0d9488)!important;
  color:#fff!important;
  box-shadow:0 7px 18px rgba(13,148,136,.27)!important;
}
html[data-ui-mode="app"] .side-bottom{
  border-top:1px solid rgba(148,163,184,.13)!important;
  padding-top:10px!important;
  gap:6px!important;
}
html[data-ui-mode="app"] .side-bottom button{
  min-height:38px!important;
  border-radius:10px!important;
  background:rgba(255,255,255,.045)!important;
  border:1px solid rgba(148,163,184,.15)!important;
  color:#d7e2ee!important;
}
html[data-ui-mode="app"] .side-bottom button:hover{background:rgba(255,255,255,.09)!important}
html[data-ui-mode="app"] .side-bottom .danger{color:#fecaca!important}

/* Topbar */
html[data-ui-mode="app"] .topbar{
  position:sticky!important;top:0!important;z-index:120!important;
  min-height:70px!important;
  padding:10px 20px!important;
  background:rgba(255,255,255,.94)!important;
  backdrop-filter:blur(14px)!important;
  border-bottom:1px solid var(--v41-line)!important;
  box-shadow:0 3px 14px rgba(15,23,42,.035)!important;
}
html[data-ui-mode="app"] .topbar h2{
  font-size:20px!important;line-height:1.05!important;margin:0!important;color:#0f172a!important;
}
html[data-ui-mode="app"] .topbar p{
  margin:3px 0 0!important;font-size:9.5px!important;color:#94a3b8!important;
}
html[data-ui-mode="app"] .global-search{
  max-width:520px!important;
}
html[data-ui-mode="app"] .global-search input{
  height:42px!important;
  border:1px solid var(--v41-line)!important;
  border-radius:12px!important;
  background:#f8fafc!important;
  padding:9px 14px!important;
  box-shadow:inset 0 1px 1px rgba(15,23,42,.02)!important;
}
html[data-ui-mode="app"] .global-search input:focus{
  background:#fff!important;border-color:#5eead4!important;
  box-shadow:0 0 0 3px rgba(20,184,166,.12)!important;
}
html[data-ui-mode="app"] .badge{
  border-radius:999px!important;
  padding:6px 9px!important;
  font-size:9px!important;
  font-weight:900!important;
  border:1px solid #dbeafe!important;
  background:#eff6ff!important;
  color:#1d4ed8!important;
}

/* Main content */
html[data-ui-mode="app"] .content{
  padding:20px 22px 92px!important;
  max-width:1680px!important;
  margin:0 auto!important;
}
html[data-ui-mode="app"] .page-head{
  min-height:74px!important;
  background:linear-gradient(135deg,#fff 0%,#fbfdff 100%)!important;
  border:1px solid var(--v41-line)!important;
  border-radius:16px!important;
  padding:15px 17px!important;
  margin:0 0 14px!important;
  box-shadow:0 5px 18px rgba(15,23,42,.035)!important;
}
html[data-ui-mode="app"] .page-head h3{
  font-size:19px!important;margin:0 0 3px!important;color:#0f172a!important;
}
html[data-ui-mode="app"] .page-head p{
  margin:0!important;color:#64748b!important;font-size:10.5px!important;line-height:1.45!important;
}
html[data-ui-mode="app"] .head-actions{gap:7px!important}

/* Buttons */
html[data-ui-mode="app"] .primary,
html[data-ui-mode="app"] .secondary,
html[data-ui-mode="app"] .ghost,
html[data-ui-mode="app"] .mini-btn,
html[data-ui-mode="app"] .icon-btn{
  border-radius:10px!important;
  font-weight:850!important;
  box-shadow:none!important;
}
html[data-ui-mode="app"] .primary{
  background:linear-gradient(135deg,#0f766e,#0d9488)!important;
  border:1px solid #0f766e!important;color:#fff!important;
}
html[data-ui-mode="app"] .primary:hover{
  background:linear-gradient(135deg,#0d665f,#0f766e)!important;
  transform:translateY(-1px)!important;
  box-shadow:0 8px 20px rgba(15,118,110,.18)!important;
}
html[data-ui-mode="app"] .secondary{
  background:#fff!important;color:#0f172a!important;border:1px solid var(--v41-line-strong)!important;
}
html[data-ui-mode="app"] .secondary:hover{background:#f8fafc!important;border-color:#94a3b8!important}
html[data-ui-mode="app"] .ghost{
  background:#f8fafc!important;color:#334155!important;border:1px solid var(--v41-line)!important;
}
html[data-ui-mode="app"] .mini-btn{
  padding:6px 8px!important;min-height:30px!important;font-size:9.5px!important;
  background:#fff!important;border:1px solid #dbe4ee!important;color:#334155!important;
}
html[data-ui-mode="app"] .mini-btn:hover{background:#f1f5f9!important}
html[data-ui-mode="app"] .mini-btn.delete{
  background:#fff7f7!important;border-color:#fecaca!important;color:#b91c1c!important;
}
html[data-ui-mode="app"] .mini-btn.edit{
  background:#eff6ff!important;border-color:#bfdbfe!important;color:#1d4ed8!important;
}
html[data-ui-mode="app"] .mini-btn.print{
  background:#f0fdfa!important;border-color:#99f6e4!important;color:#0f766e!important;
}

/* Inputs / toolbars */
html[data-ui-mode="app"] .toolbar{
  background:#fff!important;
  border:1px solid var(--v41-line)!important;
  border-radius:14px!important;
  padding:10px!important;
  margin-bottom:13px!important;
  box-shadow:0 4px 14px rgba(15,23,42,.025)!important;
  gap:8px!important;
}
html[data-ui-mode="app"] input,
html[data-ui-mode="app"] select,
html[data-ui-mode="app"] textarea{
  border-color:#d7e0ea!important;
}
html[data-ui-mode="app"] input:focus,
html[data-ui-mode="app"] select:focus,
html[data-ui-mode="app"] textarea:focus{
  border-color:#2dd4bf!important;
  outline:none!important;
  box-shadow:0 0 0 3px rgba(45,212,191,.11)!important;
}
html[data-ui-mode="app"] .toolbar input,
html[data-ui-mode="app"] .toolbar select{
  min-height:40px!important;border-radius:10px!important;background:#fbfdff!important;
}

/* KPI / summary cards */
html[data-ui-mode="app"] .stats-grid{
  gap:11px!important;margin-bottom:14px!important;
}
html[data-ui-mode="app"] .stat-card{
  min-height:102px!important;
  padding:15px 16px!important;
  border:1px solid var(--v41-line)!important;
  border-radius:16px!important;
  background:#fff!important;
  box-shadow:0 5px 18px rgba(15,23,42,.035)!important;
  position:relative!important;
  overflow:hidden!important;
}
html[data-ui-mode="app"] .stat-card::before{
  content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:#64748b;
}
html[data-ui-mode="app"] .stat-card:nth-child(1)::before{background:#0f766e}
html[data-ui-mode="app"] .stat-card:nth-child(2)::before{background:#2563eb}
html[data-ui-mode="app"] .stat-card:nth-child(3)::before{background:#7c3aed}
html[data-ui-mode="app"] .stat-card:nth-child(4)::before{background:#dc2626}
html[data-ui-mode="app"] .stat-card:nth-child(5)::before{background:#d97706}
html[data-ui-mode="app"] .stat-card:nth-child(6)::before{background:#15803d}
html[data-ui-mode="app"] .stat-card.em,
html[data-ui-mode="app"] .stat-card.red,
html[data-ui-mode="app"] .stat-card.warn{
  background:#fff!important;
}
html[data-ui-mode="app"] .stat-card span{
  color:#64748b!important;font-size:10.5px!important;font-weight:800!important;
}
html[data-ui-mode="app"] .stat-card strong{
  color:#0f172a!important;font-size:24px!important;line-height:1.15!important;margin-top:8px!important;
}

/* Panels */
html[data-ui-mode="app"] .panel{
  background:#fff!important;
  border:1px solid var(--v41-line)!important;
  border-radius:16px!important;
  box-shadow:0 6px 20px rgba(15,23,42,.035)!important;
  overflow:hidden!important;
}
html[data-ui-mode="app"] .panel-head{
  min-height:50px!important;
  padding:11px 14px!important;
  border-bottom:1px solid #edf2f7!important;
  background:linear-gradient(180deg,#fff,#fbfdff)!important;
}
html[data-ui-mode="app"] .panel-head h4{
  margin:0!important;font-size:14px!important;color:#0f172a!important;
}
html[data-ui-mode="app"] .panel-head small{color:#94a3b8!important}
html[data-ui-mode="app"] .panel-body{padding:14px!important}

/* Tables */
html[data-ui-mode="app"] .table-wrap{
  border:1px solid var(--v41-line)!important;
  border-radius:16px!important;
  background:#fff!important;
  box-shadow:0 5px 18px rgba(15,23,42,.03)!important;
  overflow:auto!important;
}
html[data-ui-mode="app"] .data-table{
  border-collapse:separate!important;border-spacing:0!important;
}
html[data-ui-mode="app"] .data-table th{
  position:sticky!important;top:0!important;z-index:2!important;
  background:#f8fafc!important;color:#475569!important;
  font-size:9.5px!important;text-transform:none!important;
  letter-spacing:.1px!important;
  border-bottom:1px solid #dbe4ee!important;
  padding:10px 10px!important;
}
html[data-ui-mode="app"] .data-table td{
  padding:10px!important;border-bottom:1px solid #eef2f7!important;
  color:#334155!important;
}
html[data-ui-mode="app"] .data-table tbody tr:nth-child(even) td{background:#fcfdff!important}
html[data-ui-mode="app"] .data-table tr:hover td{background:#f0fdfa!important}
html[data-ui-mode="app"] .money{font-weight:900!important;color:#0f172a!important}
html[data-ui-mode="app"] .paid{font-weight:900!important;color:#15803d!important}
html[data-ui-mode="app"] .due{font-weight:900!important;color:#b91c1c!important}

/* Product cards */
html[data-ui-mode="app"] .product-grid{gap:12px!important}
html[data-ui-mode="app"] .product-card{
  border:1px solid var(--v41-line)!important;border-radius:16px!important;
  background:#fff!important;box-shadow:0 6px 20px rgba(15,23,42,.04)!important;
  overflow:hidden!important;
}
html[data-ui-mode="app"] .product-card:hover{
  transform:translateY(-2px)!important;
  box-shadow:0 12px 28px rgba(15,23,42,.08)!important;
  border-color:#a7f3d0!important;
}
html[data-ui-mode="app"] .product-card img{
  background:#f8fafc!important;border-bottom:1px solid #eef2f7!important;
}
html[data-ui-mode="app"] .product-card .pc-body{padding:11px!important}
html[data-ui-mode="app"] .product-card b{color:#0f172a!important}
html[data-ui-mode="app"] .product-card small{color:#64748b!important}

/* POS */
html[data-ui-mode="app"] .pos-catalog,
html[data-ui-mode="app"] .pos-cart{
  background:#fff!important;
  border:1px solid var(--v41-line)!important;
  border-radius:16px!important;
  box-shadow:0 6px 20px rgba(15,23,42,.04)!important;
}
html[data-ui-mode="app"] .pos-search{
  border-bottom:1px solid #eef2f7!important;background:#fbfdff!important;padding:10px!important;
}
html[data-ui-mode="app"] .cart-head{
  border-bottom:1px solid #eef2f7!important;
  background:linear-gradient(180deg,#fff,#fbfdff)!important;
}
html[data-ui-mode="app"] .cart-footer{background:#fbfdff!important;border-top:1px solid #eef2f7!important}

/* Report cards */
html[data-ui-mode="app"] .report-card{
  background:#fff!important;border:1px solid var(--v41-line)!important;
  border-radius:16px!important;box-shadow:0 5px 18px rgba(15,23,42,.035)!important;
  padding:16px!important;
}
html[data-ui-mode="app"] .report-card span{color:#64748b!important}
html[data-ui-mode="app"] .report-card strong{color:#0f172a!important}

/* Forms */
html[data-ui-mode="app"] .form-grid label{
  color:#334155!important;font-weight:850!important;font-size:10.5px!important;
}
html[data-ui-mode="app"] .form-grid input,
html[data-ui-mode="app"] .form-grid select,
html[data-ui-mode="app"] .form-grid textarea{
  background:#fff!important;border:1px solid #d7e0ea!important;border-radius:10px!important;
  min-height:40px!important;padding:8px 10px!important;
}
html[data-ui-mode="app"] .form-actions{
  padding-top:12px!important;border-top:1px solid #edf2f7!important;margin-top:5px!important;
}

/* Modal — clean professional window */
html[data-ui-mode="app"] .modal{
  background:rgba(15,23,42,.44)!important;
  backdrop-filter:blur(3px)!important;
}
html[data-ui-mode="app"] .modal-card{
  width:min(1040px,calc(100vw - 70px))!important;
  max-width:1040px!important;
  border:1px solid #d8e2ec!important;
  border-radius:18px!important;
  box-shadow:var(--v41-shadow-lg)!important;
  overflow:hidden!important;
  background:#fff!important;
}
html[data-ui-mode="app"] .modal-head{
  min-height:58px!important;
  padding:13px 16px!important;
  background:#fff!important;
  border-bottom:1px solid var(--v41-line)!important;
}
html[data-ui-mode="app"] .modal-head h3{
  font-size:17px!important;color:#0f172a!important;margin:0!important;
}
html[data-ui-mode="app"] .modal-head button{
  width:34px!important;height:34px!important;border-radius:9px!important;
  border:1px solid #e2e8f0!important;background:#f8fafc!important;color:#475569!important;
}
html[data-ui-mode="app"] .modal-body{
  padding:16px!important;background:#fff!important;
}

/* Empty generic modal protection */
html[data-ui-mode="app"] #modalBody:empty,
html[data-ui-mode="app"] #modalBody:has(> :only-child:empty){display:none!important}

/* Suggestion dropdown */
html[data-ui-mode="app"] .app-record-suggestions{
  border:1px solid #cbd5e1!important;border-radius:12px!important;
  box-shadow:0 18px 44px rgba(15,23,42,.15)!important;
}
html[data-ui-mode="app"] .app-record-suggestion:hover,
html[data-ui-mode="app"] .app-record-suggestion:focus{
  background:#f0fdfa!important;outline:none!important;
}

/* Voice dock */
html[data-ui-mode="app"] .voice-toolbar.voice-toolbar-taskbar,
html[data-ui-mode="app"] .voice-toolbar{
  background:rgba(15,23,42,.96)!important;
  border:1px solid rgba(148,163,184,.20)!important;
  box-shadow:0 10px 30px rgba(15,23,42,.22)!important;
  padding:5px 7px!important;border-radius:999px!important;
  max-width:calc(100vw - 300px)!important;
}
html[data-ui-mode="app"] .voice-toolbar button{
  min-height:30px!important;
  padding:5px 9px!important;
  font-size:9px!important;
}
html[data-ui-mode="app"] .voice-privacy{
  color:#cbd5e1!important;font-size:8.5px!important;
}

/* Confirmation dialog */
html[data-ui-mode="app"] .voice-action-confirm-card,
html[data-ui-mode="app"] .voice-prompt-card{
  border-radius:18px!important;
  border:1px solid #dbe4ee!important;
  box-shadow:0 28px 80px rgba(15,23,42,.22)!important;
}
html[data-ui-mode="app"] .voice-action-confirm-actions button{
  min-height:46px!important;border-radius:11px!important;
}

/* Desktop density */
@media (min-width:1280px){
  html[data-ui-mode="app"] .stats-grid{grid-template-columns:repeat(6,minmax(0,1fr))!important}
  html[data-ui-mode="app"] .content{padding-left:24px!important;padding-right:24px!important}
}
@media (min-width:1100px) and (max-width:1279px){
  html[data-ui-mode="app"] .stats-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}

/* Keep V37 responsive behavior for smaller screens, with the new palette. */
@media (max-width:1099px){
  html[data-ui-mode="app"] .workspace{margin-left:0!important;width:100%!important}
  html[data-ui-mode="app"] .sidebar{width:min(84vw,310px)!important}
  html[data-ui-mode="app"] .content{padding-left:12px!important;padding-right:12px!important}
}


/* V42 — Assistant error feedback */
.toast.error{
  border:1px solid #fecaca!important;
  box-shadow:0 12px 34px rgba(185,28,28,.14)!important;
}
.auth-status.error{
  border-left:4px solid #dc2626!important;
  padding-left:12px!important;
}

/* V43 modal integrity: hidden/empty state removes overlay and blur immediately. */
#modal.hidden,#modal[hidden],#modal[aria-hidden="true"],#modal[data-modal-empty="true"]{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
  background:transparent!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
