[hidden] { display: none !important; }
/* Urdu Nastaliq font bundled with the app (works offline, on every phone). Only used for Urdu letters. */
@font-face { font-family: "Noto Nastaliq Urdu"; font-weight: 400; font-display: swap; src: url(fonts/noto-nastaliq-urdu-arabic-400-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Noto Nastaliq Urdu"; font-weight: 700; font-display: swap; src: url(fonts/noto-nastaliq-urdu-arabic-700-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --ink: #16202e;
  --muted: #637083;
  --line: #e2e7ef;
  --brand: #0f5c8c;
  --brand-2: #0b4a72;
  --brand-soft: #e6f0f7;
  --ok: #117a4b;
  --ok-soft: #e3f4ec;
  --warn: #a15c00;
  --warn-soft: #fdf1df;
  --bad: #b3261e;
  --bad-soft: #fce8e6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 32, 46, .06), 0 4px 14px rgba(16, 32, 46, .05);
  --nav-w: 220px;
  --input-bg: #ffffff;
  --hover: #f8fafc;
  --nav-bg: #0e2233;
  --cell: #e8eff6;
  --cell-low: #ffe2c6; --cell-low-ink: #8a4300;
  --cell-zero: #f8dcdc; --cell-zero-ink: #9c1c1c;
  --xbox: #fff5e8; --xbox-line: #f3c98f;
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-size: 15px; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidenav {
  width: var(--nav-w); background: var(--nav-bg); color: #cfd9e3; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand b { display: block; color: #fff; font-size: 16px; }
.brand small { color: #8ea3b6; }
.sidenav nav { padding: 8px; flex: 1; overflow-y: auto; }
.navlink {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px;
  color: #cfd9e3; text-decoration: none; margin-bottom: 2px;
}
.navlink svg { width: 19px; height: 19px; flex-shrink: 0; }
.navlink:hover { background: rgba(255,255,255,.06); }
.navlink.active { background: var(--brand); color: #fff; }
.netstate { padding: 12px 16px; font-size: 12.5px; border-top: 1px solid rgba(255,255,255,.08); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #3ecf8e; }
.dot.off { background: #f0a020; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 14px 22px; background: var(--card);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.topbar h1 { flex: 1; }
.content { padding: 20px 22px 90px; max-width: 1300px; width: 100%; }
.bottomnav { display: none; }

.banner { margin: 14px 22px 0; padding: 10px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; background: var(--brand-soft); color: var(--brand); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
@media (max-width: 820px) { .banner { margin: 12px 16px 0; } }

/* ---------- Components ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.stat .lbl { color: var(--muted); font-size: 13px; }
.stat .val { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat.bad .val { color: var(--bad); }
.stat.ok .val { color: var(--ok); }
.stat.warn .val { color: var(--warn); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line);
  background: var(--card); padding: 9px 14px; border-radius: 9px; cursor: pointer; font-weight: 600;
  min-height: 40px; text-decoration: none; color: var(--ink); white-space: nowrap;
}
.btn:hover { border-color: #c8d1dd; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.bad { color: var(--bad); }
.btn.wa { background: #1fa855; border-color: #1fa855; color: #fff; }
.btn.sm { min-height: 32px; padding: 5px 10px; font-size: 13.5px; }
.btn.lg { min-height: 50px; font-size: 16px; padding: 12px 20px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

label.f { display: block; margin-bottom: 10px; }
label.f > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: var(--input-bg); min-height: 40px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
textarea { min-height: 70px; resize: vertical; }
input[type=checkbox] { width: auto; min-height: 0; }

.seg { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; color: var(--muted); min-height: 38px; }
.seg button.on { background: var(--card); color: var(--brand); box-shadow: var(--shadow); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--hover); }
.tablewrap { overflow-x: auto; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.b-cash { background: var(--ok-soft); color: var(--ok); }
.b-credit { background: var(--warn-soft); color: var(--warn); }
.b-installment { background: var(--brand-soft); color: var(--brand); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-muted { background: var(--bg); color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.big { font-size: 20px; font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* ---------- POS screen ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.prodgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.prod {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 4px; min-height: 92px;
}
.prod:hover { border-color: var(--brand); }
.prod b { font-size: 14px; line-height: 1.25; }
.prod .p { color: var(--brand); font-weight: 700; margin-top: auto; }
.prod .s { font-size: 12px; color: var(--muted); }
.prod.out { opacity: .55; }
.cart { position: sticky; top: 80px; }
.cartline { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cartline .qty { display: flex; align-items: center; gap: 6px; }
.cartline .qty input { width: 60px; text-align: center; min-height: 32px; padding: 4px; }
.cartline .qty input.price { width: 95px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { font-size: 22px; font-weight: 800; border-top: 2px solid var(--ink); padding-top: 8px; margin-top: 4px; }
.schedule-preview { max-height: 220px; overflow-y: auto; font-size: 13.5px; }

.cartbar {
  display: none; position: fixed; left: 12px; right: 12px; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 15;
  background: var(--ok); color: #fff; border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 700; align-items: center; gap: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.2); cursor: pointer;
}
.cartbar.hide { display: none !important; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 20, 30, .45); display: flex; align-items: flex-start; justify-content: center; z-index: 50; padding: 30px 12px; overflow-y: auto; }
.modal { background: var(--card); border-radius: 14px; width: 100%; max-width: 640px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 900px; }
.modal header { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal header h2 { margin: 0; flex: 1; }
.modal .body { padding: 18px; }
.modal footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.x { border: 0; background: none; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; padding: 4px 8px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #16202e; color: #fff; padding: 11px 18px; border-radius: 10px; z-index: 100; box-shadow: var(--shadow); max-width: 90vw; }
.toast.bad { background: var(--bad); }

.photo { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.photos { display: flex; gap: 10px; flex-wrap: wrap; }
.photo-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.photo-slot label { cursor: pointer; }
.photo-slot input { display: none; }
.ph-empty { width: 84px; height: 84px; border-radius: 10px; border: 2px dashed var(--line); display: flex; align-items: center; justify-content: center; font-size: 26px; color: #b4bfcc; }

.sched td.paid { color: var(--ok); }
.sched tr.overdue td { background: var(--bad-soft); }
.sched tr.done td { color: var(--muted); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; }
.kv > :nth-child(odd) { color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-color: var(--brand); }

/* ---------- v2: login, ratings, field mode ---------- */
.login-screen { position: fixed; inset: 0; z-index: 200; background: linear-gradient(160deg, #0e2233, #0f5c8c); display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.login-box { background: var(--card); border-radius: 18px; padding: 24px 20px; width: 100%; max-width: 360px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-box h1 { font-size: 20px; margin: 10px 0 2px; }
.login-users { display: grid; gap: 8px; margin-top: 14px; }
.login-users .btn { flex-direction: column; gap: 0; }
.login-users small { font-weight: 400; color: var(--muted); font-size: 12px; }
.pin-input { text-align: center; font-size: 26px; letter-spacing: 10px; margin-bottom: 12px; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pinpad .btn { font-size: 20px; min-height: 56px; }
.shake { animation: shake .35s; border-color: var(--bad) !important; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.rt-good { background: var(--ok-soft); color: var(--ok); }
.rt-average { background: var(--brand-soft); color: var(--brand); }
.rt-late { background: var(--warn-soft); color: var(--warn); }
.rt-defaulter, .rt-blacklist { background: var(--bad); color: #fff; }
.rt-new { background: var(--bg); color: var(--muted); }
.mono { font-family: ui-monospace, Consolas, "Courier New", monospace; }
.scope-sel { width: auto; min-height: 38px; font-weight: 600; }
.route-card { padding: 14px; margin-bottom: 10px; }
.bar { height: 10px; border-radius: 5px; background: var(--ok); min-width: 2px; }
.bar.neg { background: var(--bad); }
tr.done td { color: var(--muted); }
.user-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.user-chip svg { width: 16px; height: 16px; }
[dir=rtl], .ur { font-family: "Jameel Noori Nastaleeq", "Noto Nastaliq Urdu", "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif; }
textarea[dir=rtl], input[dir=rtl] { font-size: 16px; line-height: 1.8; }

/* ---------- Print ---------- */
#print { display: none; }
@media print {
  body * { visibility: hidden; }
  #print, #print * { visibility: visible; }
  #print { display: block; position: absolute; left: 0; top: 0; width: 100%; color: #000; background: #fff; }
  @page { margin: 8mm; }
}
.rcpt { width: 72mm; font-family: "Courier New", monospace; font-size: 12px; margin: 0 auto; }
.rcpt h3 { text-align: center; margin: 0; font-size: 15px; }
.rcpt .c { text-align: center; }
.rcpt table td, .rcpt table th { padding: 2px 0; border: 0; font-size: 12px; text-transform: none; color: #000; }
.rcpt hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
.rcpt .lr { display: flex; justify-content: space-between; gap: 8px; }
.rcpt .b { font-weight: 700; }
.rcpt .big { font-size: 14px; }
.rcpt .sm { font-size: 10.5px; }
.rcpt.ur { font-size: 13px; line-height: 1.8; }
.rcpt img { image-rendering: pixelated; }
.a4 { font-size: 13px; color: #000; max-width: 190mm; margin: 0 auto; }
.a4 h2 { text-align: center; font-size: 18px; }
.a4 table td, .a4 table th { border: 1px solid #999; padding: 4px 6px; color: #000; }
.a4 .sig { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 60px; text-align: center; }
.a4 .sig div { border-top: 1px solid #000; padding-top: 4px; }
.a4 .ph { display: flex; gap: 10px; }
.a4 .ph img { width: 90px; height: 90px; object-fit: cover; border: 1px solid #999; }

/* ---------- Responsive (phones & tablets) ---------- */
@media (max-width: 1100px) {
  .pos { grid-template-columns: minmax(0, 1fr); }
  .cart { position: static; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .sidenav { display: none; }
  .topbar { padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); }
  .topbar h1 { font-size: 18px; }
  .content { padding: 14px 16px 100px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .cartbar { display: flex; }
  .bottomnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--line);
    z-index: 20; padding-bottom: env(safe-area-inset-bottom);
  }
  .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; font-size: 11px; color: var(--muted); text-decoration: none; }
  .bottomnav a svg { width: 22px; height: 22px; }
  .bottomnav a.active { color: var(--brand); }
  .kv { grid-template-columns: 110px 1fr; }
  .hide-m { display: none; }
  .prodgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-bg { padding: 0; }
  .modal { border-radius: 0; min-height: 100vh; }
}

/* ---------- keyboard use (desktop) ---------- */
.kfocus td, .kfocus.cartline { background: var(--brand-soft) !important; }
.kfocus { outline: 2px solid var(--brand); outline-offset: -2px; }
.prod:focus-visible, .btn:focus-visible, .navlink:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
kbd { display: inline-block; min-width: 22px; text-align: center; font: 600 12px/1.6 ui-monospace, Consolas, monospace; padding: 0 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: #f7f9fb; color: #1d2b36; }
.kbd-table { width: 100%; }
.kbd-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kbd-table td:first-child { white-space: nowrap; width: 1%; padding-right: 14px; }
.kbd-btn { margin-left: 8px; }
@media (min-width: 821px) and (hover: hover) {
  body.kbd-hints [data-kbd]::after { content: attr(data-kbd); display: inline-block; margin-left: 7px; font-size: 10.5px; line-height: 1.5; padding: 0 5px; border: 1px solid currentColor; border-radius: 4px; opacity: .6; font-weight: 600; letter-spacing: .02em; vertical-align: middle; white-space: nowrap; }
  body.kbd-hints .navlink[data-kbd]::after { margin-left: auto; opacity: .4; }
}
@media (max-width: 820px) { .kbd-btn { display: none; } }

/* shortcuts page */
.kbd-edit { width: 100%; }
.kbd-edit td { padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.kbd-edit .kl { font-size: 13.5px; }
.kbd-edit .kk { white-space: nowrap; text-align: right; }
.kbd-edit .ko { width: 1%; }
.kbd-off td, tr.kbd-off .kl { color: var(--muted); }
.kbd-off kbd { opacity: .45; }
.kchip { display: inline-flex; align-items: center; margin-left: 4px; border-radius: 6px; }
.kchip .kbtn { border: 0; background: none; padding: 2px; cursor: pointer; border-radius: 6px; }
.kchip .kbtn:hover kbd, .kchip .kbtn:focus-visible kbd { border-color: var(--brand); background: var(--brand-soft); }
.kchip .kx { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 3px; }
.kchip .kx:hover { color: var(--bad); }
.kadd { margin-left: 6px; min-height: 28px !important; padding: 2px 8px !important; font-size: 12px !important; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #c5d0d9; border-radius: 22px; transition: .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--ok, #15885a); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.switch input:disabled + span { opacity: .5; cursor: default; }
.cap-key { margin: 14px 0; padding: 22px; text-align: center; border: 2px dashed var(--line); border-radius: 12px; font-size: 18px; color: var(--muted); }
.cap-key kbd { font-size: 20px; padding: 2px 10px; }
.cap-key.bad { border-color: var(--bad); }

/* login screen */
.modal-bg { z-index: 250; }
.login-box.wide { max-width: 640px; }
.login-users { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.login-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; font: inherit; color: inherit; }
.login-tile:hover, .login-tile.kf, .login-tile:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }
.login-tile b { font-size: 15px; margin-top: 4px; }
.login-tile small { color: var(--muted); font-size: 12px; }
.login-tile .lt-last { font-size: 11px; }
.login-tile .lt-n { position: absolute; top: 7px; left: 9px; font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; object-fit: cover; color: #fff; font-weight: 700; flex: 0 0 auto; }
.login-sel { display: flex; align-items: center; gap: 12px; justify-content: center; margin: 10px 0 14px; text-align: left; }
.login-sel b { font-size: 17px; }

/* products page form */
.prodform { gap: 0 14px; }
.prodform .chk { display: flex; gap: 8px; align-items: center; margin-top: 24px; }
.prodform .chk input { width: auto; min-height: 0; }
.pf-btns { gap: 10px; margin-top: 6px; }
.pf-btns .btn { min-width: 96px; }
.pf-btns .btn:disabled { opacity: .45; cursor: not-allowed; }
#prodForm.editing { box-shadow: 0 0 0 2px var(--brand) inset; }
tr.sel td { background: var(--brand-soft) !important; font-weight: 600; }
tr.flash td { animation: pflash 1.6s ease-out; }
@keyframes pflash { from { background: #d7f5e6; } to { background: transparent; } }
@media (max-width: 820px) { .prodform { grid-template-columns: 1fr 1fr; } .prodform label[style*="span 2"] { grid-column: 1 / -1 !important; } }

/* Preferences (feature switches) */
.feat-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.feat-row input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--brand); }
.feat-row > span { display: flex; flex-direction: column; gap: 2px; }
#prefCard { align-items: center; gap: 12px; }

/* IMEI stock report */
.stockrep tr.grp td, .stock-a4 tr.grp td { background: var(--brand-soft, #eaf3fa); }
.stock-a4 tr.grp td { background: #eee; }
.stock-a4 table { border-collapse: collapse; font-size: 12px; }
.stock-a4 thead { display: table-header-group; }
.stock-a4 tbody { page-break-inside: auto; }
.stockrep td.late { color: var(--bad); font-weight: 700; }
.print-preview { background: #fff; color: #000; padding: 14px; border: 1px solid var(--line); border-radius: 8px; max-height: 70vh; overflow: auto; }

/* Global search */
.gs-btn { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; min-width: 170px; justify-content: flex-start; color: var(--muted); }
.gs-btn svg { width: 16px; height: 16px; }
@media (max-width: 820px) { .gs-btn { min-width: 0; } .gs-btn span { display: none; } }
.gs-res { margin-top: 10px; max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.gs-row { display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid transparent; background: transparent; padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; color: inherit; }
.gs-row:hover, .gs-row.on { background: var(--brand-soft, #eaf3fa); border-color: var(--brand); }
.gs-row .badge { flex: none; min-width: 120px; text-align: center; }
.gs-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gs-t .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tradein-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px dashed var(--line); color: var(--ok, #15885a); }

/* Dashboard "Today" panel */
.today-card { border-left: 4px solid var(--brand); }
.today-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.today-tile { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 10px; background: var(--bg); color: var(--ink); text-decoration: none; border: 1px solid var(--line); }
.today-tile:hover { border-color: var(--brand); }
.today-tile svg { width: 22px; height: 22px; flex: none; color: var(--brand); margin-top: 2px; }
.today-tile > span { display: flex; flex-direction: column; gap: 2px; }
.today-tile .lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.today-tile b { font-size: 22px; line-height: 1.1; }
.today-tile.warn svg, .today-tile.warn b { color: var(--bad); }
.today-lists { margin-top: 12px; }
.today-lists h3 { margin: 4px 0 6px; font-size: 14px; }
.today-row { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.today-row:hover { background: var(--bg); }
@media (max-width: 820px) {
  .today-tiles { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .today-tile { padding: 10px; gap: 6px; flex-direction: column; }
  .today-tile b { font-size: 19px; }
  .gs-btn svg { width: 18px; height: 18px; }
  .gs-row .badge { min-width: 0; }
}

/* New Sale: product suggestions while typing */
.ac-wrap { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow, 0 8px 24px rgba(0,0,0,.15)); max-height: 360px; overflow-y: auto; padding: 4px; }
.ac-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.ac-row > span { display: flex; flex-direction: column; min-width: 0; }
.ac-row.on, .ac-row:hover { background: var(--brand-soft, #eaf3fa); }
.ac-row.out b:first-child { color: var(--muted); }
.ac-row .ac-p { white-space: nowrap; }
.ac-empty { padding: 10px; color: var(--muted); }

/* License / demo */
.banner.info { background: var(--brand-soft, #eaf3fa); color: var(--brand); }
.banner a { color: inherit; font-weight: 800; }
.lic-ok { color: var(--ok, #15885a); }
.lic-bad { color: var(--bad); }
.inst-btn { margin-right: 8px; white-space: nowrap; }
.inst-steps { padding-left: 20px; line-height: 1.8; }
@media (max-width: 820px) { .inst-btn { padding: 6px 10px; font-size: 13px; } }
@media (max-width: 820px) { .inst-btn span { display: none; } .inst-btn { margin-right: 4px; } }

/* Left menu: minimize to an icon strip */
.sidenav { transition: width .18s ease; }
.brand { display: flex; align-items: flex-start; gap: 8px; }
.brand-t { flex: 1; min-width: 0; }
.nav-toggle { flex: none; width: 30px; height: 30px; border-radius: 8px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); color: #cfd9e3; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.nav-toggle:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-toggle svg { width: 16px; height: 16px; transition: transform .18s; }
body.nav-min { --nav-w: 64px; }
body.nav-min .brand { padding: 14px 0 12px; justify-content: center; }
body.nav-min .brand-t { display: none; }
body.nav-min .nav-toggle svg { transform: rotate(180deg); }
body.nav-min .sidenav nav { padding: 8px 6px; }
body.nav-min .navlink { justify-content: center; padding: 11px 0; }
body.nav-min .navlink span { display: none; }
body.nav-min.kbd-hints .navlink[data-kbd]::after { display: none; }
body.nav-min .netstate { padding: 12px 0; text-align: center; }
body.nav-min .netstate > :not(.dot) { display: none; }
body.nav-min .netstate .dot { margin: 0; }

/* Shop name bar across the top of the window (always visible, also when the menu is minimized) */
:root { --bar-h: 56px; }
.shopbar { position: sticky; top: 0; z-index: 30; height: var(--bar-h); display: flex; align-items: center; gap: 12px; padding: 0 18px 0 14px;
  background: linear-gradient(90deg, #0a1a28, #0e2233 60%, #103049); color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.shopbar .nav-toggle { width: 36px; height: 36px; }
.shopbar-logo { width: 32px; height: 32px; border-radius: 8px; flex: none; }
.shopbar-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.shopbar-t b { font-size: 17px; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shopbar-t small { font-size: 12px; color: #8ea3b6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app { min-height: calc(100vh - var(--bar-h)); }
.sidenav { top: var(--bar-h); height: calc(100vh - var(--bar-h)); }
.topbar { top: var(--bar-h); }
@media (max-width: 820px) {
  :root { --bar-h: 48px; }
  .shopbar { height: auto; min-height: var(--bar-h); padding: env(safe-area-inset-top) 16px 0; }
  .shopbar .nav-toggle { display: none; }
  .shopbar-logo { width: 28px; height: 28px; }
  .shopbar-t b { font-size: 15px; }
  .topbar { top: calc(var(--bar-h) + env(safe-area-inset-top)); padding-top: 12px; }
}

/* ---------- Shoes & Garments: size x colour grid, colour chips, labels ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 6px 13px; font-weight: 600; font-size: 13px; cursor: pointer; min-height: 34px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.mx-wrap { max-width: 100%; }
table.mx { width: auto; min-width: 100%; border-collapse: separate; border-spacing: 4px; }
table.mx th, table.mx td { border: 0; padding: 2px; text-align: center; }
table.mx th { font-size: 14px; color: var(--ink); text-transform: none; letter-spacing: 0; }
table.mx th.mx-c { text-align: left; padding-right: 10px; white-space: nowrap; color: var(--muted); font-weight: 600; }
table.mx tbody th.mx-c { color: var(--ink); }
table.mx .mx-t { font-weight: 700; color: var(--muted); min-width: 44px; }
table.mx .mx-na { color: var(--line); }
.mx-cell { display: block; min-width: 46px; padding: 9px 4px; border-radius: 8px; background: var(--cell); font-weight: 700; font-variant-numeric: tabular-nums; border: 0; font-size: 15px; color: var(--ink); }
button.mx-cell { cursor: pointer; width: 100%; min-height: 44px; }
button.mx-cell:hover { outline: 2px solid var(--brand); }
.mx-cell.low { background: var(--cell-low); color: var(--cell-low-ink); }
.mx-cell.zero { background: var(--cell-zero); color: var(--cell-zero-ink); }
.mx-in { width: 58px; text-align: center; padding: 8px 4px; font-weight: 700; font-size: 15px; }
.lbl-preview { border: 1px dashed var(--line); border-radius: 10px; padding: 12px; display: flex; justify-content: center; background: #fff; margin: 8px 0; color: #000; }
.lbl-sheet { display: grid; }
.blabel { box-sizing: border-box; padding: 1.2mm 1.5mm; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: space-between; font-family: Arial, sans-serif; color: #000; background: #fff; text-align: center; page-break-inside: avoid; break-inside: avoid; }
.lbl-preview .blabel { outline: 1px solid #ccc; }
.lbl-shop { font-size: 7pt; font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; max-width: 100%; }
.lbl-name { font-size: 7pt; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lbl-var { font-size: 8pt; line-height: 1.1; }
.lbl-var b { font-size: 10pt; }
.lbl-bc { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.lbl-bc svg { width: 100%; height: 100%; display: block; }
.lbl-price { font-size: 10pt; font-weight: 800; line-height: 1.1; }
@media print {
  #print.labels { width: auto; }
  #print.labels .blabel { page-break-after: auto; }
}
table.mx th.mx-c { position: sticky; left: 0; background: var(--card); z-index: 1; }
@media (max-width: 600px) {
  .mx-in { width: 46px; padding: 8px 2px; }
  .mx-cell { min-width: 40px; }
  table.mx { border-spacing: 3px; }
  table.mx th.mx-c { padding-right: 4px; font-size: 13px; }
}
.lbl-bc { padding: 0 2mm; box-sizing: border-box; }
.lbl-code { font-family: "Courier New", monospace; font-size: 7pt; line-height: 1; letter-spacing: .5px; }
.lbl-bc svg { max-height: 16mm; }
.xbox { background: var(--xbox); border: 1px solid var(--xbox-line); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; }
.a4inv { font-family: Arial, sans-serif; color: #000; font-size: 12px; }
.a4inv h2 { font-size: 18px; }
.a4inv hr { border: 0; border-top: 1px solid #000; margin: 8px 0; }
table.a4t { width: 100%; border-collapse: collapse; margin-top: 10px; }
table.a4t th, table.a4t td { border: 1px solid #999; padding: 5px 6px; font-size: 12px; color: #000; text-transform: none; letter-spacing: 0; }
table.a4t th { background: #eee; font-weight: 700; }
.bar { height: 10px; background: var(--brand); border-radius: 5px; min-width: 2px; }
.bar-wrap { background: var(--bg); border-radius: 5px; width: 100%; min-width: 60px; }

/* ---------- Sale screen: touch mode ---------- */
.catbar { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 4px; }
.catbar button { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 84px; padding: 6px 8px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink); }
.catbar button.on { border-color: var(--brand); background: var(--brand-soft, #e8f0f7); color: var(--brand); }
.catbar img, .catbar .ci { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.catbar .ci { display: flex; align-items: center; justify-content: center; background: var(--bg); font-size: 22px; font-weight: 800; color: var(--muted); }
.touchgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.touchgrid .prod { padding: 8px; min-height: 0; }
.touchgrid .prod b { font-size: 14px; }
.touchgrid .prod .p { font-size: 16px; }
.pimg { display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: 9px; background: var(--bg) center / 42% no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8c2cf' stroke-width='1.5'%3E%3Cpath d='M20.6 13.4l-7.2 7.2a2 2 0 0 1-2.8 0L3 13V3h10l7.6 7.6a2 2 0 0 1 0 2.8z'/%3E%3Ccircle cx='7.5' cy='7.5' r='1.5'/%3E%3C/svg%3E"); overflow: hidden; margin-bottom: 6px; }
.pimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pos.touch .cartline .qty .btn.sm { min-width: 40px; min-height: 40px; font-size: 18px; }
.pos.touch #checkout { min-height: 58px; font-size: 18px; }

/* ---------- Sale screen: desktop billing ---------- */
.pos.desk { grid-template-columns: minmax(0, 1fr) 380px; }
.desk-left { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.desk-left .card { margin: 0; }
.desk-entry { padding: 12px; }
.desk-entry #search { font-size: 18px; min-height: 50px; }
.desk-bill { padding: 0; overflow: hidden; }
.desk-bill .tablewrap { max-height: calc(100vh - 330px); min-height: 260px; overflow: auto; }
table.billt th { position: sticky; top: 0; background: var(--card); z-index: 1; }
table.billt td { padding: 6px 8px; }
table.billt tr.last td { background: var(--brand-soft, #eef4fa); }
table.billt input { min-height: 34px; padding: 4px 6px; text-align: right; }
table.billt input.price { width: 90px; }
table.billt input.dpct { width: 64px; }
.qtycell { display: inline-flex; align-items: center; gap: 4px; }
.qtycell input { width: 56px; text-align: center !important; }
.bthumb { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; flex: none; }
.billfoot { display: flex; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); gap: 12px; }
@media (max-width: 1100px) { .pos.desk { grid-template-columns: 1fr; } .desk-bill .tablewrap { max-height: none; } }
.colph { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; vertical-align: middle; margin-right: 6px; }
@media (max-width: 820px) {
  body.pos-full #topActions .btn { padding: 6px 10px; font-size: 13px; min-height: 36px; }
  body.pos-full #modeBtn span, body.pos-full #xchg span, body.pos-full #fullBtn { display: none; }
  .catbar button { min-width: 70px; }
  .catbar img, .catbar .ci { width: 42px; height: 42px; }
  .touchgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

/* ---------- Themes: shop colour (shared) + light / dark (per device) ---------- */
html[data-brand="maroon"] { --brand: #8a1c3a; --brand-2: #6e1530; --brand-soft: #f7e6ec; --nav-bg: #2a0d17; }
html[data-brand="green"] { --brand: #19734a; --brand-2: #135c3b; --brand-soft: #e3f3ea; --nav-bg: #0c2419; }
html[data-brand="black"] { --brand: #2b2f36; --brand-2: #16181c; --brand-soft: #eceef1; --nav-bg: #111317; }
html[data-brand="purple"] { --brand: #5b3aa6; --brand-2: #472d85; --brand-soft: #eee8f8; --nav-bg: #1b1233; }
html[data-brand="orange"] { --brand: #c2530f; --brand-2: #9c420b; --brand-soft: #fcebe0; --nav-bg: #2a1407; }
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e151d; --card: #16202b; --ink: #e5ecf4; --muted: #95a5b7; --line: #283645;
  --brand-soft: #1a3144; --ok-soft: #12301f; --warn-soft: #3a2a12; --bad-soft: #3a1717;
  --input-bg: #0f1822; --hover: #1c2a38; --nav-bg: #0a1017;
  --cell: #1f3043; --cell-low: #4a3118; --cell-low-ink: #ffc58c; --cell-zero: #4a1c22; --cell-zero-ink: #ff9ea8;
  --xbox: #3a2a12; --xbox-line: #6b4a1a;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
}
html[data-theme="dark"][data-brand="black"] { --brand: #8fa3b8; --brand-2: #b5c4d3; }
html[data-theme="dark"] a { color: #7cc0ec; }
html[data-theme="dark"] .btn.primary, html[data-theme="dark"] .navlink.active { color: #fff; }
html[data-theme="dark"] .pimg { background-color: #1f2b38; }
html[data-theme="dark"] .toast { background: #e5ecf4; color: #0e151d; }
html[data-theme="dark"] table.billt tr.last td { background: var(--brand-soft); }
html[data-theme="dark"] .banner { background: var(--brand-soft); color: var(--ink); }
.theme-btn { margin-left: auto; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #fff; border-radius: 9px; min-width: 38px; height: 36px; cursor: pointer; font-size: 16px; }
.theme-btn:hover { background: rgba(255,255,255,.16); }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.swatch.on { border-color: var(--ink); }
.scanbox { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; max-height: 60vh; }
.scanbox video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanline { position: absolute; left: 10%; right: 10%; top: 50%; height: 2px; background: #ff3b3b; box-shadow: 0 0 8px #ff3b3b; animation: scanl 1.6s ease-in-out infinite alternate; }
@keyframes scanl { from { top: 30%; } to { top: 70%; } }
.scan-btn { flex: none; min-width: 46px; font-size: 18px; padding: 0 10px; }
.ac-wrap:has(.scan-btn) { display: flex; gap: 6px; }
/* Urdu screens: Nastaliq needs more line height; keep numbers in the normal font */
body.ui-ur { font-family: "Noto Nastaliq Urdu", system-ui, "Segoe UI", sans-serif; }
body.ui-ur .navlink span, body.ui-ur .btn, body.ui-ur h1, body.ui-ur h2, body.ui-ur h3, body.ui-ur th, body.ui-ur label > span, body.ui-ur .seg button, body.ui-ur .tabs button { line-height: 1.9; }
body.ui-ur .btn { padding-top: 2px; padding-bottom: 2px; }
body.ui-ur th { text-transform: none; letter-spacing: 0; font-size: 13px; }
body.ui-ur input, body.ui-ur .mono, body.ui-ur td.n, body.ui-ur .n { font-family: system-ui, "Segoe UI", sans-serif; }
/* ---------- dashboard charts ---------- */
.dash-kpi { margin-bottom: 16px; }
.dash-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; }
.dash-grid .card { margin: 0; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }
.chart { position: relative; }
.chart svg { max-width: 100%; height: auto; display: block; overflow: visible; }
.chart .cg { stroke: var(--line); stroke-width: 1; }
.chart .cx { stroke: var(--muted); stroke-width: 1; opacity: .6; }
.chart .ct { fill: var(--muted); font-size: 11px; }
.chart .cb path { fill: var(--brand); transition: opacity .12s; }
.chart svg.hov .cb:not(.on) path { opacity: .35; }
.ctip { position: absolute; top: -6px; width: 140px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 8px; padding: 6px 10px; font-size: 13px; pointer-events: none; display: flex; flex-direction: column; }
.ctip span { color: var(--muted); font-size: 12px; }
.dl { font-weight: 700; font-size: 13px; }
.dl.up { color: var(--ok); } .dl.down { color: var(--bad); }
table.hbars td { border: 0; padding: 5px 4px; font-size: 14px; }
table.hbars td.hb { width: 55%; }
table.hbars .bar { height: 12px; background: var(--brand); border-radius: 0 4px 4px 0; }
.topgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.topitem { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; }
.topitem:hover { border-color: var(--brand); }
.topitem img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.topitem > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.topitem b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topn { font-weight: 800; color: var(--muted); width: 16px; text-align: center; }
.loybox { background: var(--brand-soft); border-radius: 10px; padding: 6px 10px; margin-bottom: 8px; font-size: 13.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.badge.tier { background: #f5d77a; color: #5a4300; }
.topitem b { color: var(--ink); }
html[data-theme="dark"] .seg button.on { color: #8fd0ff; }
html[data-theme="dark"] .badge { filter: brightness(1.25); }
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-item { text-align: left; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.menu-item:hover { border-color: var(--brand); }
.stars { color: #e0a100; letter-spacing: 2px; }
.stars.big { font-size: 22px; }
#fbS button { font-size: 34px; background: none; border: 0; color: var(--line); cursor: pointer; }
#fbS button.on { color: #e0a100; }
.att-list { display: flex; flex-direction: column; gap: 8px; }
.att-row { display: grid; grid-template-columns: minmax(140px, 1fr) auto auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
@media (max-width: 700px) { .att-row { grid-template-columns: 1fr; } }
table.attm td, table.attm th { padding: 4px 3px; text-align: center; font-size: 12px; }
table.attm td:first-child { text-align: left; white-space: nowrap; }
.att-P { background: var(--ok-soft); color: var(--ok); font-weight: 700; } .att-A { background: var(--bad-soft); color: var(--bad); font-weight: 700; }
.att-H { background: var(--warn-soft); color: var(--warn); font-weight: 700; } .att-L { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
table.pl td { padding: 8px 6px; } table.pl tr.sub td { border-top: 2px solid var(--line); font-weight: 700; } table.pl tr.tot td { border-top: 3px double var(--ink); font-size: 17px; } table.pl tr.tot.neg td { color: var(--bad); }
@media print { .noprint { display: none !important; } }

/* v1.7 Arabic screen language (right-to-left) and Arabic receipts */
html[lang=ar], html[lang=ar] [dir=rtl], .rcpt.ar, .a4.ar { font-family: Tahoma, "Segoe UI", "Noto Naskh Arabic", "Noto Sans Arabic", sans-serif; }
.rcpt.ar { font-size: 13px; line-height: 1.6; }
body.ui-ar th { text-transform: none; letter-spacing: 0; }
body.ui-ar input, body.ui-ar .mono, body.ui-ar td.n, body.ui-ar .n { font-family: system-ui, "Segoe UI", sans-serif; }
html[dir=rtl] .n, html[dir=rtl] td.n, html[dir=rtl] th.n { text-align: left; }
html[dir=rtl] input[type=number], html[dir=rtl] input[type=date], html[dir=rtl] .mono { direction: ltr; }
.feat-ed { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; }
#featTabs { flex-wrap: wrap; }

/* v1.8 split payment */
.pmseg { flex-wrap: wrap; } .pmseg button { flex: 1 1 30% !important; min-width: 0; }
.splitbox { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0 8px; margin-bottom: 6px; }
.splitbox #spLeft { grid-column: 1 / -1; }

/* v1.8 customer display + price-check kiosk: full screen, no menus */
body.cd-mode .shopbar, body.cd-mode .sidenav, body.cd-mode .topbar, body.cd-mode .bottomnav, body.cd-mode .lic-banner, body.cd-mode .banner,
body.kiosk-mode .shopbar, body.kiosk-mode .sidenav, body.kiosk-mode .topbar, body.kiosk-mode .bottomnav, body.kiosk-mode .banner { display: none !important; }
body.cd-mode .content, body.kiosk-mode .content { max-width: none; padding: 0; }
.cd { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.cd-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 28px; background: #141a2e; color: #fff; font-size: 22px; }
.cd-body { flex: 1; display: flex; }
.cd-idle { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; gap: 8px; }
.cd-idle img { max-width: 60vw; max-height: 55vh; border-radius: 18px; object-fit: contain; background: #fff; }
.cd-idle h1 { font-size: 46px; margin: 0; } .cd-idle h2 { font-size: 30px; margin: 6px 0 0; }
.cd-price { font-size: 44px; font-weight: 800; color: var(--brand); }
.cd-bill { flex: 1; display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; padding: 24px; }
.cd-lines { background: var(--card); border-radius: 16px; padding: 10px 18px; overflow: auto; max-height: calc(100vh - 120px); }
.cd-line { display: flex; justify-content: space-between; gap: 12px; font-size: 22px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cd-sum { background: var(--card); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 12px; font-size: 22px; }
.cd-sum > div { display: flex; justify-content: space-between; }
.cd-total { font-size: 40px; font-weight: 800; border-top: 2px solid var(--line); padding-top: 12px; }
.cd-qr { flex-direction: column; align-items: center; gap: 6px; font-size: 18px; margin-top: auto; }
.cd-qr img { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 12px; }
@media (max-width: 760px) { .cd-bill { grid-template-columns: 1fr; } }
.kiosk { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.k-head { display: flex; align-items: center; gap: 12px; padding: 16px 24px; background: #141a2e; color: #fff; font-size: 22px; }
.k-head span { flex: 1; color: #ffb47f; font-size: 18px; }
.k-scan { padding: 18px 24px; display: flex; gap: 10px; }
.k-scan input { font-size: 24px; min-height: 60px; }
.k-out { flex: 1; padding: 0 24px 24px; }
.k-wel { text-align: center; padding: 60px 20px; } .k-wel h1 { font-size: 40px; }
.k-card { display: flex; gap: 24px; align-items: center; background: var(--card); border-radius: 18px; padding: 20px; flex-wrap: wrap; }
.k-card img { width: 240px; height: 240px; object-fit: contain; background: #fff; border-radius: 14px; }
.k-card h1 { font-size: 36px; margin: 0 0 6px; }
.k-price { font-size: 52px; font-weight: 800; color: var(--brand); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.k-price s { font-size: 26px; color: var(--muted); font-weight: 500; }
.k-grid { overflow-x: auto; background: var(--card); border-radius: 14px; padding: 10px; }
.k-grid td, .k-grid th { text-align: center; font-size: 22px; padding: 10px; }
.k-grid td.ok { color: var(--ok); font-weight: 800; } .k-grid td.no { color: var(--muted); } .k-grid td.me { outline: 3px solid var(--brand); border-radius: 8px; }
.bkbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 60; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #141a2e; color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.3); max-width: calc(100vw - 32px); }
@media (max-width: 820px) { .bkbar { bottom: 80px; } }
.btn > svg { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
