:root {
  --g: #0f5c36; --g2: #1b7a4b; --gl: #e6f2ea; --g3: #cfe6d7;
  --acc: #e07b00; --accl: #fff3de;
  --bad: #b83227; --badl: #fdeceb;
  --ink: #1a2b22; --mut: #5d6f65; --line: #dce6df; --bg: #f4f7f4; --card: #fff;
  --r: 16px; --shadow: 0 1px 3px rgba(15, 60, 35, .10), 0 4px 14px rgba(15, 60, 35, .06);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
html.big { font-size: 20px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", "Nirmala UI", "Kalpurush", Arial, sans-serif;
  line-height: 1.4; -webkit-text-size-adjust: 100%;
}
body.noscroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; }
.muted { color: var(--mut); }
.center { text-align: center; }
.small { font-size: .85rem; }
.bold { font-weight: 700; }
.right { text-align: right; }
.hide { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.gap { display: grid; gap: 12px; }
.mt { margin-top: 14px; }
.pos { color: var(--g2); } .neg { color: var(--bad); } .warn-t { color: var(--acc); }

#app { max-width: 1100px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.screen { padding: 14px 14px 90px; flex: 1; }

/* ---------- header ---------- */
.bar {
  position: sticky; top: 0; z-index: 20; background: var(--g); color: #fff; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; min-height: 56px;
}
.bar .title { flex: 1; font-size: 1.15rem; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .ib {
  background: rgba(255, 255, 255, .14); border: 0; color: #fff; width: 48px; height: 48px; border-radius: 14px; font-size: 1.35rem;
  display: inline-flex; align-items: center; justify-content: center; flex: none; text-decoration: none; position: relative;
}
.bar .ib.txt { width: auto; padding: 0 14px; font-size: .95rem; font-weight: 600; }
.bar .ib .badge { position: absolute; top: 2px; right: 2px; background: var(--acc); color: #fff; border-radius: 99px; font-size: .7rem; min-width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* ---------- home ---------- */
.home-head { background: var(--g); color: #fff; padding: 14px 14px 22px; border-radius: 0 0 28px 28px; }
.home-head .top { display: flex; align-items: flex-start; gap: 10px; }
.home-head h1 { font-size: 1.6rem; line-height: 1.15; }
.home-head .date { opacity: .85; margin-top: 2px; }
.home-head .ib { background: rgba(255, 255, 255, .14); border: 0; color: #fff; width: 48px; height: 48px; border-radius: 14px; font-size: 1.4rem; flex: none; }
.who { background: rgba(255, 255, 255, .14); border: 0; color: #fff; border-radius: 14px; padding: 0 12px; height: 48px; font-size: .9rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statusline { margin: 14px 14px 0; padding: 8px 14px; background: var(--accl); border-radius: 14px; font-size: .95rem; display: flex; gap: 2px 10px; flex-wrap: wrap; justify-content: center; align-items: center; }
.statusline .sep { color: #b97b21; }
@media (max-width: 520px) { .statusline { flex-direction: column; gap: 0; } .statusline .sep { display: none; } }
.statusline button { background: none; border: 0; padding: 4px 6px; font-weight: 700; color: #8a4f00; text-decoration: underline; min-height: 32px; }
.big-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 16px 14px 30px; }
.bigbtn {
  background: var(--card); border: 0; border-radius: 22px; box-shadow: var(--shadow); min-height: 128px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; font-size: 1.15rem; font-weight: 700; color: var(--g); padding: 14px 8px; text-align: center;
}
.bigbtn:active { transform: scale(.98); background: var(--gl); }
.bigbtn .ico { font-size: 2.4rem; line-height: 1; }
.bigbtn.sell { background: var(--g); color: #fff; grid-column: 1 / -1; min-height: 120px; }
.bigbtn.sell:active { background: var(--g2); }
.bigbtn small { font-weight: 500; opacity: .75; font-size: .8rem; }
.big-btns .bigbtn:last-child:nth-child(even) { grid-column: 1 / -1; min-height: 100px; }

/* ---------- cards, forms ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; }
.card + .card { margin-top: 12px; }
.card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.list { display: grid; gap: 0; }
.item { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); min-height: 56px; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.item:last-child { border-bottom: 0; }
button.item:active { background: var(--gl); }
.item .name { font-weight: 600; }
.item .sub { font-size: .85rem; color: var(--mut); }
.btn {
  min-height: 48px; padding: 0 18px; border-radius: 14px; border: 2px solid transparent; font-weight: 700; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap;
}
.btn.primary { background: var(--g); color: #fff; }
.btn.primary:active { background: var(--g2); }
.btn.ghost { background: #fff; color: var(--g); border-color: var(--g3); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.warn { background: var(--acc); color: #fff; }
.btn.soft { background: var(--gl); color: var(--g); }
.btn.block { width: 100%; }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: .9rem; border-radius: 12px; }
.btn[disabled] { opacity: .45; }
.field { display: grid; gap: 4px; margin-bottom: 10px; font-size: .9rem; font-weight: 600; color: var(--mut); }
.field > span { font-size: .85rem; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font-size: 1rem; font-weight: 400; color: var(--ink);
}
.input:focus { outline: none; border-color: var(--g2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 44px; padding: 0 16px; border-radius: 99px; border: 2px solid var(--g3); background: #fff; font-weight: 600; color: var(--g); white-space: nowrap; }
.chip.on { background: var(--g); color: #fff; border-color: var(--g); }
.seg { display: flex; background: var(--gl); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 44px; border: 0; background: transparent; border-radius: 10px; font-weight: 600; color: var(--g); }
.seg button.on { background: var(--g); color: #fff; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 99px; background: var(--gl); color: var(--g); font-size: .8rem; font-weight: 700; }
.tag.warn { background: var(--accl); color: #8a4f00; } .tag.bad { background: var(--badl); color: var(--bad); }
.empty { text-align: center; color: var(--mut); padding: 28px 12px; }
.search { position: relative; margin-bottom: 8px; }
.search .input { padding-left: 42px; }
.search:before { content: "🔍"; position: absolute; left: 12px; top: 12px; font-size: 1.1rem; z-index: 1; }
.total-line { display: flex; justify-content: space-between; padding: 4px 0; }
.total-line.big { font-size: 1.35rem; font-weight: 800; color: var(--g); border-top: 2px solid var(--line); margin-top: 6px; padding-top: 10px; }
.switch { width: 60px; height: 34px; border-radius: 99px; border: 0; background: #c8d3cc; position: relative; flex: none; transition: background .15s; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch.on { background: var(--g2); } .switch.on .knob { left: 29px; }
.switch[disabled] { opacity: .5; }
.stat { background: var(--gl); border-radius: 14px; padding: 12px; }
.stat b { display: block; font-size: 1.3rem; color: var(--g); }
.stat span { font-size: .8rem; color: var(--mut); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.notice { background: var(--accl); border-radius: 12px; padding: 10px 12px; font-size: .9rem; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding-top: 10px; }
.bars .b { flex: 1; background: var(--g2); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars .b.hot { background: var(--acc); }
.bar-labels { display: flex; gap: 3px; font-size: .62rem; color: var(--mut); }
.bar-labels span { flex: 1; text-align: center; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: left; color: var(--mut); font-size: .8rem; padding: 6px 4px; border-bottom: 2px solid var(--line); }
.tbl td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl .r { text-align: right; }
.scrollx { overflow-x: auto; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }

/* ---------- modal / toast ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(10, 30, 20, .5); z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column; border-radius: 24px 24px 0 0; animation: up .18s ease-out; }
.sheet.wide { max-width: 760px; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.sheet-title { padding: 16px 18px 6px; font-size: 1.2rem; font-weight: 800; color: var(--g); }
.sheet-body { padding: 8px 18px; overflow-y: auto; flex: 1; }
.sheet-btns { display: flex; gap: 10px; padding: 12px 18px 16px; }
.sheet-btns .btn { flex: 1; }
@media (min-width: 700px) { .backdrop { align-items: center; } .sheet { border-radius: 24px; } }
.confirm-text { margin: 4px 0 8px; font-size: 1.05rem; }
.toasts { position: fixed; left: 0; right: 0; bottom: 78px; z-index: 200; display: grid; gap: 8px; justify-items: center; padding: 0 12px; pointer-events: none; }
.toast { background: #17261e; color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow); pointer-events: auto; display: flex; gap: 12px; align-items: center; max-width: 520px; }
.toast.warn { background: var(--acc); }
.toast-btn { background: rgba(255, 255, 255, .2); border: 0; color: #fff; border-radius: 10px; min-height: 36px; padding: 0 12px; font-weight: 700; }

/* ---------- numpad / pin ---------- */
.np-display { font-size: 2.4rem; font-weight: 800; text-align: center; color: var(--g); padding: 6px 0; min-height: 3.2rem; }
.np-live { text-align: center; color: var(--mut); min-height: 1.5rem; margin-bottom: 8px; font-weight: 600; }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-bottom: 6px; }
.key { min-height: 62px; font-size: 1.6rem; font-weight: 700; border-radius: 16px; border: 0; background: var(--gl); color: var(--g); }
.key:active { background: var(--g3); }
.pin-dots { display: flex; justify-content: center; gap: 16px; padding: 12px 0 16px; }
.dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--g); } .dot.on { background: var(--g); }

/* ---------- sell ---------- */
.sell-wrap { display: grid; gap: 14px; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile { background: #fff; border: 2px solid var(--line); border-radius: 16px; min-height: 84px; padding: 10px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; box-shadow: var(--shadow); }
.tile:active { background: var(--gl); border-color: var(--g2); }
.tile .tn { font-weight: 700; font-size: .98rem; line-height: 1.2; }
.tile .ts { font-size: .75rem; color: var(--mut); }
.tile .tp { color: var(--g); font-weight: 800; }
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px 12px; background: #fff; box-shadow: 0 -4px 18px rgba(0, 0, 0, .12); display: flex; gap: 10px; align-items: center; max-width: 1100px; margin: 0 auto; }
.cartbar .btn { flex: 1; min-height: 54px; font-size: 1.05rem; }
.cart-pane { position: fixed; inset: 0; z-index: 40; background: var(--bg); transform: translateY(100%); transition: transform .2s; display: flex; flex-direction: column; }
.cart-pane.open { transform: none; }
.cart-body { flex: 1; overflow-y: auto; padding: 12px 14px; }
.cart-foot { padding: 12px 14px 16px; background: #fff; box-shadow: 0 -4px 18px rgba(0, 0, 0, .1); }
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line .lt { font-weight: 700; text-align: right; }
.qtybox { display: flex; align-items: center; gap: 6px; }
.qtybox button { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--g3); background: #fff; font-size: 1.3rem; font-weight: 700; color: var(--g); }
.qtybox .q { min-width: 54px; text-align: center; font-weight: 800; background: var(--gl); border-radius: 10px; height: 44px; display: flex; align-items: center; justify-content: center; border: 0; }
.paygrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.paygrid .btn { min-height: 58px; font-size: 1.05rem; }
.receipt { background: #fff; max-width: 380px; margin: 0 auto; padding: 18px; border-radius: 6px; box-shadow: var(--shadow); font-family: "Courier New", ui-monospace, monospace; font-size: .9rem; }
.receipt h2 { text-align: center; font-size: 1.2rem; }
.receipt hr { border: 0; border-top: 1px dashed #999; margin: 8px 0; }
.receipt .rl { display: flex; justify-content: space-between; gap: 8px; }
.receipt .rl.b { font-weight: 800; font-size: 1.05rem; }
@media (min-width: 900px) {
  .sell-wrap { grid-template-columns: 1fr 400px; align-items: start; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .cartbar { display: none; }
  .cart-pane { position: sticky; top: 70px; inset: auto; transform: none; z-index: 1; height: calc(100vh - 90px); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
  .cart-pane .cart-close { display: none; }
  .screen.sellscreen { padding-bottom: 20px; }
}
@media (min-width: 600px) and (max-width: 899px) { .tiles { grid-template-columns: repeat(3, 1fr); } .big-btns { grid-template-columns: 1fr 1fr 1fr; } .bigbtn.sell { grid-column: 1 / -1; } }

/* ---------- login / wizard ---------- */
.center-screen { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 20px; max-width: 520px; margin: 0 auto; gap: 14px; }
.wiz-top { text-align: center; color: var(--g); }
.wiz-top h1 { font-size: 1.8rem; }
.progress { display: flex; gap: 6px; justify-content: center; }
.progress i { width: 28px; height: 6px; border-radius: 4px; background: var(--g3); } .progress i.on { background: var(--g); }
.bigopt { display: block; width: 100%; text-align: left; min-height: 64px; padding: 12px 16px; border: 2px solid var(--g3); background: #fff; border-radius: 16px; font-size: 1.1rem; font-weight: 700; color: var(--g); margin-bottom: 10px; }
.bigopt small { display: block; font-weight: 500; color: var(--mut); font-size: .85rem; }
.bigopt.on { border-color: var(--g); background: var(--gl); }
.langs { display: flex; gap: 8px; justify-content: center; }

/* ---------- board ---------- */
.board { background: #fff; padding: 16px; border-radius: var(--r); }
.board h2 { color: var(--g); border-bottom: 3px solid var(--g); padding-bottom: 4px; margin: 10px 0 6px; }
.board .pl { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px dotted var(--line); font-size: 1.3rem; }
.board .pl b { color: var(--g); font-size: 1.5rem; }
.board.full { position: fixed; inset: 0; z-index: 150; overflow: auto; border-radius: 0; font-size: 1.1em; }

/* ---------- misc ---------- */
.sched { display: grid; grid-template-columns: 90px repeat(7, 1fr); gap: 4px; min-width: 560px; }
.sched .c { min-height: 44px; border-radius: 10px; border: 0; background: var(--bg); font-size: .8rem; font-weight: 700; padding: 2px; }
.sched .c.m { background: #dff0ff; color: #0c4a7a; } .sched .c.e { background: #ffe9c7; color: #8a4f00; } .sched .c.o { background: #e6defa; color: #4a2c8a; }
.sched .hd { font-size: .8rem; font-weight: 700; color: var(--mut); text-align: center; align-self: end; }
.sched .nm { font-size: .85rem; font-weight: 600; align-self: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checkrow { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); min-height: 52px; }
.checkrow input { width: 26px; height: 26px; accent-color: var(--g); flex: none; }
.pill-who { display: inline-flex; align-items: center; gap: 6px; background: var(--gl); border-radius: 99px; padding: 6px 12px; margin: 3px; font-weight: 600; }
.fab { position: fixed; right: 16px; bottom: 18px; z-index: 25; box-shadow: var(--shadow); min-height: 56px; border-radius: 28px; padding: 0 22px; font-size: 1.05rem; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 14px 0 6px; }
.sec-title { font-size: .85rem; font-weight: 800; color: var(--mut); text-transform: uppercase; letter-spacing: .04em; margin: 18px 4px 8px; }
.photo { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--gl); flex: none; }
.err { background: var(--badl); color: var(--bad); padding: 14px; border-radius: 12px; white-space: pre-wrap; }
.install-hint { margin: 10px 14px 0; }

/* ---------- print ---------- */
@media print {
  body { background: #fff; }
  .bar, .no-print, .cartbar, .toasts, .backdrop { display: none !important; }
  .screen { padding: 0; }
  .receipt, .printable { box-shadow: none; max-width: none; }
}
