:root {
  --bg: #f4f6f5; --panel: #ffffff; --ink: #1f2523; --muted: #667085; --line: #e3e7ee;
  --side: #2b2b2b; --side-ink: #cfd3d2; --accent: #006453; --accent-2: #e3f1ee; --accent-ink: #004a3d; --accent-soft: #a9d3c9;
  --hi: #0a8a72; --hi-bg: #e3f1ee; --hi-ink: #004a3d;
  --ok: #15803d; --ok-bg: #e7f6ec; --warn: #b45309; --warn-bg: #fff6e0; --bad: #b91c1c; --bad-bg: #fdecec;
  --info: #1d4ed8; --info-bg: #e8efff; --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 650; }
h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
.muted { color: var(--muted); }
.right { text-align: right; } .center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mono { font-variant-numeric: tabular-nums; }

/* layout */
.shell { display: flex; height: 100vh; }
.side { width: 210px; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; flex-shrink: 0; }
.brand { padding: 18px 18px 14px; color: #fff; font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.brand small { display: block; color: var(--side-ink); font-weight: 400; font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px; }
.nav a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; color: var(--side-ink); text-decoration: none; cursor: pointer; margin-bottom: 2px; }
.nav a:hover { background: #3a3a3a; color: #fff; }
.nav a.active { background: var(--accent); color: #fff; }
.nav svg { width: 18px; height: 18px; flex-shrink: 0; }
.side-foot { padding: 12px 14px; border-top: 1px solid #3d3d3d; font-size: 12px; }
.side-foot b { color: #fff; display: block; font-size: 13px; }
.side-foot .row { margin-top: 8px; }
.side-foot .btn { flex: 1; justify-content: center; background: #3a3a3a; border-color: #4a4a4a; color: #fff; }
.side-foot .btn:hover { background: #454545; }
.main { flex: 1; min-width: 0; overflow-y: auto; }
.page { padding: 20px 24px 40px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { flex: 1; }

/* controls */
.btn { border: 1px solid var(--line); background: #fff; padding: 7px 13px; border-radius: 8px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: #c8ccd4; background: #fafafa; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--btn-ink, #fff); }
.btn.primary:hover { background: #00574a; border-color: #00574a; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.dark { background: var(--side); color: #fff; border-color: var(--side); }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.btn.lg { padding: 12px 18px; font-size: 15px; font-weight: 600; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { border-color: transparent; background: transparent; }
input[type=text], input:not([type]), input[type=email], input[type=tel], input[type=number], input[type=password], input[type=date], input[type=search], select, textarea {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 10px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-2); }
textarea { resize: vertical; min-height: 60px; }
label.f { display: block; }
label.f > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* cards & tables */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 16px; }
.card-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.card-head h2 { flex: 1; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; position: sticky; top: 0; }
table.t td { padding: 9px 12px; border-bottom: 1px solid #f0f1f3; vertical-align: middle; }
table.t tr:hover td { background: #fcfcfd; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t tfoot td { font-weight: 700; background: #fafbfc; border-top: 1px solid var(--line); }
.t-actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #eef0f3; color: #4b5563; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 500; margin-bottom: -1px; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .l { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .v { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding: 16px 16px 0; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bars .b i { display: block; width: 100%; max-width: 46px; background: var(--accent); border-radius: 5px 5px 0 0; min-height: 2px; }
.bars .b span { font-size: 11px; color: var(--muted); }
.bars .b em { font-style: normal; font-size: 11px; font-weight: 600; }
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.filters label.f { width: 160px; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(17, 20, 28, .45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: 14px; width: 520px; max-width: 100%; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: 860px; } .modal.xwide { width: 1100px; }
.modal-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-head h2 { flex: 1; }
.modal-head .x { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
#toasts { position: fixed; left: 228px; bottom: 18px; z-index: 99; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--side); color: #fff; padding: 10px 14px; border-radius: 9px; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 380px; }
.toast.error { background: var(--bad); } .toast.ok { background: var(--ok); }

/* login */
.login { height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #2b2b2b 0%, #1f2b48 60%, #006453 160%); }
.login .card { width: 360px; padding: 28px; }
.login h1 { font-size: 24px; } .login p { margin: 4px 0 20px; }
.login label.f { margin-bottom: 12px; }

/* POS */
.pos { display: grid; grid-template-columns: 1fr 400px; height: 100vh; }
.pos-left { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); }
.pos-top { background: #fff; border-bottom: 1px solid var(--line); padding: 10px 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; background: #eef0f3; border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 500; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.cats { display: flex; gap: 6px; padding: 10px 14px; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.cats button { border: 1px solid var(--line); background: #fff; padding: 6px 13px; border-radius: 99px; cursor: pointer; white-space: nowrap; }
.cats button.on { background: var(--side); color: #fff; border-color: var(--side); }
.items-grid { flex: 1; overflow-y: auto; padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: max-content; gap: 10px; align-content: start; }
.item-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; text-align: left; border-top: 4px solid var(--c, var(--accent)); min-height: 92px; display: flex; flex-direction: column; justify-content: space-between; transition: transform .05s; }
.item-card:hover { border-color: #c8ccd4; border-top-color: var(--c, var(--accent)); }
.item-card:active { transform: scale(.98); }
.item-card .n { font-weight: 600; line-height: 1.25; }
.item-card .p { color: var(--accent); font-weight: 700; margin-top: 8px; }
.item-card .code { font-size: 11px; color: var(--muted); }
.cart { display: flex; flex-direction: column; background: #fff; min-height: 0; }
.cart-head { padding: 10px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cart-head .full { grid-column: 1 / -1; }
.pick { border: 1px dashed #c8ccd4; background: #fafbfc; border-radius: 8px; padding: 7px 10px; cursor: pointer; text-align: left; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick.set { border-style: solid; border-color: var(--accent); background: var(--accent-2); color: var(--accent-ink); font-weight: 600; }
.cart-lines { flex: 1; overflow-y: auto; }
.line { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; padding: 9px 14px; border-bottom: 1px solid #f0f1f3; align-items: center; cursor: pointer; }
.line:hover { background: #fcfcfd; }
.line .nm { font-weight: 600; }
.line .sub { font-size: 12px; color: var(--muted); }
.line .sent { font-size: 11px; color: var(--ok); font-weight: 600; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.qty button { border: 0; background: #f6f7f9; width: 28px; height: 28px; cursor: pointer; font-size: 16px; }
.qty span { min-width: 30px; text-align: center; font-weight: 600; }
.line .amt { min-width: 70px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.totals { border-top: 1px solid var(--line); padding: 10px 14px; font-variant-numeric: tabular-nums; }
.totals .r { display: flex; justify-content: space-between; padding: 2px 0; }
.totals .r.big { font-size: 20px; font-weight: 750; padding-top: 6px; margin-top: 4px; border-top: 1px dashed var(--line); }
.totals a { color: var(--accent); cursor: pointer; text-decoration: none; }
.cart-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 0 14px 14px; }
.cart-actions .pay { grid-column: 1 / -1; }
.badge-count { background: var(--accent); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 6px; font-weight: 700; }
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.tbl { border: 2px solid var(--line); border-radius: 12px; padding: 14px 8px; text-align: center; cursor: pointer; background: #fff; }
.tbl b { display: block; font-size: 17px; }
.tbl small { color: var(--muted); }
.tbl.busy { border-color: var(--accent-soft); background: var(--accent-2); }
.tbl.busy small { color: var(--accent-ink); font-weight: 600; }
.tbl:hover { border-color: var(--accent); }
.mods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mods label { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; display: flex; gap: 8px; align-items: center; cursor: pointer; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pay-total { font-size: 30px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.pay-line { display: grid; grid-template-columns: 1fr 140px; gap: 8px; align-items: center; margin-bottom: 8px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pay-sum { background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-variant-numeric: tabular-nums; }
.pay-sum .r { display: flex; justify-content: space-between; padding: 3px 0; }
.pay-sum .r.big { font-size: 18px; font-weight: 750; }

/* kitchen */
.kds { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ticket { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.ticket-head { padding: 10px 14px; background: var(--side); color: #fff; display: flex; justify-content: space-between; align-items: center; }
.ticket-head.late { background: var(--bad); }
.ticket-head b { font-size: 18px; }
.ticket-body { padding: 6px 0; flex: 1; }
.titem { padding: 8px 14px; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; border-bottom: 1px solid #f3f4f6; }
.titem .q { font-weight: 800; font-size: 16px; min-width: 28px; }
.titem.cooking { background: var(--warn-bg); }
.titem.ready { background: var(--ok-bg); text-decoration: line-through; color: var(--muted); }
.ticket-foot { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.ticket-foot .btn { flex: 1; justify-content: center; }
.split { display: grid; grid-template-columns: 230px 1fr; gap: 16px; }
.rep-list a { display: block; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.rep-list a:hover { background: #f3f4f6; }
.rep-list a.active { background: var(--accent-2); color: var(--accent-ink); font-weight: 600; }
.rep-list h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 12px 12px 4px; }
.perm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 12px; }
.sel-search { position: relative; }
.sel-list { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; max-height: 240px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.sel-list div { padding: 8px 10px; cursor: pointer; }
.sel-list div:hover, .sel-list div.hi { background: var(--accent-2); }
.item-card > div { width: 100%; }
.item-card .img { margin: -12px -12px 8px; height: 80px; background: #f3f4f6 center/cover no-repeat; border-radius: 6px 6px 0 0; }
.img-pick { display: flex; gap: 12px; align-items: center; }
.img-pick .thumb { width: 96px; height: 96px; border-radius: 10px; border: 1px dashed #c8ccd4; background: #fafbfc center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; text-align: center; }
.menu-btn { display: none; }
/* dashboard */
.hello { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.hello h1 { font-size: 22px; }
.hello .sub { color: var(--muted); }
.qa { display: flex; gap: 8px; flex-wrap: wrap; }
.kpi2 { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; position: relative; overflow: hidden; }
.kpi2 .ic { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.kpi2 .ic svg { width: 20px; height: 20px; }
.kpi2 .l { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi2 .v { font-size: 24px; font-weight: 750; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.kpi2 .d { font-size: 12px; margin-top: 4px; font-weight: 600; }
.kpi2 .d.up { color: var(--ok); } .kpi2 .d.down { color: var(--bad); } .kpi2 .d.flat { color: var(--muted); }
.kpi2.hero { background: linear-gradient(135deg, #004a3d 0%, #006453 100%); color: #fff; border-color: #004a3d; }
.kpi2.hero .l, .kpi2.hero .d.flat { color: #cdd9f7; }
.kpi2.hero .ic { background: rgba(255,255,255,.12) !important; color: #fff !important; }
.dgrid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.c12 { grid-column: span 12; } .c8 { grid-column: span 8; } .c6 { grid-column: span 6; } .c4 { grid-column: span 4; } .c3 { grid-column: span 3; }
.chart { padding: 8px 16px 14px; }
.chart svg { display: block; width: 100%; height: auto; }
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }
.legend div { display: flex; align-items: center; }
.legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.hbar { padding: 6px 16px 14px; }
.hbar .r { display: grid; grid-template-columns: 1fr 60px; gap: 2px 10px; margin-bottom: 9px; font-size: 13px; }
.hbar .r .bar { grid-column: 1 / -1; height: 7px; background: #f1f2f4; border-radius: 99px; overflow: hidden; }
.hbar .r .bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.mini-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; padding: 12px 16px 16px; }
.mini-tables div { border-radius: 9px; padding: 8px 4px; text-align: center; font-weight: 700; font-size: 13px; background: var(--ok-bg); color: var(--ok); }
.mini-tables div.busy { background: var(--accent-2); color: var(--accent-ink); }
.mini-tables div small { display: block; font-weight: 500; font-size: 10px; }
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.flow .card { padding: 16px; }
.flow h2 { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.flow .r { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed #eef0f3; font-variant-numeric: tabular-nums; }
.flow .r.t { font-weight: 750; font-size: 16px; border-bottom: 0; border-top: 2px solid var(--line); margin-top: 4px; padding-top: 8px; }
.flow .r .neg { color: var(--bad); } .flow .r .plus { color: var(--ok); }
.alertbox { border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-weight: 500; }
.alertbox.bad { background: var(--bad-bg); color: var(--bad); } .alertbox.ok { background: var(--ok-bg); color: var(--ok); } .alertbox.warn { background: var(--warn-bg); color: var(--warn); }
@media (max-width: 1250px) { .c8, .c6, .c4, .c3 { grid-column: span 12; } .flow { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .side { position: fixed; left: -230px; top: 0; bottom: 0; z-index: 40; transition: left .2s; }
  body.nav-open .side { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .menu-btn { display: block; position: fixed; left: 10px; bottom: 10px; z-index: 45; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--side); color: #fff; font-size: 20px; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
  .page { padding: 14px 14px 70px; }
  .pos { grid-template-columns: 1fr; grid-template-rows: 55vh auto; height: auto; }
  .cart { border-top: 2px solid var(--line); }
  .form-grid, .pay-grid { grid-template-columns: 1fr; }
  .items-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .split { grid-template-columns: 1fr; }
  #toasts { left: 12px; right: 12px; }
}
@media (max-width: 1250px) { .pos { grid-template-columns: 1fr 360px; } .grid2, .grid3 { grid-template-columns: 1fr; } }

/* phones & small tablets (kept last so it wins) */
@media (max-width: 820px) {
  .pos { grid-template-columns: 1fr; grid-template-rows: 58vh auto; height: auto; }
  .pos-left { border-right: 0; min-height: 0; }
  .cart { min-height: 70vh; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr) !important; }
  .modal.wide, .modal.xwide { width: 100%; }
  .modal-body { padding: 14px; }
  table.t th, table.t td { padding: 8px; }
}
.item-card .img.ph { display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 800; color: var(--c, #006453); background: color-mix(in srgb, var(--c, #006453) 14%, #fff); }

/* branded login */
.auth { height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.auth-brand { background: radial-gradient(circle at 20% 15%, #3a3a3a 0%, #2b2b2b 55%, #1f1f1f 100%); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; text-align: center; position: relative; overflow: hidden; }
.auth-brand::after { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(0,138,114,.30), transparent 65%); right: -200px; bottom: -220px; }
.auth-logo { width: 150px; height: 150px; border-radius: 32px; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 20px 50px rgba(0,0,0,.35); overflow: hidden; margin-bottom: 26px; position: relative; z-index: 1; }
.auth-logo img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.auth-logo span { font-size: 54px; font-weight: 800; color: var(--accent); }
.auth-brand h1 { font-size: 34px; letter-spacing: -.5px; position: relative; z-index: 1; }
.auth-brand .tag { color: #bfe6dc; margin: 8px 0 0; font-weight: 500; position: relative; z-index: 1; }
.auth-info { margin-top: 18px; color: #c9cdd6; display: flex; flex-direction: column; gap: 6px; font-size: 14px; position: relative; z-index: 1; }
.auth-clock { position: absolute; left: 32px; bottom: 28px; text-align: left; z-index: 1; }
.auth-clock b { display: block; font-size: 30px; font-weight: 700; }
.auth-clock span { color: #b9bfcc; font-size: 13px; }
.auth-form { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; position: relative; }
.auth-form form { width: 100%; max-width: 360px; }
.auth-form h2 { font-size: 24px; } .auth-form p { margin: 4px 0 22px; }
.auth-form label.f { margin-bottom: 14px; }
.auth-form input { padding: 11px 12px; }
.auth-dev { position: absolute; bottom: 18px; font-size: 12px; color: var(--muted); }
.dev-credit { font-size: 10.5px; color: #8b92a3; margin-top: 8px; }
@media (max-width: 820px) { .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100vh; }
  .auth-brand { padding: 28px 20px; } .auth-logo { width: 90px; height: 90px; border-radius: 22px; margin-bottom: 14px; } .auth-logo span { font-size: 34px; }
  .auth-brand h1 { font-size: 24px; } .auth-clock { display: none; } .auth-form { padding: 24px 20px 60px; } body { overflow: auto; } }

/* Urdu */
html.lang-ur body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Naskh Arabic", "Geeza Pro", "Urdu Typesetting", Tahoma, sans-serif; }
html.lang-ur .nav a span, html.lang-ur h1, html.lang-ur h2, html.lang-ur .btn, html.lang-ur .tabs a, html.lang-ur label.f > span, html.lang-ur th { font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", "Noto Naskh Arabic", "Geeza Pro", sans-serif; line-height: 1.9; }
html.lang-ur table.t th { text-transform: none; letter-spacing: 0; font-size: 12px; }
.lang-switch { position: absolute; top: 16px; right: 18px; }

/* ===================== Wastah Stationery POS additions ===================== */
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark { width: 34px; height: 34px; border-radius: 9px; background: var(--hi); display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.brand .mark svg { width: 22px; height: 22px; }
.brand .bt { min-width: 0; }
.nav .sep { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: #6f7a93; padding: 12px 10px 4px; }
.nav a .kbd { margin-left: auto; font-size: 10px; color: #7f8aa3; border: 1px solid #4a4a4a; border-radius: 4px; padding: 0 4px; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 99px; font-size: 11.5px; font-weight: 650; background: var(--ok-bg); color: var(--ok); white-space: nowrap; }
.pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.mute { background: #eef0f4; color: #667085; }
.pill.hi { background: var(--hi-bg); color: var(--hi-ink); } .pill.blue { background: var(--accent-2); color: var(--accent-ink); }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); }
.mini { font-size: 12px; color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* POS (retail) */
.pos2 { display: grid; grid-template-columns: minmax(0, 1fr) 450px; height: 100vh; }
.pos2 .left { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); }
.scanbar { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.scanbox { position: relative; flex: 1; min-width: 240px; }
.scanbox input { font-size: 16px; padding: 11px 12px 11px 40px !important; border-width: 2px !important; border-color: #cfd8ea !important; border-radius: 10px !important; }
.scanbox input:focus { border-color: var(--accent) !important; }
.scanbox svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); }
.scanbox .res { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(16,24,40,.16); max-height: 360px; overflow-y: auto; }
.scanbox .res .r { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 9px 12px; cursor: pointer; align-items: center; border-bottom: 1px solid #f2f4f7; }
.scanbox .res .r:hover, .scanbox .res .r.hi { background: var(--accent-2); }
.quickrow { display: flex; gap: 8px; padding: 10px 14px 0; overflow-x: auto; flex-shrink: 0; }
.qtile { border: 1px solid #a9d3c9; background: var(--hi-bg); border-radius: 10px; padding: 8px 12px; cursor: pointer; text-align: left; min-width: 110px; flex-shrink: 0; }
.qtile b { display: block; font-size: 13px; line-height: 1.2; } .qtile span { font-size: 12px; color: var(--hi-ink); font-weight: 700; }
.qtile:hover { border-color: var(--hi); }
.pgrid { flex: 1; overflow-y: auto; padding: 12px 14px 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); grid-auto-rows: max-content; gap: 10px; align-content: start; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; text-align: left; padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform .05s; }
.pcard:hover { border-color: #b8c4dc; box-shadow: 0 4px 14px rgba(16,24,40,.07); }
.pcard:active { transform: scale(.985); }
.pcard .im { height: 84px; background: #f2f4f8 center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800; color: var(--c, var(--accent)); border-bottom: 3px solid var(--c, var(--accent)); }
.pcard .im.ph { background: color-mix(in srgb, var(--c, #006453) 11%, #fff); }
.pcard .bd { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.pcard .n { font-weight: 650; line-height: 1.25; font-size: 13.5px; }
.pcard .v { font-size: 12px; color: var(--muted); }
.pcard .ft { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 4px; }
.pcard .pr { font-weight: 750; color: var(--accent); }
.cart2 { display: flex; flex-direction: column; background: #fff; min-height: 0; }
.cart2 .hd { padding: 10px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.cart2 .hd .full { grid-column: 1 / -1; }
.cart2 .lines { flex: 1; overflow-y: auto; min-height: 120px; }
.cl { display: grid; grid-template-columns: 1fr auto 76px; gap: 6px 10px; padding: 9px 14px; border-bottom: 1px solid #f0f2f6; align-items: center; }
.cl:hover { background: #fafbfd; }
.cl .nm { font-weight: 650; cursor: pointer; line-height: 1.25; }
.cl .sub { font-size: 12px; color: var(--muted); grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: -3px; }
.cl .amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.cl .amt s { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.cl .tag { background: var(--ok-bg); color: var(--ok); border-radius: 6px; padding: 0 6px; font-size: 11px; font-weight: 650; }
.cl .tag.b { background: var(--hi-bg); color: var(--hi-ink); }
.cl .unit { border: 1px solid var(--line); border-radius: 6px; padding: 1px 4px; font-size: 12px; width: auto; background: #fff; }
.qty input { width: 46px; border: 0 !important; text-align: center; font-weight: 700; padding: 4px 0 !important; box-shadow: none !important; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.hints { padding: 6px 14px; background: var(--hi-bg); color: var(--hi-ink); font-size: 12.5px; font-weight: 600; border-top: 1px solid #f3e2a6; }
.tier { display: inline-flex; background: #eef1f6; border-radius: 9px; padding: 3px; }
.tier button { border: 0; background: transparent; padding: 5px 10px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: 12.5px; }
.tier button.on { background: #fff; color: var(--accent-ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.tier button.on.w { background: var(--hi); color: #3d2b00; }
.cart2 .acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0 14px 14px; }
.cart2 .acts .pay { grid-column: 1 / -1; font-size: 17px; padding: 13px; justify-content: center; }
.flash { animation: flash .6s; } @keyframes flash { from { background: #e3f1ee; } to { background: transparent; } }

/* product editor */
.vt { width: 100%; border-collapse: collapse; font-size: 13px; }
.vt th { font-size: 11px; color: var(--muted); text-align: left; padding: 4px 4px; font-weight: 600; white-space: nowrap; }
.vt td { padding: 3px 3px; vertical-align: top; }
.vt input, .vt select { padding: 5px 6px !important; font-size: 13px; }
.vt .x { color: var(--bad); border: 0; background: none; cursor: pointer; font-size: 18px; line-height: 1; padding: 6px; }
.vt tr.more td { padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.box-note { background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--muted); }

/* item picker table (purchases, PO, transfers...) */
.lines-t td input { padding: 5px 7px !important; }
.lines-t td { padding: 6px 8px !important; }
.addrow { position: relative; }

/* labels */
.label-sheet { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; background: #e9ecf2; border-radius: 10px; max-height: 52vh; overflow: auto; }
.label-sheet .lbl { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); }

/* bookings */
.statusbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.statusbar button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 12px; cursor: pointer; font-weight: 600; color: var(--muted); }
.statusbar button.on { background: var(--side); color: #fff; border-color: var(--side); }
.statusbar button .n { margin-left: 4px; opacity: .7; }
.due-late { color: var(--bad); font-weight: 700; }

/* phone scanner */
.scanner-page { max-width: 520px; margin: 0 auto; padding: 16px; }
.scanner-page video { width: 100%; border-radius: 12px; background: #000; }
.big-scan-btn { width: 100%; padding: 22px; font-size: 20px; justify-content: center; border-radius: 14px; }
.scan-log div { padding: 8px 10px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.cam-wrap { position: relative; }
.cam-wrap .aim { position: absolute; left: 10%; right: 10%; top: 38%; height: 24%; border: 3px solid rgba(245,179,1,.9); border-radius: 10px; pointer-events: none; }

@media (max-width: 1250px) { .pos2 { grid-template-columns: minmax(0, 1fr) 400px; } }
@media (max-width: 820px) {
  .pos2 { grid-template-columns: 1fr; grid-template-rows: auto auto; height: auto; }
  .pos2 .left { border-right: 0; } .pgrid { max-height: 50vh; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .cart2 { border-top: 2px solid var(--line); min-height: 70vh; }
}

.auth-logo .lm svg { width: 92px; height: 92px; display: block; }
@media (max-width: 820px) { .auth-logo .lm svg { width: 56px; height: 56px; } }
.pcard { align-items: stretch; }
.pcard > div { width: 100%; }
.cats { scrollbar-width: thin; }
.cats::-webkit-scrollbar, .quickrow::-webkit-scrollbar { height: 6px; }
.cats::-webkit-scrollbar-thumb, .quickrow::-webkit-scrollbar-thumb { background: #d5dbe6; border-radius: 6px; }

.kpi2.hero .d.up, .kpi2.hero .d.down { color: #fff; }
.scanbox { min-width: 300px; }

/* Wastah branding */
.brand .mark { background: #fff; }
.brand .mark img { width: 24px; height: auto; display: block; }
.auth-logo.wide { width: 300px; height: 120px; border-radius: 24px; }
.auth-logo.wide img { padding: 18px 22px; }
.auth-logo .lm img { width: 92px; }
.auth-dev { display: flex; align-items: center; gap: 8px; }
.auth-dev .dev-logo { height: 16px; width: auto; }
@media (max-width: 820px) { .auth-logo.wide { width: 200px; height: 80px; } }

/* ================= Wastah theme (colours from the Wastah logo: green #006453, charcoal #323232) ================= */
:root {
  --bg: #f4f6f5; --ink: #1f2523; --line: #e2e7e5;
  --side: #2b2b2b; --side-ink: #cfd3d2; --accent: #006453; --accent-2: #e3f1ee; --accent-ink: #004a3d; --accent-hi: #0a8a72; --accent-soft: #a9d3c9;
  --hi: #0a8a72; --hi-bg: #e3f1ee; --hi-ink: #004a3d;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--btn-ink, #fff); }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.nav a.active { background: var(--accent); color: #fff; }
.nav a:hover { background: #3a3a3a; }
a.link { color: var(--accent); font-weight: 600; text-decoration: none; } a.link:hover { text-decoration: underline; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark { width: 36px; height: 36px; border-radius: 9px; background: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.brand .mark img { width: 25px; height: auto; display: block; }
.brand .mark svg { display: none; }
.brand .bt { min-width: 0; font-size: 15.5px; line-height: 1.2; }
.brand small { max-width: 140px; }
.demo-tag { display: inline-block; font-style: normal; font-size: 9.5px; font-weight: 800; letter-spacing: .6px; background: #f3c74a; color: #2b2b2b; border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: 2px; }
.dev-credit { color: #a3a9a7; }
/* login */
.auth-brand { background: radial-gradient(circle at 20% 15%, #0a7d67 0%, #006453 38%, #2b2b2b 100%) !important; }
.auth-brand::after { background: radial-gradient(circle, rgba(255,255,255,.12), transparent 65%) !important; }
.auth-brand .tag { color: #bfe6dc !important; }
.auth-logo.wide { width: 300px; height: 120px; border-radius: 24px; }
.auth-logo.wide img { padding: 18px 22px; width: 100%; height: 100%; object-fit: contain; }
.auth-dev { display: flex; align-items: center; gap: 8px; }
.auth-dev .dev-logo { height: 16px; width: auto; }
@media (max-width: 820px) { .auth-logo.wide { width: 200px; height: 80px; } }
.demo-ribbon { display: inline-block; background: #f3c74a; color: #2b2b2b; font-weight: 800; font-size: 11px; letter-spacing: 1px; padding: 3px 10px; border-radius: 20px; margin-bottom: 10px; }
.demo-hint { font-size: 13px; margin: 14px 0 0; text-align: center; background: var(--accent-2); color: var(--accent-ink); padding: 8px; border-radius: 8px; }
/* activation & first-run setup */
.login .act-card { width: 520px; max-width: calc(100vw - 32px); padding: 28px; max-height: calc(100vh - 32px); overflow-y: auto; }
.act-logo { height: 42px; display: block; margin: 0 0 14px; }
.act-step { display: flex; gap: 12px; margin: 14px 0; }
.act-step > span { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.act-step > div { flex: 1; min-width: 0; }
.act-card .mid { font: 600 18px/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 1px; flex: 1; min-width: 0; }
.act-contact { font-size: 13px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); }
.act-contact b { color: var(--accent-ink); }
.login { background: radial-gradient(circle at 15% 10%, #0a7d67 0%, #006453 35%, #2b2b2b 100%); }
/* demo popup */
.demo-pop { text-align: center; } .demo-pop img { height: 34px; margin: 4px 0 10px; } .demo-pop p { margin: 0 0 12px; line-height: 1.55; }
.demo-call { background: var(--accent-2); color: var(--accent-ink); border-radius: 10px; padding: 10px; font-size: 15px; }

label.f + label.f { margin-top: 10px; }
.form-grid label.f + label.f { margin-top: 0; }

/* ===== user colours (Settings → Colors) ===== */
.side { background: var(--side); color: var(--side-ink); }
.nav a { color: var(--side-ink); }
.nav a:hover { background: var(--side-hover, #3a3a3a); color: var(--side-strong, #fff); }
.nav a.active, .nav a.active:hover { background: var(--accent); color: var(--btn-ink, #fff); }
.brand, .brand .bt { color: var(--side-strong, #fff); }
.brand small, .side .sep { color: var(--side-ink); opacity: .85; }
.side-foot { border-top-color: var(--side-line, #3d3d3d); }
.side-foot b { color: var(--side-strong, #fff); }
.side-foot .btn { background: var(--side-hover, #3a3a3a); border-color: var(--side-line, #4a4a4a); color: var(--side-strong, #fff); }
.side-foot .btn:hover { filter: brightness(1.12); }
.side-light .brand .mark { box-shadow: 0 1px 4px rgba(0,0,0,.15); border: 1px solid var(--side-line); }
.side-light .dev-credit { color: var(--side-ink); opacity: .7; }
.btn.primary, .btn.primary:hover { color: var(--btn-ink, #fff); }
body { background: var(--bg); color: var(--ink); }
.theme-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-bottom: 16px; }
.theme-preset { display: flex; align-items: center; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; font: inherit; font-size: 12px; text-align: left; }
.theme-preset:hover { border-color: var(--accent); }
.theme-preset span { width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0; border: 1px solid rgba(0,0,0,.1); }
.theme-preset b { font-weight: 600; margin-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-fields { display: grid; gap: 8px; }
.theme-field { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.theme-field input[type=color] { width: 42px; height: 30px; border: 0; padding: 0; background: none; cursor: pointer; }
.theme-field span { flex: 1; } .theme-field code { font-size: 12px; color: var(--muted); }
.theme-prev { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; height: 220px; }
.tp-side { width: 44%; background: var(--side); color: var(--side-ink); padding: 12px 8px; }
.tp-brand { display: flex; align-items: center; gap: 8px; color: var(--side-strong, #fff); margin-bottom: 10px; font-size: 13px; }
.tp-brand img { width: 22px; background: #fff; border-radius: 5px; padding: 3px; }
.tp-nav { padding: 7px 9px; border-radius: 7px; font-size: 12.5px; margin-bottom: 3px; }
.tp-nav.on { background: var(--accent); color: var(--btn-ink, #fff); }
.tp-main { flex: 1; background: var(--bg); color: var(--ink); padding: 16px; }
.tp-big { font-size: 24px; font-weight: 800; color: var(--accent); margin-top: 4px; }
.act-tabs { margin: 0 0 14px; }
.act-note { background: var(--accent-2); color: var(--accent-ink); padding: 8px 10px; border-radius: 8px; font-size: 13px; margin: 0 0 12px !important; }
.act-contact code { font-size: 11.5px; }





/* ===== Wastah UI v2 (polish.css) ===== */

/* =====================================================================================================
   Wastah UI v2 — "counter & slip"
   One bold element: the bill on the POS screen is a lifted receipt slip with a perforated total stub.
   Everything else is calm: one typeface (Manrope), tabular money, quiet borders, consistent controls.
   Colours still come from Settings → Colors (CSS variables), so every theme keeps working.
   ===================================================================================================== */
@font-face { font-family: 'Manrope'; src: url('fonts/manrope.woff2') format('woff2-variations'), url('fonts/manrope.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
:root {
  --canvas: color-mix(in srgb, var(--bg) 82%, #c9d2ce);
  --surface: #ffffff;
  --paper: color-mix(in srgb, var(--accent) 4%, #f8faf9);
  --line: #e1e6e3; --line-2: #eef1ef; --muted: #69736f;
  --r-ctl: 10px; --r-card: 14px; --r-slip: 18px;
  --shadow-slip: 0 1px 0 rgba(20, 30, 26, .04), 0 10px 30px -12px rgba(20, 30, 26, .28);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
html, body, button, input, select, textarea { font-family: 'Manrope', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; }
body { font-size: 14px; letter-spacing: -.005em; -webkit-font-smoothing: antialiased; }
.num, .amt, .pr, .p, .totals, .rx-totals, .pay-total, .pay-sum, td.num, .t td.num, .stockv { font-variant-numeric: tabular-nums; }
h1 { font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
h2 { font-weight: 700; letter-spacing: -.01em; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
* { scrollbar-width: thin; scrollbar-color: #c3cbc7 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #c9d0cd; border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: #aab4b0; } ::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: none; box-shadow: var(--ring); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- controls ---------- */
.btn { border-radius: var(--r-ctl); font-weight: 600; min-height: 36px; padding: 7px 14px; border-color: var(--line); transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 4%, #fff); }
.btn.sm { min-height: 30px; padding: 4px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { min-height: 46px; font-size: 15px; }
.btn.primary { box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 6px 14px -8px color-mix(in srgb, var(--accent) 80%, #000); }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.danger:not(.solid) { color: var(--bad); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
input[type=text], input:not([type]), input[type=email], input[type=tel], input[type=number], input[type=password], input[type=date], input[type=search], select, textarea {
  border-radius: var(--r-ctl); border-color: #d9dfdc; min-height: 38px; padding: 8px 11px; transition: border-color .12s, box-shadow .12s; }
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: #c4ccc8; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: var(--ring); }
label.f > span { font-size: 12.5px; font-weight: 600; color: #4f5955; margin-bottom: 5px; }
.badge, .pill { border-radius: 99px; font-weight: 650; }

/* ---------- sidebar ---------- */
.side { width: 220px; }
.brand { padding: 18px 16px 16px; }
.brand .bt { font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.nav { padding: 2px 10px 10px; }
.nav a { padding: 8px 10px; border-radius: 9px; font-weight: 550; font-size: 13.5px; gap: 11px; margin-bottom: 1px; position: relative; }
.nav a svg { width: 18px; height: 18px; opacity: .8; }
.nav a.active svg { opacity: 1; }
.nav .sep { padding: 14px 10px 5px; font-size: 11.5px; font-weight: 650; letter-spacing: 0; text-transform: none; opacity: .6; }
.nav .kbd { margin-left: auto; font-size: 10.5px; opacity: .6; }
.side-foot { padding: 12px 14px 14px; }
.side-foot .btn { min-height: 30px; font-size: 12px; border-radius: 8px; }

/* ---------- pages, cards, tables ---------- */
.main { background: var(--bg); }
.page { padding: 24px 28px 48px; max-width: 1500px; }
.page-head { margin-bottom: 18px; }
.card { border-radius: var(--r-card); border-color: var(--line); box-shadow: 0 1px 2px rgba(20, 30, 26, .03); }
.card-pad { padding: 18px 20px; }
.t th { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 650; color: var(--muted); background: #fafbfa; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.t tbody tr:hover td { background: color-mix(in srgb, var(--accent) 3%, #fff); }
.t tfoot td { background: #fafbfa; font-weight: 750; }
.empty { padding: 36px 20px; color: var(--muted); }
.tabs { gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 9px 14px; font-weight: 600; font-size: 13.5px; border-radius: 9px 9px 0 0; color: var(--muted); }
.tabs a:hover { color: var(--ink); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.tabs a.active { color: var(--accent-ink); box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- modals & toasts ---------- */
.overlay { background: rgba(22, 30, 27, .42); backdrop-filter: blur(3px); }
.modal { border-radius: 18px; box-shadow: 0 30px 80px -20px rgba(15, 25, 20, .45); border: 0; }
.modal-head { padding: 18px 22px 10px; border-bottom: 0; }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 8px 22px 18px; }
.modal-foot { padding: 14px 22px; background: #fafbfa; border-top: 1px solid var(--line-2); border-radius: 0 0 18px 18px; }
.modal .x { width: 32px; height: 32px; border-radius: 9px; }
.modal .x:hover { background: #eef1ef; }
.overlay .modal { animation: wst-pop .16s ease-out; }
@keyframes wst-pop { from { transform: translateY(8px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
.toast { border-radius: 12px; font-weight: 600; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .35); padding: 11px 16px; }
.toast:not(.error):not(.ok) { background: #262b29; color: #fff; }

/* =====================================================================================================
   POS — counter (left) & slip (right)
   ===================================================================================================== */
.pos, .pos2, .rx-pos { background: var(--canvas); grid-template-rows: minmax(0, 1fr); }
.pos-left, .pos2 .left, .rx-left { min-height: 0; }
.pos { grid-template-columns: minmax(0, 1fr) 430px; }
.pos2 { grid-template-columns: minmax(0, 1fr) 460px; }
.rx-pos { grid-template-columns: minmax(0, 1fr) 480px; }
.pos-left, .pos2 .left, .rx-left { border-right: 0; }

/* top bar sits on the counter, not in a white strip */
.pos-top, .scanbar { background: transparent; border-bottom: 0; padding: 14px 16px 6px; gap: 8px; }
.pos-top input[type=search], .pos-top input[type=text], .scanbox input { min-height: 46px; font-size: 15.5px; background: var(--surface); border: 1px solid #d5dcd8 !important; border-radius: 12px !important; box-shadow: 0 1px 2px rgba(20, 30, 26, .05); }
.scanbox input { padding-left: 42px !important; }
.pos-top input:focus, .scanbox input:focus { border-color: var(--accent) !important; box-shadow: var(--ring), 0 1px 2px rgba(20, 30, 26, .05) !important; }
.pos-top .btn, .scanbar .btn { min-height: 46px; border-radius: 12px; background: var(--surface); padding: 7px 12px; }
.scanbar { flex-wrap: nowrap; } .scanbox { min-width: 180px; }
.seg { background: color-mix(in srgb, var(--ink) 7%, transparent); border-radius: 12px; padding: 4px; }
.seg button { padding: 8px 14px; border-radius: 9px; font-weight: 650; font-size: 13.5px; }
.seg button.on { box-shadow: 0 1px 3px rgba(20, 30, 26, .12); color: var(--accent-ink); }

/* category chips */
.cats { background: transparent; border-bottom: 0; padding: 8px 16px 10px; gap: 6px; }
.cats button, .pos2 .cats button { border: 1px solid transparent; background: color-mix(in srgb, var(--surface) 75%, transparent); padding: 7px 14px; border-radius: 99px; font-weight: 600; font-size: 13px; color: #3e4744; transition: background .12s; }
.cats button:hover { background: var(--surface); border-color: var(--line); }
.cats button.on, .pos2 .cats button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* quick items (stationery) */
.quickrow { padding: 4px 16px 4px; }
.qtile { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 7px 12px; }
.qtile span { color: var(--accent-ink); }
.qtile:hover { border-color: var(--accent); }

/* product tiles: photo inset on a white card, price as the strongest line */
.items-grid, .pgrid { padding: 6px 16px 24px; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(164px, 1fr)); }
.item-card, .pcard { background: var(--surface); border: 1px solid transparent; border-top: 1px solid transparent; border-radius: var(--r-card); padding: 8px; min-height: 0;
  box-shadow: 0 1px 2px rgba(20, 30, 26, .06); transition: border-color .12s, box-shadow .12s, transform .06s; position: relative; }
.item-card:hover, .pcard:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); border-top-color: color-mix(in srgb, var(--accent) 40%, transparent); box-shadow: 0 8px 22px -12px rgba(20, 30, 26, .35); }
.item-card:active, .pcard:active { transform: scale(.98); }
.item-card .img, .pcard .im { margin: 0 0 8px; height: 104px; border-radius: 10px; border-bottom: 0; background-color: var(--line-2); }
.item-card .img.ph, .pcard .im.ph { background: color-mix(in srgb, var(--c, var(--accent)) 12%, #fff); color: var(--c, var(--accent)); font-size: 34px; }
.item-card .code { font-size: 11px; color: var(--muted); font-weight: 600; padding: 0 4px; }
.item-card .n, .pcard .n { font-weight: 700; font-size: 13.5px; line-height: 1.3; padding: 0 4px; }
.item-card .p { margin-top: 6px; padding: 0 4px 2px; font-size: 15px; font-weight: 800; color: var(--ink); }
.pcard .bd { padding: 0 4px 2px; gap: 2px; }
.pcard .v { font-size: 12px; }
.pcard .pr { font-size: 15px; font-weight: 800; color: var(--ink); }
.pcard .ft { padding-top: 6px; }
.item-card::after, .pcard::after { content: ''; position: absolute; left: 16px; right: 16px; top: 8px; height: 3px; border-radius: 0 0 3px 3px; background: var(--c, transparent); opacity: .9; }

/* ---------- the slip ---------- */
.cart, .cart2, .rx-bill { height: calc(100vh - 24px); align-self: start; display: flex; flex-direction: column; margin: 12px 12px 12px 4px; border-radius: var(--r-slip); background: var(--surface); box-shadow: var(--shadow-slip); overflow: hidden; min-height: 0; }
.cart-head, .cart2 .hd, .rx-bill-head { padding: 14px 16px 12px; border-bottom: 1px dashed #d6ddd9; }
.cart2 .hd > :first-child, .rx-bill-head .ttl { font-size: 17px; font-weight: 800; letter-spacing: -.015em; }
.pick { border: 1px dashed #cdd5d1; background: #fafbfa; border-radius: 10px; padding: 9px 12px; font-weight: 600; color: #4a5450; }
.pick:hover { border-color: var(--accent); }
.pick.set { color: var(--accent-ink); }
.tier { background: color-mix(in srgb, var(--ink) 7%, transparent); border-radius: 10px; }
.tier button.on.w { background: var(--accent); color: var(--btn-ink, #fff); }

/* bill lines read like a receipt */
.cart-lines, .cart2 .lines, .rx-lines { background: var(--surface); flex: 1 1 auto; min-height: 60px; overflow-y: auto; }
.cart-head, .cart2 .hd, .rx-bill-head, .totals, .rx-totals, .cart-actions, .cart2 .acts, .rx-actions, .hints { flex-shrink: 0; }
.line, .cl, .rx-line { padding: 11px 16px; border-bottom: 1px solid var(--line-2); }
.line .nm, .cl .nm, .rx-line .t .nm { font-weight: 700; font-size: 14px; }
.line .amt, .cl .amt, .rx-line .t .amt { font-weight: 800; font-size: 15px; }
.qty { border: 0; background: #f1f4f2; border-radius: 99px; padding: 2px; }
.qty button { background: var(--surface); width: 28px; height: 28px; border-radius: 99px; box-shadow: 0 1px 2px rgba(20, 30, 26, .12); font-weight: 700; color: var(--ink); }
.qty button:hover { background: var(--accent); color: var(--btn-ink, #fff); }
.qty span, .qty input { min-width: 34px; font-weight: 800; background: transparent !important; }
.cart-lines:empty, .lines .empty, .cart-lines .empty { color: var(--muted); }

/* the perforated total stub — the signature element */
.totals, .rx-totals { position: relative; background: var(--paper); border-top: 0; padding: 18px 16px 8px; margin-top: 10px; }
.totals::before, .rx-totals::before { content: ''; position: absolute; left: 0; right: 0; top: -9px; height: 10px;
  background: radial-gradient(circle at 7px -2px, transparent 6px, var(--paper) 6.5px) 0 0 / 14px 10px repeat-x; }
.totals .r, .rx-totals .r { font-size: 13.5px; color: #4a5450; padding: 3px 0; }
.totals .r.big, .rx-totals .r.big { color: var(--ink); border-top: 1px dashed #c9d2ce; margin-top: 8px; padding-top: 10px; align-items: baseline; }
.totals .r.big span:first-child, .rx-totals .r.big span:first-child { font-size: 15px; font-weight: 700; color: var(--muted); }
.totals .r.big span:last-child, .rx-totals .r.big span:last-child { font-size: 32px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
.totals a, .rx-totals .r a { font-weight: 650; }
.cart-actions, .cart2 .acts, .rx-actions { background: var(--paper); padding: 6px 16px 16px; gap: 8px; }
.cart-actions .btn, .cart2 .acts .btn, .rx-actions .btn { min-height: 40px; justify-content: center; background: var(--surface); }
.cart-actions .btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.cart-actions .pay, .cart2 .acts .pay, .rx-actions .pay { min-height: 58px; font-size: 18px; font-weight: 800; border-radius: 14px; letter-spacing: -.01em;
  background: var(--accent); border-color: var(--accent); color: var(--btn-ink, #fff); box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--accent) 85%, #000); }
.cart-actions .pay:hover, .cart2 .acts .pay:hover, .rx-actions .pay:hover { background: var(--accent-ink); }
.hints { background: var(--paper); color: var(--accent-ink); border-top: 1px solid var(--line-2); }

/* payment window */
.pay-total { font-size: 38px; letter-spacing: -.03em; color: var(--ink); }
.pay-sum { background: var(--paper); border: 1px dashed #c9d2ce; border-radius: 14px; }
.pay-sum .r.big { font-size: 20px; }

/* pharmacy counter: list instead of tiles */
.rx-top { background: transparent; border-bottom: 0; padding: 14px 16px 8px; }
.rx-search input { height: 54px; border: 1px solid #d5dcd8 !important; border-radius: 14px !important; background: var(--surface) !important; box-shadow: 0 1px 2px rgba(20, 30, 26, .05); font-size: 18px; }
.rx-search input:focus { border-color: var(--accent) !important; box-shadow: var(--ring) !important; }
.rx-hints kbd { background: var(--surface); border-color: #d5dcd8; }
.rx-results { margin: 0 4px 0 16px; border-radius: var(--r-card) var(--r-card) 0 0; box-shadow: 0 1px 2px rgba(20, 30, 26, .06); }
.rx-res-head { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 650; background: #fafbfa; }
.rx-row .nm { font-weight: 700; }
.rx-row.sel { background: color-mix(in srgb, var(--accent) 8%, #fff); box-shadow: inset 3px 0 0 var(--accent); }
.rx-detail { margin: 0 4px 12px 16px; border-radius: 0 0 var(--r-card) var(--r-card); background: #fbfcfb; border: 1px solid var(--line); border-top: 1px dashed #d6ddd9; }
.rx-detail h4 { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 700; }

/* ---------- login polish ---------- */
.auth-form h2 { font-size: 28px; font-weight: 800; letter-spacing: -.025em; }
.auth-form input { min-height: 46px; border-radius: 12px; }
.auth-form .btn.primary.lg { min-height: 50px; border-radius: 12px; font-size: 15.5px; }
.auth-brand h1 { font-weight: 800; letter-spacing: -.03em; }

@media (max-width: 1420px) { .pos2 { grid-template-columns: minmax(0, 1fr) 390px; } .pos { grid-template-columns: minmax(0, 1fr) 390px; } .scanbar .btn { padding: 7px 10px; font-size: 13px; } }
@media (max-width: 1180px) { .pos { grid-template-columns: minmax(0, 1fr) 370px; } .pos2 { grid-template-columns: minmax(0, 1fr) 390px; } .rx-pos { grid-template-columns: minmax(0, 1fr) 400px; } }
table th { text-transform: none !important; letter-spacing: 0 !important; }
@media (max-height: 800px) { .item-card .img, .pcard .im { height: 88px; } .totals .r.big span:last-child, .rx-totals .r.big span:last-child { font-size: 28px; } .cart-actions .pay, .cart2 .acts .pay, .rx-actions .pay { min-height: 52px; } }

/* ===== mobile shop ===== */
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12.5px; letter-spacing: .2px; }
.pill.mute { background: #eef0f3; color: #667085; }
.pill.hi { background: var(--info-bg); color: var(--info); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.alertbox { padding: 9px 12px; border-radius: 9px; background: #f3f4f6; border: 1px solid var(--line); margin: 8px 0; font-size: 13px; }
.alertbox.bad { background: var(--bad-bg); border-color: #f5c2c2; color: var(--bad); font-weight: 600; }
.alertbox.warn { background: var(--warn-bg); border-color: #f3d48b; color: #7a4a06; }
.alertbox.ok { background: var(--ok-bg); border-color: #bfe3cb; color: #14532d; }
.alertbox a { color: inherit; text-decoration: underline; cursor: pointer; }
table.kv { width: 100%; border-collapse: collapse; }
table.kv td { padding: 5px 8px 5px 0; border-bottom: 1px solid #f0f2f4; vertical-align: top; font-size: 13px; }
table.kv td:first-child { width: 36%; white-space: nowrap; }
h3.sec { margin: 16px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--accent-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 4px 11px; font-size: 12.5px; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip:hover { border-color: var(--accent-soft); }
.imei-ok { font-style: normal; font-size: 11px; font-weight: 600; margin-left: 6px; }
.imei-ok.good { color: var(--ok); } .imei-ok.bad { color: var(--bad); }
input.bad-in { border-color: var(--bad) !important; background: var(--bad-bg); }
.ph-slot { width: 128px; display: flex; flex-direction: column; gap: 4px; }
.ph-thumb { width: 128px; height: 86px; border: 1px dashed #c8ccd4; border-radius: 8px; background: #fafbfc center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; cursor: pointer; text-align: center; position: relative; }
.ph-thumb.sm { width: 64px; height: 64px; border-style: solid; }
.ph-thumb button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; font-size: 11px; cursor: pointer; line-height: 20px; padding: 0; }
.ph-row { flex-wrap: wrap; }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.checkgrid .ck { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.checkgrid .ck.bad { border-color: #f5c2c2; background: var(--bad-bg); }
.checkgrid .ck span { font-size: 13px; }
.checkgrid .seg button { padding: 3px 8px; font-size: 12px; }
.checkgrid .seg button[data-v="ok"].on { background: var(--ok); color: #fff; }
.checkgrid .seg button[data-v="bad"].on { background: var(--bad); color: #fff; }
.act-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.act-list .btn { justify-content: flex-start; }
.tbl-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; max-height: 46vh; overflow-y: auto; }
.ptab td { padding: 3px 4px; } .ptab input, .ptab select { padding: 4px 6px; font-size: 12.5px; }
.ptab th { position: sticky; top: 0; background: #f7f8fa; z-index: 1; font-size: 11px; }
.cl.phone-line { border-left: 3px solid var(--info); }
.cl.phone-line .nm { font-weight: 650; }
.wal-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.wal { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.wal .wn { font-size: 12px; color: var(--muted); font-weight: 600; }
.wal b { font-size: 19px; font-variant-numeric: tabular-nums; }
.wal.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-2); }
.wal.low { border-color: #f3d48b; background: var(--warn-bg); }
.wcard { border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.wcard.ok { border-color: #8fd3a6; background: var(--ok-bg); } .wcard.bad { border-color: #f5c2c2; background: #fff8f8; }
.wbig { font-size: 18px; font-weight: 800; }
.wcard.ok .wbig { color: var(--ok); } .wcard.bad .wbig { color: var(--bad); }
.bar { height: 5px; background: #eef0f3; border-radius: 3px; margin-top: 4px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--accent); }
.mob-warn { margin-top: 0; }
.mob-kpis { margin-top: -4px; }
.cart2 .acts { grid-template-columns: repeat(5, 1fr); }
.cart2 .acts .btn { padding-left: 4px; padding-right: 4px; }
.ptab select { min-width: 96px; }
.filters > select, .filters > input, .page .row > select[data-tech], .filters label input { width: auto; min-width: 150px; flex: 0 0 auto; }
.filters { flex-wrap: wrap; }

/* This POS has more counter buttons: let them wrap instead of squeezing the search box */
.scanbar { flex-wrap: wrap; row-gap: 8px; } .scanbox { flex: 1 1 280px; min-width: 280px; }

/* ===== Electronics & Appliances ===== */
.kpi2.late { border-color: #f3b4b4; background: #fff6f6; box-shadow: 0 0 0 2px #fde2e2 inset; }
.kpi2.late .v { color: var(--bad); }
.spec-box { margin-top: 10px; padding: 8px 10px 10px; border: 1px dashed var(--line); border-radius: 10px; background: #fafbfc; }
.spec-box .form-grid { margin-top: 4px; }
textarea[data-serials] { font-size: 14px; line-height: 1.5; }

.warn-box { background: #fff7e6; border: 1px solid #f3d08a; color: #7a4b00; border-radius: 10px; padding: 9px 12px; font-size: 13px; margin: 6px 0 10px; }
