:root{--ink:#101828;--muted:#667085;--bg:#f5f7fb;--card:#fff;--brand:#5b35d5;--brand2:#0aa8a7;--gold:#f2b544;--danger:#d92d20;--border:#e4e7ec}
*{box-sizing:border-box}body{margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;background:var(--bg);color:var(--ink)}a{text-decoration:none;color:inherit}.shell{display:grid;grid-template-columns:245px 1fr;min-height:100vh}.side{background:linear-gradient(180deg,#211253,#392174);color:#fff;padding:20px 14px;position:sticky;top:0;height:100vh;overflow:auto}.brand{font-weight:800;font-size:20px;padding:6px 10px 18px}.nav a{display:flex;gap:10px;align-items:center;padding:11px 12px;border-radius:10px;margin:3px 0;color:#f4f2ff}.nav a:hover,.nav a.on{background:#ffffff18}.main{padding:20px}.top{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.card{background:var(--card);border:1px solid var(--border);border-radius:16px;padding:16px;box-shadow:0 4px 18px #1018280a}.kpi{min-height:114px}.kpi b{font-size:28px;display:block;margin-top:10px}.muted{color:var(--muted)}.pill{display:inline-block;padding:5px 9px;border-radius:999px;background:#eeeafd;color:#4b2bb3;font-size:12px}.btn{border:0;border-radius:10px;padding:10px 14px;background:var(--brand);color:#fff;cursor:pointer;font-weight:700}.btn.alt{background:var(--brand2)}.btn.gold{background:#ad7200}.btn.light{background:#fff;color:var(--ink);border:1px solid var(--border)}.btn.danger{background:var(--danger)}input,select,textarea{width:100%;padding:10px 11px;border:1px solid #d0d5dd;border-radius:9px;background:#fff}label{font-size:13px;color:#475467;font-weight:650;display:block;margin-bottom:5px}.row{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.row2{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.table-wrap{overflow:auto}.table{width:100%;border-collapse:collapse}.table th,.table td{padding:10px 9px;border-bottom:1px solid #edf0f3;text-align:left;white-space:nowrap}.table th{font-size:12px;text-transform:uppercase;color:#667085;background:#fafafa}.alert{padding:12px 14px;border-radius:10px;margin-bottom:14px}.ok{background:#eafbf3;color:#057a55}.bad{background:#fff0ef;color:#b42318}.split{display:grid;grid-template-columns:1.4fr .9fr;gap:16px}.totals{font-size:15px}.totals .grand{font-size:26px;font-weight:800}.chips{display:flex;gap:8px;flex-wrap:wrap}.chip{padding:7px 10px;border-radius:9px;background:#f2f4f7;font-size:13px}.login{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at 20% 20%,#6d4ae8 0,#20114f 44%,#0b1020 100%)}.login .card{width:min(420px,92vw);padding:28px}.small{font-size:12px}@media(max-width:1050px){.grid{grid-template-columns:repeat(2,1fr)}.row{grid-template-columns:repeat(2,1fr)}.split{grid-template-columns:1fr}}@media(max-width:760px){.shell{grid-template-columns:1fr}.side{height:auto;position:relative}.nav{display:flex;overflow:auto}.nav a{white-space:nowrap}.main{padding:12px}.grid,.row,.row2{grid-template-columns:1fr}.top{align-items:flex-start;gap:10px}.top h2{margin:0}.hide-mobile{display:none}}
@media print{.side,.top,.no-print{display:none!important}.shell{display:block}.main{padding:0}.card{border:0;box-shadow:none}.table th{background:#fff}}

.input-warn{border-color:#d92d20!important;background:#fff1f0!important}.stock-zero{opacity:.55;text-decoration:line-through}.unit-badge{display:inline-block;padding:3px 7px;border-radius:7px;background:#ecfdf3;color:#027a48;font-size:11px;font-weight:700}
.section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:14px}.section-head h3{margin:0 0 4px}.quick-dialog{width:min(900px,94vw);border:0;border-radius:18px;padding:0;box-shadow:0 24px 80px #10182840}.quick-dialog::backdrop{background:#1018288f}.quick-dialog form{padding:20px}.dialog-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.dialog-head h3{margin:0}.dialog-x{border:0;background:#f2f4f7;border-radius:999px;width:36px;height:36px;font-size:24px;cursor:pointer}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}.form-msg{margin-top:10px;color:#475467}.btn.whatsapp{background:#149c61}.reorder-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:flex-end;padding-top:19px}.reorder-check{transform:scale(1.2)}
@media(max-width:760px){.section-head{flex-direction:column}.dialog-actions{justify-content:stretch}.dialog-actions .btn{flex:1}.reorder-actions{padding-top:0}.quick-dialog{width:96vw}}

/* v1.3 quick-add compatibility: works even when native <dialog>.showModal is unavailable. */
.quick-dialog.dialog-fallback-open{display:block!important;position:fixed;inset:4vh auto auto 50%;transform:translateX(-50%);z-index:10002;max-height:92vh;overflow:auto;background:#fff}
body.dialog-open:before{content:"";position:fixed;inset:0;background:#1018288f;z-index:10001}
body.dialog-open{overflow:hidden}
@media(max-width:760px){.quick-dialog.dialog-fallback-open{inset:2vh auto auto 50%;max-height:96vh}}

/* v1.4 mobile install + branding */
.brand-wrap{display:flex;align-items:center;gap:10px}.brand-logo{width:42px;height:42px;border-radius:11px;object-fit:contain;background:#fff;padding:4px;flex:0 0 auto}.brand-fallback{font-size:28px;line-height:1}.pwa-install{width:100%;margin:0 0 12px;padding:10px 12px;border:1px solid #ffffff30;border-radius:10px;background:#0aa8a7;color:#fff;font-weight:800;cursor:pointer}.pwa-help{font-size:12px;line-height:1.45;background:#ffffff14;color:#fff;padding:9px 10px;border-radius:9px;margin:0 0 10px}.login-card{text-align:left}.login-logo{display:block;width:78px;height:78px;object-fit:contain;border-radius:18px;background:#fff;border:1px solid var(--border);padding:6px;margin:0 auto 14px}.login-logo-fallback{width:78px;height:78px;border-radius:18px;background:#f2f4f7;display:grid;place-items:center;font-size:38px;margin:0 auto 14px}.pwa-login-btn{width:100%;margin-top:10px}.login-pwa-help{background:#eef8f8;color:#344054;margin-top:10px}.settings-brand-grid{display:grid;grid-template-columns:180px 1fr;gap:18px;align-items:start;margin-bottom:18px;padding-bottom:18px;border-bottom:1px solid var(--border)}.logo-preview-box{text-align:center}.logo-preview-box img,.logo-placeholder{width:128px;height:128px;object-fit:contain;border-radius:22px;border:1px solid var(--border);background:#fff;padding:8px;margin:0 auto 8px}.logo-placeholder{display:grid;place-items:center;font-size:56px;background:#f7f5ff}.pwa-status-card{margin-top:12px;padding:12px;border-radius:12px;background:#f4fbfb;border:1px solid #c8eeee}.input-warn{outline:2px solid #f79009!important}
@media(max-width:760px){.settings-brand-grid{grid-template-columns:1fr}.brand-logo{width:36px;height:36px}.pwa-install{position:sticky;left:0;min-width:max-content;margin:0 8px 0 0}.side>.pwa-help{margin:8px 0}.nav{margin-top:8px}.login .card{padding:22px}}
@media print{.pwa-install,.pwa-help{display:none!important}}
/* v1.7 admin edit/delete controls */
.action-buttons{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.action-buttons form{margin:0}.btn.mini{padding:7px 10px;border-radius:8px;font-size:12px;line-height:1}.table td .btn.mini{white-space:nowrap}


/* v1.8 smart vendor bill scan */
.btn.scan-btn{background:linear-gradient(135deg,#5b35d5,#0aa8a7);color:#fff;border:0}.scan-hero{background:linear-gradient(135deg,#fff,#f7f5ff 55%,#ecfffe)}.scan-safety{padding:11px 13px;border-radius:12px;background:#fff8e8;border:1px solid #f5d88d;color:#694b00;font-size:13px}.scan-step{display:flex;align-items:center;gap:10px;margin-bottom:14px}.scan-step>span{width:34px;height:34px;border-radius:11px;display:grid;place-items:center;background:#5b35d5;color:#fff;font-weight:800;flex:0 0 auto}.scan-upload-grid{display:grid;grid-template-columns:minmax(240px,.7fr) minmax(0,1.3fr);gap:16px;align-items:start}.scan-drop{min-height:180px;border:2px dashed #c9c3ed;border-radius:16px;background:#faf9ff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;cursor:pointer;padding:20px}.scan-drop:hover{border-color:#5b35d5;background:#f5f2ff}.scan-camera{font-size:36px}.bill-preview{display:flex;gap:10px;overflow:auto;padding-bottom:8px;min-height:92px}.bill-thumb{position:relative;flex:0 0 86px}.bill-thumb img{width:86px;height:86px;object-fit:cover;border-radius:10px;border:1px solid var(--border);background:#fff}.bill-thumb span{position:absolute;left:4px;bottom:5px;background:#101828cc;color:#fff;border-radius:6px;padding:2px 5px;font-size:10px}.scan-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.scan-progress-wrap{height:9px;background:#eef0f4;border-radius:99px;overflow:hidden;margin-top:12px}.scan-progress-bar{height:100%;width:0;background:linear-gradient(90deg,#5b35d5,#0aa8a7);transition:width .2s}.ocr-details{margin-top:14px;border-top:1px solid var(--border);padding-top:12px}.ocr-details summary{cursor:pointer;font-weight:700;color:#475467}.scan-table select,.scan-table input{min-width:110px;padding:8px}.scan-table .scan-product{min-width:220px}.scan-detected{max-width:260px;white-space:normal!important;font-size:12px;color:#667085;line-height:1.35}.scan-status{display:inline-block;border-radius:999px;padding:3px 7px;font-size:10px;font-weight:800;margin-bottom:5px}.scan-status.good{background:#eafbf3;color:#057a55}.scan-status.warn{background:#fff4e5;color:#b54708}.scan-row-review{background:#fffdf8}.scan-row-good{background:#fbfffd}.scan-total-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.scan-total-grid>div{padding:12px;border-radius:12px;background:#f7f8fb;border:1px solid #eceef3}.scan-total-grid b{display:block;font-size:20px;margin-top:4px}.scan-check{display:flex;gap:9px;align-items:flex-start;margin-top:14px;padding:12px;border-radius:12px;background:#eefafa;color:#344054}.scan-save{width:100%;margin-top:12px;padding:13px 16px}.scan-diff-bad{color:#b42318}.scan-diff-ok{color:#067647}
@media(max-width:900px){.scan-upload-grid{grid-template-columns:1fr}.scan-total-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:560px){.scan-total-grid{grid-template-columns:1fr}.scan-drop{min-height:140px}.scan-table .scan-product{min-width:190px}.scan-detected{min-width:180px}.scan-confirm{position:relative}.scan-save{position:sticky;bottom:8px;z-index:5}}

/* v1.9 — pharmacy mobile counter / generic & rack lookup */
.pos-intro{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}
.pos-intro h3{margin:0 0 5px;font-size:19px}.pos-intro p{margin:0;max-width:780px}
.pharmacy-pos{align-items:start}.pharmacy-pos .pos-catalog{min-width:0}.pos-searchbar{display:flex;align-items:end;gap:8px}
.pos-searchbox{flex:1;min-width:0}.pos-searchbox input{font-size:16px;height:48px;border:2px solid #d6d0f2}
.pos-searchbox input:focus{border-color:#5b35d5;outline:2px solid #e3dbff}
.pos-icon-btn{min-height:48px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:66px;font-size:18px;padding:6px 8px}
.pos-icon-btn span{font-size:10px}.pos-tools{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(130px,.6fr);gap:12px;margin:10px 0}
.pos-inline{display:flex;gap:6px}.pos-inline input{min-width:0;flex:1}.pos-inline .btn{flex-shrink:0}
.pos-results{display:grid;grid-template-columns:repeat(auto-fit,minmax(235px,1fr));gap:8px;margin:9px 0 14px;max-height:370px;overflow:auto}
.pos-result{background:linear-gradient(150deg,#fff,#f8f7ff);border:1px solid #ded9f2;border-radius:13px;padding:11px;display:flex;flex-direction:column;gap:8px;justify-content:space-between}
.pos-result-main{line-height:1.45;min-width:0;overflow-wrap:anywhere}.pos-result-main b{font-size:14px}.pos-result-main .small{margin-top:3px}
.pos-result-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.pos-result-actions>b{margin-right:auto;color:#32216b}.pos-result-actions button:disabled{opacity:.5;cursor:not-allowed}
.rack-tag{display:inline-block;padding:3px 7px;background:#e8f8f8;color:#086d6d;border-radius:7px;font-size:11px;font-weight:750;white-space:normal}
.pos-cart-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:12px;border-top:1px solid #edf0f3;padding-top:12px}
.pos-cart-heading h3{margin:0 0 9px}.pos-table-wrap{margin-top:6px}.pos-table th,.pos-table td{vertical-align:middle}
.pos-table .pos-medicine-cell{min-width:175px;white-space:normal}.pos-medicine-cell b{display:block}.pos-medicine-cell .rack-tag{margin-top:5px}
.pos-table .pos-rate input,.pos-table .pos-gst input{min-width:75px;width:85px;padding:8px 5px}.pos-table .pos-qty input{width:55px;min-width:45px;text-align:center;padding:7px 2px}
.qty-stepper{display:flex;align-items:center;gap:3px;white-space:nowrap}.qty-btn{border:1px solid #d9d3ef;background:#f3f0ff;color:#4b2bb3;border-radius:8px;width:33px;height:36px;font-size:21px;font-weight:800;cursor:pointer}
.pos-line{font-weight:750}.pos-empty{text-align:center;padding:16px 0;border:1px dashed #d6d0e6;border-radius:12px}
.pos-empty[hidden]{display:none}.pos-checkout .row2{grid-template-columns:repeat(2,minmax(0,1fr))}.pos-checkout .grand{font-size:23px}
.pos-save{width:100%;margin-top:12px;min-height:48px}.pos-mobile-bar{display:none}
.scanner-dialog,.alternatives-dialog{max-width:650px;max-height:88vh;overflow:auto;padding:18px}
.scanner-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.scanner-head h3{margin:0 0 12px}
.barcode-reader{min-height:240px;background:#121827;border-radius:12px;overflow:hidden;display:flex;align-items:center;justify-content:center;color:#fff}
.barcode-reader video,.barcode-reader canvas{width:100%!important;max-height:55vh;object-fit:contain}
.barcode-reader #qr-shaded-region{border:0!important}.scanner-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}
.alternatives-content{max-height:65vh;overflow:auto}.alternatives-content h4{margin:18px 0 8px}.alt-result{border:1px solid #c5e9e0;background:#f3fdf9;border-radius:11px;padding:10px;margin:7px 0}
.alt-result .small{margin-top:4px}.alt-review{border-color:#f6dca2;background:#fffaf0}
@media(max-width:1050px){.pos-checkout .row2{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){
 body.is-mobile-counter .side{display:none}body.is-mobile-counter .main{padding:10px 10px 92px}
 .pharmacy-pos{grid-template-columns:1fr}.pos-intro{align-items:flex-start}.pos-intro .btn{font-size:12px;white-space:nowrap}
 .pos-tools{grid-template-columns:minmax(0,1fr) 120px;gap:7px}.pos-tools input,.pos-tools select{font-size:14px}
 .pos-results{grid-template-columns:1fr;max-height:320px}.pos-result{flex-direction:row;align-items:center;gap:10px}
 .pos-result-actions{flex:0 0 112px;justify-content:flex-end}.pos-result-actions>b{width:100%;text-align:right}
 .pos-mobile-bar{display:flex;position:fixed;bottom:0;left:0;right:0;z-index:40;background:#fff;padding:10px 12px calc(10px + env(safe-area-inset-bottom));border-top:1px solid #d8d3ed;box-shadow:0 -4px 20px #1f17401f;gap:9px}
 .pos-mobile-bar button:first-child{flex:1}.pos-mobile-bar button:last-child{flex:0 0 115px}
 body:has(.pharmacy-pos) .main{padding-bottom:90px}
 .pos-checkout .row2{grid-template-columns:repeat(2,minmax(0,1fr))}
 .pos-table-wrap{overflow:visible}.pos-table{display:block;width:100%}.pos-table thead{display:none}.pos-table tbody{display:block}
 .pos-table tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;border:1px solid #dcd8ed;border-radius:13px;background:#fbfaff;padding:10px;margin-bottom:10px}
 .pos-table td{display:block;white-space:normal!important;padding:0!important;border:0!important;min-width:0!important}
 .pos-table .pos-medicine-cell{grid-column:1 / -1}.pos-table .pos-fefo{grid-column:1 / -1;display:flex;align-items:center;gap:8px}
 .pos-table .pos-qty{grid-column:1}.pos-table .pos-rate{grid-column:2}.pos-table .pos-gst{grid-column:1}.pos-table .pos-line{grid-column:2;align-self:center;text-align:right}
 .pos-table .pos-remove{grid-column:1 / -1;text-align:right}.pos-table .pos-rate input,.pos-table .pos-gst input{width:100%;max-width:160px}
 .qty-stepper{justify-content:flex-start}.qty-stepper input{width:64px}.qty-btn{width:38px;height:40px}
 .scanner-dialog,.alternatives-dialog{width:96vw;padding:13px;max-height:94vh}.barcode-reader{min-height:200px}
}
@media(max-width:390px){.pos-icon-btn{min-width:50px}.pos-tools{grid-template-columns:1fr}.pos-result-actions{flex-basis:96px}.pos-checkout .row2{grid-template-columns:1fr}}
@media print{.pos-intro,.pos-mobile-bar,.pos-tools,.pos-searchbar,.pos-results{display:none!important}}
.purchase-barcode-row{margin-top:12px;padding:11px 13px;background:#f6f4ff;border:1px solid #e3dff7;border-radius:12px}.purchase-barcode-row .pos-inline{max-width:640px}.purchase-barcode-row p{margin:5px 0 0}
.purchase-barcode-row{margin-top:12px;padding:11px 13px;background:#f6f4ff;border:1px solid #e3dff7;border-radius:12px}.purchase-barcode-row .pos-inline{max-width:640px}.purchase-barcode-row p{margin:5px 0 0}
.purchase-barcode-row{margin-top:12px;padding:11px 13px;background:#f6f4ff;border:1px solid #e3dff7;border-radius:12px}.purchase-barcode-row .pos-inline{max-width:640px}.purchase-barcode-row p{margin:5px 0 0}

/* v2.0: unit conversion, AI vendor scan, smart actions */
.pos-table .pos-unit select{min-width:110px;max-width:165px;padding:7px 5px;font-size:13px}
.pos-table .pos-unit .small{margin-top:5px;max-width:150px;line-height:1.25}
.legacy-convert{margin-top:16px;border:1px solid #e2c57a;background:#fffbef;padding:14px;border-radius:12px;display:flex;flex-wrap:wrap;align-items:end;gap:10px}
.legacy-convert label{width:100%;font-weight:700}.legacy-convert input{max-width:155px}
.legacy-convert-notice{grid-column:1/-1;background:#fff8e4;border:1px solid #ead08e;border-radius:10px;padding:10px;font-size:13px}
.smart-actions{margin-bottom:16px}.smart-action-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px}
.smart-action-grid a{padding:14px;background:#f7f5ff;border:1px solid #e1dafc;border-radius:13px;color:#2b2263;text-decoration:none;display:flex;flex-direction:column;gap:7px}
.smart-action-grid a span{font-size:12px;line-height:1.4;color:#5e6278}.smart-action-grid a:hover{background:#ebe7ff}
.scan-table .scan-unit{min-width:92px}.scan-table input[name="free_qty[]"]{width:70px;min-width:65px}
.scan-table input[name="line_discount[]"]{width:95px;min-width:80px}
@media(max-width:760px){.pos-table .pos-unit{grid-column:1}.pos-table .pos-rate{grid-column:2}.pos-table .pos-unit select{width:100%;max-width:none}}

.strip-price-wizard{grid-column:1/-1;padding:13px;background:#edf8f7;border:1px solid #bfe5df;border-radius:12px}
.strip-price-wizard>b{display:block;margin-bottom:7px}.strip-price-wizard p{margin:4px 0 10px}
.strip-price-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:8px}
.strip-price-fields label{font-size:12px}.strip-price-fields input{width:100%;margin-top:5px}
@media(max-width:760px){.strip-price-fields{grid-template-columns:1fr}}

.pack-choice-grid{display:grid;grid-template-columns:1fr;gap:9px;margin:12px 0}.pack-choice-grid button{min-height:54px;font-size:15px;text-align:left;justify-content:flex-start}

/* v2.1: review-first new supplier and medicine drafts */
.scan-new-fields{margin-top:10px;padding:12px;border:1px solid #edcf86;background:#fffcf3;border-radius:12px;min-width:270px;max-width:460px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;white-space:normal}
.scan-new-fields[hidden]{display:none!important}.scan-new-fields>b,.scan-new-fields>p{grid-column:1/-1;margin:0}.scan-new-fields label{font-size:11px;margin:0;white-space:normal}.scan-new-fields input,.scan-new-fields select{min-width:0;width:100%;font-size:12px;padding:8px 6px;margin-top:3px}.scan-med-cell{min-width:290px;vertical-align:top!important}.scan-new-fields .muted{line-height:1.4}.scan-confirm .scan-check{background:#f7f6fc}.scan-confirm .scan-check input{flex:0 0 auto;margin-top:3px}
@media(max-width:650px){.scan-new-fields{grid-template-columns:1fr;min-width:235px;max-width:300px}.scan-new-fields>b,.scan-new-fields>p{grid-column:auto}.scan-med-cell{min-width:255px}}

/* v2.2 OCR-free digital invoice reader */
.scan-photo-drop{min-height:104px;padding:12px;border-color:#dce3eb;background:#fbfcff}.scan-photo-drop .scan-camera{font-size:23px}.scan-photo-drop b{font-size:13px}.bill-thumb img{cursor:zoom-in}#scanWarnings{color:#8a5d1d}#scanRawText{min-height:135px}

/* v2.3 supplier/inventory reporting and instant tablet purchase pricing */
.report-hero{background:linear-gradient(135deg,#ffffff 15%,#f7f5ff 65%,#eefcfb)}
.report-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));align-items:end;gap:10px;margin:14px 0}
.report-filters label{margin:0}.report-filters input,.report-filters select{margin-top:5px}
.report-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px;margin:14px 0}
.report-kpis>div{background:#f7f8ff;border:1px solid #e4e3f8;border-radius:12px;padding:12px}
.report-kpis span{display:block;color:#667085;font-size:12px}.report-kpis b{display:block;margin-top:5px;font-size:20px;color:#332277}
.movement-pill{display:inline-block;border-radius:8px;font-size:11px;font-weight:800;padding:5px 8px}
.movement-pill.stock-in{background:#e5faf0;color:#067647}.movement-pill.stock-out{background:#fff0ed;color:#b42318}
.purchase-invoice-header,.purchase-party{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}
.purchase-invoice-header h2{margin:4px 0}.purchase-invoice-header p,.purchase-party p{line-height:1.5}
.purchase-totals{max-width:350px;margin:20px 0 0 auto}.purchase-totals p{display:flex;justify-content:space-between;gap:12px;margin:9px 0}.purchase-totals .grand{border-top:1px solid #d0d5dd;padding-top:10px;font-size:19px}
.pay-invoice-form{border-top:1px solid #e4e7ec;padding-top:14px;margin-top:16px}.pay-invoice-form .row{grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}
.unit-cost-preview{min-width:170px;max-width:230px;white-space:normal;line-height:1.5;color:#166b59;font-weight:700}
@media(max-width:650px){.purchase-invoice-header,.purchase-party{flex-direction:column}.report-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media print{.side,.top,.no-print,.report-filters,.pay-invoice-form,.action-buttons{display:none!important}.shell{display:block}.main{padding:0}.card{box-shadow:none;border:0;padding:4px}.invoice-view{width:100%}.table-wrap{overflow:visible}.table th,.table td{white-space:normal;font-size:10px}.purchase-invoice-header,.purchase-party{display:flex;flex-direction:row}}

/* v2.4: keep conditional exchange panel hidden until selected. */
#returnReplacement[hidden]{display:none!important}
#kpReturnForm textarea{width:100%;min-height:64px}
@media(max-width:680px){#kpReturnForm .row{display:grid;grid-template-columns:1fr;gap:10px}#kpReturnForm select,#kpReturnForm input{max-width:100%}}


/* v2.5 — full-width desktop & mobile POS, always-accessible menu and checkout */
.top-title-group,.top-actions{display:flex;align-items:center;gap:12px;min-width:0}.top-title-group h2{margin:0}.app-menu-toggle{white-space:nowrap;min-height:42px}.top-actions{flex-shrink:0}.app-side-close{display:none}.app-menu-shade,.pos-checkout-shade{display:none}
/* POS occupies all available desktop width, without a permanently visible sidebar. */
body.pos-mode{background:#eef2fa}body.pos-mode .shell{display:block;min-height:100dvh}body.pos-mode .main{width:100%;max-width:none;min-width:0;padding:12px 16px 24px}body.pos-mode .top{margin-bottom:10px;background:#fff;border:1px solid #e1e5ef;border-radius:13px;padding:9px 13px}body.pos-mode .top h2{font-size:19px}body.pos-mode .pharmacy-pos{display:grid;grid-template-columns:minmax(0,1fr) minmax(305px,360px);gap:12px;align-items:start}body.pos-mode .pos-catalog,body.pos-mode .pos-checkout{min-width:0}body.pos-mode .pos-catalog{padding:14px}body.pos-mode .pos-results{max-height:min(34vh,340px);grid-template-columns:repeat(auto-fill,minmax(225px,1fr))}body.pos-mode .pos-checkout{position:sticky;top:10px;max-height:calc(100dvh - 20px);overflow:auto}body.pos-mode .pos-intro{margin:0 0 10px}body.pos-mode .pos-intro h3{font-size:17px}body.pos-mode .pos-intro p{font-size:12px}.pos-quick-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.pos-quick-actions .btn{padding:9px 12px}.pos-checkout-heading{display:flex;justify-content:space-between;align-items:center;gap:8px}.pos-checkout-heading h3{margin:0 0 12px}.pos-checkout-close,.pos-mobile-checkout-trigger{display:none}
/* POS menu is an overlay, never steals bill space. */
body.pos-mode .side{position:fixed;z-index:110;left:0;top:0;bottom:0;width:min(305px,86vw);height:100dvh;transform:translateX(-105%);transition:transform .18s ease;box-shadow:12px 0 38px #11182722;display:block;overflow:auto}body.pos-mode.pos-menu-open .side{transform:translateX(0)}body.pos-mode.pos-menu-open .app-menu-shade{display:block;position:fixed;inset:0;background:#0b12258a;z-index:105}body.pos-mode .app-side-close{display:block;position:absolute;top:12px;right:12px;background:#ffffff22;border:1px solid #ffffff55;color:#fff;border-radius:8px;padding:8px 12px;cursor:pointer}body.pos-mode .side .nav{display:block;overflow:visible}body.pos-mode .side .nav a{white-space:normal}body.pos-mode.pos-menu-open{overflow:hidden}
/* On non-POS pages, the same Menu button can collapse/reveal navigation. */
body:not(.pos-mode).menu-hidden .shell{grid-template-columns:1fr}body:not(.pos-mode).menu-hidden .side{display:none}body:not(.pos-mode) .app-menu-toggle{display:inline-flex;align-items:center;gap:5px}
/* Desktop POS line items fit the entire screen; horizontal scrolling only on narrow windows. */
body.pos-mode .pos-table-wrap{max-width:100%}body.pos-mode .pos-table th,body.pos-mode .pos-table td{padding:8px 5px}body.pos-mode .pos-table .pos-medicine-cell{min-width:145px}body.pos-mode .pos-table .pos-rate input,body.pos-mode .pos-table .pos-gst input{width:75px;min-width:68px}body.pos-mode .pos-table .pos-unit select{min-width:95px;max-width:130px}
@media(max-width:1050px){body.pos-mode .pharmacy-pos{grid-template-columns:minmax(0,1fr) minmax(260px,320px)}body.pos-mode .pos-results{grid-template-columns:1fr}}
@media(max-width:760px){
 body.pos-mode .main{padding:8px 8px calc(90px + env(safe-area-inset-bottom))}body.pos-mode .top{padding:7px 8px;margin-bottom:8px;gap:6px}body.pos-mode .top-title-group{gap:7px}body.pos-mode .top h2{font-size:16px}body.pos-mode .top .small{font-size:10px}body.pos-mode .app-menu-toggle{padding:9px 10px;min-height:40px}body.pos-mode .top-actions{gap:5px}body.pos-mode .top-actions .btn{padding:9px 8px;font-size:12px}body.pos-mode .pos-fullscreen-button{font-size:0!important;min-width:40px}body.pos-mode .pos-fullscreen-button::first-letter{font-size:18px}body.pos-mode .pos-intro{align-items:center;gap:6px}body.pos-mode .pos-intro h3{font-size:15px}body.pos-mode .pos-intro p{display:none}body.pos-mode .pos-quick-actions .btn{padding:9px 8px;font-size:12px}body.pos-mode .pos-quick-actions .btn:first-child{display:none}body.pos-mode .pharmacy-pos{display:block}body.pos-mode .pos-catalog{padding:10px}body.pos-mode .pos-results{max-height:min(35dvh,320px)}body.pos-mode .pos-mobile-bar{display:flex}body.pos-mode .pos-checkout{display:none}body.pos-mode .pos-mobile-checkout-trigger{display:inline-flex}
 body.pos-mode.pos-checkout-open .pos-checkout-shade{display:block;position:fixed;inset:0;background:#111827a6;z-index:80}body.pos-mode.pos-checkout-open .pos-checkout{display:block;position:fixed;z-index:90;left:0;right:0;bottom:0;top:auto;width:100%;max-height:94dvh;overflow:auto;border-radius:20px 20px 0 0;padding:18px 15px calc(18px + env(safe-area-inset-bottom));box-shadow:0 -12px 40px #11182745}body.pos-mode.pos-checkout-open .pos-checkout-close{display:inline-flex;font-size:12px}body.pos-mode.pos-checkout-open .pos-mobile-bar{display:none}body.pos-mode.pos-checkout-open{overflow:hidden}
 body:not(.pos-mode) .shell{display:block}body:not(.pos-mode) .side{position:fixed;z-index:110;top:0;left:0;width:min(305px,88vw);height:100dvh;transform:translateX(-105%);transition:transform .18s ease;display:block}body:not(.pos-mode).menu-open .side{transform:translateX(0)}body:not(.pos-mode).menu-open .app-menu-shade{display:block;position:fixed;inset:0;background:#0b12258a;z-index:105}body:not(.pos-mode) .app-side-close{display:block;position:absolute;right:12px;top:12px;background:#ffffff22;border:1px solid #ffffff55;color:#fff;border-radius:8px;padding:8px 12px}body:not(.pos-mode) .side .nav{display:block;overflow:visible}body:not(.pos-mode) .side .nav a{white-space:normal}body:not(.pos-mode).menu-open{overflow:hidden}
}
@media(max-width:400px){body.pos-mode .top-actions>a{font-size:11px!important}body.pos-mode .pos-intro{flex-wrap:wrap}body.pos-mode .pos-quick-actions{margin-left:auto}}
@media print{body.pos-mode .side,body.pos-mode .app-menu-shade,body.pos-mode .pos-checkout-shade,.app-menu-toggle,.pos-fullscreen-button,.pos-quick-actions,.pos-checkout-close{display:none!important}body.pos-mode .main{padding:0}body.pos-mode .pos-checkout{position:static;max-height:none;overflow:visible}}


/* v2.6 mobile medicine-search keyboard and newest-first bill polish */
.pos-mobile-hint{display:none}
@media(max-width:760px){
 body.pos-mode .pos-mobile-hint{display:block;margin:3px 0 8px;font-size:11px;line-height:1.35}
 body.pos-mode .pos-searchbox input{font-size:16px}
 body.pos-mode #searchResults{scroll-margin-top:14px;overscroll-behavior:contain}
 body.pos-mode #posSearch{scroll-margin-top:10px}
 body.pos-mode #saleRows tbody tr:first-child{background:#f7fcff}
}

/* v2.6.2: medicine matches must be visible ABOVE the mobile software keyboard. */
.pos-search-loading,.pos-search-empty{padding:12px 14px;border:1px solid #ded9f2;border-radius:12px;background:#faf9ff;color:#4a3c75;font-size:14px;grid-column:1/-1}
@media(max-width:760px){
 /* Compact search mode keeps the results directly below the search field. */
 body.pos-mode.pos-search-active .pos-tools,
 body.pos-mode.pos-search-active #voiceStatus,
 body.pos-mode.pos-search-active .pos-mobile-hint{display:none!important}
 body.pos-mode.pos-search-active .pos-results{margin-top:8px;max-height:min(42dvh,350px);overflow:auto;scroll-margin-top:8px}
 body.pos-mode.pos-search-active .pos-searchbar{position:relative;z-index:2}
 body.pos-mode .pos-results{grid-template-columns:minmax(0,1fr)}
 body.pos-mode.pos-search-active .pos-result{padding:10px 12px;gap:6px}
 body.pos-mode.pos-search-active .pos-result-main b{font-size:14px}
 body.pos-mode.pos-search-active .pos-result-actions{gap:6px}
 body.pos-mode.pos-search-active .pos-result-actions .btn{min-height:36px}
}

/* v2.7: 58/80mm thermal POS receipts; only the receipt is printed. */
.thermal-layout{display:flex;align-items:flex-start;gap:20px;flex-wrap:wrap}
.thermal-controls{flex:1 1 340px;max-width:650px}.thermal-controls h3{margin:0 0 8px}
.thermal-toolbar{display:flex;flex-wrap:wrap;align-items:end;gap:9px;margin:15px 0}
.thermal-toolbar label{font-size:12px;font-weight:700}.thermal-toolbar select{min-width:130px;display:block;margin-top:4px}
.thermal-autoprint{display:flex;gap:9px;align-items:center;font-size:13px;margin:10px 0}
.thermal-autoprint input{width:18px;height:18px;flex:0 0 auto}.thermal-links{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.thermal-receipt{--kp-receipt-width:48mm;width:var(--kp-receipt-width);min-width:var(--kp-receipt-width);max-width:var(--kp-receipt-width);box-sizing:border-box;background:white;color:black;padding:2mm 1mm 5mm;font-family:Arial,Helvetica,sans-serif;font-size:10px;line-height:1.3;box-shadow:0 4px 20px #1018282a;overflow-wrap:anywhere}
.thermal-receipt[data-paper="80"]{--kp-receipt-width:72mm;font-size:11px}
.thermal-head,.thermal-foot{text-align:center}.thermal-name{font-size:15px;font-weight:800;line-height:1.15}.thermal-logo{display:block;max-width:20mm;max-height:13mm;object-fit:contain;margin:0 auto 2mm}
.thermal-rule{border-top:1px dashed #222;margin:6px 0}.thermal-meta{margin:6px 0;line-height:1.4}
.thermal-items{border-collapse:collapse;width:100%;table-layout:fixed;font-size:inherit}
.thermal-items th,.thermal-items td{padding:2px 0;vertical-align:top;white-space:normal;overflow-wrap:anywhere;border:0}
.thermal-items th:first-child{width:73%;text-align:left}.thermal-items th:last-child{width:27%}
.thermal-right{text-align:right;white-space:nowrap!important}.thermal-item-name{font-weight:700;padding-top:7px!important}
.thermal-item-meta{font-size:9px;color:#444}.thermal-total-row{display:flex;justify-content:space-between;gap:7px;margin:3px 0}.thermal-grand{font-size:14px}
.thermal-foot{padding-top:6px;line-height:1.6}
@media(max-width:700px){.thermal-layout{display:block}.thermal-controls{max-width:none}.thermal-receipt{margin:16px auto}}
@media print{
 @page{size:auto;margin:0}
 body.invoice-print-thermal{background:#fff!important;color:#000!important;margin:0!important;padding:0!important;width:auto!important;height:auto!important}
 body.invoice-print-thermal *{visibility:hidden!important}
 body.invoice-print-thermal .thermal-receipt,body.invoice-print-thermal .thermal-receipt *{visibility:visible!important}
 body.invoice-print-thermal .thermal-receipt{position:absolute!important;top:0!important;left:0!important;display:block!important;width:48mm!important;min-width:48mm!important;max-width:48mm!important;margin:0!important;padding:1mm 0 4mm!important;box-shadow:none!important;border:0!important;background:#fff!important;color:#000!important;font-size:10px!important;line-height:1.25!important}
 body.invoice-print-thermal .thermal-receipt[data-paper="80"]{width:72mm!important;min-width:72mm!important;max-width:72mm!important;font-size:11px!important}
 body.invoice-print-thermal .thermal-receipt .thermal-item-meta{color:#000!important}
 body.invoice-print-thermal .thermal-controls,body.invoice-print-thermal .thermal-links,body.invoice-print-thermal .side,body.invoice-print-thermal .top,body.invoice-print-thermal .app-menu-shade,body.invoice-print-thermal .alert{display:none!important}
 body.invoice-print-thermal .main>*:not(.thermal-layout){display:none!important}
 body.invoice-print-thermal .thermal-layout{display:block!important}
 body.invoice-print-thermal .main{margin:0!important;padding:0!important;min-height:0!important}
 body.invoice-print-thermal .shell{display:block!important}
}

/* v2.7.1: purchase quantity must never collapse behind browser number spinners. */
.purchase-table-wrap{overflow-x:auto;overscroll-behavior-x:contain;scrollbar-gutter:stable;}
.purchase-entry-table{min-width:1640px;width:100%;}
.purchase-entry-table th,.purchase-entry-table td{vertical-align:middle;}
.purchase-entry-table .purchase-product{min-width:180px;max-width:270px;}
.purchase-entry-table input[name="batch[]"]{min-width:94px;}
.purchase-entry-table input[name="expiry[]"]{min-width:145px;}
.purchase-entry-table .purchase-unit{min-width:140px;}
.purchase-entry-table input[name="free_qty[]"]{min-width:70px;}
.purchase-entry-table input[name="line_discount[]"]{min-width:90px;}
.purchase-entry-table input[name="price[]"]{min-width:110px;}
.purchase-entry-table input[name="mrp[]"]{min-width:100px;}
.purchase-entry-table input[name="gst[]"]{min-width:70px;}
.purchase-entry-table .unit-cost-preview{min-width:195px;white-space:normal;line-height:1.4;}
.purchase-entry-table .purchase-qty-cell{min-width:154px;width:154px;}
.purchase-qty-stepper{display:flex;align-items:center;gap:5px;min-width:140px;}
.purchase-qty-stepper input[name="qty[]"]{display:block;flex:1 1 72px;width:72px;min-width:72px;max-width:95px;padding:9px 5px;text-align:center;font-weight:800;font-size:17px;appearance:textfield;-moz-appearance:textfield;}
.purchase-qty-stepper input[name="qty[]"]::-webkit-outer-spin-button,.purchase-qty-stepper input[name="qty[]"]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}
.purchase-qty-btn{flex:0 0 31px;width:31px;height:38px;border:1px solid #d6d1ef;border-radius:9px;background:#f3f0ff;color:#4b2bb3;font-size:20px;font-weight:800;cursor:pointer;}
.purchase-qty-btn:active{background:#e2dcff;}
.purchase-existing-search{position:relative;margin:12px 0;padding:13px 15px;border:1px solid #dcd5ff;border-radius:12px;background:#f8f6ff;max-width:720px;}
.purchase-existing-search input{font-size:15px;}
.purchase-existing-search p{margin:7px 0 0;}
.purchase-medicine-matches{position:absolute;top:calc(100% - 7px);left:15px;right:15px;z-index:30;background:#fff;border:1px solid #dcd5ff;border-radius:12px;box-shadow:0 12px 28px #1a125b24;max-height:260px;overflow-y:auto;}
.purchase-medicine-matches[hidden]{display:none;}
.purchase-medicine-option{display:block;width:100%;border:0;border-bottom:1px solid #eef0f5;padding:12px;text-align:left;background:#fff;font-weight:650;cursor:pointer;}
.purchase-medicine-option:hover,.purchase-medicine-option:focus{background:#f1edff;}
.purchase-medicine-empty{padding:12px;color:#667085;font-size:13px;}
@media(max-width:760px){.purchase-existing-search{max-width:100%;}.purchase-qty-stepper input[name="qty[]"]{font-size:18px;}.purchase-table-wrap{margin-right:-6px;}}


/* v2.7.2 Compact Purchase / Stock In: two-line item cards instead of a 1640px wide table.
   Scoped to purchase entry; all input names and posting logic are unchanged. */
#purchase-entry{padding:12px;}
#purchase-entry .section-head{gap:8px;margin-bottom:9px;}
#purchase-entry .section-head h3{font-size:17px;}
#purchase-entry .section-head p{margin:4px 0 0;}
#purchase-entry .section-head .chips{gap:5px;}
#purchase-entry .section-head .btn{font-size:12px;padding:7px 9px;}
#purchase-entry .row{gap:8px;}
#purchase-entry .row label{margin-bottom:3px;}
#purchase-entry .row input,#purchase-entry .row select{padding:7px 8px;min-height:34px;}
#purchase-entry .purchase-existing-search{max-width:none;margin:8px 0;padding:9px 11px;}
#purchase-entry .purchase-existing-search input{padding:8px 10px;min-height:34px;}
#purchase-entry .purchase-existing-search p{margin-top:4px;}
#purchase-entry .purchase-barcode-row{margin-top:8px;padding:9px 11px;}
#purchase-entry .purchase-barcode-row .pos-inline{max-width:none;}
#purchase-entry .purchase-table-wrap{overflow-x:visible;scrollbar-gutter:auto;margin-top:8px!important;}
#purchase-entry .purchase-entry-table{display:block;min-width:0;width:100%;border-collapse:separate;}
#purchase-entry .purchase-entry-table thead{display:none;}
#purchase-entry .purchase-entry-table tbody{display:block;}
#purchase-entry .purchase-entry-table tbody tr{
 display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:7px 9px;
 position:relative;min-width:0;padding:9px 41px 9px 10px;margin-bottom:8px;
 border:1px solid #e2e5ef;border-radius:11px;background:#fbfcff;align-items:start;
}
#purchase-entry .purchase-entry-table tbody tr:nth-child(even){background:#f7f9fe;}
#purchase-entry .purchase-entry-table td{display:block;min-width:0;width:auto;padding:0;border:0;white-space:normal;}
#purchase-entry .purchase-entry-table td::before{
 content:attr(data-label);display:block;color:#566176;font-size:10px;font-weight:750;
 line-height:1.2;margin-bottom:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
#purchase-entry .purchase-entry-table td:first-child{grid-column:span 2;}
#purchase-entry .purchase-entry-table td:last-child{position:absolute;right:7px;top:9px;}
#purchase-entry .purchase-entry-table td:last-child::before{display:none;}
#purchase-entry .purchase-entry-table td:last-child .btn{padding:6px 9px;font-size:16px;line-height:1.2;}
#purchase-entry .purchase-entry-table select,#purchase-entry .purchase-entry-table input{
 display:block;width:100%;min-width:0;max-width:none;min-height:33px;
 font-size:12px;padding:6px 7px;border-radius:7px;
}
#purchase-entry .purchase-entry-table .purchase-product{min-width:0;max-width:none;width:100%;}
#purchase-entry .purchase-entry-table .purchase-unit{min-width:0;width:100%;}
#purchase-entry .purchase-entry-table .purchase-qty-cell{min-width:0;width:auto;}
#purchase-entry .purchase-qty-stepper{min-width:0;gap:3px;width:100%;}
#purchase-entry .purchase-qty-stepper input[name="qty[]"]{
 min-width:40px;width:100%;max-width:none;flex:1 1 40px;min-height:34px;
 padding:5px 2px;font-size:15px;font-weight:800;
}
#purchase-entry .purchase-qty-btn{flex:0 0 25px;width:25px;height:34px;border-radius:7px;font-size:18px;}
#purchase-entry .purchase-entry-table .unit-cost-preview{min-width:0;line-height:1.25;font-size:11px;overflow-wrap:anywhere;padding:2px 0;}
#purchase-entry .row2{gap:8px;}
#purchase-entry .row2 input{padding:7px 8px;min-height:34px;}
@media(max-width:1200px){
 #purchase-entry .purchase-entry-table tbody tr{grid-template-columns:repeat(4,minmax(0,1fr));}
}
@media(max-width:760px){
 #purchase-entry{padding:10px;}
 #purchase-entry .purchase-entry-table tbody tr{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:10px 38px 10px 9px;}
 #purchase-entry .purchase-entry-table td:first-child,#purchase-entry .purchase-entry-table td:nth-child(11){grid-column:span 2;}
 #purchase-entry .purchase-entry-table input[type="date"]{font-size:12px;padding:5px 3px;}
 #purchase-entry .purchase-existing-search{margin:6px 0;}
 #purchase-entry .purchase-table-wrap{margin-right:0;}
 #purchase-entry .purchase-qty-stepper input[name="qty[]"]{font-size:17px;}
}
@media(max-width:390px){
 #purchase-entry .purchase-entry-table tbody tr{padding-right:34px;gap:6px;}
 #purchase-entry .purchase-qty-btn{flex-basis:23px;width:23px;}
 #purchase-entry .purchase-entry-table select,#purchase-entry .purchase-entry-table input{font-size:12px;}
}
@media print{#purchase-entry .purchase-entry-table tbody tr{break-inside:avoid;}}

/* v2.8: pharmacy-wide printer selection and laser/inkjet tax invoice. */
.printer-settings{margin-top:20px;padding:18px;border:1px solid #d9d3f3;background:#faf9ff;border-radius:13px}
.printer-settings h3{margin:0 0 7px;color:#2c195f}
.printer-settings p{margin:5px 0 12px;line-height:1.5}
.printer-settings [hidden]{display:none!important}
.printer-settings-link{color:#4d2db4;text-decoration:underline;text-underline-offset:2px}
.laser-invoice{width:210mm;max-width:100%;min-height:235mm;padding:12mm 12mm 10mm;background:#fff;color:#111827;box-shadow:0 4px 20px #10182826;font-family:Arial,Helvetica,sans-serif;font-size:13px;line-height:1.45;overflow-wrap:anywhere}
.laser-invoice[data-paper="A5"]{width:148mm;min-height:190mm;padding:8mm 7mm;font-size:10px}
.laser-header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;border-bottom:2px solid #211253;padding-bottom:12px}
.laser-brand{display:flex;gap:12px;align-items:flex-start;min-width:0}
.laser-logo{max-width:64px;max-height:64px;object-fit:contain}
.laser-brand h1{font-size:23px;margin:0 0 4px;color:#211253;line-height:1.15}
.laser-brand p{margin:2px 0;font-size:11px;line-height:1.35}
.laser-title{text-align:right;white-space:nowrap;flex-shrink:0}
.laser-title strong{display:block;font-size:18px;letter-spacing:.8px}
.laser-title span{font-size:10px;color:#667085}
.laser-invoice-meta{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding:12px 0;border-bottom:1px solid #d0d5dd}
.laser-invoice-meta>div{min-width:0;overflow-wrap:anywhere}
.laser-invoice-meta span,.laser-label{display:block;color:#667085;font-size:10px;text-transform:uppercase;letter-spacing:.3px}
.laser-invoice-meta strong{display:block;font-size:12px}
.laser-customer{display:flex;justify-content:space-between;gap:20px;padding:11px 0 13px}
.laser-customer>div{display:flex;flex-direction:column;gap:2px}
.laser-customer strong{font-size:13px}
.laser-items{width:100%;border-collapse:collapse;table-layout:fixed}
.laser-items th,.laser-items td{border:1px solid #d8dce6;padding:7px 5px;vertical-align:top;white-space:normal;overflow-wrap:anywhere;font-size:11px}
.laser-items thead th{background:#f0eff8;color:#211253;text-transform:uppercase;font-size:10px;letter-spacing:.2px}
.laser-items .laser-n{width:4%;text-align:center}
.laser-items .laser-medicine{width:28%;text-align:left;font-weight:650}
.laser-items .laser-right{text-align:right;white-space:normal}
.laser-items tr{break-inside:avoid;page-break-inside:avoid}
.laser-items thead{display:table-header-group}
.laser-invoice[data-layout="compact"] .laser-detail-only{display:none}
.laser-invoice[data-layout="compact"] .laser-items .laser-medicine{width:42%}
.laser-invoice[data-layout="compact"] .laser-items th,.laser-invoice[data-layout="compact"] .laser-items td{padding:5px 4px}
.laser-invoice[data-paper="A5"] .laser-header{gap:8px}
.laser-invoice[data-paper="A5"] .laser-brand h1{font-size:16px}
.laser-invoice[data-paper="A5"] .laser-logo{max-width:42px;max-height:42px}
.laser-invoice[data-paper="A5"] .laser-title strong{font-size:12px}
.laser-invoice[data-paper="A5"] .laser-invoice-meta{grid-template-columns:repeat(2,minmax(0,1fr))}
.laser-invoice[data-paper="A5"] .laser-items th,.laser-invoice[data-paper="A5"] .laser-items td{font-size:8px;padding:4px 3px}
.laser-bottom{display:flex;justify-content:space-between;gap:18px;margin-top:14px}
.laser-bottom-notes{flex:1;font-size:12px;color:#344054}
.laser-bottom-notes b{color:#101828}
.laser-notes{margin-top:10px;max-width:260px}
.laser-totals{width:245px;max-width:58%;border-collapse:collapse;font-size:12px}
.laser-totals td,.laser-totals th{padding:5px 4px;border-bottom:1px solid #e4e7ec}
.laser-totals td:last-child,.laser-totals th:last-child{text-align:right;white-space:nowrap}
.laser-grand{background:#f0eff8;font-size:14px;color:#211253}
.laser-footer{display:flex;justify-content:space-between;align-items:end;gap:20px;margin-top:45px;padding-top:9px;border-top:1px solid #d0d5dd;font-size:11px}
.laser-signature{font-weight:700;border-top:1px solid #667085;padding-top:6px;min-width:120px;text-align:center}
.laser-powered{text-align:center;font-size:10px;color:#667085;margin-top:18px}
@media(max-width:800px){.laser-invoice{width:100%;min-height:0;padding:14px 10px}.laser-header{flex-wrap:wrap}.laser-title{text-align:left}.laser-items th,.laser-items td{font-size:8px;padding:4px 2px}.laser-invoice-meta{grid-template-columns:repeat(2,minmax(0,1fr))}.laser-bottom{gap:8px}.laser-totals{max-width:62%}}
@media print{
 body.invoice-print-laser{background:#fff!important;color:#000!important;margin:0!important;padding:0!important}
 body.invoice-print-laser *{visibility:hidden!important}
 body.invoice-print-laser .laser-invoice,body.invoice-print-laser .laser-invoice *{visibility:visible!important}
 body.invoice-print-laser .side,body.invoice-print-laser .top,body.invoice-print-laser .app-menu-shade,body.invoice-print-laser .thermal-controls,body.invoice-print-laser .alert{display:none!important}
 body.invoice-print-laser .main>*:not(.thermal-layout){display:none!important}
 body.invoice-print-laser .thermal-layout{display:block!important;margin:0!important;padding:0!important}
 body.invoice-print-laser .main{margin:0!important;padding:0!important;min-height:0!important}
 body.invoice-print-laser .shell{display:block!important;margin:0!important;padding:0!important}
 body.invoice-print-laser .laser-invoice{display:block!important;position:static!important;visibility:visible!important;width:100%!important;min-width:0!important;max-width:100%!important;min-height:0!important;margin:0!important;padding:0!important;box-shadow:none!important;border:0!important;background:#fff!important;color:#000!important;overflow:visible!important}
 body.invoice-print-laser .laser-invoice .laser-items th{background:#efefef!important;color:#000!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
 body.invoice-print-laser .laser-invoice .laser-grand{background:#eee!important;color:#000!important}
 body.invoice-print-laser .laser-invoice .laser-header{border-color:#111!important}
 body.invoice-print-laser .laser-invoice .laser-items tr{break-inside:avoid}
 body.invoice-print-laser .laser-invoice .laser-items thead{display:table-header-group}
 body.invoice-print-laser .laser-invoice .laser-footer{break-inside:avoid}
}

/* v2.8.1: compact optional walk-in patient name under the customer selector. */
.pos-checkout .pos-patient-label{margin:7px 0 4px;font-size:12px;}
.pos-checkout input[name="patient_name"]{min-width:0;}
[data-patient-name-label][hidden],input[name="patient_name"][hidden]{display:none!important;}
