@font-face{font-family:"Noto Sans Bengali";font-style:normal;font-weight:100 900;font-display:swap;src:url(../fonts/noto-bengali-bengali.woff2) format("woff2");unicode-range:U+0951-0952,U+0964-0965,U+0980-09FE,U+1CD0,U+1CD2,U+1CD5-1CD6,U+1CD8,U+1CE1,U+1CEA,U+1CED,U+1CF2,U+1CF5-1CF7,U+200C-200D,U+20B9,U+25CC,U+A8F1}
@font-face{font-family:"Noto Sans Bengali";font-style:normal;font-weight:100 900;font-display:swap;src:url(../fonts/noto-bengali-latin.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

:root{
  --brand:#157a3b;--brand-d:#0f5e2c;--brand-l:#e7f3eb;
  --saffron:#f2a516;--red:#d7262b;--red-l:#fdecec;--blue:#2563eb;
  --bg:#f5f2ec;--surface:#fff;--ink:#17221b;--muted:#6b766f;--line:#e7e1d5;
  --radius:16px;--shadow:0 1px 2px rgba(23,34,27,.05),0 4px 14px rgba(23,34,27,.05);
  --safe-b:env(safe-area-inset-bottom,0px);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html{background:#e6e1d6}
body{margin:0;font-family:"Noto Sans Bengali",system-ui,sans-serif;color:var(--ink);background:#e6e1d6;font-size:15px;line-height:1.5;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:none;padding:0}
a{color:inherit;text-decoration:none}
svg{width:22px;height:22px;flex:none}
.app{max-width:480px;margin:0 auto;min-height:100vh;min-height:100dvh;background:var(--bg);position:relative;padding-bottom:calc(96px + var(--safe-b))}
.app.no-pad{padding-bottom:24px}
.app.has-foot{padding-bottom:calc(110px + var(--safe-b))}

/* ---------- top bars ---------- */
.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:6px;height:58px;padding:0 8px;background:var(--surface);border-bottom:1px solid var(--line)}
.topbar h1{flex:1;margin:0;font-size:18px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-left:4px}
.top-right{display:flex;gap:2px}
.icon-btn{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;color:var(--ink)}
.icon-btn:active{background:var(--bg)}
.home-head{background:linear-gradient(160deg,var(--brand) 0%,var(--brand-d) 100%);color:#fff;padding:12px 16px 74px;border-radius:0 0 26px 26px}
.home-head .row1{display:flex;align-items:center;gap:10px}
.home-head .logo{width:42px;height:42px;border-radius:12px;background:#fff;display:grid;place-items:center;overflow:hidden}
.home-head .logo img{width:40px;height:40px;object-fit:contain}
.home-head .brand{flex:1;line-height:1.2}
.home-head .brand b{display:block;font-size:18px}
.home-head .brand small{opacity:.8;font-size:12.5px}
.home-head .icon-btn{color:#fff}
.home-head .icon-btn:active{background:rgba(255,255,255,.15)}
.hero-num{margin-top:16px}
.hero-num small{opacity:.85;font-size:13px}
.hero-num b{display:block;font-size:32px;font-weight:800;letter-spacing:.3px;line-height:1.25}
.hero-sub{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
.hero-sub span{background:rgba(255,255,255,.14);border-radius:999px;padding:4px 11px;font-size:12.5px}

/* ---------- layout pieces ---------- */
.content{padding:14px 14px 0}
.lift{margin-top:-60px;position:relative}
.card{background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px;margin-bottom:12px}
.card-title{display:flex;align-items:center;justify-content:space-between;margin:0 0 10px;font-size:15px;font-weight:700}
.card-title a,.link{color:var(--brand);font-size:13px;font-weight:600}
.sec-title{font-size:14px;font-weight:700;color:var(--muted);margin:18px 4px 8px}
.row{display:flex;align-items:center}
.gap{gap:8px}
.between{justify-content:space-between}
.grow{flex:1;min-width:0}
.muted{color:var(--muted)}
.small{font-size:12.5px}
.green{color:var(--brand)}
.red{color:var(--red)}
.blue{color:var(--blue)}
.orange{color:#c2410c}
.center{text-align:center}
.mt{margin-top:12px}
.hr{height:1px;background:var(--line);margin:10px 0}

.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:12px}
.stat{background:var(--surface);border-radius:14px;box-shadow:var(--shadow);padding:10px 10px 11px;min-width:0}
.stat small{display:flex;align-items:center;gap:4px;color:var(--muted);font-size:12px;white-space:nowrap}
.stat small svg{width:15px;height:15px}
.stat b{display:block;font-size:16px;font-weight:800;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.quick3{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:6px}
.qbtn{background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px 6px 12px;display:flex;flex-direction:column;align-items:center;gap:7px;font-weight:700;font-size:14.5px}
.qbtn .qi{width:48px;height:48px;border-radius:15px;display:grid;place-items:center;color:#fff}
.qbtn .qi svg{width:25px;height:25px}
.qbtn:active,.tile:active,.list-item:active{transform:scale(.97)}

.tiles{display:grid;grid-template-columns:repeat(4,1fr);gap:4px 2px;background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow);padding:12px 6px}
.tile{display:flex;flex-direction:column;align-items:center;gap:6px;padding:6px 2px;font-size:12.5px;line-height:1.3;text-align:center;position:relative;border-radius:12px;transition:transform .1s}
.tile-ic{width:46px;height:46px;border-radius:14px;display:grid;place-items:center}
.tile-ic svg{width:23px;height:23px}
.badge{position:absolute;top:0;right:calc(50% - 30px);background:var(--red);color:#fff;font-size:10.5px;font-weight:700;min-width:19px;height:19px;border-radius:10px;display:grid;place-items:center;padding:0 5px;border:2px solid #fff}

/* ---------- lists ---------- */
.list{background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;margin-bottom:12px}
.list-item{display:flex;align-items:center;gap:12px;padding:12px 14px;border-bottom:1px solid var(--line);width:100%;text-align:left;transition:transform .1s}
.list-item:last-child{border-bottom:0}
.li-ic{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;flex:none;font-weight:700}
.li-ic svg{width:20px;height:20px}
.li-main{flex:1;min-width:0}
.li-main b{display:block;font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.li-main small{color:var(--muted);font-size:12.5px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.li-end{text-align:right;flex:none}
.li-end b{display:block;font-size:15px}
.li-end small{font-size:12px}
.date-head{font-size:12.5px;font-weight:700;color:var(--muted);margin:14px 4px 6px;display:flex;justify-content:space-between}
.empty{text-align:center;color:var(--muted);padding:34px 16px}
.empty svg{width:44px;height:44px;opacity:.45;margin-bottom:6px}
.pill{display:inline-block;font-size:11.5px;font-weight:700;padding:2px 8px;border-radius:999px;background:var(--bg)}
.pill.red{background:var(--red-l);color:var(--red)}
.pill.green{background:var(--brand-l);color:var(--brand)}
.pill.orange{background:#fff3e0;color:#c2410c}

/* ---------- chips / tabs ---------- */
.chips{display:flex;gap:7px;overflow-x:auto;padding:2px 0 10px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;padding:7px 14px;border-radius:999px;background:var(--surface);border:1px solid var(--line);font-size:13.5px;font-weight:600;color:var(--muted)}
.chip.on{background:var(--brand);border-color:var(--brand);color:#fff}
.seg{display:flex;background:#ebe6db;border-radius:12px;padding:4px;margin-bottom:12px}
.seg button{flex:1;padding:8px 4px;border-radius:9px;font-weight:700;font-size:14px;color:var(--muted)}
.seg button.on{background:var(--surface);color:var(--ink);box-shadow:var(--shadow)}

/* ---------- forms ---------- */
.lbl{display:block;font-size:13px;font-weight:600;color:var(--muted);margin:0 0 5px}
.field{margin-bottom:12px}
.input{width:100%;height:46px;border:1.5px solid var(--line);border-radius:12px;padding:0 12px;background:#fff;outline:none;font-size:15px}
textarea.input{height:auto;min-height:90px;padding:10px 12px;resize:vertical}
.input:focus{border-color:var(--brand);box-shadow:0 0 0 3px rgba(21,122,59,.12)}
select.input{appearance:none;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b766f' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center;padding-right:34px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.search{display:flex;align-items:center;gap:8px;height:46px;border:1.5px solid var(--line);border-radius:12px;padding:0 12px;background:#fff;margin-bottom:10px}
.search svg{color:var(--muted);width:19px;height:19px}
.search input{border:0;outline:none;flex:1;min-width:0;background:none;font-size:15px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:48px;padding:0 18px;border-radius:13px;font-weight:700;font-size:15.5px;background:var(--bg);color:var(--ink)}
.btn svg{width:20px;height:20px}
.btn.primary{background:var(--brand);color:#fff}
.btn.primary:active{background:var(--brand-d)}
.btn.danger{background:var(--red-l);color:var(--red)}
.btn.outline{background:#fff;border:1.5px solid var(--line)}
.btn.block{width:100%}
.btn.sm{height:38px;padding:0 13px;font-size:14px;border-radius:11px}
.btn-sq{width:46px;height:46px;border-radius:12px;background:var(--brand-l);color:var(--brand);display:grid;place-items:center;flex:none}
.btn-row{display:flex;gap:8px}
.btn-row .btn{flex:1}
.opt-chips{display:flex;flex-wrap:wrap;gap:7px}
.opt-chips label{cursor:pointer}
.opt-chips input{display:none}
.opt-chips span{display:inline-block;padding:7px 13px;border-radius:999px;border:1.5px solid var(--line);font-size:13.5px;font-weight:600;background:#fff}
.opt-chips input:checked+span{background:var(--brand-l);border-color:var(--brand);color:var(--brand)}

/* ---------- sell form ---------- */
.pick-list{display:grid;grid-template-columns:1fr 1fr;gap:8px;max-height:236px;overflow-y:auto}
.pick{border:1.5px solid var(--line);border-radius:12px;padding:8px 10px;text-align:left;background:#fff;min-width:0}
.pick b{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:13px;line-height:1.35;overflow:hidden}
.pick small{font-size:12px;color:var(--muted)}
.pick.in{border-color:var(--brand);background:var(--brand-l)}
.pick.out small{color:var(--red)}
.ci{padding:10px 0;border-bottom:1px dashed var(--line)}
.ci:last-child{border-bottom:0}
.ci-top{display:flex;align-items:center;gap:8px}
.ci-top b{flex:1;font-size:14.5px}
.ci-bot{display:flex;align-items:center;gap:8px;margin-top:8px}
.stepper{display:flex;align-items:center;border:1.5px solid var(--line);border-radius:11px;overflow:hidden;height:40px}
.stepper button{width:36px;height:100%;display:grid;place-items:center;color:var(--brand)}
.stepper button svg{width:18px;height:18px}
.stepper input{width:52px;border:0;text-align:center;outline:none;font-weight:700;height:100%}
.ci-price{width:86px;height:40px;border:1.5px solid var(--line);border-radius:11px;padding:0 8px;outline:none;text-align:right}
.ci-total{flex:1;text-align:right;font-weight:800}
.sum-row{display:flex;justify-content:space-between;align-items:center;padding:5px 0}
.sum-row input{width:120px;height:40px;text-align:right}
.sum-row.big{font-size:18px;font-weight:800;border-top:1px dashed var(--line);margin-top:4px;padding-top:9px}
.sticky-foot{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:480px;z-index:30;background:var(--surface);border-top:1px solid var(--line);padding:10px 14px calc(10px + var(--safe-b));display:flex;align-items:center;gap:12px;box-shadow:0 -6px 20px rgba(0,0,0,.05)}
.sticky-foot .ft{flex:1;line-height:1.2}
.sticky-foot .ft small{color:var(--muted);font-size:12px}
.sticky-foot .ft b{display:block;font-size:20px}
.sticky-foot .btn{flex:1.4}

.amount-big{font-size:34px;font-weight:800;text-align:center;height:72px;border-radius:16px}

/* ---------- bottom nav ---------- */
.navbar{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:480px;z-index:30;background:var(--surface);border-top:1px solid var(--line);display:flex;padding:6px 6px calc(6px + var(--safe-b));box-shadow:0 -6px 20px rgba(0,0,0,.04)}
.navbar button{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;font-size:11.5px;font-weight:600;color:var(--muted);padding:4px 0}
.navbar button.on{color:var(--brand)}
.navbar .fab{position:relative;top:-20px}
.navbar .fab span{width:56px;height:56px;border-radius:18px;background:var(--brand);color:#fff;display:grid;place-items:center;box-shadow:0 8px 18px rgba(21,122,59,.35);margin-bottom:2px}
.navbar .fab span svg{width:27px;height:27px}
.navbar .fab{color:var(--brand)}
.fab-ext{position:fixed;bottom:calc(18px + var(--safe-b));right:max(16px,calc(50% - 224px));z-index:30;height:52px;padding:0 20px;border-radius:16px;background:var(--brand);color:#fff;font-weight:700;display:flex;align-items:center;gap:7px;box-shadow:0 8px 20px rgba(21,122,59,.35)}

/* ---------- sheet / drawer / toast ---------- */
.sheet-wrap{position:fixed;inset:0;z-index:100}
.sheet-bg{position:absolute;inset:0;background:rgba(15,25,18,.45);opacity:0;transition:opacity .2s}
.sheet{position:absolute;bottom:0;left:50%;transform:translate(-50%,100%);width:100%;max-width:480px;max-height:90vh;max-height:90dvh;overflow-y:auto;background:var(--surface);border-radius:22px 22px 0 0;padding:6px 16px calc(18px + var(--safe-b));transition:transform .25s cubic-bezier(.2,.8,.2,1)}
.sheet-wrap.open .sheet-bg{opacity:1}
.sheet-wrap.open .sheet{transform:translate(-50%,0)}
.sheet-handle{width:40px;height:5px;border-radius:3px;background:var(--line);margin:4px auto 6px}
.sheet-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.sheet-head h3{margin:0;font-size:17px}
.drawer{position:absolute;top:0;bottom:0;left:max(0px,calc(50% - 240px));width:min(300px,82vw);background:var(--surface);transform:translateX(-105%);transition:transform .25s;overflow-y:auto;padding-bottom:20px}
.sheet-wrap.open .drawer{transform:none}
.drawer-head{background:var(--brand);color:#fff;padding:22px 18px 18px;display:flex;align-items:center;gap:12px}
.drawer-head img{width:48px;height:48px;border-radius:12px;background:#fff;object-fit:contain}
.drawer-sec{font-size:12px;font-weight:700;color:var(--muted);padding:14px 18px 4px}
.drawer a{display:flex;align-items:center;gap:14px;padding:10px 18px;font-size:15px;cursor:pointer}
.drawer a:active{background:var(--bg)}
.drawer a svg{width:21px;height:21px}
.toast{position:fixed;left:50%;bottom:calc(100px + var(--safe-b));transform:translate(-50%,20px);background:#17221b;color:#fff;padding:10px 18px;border-radius:12px;font-size:14px;opacity:0;pointer-events:none;transition:.25s;z-index:200;max-width:90vw;text-align:center}
.toast.show{opacity:1;transform:translate(-50%,0)}

/* ---------- receipt ---------- */
.receipt{font-size:13px;line-height:1.45}
.receipt .r-head{text-align:center;border-bottom:1px dashed #999;padding-bottom:8px;margin-bottom:8px}
.receipt .r-head b{font-size:18px;display:block}
.receipt .r-meta{display:flex;justify-content:space-between;font-size:12px}
.receipt table{width:100%;border-collapse:collapse;margin:8px 0}
.receipt th{font-size:11.5px;text-align:left;border-bottom:1px dashed #999;padding:3px 0}
.receipt td{padding:4px 0;vertical-align:top}
.receipt .num{text-align:right;white-space:nowrap}
.receipt .r-tot{border-top:1px dashed #999;padding-top:6px}
.receipt .r-tot div{display:flex;justify-content:space-between}
.receipt .r-tot .grand{font-weight:800;font-size:15px}
.receipt .r-foot{text-align:center;border-top:1px dashed #999;margin-top:8px;padding-top:7px;font-size:12px}
.paid-stamp{display:inline-block;border:2px solid var(--brand);color:var(--brand);border-radius:8px;padding:0 8px;font-weight:800;transform:rotate(-6deg)}

/* ---------- report bars ---------- */
.bars{display:flex;align-items:flex-end;gap:6px;height:140px;padding-top:18px}
.bar{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;gap:4px;min-width:0}
.bar i{display:block;width:100%;max-width:30px;border-radius:7px 7px 3px 3px;background:var(--brand);min-height:3px}
.bar.today i{background:var(--saffron)}
.bar small{font-size:11px;color:var(--muted)}
.bar em{font-style:normal;font-size:10px;color:var(--muted);white-space:nowrap}
.kv{display:flex;justify-content:space-between;padding:8px 0;border-bottom:1px solid var(--line)}
.kv:last-child{border-bottom:0}
.kv b{font-weight:800}
.meter{height:7px;background:var(--bg);border-radius:4px;overflow:hidden;margin-top:5px}
.meter i{display:block;height:100%;background:var(--brand);border-radius:4px}

/* ---------- print ---------- */
#print-root{display:none}
@media print{
  html,body{background:#fff!important}
  body>*:not(#print-root){display:none!important}
  #print-root{display:block!important;color:#000;font-family:"Noto Sans Bengali",sans-serif}
  #print-root.paper-58{width:56mm}
  #print-root.paper-80{width:76mm}
  #print-root.paper-a4{width:100%;max-width:180mm;margin:0 auto;font-size:14px}
  @page{margin:3mm}
}

/* ---------- login / sync ---------- */
.login{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;justify-content:center;padding:24px 18px;text-align:center}
.login>img{width:110px;height:66px;object-fit:contain;margin:0 auto 6px;background:#fff;border-radius:16px;padding:6px;box-shadow:var(--shadow)}
.login h2{margin:8px 0 4px;font-size:22px;color:var(--brand)}
.login p{margin:0 0 16px}
.login .card{text-align:left}
.spinner{width:34px;height:34px;border:3.5px solid var(--line);border-top-color:var(--brand);border-radius:50%;margin:14px auto;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.sync-badge{margin-top:10px;font-size:12px;color:#fff;opacity:.9;background:rgba(0,0,0,.14);border-radius:999px;padding:3px 11px}
.sync-badge.warn{background:#f2a516;color:#3b2a00;opacity:1;font-weight:700}
.who{margin-top:12px;padding-top:10px;border-top:1px solid var(--line);font-size:12.5px;color:var(--muted);text-align:center;line-height:1.7}

/* ---------- accounts ---------- */
.acc-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(100px,1fr));gap:8px;margin-bottom:12px}
.acc{background:var(--surface);border-radius:14px;box-shadow:var(--shadow);padding:9px 10px;text-align:left;border:1.5px solid transparent;min-width:0}
.acc small{display:block;color:var(--muted);font-size:12px}
.acc b{display:block;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.acc.on{border-color:var(--brand);background:var(--brand-l)}
.btn-row .btn.sm{padding:0 8px;font-size:13px}
