:root{--blue:#1554c0;--blue-d:#0d3b8c;--blue-l:#e8f0fd;--ink:#13203a;--mut:#5b6b85;--line:#dbe3ef;--bg:#f5f8fc;--ok:#13804a;--warn:#b45309;--bad:#c0262d;--r:10px;font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Noto Sans Devanagari",sans-serif}
:root{--evital-blue:#244f96;--evital-action:#4b9ed8;--evital-due:#ca5866;--evital-payment:#5aa5d9;--evital-settled:#4b9ed8}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.payment-due,.payment-credit{color:var(--evital-due)!important}.payment-due-tag{display:inline-block;border-radius:1px;background:var(--evital-due);color:#fff;padding:3px 7px;font-size:11px}.payment-mode-tag{color:#8d969f;font-size:12px}.payment-mode-tag:before{content:'▰';color:var(--evital-payment);margin-right:5px}.payment-upi:before{content:'◩';color:#86a66c}.payment-settled{color:var(--evital-settled)}
.bill-payment .payment-popover-total{margin:-16px -16px 0;padding:9px 14px;background:var(--evital-blue);color:#fff;font-weight:600}.bill-payment table th{font-size:12px;background:white;color:#222;text-transform:none;letter-spacing:0}.bill-payment table td{font-size:12px;border:0;padding:8px 4px}.bill-payment #paymentRecordOpen{width:100%;padding:7px;border:0;border-radius:2px;background:var(--evital-action);color:#fff;margin-top:8px}.bill-earned{background:#ffffff0d;padding:4px 9px;border-radius:1px;font-weight:600}
.record-payment-form{width:min(930px,100%);min-height:min(680px,90vh);max-height:92vh;overflow:auto;background:white;color:#263c60;box-shadow:0 8px 30px #10285440;border-radius:0;font-size:14px}.record-payment-form>header{display:flex;align-items:center;gap:20px;background:var(--evital-blue);color:white;padding:16px 20px}.record-payment-form h2{font-size:21px;font-weight:500;flex:1;margin:0}.record-payment-form header .btn{background:var(--evital-action);border-radius:2px;padding:7px 16px;font-size:14px;font-weight:400}.record-close{background:transparent;border:0;color:white;font-size:25px;padding:0 0 0 3px}.record-payment-body{padding:20px}.record-row{display:grid;grid-template-columns:1fr 1fr 1fr 44px;gap:18px;margin-bottom:20px;align-items:end}.record-row label{color:#315688;font-size:12px;display:flex;flex-direction:column;gap:2px}.record-row input,.record-row select{height:32px;width:100%;border:0;border-bottom:1px solid #a7acb5;border-radius:0;box-shadow:none;color:#222;padding:3px 0;font-size:14px;background:#fff}.record-row button{height:30px;border:0;border-radius:1px;background:var(--evital-action);color:white;font-size:21px}.record-row button.record-remove{background:var(--evital-due);font-size:15px}.record-remark{display:block;padding-top:10px}.record-remark textarea{width:100%;height:80px;border:0;border-bottom:1px solid #999;border-radius:0;resize:vertical;padding:10px 0;font-size:14px;color:#222}.record-tab{display:inline-block;margin-top:24px;color:var(--evital-action);border-bottom:2px solid var(--evital-action);padding:12px 24px;font-size:14px}.record-payment-form table{border-top:1px solid #dce1e8;font-size:13px}.record-payment-form th{font-size:13px;text-transform:none;letter-spacing:0;background:white;color:#9399a0;font-weight:400;white-space:nowrap;padding:12px 0;border-bottom:1px solid #96a9ba}.record-payment-form td{font-size:13px;padding:12px 0;border-bottom:1px solid #c3cdd8}.record-error{color:var(--evital-due);font-size:13px}
@media(max-width:680px){.record-payment-form>header{padding:12px;gap:8px}.record-payment-form h2{font-size:16px}.record-payment-form header .btn{font-size:12px;padding:7px 9px}.record-payment-body{padding:12px;overflow-x:auto}.record-row{grid-template-columns:1fr 1fr;gap:12px}.record-row>button{width:44px;justify-self:end}.record-payment-form table{min-width:620px}}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-size:15px}
a{color:var(--blue)}button{font:inherit;cursor:pointer}
input,select,textarea{font:inherit;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);min-width:0}
input:focus,select:focus{outline:2px solid var(--blue);outline-offset:0;border-color:var(--blue)}
.btn{background:var(--blue);color:#fff;border:0;border-radius:8px;padding:9px 16px;font-weight:600}
.btn:hover{background:var(--blue-d)}.btn.ghost{background:#fff;color:var(--blue);border:1px solid var(--line)}.btn.red{background:var(--bad)}
.btn:disabled{opacity:.5;cursor:default}
header.top{background:var(--blue);color:#fff;display:flex;align-items:center;gap:6px;padding:0 16px;height:54px;position:sticky;top:0;z-index:5}
header.top .brand{display:flex;align-items:center;gap:8px;font-weight:700;font-size:17px;margin-right:14px;white-space:nowrap}
header.top .brand img{width:30px;height:30px;border-radius:50%;background:#fff;object-fit:cover}
header.top nav{display:flex;gap:2px;overflow-x:auto;flex:1}
header.top nav a{color:#dbe6fb;text-decoration:none;padding:8px 12px;border-radius:8px;white-space:nowrap;font-weight:500}
header.top nav a.on,header.top nav a:hover{background:rgba(255,255,255,.16);color:#fff}
header.top .who{font-size:13px;white-space:nowrap;display:flex;gap:8px;align-items:center}
header.top .who button{background:transparent;border:1px solid rgba(255,255,255,.5);color:#fff;border-radius:6px;padding:4px 10px}
main{padding:18px;max-width:1280px;margin:0 auto}
h1{font-size:21px;margin:0 0 14px}h2{font-size:16px;margin:0 0 10px}
.card{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:16px}
.grid{display:grid;gap:14px}.g4{grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}.g2{grid-template-columns:repeat(auto-fit,minmax(340px,1fr))}
.stat .k{color:var(--mut);font-size:13px}.stat .v{font-size:24px;font-weight:700;margin-top:4px}.stat .s{color:var(--mut);font-size:12px;margin-top:2px}
table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:8px 8px;border-bottom:1px solid var(--line);vertical-align:middle}
th{font-size:12px;color:var(--mut);font-weight:600;text-transform:uppercase;letter-spacing:.03em;background:#fafcff}
td.n,th.n{text-align:right;font-variant-numeric:tabular-nums}
tr.click{cursor:pointer}tr.click:hover td{background:var(--blue-l)}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.sp{flex:1}
.pill{display:inline-block;padding:2px 8px;border-radius:99px;font-size:12px;font-weight:600;background:var(--blue-l);color:var(--blue-d)}
.pill.warn{background:#fff3e0;color:var(--warn)}.pill.bad{background:#fde8e8;color:var(--bad)}.pill.ok{background:#e5f5ec;color:var(--ok)}
.mut{color:var(--mut)}.small{font-size:12px}
.sugg{position:absolute;left:0;right:0;top:100%;background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 24px rgba(20,40,80,.12);max-height:380px;overflow:auto;z-index:10}
.sugg div{padding:8px 12px;display:flex;gap:10px;align-items:center;cursor:pointer;border-bottom:1px solid #f0f3f8}
.sugg div.on,.sugg div:hover{background:var(--blue-l)}
.sugg img,.thumb{width:36px;height:36px;object-fit:contain;border-radius:6px;background:#f2f5fa;flex:none}
.login{min-height:100vh;display:grid;place-items:center;background:linear-gradient(160deg,#e8f0fd,#fff 60%)}
.login .card{width:min(380px,92vw);padding:28px}.login img{width:64px;height:64px;border-radius:50%;display:block;margin:0 auto 10px}
.login h1{text-align:center}.login label{display:block;font-size:13px;color:var(--mut);margin:12px 0 4px}.login input{width:100%}
.bill-total{font-size:26px;font-weight:800;color:var(--blue-d)}
#toast{position:fixed;bottom:18px;left:50%;transform:translateX(-50%);background:var(--ink);color:#fff;padding:10px 16px;border-radius:8px;opacity:0;transition:.2s;pointer-events:none;z-index:50;max-width:90vw}
#toast.show{opacity:1}#toast.err{background:var(--bad)}
.modal{position:fixed;inset:0;background:rgba(10,25,50,.45);display:grid;place-items:center;z-index:30;padding:16px}
.modal .card{width:min(760px,100%);max-height:90vh;overflow:auto}
.kbd{font-size:11px;border:1px solid var(--line);border-radius:4px;padding:1px 5px;color:var(--mut);background:#fff}
.bar{display:flex;align-items:flex-end;gap:6px;height:120px}.bar div{flex:1;background:var(--blue);border-radius:4px 4px 0 0;min-height:2px;position:relative}
.bar div span{position:absolute;bottom:-18px;left:50%;transform:translateX(-50%);font-size:10px;color:var(--mut)}
@media print{header.top,.noprint{display:none!important}main{padding:0}.card{border:0}body{background:#fff}}
@media (max-width:640px){main{padding:12px}header.top .who span{display:none}}
.billgrid{grid-template-columns:minmax(0,1fr) 320px;align-items:start}.prodgrid{grid-template-columns:minmax(0,1fr) 260px;align-items:start}
@media (max-width:900px){.billgrid,.prodgrid{grid-template-columns:1fr}}
/* v2 layout */
main.wide{max-width:none}
header.top{gap:4px}header.top .brand{color:#fff;text-decoration:none}
header.top nav{overflow:visible;align-items:center}
.mlink,.mbtn{color:#dbe6fb;text-decoration:none;padding:8px 12px;border-radius:8px;white-space:nowrap;font-weight:500;background:none;border:0;font-size:15px}
.mlink.on,.mlink:hover,.menu.on .mbtn,.mbtn:hover,.menu.open .mbtn{background:rgba(255,255,255,.16);color:#fff}
.menu{position:relative}.drop{display:none;position:absolute;top:calc(100% + 6px);left:0;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 10px 30px rgba(15,35,80,.18);min-width:210px;padding:6px;z-index:20}
.menu.open .drop{display:block}.drop a{display:flex;justify-content:space-between;align-items:center;padding:9px 12px;border-radius:7px;color:var(--ink);text-decoration:none}.drop a:hover{background:var(--blue-l);color:var(--blue-d)}
.btn.newbill{background:#fff;color:var(--blue);text-decoration:none;margin-right:6px;white-space:nowrap}.btn.newbill:hover{background:var(--blue-l)}
a.btn{text-decoration:none;display:inline-block}
.chips{display:flex;gap:8px;flex-wrap:wrap;margin:6px 0 10px}
.chip{display:inline-flex;gap:8px;align-items:center;padding:6px 12px;border-radius:99px;background:#fff;border:1px solid var(--line);color:var(--ink);text-decoration:none;font-size:13px}
.chip b{background:var(--blue-l);color:var(--blue-d);border-radius:99px;padding:1px 8px}.chip.warn b{background:#fff3e0;color:var(--warn)}.chip.bad b{background:#fde8e8;color:var(--bad)}.chip:hover{border-color:var(--blue)}
.stat.blue{background:var(--blue);color:#fff;border-color:var(--blue)}.stat.blue .k,.stat.blue .s{color:#dbe6fb}
.billtop{display:flex;gap:0;padding:0;flex-wrap:wrap;overflow:visible}
.billtop .bt{padding:10px 14px;border-right:1px solid var(--line);display:flex;flex-direction:column;gap:4px;min-width:150px}.billtop .bt:last-child{border-right:0}
.billtop .bt.grow{flex:1;min-width:260px}.billtop .lbl{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--mut);font-weight:600}
.billtop input,.billtop select{width:100%}
.searchrow{display:flex;gap:12px;align-items:center;padding:12px;border-bottom:1px solid var(--line);background:#fafcff;border-radius:10px 10px 0 0}
.searchrow>div,.searchrow>input{flex:1}.searchrow input#q{width:100%;font-size:16px;padding:10px 12px}
table.lines td{padding:6px 8px}table.lines select{max-width:170px}
input.num{width:78px;text-align:right}input.num.sm{width:62px}input.num.err{border-color:var(--bad);background:#fff5f5}
button.x{background:none;border:0;color:var(--mut);font-size:15px;padding:4px 8px;border-radius:6px}button.x:hover{background:#fde8e8;color:var(--bad)}
.billfoot{position:sticky;bottom:0;margin-top:10px;background:var(--blue-d);color:#fff;border-radius:10px;padding:10px 14px;display:flex;gap:18px;align-items:center;flex-wrap:wrap;z-index:4}
.billfoot b{font-variant-numeric:tabular-nums}.billfoot .net{font-size:15px}.billfoot .net b{font-size:24px;margin-left:6px}
.billfoot .btn{background:#fff;color:var(--blue-d)}.billfoot .btn.ghost{background:transparent;color:#fff;border-color:rgba(255,255,255,.5)}.billfoot .kbd{background:transparent;color:inherit;border-color:currentColor}
.filters{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:6px}
.seg{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden}.seg button{background:#fff;border:0;border-right:1px solid var(--line);padding:7px 10px;font-size:13px}.seg button:last-child{border-right:0}.seg button.on,.seg button:hover{background:var(--blue-l);color:var(--blue-d)}
.invgrid{display:grid;grid-template-columns:240px minmax(0,1fr);gap:12px;align-items:start}
.side{display:flex;flex-direction:column;gap:6px;position:sticky;top:66px}.side select,.side input:not([type=checkbox]){width:100%}
.tabs{display:flex;gap:2px}.tabs button{background:#eef3fb;border:1px solid var(--line);border-bottom:0;padding:8px 16px;border-radius:8px 8px 0 0;color:var(--mut);font-weight:600}.tabs button.on{background:#fff;color:var(--blue-d)}
.pimg{width:110px;height:110px;object-fit:contain;background:#f2f5fa;border-radius:10px;flex:none}
.kpis{display:flex;gap:10px}.kpis div{border:1px solid var(--line);border-radius:10px;padding:10px 14px;display:flex;flex-direction:column;min-width:110px}.kpis b{font-size:18px}
.invoice{max-width:860px}
@media (max-width:900px){.invgrid{grid-template-columns:1fr}.side{position:static}.kpis{flex-wrap:wrap}header.top{flex-wrap:wrap;height:auto;padding:8px 12px}header.top nav{order:3;width:100%;overflow-x:auto}}
@media print{.billfoot,.chips{display:none!important}}
.obadge{background:#ffb020;color:#2b1a00;font-weight:700;border-radius:99px;padding:5px 12px;text-decoration:none;font-size:13px;white-space:nowrap;margin-right:6px;animation:pulse 2s infinite}
@keyframes pulse{50%{opacity:.75}}
textarea{font:inherit;padding:8px 10px;border:1px solid var(--line);border-radius:8px;width:100%}
/* phase 3: profit/loss colours, charts, split payment, thermal print */
.pos{color:var(--ok);font-weight:600}.neg{color:var(--bad);font-weight:600}.warnc{color:var(--warn);font-weight:600}
.stat.profitc{border-left:4px solid var(--ok)}.stat.lossc{border-left:4px solid var(--bad)}
.stat.profitc .v .neg,.stat.lossc .v{color:var(--bad)}.stat.profitc .v{color:var(--ok)}
svg.chart{width:100%;height:auto;display:block}svg .ax{font-size:10.5px;fill:var(--mut)}svg .dv{font-size:15px;font-weight:700;fill:var(--ink)}
.legend{display:flex;gap:14px;flex-wrap:wrap;font-size:12px;color:var(--mut);margin-top:6px}.legend.col{flex-direction:column;gap:6px}
.legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:6px;vertical-align:-1px}.legend b{color:var(--ink);margin-left:4px}
.donut{display:flex;gap:14px;align-items:center;flex-wrap:wrap}.donut svg{width:160px;height:160px;flex:none}
.hbars{display:flex;flex-direction:column;gap:6px}.hb{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) 76px 44px;gap:8px;align-items:center;font-size:13px;padding:2px 4px;border-radius:6px}
.hb:hover{background:var(--blue-l)}.hn{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.track{height:10px;background:#eef3fb;border-radius:99px;overflow:hidden}.track span{display:block;height:100%;background:var(--blue);border-radius:99px}
.hv{text-align:right;font-variant-numeric:tabular-nums}.hm{text-align:right;font-size:12px}
.splitbox{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:6px;font-size:12px}.splitbox label{display:flex;flex-direction:column;gap:2px;color:var(--mut)}.splitbox input{width:100%}.splitbox div{grid-column:1/-1}
@media (max-width:900px){#agrid{grid-template-columns:1fr!important}}
@media print{body.thermal main{padding:0}body.thermal .invoice{width:72mm;max-width:72mm;padding:0;font-size:11px}body.thermal .invoice h1{font-size:15px}body.thermal .invoice table{font-size:10px}body.thermal .invoice th,body.thermal .invoice td{padding:2px}body.thermal .invoice img{display:none}@page{margin:4mm}}
.bigneg{font-size:22px;font-weight:700;color:var(--bad);margin:2px 0 8px}.bigwarn{font-size:22px;font-weight:700;color:var(--warn);margin:2px 0 8px}
.rlink{display:block;padding:7px 0;border-bottom:1px solid #f0f3f8;text-decoration:none}.rlink:hover{color:var(--blue-d)}
details.card summary{cursor:pointer;font-weight:600}
.labelsheet{display:none}
@media print{body.printlabels #app>header,body.printlabels main>*:not(#sheet){display:none!important}body.printlabels .labelsheet{display:flex!important;flex-wrap:wrap;gap:0}
 .lab{box-sizing:border-box;padding:1.2mm 1.5mm;border:0.2mm dashed #bbb;overflow:hidden;font:7pt system-ui;color:#000;page-break-inside:avoid;display:flex;flex-direction:column;justify-content:space-between}
 .lab b{font-size:7.5pt;line-height:1.1}.lab .lr{display:flex;justify-content:space-between;font-size:6pt}.lab .lm{font-weight:700;font-size:8pt}@page{margin:3mm}}
.selc{width:28px}
.btn.sm{padding:3px 8px;font-size:13px;min-height:0}

/* ================= v3: sidebar layout & refreshed design system ================= */
:root{--blue:#1a56c4;--blue-d:#123f93;--blue-l:#eaf1fd;--blue-m:#c9dbfa;--ink:#101a2e;--ink-2:#334160;--mut:#64728c;--line:#e3e8f0;--line-2:#eef2f7;--bg:#f4f6fa;--card:#fff;
  --ok:#11804a;--ok-l:#e6f5ed;--warn:#b25a05;--warn-l:#fff3e2;--bad:#c42b33;--bad-l:#fdecec;--r:12px;--sh:0 1px 2px rgba(16,26,46,.05),0 1px 1px rgba(16,26,46,.03);--sh-2:0 12px 32px rgba(16,26,46,.14);--sbw:244px}
body{font-size:14.5px;line-height:1.45;-webkit-font-smoothing:antialiased;background:var(--bg)}
.ic{width:18px;height:18px;flex:none}
/* layout */
.layout{display:grid;grid-template-columns:var(--sbw) minmax(0,1fr);min-height:100vh}
.sidebar{position:sticky;top:0;height:100vh;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;z-index:20}
.sidebar .brand{display:flex;align-items:center;gap:10px;padding:16px 16px 14px;text-decoration:none;color:var(--ink);border-bottom:1px solid var(--line-2)}
.sidebar .brand img{width:34px;height:34px;border-radius:10px;object-fit:cover;background:var(--blue-l)}
.sidebar .brand b{display:block;font-size:15.5px;letter-spacing:-.01em}.sidebar .brand small{display:block;color:var(--mut);font-size:11.5px}
.snav{flex:1;overflow-y:auto;padding:10px 10px 16px;display:flex;flex-direction:column;gap:2px;scrollbar-width:thin}
.nv{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border-radius:9px;color:var(--ink-2);text-decoration:none;font-weight:500;background:none;border:0;text-align:left;font-size:14px}
.nv:hover{background:var(--line-2);color:var(--ink)}.nv.on{background:var(--blue-l);color:var(--blue-d);font-weight:600}
.nv .ic{color:var(--mut)}.nv.on .ic,.ng.cur>.nh .ic{color:var(--blue)}
.ng.cur>.nh{color:var(--ink);font-weight:600}
.nh .cv{margin-left:auto;width:14px;height:14px;transition:transform .15s}.ng.open .cv{transform:rotate(90deg)}
.nsub{display:none;flex-direction:column;margin:2px 0 6px 19px;padding-left:12px;border-left:1px solid var(--line)}.ng.open .nsub{display:flex}
.nsub a{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 10px;border-radius:7px;color:var(--ink-2);text-decoration:none;font-size:13.5px}
.nsub a:hover{background:var(--line-2);color:var(--ink)}.nsub a.on{background:var(--blue-l);color:var(--blue-d);font-weight:600}
.sfoot{display:flex;align-items:center;gap:10px;padding:12px 14px;border-top:1px solid var(--line-2)}
.sfoot .av{width:32px;height:32px;border-radius:50%;background:var(--blue);color:#fff;display:grid;place-items:center;font-weight:700;font-size:12.5px;flex:none}
.sfoot b{display:block;font-size:13.5px;line-height:1.2}.sfoot small{color:var(--mut);font-size:11.5px}
.iconbtn{background:none;border:0;border-radius:8px;padding:7px;color:var(--mut);display:inline-grid;place-items:center}.iconbtn:hover{background:var(--line-2);color:var(--ink)}
.mainwrap{min-width:0;display:flex;flex-direction:column}
.topbar{position:sticky;top:0;z-index:15;display:flex;align-items:center;gap:10px;padding:10px 22px;background:rgba(244,246,250,.86);backdrop-filter:saturate(1.4) blur(8px);border-bottom:1px solid var(--line)}
.crumb{font-weight:600;color:var(--mut);font-size:13px;min-width:70px}
.gsearch{flex:1;max-width:560px;display:flex;align-items:center;gap:10px;background:#fff;border:1px solid var(--line);border-radius:10px;padding:8px 12px;color:var(--mut);text-align:left;box-shadow:var(--sh)}
.gsearch:hover{border-color:var(--blue-m)}.gsearch span:not(.kbd){flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.topbar .btn.newbill{margin-left:auto;display:inline-flex;align-items:center;gap:6px;background:var(--blue);color:#fff;border:0;margin-right:0}.topbar .btn.newbill:hover{background:var(--blue-d)}
.topbar .btn.newbill .kbd{background:rgba(255,255,255,.16);color:#fff;border-color:rgba(255,255,255,.35)}
.topbar .obadge{margin-left:auto;margin-right:0}.topbar .obadge:not([hidden])+.btn.newbill{margin-left:0}
main{padding:20px 22px 32px;max-width:1360px;width:100%;margin:0 auto}main.wide{max-width:none}
.only-m{display:none}.scrim{display:none}
/* type & cards */
h1{font-size:22px;letter-spacing:-.015em;margin:0 0 14px}h2{font-size:15.5px;letter-spacing:-.005em}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--sh)}
.stat{position:relative}.stat .k{font-size:12.5px;font-weight:500}.stat .v{font-size:25px;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.stat.blue{background:linear-gradient(135deg,var(--blue),var(--blue-d));border-color:transparent;box-shadow:0 6px 18px rgba(26,86,196,.25)}
/* buttons & inputs */
.btn{border-radius:9px;padding:8px 15px;font-weight:600;font-size:14px;display:inline-flex;align-items:center;gap:6px;justify-content:center;transition:background .12s,border-color .12s,box-shadow .12s}
.btn.ghost{background:#fff;color:var(--ink-2);border:1px solid var(--line);box-shadow:var(--sh)}.btn.ghost:hover{border-color:var(--blue-m);color:var(--blue-d);background:#fff}
.btn:focus-visible,.iconbtn:focus-visible,.nv:focus-visible,.gsearch:focus-visible,a:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
input,select,textarea{border-radius:9px;border-color:var(--line);padding:8px 11px}
input:hover,select:hover{border-color:#cfd8e6}input:focus,select:focus,textarea:focus{outline:3px solid rgba(26,86,196,.18);border-color:var(--blue)}
.kbd{border-radius:5px;font-weight:600;font-family:inherit}
/* tables */
table{font-size:14px}th{background:#f8fafd;color:var(--mut);font-size:11.5px;letter-spacing:.04em;position:sticky;top:0;z-index:1}
th,td{padding:9px 10px;border-bottom:1px solid var(--line-2)}tr:last-child td{border-bottom:0}
tr.click:hover td{background:#f3f7fe}th.click{cursor:pointer;user-select:none}th.click:hover{color:var(--blue-d)}
.pill{border-radius:99px;font-weight:600;font-size:11.5px;padding:2px 9px}.pill.ok{background:var(--ok-l)}.pill.warn{background:var(--warn-l)}.pill.bad{background:var(--bad-l)}
.seg{border-radius:9px;background:#fff;box-shadow:var(--sh)}.seg button,.seg a{color:var(--ink-2);text-decoration:none}.seg button.on,.seg a.on{background:var(--blue-l);color:var(--blue-d);font-weight:600}
.chip{box-shadow:var(--sh);font-weight:500}.chips{margin:0 0 14px}
.filters{gap:8px}
.drop{border-radius:12px}
/* loading skeleton */
.skel{display:grid;gap:14px}.skel div{height:88px;border-radius:var(--r);background:linear-gradient(90deg,#eceff5 25%,#f5f7fb 50%,#eceff5 75%);background-size:200% 100%;animation:sk 1.2s infinite}.skel div:first-child{height:34px;width:40%}
@keyframes sk{to{background-position:-200% 0}}
/* billing */
.billfoot{background:linear-gradient(135deg,var(--blue-d),#0c2f70);border-radius:12px;box-shadow:0 -6px 22px rgba(16,26,46,.12)}
.searchrow{background:#f8fafd;border-radius:12px 12px 0 0}.searchrow input#q{border-width:1.5px}
.billtop .lbl{font-size:10.5px}
/* global search */
.gsmodal{align-items:start;padding-top:9vh;background:rgba(16,26,46,.38)}
.gsbox{width:min(640px,100%);padding:0;overflow:hidden;box-shadow:var(--sh-2)}
.gsin{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--line)}.gsin .ic{color:var(--mut)}
.gsin input{flex:1;border:0;font-size:16px;padding:6px 2px;outline:0!important}
.gsr{max-height:60vh;overflow:auto;padding:6px}
.gsh{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--mut);font-weight:700;padding:10px 10px 4px}
.gsr a{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:9px;color:var(--ink);text-decoration:none}
.gsr a small{display:block;color:var(--mut);font-size:12px}.gsr a.on,.gsr a:hover{background:var(--blue-l)}
/* login */
.login{background:radial-gradient(1200px 600px at 10% -10%,#dfe9fc,transparent),radial-gradient(900px 500px at 110% 110%,#e3f3ea,transparent),var(--bg)}
.login .card{box-shadow:var(--sh-2);border-radius:16px}
/* responsive */
@media (max-width:1100px){:root{--sbw:220px}}
@media (max-width:900px){
  .layout{grid-template-columns:1fr}
  .sidebar{position:fixed;left:0;top:0;bottom:0;width:272px;transform:translateX(-102%);transition:transform .2s;box-shadow:var(--sh-2)}
  .sidebar.show{transform:none}
  .scrim{position:fixed;inset:0;background:rgba(16,26,46,.38);z-index:19}.scrim.show{display:block}
  .only-m{display:inline-grid}.crumb{display:none}
  .topbar{padding:8px 12px;gap:8px}.gsearch span:not(.kbd){font-size:13px}.gsearch .kbd{display:none}
  .topbar .btn.newbill .kbd,.topbar .btn.newbill span:not(.kbd){display:none}.topbar .btn.newbill{padding:8px 10px}
  main{padding:14px 12px 28px}
}
@media print{.sidebar,.topbar,.scrim{display:none!important}.layout{display:block}main{padding:0;max-width:none}.card{box-shadow:none}
  body.printlabels .layout .sidebar,body.printlabels .topbar{display:none!important}}
/* v3 billing polish */
.billtop{display:grid;grid-template-columns:118px minmax(240px,1.6fr) minmax(150px,1fr) 150px 160px 120px 180px;padding:0}
.billtop .bt{min-width:0;padding:10px 12px}
@media (max-width:1380px){.billtop{grid-template-columns:118px minmax(220px,2fr) minmax(150px,1fr) 150px 160px}.billtop .bt:nth-child(5){border-right:0}.billtop .bt:nth-child(n+6){border-top:1px solid var(--line-2)}}
@media (max-width:900px){.billtop{grid-template-columns:1fr 1fr}.billtop .bt.grow{grid-column:1/-1}.billtop .bt{border-right:0;border-top:1px solid var(--line-2)}}
.billfoot{gap:14px;padding:10px 14px}.billfoot>span:not(.sp):not(.net){font-size:13px;opacity:.92}
.billfoot .btn.ghost{padding:6px 11px;font-size:13px;box-shadow:none}.billfoot .btn#save{padding:9px 18px;font-size:15px}
@media (min-width:1280px){.billfoot{flex-wrap:nowrap}}
.billfoot .btn,.billfoot>span{white-space:nowrap}
.g3{grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}
.card svg.chart{max-height:300px;margin:0 auto}
/* v3.1: menu on top (desktop); the side drawer is kept for phones */
.layout.top{display:block}
.layout.top .sidebar{display:none}
.tbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:6px;height:58px;padding:0 18px;background:#fff;border-bottom:1px solid var(--line);box-shadow:0 1px 2px rgba(16,26,46,.04)}
.tbrand{display:flex;align-items:center;gap:9px;text-decoration:none;color:var(--ink);margin-right:10px;white-space:nowrap}.tbrand img{width:32px;height:32px;border-radius:9px;object-fit:cover;background:var(--blue-l)}.tbrand b{font-size:15.5px;letter-spacing:-.01em}
.tnav{display:flex;align-items:center;gap:2px;min-width:0}
.tl{display:inline-flex;align-items:center;gap:7px;padding:8px 10px;border-radius:9px;border:0;background:none;color:var(--ink-2);text-decoration:none;font-weight:500;font-size:14px;white-space:nowrap;position:relative}
.tl .ic{width:17px;height:17px;color:var(--mut)}.tl .dn{width:14px;height:14px;margin-left:-2px}
.tl:hover,.tm.open>.tl{background:var(--line-2);color:var(--ink)}
.tl.on,.tm.on>.tl{color:var(--blue-d);font-weight:600}.tl.on .ic,.tm.on>.tl .ic{color:var(--blue)}
.tl.on::after,.tm.on>.tl::after{content:"";position:absolute;left:10px;right:10px;bottom:-11px;height:2.5px;border-radius:2px;background:var(--blue)}
.tm{position:relative}
.tdrop{display:none;position:absolute;top:calc(100% + 8px);left:0;min-width:220px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:var(--sh-2);padding:6px;z-index:30}
.tdrop.right{left:auto;right:0}.tm.open .tdrop{display:block}
.tdrop a{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 11px;border-radius:8px;color:var(--ink-2);text-decoration:none;font-size:14px;white-space:nowrap}
.tdrop a:hover{background:var(--blue-l);color:var(--blue-d)}.tdrop a.on{background:var(--blue-l);color:var(--blue-d);font-weight:600}
.tdrop a .ic{width:16px;height:16px}
.tuinfo{padding:8px 11px 10px;border-bottom:1px solid var(--line-2);margin-bottom:4px}.tuinfo b{display:block}.tuinfo small{color:var(--mut)}
.tbar .gsearch{flex:0 1 230px;max-width:260px;margin-left:auto;padding:7px 11px;box-shadow:none;background:var(--bg)}
.tbar .btn.newbill{margin-left:6px;display:inline-flex;align-items:center;gap:6px;background:var(--blue);color:#fff;border:0;white-space:nowrap}.tbar .btn.newbill:hover{background:var(--blue-d)}
.tbar .btn.newbill .kbd{background:rgba(255,255,255,.16);color:#fff;border-color:rgba(255,255,255,.35)}
.tbar .obadge{margin:0 0 0 6px}
.avbtn{border:0;background:none;padding:3px;border-radius:50%;margin-left:4px}.avbtn .av{width:34px;height:34px;border-radius:50%;background:var(--blue);color:#fff;display:grid;place-items:center;font-weight:700;font-size:12.5px}
.avbtn:hover .av,.tuser.open .av{box-shadow:0 0 0 3px var(--blue-m)}
.layout.top main{padding:20px 22px 32px}
@media (max-width:1380px){.tl .ic:not(.dn){display:none}.tl{padding:8px 9px;gap:4px}}
@media (max-width:1180px){.tl{font-size:13.5px;padding:8px 7px}.tbrand b{display:none}}
@media (max-width:1100px){.tbar .gsearch span:not(.kbd),.tbar .gsearch .kbd{display:none}.tbar .gsearch{flex:none}.tbar .btn.newbill .kbd{display:none}}
@media (max-width:900px){
  .tnav,.tbrand b{display:none}.tbar{padding:0 10px;height:54px}.tbar .gsearch{flex:1;max-width:none;margin-left:0}.tbar .gsearch span:not(.kbd){display:inline}
  .tbar .btn.newbill span:not(.kbd){display:none}.tbar .btn.newbill{padding:8px 10px}
  .layout.top .sidebar{display:flex}
  .layout.top main{padding:14px 12px 28px}
}
@media print{.tbar{display:none!important}}
/* v3.2 top bar fit */
.tnav{flex:1 1 auto}
.tbar .gsearch{margin-left:8px}
@media (max-width:1600px){.tbar .gsearch{flex:none;width:40px;height:38px;padding:0;justify-content:center;background:#fff}.tbar .gsearch span{display:none!important}}
@media (max-width:1500px){.tl .ic:not(.dn){display:none}.tl{padding:8px 9px;gap:3px}}
@media (max-width:1380px){.tbrand b{display:none}.tbar .btn.newbill .kbd{display:none}}
@media (max-width:1120px){.tl{font-size:13.5px;padding:8px 6px}.tl .dn{display:none}}
@media (max-width:900px){.tbar .gsearch{flex:1;width:auto;justify-content:flex-start;padding:7px 11px;background:var(--bg)}.tbar .gsearch span:not(.kbd){display:inline!important}}
/* v3.3 KPI cards (spark bars + change vs previous period) */
.kpi{padding:14px 16px;transition:border-color .15s,box-shadow .15s}.kpi:hover{border-color:#cfd8e6}
.kpi .kt{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.kpi .kl{min-width:0}
.kpi .k{color:var(--mut);font-size:12.5px;font-weight:500}.kpi .v{font-size:25px;font-weight:700;letter-spacing:-.02em;margin-top:3px;font-variant-numeric:tabular-nums}
.kpi .kb{display:flex;align-items:center;gap:8px;margin-top:8px;flex-wrap:wrap}.kpi .s{color:var(--mut);font-size:12px}
.delta{display:inline-flex;align-items:center;gap:3px;font-size:11.5px;font-weight:700;padding:1px 7px;border-radius:99px;font-variant-numeric:tabular-nums}
.delta.up{background:var(--ok-l);color:var(--ok)}.delta.down{background:var(--bad-l);color:var(--bad)}
.spark{display:flex;align-items:flex-end;gap:2px;height:38px;flex:none;max-width:46%}
.spark i{display:block;width:4px;border-radius:2px;background:rgba(26,86,196,.18);transform-origin:bottom;animation:sg .45s cubic-bezier(.23,1,.32,1) both}.spark i.last{background:var(--blue)}
@media (prefers-reduced-motion:reduce){.spark i{animation:none}}
@keyframes sg{from{opacity:.4;transform:scaleY(.2)}to{opacity:1;transform:none}}
.kpi.accent{background:linear-gradient(135deg,var(--blue),var(--blue-d));border-color:transparent;color:#fff;box-shadow:0 6px 18px rgba(26,86,196,.25)}
.kpi.accent .k,.kpi.accent .s{color:#dbe6fb}.kpi.accent .spark i{background:rgba(255,255,255,.28)}.kpi.accent .spark i.last{background:#fff}
.kpi.accent .delta.up{background:rgba(255,255,255,.18);color:#d9ffe9}.kpi.accent .delta.down{background:rgba(255,255,255,.18);color:#ffe1e1}
/* numbered pager */
.pager{display:inline-flex;gap:4px;align-items:center}.pg{min-width:32px;height:32px;border:1px solid var(--line);background:#fff;border-radius:8px;color:var(--ink-2);font-size:13px;font-weight:600}
.pg:hover:not(:disabled){border-color:var(--blue-m);color:var(--blue-d)}.pg.on{background:var(--blue);border-color:var(--blue);color:#fff}.pg:disabled{opacity:.4;cursor:default}.pgdots{color:var(--mut);padding:0 2px}

/* Sales entry workspace: eVital-style composition using Amar's billing engine. */
body:has(.sales-entry){background:#fff}
.layout.top:has(.sales-entry) .tbar{height:50px;background:#2b56a0;border:0;box-shadow:none;color:#fff;padding:0 18px}
.layout.top:has(.sales-entry) .tbar .tbrand,.layout.top:has(.sales-entry) .tbar .tl,.layout.top:has(.sales-entry) .tbar button{color:#fff}
.layout.top:has(.sales-entry) .tbar .tbrand img{border-radius:50%;background:#fff}
.layout.top:has(.sales-entry) .tbar .tl:hover,.layout.top:has(.sales-entry) .tbar .tm.open>.tl,.layout.top:has(.sales-entry) .tbar .tm.on>.tl{background:#214a91;color:#fff}
.layout.top:has(.sales-entry) .tbar .tl.on::after,.layout.top:has(.sales-entry) .tbar .tm.on>.tl::after{display:none}
.layout.top:has(.sales-entry) .tbar .tdrop a,.layout.top:has(.sales-entry) .tbar .tdrop button{color:#254d86}
.layout.top:has(.sales-entry) .tbar .gsearch,.layout.top:has(.sales-entry) .tbar .newbill{background:transparent;border-color:#ffffff2f;color:#fff}
.layout.top:has(.sales-entry) main{padding:0;max-width:none;min-height:calc(100vh - 50px);margin:0}
.sales-entry{display:grid;grid-template-columns:218px minmax(0,1fr);min-height:calc(100vh - 50px);color:#18233c;background:#fff}
.sales-rail{background:#f4f5f7;border-right:1px solid #d9dfe8;min-width:0}
.sales-crumb{height:65px;display:flex;align-items:center;gap:9px;padding:0 20px;border-bottom:1px solid #d9dfe8;font-size:15px}
.sales-crumb a{color:#2d68ae;text-decoration:none;font-weight:600}.sales-crumb b{font-size:16px}.sales-bulb{width:16px;height:22px;border-radius:10px;background:#5aa9de;color:transparent;margin-left:2px;position:relative}
.sales-bulb:after{content:"";position:absolute;width:7px;height:3px;background:#5aa9de;bottom:-4px;left:4px;border-radius:2px}
.sales-date{height:64px;margin:0 20px;background:#2d5daa;color:#fff;display:flex;align-items:center;gap:12px;padding:9px 16px;box-shadow:0 2px 4px #16396c24}
.sales-date-icon{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:#4fa4dc;font-size:17px}.sales-date small{display:block;font-size:13px;opacity:.9}.sales-date b{display:block;font-size:16px;margin-top:1px}
.sales-rail-link{display:flex;align-items:center;justify-content:space-between;margin:0 20px;padding:12px 4px;border-bottom:1px solid #dfe4eb;color:#52647e;text-decoration:none;font-size:13px}.sales-rail-link:hover{color:#254f94}
.sales-stage{min-width:0;display:flex;flex-direction:column;min-height:calc(100vh - 50px);background:#fff}
.sales-actions{min-height:57px;display:flex;align-items:center;gap:10px;padding:8px 14px;border-bottom:1px solid #cfd7e3;background:#f7f8fa}
.sales-tool-icon{width:42px;height:36px;display:grid;place-items:center;background:#fff;border:1px solid #d6dce5;border-radius:2px;color:#2d5daa;font-size:20px}
.sales-action-select{display:flex;align-items:center;gap:7px;min-width:150px}.sales-action-select>span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.sales-action-select select{height:36px;min-width:140px;background:#fff;border-radius:2px;color:#385073;padding:6px 34px 6px 11px}
.sales-action-select select:disabled{opacity:1;color:#385073;background:#fff}
.sales-action-link{height:36px;display:inline-flex;align-items:center;gap:7px;padding:0 13px;background:#fff;border:1px solid #d6dce5;border-radius:2px;text-decoration:none;color:#3b577e;white-space:nowrap}
.sales-save-top{height:36px;border-radius:2px;min-width:98px;background:#4a9bd5}.sales-settings{width:43px;height:36px;display:grid;place-items:center;background:#4a9bd5;color:#fff;text-decoration:none;font-size:18px}
.sales-entry .billtop{display:grid;grid-template-columns:minmax(360px,1.7fr) 220px minmax(310px,1fr);padding:0;border:0;border-bottom:1px solid #cfd7e3;border-radius:0;box-shadow:none;background:#fff;overflow:visible}
.sales-entry .billtop .bt{position:relative;min-width:0;padding:10px 14px;border-right:1px solid #cfd7e3;display:flex;flex-direction:column;gap:4px}.sales-entry .billtop .bt:last-child{border-right:0}
.sales-entry .billtop .lbl{font-size:12px;text-transform:none;letter-spacing:0;color:#315386;font-weight:500}
.sales-entry .billtop input,.sales-entry .billtop select{height:32px;border:0;border-radius:0;padding:3px 0;box-shadow:none;outline:none;font-size:14px;color:#51617a}
.sales-entry .billtop input:focus{border-bottom:2px solid #4d9ed6}.counter-note{position:absolute;right:14px;top:10px;color:#4e9bd0;font-size:12px}
.bill-options-strip{min-height:38px;display:flex;align-items:center;gap:24px;padding:5px 14px;border-bottom:1px solid #cfd7e3;color:#56657c;font-size:12px;background:#fff}
.bill-options-strip label{display:flex;align-items:center;gap:6px;white-space:nowrap}.bill-options-strip .coupon-option{margin-left:auto}.bill-options-strip .coupon-option input{height:28px;width:86px;text-transform:uppercase}.bill-options-strip .coupon-option button{height:28px;padding:3px 10px;border-radius:2px;font-size:12px}
.sales-lines{flex:1;min-height:390px;display:flex;flex-direction:column;background:#fff}.sales-table-scroll{overflow-x:auto}
.sales-entry table.lines{min-width:1160px;table-layout:fixed;border-collapse:collapse}.sales-entry table.lines th{position:static;background:#fff;color:#244c82;text-transform:none;letter-spacing:0;font-size:12px;font-weight:600;padding:12px 7px;border-bottom:1px solid #d5dce7;text-align:left}
.sales-entry table.lines th.n{text-align:right}.sales-entry table.lines th:nth-child(1){width:34px}.sales-entry table.lines th:nth-child(2){width:225px}.sales-entry table.lines th:nth-child(3){width:86px}.sales-entry table.lines th:nth-child(4){width:65px}.sales-entry table.lines th:nth-child(5){width:145px}.sales-entry table.lines th:nth-child(6){width:78px}.sales-entry table.lines th:nth-child(7){width:86px}.sales-entry table.lines th:nth-child(8){width:72px}.sales-entry table.lines th:nth-child(9){width:72px}.sales-entry table.lines th:nth-child(10){width:92px}.sales-entry table.lines th:nth-child(11){width:70px}.sales-entry table.lines th:nth-child(12){width:110px}.sales-entry table.lines th:nth-child(13){width:34px}
.sales-search-body td{padding:0!important;border:0!important;background:#dceeff}.sales-entry .searchrow{padding:0;border:0;border-radius:0;background:#dceeff;gap:0}.sales-entry .searchrow input#q{width:100%;border:0!important;border-radius:0;padding:12px 18px;background:#dceeff;color:#514578;font-size:14px;outline:none;box-shadow:none}
.sales-entry table.lines tbody#lines td{height:47px;padding:7px;border-bottom:1px solid #e5e8ee}.sales-entry table.lines tbody#lines tr:hover td{background:#f6faff}
.sales-empty{flex:1;min-height:300px;display:flex;align-items:flex-start;justify-content:center;padding:44px 20px;margin:0;color:#8a96a8;font-size:13px;background:radial-gradient(circle at 50% 20%,#f7fbff,transparent 35%)}
.sales-entry .billfoot{position:sticky;bottom:0;margin:0;border-radius:0;min-height:48px;padding:7px 14px;background:#28559e;box-shadow:0 -3px 12px #183b721f;gap:13px;z-index:8}
.sales-entry .billfoot>span:not(.sp){font-size:12px}.sales-entry .billfoot .net{font-size:13px}.sales-entry .billfoot .net b{font-size:21px}.sales-entry .billfoot .btn{border-radius:2px;padding:6px 10px;font-size:12px}.sales-entry .billfoot .btn#save{background:#fff;color:#244c8a}
@media(max-width:1180px){.sales-entry{grid-template-columns:180px minmax(0,1fr)}.sales-date,.sales-rail-link{margin-left:10px;margin-right:10px}.sales-entry .billtop{grid-template-columns:minmax(300px,1.4fr) 160px minmax(260px,1fr)}.sales-action-link span{display:none}.sales-actions{gap:6px}.sales-action-select{min-width:120px}.sales-action-select select{min-width:120px}}
@media(max-width:900px){.layout.top:has(.sales-entry) main{min-height:calc(100vh - 54px)}.sales-entry{grid-template-columns:1fr}.sales-rail{display:none}.sales-stage{min-height:calc(100vh - 54px)}.sales-actions{overflow-x:auto}.sales-entry .billtop{grid-template-columns:1fr}.sales-entry .billtop .bt{border-right:0;border-bottom:1px solid #e2e7ef}.counter-note{position:static}.bill-options-strip{overflow-x:auto}.sales-entry .billfoot{overflow-x:auto;flex-wrap:nowrap}}

/* Sales bill detail shares the sales register navigation; printing uses a separate document. */
@media screen{.bill-print-document{display:none}}
.bill-workspace{display:flex;flex-direction:column;min-height:calc(100vh - 50px);padding:0 20px 44px;background:#f5f6f8;color:#294d7a}
.bill-detail-head{min-height:65px;display:flex;gap:13px;align-items:center;font-size:14px}.bill-detail-head>a{color:#4c9bd2;text-decoration:none}.bill-detail-head>a span{margin-left:10px;color:#37577f}.bill-detail-head>b{font-size:15px}.bill-order-type{border-right:1px solid #cbd3df;padding-right:15px;font-size:15px}.bill-payment,.bill-more{position:relative}.bill-payment summary,.bill-more summary{cursor:pointer;list-style:none}.bill-payment summary{display:flex;gap:15px;align-items:center}.bill-payment summary>span{border-left:1px solid #cbd3df;padding:5px 0 5px 15px;color:#8798ae}.bill-payment>div{position:absolute;top:35px;right:0;width:280px;background:white;border:1px solid #d5dee8;box-shadow:0 5px 20px #193d7229;z-index:20;padding:16px;font-size:13px}.bill-payment p{display:flex;justify-content:space-between;gap:15px}.bill-more summary{background:#4b9bd5;color:white;padding:7px 16px;border-radius:2px}.bill-actions{position:absolute;right:0;top:36px;z-index:20;min-width:220px;background:#fff;border:1px solid #d4dce7;box-shadow:0 5px 20px #193d7229;padding:6px}.bill-action-list{display:flex;flex-direction:column;align-items:stretch;gap:0;margin:0!important}.bill-action-list>.sp{display:none}.bill-action-list .btn,.bill-action-list>a{display:block;width:100%;border:0;border-radius:0;background:white;color:#385a88;padding:9px 12px;text-align:left;text-decoration:none;font-size:13px;font-weight:400}.bill-action-list .btn:hover,.bill-action-list>a:hover{background:#eaf4ff}.bill-action-list .btn.red{color:#bf4f60}
.bill-meta{display:grid;grid-template-columns:150px 180px minmax(280px,2fr) 145px minmax(160px,1fr);gap:0;background:#fff;border-bottom:1px solid #d2dbe6;min-height:76px}.bill-meta>div{padding:11px 20px;display:flex;align-content:center;align-items:center;gap:9px;flex-wrap:wrap}.bill-meta small{display:block;width:100%;color:#8192a9;font-size:12px}.bill-meta b,.bill-meta a{font-size:13px;font-weight:600;line-height:1.4;text-decoration:none;color:#2d5182}.bill-meta b>span:not(.bill-person){font-size:12px}.bill-person{display:inline-grid;place-items:center;width:27px;height:27px;background:#2b569e;border-radius:50%;color:#fff;font-size:15px;margin-right:4px}.bill-phone{font-size:13px;color:#37608d}.bill-grid-wrap{background:#fff;flex:1;display:flex;flex-direction:column;min-height:430px;overflow-x:auto}.bill-detail-table{min-width:1120px;table-layout:fixed}.bill-detail-table th{font-size:11px;font-weight:500;text-transform:none;letter-spacing:0;color:#315784;background:#fff;padding:11px 12px;border-bottom:1px solid #cbd4e1}.bill-detail-table td{font-size:13px;color:#22364e;padding:8px 12px;vertical-align:middle;border-bottom:1px solid #dce4ee;height:49px}.bill-detail-table th:nth-child(1){width:30%}.bill-detail-table th:nth-child(2){width:7%}.bill-detail-table th:nth-child(3){width:11%}.bill-detail-table th:nth-child(4){width:7%}.bill-detail-table th:nth-child(5){width:8%}.bill-detail-table th:nth-child(6){width:6%}.bill-detail-table th:nth-child(7){width:7%}.bill-detail-table th:nth-child(8){width:8%}.bill-detail-table th:nth-child(9){width:6%}.bill-detail-table th:nth-child(10){width:10%}.bill-detail-table td a{color:#294e7e;font-size:13px;text-decoration:none}.bill-detail-table td a:hover{text-decoration:underline}.bill-detail-table td small{display:block;margin-top:2px;color:#8a939d;font-size:10px}.bill-detail-table tr:nth-child(even) td{background:#dcefff}.bill-detail-table td.bill-amount-col{background:#e9f4ff;color:#315a92;font-size:15px}.bill-grid-fill{flex:1;min-height:240px;background:linear-gradient(to left,#eaf4ff 10%,white 10%)}
.bill-detail-foot{position:fixed;bottom:0;left:20px;right:20px;min-height:44px;background:#244f96;color:#fff;display:flex;align-items:center;gap:18px;padding:7px 20px;font-size:12px;z-index:10}.bill-detail-foot a,.bill-detail-foot button{color:#fff;text-decoration:none;border:0;background:transparent;font-size:12px;white-space:nowrap;padding:0}.bill-disabled{opacity:.45}.bill-detail-foot small{font-size:11px;opacity:.75;margin-left:3px}.bill-status{border-left:1px solid #ffffff70;padding-left:18px}.bill-net{display:flex;align-items:center;gap:30px}.bill-net b{font-size:24px;font-weight:600}.bill-breakdown{position:fixed;bottom:44px;right:20px;z-index:9;width:330px;background:#fff;box-shadow:0 -3px 20px #214d8c26}.bill-breakdown:not([open]){display:none}.bill-breakdown summary{padding:14px 18px;list-style:none;background:#f0f5fa;cursor:pointer;font-size:14px}.bill-breakdown summary span{float:right}.bill-breakdown>div{padding:4px 18px 15px}.bill-breakdown p{display:flex;justify-content:space-between;font-size:13px;gap:20px}.bill-breakdown p:last-child{border-top:1px solid #d7e0ea;padding-top:10px}.bill-breakdown b{font-weight:600}
@media(max-width:1050px){.bill-meta{grid-template-columns:140px 170px minmax(250px,1fr)}.bill-meta>div:nth-child(n+4){border-top:1px solid #e0e6ef}.bill-detail-head{flex-wrap:wrap;padding:10px 0}.bill-detail-foot{overflow-x:auto;gap:14px}.bill-workspace{padding:0 10px 44px}.bill-detail-foot{left:10px;right:10px}.bill-breakdown{right:10px}}
@media(max-width:650px){.bill-meta{grid-template-columns:1fr 1fr}.bill-meta .bill-patient{grid-column:1/-1;order:5}.bill-payment summary>span{display:none}.bill-detail-head{gap:9px}.bill-detail-head>b{font-size:12px}.bill-order-type{font-size:12px;padding-right:8px}.bill-meta>div{padding:10px}.bill-workspace{min-height:calc(100vh - 54px)}}
@media print{.bill-print-document{display:block!important;border:1px solid #222!important;border-radius:0!important;padding:14px!important;font-family:Arial,sans-serif;color:#000}.bill-print-document th{background:#f0f0f0!important;color:#000;font-size:10px}.bill-print-document td{font-size:11px}.bill-print-document .mut{color:#444}.bill-print-document h1{font-size:22px}.bill-print-document .bill-total{font-size:20px}.bill-print-document tr{break-inside:avoid}.bill-print-document .bill-total{border-top:1px solid #222}.thermal .bill-print-document{border:0!important;padding:0!important}.thermal .bill-print-document th,.thermal .bill-print-document td{font-size:9px}.thermal .bill-print-document table{table-layout:auto}}
/* Sales register: the same compact visual language as the eVital sales ledger. */
.purchase-history .sales-history-head{background:#f5f6f8}.purchase-history .sales-history-title h1{font-size:15px}.purchase-history .sales-register{margin-top:0;border-top:0}.purchase-history .sales-register-filters{margin:0 24px;padding:14px 18px 4px}.purchase-register-table th{background:#fff!important}.purchase-register-table td{height:41px!important;font-size:13px!important}.purchase-register-table th:nth-child(1){width:75px}.purchase-register-table th:nth-child(2){width:145px}.purchase-register-table th:nth-child(3){width:170px}.purchase-register-table th:nth-child(4){width:120px}.purchase-register-table th:nth-child(5){width:120px}.purchase-register-table th:nth-child(6){width:270px}.purchase-register-table th:nth-child(7){width:210px}.purchase-amount{white-space:nowrap}.purchase-due{background:#c95d6b;color:#fff;padding:3px 6px;margin-left:10px;font-size:11px;border-radius:1px}.purchase-paid{margin-left:10px;color:#839aa4;font-size:12px}.purchase-more{position:relative;font-size:13px}.purchase-more summary{list-style:none;cursor:pointer;background:#4b9bd5;color:#fff;padding:7px 14px;border-radius:2px}.purchase-more>div{position:absolute;right:0;top:37px;z-index:20;min-width:180px;background:#fff;border:1px solid #d6dce5;box-shadow:0 5px 15px #1c376b20;padding:5px}.purchase-more a{display:block;padding:8px 12px;color:#335986;text-decoration:none}.purchase-more a:hover{background:#edf6fc}
.sales-return-history .sales-history-title a{color:#4b9bd5;text-decoration:none;font-size:14px}.sales-return-history .sales-history-title .sales-new{color:#fff}.sales-return-history .sales-history-title h1{font-size:15px;color:#bc5766}.sales-return-history .sales-history-head{background:#f5f6f8}.sales-return-history .sales-register{margin-top:0;border-top:0}.sales-return-history .sales-register-filters{margin:0 24px;padding:14px 18px 4px}.sales-return-history .sales-register-table td{height:40px;font-size:13px}.sales-return-history .sales-register-table th{background:#fff}.return-register-table th:nth-child(2){width:170px}.return-register-table th:nth-child(5){width:220px}.return-register-table th:nth-child(7){width:210px}.return-amount{white-space:nowrap}.return-amount span{display:inline-block;min-width:75px;text-align:left;color:#9099a5;margin-left:14px;font-size:12px}.return-receipt table th{width:40%}.return-receipt table td{text-align:left}
@media print{body:has(.return-receipt)>#app{display:none!important}body:has(.return-receipt) #m2 .modal{position:static;display:block;background:#fff;padding:0}body:has(.return-receipt) .return-receipt{width:100%!important;max-width:none;border:0;box-shadow:none}}
body:has(.sales-history){background:#f5f6f8}
.layout.top:has(.sales-history) .tbar{height:50px;background:#2b56a0;border:0;box-shadow:none;color:#fff;padding:0 18px}
.layout.top:has(.sales-history) .tbar .tbrand,.layout.top:has(.sales-history) .tbar .tl,.layout.top:has(.sales-history) .tbar button{color:#fff}
.layout.top:has(.sales-history) .tbar .tbrand img{border-radius:50%;background:#fff}
.layout.top:has(.sales-history) .tbar .tl:hover,.layout.top:has(.sales-history) .tbar .tm.open>.tl,.layout.top:has(.sales-history) .tbar .tm.on>.tl{background:#214a91;color:#fff}
.layout.top:has(.sales-history) .tbar .tl.on::after,.layout.top:has(.sales-history) .tbar .tm.on>.tl::after{display:none}
.layout.top:has(.sales-history) .tbar .tdrop a,.layout.top:has(.sales-history) .tbar .tdrop button{color:#254d86}
.layout.top:has(.sales-history) .tbar .gsearch,.layout.top:has(.sales-history) .tbar .newbill{background:transparent;border-color:#ffffff2f;color:#fff}
.layout.top:has(.sales-history) main{padding:0;max-width:none;margin:0;min-height:calc(100vh - 50px)}
.sales-history{min-height:calc(100vh - 50px);color:#233c62;background:#f5f6f8}
.sales-history-head{height:65px;padding:0 24px;display:flex;align-items:center;justify-content:space-between;background:#fff;border-bottom:1px solid #d9dfe8}
.sales-history-title,.sales-history-actions{display:flex;align-items:center;gap:12px}.sales-history-title h1{font-size:20px;margin:0;color:#253e64;font-weight:600}.sales-history-bulb{width:15px;height:20px;border-radius:9px;background:#5aa9de;color:transparent;position:relative}.sales-history-bulb:after{content:"";position:absolute;width:7px;height:3px;background:#5aa9de;bottom:-4px;left:4px;border-radius:2px}
.sales-new,.sales-return-link,.sales-icon-btn{height:34px;display:inline-flex;align-items:center;justify-content:center;text-decoration:none;border:1px solid #d2d8e1;background:#fff;color:#325886;padding:0 13px;border-radius:2px;font-size:13px}.sales-new{background:#4b9bd5;border-color:#4b9bd5;color:#fff}.sales-icon-btn{width:36px;padding:0;color:#347ab5;font-size:19px}.sales-return-link b{font-size:20px;margin-left:10px;font-weight:400}
.sales-register-filters{min-height:62px;padding:12px 24px;display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:#fff;border-bottom:1px solid #d6dce5}
.sales-register-filters input,.sales-register-filters select{height:36px;border:1px solid #ccd4df;border-radius:2px;background:#fff;color:#54657c;font-size:12px;box-shadow:none}
.sales-search-group{display:flex;min-width:320px}.sales-search-group select{width:105px;border-radius:2px 0 0 2px;border-right:0;color:#345c91}.sales-search-group input{flex:1;border-radius:0 2px 2px 0;padding-left:11px}
.sales-date-filter{display:flex;align-items:center;gap:0;min-width:380px}.sales-date-filter>span:not(.sales-calendar){height:36px;display:grid;place-items:center;border-top:1px solid #ccd4df;border-bottom:1px solid #ccd4df;padding:0 6px;color:#8a96a7;font-size:11px}.sales-calendar{height:36px;width:34px;display:grid;place-items:center;background:#4e9dd6;color:#fff;border-radius:2px 0 0 2px}.sales-date-filter input{width:125px;border-radius:0;padding:5px}.sales-date-filter input:nth-of-type(2){border-radius:0 2px 2px 0}.sales-date-filter .seg{display:none}
.sales-mobile-filter{display:flex;min-width:160px}.sales-mobile-filter span{width:33px;height:36px;display:grid;place-items:center;border:1px solid #ccd4df;border-right:0;color:#478cc2}.sales-mobile-filter input{width:145px;border-radius:0 2px 2px 0}.sales-payment-filter{width:110px}.sales-more-filter{height:36px;padding:0 12px;border:1px solid #ccd4df;background:#fff;color:#31598e;border-radius:2px;font-size:12px}.sales-more-panel{width:100%;grid-template-columns:repeat(3,minmax(180px,240px));gap:10px;padding-top:2px}.sales-more-panel label{display:grid;gap:4px;color:#738096;font-size:11px}
.sales-register{margin:14px 24px 24px;background:#fff;border:1px solid #d7dde6;min-height:430px;box-shadow:0 1px 2px #1c376b0b}
.sales-register-summary{min-height:48px;padding:0 14px;display:flex;align-items:center;gap:10px;border-bottom:1px solid #d7dde6;color:#32527f;font-size:13px}.sales-register-summary> b{font-size:14px}.summary-total{color:#65809f}.sales-mode-total{border-left:1px solid #dce2e9;padding-left:10px;color:#76869a;font-size:11px}.sales-mode-total b{color:#385d8d;margin-left:4px}
.sales-table-wrap{overflow:auto;min-height:314px}.sales-register-table{min-width:1050px;border-collapse:collapse;table-layout:fixed}.sales-register-table th{background:#f6f8fb;color:#325986;font-size:11px;text-transform:none;letter-spacing:0;font-weight:600;padding:10px 12px;border-bottom:1px solid #cfd7e1;white-space:nowrap;text-align:left}.sales-register-table th:nth-child(1){width:120px}.sales-register-table th:nth-child(2){width:120px}.sales-register-table th:nth-child(3){width:105px}.sales-register-table th:nth-child(4){width:120px}.sales-register-table th:nth-child(5){width:180px}.sales-register-table th:nth-child(6){width:120px}.sales-register-table th:nth-child(7){width:115px}.sales-register-table th:nth-child(8){width:110px}.sales-register-table th.sales-row-actions{width:78px}
.sales-register-table td{height:52px;padding:7px 12px;border-bottom:1px solid #e4e8ee;color:#4d607b;font-size:12px;background:#fff}.sales-register-table tbody tr.click:hover td{background:#f2f8fd}.sales-register-table td b{color:#2e5c96}.sales-register-table td.small span{color:#93a0b1}.delivery-dot{color:#4c9ed7;font-size:9px}.sales-register-table .n{text-align:right}.sales-register-table .pill{border-radius:2px;font-size:10px;padding:3px 6px}.sales-register-table .pill.bad{background:#fff0ee;color:#d05b51;border:1px solid #efc6c2}
.sales-row-actions{white-space:nowrap;text-align:right}.sales-action-icon{width:28px;height:28px;border:0;background:transparent;color:#5388b7;font-size:15px}.sales-action-icon.wa{color:#3ca578}.sales-empty-row td{text-align:center;color:#8a96a8;height:250px;background:radial-gradient(circle at 50% 35%,#f4f9fd,transparent 30%)}
.sales-register-pager{height:48px;padding:0 12px;display:flex;align-items:center;gap:10px;border-top:1px solid #d7dde6;color:#7b8798;font-size:11px}.sales-register-pager label{display:flex;align-items:center;gap:6px}.sales-register-pager select{height:28px;padding:2px 25px 2px 7px;font-size:11px;border-radius:2px}.sales-register-pager .pg{border-radius:2px;height:29px;min-width:29px;font-size:11px}
@media(max-width:1100px){.sales-register-filters{align-items:flex-start}.sales-date-filter{order:3}.sales-register{margin:10px 14px 20px}.sales-history-head{padding:0 14px}}
@media(max-width:720px){.layout.top:has(.sales-history) main{min-height:calc(100vh - 54px)}.sales-history-head{height:auto;min-height:58px;gap:10px;flex-wrap:wrap;padding:10px 12px}.sales-history-actions{gap:5px}.sales-register-filters{padding:10px 12px}.sales-search-group,.sales-date-filter,.sales-mobile-filter{width:100%;min-width:0}.sales-date-filter{overflow-x:auto}.sales-date-filter input{min-width:125px}.sales-mobile-filter input{width:100%}.sales-register{margin:8px 0;border-left:0;border-right:0}}
select.sm{padding:5px 8px;font-size:13px}
/* v3.4 home: business at a glance, expiry tabs, loyalty bars */
.glance .row{gap:8px}
.gtiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin:14px 0 10px}
.gtile{display:flex;flex-direction:column;gap:2px;padding:12px 14px;border:1px solid var(--line);border-radius:10px;text-decoration:none;color:var(--ink);border-left:4px solid var(--blue);transition:background .12s}
.gtile:hover{background:#f8fafd}.gtile.pur{border-left-color:var(--ink-2)}.gtile.b2b{border-left-color:#0e9fb0}
.gtile .k{font-size:12.5px;color:var(--mut);font-weight:500}.gtile b{font-size:22px;letter-spacing:-.02em;font-variant-numeric:tabular-nums}.gtile .s{font-size:12px;color:var(--mut)}
.tabs2{display:inline-flex;gap:14px;border-bottom:1px solid var(--line-2)}.tabs2 button{background:none;border:0;padding:4px 0 8px;font-weight:600;font-size:14.5px;color:var(--mut);border-bottom:2px solid transparent;margin-bottom:-1px}
.tabs2 button.on{color:var(--ink);border-bottom-color:var(--blue)}
#expbox table{margin-top:8px}
.lrows{display:flex;flex-direction:column;gap:10px;margin-top:10px}.lrows div{display:grid;grid-template-columns:78px 1fr auto;gap:10px;align-items:center;font-size:13.5px}.lrows span{color:var(--mut)}
.lbar{height:8px;background:var(--line-2);border-radius:99px;overflow:hidden}.lbar i{display:block;height:100%;border-radius:99px}.lbar i.b{background:var(--blue)}.lbar i.g{background:var(--ok)}.lbar i.r{background:var(--bad)}
.lrows b{font-variant-numeric:tabular-nums;min-width:70px;text-align:right}
.empty{padding:22px 10px;text-align:center;color:var(--mut);border:1px dashed var(--line);border-radius:10px;margin-top:10px}


/* Owner 23 Nov 2026: no up/down arrows on number fields anywhere in the dashboard — numbers are typed only. */
input[type=number]{-moz-appearance:textfield;appearance:textfield}
input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}
