/* Karki'z POS: white/blue like the admin dashboard, mobile first, touch targets 48px */
:root { --blue:#1d4ed8; --blue-d:#1e40af; --blue-l:#eff6ff; --ink:#0f172a; --mute:#475569; --line:#dbe3ef; --bg:#f5f8fc; --card:#fff; --red:#b91c1c; --red-l:#fef2f2; --green:#15803d; --green-l:#f0fdf4; --amber:#92400e; --amber-l:#fffbeb; --r:14px; }
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; font:16px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,"Noto Sans Devanagari",sans-serif; color:var(--ink); background:var(--bg); overflow-x:hidden; }
h1,h2,h3,p { margin:0; }
.boot { padding:40px; text-align:center; color:var(--mute); }
.wrap { max-width:720px; margin:0 auto; padding:16px 16px calc(24px + env(safe-area-inset-bottom)); }
.top { position:sticky; top:0; z-index:5; background:var(--blue); color:#fff; padding:8px 12px; padding-top:calc(8px + env(safe-area-inset-top)); display:flex; align-items:center; gap:8px; }
.top .who { flex:1; min-width:0; }
.top .who b { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.top .who span { font-size:13px; opacity:.9; }
.top button { background:rgba(255,255,255,.16); color:#fff; border:1px solid rgba(255,255,255,.35); padding:8px 12px; flex:0 0 auto; }
.top .who span { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.card { background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:16px; margin-top:16px; }
.card h2 { font-size:19px; margin-bottom:4px; }
.card .sub { color:var(--mute); font-size:14px; margin-bottom:12px; }
label { display:block; font-weight:600; font-size:15px; margin:14px 0 6px; }
input, textarea { width:100%; min-height:48px; padding:10px 12px; font:inherit; color:var(--ink); background:#fff; border:1.5px solid #94a3b8; border-radius:10px; }
input:focus-visible, textarea:focus-visible, button:focus-visible { outline:3px solid #93c5fd; outline-offset:2px; }
input.money { font-size:22px; font-weight:700; text-align:right; }
button { min-height:48px; min-width:48px; padding:10px 16px; font:inherit; font-weight:600; border-radius:10px; border:1.5px solid var(--line); background:#fff; color:var(--ink); cursor:pointer; touch-action:manipulation; }
button.primary { background:var(--blue); border-color:var(--blue); color:#fff; }
button.primary:active { background:var(--blue-d); }
button.danger { background:#fff; border-color:var(--red); color:var(--red); }
button.block { display:block; width:100%; margin-top:16px; }
button.link { border:0; background:none; color:var(--blue); padding:10px 4px; text-decoration:underline; }
button[disabled] { opacity:.55; cursor:not-allowed; }
.row { display:flex; gap:10px; flex-wrap:wrap; }
.row > * { flex:1 1 140px; }
.err { background:var(--red-l); color:var(--red); border:1px solid #fecaca; border-radius:10px; padding:10px 12px; margin-top:12px; font-weight:600; }
.info { background:var(--blue-l); color:var(--blue-d); border:1px solid #bfdbfe; border-radius:10px; padding:10px 12px; margin-top:12px; }
.kv { display:grid; grid-template-columns:1fr auto; gap:6px 12px; margin-top:8px; }
.kv dt { color:var(--mute); }
.kv dd { margin:0; font-weight:700; text-align:right; font-variant-numeric:tabular-nums; }
.badge { display:inline-block; padding:3px 10px; border-radius:999px; font-size:13px; font-weight:700; }
.badge.open { background:var(--green-l); color:var(--green); }
.badge.closed { background:#e2e8f0; color:#334155; }
.diff-ok { color:var(--green); } .diff-bad { color:var(--red); } .diff-over { color:var(--amber); }
.login { min-height:100vh; min-height:100dvh; display:flex; align-items:center; justify-content:center; padding:16px; }
.login .card { width:100%; max-width:400px; margin:0; }
.brand { display:flex; align-items:center; gap:12px; margin-bottom:8px; }
.brand img { width:56px; height:56px; object-fit:contain; border-radius:12px; background:#fff; border:1px solid var(--line); }
.top .logo { flex:0 0 auto; width:40px; height:40px; border-radius:10px; background:#fff; overflow:hidden; display:flex; }
.top .logo img { width:100%; height:100%; object-fit:contain; }
.brand h1 { font-size:22px; }
.brand p { color:var(--mute); font-size:14px; }
.count { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:10px; }
.count label { margin:0; font-size:13px; font-weight:600; color:var(--mute); }
.count input { text-align:center; padding:8px 4px; }
.list { list-style:none; margin:8px 0 0; padding:0; }
.list li { display:flex; justify-content:space-between; gap:10px; padding:12px 0; border-top:1px solid var(--line); font-size:15px; }
.list li:first-child { border-top:0; }
.list small { display:block; color:var(--mute); }
#toast { position:fixed; left:50%; top:calc(72px + env(safe-area-inset-top)); transform:translateX(-50%); max-width:calc(100vw - 32px); background:#0f172a; color:#fff; padding:12px 16px; border-radius:12px; opacity:0; pointer-events:none; transition:opacity .2s; z-index:20; }
#toast.on { opacity:1; }
[hidden] { display:none !important; }
@media (min-width:600px) { .count { grid-template-columns:repeat(5,1fr); } }
@media (prefers-reduced-motion:reduce) { #toast { transition:none; } }

/* ---- selling ---- */
.sell { padding-bottom:calc(96px + env(safe-area-inset-bottom)); }
.chips { display:flex; gap:8px; overflow-x:auto; padding:12px 0 4px; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
.chips::-webkit-scrollbar { display:none; }
.chip { flex:0 0 auto; border-radius:999px; white-space:nowrap; }
.chip.on, .seg.on { background:var(--blue); border-color:var(--blue); color:#fff; }
.grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; margin-top:10px; }
.prod { position:relative; display:flex; flex-direction:column; align-items:stretch; gap:4px; padding:8px; text-align:left; min-height:132px; background:#fff; border-radius:var(--r); overflow:hidden; }
.prod img, .prod .ph { width:100%; aspect-ratio:4/3; object-fit:cover; border-radius:10px; background:var(--blue-l); }
.prod .ph { display:flex; align-items:center; justify-content:center; font-size:30px; font-weight:800; color:#93c5fd; }
.prod .pn { font-weight:700; font-size:15px; line-height:1.25; overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.prod .pp { color:var(--blue-d); font-weight:700; font-size:15px; }
.prod .left { font-size:12px; font-weight:600; color:var(--mute); }
.prod .left.low { color:var(--red); }
.prod .inq { position:absolute; top:6px; right:6px; min-width:28px; height:28px; padding:0 8px; border-radius:999px; background:var(--blue); color:#fff; font-weight:800; display:flex; align-items:center; justify-content:center; }
.cartbar { position:fixed; left:0; right:0; bottom:0; z-index:6; display:flex; align-items:center; gap:12px; padding:10px 16px calc(10px + env(safe-area-inset-bottom)); background:#fff; border-top:1px solid var(--line); box-shadow:0 -4px 16px rgba(15,23,42,.08); }
.cartbar > div { flex:1; min-width:0; }
.cartbar .n { display:block; font-size:14px; color:var(--mute); font-weight:600; }
.cartbar .v { font-size:22px; font-weight:800; font-variant-numeric:tabular-nums; }
.cartbar button { min-width:120px; min-height:52px; font-size:18px; }
dialog.sheet { border:0; border-radius:var(--r); padding:16px; width:min(420px, calc(100vw - 24px)); max-height:85vh; color:var(--ink); }
dialog.sheet::backdrop { background:rgba(15,23,42,.5); }
dialog.sheet h3 { font-size:18px; margin-bottom:12px; }
.sizes { display:grid; gap:8px; }
.size { display:flex; justify-content:space-between; align-items:center; min-height:56px; font-size:17px; }
.size span { color:var(--blue-d); font-weight:800; }
.lines { list-style:none; margin:8px 0 0; padding:0; }
.lines li { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px 10px; align-items:center; padding:12px 0; border-top:1px solid var(--line); }
.lines li:first-child { border-top:0; }
.lines .ln b { display:block; overflow-wrap:anywhere; } .lines .ln small { color:var(--mute); }
.lines .amt { grid-column:2; grid-row:1; text-align:right; font-weight:800; font-variant-numeric:tabular-nums; }
.lines .qty { grid-column:1; display:flex; align-items:center; gap:10px; }
.lines .qty button { min-width:48px; font-size:22px; padding:0; }
.lines .qty .q { min-width:28px; text-align:center; font-size:18px; }
.lines .lnote { grid-column:1 / -1; min-height:44px; font-size:15px; }
.kv.big { margin-top:12px; padding-top:12px; border-top:1px solid var(--line); font-size:17px; }
.kv .tot { font-size:22px; font-weight:800; color:var(--ink); }
.segs, .methods, .quick { display:flex; gap:8px; flex-wrap:wrap; }
.segs { flex:0 0 auto; }
.methods .seg { flex:1 1 96px; }
.quick { margin-top:8px; } .quick button { flex:1 1 72px; padding:8px; }
.change { margin-top:12px; padding:12px; border-radius:10px; background:var(--green-l); color:var(--green); font-size:20px; font-weight:800; text-align:center; }
.change.short { background:var(--red-l); color:var(--red); }
.qr { display:block; width:min(240px, 100%); margin:12px auto 0; border:1px solid var(--line); border-radius:10px; }
button.pay { min-height:60px; font-size:19px; }
.done { text-align:center; } .done .kv { text-align:left; }
.tick { width:64px; height:64px; margin:0 auto 8px; border-radius:50%; background:var(--green-l); color:var(--green); font-size:36px; font-weight:800; display:flex; align-items:center; justify-content:center; }
@media (min-width:600px) { .grid { grid-template-columns:repeat(3, minmax(0, 1fr)); } }
@media (min-width:900px) { .wrap.sell { max-width:1100px; } .grid { grid-template-columns:repeat(5, minmax(0, 1fr)); } }

/* ---- bottom navigation, tables, bills, kitchen ---- */
.bar { position:fixed; left:0; right:0; bottom:0; z-index:7; display:flex; background:#fff; border-top:1px solid var(--line); padding-bottom:env(safe-area-inset-bottom); }
.bar button { flex:1; min-height:56px; border:0; border-radius:0; background:#fff; color:var(--mute); font-size:14px; padding:6px 2px; }
.bar button.on { color:var(--blue); box-shadow:inset 0 3px 0 var(--blue); }
.wrap { padding-bottom:calc(88px + env(safe-area-inset-bottom)); }
.sell { padding-bottom:calc(150px + env(safe-area-inset-bottom)); }
.cartbar { bottom:calc(56px + env(safe-area-inset-bottom)); padding-bottom:10px; }
#toast { z-index:30; }
.pg { font-size:20px; margin-top:16px; }
.tgrid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; margin-top:10px; }
.tbl { display:flex; flex-direction:column; align-items:flex-start; gap:2px; min-height:92px; padding:12px; background:#fff; border-radius:var(--r); text-align:left; }
.tbl b { font-size:18px; } .tbl .sm { font-size:13px; font-weight:600; color:var(--mute); }
.tbl.busy { background:var(--amber-l); border-color:#fcd34d; } .tbl.busy .sm:first-of-type { color:var(--amber); font-size:16px; font-weight:800; }
.tabhead { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:8px; } .tabhead h2 { font-size:20px; flex:1 1 100%; }
.tabpage .grid { margin-bottom:8px; }
.dish { min-height:84px; justify-content:center; }
.row.actions { margin-top:14px; } .row.actions button { min-height:56px; }
.badge.sent { background:var(--blue-l); color:var(--blue-d); } .badge.new { background:var(--amber-l); color:var(--amber); }
.lines .qty .badge { margin-left:6px; }
label.pick { display:flex; align-items:center; gap:12px; min-height:48px; margin:0; font-weight:400; }
label.pick input { width:44px; min-height:44px; height:44px; flex:0 0 auto; accent-color:var(--blue); }
.tickets { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:12px; margin-top:12px; }
.ticket { background:#fff; border:2px solid var(--line); border-radius:var(--r); padding:14px; }
.ticket header { display:flex; justify-content:space-between; gap:8px; align-items:baseline; } .ticket header b { font-size:20px; } .ticket header span { color:var(--mute); font-size:13px; }
.ticket ul { list-style:none; margin:10px 0 0; padding:0; } .ticket li { padding:8px 0; border-top:1px solid var(--line); font-size:18px; } .ticket li small { display:block; color:var(--red); font-size:14px; font-weight:700; }
.ticket li.gone { text-decoration:line-through; color:var(--mute); }
.ticket.st-new { border-color:#f59e0b; } .ticket.st-preparing { border-color:var(--blue); } .ticket.st-ready { border-color:var(--green); }
.b-new { background:var(--amber-l); color:var(--amber); } .b-preparing { background:var(--blue-l); color:var(--blue-d); } .b-ready { background:var(--green-l); color:var(--green); }
@media (min-width:600px) { .tgrid { grid-template-columns:repeat(4, minmax(0, 1fr)); } }
html { scroll-padding-bottom:110px; scroll-padding-top:72px; }
a.btn { min-height:48px; min-width:48px; padding:10px 16px; font-weight:600; border-radius:10px; border:1.5px solid var(--line); background:#fff; color:var(--ink); text-decoration:none; display:inline-flex; align-items:center; justify-content:center; text-align:center; touch-action:manipulation; }
a.btn.small { min-height:44px; padding:8px 12px; flex:0 0 auto; font-size:14px; }
.list li { align-items:center; }
.btns { display:flex; gap:6px; flex:0 0 auto; } button.small { min-height:44px; padding:8px 12px; font-size:14px; }
.b-void { background:var(--red-l); color:var(--red); }
.lines .qty .sm { margin-left:8px; color:var(--mute); }
.order { background:#fff; border:2px solid var(--line); border-radius:var(--r); padding:14px; margin-top:12px; } .order.late { border-color:#f87171; }
.order header { display:flex; justify-content:space-between; align-items:center; gap:8px; } .order header b { font-size:18px; }
.order ul { margin:6px 0 0; padding-left:20px; }
.bar button { font-size:13px; padding:6px 0; }
dialog.sheet h4 { margin:14px 0 6px; font-size:14px; color:var(--mute); }
.size.on { background:var(--blue-l); border-color:var(--blue); color:var(--blue-d); }
dialog.sheet { overflow-y:auto; }
dialog.sheet h4 { margin:14px 0 6px; font-size:14px; color:var(--mute); }
.size.on { background:var(--blue-l); border-color:var(--blue); color:var(--blue-d); }
dialog.sheet { overflow-y:auto; }
a.btn.block { display:flex; margin-top:16px; width:100%; }

/* ---- weak internet ---- */
.netbar { position:sticky; top:calc(64px + env(safe-area-inset-top)); z-index:4; display:flex; flex-wrap:wrap; gap:8px 12px; align-items:center; padding:8px 14px; font-weight:700; background:#fffbeb; color:#92400e; border-bottom:1px solid #fcd34d; }
.netbar.off { background:#fef2f2; color:#b91c1c; border-color:#fecaca; }
.netbar .msg { flex:1 1 200px; }
.netbar button { min-height:44px; padding:6px 14px; border-radius:10px; border:1.5px solid currentColor; background:#fff; color:inherit; font-weight:700; }
.bar button { position:relative; }
.bar .dot { position:absolute; top:4px; left:calc(50% + 14px); min-width:20px; height:20px; padding:0 5px; border-radius:999px; background:#b91c1c; color:#fff; font-size:12px; display:flex; align-items:center; justify-content:center; }
.tick.warn { background:var(--amber-l); color:var(--amber); }
.reason { color:var(--red) !important; font-weight:600; }
.wrapbtns { flex-wrap:wrap; margin-top:10px; } .order .inl { margin-top:10px; display:grid; gap:6px; } .order .inl[hidden], .order .qtyrow[hidden] { display:none; }
.order .qtyrow { display:grid; gap:6px; } .order h3.sub { margin:10px 0 2px; font-size:14px; } button.danger { background:#dc2626; border-color:#dc2626; color:#fff; }
.chk { display:flex; align-items:center; gap:8px; min-height:44px; } .chk input { width:24px; height:24px; }
