:root {
  --g: #0e7a4b; --g-d: #0a5c38; --g-l: #e6f4ec;
  --ink: #16211b; --mut: #5f6e66; --line: #e3e8e4; --bg: #f5f7f4; --card: #fff;
  --warn: #b45309; --warn-l: #fef3c7; --red: #b91c1c; --red-l: #fee2e2; --blue: #1d4ed8;
  --r: 14px; --nav: 64px;
}
@media (prefers-color-scheme: dark) {
  :root { --g: #34c785; --g-d: #1fa56a; --g-l: #12261d; --ink: #e8efea; --mut: #9aaba0; --line: #26312b; --bg: #0e1411; --card: #17201b;
    --warn: #fbbf24; --warn-l: #2e2410; --red: #f87171; --red-l: #2f1515; --blue: #7aa2ff; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 17px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Noto Sans Devanagari", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; line-height: 1.4; }
main { max-width: 640px; margin: 0 auto; padding: 14px 16px calc(var(--nav) + 90px); }
h1 { font-size: 1.35rem; margin: 6px 0 12px; } h2 { font-size: 1.05rem; margin: 20px 0 8px; }
small, .mut { color: var(--mut); } small { font-size: .8rem; }
a { color: var(--g); text-decoration: none; }
.row { display: flex; align-items: center; gap: 10px; } .row.sb { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.right { text-align: right; } .b { font-weight: 700; } .hide { display: none !important; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.tile .v { font-size: 1.45rem; font-weight: 800; } .tile.hero { grid-column: 1 / -1; background: var(--g); color: #fff; border: 0; } .tile.hero small { color: #d2f0e0; }
.tile.hero .v { font-size: 2rem; }
@media (prefers-color-scheme: dark) { .tile.hero { color: #06180f; } .tile.hero small { color: #0a3a22; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 0;
  background: var(--g); color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-align: center; }
@media (prefers-color-scheme: dark) { .btn { color: #06180f; } }
.btn:active { transform: scale(.98); } .btn.big { min-height: 56px; font-size: 1.1rem; width: 100%; }
.btn.alt { background: var(--g-l); color: var(--g); } .btn.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn.red { background: var(--red-l); color: var(--red); } .btn.sm { min-height: 38px; padding: 0 12px; font-size: .9rem; }
.btn[disabled] { opacity: .5; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.act { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 14px; color: var(--ink); font-weight: 700; }
.act .ic { font-size: 1.8rem; } .act small { font-weight: 400; }
.act.primary { background: var(--g); border: 0; color: #fff; } .act.primary small { color: #d2f0e0; }
@media (prefers-color-scheme: dark) { .act.primary { color: #06180f; } .act.primary small { color: #0a3a22; } }

.alert { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--warn-l); color: var(--warn); margin-bottom: 10px; font-weight: 600; }
.alert.bad { background: var(--red-l); color: var(--red); } .alert.good { background: var(--g-l); color: var(--g); }

input, select, textarea { font: inherit; color: inherit; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 0 14px; min-height: 48px; width: 100%; }
input:focus, select:focus { outline: 2px solid var(--g); border-color: transparent; }
label { display: block; font-size: .85rem; color: var(--mut); margin: 12px 0 4px; }
.pin { letter-spacing: .5em; text-align: center; font-size: 1.4rem; }

.searchbar { display: flex; gap: 8px; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 4px 0 8px; }
.icon { flex: none; width: 52px; min-height: 52px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); font-size: 1.4rem; cursor: pointer; }
.icon.on { background: var(--red-l); border-color: var(--red); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.chip { flex: none; padding: 8px 14px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--ink); }
.chip.on { background: var(--g); border-color: var(--g); color: #fff; }

.grid-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.item { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 64px; font: inherit; color: inherit; cursor: pointer; width: 100%; }
.item .n { font-weight: 700; line-height: 1.2; display: block; } .item .p { color: var(--g); font-weight: 700; font-size: .9rem; }
.item:active { background: var(--g-l); }
.list > .li { display: flex; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list > .li:last-child { border-bottom: 0; }

.line { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin-bottom: 8px; }
.line.warn { border-color: var(--warn); }
.line .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.line .nm { font-weight: 700; } .line .x { background: none; border: 0; font-size: 1.3rem; color: var(--mut); cursor: pointer; padding: 0 4px; }
.line .ctl { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.qty { display: flex; align-items: center; } .qty button { width: 44px; height: 44px; border: 1.5px solid var(--line); background: var(--card); font-size: 1.3rem; border-radius: 10px; color: var(--ink); cursor: pointer; }
.qty input { width: 64px; text-align: center; border-radius: 0; margin: 0 -1px; padding: 0 4px; min-height: 44px; }
.rate { width: 84px; padding: 0 8px; min-height: 44px; text-align: center; }
.rate.need { border-color: var(--warn); background: var(--warn-l); }
.amt { margin-left: auto; font-weight: 800; font-size: 1.1rem; }
.tot-in { width: 104px; margin-left: auto; padding: 0 8px; min-height: 44px; text-align: right; font-weight: 800; font-size: 1.1rem; }
.chip.pack { border-color: var(--g); color: var(--g); } .chip.pack.on { background: var(--g); color: #fff; }
@media (prefers-color-scheme: dark) { .chip.pack.on { color: #06180f; } }
.quick { flex-wrap: wrap; }
.quick { display: flex; gap: 6px; margin-top: 8px; } .quick .chip { padding: 6px 12px; }

.paybar { position: fixed; left: 0; right: 0; bottom: var(--nav); padding: 10px 16px; background: var(--card); border-top: 1px solid var(--line); z-index: 8; }
.paybar .in { max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 14px; } .paybar .tot { font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; height: var(--nav); background: var(--card); border-top: 1px solid var(--line); display: flex; z-index: 9; padding-bottom: env(safe-area-inset-bottom); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .75rem; color: var(--mut); gap: 1px; font-weight: 600; }
.nav a .ic { font-size: 1.35rem; } .nav a.on { color: var(--g); }

.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 640px; border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; }
.sheet h3 { margin: 0 0 6px; font-size: 1.15rem; }
.paybtns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 14px 0 6px; }
.paybtns .btn { flex-direction: column; min-height: 76px; font-size: 1rem; }
.paybtns .btn span { font-size: 1.5rem; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav) + 84px); background: #111; color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 40; max-width: 90vw; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.toast.bad { background: var(--red); }

.scan { position: fixed; inset: 0; background: #000; z-index: 50; display: flex; flex-direction: column; }
.scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; left: 12%; right: 12%; top: 30%; height: 28%; border: 3px solid #4ade80; border-radius: 16px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
.scan-bar { position: absolute; left: 0; right: 0; top: 0; padding: 16px; display: flex; justify-content: space-between; align-items: center; color: #fff; font-weight: 700; background: linear-gradient(#000a, transparent); }
.scan-msg { position: absolute; left: 16px; right: 16px; bottom: 40px; color: #fff; text-align: center; font-weight: 600; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 110px; margin: 8px 0 4px; } .bars div { flex: 1; background: var(--g); border-radius: 6px 6px 0 0; min-height: 3px; }
.bars-l { display: flex; gap: 6px; color: var(--mut); font-size: .7rem; } .bars-l span { flex: 1; text-align: center; }
.pos { color: var(--g); } .neg { color: var(--red); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .75rem; font-weight: 700; background: var(--g-l); color: var(--g); } .pill.warn { background: var(--warn-l); color: var(--warn); } .pill.red { background: var(--red-l); color: var(--red); }
.empty { text-align: center; color: var(--mut); padding: 30px 10px; }
.langsw { display: inline-flex; background: var(--line); border-radius: 99px; padding: 3px; }
.langsw a { padding: 5px 12px; border-radius: 99px; font-size: .85rem; font-weight: 700; color: var(--mut); } .langsw a.on { background: var(--g); color: #fff; }
@media (prefers-color-scheme: dark) { .langsw a.on { color: #06180f; } }
.login { max-width: 420px; margin: 0 auto; padding: 28px 18px; } .login .logo { font-size: 3rem; text-align: center; }
.tabs { display: flex; background: var(--line); border-radius: 12px; padding: 4px; margin: 14px 0; } .tabs a { flex: 1; text-align: center; padding: 10px; border-radius: 9px; font-weight: 700; color: var(--mut); } .tabs a.on { background: var(--card); color: var(--ink); }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; } table.t td, table.t th { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; } table.t th { color: var(--mut); font-weight: 600; font-size: .75rem; }
