/* TN Bill Book – Quick Billing (POS) */
.pos{display:grid;grid-template-columns:minmax(0,1fr) 400px;gap:18px;align-items:start}
.pos-main{display:flex;flex-direction:column;gap:14px;min-width:0}
.pos-side{display:flex;flex-direction:column;gap:14px;position:sticky;top:74px;max-height:calc(100vh - 88px);overflow:auto;padding-bottom:4px}
.pos-today{font-size:13px;color:var(--muted)}
.pos-scan{padding:10px 12px;position:relative;overflow:visible}
.pos-scanrow{display:flex;align-items:center;gap:10px}
.pos-scanrow>svg{width:26px;height:26px;color:var(--brand);flex-shrink:0}
.pos-scanrow .input{flex:1;font-size:17px;font-weight:600;padding:13px 14px;border-width:2px}
.pos-scanrow .input:focus{border-color:var(--brand)}
#posHeldBtn.has{border-color:#f59e0b;color:#b45309;background:#fffbeb}
.pos-sug{position:absolute;left:12px;right:12px;top:calc(100% - 6px);z-index:15;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 14px 40px rgba(15,23,42,.16);overflow:hidden}
.pos-sug button{appearance:none;border:0;border-bottom:1px solid var(--line);background:#fff;width:100%;display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 14px;cursor:pointer;text-align:left;font:inherit}
.pos-sug button:last-child{border-bottom:0}
.pos-sug button:hover,.pos-sug button.on{background:#eef2ff}
.pos-sug span{display:flex;flex-direction:column;min-width:0}
.pos-sug small{color:var(--muted);font-size:12px}
.pos-sug i{font-style:normal;font-weight:700;white-space:nowrap}
.pos-empty{text-align:center;padding:46px 20px;color:var(--muted)}
.pos-empty>svg{width:54px;height:54px;color:#c7d2fe;margin-bottom:6px}
.pos-empty h4{margin:0 0 4px;font-size:17px;color:var(--ink)}
.pos-empty p{margin:0}
.pos-last{margin-top:18px!important;padding-top:14px;border-top:1px dashed var(--line)}
.pos-tbl td{vertical-align:middle}
.pos-tbl .c{text-align:center}
.pos-num{width:108px;text-align:right;font-weight:700;display:inline-block}
.pos-num.sm2{width:64px}
.pos-qty{display:inline-flex;align-items:center;gap:4px}
.pos-qty .input{width:56px;text-align:center;font-weight:800;padding-left:4px;padding-right:4px}
.pos-qty .btn{width:32px;height:32px;padding:0;font-size:18px;line-height:1}
.pos-tbl tr.flash td{animation:posflash .7s}
@keyframes posflash{from{background:#dbeafe}to{background:transparent}}
.pos-sum{display:flex;flex-direction:column;gap:10px}
.pos-cust{gap:8px;margin:0}
.pos-rows{display:flex;flex-direction:column;gap:8px}
.pos-rows>div{display:flex;justify-content:space-between;align-items:center;gap:10px}
.pos-rows span b{font-weight:500;color:var(--muted);font-size:12.5px}
.pos-small{font-size:12.5px;color:var(--muted)}
.pos-disc{display:flex;gap:6px;align-items:center}
.pos-disc .input{width:92px;text-align:right;font-weight:700}
.pos-seg{display:flex;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.pos-seg button{appearance:none;border:0;background:#fff;padding:8px 11px;font:700 13px inherit;color:var(--muted);cursor:pointer}
.pos-seg button.on{background:var(--brand);color:#fff}
.pos-total{display:flex;justify-content:space-between;align-items:baseline;border-top:2px solid var(--ink);padding-top:10px;margin-top:2px}
.pos-total span{font-weight:800;letter-spacing:.06em}
.pos-total b{font-size:32px;font-weight:800;letter-spacing:-.02em}
.pos-saved{font-size:12.5px;color:var(--green);font-weight:600;text-align:right;min-height:0}
.pos-modes{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.pos-modes button{appearance:none;border:1.5px solid var(--line);background:#fff;border-radius:9px;padding:9px 4px;font:700 13px inherit;color:var(--ink-2);cursor:pointer}
.pos-modes button.on{border-color:var(--brand);background:#eef2ff;color:var(--brand)}
.pos-cash{display:flex;flex-direction:column;gap:8px;background:var(--soft);border-radius:10px;padding:10px 12px}
.pos-adj{display:flex;justify-content:space-between;align-items:center;gap:10px}
.pos-change{display:flex;justify-content:space-between;align-items:center}
.pos-change b{font-size:18px;color:var(--green)}
.pos-change b.bad{color:var(--red)}
.pos-actions{display:flex;flex-direction:column;gap:8px}
.pos-actions .lg{padding:15px;font-size:16px}
.pos-actions kbd{font:600 11px ui-monospace,monospace;background:rgba(255,255,255,.22);border-radius:5px;padding:2px 6px;margin-left:8px}
.pos-act2{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px}
.pos-prev .card-h{padding:10px 14px}
.pos-prevbox{background:#e5e7eb;border-radius:0 0 var(--r) var(--r);overflow:auto;max-height:520px}
.pos-prevbox iframe{display:block;width:100%;height:320px;border:0}
.pos-chk{display:grid;grid-template-columns:1fr 1fr;gap:8px 12px;margin-bottom:14px;font-size:13.5px}
.pos-bar{display:none}
.pos-dash{display:flex;align-items:center;gap:14px;background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:12px 16px;color:var(--ink);box-shadow:var(--shadow)}
.pos-dash>svg{width:30px;height:30px;color:var(--brand);flex-shrink:0}
.pos-dash span{display:flex;flex-direction:column;flex:1;min-width:0}
.pos-dash small{color:var(--muted)}
.pos-dash i{font-style:normal}
@media (max-width:1180px){
	.pos{grid-template-columns:1fr}
	.pos-side{position:static;max-height:none;overflow:visible}
}
@media (max-width:860px){
	.pos{padding-bottom:70px}
	.pos-bar{display:flex;position:fixed;left:0;right:0;bottom:calc(58px + env(safe-area-inset-bottom));z-index:24;background:#fff;border-top:1px solid var(--line);padding:8px 12px;align-items:center;justify-content:space-between;gap:12px;box-shadow:0 -6px 20px rgba(15,23,42,.08)}
	.pos-bar small{display:block;color:var(--muted);font-size:11px}
	.pos-bar b{font-size:20px}
	.pos-scanrow .input{font-size:16px;padding:11px 12px}
	#posHeldBtn span{display:none}
	.pos-tbl thead{display:none}
	.pos-tbl tr{display:grid;grid-template-columns:1fr auto;gap:6px 10px;padding:10px 12px;border-bottom:1px solid var(--line)}
	.pos-tbl td{border:0!important;padding:0!important}
	.pos-tbl td:nth-child(1){display:none}
	.pos-tbl td:nth-child(2){grid-column:1}
	.pos-tbl td:nth-child(7){grid-column:2;grid-row:1}
	.pos-tbl td:nth-child(3),.pos-tbl td:nth-child(4),.pos-tbl td:nth-child(5),.pos-tbl td:nth-child(6){grid-column:1/-1;display:flex;justify-content:space-between;align-items:center;text-align:left}
	.pos-tbl td[data-l]:before{content:attr(data-l);font-size:12px;color:var(--muted);font-weight:600}
	.pos-actions kbd{display:none}
	.pos-chk{grid-template-columns:1fr}
}

/* Phone scanner */
#posPhone.on{border-color:#f59e0b;color:#b45309;background:#fffbeb}
#posPhone.live{border-color:#16a34a;color:#166534;background:#dcfce7}
.pos-steps{margin:0 0 14px;padding-left:20px;display:flex;flex-direction:column;gap:6px}
.pos-phone-sw{background:var(--soft);border:1px solid var(--line);border-radius:10px;padding:10px 12px}
.msc{max-width:560px;margin:0 auto;display:flex;flex-direction:column;gap:14px}
.msc-cam{overflow:hidden;padding:0}
.msc-view{position:relative;background:#0f172a;aspect-ratio:4/3;overflow:hidden}
.msc-view video{width:100%;height:100%;object-fit:cover;display:block}
#mscH5{position:absolute;inset:0}
#mscH5 video{width:100%!important;height:100%!important;object-fit:cover}
.msc-line{position:absolute;left:8%;right:8%;top:50%;height:2px;background:#ef4444;box-shadow:0 0 12px #ef4444;pointer-events:none;animation:mscl 1.6s ease-in-out infinite}
@keyframes mscl{0%,100%{transform:translateY(-34px)}50%{transform:translateY(34px)}}
.msc-start{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;background:rgba(15,23,42,.82);color:#cbd5e1;text-align:center;padding:16px}
.msc-start p{margin:0;font-size:13px}
.msc-start .lg{padding:14px 22px;font-size:16px}
.msc-status{padding:10px 14px;font-weight:600;font-size:13.5px;color:var(--muted);text-align:center}
.msc-status.ok{color:#166534;background:#dcfce7}
.msc-status.warn{color:#92400e;background:#fef3c7}
.msc-status.bad{color:#991b1b;background:#fee2e2}
.msc-manual{display:flex;gap:8px}
.msc-manual .input{flex:1}
.msc-row{display:flex;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid var(--line)}
.msc-row:last-child{border-bottom:0}
.msc-row div{display:flex;flex-direction:column;min-width:0}
.msc-row small{color:var(--muted);font-size:12px}
.msc-row .r{text-align:right;flex-shrink:0}
.msc-row.unk b{color:var(--red)}
@media (max-width:860px){#posPhone span{display:none}}
