

/* Layout: slim sidebar + airy card column on desktop; floating pill nav with FAB on phones. Single light theme, soft mint/sky wash. */
:root{
  --bg:#F4F7F4; --card:#FFFFFF; --ink:#16211B; --muted:#7D8A84; --line:#E7EDE9;
  --accent:#21993C; --accent-soft:#E2F4E6; --blue:#17772E; --blue-soft:#EDF7EF;
  --grad:linear-gradient(135deg,#34B552 0%,#21993C 55%,#16802F 100%); --grad-soft:linear-gradient(135deg,#F1FAF3 0%,#E2F4E6 100%);
  --lav:#7B6CD9; --lav-soft:#F1EEFB; --peach:#E08A3C; --peach-soft:#FDF0E5;
  --bad:#D2504B; --bad-soft:#FCEBEA; --warn:#C9811F; --warn-soft:#FDF3E1;
  --r:22px; --r-sm:14px;
  --shadow:0 1px 2px rgba(22,40,30,.04),0 10px 30px rgba(22,40,30,.05);
  --font:'Inter','Noto Sans Tamil','Noto Sans Devanagari',system-ui,-apple-system,'Segoe UI',sans-serif;
  color-scheme:light;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{background:var(--bg);color:var(--ink);font-family:var(--font);font-size:15.5px;line-height:1.55;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
body::before{content:"";position:fixed;inset:0 0 auto 0;height:420px;z-index:-1;pointer-events:none;
  background:radial-gradient(600px 300px at 10% 0%,#D3F0DA 0%,transparent 70%),radial-gradient(600px 320px at 90% 0%,#E6F6D9 0%,transparent 70%)}
h1,h2,h3{margin:0;font-weight:700;text-wrap:balance;letter-spacing:-.005em;line-height:1.25}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
html{-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{overscroll-behavior-y:none}
button,a,.li.click,[data-act]{touch-action:manipulation}
.btn:active,.chip:active,.qa button:active,.icon-btn:active,.fab:active,.li.click:active,.role-card:active{transform:scale(.97)}
.btn,.chip,.qa button,.icon-btn,.fab,.li.click{transition:transform .08s}
/* list rows: action buttons under the text */
.li-acts{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:10px}
.inv-r{width:110px}
.mini-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.mini-stats .v{font-size:28px;font-weight:600}
:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.num{font-variant-numeric:tabular-nums}
.muted{color:var(--muted)}
.small{font-size:14px;line-height:1.5}
.xs{font-size:12.5px;line-height:1.45}
svg.i{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}

/* top horizontal navigation */
.app{display:flex;flex-direction:column;min-height:100%}
.app>main{align-self:center}
.side{position:sticky;top:0;z-index:40;display:flex;flex-direction:row;align-items:center;gap:16px;padding:10px clamp(16px,3vw,40px);border-bottom:1px solid var(--line);background:rgba(255,255,255,.85);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
.side .logo{padding:0;flex:none}
.side #userChip{order:4;flex:none;margin-left:auto}
.side .side-foot{display:none}
.logo{display:flex;align-items:center;gap:10px;font-weight:700;font-size:19px;padding:0 8px}
.logo b{width:34px;height:34px;border-radius:11px;background:var(--grad);color:#fff;display:grid;place-items:center}
.seg{display:flex;background:#EBF0ED;border-radius:999px;padding:4px;gap:4px}
.seg button{flex:1;border:0;background:transparent;border-radius:999px;padding:8px 10px;font-weight:600;font-size:13px;color:var(--muted)}
.seg button.on{background:#fff;color:var(--ink);box-shadow:0 1px 4px rgba(0,0,0,.08)}
.nav{order:2;flex:1;min-width:0;display:flex;flex-direction:row;gap:4px;overflow-x:auto;scrollbar-width:none}
.nav::-webkit-scrollbar{display:none}
.nav a{display:flex;align-items:center;gap:8px;padding:8px 14px;border-radius:999px;color:var(--muted);text-decoration:none;font-weight:600;font-size:14px;white-space:nowrap;flex:none}
.nav a svg.i{width:18px;height:18px}
.nav a:hover{background:#fff;color:var(--ink)}
.nav a.on{background:var(--grad);color:#fff;box-shadow:0 8px 20px rgba(33,153,60,.25)}
.nav a.on .badge{background:#fff;color:var(--accent)}
.nav a .badge{margin-left:2px}
.side-foot{display:flex;align-items:center;gap:8px}
/* profile icon + menu (notifications, settings, sign out) */
#userChip{position:relative}
.av-btn{position:relative;width:38px;height:38px;border-radius:50%;border:0;background:var(--grad);color:#fff;font-weight:700;font-size:16px;display:grid;place-items:center;flex:none;box-shadow:0 4px 12px rgba(33,153,60,.25)}
.av-badge{position:absolute;top:-4px;right:-6px;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:var(--bad);color:#fff;font-size:11px;font-weight:700;display:grid;place-items:center;border:2px solid #fff}
.pmenu{position:absolute;right:0;top:calc(100% + 10px);width:min(340px,calc(100vw - 24px));padding:8px;z-index:70;max-height:min(70vh,560px);overflow-y:auto;box-shadow:0 20px 50px rgba(22,40,30,.18)}
.pm-head{display:flex;align-items:center;gap:10px;padding:8px 8px 12px;border-bottom:1px solid var(--line)}
.pm-head .nm{font-weight:600}
.pm-sec{font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;padding:12px 8px 4px;display:flex;align-items:center;gap:6px}
.pm-item{width:100%;border:0;background:none;text-align:left;font:inherit;color:inherit;padding:10px 8px}
.pm-item .tile{width:36px;height:36px;border-radius:11px}
.pm-all{display:block;padding:6px 8px 10px}
.pm-links{border-top:1px solid var(--line);margin-top:4px;padding-top:4px}
.pm-links .pm-item{gap:12px}

main{padding:28px clamp(16px,3vw,40px) 120px;max-width:1180px;width:100%}
.top{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}
.top .date{color:var(--muted);font-size:14px;margin-bottom:4px}
.top h1{font-size:clamp(26px,3.4vw,34px);line-height:1.15}
.top h1 span{display:block;color:#9AA6A0;font-weight:500}
.top-actions{display:flex;gap:8px;align-items:center}
.icon-btn{width:42px;height:42px;border-radius:50%;border:0;background:#fff;box-shadow:var(--shadow);display:grid;place-items:center;color:var(--ink);position:relative}
.icon-btn .dot{position:absolute;top:9px;right:10px;width:8px;height:8px;border-radius:50%;background:var(--bad);border:2px solid #fff}
.mobile-only{display:none}

.grid{display:grid;gap:18px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.split{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:18px;align-items:start}
.stack{display:flex;flex-direction:column;gap:18px}
.row{display:flex;align-items:center;gap:12px}
.row.between{justify-content:space-between}
.wrap{flex-wrap:wrap}

.card{background:var(--card);border-radius:var(--r);padding:22px;box-shadow:var(--shadow)}
.card.flat{box-shadow:none;border:1px solid var(--line)}
.card h2{font-size:17px}
.sec-h{display:flex;align-items:center;justify-content:space-between;margin:22px 2px 12px}
.sec-h h2{font-size:18px}
.link{color:var(--blue);background:none;border:0;font-weight:600;font-size:13px;padding:0;text-decoration:none}

.stat{display:flex;flex-direction:column;gap:14px}
.stat .v{font-size:26px;font-weight:600;line-height:1}
.stat .l{color:var(--muted);font-size:14px;margin-top:4px}
.tile{width:42px;height:42px;border-radius:13px;display:grid;place-items:center}
.t-mint{background:var(--accent-soft);color:var(--accent)}
.t-sky{background:var(--blue-soft);color:var(--blue)}
.t-lav{background:#EEF6E0;color:#4F8A1B}
.t-peach{background:var(--peach-soft);color:var(--peach)}
.t-bad{background:var(--bad-soft);color:var(--bad)}

.qa{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}
.qa button{border:0;border-radius:18px;padding:18px 10px;display:flex;flex-direction:column;align-items:center;gap:8px;font-weight:600;font-size:14px}
.qa button small{font-weight:400;color:var(--muted);font-size:12px}
.qa button svg.i{width:26px;height:26px}

.pill{display:inline-flex;align-items:center;gap:4px;border-radius:999px;padding:3px 10px;font-size:12px;font-weight:600;white-space:nowrap}
.p-ok{background:var(--accent-soft);color:var(--accent)}
.p-blue{background:var(--blue-soft);color:var(--blue)}
.p-warn{background:var(--warn-soft);color:var(--warn)}
.p-bad{background:var(--bad-soft);color:var(--bad)}
.p-grey{background:#EEF2EF;color:var(--muted)}
.p-dark{background:var(--grad);color:#fff}
.badge{background:var(--bad);color:#fff;border-radius:999px;font-size:11px;font-weight:700;padding:1px 7px}

.chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px;margin-bottom:14px;scrollbar-width:none}
.chip{border:0;background:transparent;padding:7px 14px;border-radius:999px;font-weight:600;color:var(--muted);white-space:nowrap}
.chip.on{background:var(--grad);color:#fff}
.chip:not(.on):hover{background:#fff}

.btn{border:0;border-radius:14px;padding:11px 18px;font-weight:600;display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--grad);color:#fff;box-shadow:0 6px 16px rgba(33,153,60,.22)}
.btn.ghost,.btn.soft{box-shadow:none}
.btn:hover{filter:brightness(.96)}
.btn.ghost{background:#fff;color:var(--ink);box-shadow:inset 0 0 0 1px var(--line)}
.btn.soft{background:var(--accent-soft);color:var(--accent)}
.btn.blue{background:var(--blue)}
.btn.sm{padding:7px 12px;border-radius:11px;font-size:13px}
.btn.full{width:100%}
.btn:disabled{opacity:.45;cursor:not-allowed}

label.f{display:flex;flex-direction:column;gap:7px;font-size:14px;font-weight:600;color:#4A5751}
.inp,select.inp,textarea.inp{width:100%;border:1px solid var(--line);background:#FAFCFB;border-radius:12px;padding:10px 12px;font-weight:500;font-size:14px}
.inp:focus{outline:2px solid var(--accent-soft);border-color:var(--accent)}
textarea.inp{resize:vertical;min-height:90px}
.search{display:flex;align-items:center;gap:8px;background:#fff;border-radius:999px;padding:8px 14px;box-shadow:var(--shadow);min-width:220px}
.search input{border:0;outline:0;background:transparent;width:100%}
.fields{display:grid;gap:12px}
.fields.two{grid-template-columns:1fr 1fr}

.list{display:flex;flex-direction:column}
.li{display:flex;align-items:center;gap:14px;padding:15px 4px;border-bottom:1px solid var(--line)}
.li:last-child{border-bottom:0}
.li .main{flex:1;min-width:0}
.li .t{font-weight:600}
.li .s{color:var(--muted);font-size:14px;line-height:1.45;margin-top:2px}
.li.click{cursor:pointer;border-radius:12px}
.li.click:hover{background:#F7FAF8}
.right{text-align:right}

.bar{height:6px;border-radius:99px;background:#EEF2EF;overflow:hidden;width:100%}
.bar i{display:block;height:100%;border-radius:99px;background:var(--grad)}

/* week strip + timeline (from the calendar references) */
.week{display:grid;grid-template-columns:repeat(7,1fr);text-align:center;gap:4px;margin-bottom:16px}
.week button{border:0;background:transparent;border-radius:14px;padding:8px 0;display:flex;flex-direction:column;align-items:center;gap:6px;color:var(--muted)}
.week button b{font-size:16px;color:var(--ink);font-weight:600;width:34px;height:34px;display:grid;place-items:center;border-radius:50%}
.week button.on b{background:var(--grad);color:#fff;box-shadow:0 6px 14px rgba(33,153,60,.3)}
.week button.today:not(.on) b{color:var(--blue)}
.week button i{width:5px;height:5px;border-radius:50%;background:transparent}
.week button.has i{background:var(--accent)}
.tl{position:relative;display:flex;flex-direction:column;gap:12px;padding-left:30px}
.tl::before{content:"";position:absolute;left:9px;top:12px;bottom:12px;width:2px;background:#CDEBD4}
.tl .it{position:relative;background:#F5FAF6;border-radius:16px;padding:14px 16px}
.tl .it::before{content:"";position:absolute;left:-27px;top:16px;width:12px;height:12px;border-radius:50%;border:2px solid var(--blue);background:#fff}
.tl .it.hot{background:var(--grad);color:#fff;box-shadow:0 10px 24px rgba(33,153,60,.25)}
.tl .it.hot::before{box-shadow:0 0 0 4px #CDEBD4;background:var(--accent)}
.tl .it.hot .s{color:#D7F2DD}
.tl .it.done{opacity:.55}
.tl .it.done::before{background:var(--blue)}
.tl .it .t{font-weight:600}
.tl .it .s{color:var(--muted);font-size:13px}

/* focus card (meditation reference) */
.focus{display:flex;align-items:center;justify-content:space-between;gap:16px;background:var(--grad-soft)}
.focus .k{font-size:13px;color:var(--muted)}
.focus h3{font-size:22px;margin:6px 0 4px}
.ring{position:relative;width:70px;height:70px;flex:none}
.ring svg{width:70px;height:70px;transform:rotate(-90deg)}
.ring span{position:absolute;inset:0;display:grid;place-items:center;text-align:center;font-weight:600;font-size:17px;line-height:1}
.ring span small{display:block;font-size:10px;color:var(--muted);font-weight:500;margin-top:2px}
.quote{display:flex;gap:14px;align-items:flex-start;background:#FAFBFA}
.quote .q{font-size:30px;line-height:1;color:var(--accent);font-weight:700}

.wx{background:linear-gradient(135deg,#E9F7EC,#F3FAEA)}
.wx .big{font-size:40px;font-weight:600;line-height:1}
.wx-days{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-top:16px}
.wx-days div{background:rgba(255,255,255,.7);border-radius:14px;padding:10px 4px;text-align:center;font-size:12px}
.wx-days b{display:block;font-size:14px}
.wx-days svg.i{display:block;margin:6px auto 4px}
.wx-days span{display:block}

.prod-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:14px}
.prod{display:flex;flex-direction:column;gap:10px}
.prod .nm{font-weight:600;line-height:1.3}
.qty{display:inline-flex;align-items:center;gap:10px;background:#F2F5F3;border-radius:12px;padding:4px}
.qty button{width:28px;height:28px;border:0;border-radius:9px;background:#fff;font-weight:700}

.chart{width:100%;height:auto;display:block}
.chart{font-size:11px}
.chart text{fill:var(--muted);font-family:var(--font)}

.banner{display:flex;gap:10px;align-items:flex-start;background:var(--warn-soft);color:#7A5410;border-radius:14px;padding:12px 14px;font-size:13px}

/* bottom nav (phone) */
.bnav{display:none}
.fab{width:58px;height:58px;border-radius:50%;border:0;background:var(--grad);color:#fff;display:grid;place-items:center;box-shadow:0 10px 24px rgba(33,153,60,.4)}
.fab svg.i{width:26px;height:26px}
.fab-desk{position:fixed;right:32px;bottom:32px;z-index:20}

/* modal sheet */
.modal{position:fixed;inset:0;background:rgba(18,28,22,.32);display:flex;align-items:center;justify-content:center;padding:16px;z-index:50}
.modal[hidden]{display:none}
.sheet{background:#fff;border-radius:26px;width:min(560px,100%);max-height:88vh;overflow:auto;padding:24px;box-shadow:0 30px 80px rgba(0,0,0,.2)}
.sheet-h{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.sheet-h h2{font-size:20px}
.toast{position:fixed;left:50%;bottom:110px;transform:translateX(-50%) translateY(20px);background:var(--ink);color:#fff;padding:11px 18px;border-radius:14px;font-weight:600;font-size:14px;opacity:0;transition:.25s;z-index:60;pointer-events:none}
.toast.on{opacity:1;transform:translateX(-50%)}
.empty{padding:28px;text-align:center;color:var(--muted)}
.stars button{border:0;background:none;font-size:20px;color:#D5DCD8;padding:0 1px}
.stars button.on{color:#F2B43A}
.mbar,.scrim{display:none}
/* bill panel: header, tools, lines */
.pos-head{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) minmax(0,1fr);gap:10px;margin-bottom:10px}
.pos-biller{display:flex;flex-direction:column;gap:2px;min-width:0}
.pos-biller select{border:1px solid var(--line);background:#FAFCFB;border-radius:10px;padding:6px 8px;font:inherit;font-weight:600;font-size:14px;min-height:38px;width:100%}
.pos-tools{display:flex;flex-wrap:wrap;gap:6px;padding-bottom:12px;margin-bottom:4px;border-bottom:1px solid var(--line)}
.pos-tools .btn.sm{min-height:36px;padding:6px 10px;font-size:13px}
.pos-tools .badge{margin-left:2px}
.pl-list{display:flex;flex-direction:column}
.pl{padding:12px 0;border-bottom:1px solid var(--line)}
.pl-top{display:flex;justify-content:space-between;align-items:flex-start;gap:8px}
.pl-name{min-width:0;line-height:1.35}
.pl-name b{font-weight:600}
.pl-row{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px 10px;margin-top:8px}
.pl-f{display:flex;flex-direction:column;gap:2px}
.pl-f span{font-size:12px;color:var(--muted)}
.pl-f input{width:86px;border:1px solid var(--line);background:#FAFCFB;border-radius:10px;padding:6px 8px;text-align:right;font:inherit;font-size:15px;min-height:38px}
.pl-amt{margin-left:auto;font-weight:700;text-align:right;display:flex;flex-direction:column;align-items:flex-end;line-height:1.2}
.pl-batch{display:flex;align-items:center;gap:8px;margin-top:8px}
.pl-batch select{flex:1;min-width:0;border:1px solid var(--line);background:#FAFCFB;border-radius:10px;padding:6px 8px;font:inherit;font-size:13px;min-height:36px}
.pos-in{width:110px!important;min-height:38px!important;padding:6px 10px!important;text-align:right}
.pos-lbl{border:0;border-bottom:1px dashed var(--line);background:transparent;font:inherit;color:inherit;padding:2px 0;width:100%;min-width:0}
.pos-prev{display:flex;justify-content:space-between;align-items:center;gap:10px;background:var(--bad-soft);color:var(--bad);border-radius:12px;padding:10px 12px;margin-top:6px}
.seg.mini{display:inline-flex;padding:3px;gap:2px}
.seg.mini button{padding:4px 10px;font-size:13px;flex:none}
.pos-modes{margin:4px 0 10px}
kbd{font-family:inherit;font-size:11px;background:#EEF2EF;border-radius:6px;padding:1px 5px;color:var(--muted)}
.pos-kind{margin-bottom:12px}
.pos-kind button{font-size:14px;padding:9px 10px}
/* company logo + invoice actions */
.logo-pick{display:flex;align-items:center;gap:14px;margin-bottom:14px}
.logo-prev{width:72px;height:72px;border-radius:16px;border:1px dashed var(--line);background:#F6F8F7;display:grid;place-items:center;overflow:hidden;flex:none;color:var(--muted)}
.logo-prev img{width:100%;height:100%;object-fit:contain;background:#fff}
.inv-logo{width:52px;height:52px;object-fit:contain;border-radius:10px;flex:none}
.inv-acts{display:flex;flex-direction:column;gap:8px}
.inv-acts-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.inv-acts-row .btn{padding:10px 6px;font-size:14px}
@media (max-width:520px){.inv-acts-row{grid-template-columns:1fr 1fr}}
.pos-done .inv{border:0;padding:0}
/* bill items table — one grid for header and rows so columns line up exactly */
.bt{margin-top:6px;border:1px solid var(--line);border-radius:14px;overflow:hidden}
.bt-h,.bt-r{display:grid;grid-template-columns:28px minmax(220px,1fr) 118px 96px 136px 100px 32px;column-gap:12px;align-items:start;padding:10px 12px}
.bt-h{align-items:center;background:#F6F8F7;font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.03em}
.bt-h .c-n{text-align:center}.bt-h .c-q{text-align:center}.bt-h .c-r{text-align:right}
.bt-r{border-top:1px solid var(--line)}
.bt-r:nth-child(even){background:#FCFDFC}
/* every cell is 38px tall on the control line */
.bt-n{height:38px;display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:13px}
.bt-item{min-width:0;min-height:38px;display:flex;flex-direction:column;justify-content:center}
.bt-name{font-weight:600;line-height:1.3}
.bt-meta{font-size:12.5px;color:var(--muted);margin-top:2px;line-height:1.35}
.bt-meta .bad{color:var(--bad);font-weight:600}
.bt-warn{display:flex;align-items:center;gap:4px;font-size:12.5px;color:var(--bad);margin-top:3px}
.bt-warn svg.i{width:14px;height:14px}
.bt-cell{display:flex;flex-direction:column;gap:4px;min-width:0}
.bt-lbl{display:none;font-size:11.5px;font-weight:600;color:var(--muted);line-height:1.2}
.bt-qcell{align-items:center}
.bt .bt-qty{height:38px;display:inline-flex;align-items:center;gap:4px;padding:3px;border-radius:11px;background:#F2F5F3}
.bt .bt-qty button{width:32px;height:32px;border:0;border-radius:9px;background:#fff;font-weight:700;font-size:16px;line-height:1;display:grid;place-items:center}
.bt .bt-qty input{width:40px;height:32px;border:0;background:transparent;text-align:center;font:inherit;font-weight:700;font-size:15px;font-variant-numeric:tabular-nums}
.bt-in{width:100%;height:38px;border:1px solid var(--line);background:#fff;border-radius:10px;padding:0 10px;text-align:right;font:inherit;font-size:15px;font-variant-numeric:tabular-nums}
.bt-in:focus{outline:2px solid var(--accent-soft);border-color:var(--accent)}
.bt-dwrap{display:flex;align-items:center;gap:6px;height:38px}
.bt-dwrap .seg.mini{height:38px;align-items:center;flex:none;padding:3px}
.bt-dwrap .seg.mini button{height:32px;width:30px;padding:0;display:grid;place-items:center}
.bt-dwrap .bt-in{flex:1;min-width:0}
.bt-amt{align-items:flex-end;justify-content:center;min-height:38px;text-align:right;line-height:1.2}
.bt-amt b{font-size:16px;font-weight:700}
.bt-amt s{font-size:12px;color:var(--muted)}
.bt-rm{width:32px!important;height:32px!important;margin-top:3px;box-shadow:none!important;background:transparent!important;color:var(--muted)}
.bt-rm:hover{color:var(--bad)}/* stock to hand over (earliest expiry) */
.give{display:block;width:fit-content;margin-top:6px;padding:4px 10px;border-radius:999px;background:var(--blue-soft);color:var(--blue);font-size:12.5px;font-weight:600;max-width:100%}
.give svg.i{width:14px;height:14px;flex:none}
.give.soon{background:var(--warn-soft);color:var(--warn)}
.exp-tag{font-size:12px;color:var(--muted);margin-top:2px}
.exp-tag.soon{color:var(--bad);font-weight:600}
/* bill totals */
.bs{margin:14px 0 12px;border:1px solid var(--line);border-radius:14px;padding:6px 14px}
.bs-r{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 0;border-bottom:1px dashed var(--line);font-size:15px}
.bs-r small{color:var(--muted);font-size:12.5px;margin-left:4px}
.bs-r .num{font-variant-numeric:tabular-nums;font-weight:600;white-space:nowrap}
.bs-r .neg{color:var(--bad)}
.bs-r.sub{color:var(--muted);font-size:14px;padding:5px 0}
.bs-r.sub .num{font-weight:500}
.bs-ctl{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.bs-ctl .bt-in{width:96px}
.bs-ctl .pos-lbl{width:150px}
.bs-total{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:10px -8px 0;padding:12px 14px;border-radius:12px;background:var(--accent-soft);color:#14632A}
.bs-total span{font-weight:700;font-size:16px}
.bs-total b{font-size:26px;font-variant-numeric:tabular-nums}
.bs-words{text-align:right;font-size:12.5px;color:var(--muted);padding:6px 0 4px}
.bs-prev{margin:8px -8px 4px;padding:4px 14px;border-radius:12px;background:var(--bad-soft);color:var(--bad)}
.bs-prev .bs-r{border-bottom:0;padding:6px 0}
/* editable bill number / date in the bill header */
.pos-by{display:flex;align-items:center;min-height:38px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pos-hf{display:flex;flex-direction:column;gap:2px;min-width:0}
.pos-hf input,.pos-hf .dp-btn{border:1px solid var(--line);background:#FAFCFB;border-radius:10px;padding:6px 8px;font:inherit;font-weight:700;font-size:15px;min-height:38px;width:100%;min-width:0}
.pos-hf input:focus,.pos-hf .dp-btn:focus-visible{outline:2px solid var(--accent-soft);border-color:var(--accent)}
/* customer dropdown */
.cust-dd{position:relative;margin-bottom:12px}
.cust-dd-btn{width:100%;display:flex;align-items:center;gap:10px;border:1px solid var(--line);background:#fff;border-radius:16px;padding:12px 14px;min-height:52px;font:inherit;font-weight:600;color:var(--ink);box-shadow:var(--shadow);text-align:left}
.cust-dd-btn span{flex:1}
.cust-dd-btn svg.i:last-child{transform:rotate(90deg);color:var(--muted)}
.cust-dd-btn[aria-expanded="true"]{border-color:var(--accent)}
.cust-dd-btn[aria-expanded="true"] svg.i:last-child{transform:rotate(-90deg)}
.cust-dd-panel{position:absolute;left:0;right:0;top:calc(100% + 6px);z-index:30;padding:10px;box-shadow:0 20px 50px rgba(22,40,30,.18)}
.cust-dd-search{box-shadow:none;border:1px solid var(--line);background:#FAFCFB;min-width:0;margin-bottom:6px}
.cust-dd-list{max-height:min(52vh,420px);overflow-y:auto}
.cust-dd-list .li{width:100%;border:0;background:none;text-align:left;font:inherit;color:inherit;padding:10px 6px}
/* product search + barcode */
.pos-search{display:flex;align-items:center;gap:8px;background:#fff;border-radius:16px;padding:6px 6px 6px 14px;box-shadow:var(--shadow);margin-bottom:8px;border:2px solid transparent}
.pos-search:focus-within{border-color:var(--accent)}
.pos-search input{flex:1;border:0;outline:0;background:transparent;font-size:16px;min-height:40px;min-width:0}
.pos-search .icon-btn{box-shadow:none;background:var(--accent-soft);color:var(--accent);flex:none}
.pos-p.hl{box-shadow:0 0 0 3px var(--accent),var(--shadow)}
.scan-box{position:relative;border-radius:16px;overflow:hidden;background:#000;aspect-ratio:4/3}
.scan-box video{width:100%;height:100%;object-fit:cover;display:block}
.scan-line{position:absolute;left:10%;right:10%;top:50%;height:2px;background:#F5B700;box-shadow:0 0 12px #F5B700}
/* product photos */
img.tile.pimg{object-fit:cover;padding:0;background:#F2F5F3;flex:none}
.prod-img{width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:12px;background:#F2F5F3;display:block}
.pos-p .prod-img{aspect-ratio:1/1;margin-bottom:2px}
.pimg-pick{display:flex;gap:14px;align-items:center}
.pimg-prev{width:96px;height:96px;border-radius:16px;background:#F2F5F3;display:grid;place-items:center;overflow:hidden;flex:none;color:var(--muted);border:1px dashed var(--line)}
.pimg-prev img{width:100%;height:100%;object-fit:cover}
.pimg-prev svg.i{width:32px;height:32px}
.pv-img{width:100%;max-width:320px;aspect-ratio:1/1;object-fit:cover;border-radius:14px;background:#F6F8F7;margin:0 auto 12px;display:block}
/* shop dashboard */
.kpi{display:flex;align-items:center;gap:14px}
.kpi .tile{width:48px;height:48px;border-radius:14px;flex:none}
.kpi .tile svg.i{width:24px;height:24px}
.kpi-b{min-width:0;flex:1}
.kpi-l{color:var(--muted);font-size:14px;font-weight:600;line-height:1.3}
.kpi-v{display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px;margin-top:2px}
.kpi-v .num{font-size:24px;font-weight:700;line-height:1.2}
.kpi-v .pill{font-size:12px;padding:2px 8px}
.dash-t{border:0;text-align:left;font:inherit;color:inherit;width:100%}
.dash-t:active{transform:scale(.98)}
.quick{display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:10px}
.quick button{border:0;border-radius:16px;padding:14px 6px;min-height:92px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;font-weight:600;font-size:13px;line-height:1.2;text-align:center}
.quick button svg.i{width:26px;height:26px}
.quick button:active{transform:scale(.96)}
/* POS billing */
.pos{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(320px,1fr);gap:16px;align-items:start}
.pos-cust{display:flex;align-items:center;gap:12px;width:100%;border:0;margin-bottom:12px;padding:12px 14px;font:inherit;color:inherit}
.pos-cust .main{flex:1}
.pos-cust .t{font-weight:600}
.pos-cust .s{font-size:13px;color:var(--muted)}
.pos-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.pos-p{position:relative;border:0;background:#fff;border-radius:16px;padding:12px;display:flex;flex-direction:column;align-items:flex-start;gap:4px;text-align:left;box-shadow:var(--shadow);min-height:150px;font:inherit;color:inherit}
.pos-p .nm{font-weight:600;line-height:1.25;font-size:14px}
.pos-p.in{box-shadow:0 0 0 2px var(--accent),var(--shadow)}
.pos-p .q{position:absolute;top:8px;right:8px;background:var(--accent);color:#fff;border-radius:999px;min-width:26px;height:26px;display:grid;place-items:center;font-weight:700;font-size:13px;padding:0 6px}
.pos-p:disabled{opacity:.45}
.pos-p .bad{color:var(--bad);font-weight:600}
.pos-p:active{transform:scale(.97)}
.pos-cart{position:sticky;top:16px}
.pos-line{display:grid;grid-template-columns:minmax(0,1fr) auto auto;grid-template-areas:"main main rm" "qty rate amt";gap:6px 10px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}
.pos-line .main{grid-area:main}
.pos-line .main .t{font-weight:600}
.pos-line .qty{grid-area:qty;justify-self:start}
.pos-line .qty input{width:44px;border:0;background:transparent;text-align:center;font-weight:700;font-size:16px}
.pos-rate{grid-area:rate;display:flex;align-items:center;gap:4px}
.pos-rate input{width:84px;border:1px solid var(--line);border-radius:10px;padding:6px 8px;text-align:right;font-size:15px;background:#FAFCFB}
.pos-amt{grid-area:amt;font-weight:700;text-align:right;min-width:72px}
.pos-rm{grid-area:rm;width:34px!important;height:34px!important;box-shadow:none!important}
.pos-tot{display:flex;flex-direction:column;gap:6px;margin:12px 0}
.pos-tot>div{display:flex;justify-content:space-between;align-items:center;font-size:14px}
.pos-tot .grand{font-size:22px;font-weight:700;border-top:1px solid var(--line);padding-top:8px}
.pos-change{font-size:22px;font-weight:700;color:var(--accent);padding-top:8px}
.pos-qr{width:200px;margin:4px auto 0;background:#fff;border-radius:12px}
.pos-qr svg{width:100%;height:auto;display:block}
.pos-go{min-height:54px;font-size:17px}
.pos-bar{display:none}
/* invoice */
.inv{border:1px solid var(--line);border-radius:16px;padding:14px;background:#fff}
.inv-h{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;padding-bottom:10px;border-bottom:1px dashed var(--line)}
.inv-shop{font-weight:700;font-size:17px}
.inv-meta{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:10px 0;border-bottom:1px dashed var(--line)}
.inv-meta .k,.inv-gst .k{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.inv-meta .v{font-weight:600}
.inv-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 10px;padding:8px 0;border-bottom:1px solid #F0F3F1}
.inv-row .nm{font-weight:600}
.inv-row .amt{font-weight:600}
.inv-row .sub{grid-column:1/-1;font-size:12px;color:var(--muted)}
.inv-tot{display:flex;flex-direction:column;gap:4px;padding:10px 0;border-bottom:1px dashed var(--line);font-size:14px}
.inv-tot>div,.inv-pay>div,.inv-gst>div{display:flex;justify-content:space-between;gap:10px}
.inv-tot .grand{font-size:20px;font-weight:700;padding-top:4px}
.inv-gst{padding:10px 0;border-bottom:1px dashed var(--line);font-size:12px;display:flex;flex-direction:column;gap:3px}
.inv-pay{padding-top:10px;display:flex;flex-direction:column;gap:4px;font-size:14px}
@media print{
  body *{visibility:hidden!important}
  #invoice,#invoice *{visibility:visible!important}
  #invoice{position:fixed;left:0;top:0;width:100%;border:0}
}
/* price comparison charts */
.pchart{display:flex;flex-direction:column}
.prow{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 10px;padding:10px 0;border-bottom:1px solid var(--line);align-items:baseline}
.prow:last-of-type{border-bottom:0}
.prow .nm{font-weight:600;font-size:14px}
.prow .km{color:var(--muted);font-size:12px}
.prow .pv{font-weight:600}
.ptrack{grid-column:1/-1;position:relative;height:16px}
.ptrack .rng{position:absolute;top:6px;height:4px;border-radius:4px;background:#BFE3C8}
.ptrack .md{position:absolute;top:2px;width:12px;height:12px;border-radius:50%;background:#21993C;box-shadow:0 0 0 2px #fff;transform:translateX(-50%)}
.ptrack .avg{position:absolute;top:-4px;bottom:-4px;border-left:2px dashed #9AA6A0}
.prow.near .md{background:#2F6FDE;width:14px;height:14px;top:1px}
.prow.near .rng{background:#C9D9F7}
.pscale{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);margin-top:4px}
.plegend{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:12px;color:var(--muted);margin-top:10px}
.plegend span{display:inline-flex;align-items:center;gap:6px}
.plegend .dot{width:10px;height:10px;border-radius:50%;display:inline-block}
.plegend .bar{width:18px;height:4px;border-radius:4px;background:#BFE3C8;display:inline-block}
.plegend .dash{width:16px;border-top:2px dashed #9AA6A0;display:inline-block}
.pvalue{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.pvalue>div{background:#F6F8F7;border-radius:14px;padding:12px}
.pvalue .k{font-size:12px;color:var(--muted)}
.pvalue .big{font-size:22px;font-weight:600}
.mcard{border:0;width:100%;text-align:left;display:block;font:inherit;color:inherit}
.mcard:active{transform:scale(.98)}
/* store finder */
.store-map{height:min(52vh,460px);border-radius:18px;overflow:hidden;background:#DDE5E0}
.store-pin{background:#21993C;color:#fff;border:3px solid #fff;border-radius:50% 50% 50% 0;transform:rotate(-45deg);box-shadow:0 2px 6px rgba(0,0,0,.35)}
.store-pin.mine{background:#F5B700}
.me-pin{background:#1A73E8;border:3px solid #fff;border-radius:50%;box-shadow:0 0 0 6px rgba(26,115,232,.25)}
/* dashboard land hero */
.hero-land{position:relative;padding:0;overflow:hidden}
.hero-land .land-mini{height:220px;border-radius:0}
.hero-land .cap{position:absolute;left:12px;right:12px;top:12px;display:flex;justify-content:space-between;gap:8px;z-index:500;pointer-events:none}
.hero-land .cap .pill{background:rgba(255,255,255,.94);color:var(--ink);box-shadow:0 2px 8px rgba(0,0,0,.2);pointer-events:auto}
.hero-land .body{padding:16px}
/* Daily Pulse quick-log grid */
.pulse{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
.pulse button{border:0;border-radius:16px;padding:14px 4px;min-height:84px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;font-weight:600;font-size:12.5px;line-height:1.2;text-align:center}
.pulse button svg.i{width:26px;height:26px}
.pulse button:active{transform:scale(.96)}
/* programme step rows */
.step{background:#F6F8F7;border-radius:16px;padding:12px;display:grid;grid-template-columns:70px 1fr;gap:8px;position:relative}
.step .full{grid-column:1/-1}
.step .rm{position:absolute;top:6px;right:6px;width:36px;height:36px}
/* land map */
.sheet.wide{width:min(1000px,100%)}
.land-map{height:min(58vh,560px);border-radius:18px;overflow:hidden;background:#DDE5E0}
.land-mini{height:240px;border-radius:16px;overflow:hidden;background:#DDE5E0;cursor:pointer}
.land-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:16px;align-items:start}
.land-vx{background:#fff;border:3px solid #F5B700;border-radius:50%;box-shadow:0 1px 4px rgba(0,0,0,.4)}
.land-vx.first{border-color:#21993C;background:#E2F4E6}
.kv{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.kv>div{background:#F6F8F7;border-radius:14px;padding:10px 12px}
.kv .k{font-size:12px;color:var(--muted)}
.kv .v{font-weight:600}
.land-bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:12px}
.land-bar .area{flex:1;min-width:180px;font-weight:600}
.leaflet-container{font-family:var(--font);isolation:isolate} /* keep map layers under the sticky top bar */
pre.msg{white-space:pre-wrap;background:#F6F8F7;border-radius:14px;padding:14px;font-family:var(--font);font-size:13px;margin:0}

@media (max-width:1000px){
  .g4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .split{grid-template-columns:1fr}
}
/* ===== phones (primary target) ===== */
@media (max-width:760px){
  body{font-size:16px}
  .app{grid-template-columns:1fr}
  .mobile-only{display:flex}
  main{padding:14px 14px calc(96px + env(safe-area-inset-bottom))}
  .app.solo main{padding-top:calc(14px + env(safe-area-inset-top))}

  /* top navigation: logo + user on one row, swipeable menu row below */
  .side{flex-wrap:wrap;gap:8px 10px;padding:calc(8px + env(safe-area-inset-top)) 12px 0}
  .side .logo{font-size:17px}
  .side .logo b{width:30px;height:30px;border-radius:10px}
  .side-foot{display:none}
  .nav{order:3;flex:0 0 100%;padding-bottom:8px;margin:0 -12px;padding-left:12px;padding-right:12px}
  .nav a{padding:8px 12px;font-size:14px}
  .user-chip .xs{display:none}

  /* header */
  .top{flex-wrap:wrap;gap:10px;margin-bottom:16px}
  .top>div:first-child{flex:1;min-width:0}
  .top .date{font-size:13px}
  .top h1{font-size:24px}
  .top-actions{flex-wrap:wrap;justify-content:flex-end}

  /* layout */
  .grid{gap:14px}
  .split,.stack{gap:14px}
  .g3,.g2{grid-template-columns:1fr}
  .g4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .card{padding:18px;border-radius:18px}
  .row.between,.sec-h{flex-wrap:wrap;gap:8px}
  .qa{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  .qa button{padding:14px 4px;min-height:92px;font-size:13px;text-align:center}
  .stat{gap:10px}
  .stat .v{font-size:21px;word-break:break-word}
  .mini-stats{gap:8px}
  .mini-stats .card{padding:12px}
  .mini-stats .v{font-size:22px}
  .focus h3{font-size:19px}
  .prod-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .kpi{gap:10px;padding:14px}
  .kpi .tile{width:40px;height:40px;border-radius:12px}
  .kpi-l{font-size:13px}
  .kpi-v .num{font-size:19px}
  .quick{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
  .quick button{min-height:84px;padding:10px 2px;font-size:11.5px;border-radius:14px}
  .quick button svg.i{width:24px;height:24px}
  .pos{grid-template-columns:1fr;gap:12px}
  .pos-head{grid-template-columns:1fr 1fr}
  .bs-total b{font-size:22px}

  .pos-biller{grid-column:1/-1}
  .pl-f input{width:76px}
  .pos-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .pos-p{min-height:138px;padding:10px}
  .pos-cart{position:static}
  .pos-bar{display:flex;position:fixed;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));z-index:30;align-items:center;justify-content:space-between;gap:10px;border:0;border-radius:18px;padding:14px 18px;background:var(--grad);color:#fff;font:inherit;font-weight:600;box-shadow:0 10px 28px rgba(33,153,60,.4)}
  .pos-bar b{font-size:18px}
  .pos-bar span{display:inline-flex;align-items:center;gap:6px}
  .pulse{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
  .pulse button{min-height:78px;padding:10px 2px;font-size:12px;border-radius:14px}
  .wx-days{gap:5px}
  .wx-days div{padding:8px 2px;font-size:11px}
  .inv-r{width:84px}
  .li{gap:12px;padding:14px 2px}
  .tl{padding-left:26px}

  /* touch targets: at least 44px */
  .btn{min-height:46px;padding:12px 18px;font-size:15px}
  .btn.sm{min-height:40px;padding:8px 14px;font-size:14px}
  .chip{padding:10px 16px;min-height:40px}
  .seg button,.seg .segl{padding:11px 10px;font-size:14px}
  .icon-btn{width:44px;height:44px}
  .link{padding:8px 0;font-size:14px}
  .qty{gap:8px}
  .qty button{width:38px;height:38px;font-size:18px}
  .stars button{font-size:28px;padding:2px 4px}
  .week button{padding:6px 0}

  /* forms: 16px stops iOS zooming into inputs */
  .inp,select.inp,textarea.inp{font-size:16px;padding:12px 14px;min-height:46px}
  .search{padding:10px 14px}
  .search input{font-size:16px}
  .fields.two{grid-template-columns:1fr}
  label.f{font-size:14px}

  /* bottom nav, above the home indicator */
  .fab-desk{display:none}
  .bnav{display:flex;position:fixed;right:16px;bottom:calc(16px + env(safe-area-inset-bottom));z-index:30}
  .toast{bottom:calc(90px + env(safe-area-inset-bottom));max-width:calc(100% - 32px);text-align:center}
  .search{min-width:0;flex:1}

  /* sheets slide up from the bottom; header stays visible while scrolling */
  .modal{padding:0;align-items:flex-end}
  .sheet{width:100%;border-radius:22px 22px 0 0;max-height:92vh;max-height:92dvh;padding:0 16px calc(20px + env(safe-area-inset-bottom));animation:up .22s ease-out}
  .sheet-h{position:sticky;top:0;background:#fff;z-index:5;margin:0 -16px 12px;padding:14px 16px 10px;border-bottom:1px solid var(--line)}
  .sheet-h h2{font-size:18px}

  /* land map editor: full screen */
  .sheet.wide{height:100vh;height:100dvh;max-height:none;border-radius:0;display:flex;flex-direction:column;padding-top:env(safe-area-inset-top)}
  .sheet.wide .land-map{flex:1;height:auto;min-height:260px;border-radius:14px}
  .land-grid{grid-template-columns:1fr}
  .land-mini{height:200px}
  .land-bar{gap:6px}
  .land-bar .area{flex-basis:100%;min-width:0}
  .land-bar .btn{flex:1}
  .kv{gap:6px}

  .auth-wrap{padding:calc(16px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom));place-items:start center}
  .auth .hero{padding:22px 20px;border-radius:22px}
  .auth .hero h1{font-size:24px}
  .prefix span{padding:12px}
}
@keyframes up{from{transform:translateY(40px);opacity:.6}to{transform:none;opacity:1}}
/* very small phones */
@media (max-width:360px){
  main{padding-left:10px;padding-right:10px}
  .g4{grid-template-columns:1fr 1fr}
  .stat .v{font-size:18px}
  .bnav .pillnav a{width:42px}
}
/* phones in landscape: keep the map usable */
@media (max-height:500px) and (max-width:900px){
  .sheet.wide .land-map{min-height:160px}
}
/* no hover on touch screens */
@media (hover:none){
  .nav a:hover,.chip:not(.on):hover,.li.click:hover{background:inherit}
  .btn:hover{filter:none}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}


/* radio-as-segment for the order form */
.seg label{position:relative;display:flex}
.seg .segl{flex:1;text-align:center;border-radius:999px;padding:8px 10px;font-weight:600;font-size:13px;color:var(--muted);cursor:pointer}
.seg input:checked+.segl{background:#fff;color:var(--ink);box-shadow:0 1px 4px rgba(0,0,0,.08)}
.seg input:focus-visible+.segl{outline:2px solid var(--blue)}

/* auth + onboarding */
.app.solo{grid-template-columns:1fr}
.app.solo .side{display:none}
.auth-wrap{min-height:100vh;display:grid;place-items:center;padding:24px 16px}
.auth{width:min(440px,100%);display:flex;flex-direction:column;gap:18px}
.auth .hero{background:var(--grad);color:#fff;border-radius:28px;padding:28px 24px;position:relative;overflow:hidden}
.auth .hero::after{content:"";position:absolute;right:-40px;top:-40px;width:180px;height:180px;border-radius:50%;background:rgba(255,255,255,.12)}
.auth .hero h1{font-size:28px;margin-top:14px}
.auth .hero p{margin:6px 0 0;color:#DFF5E4}
.auth .hero .logo b{background:rgba(255,255,255,.2)}
.divider{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:12px}
.divider::before,.divider::after{content:"";flex:1;height:1px;background:var(--line)}
.gbtn{background:#fff;color:var(--ink);box-shadow:inset 0 0 0 1px var(--line)}
.err{background:var(--bad-soft);color:var(--bad);border-radius:12px;padding:10px 12px;font-size:13px;font-weight:600}
.role-card{display:flex;gap:16px;align-items:center;text-align:left;border:0;width:100%;padding:20px}
.role-card:hover{box-shadow:0 0 0 2px var(--accent),var(--shadow)}
.prefix{display:flex;align-items:center;gap:0}
.prefix span{padding:10px 12px;background:#EEF4EF;border:1px solid var(--line);border-right:0;border-radius:12px 0 0 12px;font-weight:600}
.prefix .inp{border-radius:0 12px 12px 0}
.loading{min-height:100vh;display:grid;place-items:center;color:var(--muted)}
.spin{width:34px;height:34px;border-radius:50%;border:3px solid var(--accent-soft);border-top-color:var(--accent);animation:sp 0.8s linear infinite;margin:0 auto 12px}
@keyframes sp{to{transform:rotate(360deg)}}
.user-chip{display:flex;align-items:center;gap:10px;padding:10px;border-radius:14px;background:#fff;box-shadow:var(--shadow)}
.user-chip .av{width:34px;height:34px;border-radius:50%;background:var(--grad);color:#fff;display:grid;place-items:center;font-weight:700}
.user-chip .nm{font-weight:600;font-size:14px;line-height:1.2}
.offline{position:fixed;top:10px;left:50%;transform:translateX(-50%);background:var(--warn-soft);color:#7A5410;padding:6px 14px;border-radius:999px;font-size:12px;font-weight:600;z-index:70}
/* shop (PC / big screen): use the full width */
.app.wide>main{max-width:none;padding-left:clamp(16px,2.2vw,40px);padding-right:clamp(16px,2.2vw,40px)}
.app.wide .side{padding-left:clamp(16px,2.2vw,40px);padding-right:clamp(16px,2.2vw,40px)}
@media (min-width:1200px){
  .app.wide .pos{grid-template-columns:minmax(0,1.7fr) minmax(420px,1fr);gap:22px}
  .app.wide .pos-grid{grid-template-columns:repeat(auto-fill,minmax(170px,1fr))}
  .app.wide .split{grid-template-columns:minmax(0,1.6fr) minmax(0,1fr)}
  .app.wide .qa{grid-template-columns:repeat(6,minmax(0,1fr))}
  .app.wide .g3{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (min-width:1600px){
  .app.wide .grid.g2{grid-template-columns:repeat(3,minmax(0,1fr))}
}
/* the bill table adapts to the bill panel's own width (stacked rows when narrow) */
.pos-cart{container-type:inline-size;container-name:bill}
/* medium bill panel: name on its own line, then one aligned row of Qty | Rate | Discount | Amount */
@container bill (max-width:859px){
  .bt-h{display:none}
  .bt-n{display:none}
  .bt-r{grid-template-columns:118px minmax(0,1fr) minmax(0,1.35fr) minmax(0,1fr) 32px;grid-template-areas:"item item item item rm" "qty rate disc amt amt";row-gap:10px;column-gap:10px;padding:12px 14px}
  .bt-item{grid-area:item;min-height:0}.bt-rm{grid-area:rm;margin-top:-2px}
  .bt-qcell{grid-area:qty;align-items:flex-start}.bt-rate{grid-area:rate}.bt-disc{grid-area:disc}.bt-amt{grid-area:amt}
  .bt-lbl{display:block}
  .bt-amt{justify-content:flex-start}
  .bt-amt b{height:38px;display:flex;align-items:center;font-size:17px}
  .bt-amt s{margin-top:-6px}
}
/* narrow (phones): 2 × 2 */
@container bill (max-width:479px){
  .bt-r{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 32px;grid-template-areas:"item item rm" "qty rate ." "disc amt .";padding:12px}
}
@media (min-width:1400px){ .app.wide .pos{grid-template-columns:minmax(0,1.15fr) minmax(660px,1fr)} }
@media (min-width:1800px){ .app.wide .pos{grid-template-columns:minmax(0,1.4fr) minmax(760px,1fr)} }
/* Title Case for interface labels (not for typed data) */
h1,h2,h3,.btn,.seg button,.seg .segl,.nav a,.qa button,label.f,.bt-lbl,.bt-h,.kpi-l,.pmenu button,.pmenu a,th,.bs-r>span:first-child,.cust-dd>button,.pos-hf>span,.bs-prev,.bs-total,.dp-title,::placeholder{text-transform:capitalize}
label.f input,label.f select,label.f textarea,label.f option{text-transform:none}
/* themed date picker */
.dp-btn{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;font-family:inherit;color:var(--ink);text-align:left;cursor:pointer}
.dp-btn:not(.inp){border:1px solid var(--line);background:#FAFCFB;border-radius:12px;padding:10px 12px;font-size:14px;font-weight:500}
.dp-btn svg.i{width:18px;height:18px;color:var(--muted);flex:none}
.dp-btn.empty .dp-v{color:var(--muted)}
.dp-btn:focus-visible{outline:2px solid var(--accent-soft);border-color:var(--accent)}
.dp{position:fixed;z-index:300;width:300px;background:var(--card);border-radius:var(--r-sm);padding:12px;box-shadow:0 12px 40px rgba(22,40,30,.16),0 0 0 1px var(--line)}
.dp.sheet{left:0!important;right:0;bottom:0;top:auto!important;width:auto;border-radius:var(--r) var(--r) 0 0;padding:16px 16px calc(16px + env(safe-area-inset-bottom))}
.dp-head{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-bottom:8px}
.dp-head b,.dp-title{font-weight:700;font-size:15px;color:var(--ink)}
.dp-title{border:0;background:transparent;border-radius:10px;padding:6px 10px;font-family:inherit;cursor:pointer}
.dp-title:hover{background:var(--accent-soft)}
.dp-nav{width:34px;height:34px;border:0;border-radius:50%;background:#EBF0ED;display:grid;place-items:center;color:var(--ink);cursor:pointer}
.dp-nav:hover{background:var(--accent-soft);color:var(--accent)}
.dp-nav svg.i{width:16px;height:16px}
.dp svg.flip{transform:scale(-1,1)}
.dp-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}
.dp-grid.three{grid-template-columns:repeat(3,1fr);gap:6px}
.dp-wk span{text-align:center;font-size:12px;font-weight:600;color:var(--muted);padding:4px 0}
.dp-d,.dp-c{border:0;background:transparent;border-radius:10px;font-family:inherit;font-size:14px;font-weight:500;color:var(--ink);cursor:pointer}
.dp-d{aspect-ratio:1;min-height:36px;display:grid;place-items:center}
.dp-c{padding:12px 0;font-weight:600}
.dp-d:hover:not(:disabled),.dp-c:hover{background:var(--accent-soft);color:var(--accent)}
.dp-d.now{box-shadow:inset 0 0 0 1.5px var(--accent);color:var(--accent);font-weight:700}
.dp-d.on,.dp-c.on{background:var(--grad);color:#fff;font-weight:700;box-shadow:0 6px 14px rgba(33,153,60,.25)}
.dp-d:disabled{color:#C3CCC7;cursor:not-allowed}
.dp-foot{display:flex;justify-content:space-between;gap:8px;margin-top:10px;padding-top:10px;border-top:1px solid var(--line)}
.dp-foot .btn{flex:1}
.pos-hf .dp-btn{font-weight:700;font-size:15px;padding:6px 8px;border-radius:10px}

/* customer page */
svg.i.flip{transform:scale(-1,1)}
svg.i.flipv{transform:scale(1,-1)}
.cp-top{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(300px,100%),1fr));gap:18px;margin-bottom:18px}
.cp-card{display:flex;flex-direction:column}
.cp-card>.btn.full,.cp-card>.cp-pay{margin-top:auto}
.cp-av{width:56px;height:56px;border-radius:18px;font-size:22px;flex:none}
.cp-name{display:flex;align-items:center;flex-wrap:wrap;gap:8px;font-size:20px;font-weight:700;line-height:1.3}
.cp-info{display:flex;flex-direction:column;gap:10px;margin:16px 0}
.cp-line{display:flex;align-items:flex-start;gap:10px;font-weight:500}
.cp-line svg.i{width:18px;height:18px;color:var(--muted);flex:none;margin-top:3px}
.cp-big{font-size:30px;font-weight:700;line-height:1.2}
.cp-pay{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;align-items:end}
.cp-pay label.f{min-width:0;margin:0}
.cp-pay label.f:first-child{grid-column:1/-1}
.cp-pay .inp{width:100%;height:46px}
.cp-pay .cp-mode{min-width:0}
.cp-pay .btn{height:46px;min-height:46px;width:100%;justify-content:center}
.cp-card .msg{margin:0 0 12px}
.cp-grid{display:grid;gap:18px;align-items:start}
@media(min-width:1100px){.cp-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
.cp-sec{padding:16px 18px}
.cp-inv .right{text-align:right;display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.cp-acts{display:flex;gap:6px;flex:none}
.cp-invview{padding:4px 0 18px;border-bottom:1px solid var(--line)}
@media(max-width:640px){.cp-inv{flex-wrap:wrap}.cp-acts{width:100%;padding-left:62px}.cp-acts .btn{flex:1}}
.top-actions label.btn{cursor:pointer}a.btn{text-decoration:none}

/* ===== Minimal white theme: white page, no gradients, one accent colour ===== */
:root{
  --bg:#FFFFFF; --card:#FFFFFF; --line:#E8ECEA; --muted:#6F7A75;
  --accent:#1E8E3A; --accent-soft:#EEF6F0; --blue:#1E8E3A; --blue-soft:#F4F6F5;
  --grad:#1E8E3A; --grad-soft:#F7F8F8;
  --lav:#16211B; --lav-soft:#F4F6F5; --peach:#16211B; --peach-soft:#F4F6F5;
  --shadow:0 0 0 1px var(--line);
}
body{background:#fff}
body::before{display:none}
/* icon tiles: neutral, only problems stay red */
.t-mint,.t-sky,.t-lav,.t-peach{background:#F4F6F5;color:var(--ink)}
.t-bad{background:var(--bad-soft);color:var(--bad)}
/* no coloured glows */
.btn,.fab,.av-btn,.nav a.on,.week button.on b,.tl .it.hot,.pos-bar,.dp-d.on,.dp-c.on,.pos-p.in,.pos-p.hl{box-shadow:none}
.pos-p.in{box-shadow:0 0 0 2px var(--accent)}
.pos-p.hl{box-shadow:0 0 0 2px var(--ink)}
.btn.ghost{box-shadow:inset 0 0 0 1px var(--line)}
/* menu: active item is a quiet grey pill */
.nav a.on{background:#F1F3F2;color:var(--ink)}
.nav a.on .badge{background:var(--accent);color:#fff}
.chip.on{background:var(--ink);color:#fff}
.focus,.wx{background:#F7F8F8}
.av-btn{background:var(--ink)}
.icon-btn{box-shadow:0 0 0 1px var(--line)}.pos-b2b{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:10px;margin:-2px 0 10px}
@media(max-width:480px){.pos-b2b{grid-template-columns:1fr}}

/* Bills page: bills and quotations */
.bl-bar{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:12px}
.bl-tabs{flex:0 0 auto;min-width:300px}
.bl-tabs button{padding:9px 18px;font-size:14px}
.bl-n{font-weight:600;opacity:.6;margin-left:4px}
.bl-bar .search{flex:1;min-width:220px}
.bl-card{padding:4px 16px}
.bl-item{border-bottom:1px solid var(--line)}
.bl-item:last-child{border-bottom:0}
.bl-item>.li{border-bottom:0}
.bl-amt{display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex:none;min-width:96px;text-align:right}
.bl-acts{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px;flex:none;width:620px}
.bl-del{width:34px;height:34px;box-shadow:none;background:transparent;color:var(--muted)}
.bl-del:hover{color:var(--bad);background:var(--bad-soft)}
.inv-send{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:8px;margin-bottom:8px}
.inv-send .btn{width:100%}
.pos-editing{margin-bottom:12px}
.pos-editing .link{margin-left:auto}
@media(max-width:1280px){.bl-row{flex-wrap:wrap}.bl-acts{width:100%;justify-content:flex-start;padding-left:58px}}
@media(max-width:480px){.bl-tabs{min-width:0;width:100%}.bl-acts{padding-left:0}}

/* email addresses keep their own case */
a[href^="mailto"]{text-transform:none}

/* Settings: invoice design picker */
.tpl-pick{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.tpl{display:flex;flex-direction:column;align-items:stretch;gap:8px;border:0;background:transparent;padding:0;font:inherit;color:var(--ink);cursor:pointer;text-align:center}
.tp-page{position:relative;display:block;aspect-ratio:210/297;background:#fff;border-radius:8px;box-shadow:0 0 0 1px var(--line);overflow:hidden}
.tpl.on .tp-page{box-shadow:0 0 0 2px var(--accent)}
.tpl:hover .tp-page{box-shadow:0 0 0 2px #C9D2CD}
.tpl.on:hover .tp-page{box-shadow:0 0 0 2px var(--accent)}
.tpl-l{display:inline-flex;align-items:center;justify-content:center;gap:4px;font-weight:600;font-size:14px}
.tpl-l svg.i{width:16px;height:16px;color:var(--accent)}
.tp-page i{position:absolute;display:block;border-radius:1px}
.tp-band{left:0;right:0;top:0;height:3%}
.tp-l{left:9%;height:2.2%;background:#C9CED6}
.tp-l.w60{top:9%;width:45%;background:#1C2420}.tp-l.w40{top:14%;width:32%}.tp-l.w50{top:16%;width:40%}
.tp-l.dk{background:#1C1C28}
.tp-head{left:8%;right:8%;top:30%;height:5%}
.tp-row{left:8%;right:8%;height:2%;background:#E3E6EA}
.tp-row:nth-of-type(5){top:40%}.tp-row:nth-of-type(6){top:46%}
.tp-classic .tp-row:nth-of-type(5){top:39%}.tp-classic .tp-row:nth-of-type(6){top:45%}
.tp-row.dk{background:#3B3B48;height:1px}
.tp-tot{right:8%;top:56%;width:34%;height:3%;background:#1C2420}
.tp-title{right:8%;top:6%;width:36%;height:5%}
.tp-box{right:8%;top:58%;width:38%;height:6%}
.tp-foot{left:8%;right:8%;top:86%;height:1px}
.tp-sq{left:9%;top:6%;width:9%;aspect-ratio:1;background:#111}
.tp-panel{left:8%;right:8%;top:17%;height:13%;background:#EFF1F3}
.tp-rule{left:8%;right:8%;top:36%;height:1px;background:#111}
.tp-clean .tp-row:nth-of-type(5){top:42%}.tp-clean .tp-row:nth-of-type(6){top:48%}
.tp-hatch{left:8%;top:58%;width:34%;height:7%;background:repeating-linear-gradient(135deg,#F2F3F4 0 2px,#E3E5E8 2px 3px)}
.tp-page .g{background:var(--accent)}.tp-page .v{background:#4F4597}.tp-page .k{background:#111}
.sign-l{font-size:14px;font-weight:600;color:#4A5751}
.sign-prev{width:120px}
.sign-prev img{object-fit:contain}

/* Accounts: double-entry books */
.bk-card{padding:16px 18px}
.bk-lh{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.bk-lh h2{font-size:17px}
.bk-card .r,.bk-t .r{text-align:right}
.bk-vh,.bk-vr{display:grid;grid-template-columns:110px minmax(180px,1.1fr) minmax(0,2fr) 140px;gap:12px;align-items:center}
.bk-vh{font-size:12px;font-weight:600;color:var(--muted);padding:0 8px 8px;border-bottom:1px solid var(--line)}
.bk-v{border-bottom:1px solid var(--line)}
.bk-v:last-child{border-bottom:0}
.bk-vr{width:100%;border:0;background:transparent;font:inherit;color:inherit;text-align:left;padding:11px 8px;cursor:pointer;border-radius:10px}
.bk-vr:hover{background:#F7F9F8}
.bk-vr b{margin-right:8px;font-weight:600}
.bk-narr{color:var(--muted);font-size:14px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bk-v.open .bk-narr{white-space:normal}
.bk-lines{margin:0 8px 12px;border:1px solid var(--line);border-radius:12px;padding:6px 12px}
.bk-lines>div:not(.bk-la){display:grid;grid-template-columns:36px minmax(0,1fr) 130px 130px;gap:10px;padding:7px 0;border-bottom:1px dashed var(--line);font-size:14px}
.bk-lines>div:nth-last-child(1):not(.bk-la),.bk-lines>div:nth-last-child(2):has(+.bk-la){border-bottom:0}
.bk-lines span:first-child{font-weight:700;color:var(--muted)}
.bk-lines .num{text-align:right}
.bk-la{padding:8px 0 4px}
.bk-ltop{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.bk-lsel{max-width:340px}
.bk-th,.bk-tr{display:grid;grid-template-columns:96px minmax(0,2fr) minmax(150px,1fr) 120px 120px 150px;gap:10px;align-items:start;padding:9px 6px;border-bottom:1px solid var(--line);font-size:14px}
.bk-th{font-size:12px;font-weight:600;color:var(--muted);padding-top:0}
.bk-n{display:block;margin-top:2px}
.bk-sub{color:var(--muted)}
.bk-tot{font-weight:700;border-bottom:0;border-top:2px solid var(--ink)}
.bk-pr{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto 20px;gap:10px;align-items:center;border:0;border-bottom:1px solid var(--line);background:transparent;font:inherit;color:inherit;padding:11px 6px;text-align:left;cursor:pointer}
.bk-pr:hover{background:#F7F9F8}
.bk-pr svg.i{width:16px;height:16px;color:var(--muted)}
.bk-tg{font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;padding:14px 6px 6px}
.bk-tbr{display:grid;grid-template-columns:minmax(0,1fr) 150px 150px;gap:10px;padding:8px 6px;border-bottom:1px solid var(--line);font-size:14px;align-items:center}
.bk-tbr .link{font:inherit;color:inherit;text-align:left;padding:0;border:0;background:none;cursor:pointer}
.bk-tbr .link:hover{color:var(--accent)}
.bk-th3{font-size:12px;font-weight:600;color:var(--muted)}
.bk-t{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;border:1px solid var(--line);border-radius:12px;overflow:hidden}
.bk-t>div{display:flex;flex-direction:column;padding:4px 14px 10px}
.bk-t>div+div{border-left:1px solid var(--line)}
.bk-sh{font-size:12px;font-weight:700;color:var(--muted);padding:10px 0 6px;border-bottom:1px solid var(--line);text-transform:uppercase;letter-spacing:.04em}
.bk-sr{display:flex;justify-content:space-between;gap:12px;padding:7px 0;font-size:14px;border-bottom:1px dashed var(--line)}
.bk-sr.bk-tot{margin-top:auto;border-bottom:0;border-top:2px solid var(--ink);padding-top:9px}
.bk-sr.bk-hl{font-weight:700}
.bk-sr.bk-gh{font-weight:700;border-bottom:0;padding-top:10px}
.bk-sr.bk-in{padding-left:14px;color:var(--muted)}
.bk-from{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:600}
.bk-from .dp-btn,.bk-from input{width:170px}
.bk-coah,.bk-coar{display:grid;grid-template-columns:minmax(0,1fr) 160px 150px 90px;gap:10px;align-items:center;padding:6px;font-size:14px}
.bk-coah{font-size:12px;font-weight:600;color:var(--muted);border-bottom:1px solid var(--line)}
.bk-coar{border-bottom:1px solid var(--line)}
.bk-coar .inp{padding:7px 10px;min-height:36px}
.vf{margin-bottom:12px}
.vf-types{flex-wrap:wrap}
.vf-types button{flex:1 0 auto}
.vf-head{display:grid;grid-template-columns:200px minmax(0,1fr);gap:12px;margin-top:14px}
.vf-simple{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:12px}
.vf-grid{margin-top:12px}
.vf-gh,.vf-gr,.vf-gt{display:grid;grid-template-columns:minmax(0,1fr) 150px 150px 36px;gap:8px;align-items:center}
.vf-gh{font-size:12px;font-weight:600;color:var(--muted);padding-bottom:6px}
.vf-gr{margin-bottom:8px}
.vf-gt{padding-top:6px;border-top:1px solid var(--line);font-weight:700}
.vf-gt .num{text-align:right;padding-right:12px}
.vf-diff{color:var(--bad);font-weight:600;font-size:14px;text-align:right;margin-top:6px}
@media(max-width:900px){
 .bk-vh{display:none}.bk-vr{grid-template-columns:1fr auto;gap:4px 10px}.bk-vr>span:nth-child(1){grid-column:1/-1;font-size:12px;color:var(--muted)}.bk-narr{grid-column:1/-1;order:3}
 .bk-th{display:none}.bk-tr{grid-template-columns:1fr auto;gap:2px 10px}.bk-tr>span:nth-child(1),.bk-tr>span:nth-child(3){font-size:12px;color:var(--muted)}.bk-tr>span:nth-child(4):empty,.bk-tr>span:nth-child(5):empty{display:none}
 .bk-t{grid-template-columns:1fr}.bk-t>div+div{border-left:0;border-top:1px solid var(--line)}
 .bk-tbr{grid-template-columns:minmax(0,1fr) 110px 110px}
 .bk-coah{display:none}.bk-coar{grid-template-columns:1fr 1fr;row-gap:6px}.bk-coar>span:first-child{grid-column:1/-1;font-weight:600}
 .vf-head,.vf-simple{grid-template-columns:1fr}.vf-gh,.vf-gr,.vf-gt{grid-template-columns:minmax(0,1fr) 96px 96px 32px}
 .bk-ltop{flex-direction:column;align-items:stretch}.bk-lsel{max-width:none}
}
.vf-gt .btn{justify-self:start}

/* Add Stock screen */
.rs-form{max-width:860px}
.rs-sec{margin-bottom:14px}
.rs-h{font-size:17px;margin-bottom:12px}
.rs-line{padding:14px}
.rs-info{grid-template-columns:repeat(3,minmax(0,1fr))}
.rs-info .v{font-size:14px}
@media (max-width:420px){.rs-info{grid-template-columns:1fr 1fr}.rs-info>div:last-child{grid-column:1/-1}}
/* interactive charts (ui/charts.js) */
.vz-h{font-size:16px;margin-bottom:10px}
.vz-read{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline;min-height:26px;margin:2px 0 6px;font-size:14px}
.vz-read b{font-weight:700}
.vz-read .num{font-weight:700;font-size:16px}
.vz-hit{fill:transparent;cursor:pointer}
.vz .vz-m{transition:opacity .15s}
.vz.vz-picked .vz-m{opacity:.45}
.vz.vz-picked .vz-m.vz-on{opacity:1}
.vz-dwrap{display:flex;align-items:center;gap:16px}
.vz-dsvg{width:150px;height:150px;flex:none}
.vz-seg{cursor:pointer}
.vz-dt{font-size:11px;fill:var(--muted)}
.vz-dv{font-size:17px;font-weight:700;fill:var(--ink)}
.vz-legend{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.vz-lg{display:grid;grid-template-columns:12px 1fr auto 42px;gap:8px;align-items:center;border:0;background:none;padding:8px 6px;border-radius:10px;text-align:left;font-size:14px}
.vz-lg i{width:12px;height:12px;border-radius:4px}
.vz-lg .muted{text-align:right}
.vz-lg.vz-on{background:#F1F6F3}
.vz-hb{display:flex;flex-direction:column;gap:12px}
.vz-hbr .t{font-weight:600}
.vz-hbr.click{cursor:pointer;border-radius:10px;margin:-4px;padding:4px}
.vz-hbr.click:active{background:#F1F6F3}
.vz-track{height:8px;border-radius:99px;background:#EEF2EF;margin-top:6px;overflow:hidden}
.vz-track i{display:block;height:100%;border-radius:99px}
.vz-delta{font-size:12.5px;font-weight:700;padding:3px 8px;border-radius:99px;background:#F1F4F2;color:var(--muted)}
.vz-delta.up{background:var(--accent-soft);color:#14632A}
.vz-delta.down{background:var(--bad-soft);color:#A3322E}
.vz-seg-btns{flex:none}
.vz-seg-btns button{padding:6px 12px}
.vz-spark{width:72px;height:24px;display:block;margin-left:auto;margin-bottom:2px}
.pp-loss{color:var(--bad)}
.pp-row .right{display:flex;flex-direction:column;align-items:flex-end}
@media (max-width:520px){.vz-dwrap{flex-direction:column;align-items:stretch}.vz-dsvg{margin:0 auto}.vz-spark{display:none}}
/* shared invoice page (customer opens the link) */
.shared-wrap{max-width:760px;margin:0 auto}
.app.shared-view main{padding-top:20px}

/* ===== Green accents on a white page: green outlines keep cards apart, green marks where you are and where sections start.
   Red stays only for problems (overdue, out of stock, loss). ===== */
:root{
  --bg:#FFFFFF; --line:#DCEBE1; --accent-soft:#E3F3E8; --mint-tint:#EEF7F1;
  --shadow:0 0 0 1px #DCEBE1, 0 2px 10px rgba(30,142,58,.05);
}
body{background:var(--bg)}
/* top bar: white with a green line under it; active menu item filled green */
.side{background:rgba(255,255,255,.94);border-bottom:2px solid var(--accent-soft)}
.nav a.on{background:var(--accent);color:#fff}
.nav a.on .badge{background:#fff;color:var(--accent)}
.nav a:not(.on):hover{color:var(--accent)}
.av-btn{background:var(--accent)}
/* page title: short green underline */
.top h1::after{content:"";display:block;width:36px;height:4px;border-radius:4px;background:var(--accent);margin-top:8px}
/* section headings: green bar on the left */
.sec-h h2,.rs-h,.vz-h,.card>h2:first-child,.card>.row>h2:first-child,.card>.sec-h>h2:first-child{border-left:4px solid var(--accent);padding-left:10px;line-height:1.25}
/* active tabs / chips / segments in green (not black) */
.chip.on{background:var(--accent);color:#fff}
.chip:not(.on){background:#fff;box-shadow:inset 0 0 0 1px var(--line)}
.seg{background:var(--mint-tint)}
.seg button.on{color:var(--accent);box-shadow:0 0 0 1px var(--line)}
/* icon tiles and info boxes: light green; problems keep red */
.t-mint,.t-sky,.t-lav{background:var(--accent-soft);color:var(--accent)}
.t-peach{background:#FFF4E5;color:#B26A00}
.kv>div{background:var(--mint-tint)}
.pos-tot .grand{border-top:2px solid var(--accent-soft)}
.li{border-bottom-color:#E6F0E9}
/* inputs and search: green when focused */
.inp:focus{outline:3px solid var(--accent-soft);border-color:var(--accent)}
.search:focus-within{box-shadow:0 0 0 2px var(--accent)}
.btn.ghost{box-shadow:inset 0 0 0 1px var(--line)}
.btn.ghost:hover{color:var(--accent)}
/* ===== Phones: one-row top bar + bottom tab bar (computers keep the top menu) ===== */
.tabbar{display:none}
@media (max-width:760px){
  .side{flex-wrap:nowrap;gap:10px;padding:calc(8px + env(safe-area-inset-top)) 14px 8px}
  .side .nav{display:none}
  .side #userChip{order:2;margin-left:auto}
  .bnav{display:block;position:fixed;left:0;right:0;bottom:0;z-index:45;background:rgba(255,255,255,.97);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-top:1px solid var(--line);padding:4px 4px calc(4px + env(safe-area-inset-bottom));box-shadow:0 -6px 18px rgba(22,40,30,.06)}
  .tabbar{display:flex;justify-content:space-around;align-items:stretch}
  .tabbar a,.tabbar button{flex:1 1 0;min-width:0;min-height:56px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:4px 2px;border:0;background:none;color:var(--muted);font:inherit;font-size:11.5px;font-weight:600;text-decoration:none;position:relative;-webkit-tap-highlight-color:transparent}
  .tabbar .tab-i{display:grid;place-items:center;width:52px;height:30px;border-radius:999px;transition:background .15s}
  .tabbar svg.i{width:22px;height:22px}
  .tabbar .tab-l{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .tabbar .on{color:var(--accent)}
  .tabbar .on .tab-i{background:var(--accent-soft)}
  .tabbar .badge{position:absolute;top:2px;left:calc(50% + 8px);font-size:10.5px;padding:0 6px;line-height:17px}
  .bnav .fab{position:absolute;right:16px;bottom:calc(100% + 14px)}
  main{padding-bottom:calc(120px + env(safe-area-inset-bottom))}
  .pos-bar{bottom:calc(76px + env(safe-area-inset-bottom))}
  .toast{bottom:calc(86px + env(safe-area-inset-bottom))}
  .app.solo .bnav{display:none}
}
/* product cards: long names stay on two lines */
.pos-p .nm{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
/* ===== Phones: thumb-size controls in the bill ===== */
@media (max-width:760px){
  .bt .bt-qty{height:48px;gap:6px;padding:4px}
  .bt .bt-qty button{width:40px;height:40px;font-size:20px}
  .bt .bt-qty input{width:46px;height:40px;font-size:16px}
  .bt-rm{width:40px!important;height:40px!important}
  .seg.mini button{min-width:42px;min-height:40px}
  .seg button{min-height:40px}
  .pos-lbl{min-height:40px}
}
@media (max-width:760px){.search input{min-height:34px}.bt .bt-in{min-width:64px}}

/* Add Stock on phones: short fields side by side (less scrolling per item) */
@media (max-width:760px){.rs-form .fields.two{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px 10px}}

/* Billing phone bar: count + total on the left, the action as a clear white button on the right */
@media (max-width:760px){
  .pos-bar{padding:10px 10px 10px 18px}
  .pos-bar .pb-l{display:flex;flex-direction:column;align-items:flex-start;gap:0;line-height:1.2;min-width:0}
  .pos-bar .pb-l span{font-size:12.5px;font-weight:600;opacity:.92}
  .pos-bar .pb-l b{font-size:19px}
  .pos-bar .pb-go{display:inline-flex;align-items:center;gap:6px;background:#fff;color:var(--accent);border-radius:12px;padding:11px 14px;font-weight:700;font-size:15px;white-space:nowrap}
  .pos-bar .pb-go svg.i{width:18px;height:18px}
}
/* Bills list on phones: actions in one row of equal icon buttons */
@media (max-width:760px){
  .bl-row{flex-wrap:wrap;row-gap:10px}
  .bl-acts{display:grid;grid-template-columns:repeat(auto-fit,minmax(64px,1fr));gap:6px;width:100%;padding-left:0}
  .bl-acts .btn{flex-direction:column;gap:3px;padding:7px 4px;min-height:54px;font-size:12px;border-radius:12px}
  .bl-acts .btn svg.i{width:19px;height:19px}
  .bl-acts .bl-del{width:100%;height:54px;border-radius:12px;box-shadow:inset 0 0 0 1px var(--line)}
  .bl-card{padding:4px 12px}
}
.pos-b2b[hidden]{display:none!important}
.pos-b2b-add{display:inline-flex;align-items:center;gap:6px;margin:-4px 0 12px 4px;min-height:40px;font-weight:600}
.pos-b2b-add svg.i{width:16px;height:16px}

/* page header on phones: the title keeps its width; buttons move to the next line when they don't fit */
@media (max-width:760px){.top>div:first-child{flex:1 0 auto;max-width:100%}.top-actions{margin-left:auto;max-width:100%}}

/* ===== Phones: compact tiles, one-row period picker, chart switches under their title ===== */
@media (max-width:760px){
  .per-row{flex-wrap:nowrap!important;overflow-x:auto;scrollbar-width:none;margin-left:-14px!important;margin-right:-14px!important;padding:0 14px 2px}
  .per-row::-webkit-scrollbar{display:none}
  .per-row .btn{flex:none;white-space:nowrap}
  .stat{gap:8px;padding:14px!important}
  .stat .tile{width:34px;height:34px;border-radius:10px}
  .stat .tile svg.i{width:18px;height:18px}
  .stat .v{font-size:20px}
  .stat .l{font-size:13px;margin-top:2px;line-height:1.3}
  .vz-seg-btns{width:100%}
  .vz-seg-btns button{white-space:nowrap;flex:1}
}
/* phones: short fields side by side in forms (inputs line up at the bottom) */
@media (min-width:340px) and (max-width:760px){.fields.two{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:end;gap:12px 10px}}

/* ===== Billing on phones: bill lines that never overlap, smaller product cards ===== */
@media (max-width:760px){
  .bt-r{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 40px!important;grid-template-areas:"item item rm" "qty rate rate" "disc disc disc" "amt amt amt"!important;row-gap:10px!important;column-gap:10px!important;padding:12px!important}
  .bt-cell{min-width:0}
  .bt .bt-qty{display:flex;width:100%;height:44px;gap:4px;padding:3px}
  .bt .bt-qty button{width:38px;height:38px;flex:none;font-size:19px}
  .bt .bt-qty input{flex:1;min-width:0;width:auto;height:38px}
  .bt .bt-in{min-width:0;height:44px}
  .bt-dwrap{height:44px;gap:8px}
  .bt-dwrap .seg.mini{height:44px}
  .bt-dwrap .seg.mini button{width:44px;min-width:0;height:38px}
  .bt-amt{flex-direction:row!important;flex-wrap:wrap;justify-content:space-between!important;align-items:center!important;min-height:0;border-top:1px dashed var(--line);padding-top:8px;gap:4px 10px}
  .bt-amt b{height:auto!important;font-size:17px}
  .bt-amt s{margin:0!important;order:2}
  .pos-grid{gap:8px}
  .pos-p{min-height:0;padding:10px 10px 9px;gap:2px;border-radius:14px}
  .pos-p > .tile{display:none}
  .pos-p .prod-img{width:40px;height:40px;border-radius:10px;margin-bottom:4px}
  .pos-p .nm{font-size:13.5px}
  .pos-p.in .nm{padding-right:26px}
  .pos-p .xs{font-size:12px}
  .pos-p b.num{font-size:15px}
  .pos-p .q{top:6px;right:6px;min-width:24px;height:24px;font-size:12px}
}
/* bill totals on phones: label, switch, box and value stay on one line */
@media (max-width:760px){.bs-r{gap:8px}.bs-ctl{flex-wrap:nowrap;gap:6px;min-width:0}.bs-ctl .seg.mini{padding:2px;flex:none}.bs-ctl .seg.mini button{min-width:34px;min-height:34px;width:34px;padding:0}.bs-ctl .bt-in{width:72px;min-width:0!important;height:38px;padding:0 8px}.bs-ctl .pos-lbl{width:104px}.bs-r>.num{flex:none}}

@media (max-width:760px){.bs-ctl .pos-lbl{width:auto;flex:1 1 auto;min-width:96px}}

/* bills list: one compact line per bill, tap to open; edit / make bill only inside */
.bl-row{flex-wrap:nowrap!important;padding:11px 0;gap:10px;cursor:pointer}
.bl-row .main{min-width:0}
.bl-row .main .t{font-weight:700}
.bl-row .main .s{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bl-row>svg.i{flex:none;color:var(--muted);width:18px;height:18px}
.bl-amt{min-width:0;gap:3px}
.bl-amt .pill{font-size:11.5px}
.bl-item.on>.bl-row{border-bottom:0}
/* dashboard: today card */
.dh{padding:16px;margin-bottom:14px}
.dh-main{display:block;width:100%;border:0;background:none;font:inherit;color:inherit;text-align:left;padding:0;cursor:pointer}
.dh-l{display:flex;align-items:center;gap:10px;font-weight:600;color:var(--muted);font-size:14px}
.dh-l .tile{width:36px;height:36px;border-radius:11px}
.dh-l .tile svg.i{width:18px;height:18px}
.dh-d{margin-left:auto;font-size:12.5px;font-weight:500}
.dh-big{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:12px}
.dh-big>.num{font-size:34px;font-weight:700;line-height:1.1;letter-spacing:-.01em}
.dh-s{font-size:13px;color:var(--muted);margin-top:4px}
.dh-three{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}
.dh-box{display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:11px 10px;border:0;border-radius:14px;background:#F6F8F7;font:inherit;color:inherit;text-align:left;cursor:pointer;min-width:0}
.dh-ic{width:28px;height:28px;border-radius:50%;background:#fff;display:grid;place-items:center;color:var(--accent);margin-bottom:2px}
.dh-ic svg.i{width:15px;height:15px}
.dh-v{font-size:15.5px;font-weight:700;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dh-bl{font-size:12px;font-weight:600;color:var(--muted)}
@media(min-width:760px){.dh-v{font-size:18px}.dh-box{padding:14px}}
/* dashboard: four equal tiles, 2 × 2 on phones, one row on computers */
.dq{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:14px}
@media(min-width:900px){.dq{grid-template-columns:repeat(4,minmax(0,1fr))}}
.dq-t{display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:14px;margin:0;border:0;font:inherit;color:inherit;text-align:left;cursor:pointer;min-width:0}
.dq-h{display:flex;align-items:center;gap:8px;min-width:0;width:100%}
.dq-ic{width:30px;height:30px;border-radius:10px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;flex:none}
.dq-ic svg.i{width:16px;height:16px}
.dq-l{font-size:12.5px;font-weight:600;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dq-v{font-size:21px;font-weight:700;line-height:1.15;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dq-s{display:flex;align-items:center;flex-wrap:wrap;gap:6px;font-size:12px;color:var(--muted);min-height:20px}
.dq-s .pill{font-size:11px;padding:2px 7px}
@media(min-width:900px){.dq-v{font-size:24px}.dq-t{padding:18px}}
.pi-dpic svg.i{width:26px;height:26px;color:var(--accent)}
.pi-dperic{display:inline-flex;vertical-align:-3px;margin-right:4px}
.pi-dperic svg.i{width:15px;height:15px;color:var(--muted)}
.ie-cic{display:grid;place-items:center}
.fb-face{display:inline-flex}
.pi-star svg.i{width:12px;height:12px;fill:currentColor;vertical-align:-1px;margin-right:3px}
.stars button svg.i{width:22px;height:22px}
.stars button.on svg.i,.rstars svg.i{fill:currentColor}
.rstars svg.i{width:15px;height:15px;color:var(--warn)}
/* product info: farmers' top rated for a searched crop / problem */
.pi-tr-h{display:flex;align-items:center;gap:6px;font-weight:700;font-size:15px;margin:2px 0 10px}
.pi-tr-h svg.i{width:17px;height:17px;color:var(--warn);fill:var(--warn)}
.pi-tr-row{display:flex;gap:10px;overflow-x:auto;scrollbar-width:none;padding-bottom:4px;margin-bottom:16px}
.pi-tr-row::-webkit-scrollbar{display:none}
.pi-tr{flex:0 0 230px;display:flex;gap:10px;align-items:center;padding:10px;margin:0;color:inherit;text-decoration:none;min-width:0}
.pi-tr-img{width:58px;height:58px;border-radius:12px;object-fit:contain;background:#F6F8F7;flex:none;display:grid;place-items:center}
.pi-tr-b{min-width:0;flex:1}
.pi-tr-n{font-weight:700;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pi-tr-s{font-size:12.5px;color:var(--muted);margin-top:3px}
.pi-tr-on{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* product info: farmer ratings */
.pr-badge{display:inline-flex;align-items:center;gap:6px;margin-top:10px;padding:6px 10px;border-radius:10px;background:#F6F8F7;font-size:13px}
.pr-badge svg.i{width:15px;height:15px}
.pr-badge span{color:var(--muted);font-weight:500}
.pr-split{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));gap:4px 24px;margin-top:14px}
/* crop feedback */
.pos-crop{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin-bottom:10px}
.pos-crop label.f{margin:0;min-width:0}
.pos-crop .inp{width:100%;min-width:0}
.pos-crop .inp + .inp{margin-top:6px}
.bt-cp .bt-cpo{grid-column:1/-1}
.bt-cp.sel{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.bt-cp{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);gap:6px;margin-top:6px;min-width:0}
.bt-cp .inp{min-height:36px;height:36px;padding:4px 10px;font-size:13.5px;width:100%;min-width:0}
.bt-cpl{display:inline-flex;flex-wrap:wrap;align-items:center;gap:5px;margin-top:5px;padding:0;border:0;background:none;font:inherit;font-size:12.5px;color:var(--accent);cursor:pointer;text-align:left;max-width:100%;min-width:0;overflow-wrap:anywhere}
/* billing fits the phone: nothing in it may be wider than the screen */
.pos,.pos>div,.pos .card,.bt,.bt-r>*{min-width:0;max-width:100%}
.pos-search input{min-width:0;flex:1}
.bt-meta{overflow-wrap:anywhere}
@media (max-width:760px){.app .pos{grid-template-columns:minmax(0,1fr)!important}.bt-h{display:none}.bt-r{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 40px!important}}
.bt-cpl svg.i{width:14px;height:14px;flex:none}
.bt-cpl u{color:var(--muted)}
.pos-co{font-weight:600;color:var(--accent);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.fb-sum{padding:16px;margin-bottom:14px}
.fb-top{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.fb-counts{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;flex:1 1 220px}
.fb-counts>div{display:flex;flex-direction:column;align-items:center;gap:2px;min-width:0;padding:8px 10px;border-radius:12px;background:#F6F8F7}
.fb-counts b{font-size:18px}
.fb-counts span{font-size:11.5px;font-weight:600;color:var(--muted);white-space:nowrap}
.fb-li{align-items:flex-start}
.fb-crop{display:flex;align-items:center;gap:6px}
.fb-crop .crop-img{flex:none}
.fb-item{border-bottom:1px solid var(--line);padding-bottom:12px}
.fb-item:last-child{border-bottom:0}
.fb-item>.li{border-bottom:0;padding-bottom:6px}
.fb-item .right{flex:none;text-align:right}
.fb-acts{display:flex;align-items:center;justify-content:space-between;gap:8px}
.fb-acts .btn{flex:none}
.fb-send{display:flex;align-items:center;gap:8px;flex:none}
.fb-call{width:36px;height:36px;box-shadow:none;background:#F2F5F3}
.fb-call svg.i{width:17px;height:17px}
.fb-face{font-size:20px;line-height:1;margin-top:4px}
.fb-note{display:flex;gap:10px;align-items:flex-start;padding:8px 10px;margin-top:2px;border-radius:10px;background:#F6F8F7;font-size:13.5px;color:var(--ink)}
.fb-res{display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.fb-res .fb-face{display:inline-flex}
.f-lbl{font-size:14px;font-weight:600;color:#4A5751;margin-bottom:7px}
.fb-note img{width:64px;height:64px;object-fit:cover;border-radius:10px;flex:none;cursor:pointer}
.fb-prod{padding:8px 0}
.fb-pn{font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fb-pick{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.fb-pick.five{grid-template-columns:repeat(5,minmax(0,1fr))}
.fb-opt{position:relative;margin:0;cursor:pointer}
.fb-opt input{position:absolute;opacity:0;pointer-events:none}
.fb-opt span{display:flex;align-items:center;justify-content:center;min-height:46px;border:1.5px solid var(--line);border-radius:12px;font-weight:600;font-size:13.5px;text-align:center;padding:4px}
.fb-opt input:checked+span{border-color:var(--accent);background:var(--accent-soft)}
.fb-opt.r-partly input:checked+span{border-color:var(--warn);background:var(--warn-soft)}
.fb-opt.r-no input:checked+span{border-color:var(--bad);background:var(--bad-soft)}
/* settings: list of groups, each opens its own screen */
.set-list{padding:4px 14px;max-width:720px}
.set-row{display:flex;align-items:center;gap:14px;padding:13px 0;border-bottom:1px solid var(--line);color:inherit;text-decoration:none;min-height:64px}
.set-row:last-child{border-bottom:0}
.set-row .tile{width:40px;height:40px;border-radius:12px;flex:none}
.set-row>svg.i{flex:none;color:var(--muted);width:18px;height:18px}
.set-m{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.set-t{font-weight:600;font-size:15.5px;color:var(--ink)}
.set-s{font-size:13px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.set-page{display:flex;flex-direction:column;gap:14px;max-width:720px}
.set-opts{padding:6px 14px}
.set-opt{display:flex;align-items:center;gap:14px;width:100%;padding:15px 0;border:0;border-bottom:1px solid var(--line);background:none;font:inherit;text-align:left;cursor:pointer}
.set-opt:last-child{border-bottom:0}
.set-radio{width:22px;height:22px;border-radius:50%;border:2px solid #C9D2CD;flex:none;display:grid;place-items:center}
.set-opt.on .set-radio{border-color:var(--accent)}
.set-opt.on .set-radio::after{content:"";width:11px;height:11px;border-radius:50%;background:var(--accent)}
/* period picker (Accounts, Sales Reports) */
.pr-bar{padding:10px;margin:0 0 14px}
.pr-seg{display:flex;gap:4px;overflow-x:auto;scrollbar-width:none;background:#F2F5F3;border-radius:12px;padding:4px}
.pr-seg::-webkit-scrollbar{display:none}
.pr-seg button{flex:1 0 auto;border:0;background:transparent;border-radius:9px;padding:8px 12px;font:inherit;font-size:13px;font-weight:600;color:var(--muted);white-space:nowrap;cursor:pointer}
.pr-seg button.on{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.08)}
.pr-dates{display:flex;align-items:center;gap:8px;margin-top:10px}
.pr-d{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px;margin:0}
.pr-d>span{font-size:11.5px;font-weight:600;color:var(--muted);padding-left:2px}
.pr-d .dp-btn.rc-cal{width:100%;justify-content:flex-start}
.pr-arrow{flex:none;color:var(--muted);margin-top:18px}
.pr-arrow svg.i{width:16px;height:16px}
/* page header: the title keeps its width; when the buttons don't fit beside it they go to the next line (never on top of it) */
/* one row on every page: back arrow, title, buttons (New Bill, Add Stock…) always on the same line, never below */
.top{flex-wrap:nowrap!important;align-items:center!important;gap:10px!important}
.top>.top-t{flex:1 1 auto!important;min-width:80px!important;max-width:none!important}
.top>.top-t h1{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top>.top-actions{margin-left:auto!important;flex:0 1 auto!important;min-width:0;max-width:72%!important;flex-wrap:nowrap!important;overflow-x:auto;scrollbar-width:none;justify-content:flex-end}
.top>.top-actions::-webkit-scrollbar{display:none}
.top>.top-actions>*{flex:none}
.top>.top-actions.wide{width:auto!important;display:flex!important}
@media (max-width:760px){.top>.top-t h1{font-size:22px}.top>.top-actions .btn.sm{padding:7px 10px;font-size:13.5px}}
/* back arrow beside page titles */
.top-back{flex:none;width:40px;height:40px;border-radius:50%;background:#F2F5F3;border:1px solid var(--line);box-shadow:none;display:grid;place-items:center;color:var(--ink);margin-right:-4px}
.top-back svg.i{width:20px;height:20px;stroke-width:2.4}
/* accounts: credit to paying ratio */
.cr-main{display:flex;align-items:baseline;gap:10px;margin:12px 0 8px;flex-wrap:wrap}
.cr-pct{font-size:34px;font-weight:700;line-height:1}
.cr-of{font-size:13px;font-weight:600;color:var(--muted)}
.cr-bar{height:8px;margin-bottom:14px}
.cr-two{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}
.cr-two>div{background:#F6F8F7;border-radius:12px;padding:10px 12px;min-width:0}
.cr-v{font-size:17px;font-weight:700;margin-top:2px}
.cr-slow{margin-top:14px;padding-top:12px;border-top:1px solid var(--line)}
.cr-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 0;color:inherit;text-decoration:none;border-bottom:1px solid var(--line)}
.cr-row:last-child{border-bottom:0}
.cr-n{font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cr-r{font-weight:700;flex:none;font-size:13.5px}
/* receivables summary */
.rc-sum{padding:18px;margin-bottom:16px}
.rc-top{display:flex;align-items:center;gap:14px}
.rc-top .tile{width:50px;height:50px;border-radius:16px;flex:none}
.rc-big{font-size:30px;font-weight:700;line-height:1.15;color:var(--ink);letter-spacing:-.01em}
.rc-l{font-size:12.5px;font-weight:600;color:var(--muted)}
.rc-s{font-size:13px;color:var(--muted);margin-top:2px}
.rc-two{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}
.rc-box{display:flex;align-items:center;gap:10px;padding:12px;border-radius:14px;background:#F6F8F7;min-width:0}
.rc-ic{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;flex:none;background:#fff;color:var(--muted)}
.rc-ic svg.i{width:17px;height:17px}
.rc-v{font-size:19px;font-weight:700;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rc-box.bad{background:var(--bad-soft)}.rc-box.bad .rc-ic,.rc-box.bad .rc-v{color:var(--bad)}
.rc-box.ok .rc-ic{color:var(--accent)}
.bl-x{flex:none;width:36px;height:36px;border-radius:50%;background:#F2F5F3;border:1px solid var(--line);display:grid;place-items:center;color:var(--ink)}
.bl-x svg.i{width:18px;height:18px;stroke-width:2.4}
.cp-invview>.bl-acts{display:flex!important;width:auto!important;padding:0!important;margin:0 0 10px;justify-content:flex-start;gap:8px}
.cp-invview>.bl-acts .btn{flex-direction:row!important;min-height:40px!important;font-size:13px!important}

/* shop logo image in the header and sign-in */
.logo-img{width:34px;height:34px;border-radius:9px;flex:none;object-fit:cover}
@media (max-width:760px){.side .logo-img{width:30px;height:30px;border-radius:8px}}

/* app feel: no pinch / double-tap zoom, password typed as dots without the browser treating it as a saved-password field */
.app-mode{touch-action:manipulation}
[data-pw]{-webkit-text-security:disc;text-security:disc}

/* no pull-down-to-reload: the gesture is caught on the page root, not only the body */
.app-mode,.app-mode body{overscroll-behavior:none}

/* app, not a web page: no text highlighting on long-press, no link/image pop-up menu, no blue tap flash,
   no focus ring after a tap, no dragging pictures, no scrollbars on phones. Typing and selecting inside fields still works. */
.app-mode body{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
.app-mode :is(input,textarea,select,[contenteditable="true"],pre.msg){-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
.app-mode :is(img,a,svg){-webkit-user-drag:none;user-drag:none}
:focus:not(:focus-visible){outline:none}
input[type=number]{-moz-appearance:textfield;appearance:textfield}
input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
input[type=search]::-webkit-search-cancel-button{-webkit-appearance:none}
@media (max-width:760px){.app-mode *{scrollbar-width:none}.app-mode *::-webkit-scrollbar{display:none;width:0;height:0}}

/* no pinch or double-tap zoom anywhere, including inside popups and side-scrolling rows
   ("manipulation" still lets a phone pinch-zoom; pan-x pan-y does not). Maps keep their own pinch. */
.app-mode *,.app-mode *::before,.app-mode *::after{touch-action:pan-x pan-y}
.app-mode .leaflet-container,.app-mode .leaflet-container *{touch-action:none}

/* Inter: clean numbers that line up in bills and totals */
body{font-feature-settings:'cv11','ss01';letter-spacing:-0.005em}
.num{font-variant-numeric:tabular-nums}

/* opening the app: one white screen that fills in — top bar, tab bar, then each block rising softly into place */
@keyframes wcbIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes wcbFade{from{opacity:0}to{opacity:1}}
body.build .side{animation:wcbFade .35s ease-out both}
body.build #bnav{animation:wcbIn .4s cubic-bezier(.2,.7,.2,1) both}
body.build .bi{animation:wcbIn .45s cubic-bezier(.2,.7,.2,1) both}

/* Android app: Google sign-in can't run inside an app's built-in browser, so only email sign-in shows */
.in-app .gbtn,.in-app .auth .divider{display:none!important}


/* Reorder List: one card per supplier, a line per product with a quantity stepper */
.ro-cover{display:flex;align-items:center;gap:10px;margin:0 0 14px;flex-wrap:wrap}
.ro-cover-l{font-weight:600;font-size:14px;color:var(--muted)}
.ro-cover .seg{flex:1;min-width:0;display:flex}
.ro-cover .seg button{flex:1;white-space:nowrap}
.ro-card{padding:14px;margin-bottom:14px}
.ro-h{display:flex;align-items:center;gap:12px;padding-bottom:10px;border-bottom:1px solid var(--line)}
.ro-h .main{flex:1;min-width:0}
.ro-h .t{font-weight:700;font-size:16px}
.ro-h .s{font-size:13px;color:var(--muted)}
.ro-est{font-weight:700;font-size:15px}
.ro-li{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:10px;padding:12px 0;border-bottom:1px solid var(--line)}
.ro-li:last-child{border-bottom:0}
.ro-li .main{min-width:0}
.ro-li .t{font-weight:600;line-height:1.3}
.ro-li .s{font-size:12.5px;color:var(--muted);margin-top:2px}
.ro-sup{margin-top:8px;height:40px;font-size:14px}
.ro-q{display:flex;flex-direction:column;align-items:flex-end;gap:3px}
.ro-step{display:inline-flex;align-items:center;gap:2px;padding:3px;border-radius:11px;background:#F2F5F3}
.ro-step button{width:34px;height:34px;border:0;border-radius:9px;background:#fff;font-weight:700;font-size:18px;line-height:1;display:grid;place-items:center;color:var(--ink)}
.ro-step input{width:44px;height:34px;border:0;background:transparent;text-align:center;font:inherit;font-weight:700;font-size:15px}
.ro-x{width:36px;height:36px;box-shadow:none;background:transparent;color:var(--muted)}
.ro-add{display:inline-flex;align-items:center;gap:6px;margin:10px 0 4px;min-height:40px;font-weight:600}
.ro-acts{display:grid;grid-template-columns:1fr 2fr;gap:8px;margin-top:8px}
.ro-wa{background:#25D366;box-shadow:none}
@media (max-width:760px){
  .ro-li{grid-template-columns:minmax(0,1fr) auto auto;grid-template-areas:"main q x"}
  .ro-li>.tile,.ro-li>.pimg{display:none}
  .ro-li .main{grid-area:main}.ro-li .ro-q{grid-area:q}.ro-li .ro-x{grid-area:x}
  .ro-cover .seg button{padding-left:6px;padding-right:6px;font-size:13px}
}
@media (max-width:760px){.ro-step button{width:40px;height:40px}.ro-step input{width:44px;height:40px}}

/* Reorder List on phones: name and details across the full width, quantity and amount on the row below */
@media (max-width:760px){
  .ro-li{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"main x" "q q";row-gap:8px;column-gap:6px}
  .ro-li .ro-q{flex-direction:row-reverse;justify-content:space-between;align-items:center;width:100%}
  .ro-li .ro-q .xs{font-size:14px;font-weight:600;color:var(--ink)}
  .ro-li .ro-x{align-self:start;margin-top:-6px}
  .ro-sup{width:100%}
  .ro-add{margin-top:6px}
}
/* phones: a page with several header buttons gets them as one full-width row of equal buttons under the title */
@media (max-width:760px){
  .top-actions.wide{width:100%;margin-left:0;display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:8px}
  .top-actions.wide>.btn{width:100%;justify-content:center;padding-left:8px;padding-right:8px;white-space:nowrap}
}

/* Scan button in billing search, and the label scanner (full-screen camera, box in the middle, result panel below) */
.pos-search .pos-scan{flex:none;margin-left:4px;height:38px;border-radius:12px;padding:0 12px}
.ls{position:fixed;inset:0;z-index:200;background:#000;display:flex;flex-direction:column}
.ls video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.ls-mask{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none}
.ls-box{position:relative;width:min(82vw,420px);height:min(34vh,240px);margin-top:-18vh;border-radius:18px;box-shadow:0 0 0 200vmax rgba(0,0,0,.55)}
.ls-box i{position:absolute;width:28px;height:28px;border:4px solid #fff}
.ls-box i:nth-child(1){top:-2px;left:-2px;border-right:0;border-bottom:0;border-radius:16px 0 0 0}
.ls-box i:nth-child(2){top:-2px;right:-2px;border-left:0;border-bottom:0;border-radius:0 16px 0 0}
.ls-box i:nth-child(3){bottom:-2px;left:-2px;border-right:0;border-top:0;border-radius:0 0 0 16px}
.ls-box i:nth-child(4){bottom:-2px;right:-2px;border-left:0;border-top:0;border-radius:0 0 16px 0}
.ls-top{position:relative;display:flex;align-items:center;justify-content:space-between;padding:calc(12px + env(safe-area-inset-top)) 14px 0}
.ls-step{color:#fff;font-weight:700;font-size:18px;text-shadow:0 1px 3px rgba(0,0,0,.5)}
.ls-ic{width:46px;height:46px;border-radius:50%;border:0;background:rgba(0,0,0,.45);color:#fff;display:grid;place-items:center}
.ls-ic.on{background:#fff;color:#111}
.ls-ic svg.i{width:22px;height:22px}
.ls-panel{position:absolute;left:0;right:0;bottom:0;background:var(--card,#fff);border-radius:22px 22px 0 0;padding:16px 16px calc(16px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:10px}
.ls-row{display:flex;align-items:center;gap:10px}
.ls-t{font-weight:600;color:var(--muted)}
.ls-spin{width:20px;height:20px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--accent);animation:lsspin .8s linear infinite}
@keyframes lsspin{to{transform:rotate(360deg)}}
.ls-prod{font-size:18px}.ls-prod span{color:var(--muted);font-weight:500}
.ls-read{font-size:14px;color:var(--muted)}
.ls-msg{display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:12px;font-weight:600;font-size:14.5px}
.ls-msg svg.i{flex:none;width:20px;height:20px}
.ls-msg.ok{background:var(--accent-soft);color:#14632A}
.ls-msg.warn{background:#FFF4E0;color:#8A5300}
.ls-msg.bad{background:var(--bad-soft,#FDECEA);color:var(--bad)}
.ls-msg.grey{background:#F2F5F3;color:var(--muted)}
.ls-acts{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:8px}
.ls-exp{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
.ls-exp>div{display:flex;flex-direction:column;gap:1px;padding:10px 12px;border-radius:12px;background:#F6F8F7;min-width:0}
.ls-exp span{font-size:12px;font-weight:600;color:var(--muted)}
.ls-exp b{font-size:16px}
.ls-exp i{font-style:normal;font-size:12.5px;color:var(--muted)}
.ls-exp i.warn{color:var(--warn);font-weight:600}
.ls-exp i.bad{color:var(--bad);font-weight:600}
.ls-title .ls-t{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ls-title .ls-live{overflow-wrap:normal}
.ls-cands{display:flex;flex-direction:column;gap:6px}
.ls-form label.ls-new .inp,.ls-form label.ls-new .dp-btn{border-color:var(--accent);background:var(--accent-soft)}
.ls-cand{display:flex;flex-direction:column;align-items:flex-start;gap:1px;padding:10px 12px;border:1.5px solid var(--line);border-radius:12px;background:#fff;font:inherit;text-align:left;cursor:pointer}
.ls-cand.top{border-color:var(--accent);background:var(--accent-soft)}
.ls-cand b{font-size:15px}
.ls-cand span{font-size:12.5px;color:var(--muted)}
.ls-grp{cursor:default}
.ls-sizes{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px;width:100%}
.ls-sizes button{flex:1 1 90px;min-height:44px;border:1.5px solid var(--accent);border-radius:10px;background:#fff;color:var(--accent);font:inherit;font-weight:700;font-size:15px;cursor:pointer}
.ls-sizes button:active{background:var(--accent);color:#fff}
/* Add Stock: details read from the pack, to check before adding */
.ls-panel{max-height:78vh;overflow-y:auto}
.ls-form{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 10px}
.ls-form label{display:flex;flex-direction:column;gap:4px;min-width:0;margin:0}
.ls-form label>span{font-size:12px;font-weight:600;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ls-form .inp,.ls-form .dp-btn{min-height:44px;height:44px;width:100%}
.ls-acts .btn{min-height:48px;justify-content:center}
/* opening the app: pieces appear one by one in place (fade only, no sliding) */
@keyframes wcbIn{from{opacity:0}to{opacity:1}}
body.build #bnav{animation:wcbFade .3s ease-out both}
body.build .bi{animation:wcbIn .35s ease-out both}
.ls-kv{display:grid;grid-template-columns:1fr 1fr;gap:6px 14px;font-size:14px}
.ls-kv>div{display:flex;flex-direction:column;min-width:0}
.ls-kv span{color:var(--muted);font-size:12.5px}
.ls-kv b{font-weight:700;overflow-wrap:anywhere}
.ls-kv>div:first-child{grid-column:1/-1}
.ls-diff{display:inline-block;margin-left:6px;font-size:12px;font-weight:600;color:#8A5300;background:#FFF4E0;border-radius:8px;padding:1px 6px}
/* scanner: box in the upper part of the screen, compact details so nothing covers it */
.ls-mask{place-items:start center;padding-top:calc(84px + env(safe-area-inset-top))}
.ls-box{margin-top:0;width:min(92vw,480px);height:min(36vh,300px)}
.ls-kv{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px 10px;font-size:13.5px}
.ls-panel{gap:8px;padding-top:14px}
.ls-prod{font-size:17px}
.ls-live{color:var(--ink);font-weight:600;overflow-wrap:anywhere}


/* opened bill in the app: a short summary, not the printed invoice */
.bsm{background:#F6F8F7;border-radius:14px;padding:12px 14px;display:flex;flex-direction:column;gap:8px}
.bsm-r{display:flex;justify-content:space-between;align-items:baseline;gap:12px;font-size:15px}
.bsm-r>span{min-width:0}
.bsm-r i{font-style:normal;color:var(--muted)}
.bsm-x{color:var(--muted);font-size:14px}
.bsm-t{border-top:1px dashed var(--line);padding-top:8px;font-size:17px;font-weight:700}
.bsm-pay{font-size:14px;color:var(--muted)}
.bsm-pay .bad{color:var(--bad)}

/* ===== Less green (2026-11-24): a white, neutral page with green only where it means something:
   main buttons, the active tab, Paid / money-in, small icons and the logo. ===== */
:root{ --line:#E6E9E7; --mint-tint:#F4F5F4; --shadow:0 0 0 1px #E6E9E7, 0 2px 8px rgba(20,30,25,.04); }
.side{border-bottom:1px solid var(--line)}
.top h1::after{display:none}
.sec-h h2,.rs-h,.vz-h,.card>h2:first-child,.card>.row>h2:first-child,.card>.sec-h>h2:first-child{border-left:0;padding-left:0}
.chip.on{background:var(--ink);color:#fff}
.chip:not(.on){background:#fff;box-shadow:inset 0 0 0 1px var(--line);color:var(--ink)}
.seg{background:#F1F3F2}
.seg button.on{color:var(--ink);background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.08)}
/* icon tiles: light grey, the icon itself stays green */
.t-mint,.t-sky,.t-lav{background:#F2F4F3;color:var(--accent)}
.kv>div{background:#F6F7F6}
.li{border-bottom-color:#EEF0EF}
/* dashboard quick actions: white cards with a thin line, green icon; dark text */
.qa button.t-mint,.qa button.t-sky,.qa button.t-lav{background:#fff;color:var(--ink);box-shadow:inset 0 0 0 1px var(--line)}
.qa button.t-mint svg.i,.qa button.t-sky svg.i,.qa button.t-lav svg.i{color:var(--accent)}
.qa button.t-peach{background:#fff;color:var(--ink);box-shadow:inset 0 0 0 1px var(--line)}
.qa button.t-peach svg.i{color:#B26A00}
.btn.soft{background:#F2F4F3;color:var(--ink)}
.pos-search .icon-btn{background:#F2F4F3;color:var(--ink)}
.search:focus-within{box-shadow:0 0 0 2px var(--ink)}
.inp:focus{outline:3px solid #EEF0EF;border-color:#9AA5A0}
.bs-total{background:#F4F5F4}
.chip.on{background:#fff;color:var(--accent);box-shadow:inset 0 0 0 1.5px var(--accent)}

.upi-prev{display:flex;flex-direction:column;align-items:center;gap:6px}
.upi-prev svg{width:180px;height:180px}
.upi-prev:empty{display:none}


/* pack size (50 Kg, 150 ml) in bold so it is read at a glance */
.pack{font-weight:700;color:var(--ink)}
.pos-p .xs .pack{font-size:13.5px}
/* phones and small screens: no product photos or icons, just the text; large screens keep them */
@media (max-width:760px){
  .ptile,.pv-img,.pimg-pick{display:none!important}
}
.cat-list{display:flex;flex-wrap:wrap;gap:8px}
.cat-chip{display:inline-flex;align-items:center;gap:4px;padding:6px 6px 6px 14px;border-radius:999px;box-shadow:inset 0 0 0 1px var(--line);font-weight:600;font-size:14.5px;background:#fff}
.cat-chip button{width:30px;height:30px;border:0;border-radius:50%;background:#F2F4F3;color:var(--muted);display:grid;place-items:center}
.cat-chip button svg.i{width:15px;height:15px}


.offline{top:calc(8px + env(safe-area-inset-top));background:#1F2A24;color:#fff;font-size:13px;padding:7px 16px;box-shadow:0 4px 14px rgba(0,0,0,.15)}

@media (max-width:760px){.offline{top:auto;bottom:calc(84px + env(safe-area-inset-bottom))}}


/* billing quantity: the number always has room (3-4 digits), never under the + button */
.bt .bt-qty input{min-width:56px;padding:0 4px;-moz-appearance:textfield;appearance:textfield;font-variant-numeric:tabular-nums}
.bt .bt-qty input::-webkit-inner-spin-button,.bt .bt-qty input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.bt .bt-qty button{flex:none}
@media (max-width:760px){
  .bt .bt-qty{width:100%!important;display:flex!important;justify-content:space-between}
  .bt .bt-qty input{flex:1 1 auto;width:auto!important;min-width:0}
}
@media (max-width:760px){
  .bt-r{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) 40px!important}
  .bt .bt-qty button{width:36px!important;height:38px}
}
@media (max-width:760px){.bt-r{grid-template-columns:minmax(150px,1.3fr) minmax(0,1fr) 40px!important}}


/* ===== The page never moves sideways: anything wider is clipped; rows meant to scroll (chips, periods) scroll inside themselves ===== */
html,body{overflow-x:hidden;max-width:100%}
@supports (overflow-x:clip){html,body{overflow-x:clip}}
#main,.app,.grid,.split,.stack{min-width:0;max-width:100%}
.card{min-width:0}
/* pop-up panels (profile menu, dropdowns, date picker) keep their own width, not their small button's */
.pmenu{max-width:calc(100vw - 24px)!important}
.app-mode,.app-mode body{overscroll-behavior-x:none}
/* tiles: text column may shrink; amounts never wrap */
.kpi-b,.stat>div,.kv>div{min-width:0}
.kpi-v .num,.stat .v{white-space:nowrap}
/* long amounts shrink step by step (6, 7, 8+ digits) */
.kpi-v .num.n-m{font-size:.9em}.kpi-v .num.n-s{font-size:.8em}.kpi-v .num.n-xs{font-size:.7em}
.stat .v.n-m{font-size:.9em}.stat .v.n-s{font-size:.8em}.stat .v.n-xs{font-size:.68em}
@media (max-width:760px){
  .kpi{gap:10px;padding:12px}
  .kpi .tile{width:36px;height:36px;border-radius:11px}
  .kpi .tile svg.i{width:20px;height:20px}
  .kpi-v .num{font-size:19px}
  .kpi-v .num.n-m{font-size:17px}.kpi-v .num.n-s{font-size:15.5px}.kpi-v .num.n-xs{font-size:14px}
  .stat .v{font-size:20px}
  .stat .v.n-m{font-size:18px}.stat .v.n-s{font-size:16.5px}.stat .v.n-xs{font-size:15px}
}
/* dashboard tiles on phones: icon on top, label and amount use the full width; the label stays on one line */
@media (max-width:760px){
  .kpi{flex-direction:column;align-items:flex-start;gap:8px}
  .kpi .tile{width:32px;height:32px;border-radius:10px}
  .kpi .tile svg.i{width:18px;height:18px}
  .kpi-b{width:100%}
  .kpi-l{white-space:nowrap;font-size:13px}
}

/* ===== No Internet Connection screen ===== */
.noi{position:fixed;inset:0;z-index:300;background:#fff;display:flex;align-items:center;justify-content:center;padding:calc(24px + env(safe-area-inset-top)) 22px calc(24px + env(safe-area-inset-bottom));animation:noiIn .25s ease-out both;overflow-y:auto}
.noi.noi-out{animation:noiOut .25s ease-in both}
@keyframes noiIn{from{opacity:0}to{opacity:1}}
@keyframes noiOut{to{opacity:0}}
.noi-in{width:100%;max-width:380px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:16px}
.noi-art{width:200px;height:150px;animation:noiFloat 3.2s ease-in-out infinite}
@keyframes noiFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-8px)}}
.noi-svg{width:100%;height:100%}
.noi-halo{fill:#F2F7F3}
.noi-cloud{fill:#fff;stroke:#C9D3CD;stroke-width:3}
.noi-wave{fill:none;stroke:#9AA6A0;stroke-width:3.2;stroke-linecap:round}
.noi-dotc{fill:#9AA6A0}
.noi-cut{stroke:#D2504B;stroke-width:4.5;stroke-linecap:round}
.noi h1{margin:0;font-size:24px;font-weight:700;letter-spacing:-.01em}
.noi-st{display:inline-flex;align-items:center;gap:8px;font-size:14.5px;font-weight:600;color:var(--muted);background:#F6F7F6;border-radius:999px;padding:7px 14px}
.noi-pulse{width:9px;height:9px;border-radius:50%;background:#C9811F;box-shadow:0 0 0 0 rgba(201,129,31,.5);animation:noiPulse 1.6s ease-out infinite}
@keyframes noiPulse{0%{box-shadow:0 0 0 0 rgba(201,129,31,.5)}100%{box-shadow:0 0 0 12px rgba(201,129,31,0)}}
.noi-shake{animation:noiShake .4s}
@keyframes noiShake{25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}
.noi-checks{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;width:100%;margin-top:4px}
.noi-checks>div{display:flex;flex-direction:column;align-items:center;gap:8px;padding:14px 6px;border-radius:16px;box-shadow:inset 0 0 0 1px var(--line);font-size:13px;font-weight:600}
.noi-ic{width:40px;height:40px;border-radius:12px;background:#F2F4F3;display:grid;place-items:center;color:var(--accent)}
.noi-ic svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.noi-ic svg path[transform]{fill:currentColor;stroke:none}
.noi-acts{display:flex;flex-direction:column;gap:10px;width:100%;margin-top:6px}
.noi-acts .btn{min-height:52px;font-size:16px;justify-content:center}

/* Arrange Menu (drag to reorder the bottom bar) */
.ar-sec{font-size:12px;font-weight:700;color:var(--muted);padding:4px 4px 6px}
.ar-sep{padding-top:16px}
.ar-row{display:flex;align-items:center;gap:14px;padding:10px 4px;border-bottom:1px solid var(--line);background:var(--card);position:relative}
.ar-row .main{flex:1;min-width:0}
.ar-grip{display:grid;place-items:center;width:44px;height:44px;margin:-6px -4px -6px 0;color:var(--muted);cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none}
.ar-grip .i{stroke-width:3.2}
.ar-row.dragging{z-index:2;border-radius:14px;border-bottom-color:transparent;box-shadow:0 8px 24px rgba(22,33,27,.14)}
.ar-row.dragging .ar-grip{cursor:grabbing;color:var(--accent)}
body.ar-busy,body.ar-busy *{-webkit-user-select:none;user-select:none;cursor:grabbing}
body.ar-busy #sheet{overflow:hidden;touch-action:none}

/* Distributor maps: retailer pins coloured by route, white pins for other shops on WhatCrop */
.ret-map{height:min(52vh,420px);border-radius:16px;overflow:hidden;background:#DDE5E0}
.route-card{padding:8px;margin-bottom:12px}
.route-map{height:min(44vh,360px);border-radius:14px;overflow:hidden;background:#DDE5E0}
.route-map .empty,.ret-map .empty{height:100%;display:grid;place-items:center}
.rpin{background:transparent;overflow:hidden}
.rpin span{display:block;width:100%;height:100%}
.rpin.ext span{box-shadow:inset 0 0 0 3px var(--muted)}
.rpin.mine{z-index:1000!important}
.rdot{width:12px;height:12px;border-radius:50%;flex:none;box-shadow:0 0 0 1px var(--line)}
.rpop{min-width:150px}
.rpop-a{display:flex;gap:14px;margin-top:8px}
.rpop-a a{color:var(--accent);font-weight:600}
@media (max-width:760px){.ret-map{height:300px}.route-map{height:260px}}

/* Supply orders: batch rows on dispatch, batch table on received goods, quantity boxes on a new order */
.sp-item{padding:14px}
.sp-row{display:grid;grid-template-columns:1.3fr 1fr 1fr .7fr auto;gap:8px;align-items:end;margin:10px 0;padding-top:10px;border-top:1px dashed var(--line)}
.sp-row .f{min-width:0}
.sp-row .inp:disabled{opacity:.75}
.sp-x{box-shadow:none;background:#F2F5F3;align-self:end}
.sp-bt{margin-top:8px;border:1px solid var(--line);border-radius:12px;overflow:hidden}
.sp-br{display:grid;grid-template-columns:auto 1fr auto;gap:10px;padding:8px 12px;border-top:1px solid var(--line);align-items:center;font-size:14px}
.sp-br:first-child{border-top:0}
.sn-q{width:84px;flex:none;text-align:right}
@media (max-width:760px){
  .sp-row{grid-template-columns:1fr 1fr}
  .sp-row .sp-x{grid-column:1/-1;justify-self:end}
}

/* section labels inside pick lists (On WhatCrop / My Suppliers) */
.dd-sec{font-size:12px;font-weight:700;color:var(--muted);padding:10px 6px 4px}

/* Request Stock: product cards like a shop, sticky cart bar above the phone tab bar */
.shop-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px}
.shop-card{display:flex;flex-direction:column;padding:0;overflow:hidden}
.shop-pic{aspect-ratio:4/3;background:#F2F5F3;display:grid;place-items:center;overflow:hidden}
.shop-pic img.prod-img{width:100%;height:100%;object-fit:cover;border-radius:0}
.shop-pic .tile{width:64px;height:64px;border-radius:18px}
.shop-pic .tile svg.i{width:30px;height:30px}
.shop-b{display:flex;flex-direction:column;gap:6px;padding:12px 14px 14px;flex:1}
.shop-b .t{font-weight:700;font-size:15px;line-height:1.3}
.shop-b .pill{align-self:flex-start}
.shop-price{display:flex;align-items:baseline;gap:6px}
.shop-price .num{font-size:20px;font-weight:700}
.shop-tiers{display:flex;flex-wrap:wrap;gap:4px 12px;font-size:12.5px}
.shop-qty{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:auto;padding-top:6px}
.shop-qty .qty input{width:56px}
.cart-bar{position:sticky;bottom:16px;z-index:20;display:flex;align-items:center;gap:12px;margin-top:14px;padding:12px 14px;background:var(--card);border:1px solid var(--line);border-radius:16px;box-shadow:0 8px 24px rgba(22,33,27,.14)}
.cart-bar .main{flex:1;min-width:0}
@media (max-width:760px){
  .shop-grid{grid-template-columns:1fr}
  .shop-card{flex-direction:row}
  .shop-pic{aspect-ratio:auto;width:112px;flex:none}
  .cart-bar{bottom:calc(76px + env(safe-area-inset-bottom))}
}
/* …except the Request Stock shop and the manufacturer's product photo, where the photo is the point */
@media (max-width:760px){
  .shop-pic .ptile.tile{display:grid!important}
  .shop-pic img.ptile{display:block!important}
  .pimg-pick.keep{display:flex!important}
}

/* the hidden attribute wins over button display styles */
.btn[hidden],.icon-btn[hidden]{display:none!important}

/* business logo as the profile icon */
.av-btn.has-logo{background:#fff!important;box-shadow:0 0 0 1px var(--line),0 4px 12px rgba(22,33,27,.12)}
.av-btn .av-img{width:100%;height:100%;border-radius:50%;object-fit:contain;padding:3px;background:#fff}

/* Bills list: the invoice number always on one line (never wraps or gets cut); the line under it shortens instead */
.bl-row .main{min-width:0;flex:1 1 auto}
.bl-row .main .t{white-space:nowrap;letter-spacing:-.01em}
.bl-row .main .s{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bl-row .bl-amt{flex:none}
@media (max-width:380px){.bl-row .main .t{font-size:14px}}

/* Product Info: library list and the product's detail page */
.info-tile{flex:none}
.info-head{display:flex;gap:14px;align-items:center}
.info-img{width:84px;height:84px;border-radius:16px;object-fit:cover;flex:none;background:#F2F5F3}
.info-img.tile svg.i{width:34px;height:34px}
.info-sec{padding:14px 16px}
.info-h{display:flex;align-items:center;gap:8px;margin-bottom:8px;color:var(--accent)}
.info-h h2{font-size:15px;color:var(--ink);margin:0}
.info-txt{white-space:pre-line;line-height:1.55;font-size:14.5px}
.info-crop{cursor:pointer;gap:6px}
.info-crop input{accent-color:var(--accent)}
@media (max-width:760px){ .info-tile.tile{display:grid!important} img.info-tile{display:block!important} }

/* small delete icon at the end of an opened bill's / quotation's actions */
.cp-invview>.bl-acts .bl-del{margin-left:auto;width:36px;height:36px;min-height:36px;box-shadow:none;background:#F2F5F3;color:var(--muted)}
.cp-invview>.bl-acts .bl-del svg.i{width:18px;height:18px}
.cp-invview>.bl-acts .bl-del:hover,.cp-invview>.bl-acts .bl-del:active{color:var(--bad);background:#FDECEC}

/* ===== Product Info: shop-style product pages ===== */
.pi-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px}
.pi-card{display:flex;flex-direction:column;padding:0;overflow:hidden;color:inherit;text-decoration:none}
.pi-cimg{position:relative;aspect-ratio:1/1;background:#F4F6F5;display:grid;place-items:center;overflow:hidden}
.pi-cimg img{width:100%;height:100%;object-fit:cover}
.pi-size{position:absolute;top:8px;left:8px;background:#fff;border:1px solid var(--line);border-radius:999px;padding:2px 8px;font-size:11.5px;font-weight:600}
.pi-cb{padding:10px 12px 12px;display:flex;flex-direction:column;gap:2px}
.pi-cn{font-weight:700;font-size:14.5px;line-height:1.3}
.pi-noimg{width:100%;height:100%;display:grid;place-items:center;color:var(--accent);background:#F4F6F5}
.pi-noimg svg.i{width:38px;height:38px}
.pi-noimg.big svg.i{width:72px;height:72px}
.pi-top{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:16px;align-items:start}
.pi-gal{display:grid;grid-template-columns:76px minmax(0,1fr);gap:10px}
.pi-main{grid-column:2;grid-row:1;aspect-ratio:1/1;border-radius:18px;overflow:hidden;background:#F4F6F5;border:1px solid var(--line)}
.pi-main img{width:100%;height:100%;object-fit:contain;background:#fff}
.pi-thumbs{grid-column:1;grid-row:1;display:flex;flex-direction:column;gap:8px}
.pi-th{padding:0;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:#fff;aspect-ratio:1/1;cursor:pointer}
.pi-th img{width:100%;height:100%;object-fit:cover;display:block}
.pi-th.on{outline:2px solid var(--accent);outline-offset:1px}
.pi-info{display:flex;flex-direction:column;gap:8px;align-items:flex-start}
.pi-name{font-size:24px;line-height:1.25;margin:2px 0 0}
.pi-lbl{font-size:12.5px;font-weight:700;color:var(--muted);margin-top:6px}
.pi-sizes{display:flex;flex-wrap:wrap;gap:8px}
.pi-sz{display:inline-flex;align-items:center;gap:4px;border:1px solid var(--line);background:#fff;border-radius:999px;padding:6px 14px;font:inherit;font-size:13.5px;font-weight:600;color:var(--ink);cursor:pointer}
.pi-sz.on{border-color:var(--accent);color:var(--accent);background:var(--accent-soft)}
.pi-desc{margin:4px 0 0;line-height:1.6;color:#3C4A43;white-space:pre-line}
.pi-facts{display:flex;flex-wrap:wrap;gap:14px;font-size:13px;font-weight:600;color:var(--muted);margin-top:4px}
.pi-facts span{display:inline-flex;align-items:center;gap:6px}
.pi-facts svg.i{width:16px;height:16px;color:var(--accent)}
.pi-sec{padding:14px 16px}
.pi-h{display:flex;align-items:center;gap:8px;margin-bottom:10px;color:var(--accent)}
.pi-h h2{font-size:16px;color:var(--ink);margin:0}
.pi-ing{color:inherit;text-decoration:none}
.pi-ingimg{width:42px;height:42px;border-radius:12px;object-fit:cover;flex:none}
.pi-clip{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
.pi-amt{background:var(--accent-soft);color:var(--accent);border-radius:999px;padding:3px 10px;font-size:13px;white-space:nowrap}
.pi-crops{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:10px}
.pi-crop{position:relative;display:flex;flex-direction:column;align-items:center;gap:6px;padding:14px 8px 12px;border:1px solid var(--line);border-radius:16px;background:#fff;text-align:center}
.pi-crop.best{border-color:var(--accent);background:var(--accent-soft)}
.pi-cropic{width:56px;height:56px;border-radius:50%;display:grid;place-items:center;font-size:32px;background:#F4F6F5}
.pi-crop.best .pi-cropic{background:#fff}
.pi-cropn{font-weight:600;font-size:13.5px}
.pi-star{position:absolute;top:6px;right:6px;font-size:10.5px;font-weight:700;color:var(--accent);background:#fff;border-radius:999px;padding:1px 7px}
.pi-use{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px 18px}
.pi-use .pi-lbl{margin:0 0 3px}
.pi-mkh{display:flex;gap:12px;align-items:center}
/* editor */
.ie-photos{display:grid;grid-template-columns:repeat(auto-fill,minmax(88px,1fr));gap:10px}
.ie-ph{position:relative;aspect-ratio:1/1;border-radius:14px;overflow:hidden;border:1px solid var(--line);background:#F4F6F5}
.ie-ph img{width:100%;height:100%;object-fit:cover}
.ie-ph.main{outline:2px solid var(--accent);outline-offset:1px}
.ie-ph.add{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border-style:dashed;cursor:pointer;color:var(--muted);font-size:12.5px;font-weight:600}
.ie-phb{position:absolute;top:4px;width:26px;height:26px;border-radius:50%;border:0;background:rgba(255,255,255,.92);display:grid;place-items:center;font-size:14px;color:var(--ink);cursor:pointer;padding:0}
.ie-phb.l{left:4px;color:#E0A800}
.ie-phb.r{right:4px}
.ie-phb svg.i{width:14px;height:14px}
.ie-phmain{position:absolute;left:4px;bottom:4px;background:var(--accent);color:#fff;font-size:10.5px;font-weight:700;border-radius:999px;padding:1px 8px}
.ie-x{border:0;background:none;padding:0 0 0 2px;display:grid;place-items:center;color:inherit;cursor:pointer}
.ie-x svg.i{width:13px;height:13px}
.ie-comp{display:grid;grid-template-columns:minmax(0,1fr) 92px auto;gap:8px;align-items:center;margin-bottom:8px}
.ie-crops{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:8px}
.ie-crop{display:flex;align-items:center;gap:8px;padding:6px 8px;border:1px solid var(--line);border-radius:12px}
.ie-crop.used{background:#FAFCFB}
.ie-crop.best{border-color:var(--accent);background:var(--accent-soft)}
.ie-cic{font-size:20px;width:28px;text-align:center}
.ie-cn{flex:1;min-width:0;font-weight:600;font-size:13.5px}
@media (max-width:760px){
  .pi-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .pi-top{grid-template-columns:1fr}
  .pi-gal{grid-template-columns:1fr}
  .pi-main{grid-column:1;grid-row:1}
  .pi-thumbs{grid-column:1;grid-row:2;flex-direction:row;overflow-x:auto}
  .pi-th{width:64px;flex:none}
  .pi-name{font-size:21px}
  .pi-crops{grid-template-columns:repeat(3,minmax(0,1fr))}
  .ie-crops{grid-template-columns:1fr}
}

/* search boxes (data-filter) hide non-matching rows: the hidden attribute must win over the rows' flex / grid display */
[data-s][hidden]{display:none!important}

/* Product Info: dosage as picture cards */
.pi-dose{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:10px}
.pi-dc{display:flex;flex-direction:column;align-items:center;text-align:center;gap:4px;padding:14px 10px;border:1px solid var(--line);border-radius:16px;background:#FAFCFB}
.pi-dc.txt{align-items:flex-start;text-align:left}
.pi-dpic{width:54px;height:54px;border-radius:50%;display:grid;place-items:center;font-size:28px;background:var(--accent-soft);margin-bottom:2px}
.pi-dm{font-size:12.5px;font-weight:700;color:var(--muted)}
.pi-damt{font-size:19px;font-weight:800;color:var(--ink);line-height:1.2}
.pi-dper{display:inline-flex;align-items:center;gap:5px;font-size:13px;font-weight:600;color:var(--accent);background:#fff;border:1px solid var(--line);border-radius:999px;padding:3px 10px;margin-top:2px}
@media (max-width:760px){.pi-dose{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Product Info: two photo slots (Front, Back) */
.ie-photos.two{grid-template-columns:repeat(2,minmax(0,160px))}
.ie-slot{position:relative}
.ie-slot .ie-ph{display:block;cursor:pointer}
.ie-slot .ie-ph.add{display:flex}
.ie-slot .ie-phb.r{top:6px;right:6px}
.ie-slotl{text-align:center;font-size:13px;font-weight:700;margin-top:6px}
.pi-th{position:relative}
.pi-thl{position:absolute;left:0;right:0;bottom:0;background:rgba(255,255,255,.9);font-size:10.5px;font-weight:700;color:var(--ink);padding:1px 0;text-align:center}
@media (max-width:760px){.pi-th{width:76px}}

/* WhatsApp Messages editor: placeholder tags, drop target, preview bubble */
.wt-pal{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.wt-tk{display:inline-flex;align-items:center;gap:4px;padding:2px 9px;border-radius:999px;background:var(--accent-soft);color:var(--accent);font-weight:700;font-size:13px;line-height:1.6;white-space:nowrap;vertical-align:baseline;-webkit-user-select:none;user-select:none}
.wt-tk svg.i{width:13px;height:13px}
.wt-src{cursor:grab;touch-action:none;border:1px solid transparent;padding:5px 11px}
.wt-src:active{border-color:var(--accent)}
.wt-ed{min-height:220px;white-space:pre-wrap;word-break:break-word;line-height:1.9;font-size:15px;outline:none;cursor:text;height:auto}
.wt-ed.wt-over{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.wt-ghost{position:fixed;left:0;top:0;z-index:100;pointer-events:none;margin:-14px 0 0 -20px;box-shadow:0 6px 18px rgba(22,33,27,.2);background:#fff;border:1px solid var(--accent)}
body.wt-dragging,body.wt-dragging *{cursor:grabbing!important;-webkit-user-select:none;user-select:none}
.wt-bubble{background:#E7F8DD;border-radius:16px 16px 16px 4px;padding:12px 14px;max-width:520px}
.wt-bubble .msg{background:none;padding:0;margin:0;border:0;white-space:pre-wrap;font-family:inherit;font-size:14.5px}

/* Product Info: show the whole photo inside its square (fit, never cropped or zoomed) */
.pi-cimg{background:#fff}
.pi-cimg img,.pi-th img,.ie-ph img,.pi-ingimg,.info-img{object-fit:contain;background:#fff}
.pi-main img{object-fit:contain;width:100%;height:100%;background:#fff}
.pi-cimg img{padding:6px}

.pi-cimg img{position:absolute;inset:0;width:100%;height:100%;box-sizing:border-box}
.pi-th img{object-fit:contain}
/* product page: the photo always sits whole inside a true square */
.pi-main{position:relative}
.pi-main img{position:absolute;inset:0;padding:10px;box-sizing:border-box}
.pi-th img{padding:3px;box-sizing:border-box}
.pi-szlist{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;font-size:15px;font-weight:700;color:var(--ink)}
.pi-szlist span{color:var(--muted);font-weight:400}
/* Distributor dashboard: This Month and Outstanding cards, two figures each */
.dsum{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:12px}
.dsum-c{padding:14px 16px}
.dsum-h{font-size:13px;font-weight:700;color:var(--muted);text-transform:capitalize;margin-bottom:10px}
.dsum-r{display:grid;grid-template-columns:1fr 1fr}
.dsum-f{display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-width:0;border:0;background:none;font:inherit;color:inherit;text-align:left;padding:0 12px 0 0;cursor:pointer}
.dsum-f + .dsum-f{border-left:1px solid var(--line);padding:0 0 0 14px}
.dsum-f:active{transform:scale(.98)}
.dsum-f .tile{width:36px;height:36px;border-radius:11px}
.dsum-f .tile svg.i{width:20px;height:20px}
.dsum-l{font-size:13.5px;font-weight:600;color:var(--muted);text-transform:capitalize;line-height:1.25}
.dsum-v{font-size:22px;font-weight:700;line-height:1.2;white-space:nowrap;max-width:100%}
.dsum-v.n-m{font-size:19px}.dsum-v.n-s{font-size:17px}.dsum-v.n-xs{font-size:15px}
@media (max-width:760px){
  .dsum{grid-template-columns:1fr;gap:10px}
  .dsum-c{padding:12px 14px}
  .dsum-f .tile{width:32px;height:32px;border-radius:10px}
  .dsum-f .tile svg.i{width:18px;height:18px}
  .dsum-v{font-size:20px}
}
/* Collection agents: figures row, outcome buttons, retailer remarks, assign list */
.ag-figs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:2px}
.ag-figs.two{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:12px}
.ag-fig{background:#F6F8F7;border-radius:14px;padding:10px 12px;min-width:0}
.ag-fl{font-size:12.5px;font-weight:600;color:var(--muted);text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ag-fv{font-size:19px;font-weight:700;line-height:1.25;white-space:nowrap}
.ag-fv.n-m{font-size:17px}.ag-fv.n-s{font-size:15.5px}.ag-fv.n-xs{font-size:14px}
.ag-fig.ok .ag-fv{color:var(--accent)}
.ag-day .ag-figs{margin-top:14px}
.ag-hi{font-size:18px;font-weight:700}
.ag-ci{margin-top:12px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.ag-lbl{font-size:14px;font-weight:600;margin-bottom:8px}
.ag-outs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.ag-ob{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:76px;padding:10px 6px;border:1px solid var(--line);border-radius:14px;background:#fff;font:inherit;font-size:13px;font-weight:600;color:var(--ink);text-align:center;line-height:1.25;cursor:pointer}
.ag-ob svg.i{width:22px;height:22px;color:var(--muted)}
.ag-ob.on{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent);color:var(--accent)}
.ag-ob.on svg.i{color:var(--accent)}
.ag-ob:active{transform:scale(.97)}
.ag-said{margin-top:6px;padding:8px 10px;background:#F6F8F7;border-radius:10px;font-size:13.5px;line-height:1.45;color:#3C4A43;white-space:pre-line}
.ag-note{margin-top:6px;font-size:13px;color:#3C4A43;background:#F6F8F7;border-radius:10px;padding:6px 10px}
.ag-v{align-items:flex-start}
.ag-rts{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
.ag-rt{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);border-radius:999px;padding:6px 12px;font-size:13.5px;font-weight:600;cursor:pointer}
.ag-rt:has(input:checked){border-color:var(--accent);color:var(--accent)}
.ag-rt input{accent-color:var(--accent);margin:0}
.asg-r{gap:10px}
.asg-ck{display:flex;align-items:flex-start;gap:12px;flex:1;min-width:0;cursor:pointer}
.asg-ck input{width:20px;height:20px;margin-top:2px;accent-color:var(--accent);flex:none}
.asg-ck .main{flex:1;min-width:0}
.asg-amt{width:110px;flex:none;text-align:right}
.asg-bar{position:sticky;bottom:calc(76px + env(safe-area-inset-bottom));margin-top:14px;z-index:5}
@media (min-width:761px){.asg-bar{bottom:16px}}
@media (max-width:760px){
  .ag-figs{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .ag-outs{grid-template-columns:repeat(2,minmax(0,1fr))}
  .asg-amt{width:92px}
}
/* live map of agents: a round initial per agent with the name above it */
.ag-pin{background:none;border:0}
.ag-pin span{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;color:#fff;font-weight:700;font-size:15px;border:3px solid #fff;box-shadow:0 2px 6px rgba(0,0,0,.3)}
.ag-tip{font-weight:700;font-size:12px;padding:2px 8px;border-radius:999px}
/* Collection agents tracking dashboard: agent list (left) + big grey map with a floating detail card (right) */
.tdash{display:grid;grid-template-columns:340px minmax(0,1fr);height:640px;background:var(--card);border-radius:var(--r);box-shadow:var(--shadow);overflow:hidden}
.td-side{display:flex;flex-direction:column;min-height:0;padding:18px 16px 12px;border-right:1px solid var(--line)}
.td-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.td-top h2{font-size:18px}
.td-tabs{margin-bottom:12px}
.td-tabs button{padding:10px}
.td-tabs button.on{background:var(--ink);color:#fff;box-shadow:none}
.td-list{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:8px;margin:0 -4px;padding:0 4px 4px;scrollbar-width:thin}
.td-card{display:block;width:100%;text-align:left;font:inherit;color:inherit;background:#F6F8F7;border:1.5px solid transparent;border-radius:16px;padding:12px 14px;cursor:pointer}
.td-card:not(.on):hover{background:#EFF3F1}
.td-card.on{background:#fff;border-color:var(--ink);cursor:default}
.td-ch{display:flex;align-items:center;justify-content:space-between;gap:8px}
.td-cn{font-weight:700;font-size:15px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.td-cs{display:flex;align-items:center;gap:4px;margin-top:3px;font-size:12.5px;color:var(--muted);min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.td-cs svg.i{width:13px;height:13px;flex:none}
.td-prog{display:flex;flex-direction:column;align-items:center;gap:6px;margin:14px 0 4px}
.td-bar{width:100%;height:6px;border-radius:999px;background:#EEF2EF;overflow:hidden}
.td-bar i{display:block;height:100%;background:var(--accent);border-radius:999px}
.td-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:12px 0}
.td-grid span,.td-fg span{display:block;font-size:11.5px;color:var(--muted);text-transform:capitalize;white-space:nowrap}
.td-grid b{display:block;font-size:13px;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.td-who{display:flex;align-items:center;gap:10px;padding-top:12px;border-top:1px solid var(--line)}
.td-av{width:40px;height:40px;border-radius:12px;background:#EEF2EF;display:grid;place-items:center;font-weight:700;flex:none}
.td-who .icon-btn{width:38px;height:38px;flex:none}
.td-who .icon-btn svg.i{width:18px;height:18px}
.td-more{display:flex;align-items:center;justify-content:space-between;margin-top:12px;font-size:13px;color:var(--ink);text-decoration:none}
.td-more svg.i{width:16px;height:16px;transform:rotate(90deg)}
.td-map{position:relative;min-width:0;background:#E9ECEA}
.td-canvas{position:absolute;inset:0}

.td-canvas .empty{height:100%;display:grid;place-items:center}
.td-ctl{position:absolute;top:14px;right:14px;z-index:900;display:flex;gap:8px}
.td-ctl .icon-btn{width:40px;height:40px}
.td-float{position:absolute;left:16px;right:16px;bottom:16px;z-index:900;background:#fff;border-radius:16px;box-shadow:0 8px 30px rgba(22,33,27,.14);padding:14px 16px}
.td-fh{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-bottom:12px;margin-bottom:12px;border-bottom:1px solid var(--line)}
.td-fn{font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.td-fg{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
.td-fg b{display:block;font-size:13.5px;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.td-fg small{display:block;font-size:11.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.td-now{background:none;border:0}
.td-now span{display:block;width:22px;height:22px;border-radius:50%;background:var(--ink);border:4px solid #fff;box-shadow:0 0 0 2px var(--ink),0 2px 8px rgba(0,0,0,.3)}
.td-now span.live{animation:tdPulse 1.8s ease-out infinite}
@keyframes tdPulse{0%{box-shadow:0 0 0 2px var(--ink),0 0 0 2px rgba(22,33,27,.35)}100%{box-shadow:0 0 0 2px var(--ink),0 0 0 16px rgba(22,33,27,0)}}
.td-tip{background:var(--ink);color:#fff;border:0;border-radius:999px;font-weight:700;font-size:12px;padding:3px 10px;box-shadow:none}
.td-tip::before{display:none}
.td-dest{background:none;border:0}
.td-dpin{position:absolute;left:0;top:0;color:var(--ink)}
.td-dpin svg.i{width:24px;height:24px;fill:var(--ink);stroke:#fff}
.td-dname{position:absolute;left:28px;top:-4px;font-size:24px;font-weight:700;color:var(--ink);white-space:nowrap;letter-spacing:-.3px;text-shadow:0 0 4px #fff,0 0 4px #fff,0 0 8px #fff}
@media (max-width:760px){
  .tdash{grid-template-columns:1fr;height:auto}
  .td-map{order:-1;height:62vh;min-height:420px}
  .td-side{border-right:0;border-top:1px solid var(--line);padding:16px 12px}
  .td-list{overflow:visible}
  .td-float{left:10px;right:10px;bottom:10px;padding:12px}
  .td-fg{grid-template-columns:repeat(2,minmax(0,1fr));row-gap:10px}
  .td-fg>div:nth-child(4){display:none}
  .td-dname{font-size:18px}
  .td-ctl{top:10px;right:10px}
}
/* maps: full screen inside the app, legend, markers */
.map-box{position:relative}
.map-fs{position:absolute;top:10px;right:10px;z-index:950;width:40px;height:40px}
.td-ctl .map-fs{position:static}
.map-full{position:fixed!important;inset:0!important;z-index:3000!important;margin:0!important;border-radius:0!important;height:auto!important;max-height:none!important;background:#E9ECEA}
.map-box.map-full .route-map{height:100%!important;border-radius:0}
.map-box.map-full .map-key{position:absolute;left:10px;bottom:10px;z-index:950;background:#fff;border-radius:999px;padding:6px 12px;box-shadow:0 2px 10px rgba(0,0,0,.15);margin:0}
.map-full .map-fs{top:calc(10px + env(safe-area-inset-top))}
.td-map.map-full .td-ctl{top:calc(14px + env(safe-area-inset-top))}
body:has(.map-full){overflow:hidden}
.td-pick{position:absolute;top:calc(14px + env(safe-area-inset-top));left:14px;right:170px;z-index:900;display:flex;gap:6px;overflow-x:auto;scrollbar-width:none}
.td-pick .chip{background:#fff;box-shadow:0 1px 6px rgba(0,0,0,.12)}
.td-pick .chip.on{background:var(--ink);color:#fff}
.map-key{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:8px;font-size:12px;color:var(--muted);font-weight:600}
.map-key span{display:inline-flex;align-items:center;gap:6px}
.map-key i{display:inline-block;flex:none}
.k-line{width:22px;height:4px;border-radius:2px;background:var(--ink)}
.k-dash{width:22px;height:0;border-top:3px dotted var(--ink)}
.k-stop{width:16px;height:16px;border-radius:50%;background:var(--ink);color:#fff;font-size:10px;font-style:normal;display:grid!important;place-items:center}
.k-done{width:14px;height:14px;border-radius:50%;background:var(--accent)}
.mk{background:none;border:0}
.mk-agent{display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:var(--ink);color:#fff;font-weight:700;font-size:16px;border:3px solid #fff;box-shadow:0 3px 10px rgba(0,0,0,.35);box-sizing:border-box}
.mk-agent.live{animation:mkPulse 1.8s ease-out infinite}
.mk-agent img,.td-av img{width:100%;height:100%;object-fit:cover;border-radius:inherit;display:block}
.mk-agent.ph{padding:0;overflow:hidden;background:#fff}
.td-av{overflow:hidden}
.mk-agent.other{width:30px;height:30px;font-size:13px;background:#9AA5A0;border-width:2px}
@keyframes mkPulse{0%{box-shadow:0 0 0 2px #2F6BF2,0 0 0 2px rgba(47,107,242,.45)}100%{box-shadow:0 0 0 2px #2F6BF2,0 0 0 18px rgba(47,107,242,0)}}
.mk-stop{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:#fff;color:var(--ink);border:2.5px solid var(--ink);font-weight:800;font-size:13px;box-sizing:border-box;box-shadow:0 2px 6px rgba(0,0,0,.2);flex:none}
.mk-stop.next{background:var(--ink);color:#fff;border-color:#fff;width:34px;height:34px;font-size:15px;box-shadow:0 0 0 2.5px var(--ink),0 3px 8px rgba(0,0,0,.3)}
.mk-stop.sm{width:28px;height:28px;font-size:12.5px;box-shadow:none}
.mk-stop.sm.next{width:28px;height:28px;font-size:12.5px;box-shadow:0 0 0 2px var(--ink)}
.mk-stop.none{border-style:dashed;color:var(--muted);border-color:#C9D1CD}
.mk-done{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--accent);color:#fff;border:2.5px solid #fff;box-shadow:0 2px 6px rgba(0,0,0,.25);box-sizing:border-box}
.mk-done svg.i{width:14px;height:14px;stroke-width:3}
.mk-start{display:block;width:16px;height:16px;border-radius:50%;background:#9AA5A0;border:3px solid #fff;box-shadow:0 1px 4px rgba(0,0,0,.3);box-sizing:border-box}
.mk-dname{position:absolute;left:0;top:0;font-size:22px;font-weight:800;color:var(--ink);white-space:nowrap;letter-spacing:-.3px;text-shadow:0 0 4px #fff,0 0 4px #fff,0 0 8px #fff;pointer-events:none}
.td-rts{display:flex;flex-wrap:wrap;gap:6px;margin:-2px 0 12px}
.td-rts .pill svg.i{width:12px;height:12px}
.rt-agent{display:flex;align-items:flex-end;flex-wrap:wrap;gap:10px 16px;margin-bottom:12px}
.rt-pick{max-height:min(52vh,420px);overflow-y:auto;margin:0 -4px;padding:0 4px}
.rt-row{gap:12px;cursor:pointer;padding:12px 4px}
.rt-row input{width:20px;height:20px;accent-color:var(--accent);flex:none}
.td-fg{grid-template-columns:repeat(6,minmax(0,1fr))}
@media (max-width:760px){
  .td-fg{grid-template-columns:repeat(2,minmax(0,1fr))}
  .td-fg>div:nth-child(1),.td-fg>div:nth-child(4){display:none}
  .td-pick{left:10px;right:150px}
  .mk-dname{font-size:17px}
}
/* Collection Agents list and agent page */
.ag-row{gap:10px}
.ag-link{display:flex;align-items:flex-start;gap:12px;flex:1;min-width:0;color:inherit;text-decoration:none}
.ag-link .main{flex:1;min-width:0}
.ag-row .icon-btn{width:40px;height:40px;flex:none}
.ag-row .icon-btn svg.i{width:18px;height:18px}
.ag-pg{display:flex;align-items:center;gap:10px;margin-top:10px}
.ag-pg .td-bar{flex:1;max-width:220px}
.ag-pg span{font-size:12.5px;font-weight:600;color:var(--muted);white-space:nowrap}
.td-av.off{background:var(--bad-soft);color:var(--bad)}
.td-av.lg{width:56px;height:56px;border-radius:16px;font-size:22px}
.ag-hd{display:flex;align-items:flex-start;gap:14px}
.ag-hd .main{flex:1;min-width:0}
.ag-hd .li-acts a.pill{text-decoration:none}
.ag-hd .pill svg.i,.ag-row .pill svg.i{width:12px;height:12px}
.ag-today{display:flex;align-items:center;gap:16px}
.ag-pct{font-size:40px;font-weight:800;line-height:1;letter-spacing:-1px;color:var(--ink);flex:none}
.ag-pct small{font-size:20px;font-weight:700;margin-left:1px}
.ag-today .td-bar{height:8px;margin-top:8px}
.ag-loc{display:flex;align-items:center;gap:12px}
.ag-loc .main{flex:1;min-width:0}
.ag-loc .t{font-weight:700}
.ag-loc .s{color:var(--muted);font-size:13px;margin-top:2px}
.mk-done.sm{width:28px;height:28px;flex:none;box-shadow:none;border:0}
.ag-day-row{width:100%;border:0;background:none;text-align:left;font:inherit;color:inherit}
.ag-day-row.on{background:#F6F8F7}
/* timeline: time on the left, a dot on a line, what happened */
.tl{display:flex;flex-direction:column}
.tl-i{display:grid;grid-template-columns:48px 18px minmax(0,1fr) auto;gap:0 10px;align-items:start;position:relative;padding:0 0 16px}
.tl-i:last-child{padding-bottom:0}
.tl-i::before{content:'';position:absolute;left:66px;top:14px;bottom:-2px;width:2px;background:var(--line)}
.tl-i:last-child::before{display:none}
.tl-time{font-size:12.5px;font-weight:700;color:var(--muted);padding-top:2px;text-align:right}
.tl-dot{width:14px;height:14px;border-radius:50%;margin-top:3px;background:#fff;border:3px solid var(--ink);box-sizing:border-box;position:relative;z-index:1;justify-self:center}
.tl-i.in .tl-dot{background:var(--accent);border-color:var(--accent)}
.tl-i.out .tl-dot{background:var(--ink)}
.tl-i.paid .tl-dot{border-color:var(--accent)}
.tl-i.gap .tl-dot{border-color:var(--warn);border-style:dashed}
.tl-i .t{font-weight:600}
.tl-i .s{font-size:13px;color:var(--muted);margin-top:2px}
.tl-i.gap .t{color:var(--warn)}
.tl-i>b{padding-top:1px}
/* picking a route: chips in the retailer form, retailers without a route */
.rt-chips{display:flex;flex-wrap:wrap;gap:8px}
.rt-chip{display:inline-flex;align-items:center;gap:6px;border:1.5px solid var(--line);background:#fff;border-radius:999px;padding:8px 14px;font:inherit;font-size:14px;font-weight:600;color:var(--ink);cursor:pointer}
.rt-chip.on{border-color:var(--accent);color:var(--accent)}
.rt-chip.add{border-style:dashed;color:var(--muted)}
.rt-chip.add.on{border-style:solid;color:var(--accent)}
.rt-chip svg.i{width:15px;height:15px}
.rt-loose{display:flex;align-items:center;gap:12px;margin-bottom:12px;color:inherit;text-decoration:none;padding:14px 16px}
.rt-loose .main{flex:1;min-width:0;font-weight:700}
.rt-set{width:auto;max-width:140px;min-height:38px;padding:4px 8px;flex:none}
@media (max-width:760px){
  .ag-row .icon-btn{width:36px;height:36px}
  .ag-hd .row .icon-btn{width:38px;height:38px}
  .ag-pct{font-size:34px}
  .rt-set{max-width:120px}
}
.map-note{position:absolute;top:10px;left:56px;right:60px;z-index:900;width:fit-content;max-width:calc(100% - 116px);margin:0 auto;background:var(--ink);color:#fff;font-size:12.5px;font-weight:600;padding:6px 12px;border-radius:999px;box-shadow:0 2px 8px rgba(0,0,0,.2);text-align:center;pointer-events:none}
.map-note.low{top:auto;bottom:34px;background:#fff;color:var(--ink)}
/* minimal: route card day picker and one summary line, two-number cards, agent page tabs */
.rc-days{display:flex;align-items:center;gap:8px;margin-bottom:10px}
/* one date field: shows the day; tapping it opens the phone's calendar */
.rc-date{position:relative;display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 16px;margin-bottom:10px;border-radius:999px;background:#fff;box-shadow:0 0 0 1px var(--line);font-size:14px;font-weight:600;color:var(--ink);cursor:pointer}
.rc-date svg.i{width:18px;height:18px;flex:none}
.rc-date input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer;border:0;padding:0}
.rc-days .chips{margin:0;padding:0;flex:1;min-width:0;align-items:center}
/* calendar: one round button on the right of the Route heading; the phone's date picker is clipped inside it */
.sec-h h2{min-width:0}
.rc-wrap{display:flex;align-items:center;gap:8px;flex:none;margin-left:auto}
/* the app's own date button (datepicker.js) used as-is: one date + calendar icon in a small rectangle */
.dp-btn.rc-cal{width:auto;height:38px;flex:none;display:inline-flex;align-items:center;gap:8px;padding:0 12px;margin:0;border:1px solid var(--line);border-radius:10px;background:#fff;font-size:13.5px;font-weight:600;white-space:nowrap}
/* map credit folded into a small ⓘ; tap it to read */
.leaflet-control-attribution{font-size:0!important;width:20px;height:20px;padding:0!important;border-radius:50% 0 0 0;background:rgba(255,255,255,.75)!important;display:grid;place-items:center;overflow:hidden;cursor:pointer}
.leaflet-control-attribution::before{content:'i';font:italic 700 11px/1 Georgia,serif;color:#555}
.leaflet-control-attribution:hover,.leaflet-control-attribution:active,.leaflet-control-attribution:focus-within{font-size:10px!important;width:auto;height:auto;padding:2px 6px!important;border-radius:6px 0 0 0;display:block}
.leaflet-control-attribution:hover::before,.leaflet-control-attribution:active::before{content:none}
.rc-cal svg.i{width:18px;height:18px}
.rc-cal input{position:absolute;inset:0;width:100%;height:100%;min-width:0;max-width:none;margin:0;padding:0;border:0;opacity:0;font-size:16px;-webkit-appearance:none;appearance:none;cursor:pointer}
.rc-cal input::-webkit-calendar-picker-indicator{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;opacity:0;cursor:pointer}
.rc-line{padding:10px 6px 2px;font-size:13px;font-weight:600;color:var(--muted)}
.ag-two{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:16px 18px}
.ag-two span{display:block;font-size:12.5px;color:var(--muted);font-weight:600}
.ag-two b{display:block;font-size:22px;font-weight:800;margin-top:2px}
.ag-two>div+div{border-left:1px solid var(--line);padding-left:14px}
.ag-sum{margin-top:2px;font-size:13.5px;color:var(--muted);font-weight:600}
.ag-tabs{margin:14px 0 12px}
.ag-where{display:flex;align-items:center;gap:8px;margin-top:14px;padding-top:12px;border-top:1px solid var(--line);color:var(--ink);text-decoration:none;font-size:13.5px;font-weight:600}
.ag-where span:first-of-type{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ag-where svg.i{width:16px;height:16px;flex:none}
/* distance travelled today: tap to see the route */
.ag-km{display:flex;align-items:center;gap:8px;width:100%;margin-top:14px;padding:12px 14px;border:0;border-radius:14px;background:#F6F8F7;font:inherit;color:var(--ink);cursor:pointer;text-align:left}
.ag-km b{font-size:22px;font-weight:800;line-height:1}
.ag-km span{flex:1;font-size:13px;font-weight:600;color:var(--muted)}
.ag-km svg.i{width:18px;height:18px;flex:none}
.ag-km svg.i:first-child{color:var(--accent)}
.ag-km:active{transform:scale(.99)}
.ag-cash{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:12px;padding-top:12px;border-top:1px solid var(--line);font-weight:700}
.icon-btn.sm-x{width:32px;height:32px;flex:none;box-shadow:none;background:transparent;color:var(--muted)}
.icon-btn.sm-x svg.i{width:16px;height:16px}
.td-fg.three{grid-template-columns:repeat(3,minmax(0,1fr))!important}
.td-fg.three>div{display:block!important}
.td-who{border-top:1px solid var(--line);padding-top:10px;margin-top:10px}
.td-card .ag-pg{margin-top:10px}
.map-holder{width:100%;height:100%}
/* while new map pictures load, a light ground that matches the white map (no flashes) */
.leaflet-container{background:#F2F1ED!important}
.leaflet-tile-container,.leaflet-zoom-animated{will-change:transform}
.leaflet-tile{backface-visibility:hidden}
/* money paid ahead by a retailer (more than they owed): +₹500 next to the name */
.adv{display:inline-block;color:var(--accent);font-weight:700;font-size:.92em;white-space:nowrap}
/* ---- layout fixes for phones (no overlaps) ---- */
/* small round buttons in page headers, so a header stays on one line */
.icon-btn.hd-ic{width:38px;height:38px;flex:none;box-shadow:0 0 0 1px var(--line)}
.icon-btn.hd-ic svg.i{width:18px;height:18px}
/* agent rows: a long name is cut with … instead of pushing the status off the row */
.ag-row .main .row{min-width:0;flex-wrap:nowrap}
.ag-row .main .t{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ag-row .main .pill{flex:none}
.ag-row .s{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* list rows with a number, a name and an amount: the name takes the room, the rest never wraps */
.rt-li{gap:10px}
.rt-li>.num,.li>b.num{flex:none;white-space:nowrap}
.li .main .t{overflow-wrap:anywhere}
/* route page: agent picker on its own line, the two add buttons under it */
.rt-agent{display:flex;flex-direction:column;align-items:stretch;gap:10px}
.rt-add{display:flex;gap:8px;flex-wrap:wrap}
.rt-add .btn{flex:1;justify-content:center;min-width:140px}
/* live map: the note sits below the map buttons and the agent chips */
.td-canvas .map-note{top:62px;left:14px;right:14px}
.td-map.map-full .td-canvas .map-note{top:calc(110px + env(safe-area-inset-top))}
/* page header actions never squeeze the title */
@media (max-width:760px){.top-actions{gap:6px}.top-actions .btn.sm{padding:7px 10px}}
/* Receivables: small green arrow that opens WhatsApp with the reminder typed */
.rec-li{gap:12px}
.wa-go{width:36px;height:36px;flex:none;border-radius:50%;background:#25D366;color:#fff;display:grid;place-items:center;text-decoration:none;border:0;padding:0;cursor:pointer}
.wa-go svg.i{width:17px;height:17px;stroke:#fff}
/* send in the WhatCrop app (customers who use the app) */
.app-go{width:36px;height:36px;flex:none;border-radius:50%;background:var(--accent-soft);color:var(--accent);border:1.5px solid var(--accent);display:grid;place-items:center;padding:0;cursor:pointer}
.app-go svg.i{width:16px;height:16px}
.app-go:active{transform:scale(.94)}
.dot-new{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--bad);vertical-align:middle;margin-left:4px}
.wa-go:active{transform:scale(.94)}
/* agent's nearest shop card */
.ag-next{margin-top:12px;border:1.5px solid var(--ink)}
.ag-nl{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:600;color:var(--muted);margin-bottom:4px}
.ag-nl svg.i{width:14px;height:14px}
.ag-namt{font-size:20px;font-weight:800;margin-top:2px}
.ag-nbtns{display:flex;gap:8px;margin-top:14px}
.ag-nbtns .btn{flex:1;justify-content:center}
.ag-nbtns .btn:last-child:not(:first-child):not(:nth-child(2)){flex:0 0 auto}
.ag-after{margin-top:10px;padding-top:10px;border-top:1px solid var(--line);font-size:13px;color:var(--muted)}
.ag-issues{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.ag-issues .pill,.ag-fix{white-space:normal;text-align:left}
.ag-issues .pill svg.i,.ag-fix svg.i{width:12px;height:12px;flex:none}
.ag-fix{border:0;font:inherit;font-size:12px;font-weight:600;cursor:pointer;margin:2px 0}
/* Product Info pages: 1 2 3 … under the grid */
.pg{display:flex;justify-content:center;align-items:center;gap:6px;margin:16px 0 4px;flex-wrap:wrap}
.pg-b{min-width:40px;height:40px;padding:0 10px;display:inline-grid;place-items:center;border:1px solid var(--line);border-radius:12px;background:#fff;font:inherit;font-size:14px;font-weight:700;color:var(--ink);cursor:pointer}
.pg-b.on{border-color:var(--accent);color:var(--accent)}
.pg-b.off{opacity:.35;cursor:default}
.pg-b svg.i{width:18px;height:18px}
.pg-gap{color:var(--muted);padding:0 2px}

/* every product photo (Stock, Billing, Shop, Request Stock, product popup, editors): the whole photo fits inside its square */
img.tile.pimg,.prod-img,.pv-img,.pimg-prev img,.shop-pic img.prod-img,.shop-pic img{object-fit:contain!important;background:#fff}

/* Accounts → GST: returns for the accountant */
.gst-acts{display:flex;flex-direction:column;gap:8px;margin-top:14px}
.gst-acts .btn{width:100%;justify-content:center;min-height:48px;margin:0}


/* Bills: search and the calendar side by side */
.bl-find{display:flex;align-items:center;gap:8px;flex:1 1 260px;min-width:0}
.bl-find .search{flex:1;min-width:0!important;margin:0}
.bl-find .dp-btn.rc-cal{flex:none;height:46px}
.bl-find .dp-btn.rc-cal.empty .dp-v{display:none}

/* Settings → Users → Permissions: one row per permission with an on/off switch */
.perm-row{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:12px 0;border:0;border-bottom:1px solid var(--line);background:none;font:inherit;font-weight:600;font-size:14.5px;color:var(--ink);text-align:left;cursor:pointer}
.perm-row:last-child{border-bottom:0}
.sw{position:relative;width:46px;height:28px;border-radius:999px;background:#D5DDD8;flex:none;transition:background .15s}
.sw i{position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.2);transition:left .15s}
.sw.on{background:var(--accent)}.sw.on i{left:21px}

/* customer page: crops they grow */
.cc-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
.cc-crop{display:flex;align-items:center;gap:10px;padding:10px;border-radius:14px;background:#F6F8F7;min-width:0}
.cc-crop>div{display:flex;flex-direction:column;min-width:0}
.cc-crop b{font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cc-crop span{font-size:12px;color:var(--muted)}
.cp-crops .sec-h{gap:8px}

/* Receivables: the reminder buttons sit in a fixed slot so the amounts line up */
.rec-acts{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:none;width:80px}

/* ---------- map theme: grey street map, blue routes, white floating cards and chips ---------- */
.wc-tiles{filter:grayscale(1) brightness(1.05) contrast(.88)}
.leaflet-container{background:#EEF0F2!important}
.route-map,.td-map{background:#EEF0F2}
.leaflet-control-zoom{border:0!important;border-radius:14px!important;overflow:hidden;box-shadow:0 4px 16px rgba(22,33,27,.14)!important;margin:0 10px 12px 0!important}
.leaflet-control-zoom a{width:38px!important;height:38px!important;line-height:38px!important;color:var(--ink)!important;font-size:20px!important;border-bottom:1px solid var(--line)!important}
.leaflet-control-zoom a:last-child{border-bottom:0!important}
.map-zoom{position:absolute;right:14px;top:50%;transform:translateY(-50%);z-index:900;display:flex;flex-direction:column;background:#fff;border-radius:14px;box-shadow:0 4px 16px rgba(22,33,27,.14);overflow:hidden}
.map-zoom button{width:40px;height:40px;display:grid;place-items:center;border:0;background:none;color:var(--ink);cursor:pointer;border-bottom:1px solid var(--line)}
.map-zoom button:last-child{border-bottom:0}
.map-zoom svg.i{width:18px;height:18px}
.map-zoom .mz-fit{color:#2F6BF2}
.mz-minus{display:block;width:14px;height:2px;border-radius:2px;background:currentColor}
.td-ctl .icon-btn,.map-fs{background:#fff;border:0;box-shadow:0 4px 16px rgba(22,33,27,.14)}
.mk-agent{background:#2F6BF2;box-shadow:0 0 0 2px #2F6BF2,0 4px 12px rgba(47,107,242,.4)}
.mk-agent.ph{box-shadow:0 0 0 2.5px #2F6BF2,0 4px 12px rgba(47,107,242,.4)}
.mk-agent.other{background:#A3ADB8;box-shadow:0 2px 6px rgba(0,0,0,.25)}
.mk-stop{color:#2F6BF2;border-color:#2F6BF2}
.mk-stop.next{background:#2F6BF2;box-shadow:0 0 0 2.5px #2F6BF2,0 3px 8px rgba(47,107,242,.35)}
.mk-done{background:#16211B}
.mk-start{width:18px;height:18px;background:#fff;border:5px solid #2F6BF2;box-shadow:0 2px 6px rgba(0,0,0,.25)}
.mk-chip{position:absolute;left:0;bottom:22px;transform:translateX(-50%);display:flex;flex-direction:column;align-items:flex-start;background:#fff;border-radius:10px;padding:5px 10px 6px;box-shadow:0 4px 14px rgba(22,33,27,.16);white-space:nowrap;pointer-events:none}
.mk-chip::after{content:'';position:absolute;left:50%;bottom:-5px;width:10px;height:10px;background:#fff;transform:translateX(-50%) rotate(45deg);border-radius:2px}
.mk-chip small{font-size:10.5px;font-weight:600;color:var(--muted);line-height:1.2}
.mk-chip b{font-size:12.5px;color:var(--ink);line-height:1.3;max-width:160px;overflow:hidden;text-overflow:ellipsis}
.td-float{border-radius:20px;box-shadow:0 10px 34px rgba(22,33,27,.16)}
.td-float .td-av{width:44px;height:44px;border-radius:50%;font-size:17px;background:#E8EFFE;color:#2F6BF2}
.td-fs{display:flex;align-items:center;gap:6px;font-size:12.5px;color:var(--muted);font-weight:600;margin-top:1px}
.td-dot{width:8px;height:8px;border-radius:50%;background:#2F6BF2;box-shadow:0 0 0 3px rgba(47,107,242,.18)}
.td-call{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:#2F6BF2;color:#fff;flex:none}
.td-call svg.i{width:18px;height:18px}
.td-tl{margin-top:12px;display:flex;flex-direction:column}
.td-tl>div{position:relative;display:grid;grid-template-columns:12px 44px minmax(0,1fr) auto;align-items:center;gap:8px;padding:5px 0;font-size:12.5px}
.td-tl>div i{width:10px;height:10px;border-radius:50%;border:2px solid #B9C3CE;background:#fff;box-sizing:border-box;z-index:1}
.td-tl>div.on i{border-color:#2F6BF2;background:#2F6BF2}
.td-tl>div:not(:last-child)::before{content:'';position:absolute;left:4.5px;top:17px;bottom:-7px;width:1px;background:#DCE2E8}
.td-tl span{color:var(--muted)}
.td-tl b{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.td-tl small{color:var(--muted);font-size:11.5px;white-space:nowrap}
.k-line{background:#2F6BF2}
.k-dash{border-top:3px dashed #8FB0F7}
.k-stop{background:#2F6BF2}
.k-done{background:#16211B}
@media (max-width:760px){.map-zoom{right:10px;top:calc(50% - 60px)}}
.mk-stop.sm.next{box-shadow:0 0 0 2px #2F6BF2}
.map-zoom{top:64px;transform:none}
.td-map.map-full .map-zoom{top:calc(68px + env(safe-area-inset-top))}
@media (max-width:760px){.map-zoom{right:10px;top:60px}}
.ag-vacts{display:grid;grid-template-columns:repeat(auto-fit,minmax(0,1fr));gap:8px;margin-top:12px}
.ag-vacts .btn{justify-content:center;min-width:0;padding-left:8px;padding-right:8px}
.li .s .link{padding:0;font-size:inherit}
.empty{text-transform:capitalize}
@media (max-width:760px){.route-map .leaflet-control-zoom{display:none}}

/* ---------- Shop Page (Settings → Shop Page) ---------- */
.sp-tabs{margin-bottom:14px;width:100%}
.sp-tabs button{flex:1}
.sp-ph{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.sp-tile{position:relative;aspect-ratio:1;border-radius:var(--r-sm);overflow:hidden;background:#F2F4F3}
.sp-img{all:unset;display:block;width:100%;height:100%;cursor:pointer}
.sp-img img{width:100%;height:100%;object-fit:cover;display:block}
.sp-cover{position:absolute;left:6px;bottom:6px;background:rgba(0,0,0,.6);color:#fff;font-size:11px;font-weight:600;padding:2px 8px;border-radius:999px}
.sp-rm{position:absolute;top:5px;right:5px;width:26px;height:26px;border-radius:50%;border:0;background:rgba(0,0,0,.55);color:#fff;display:grid;place-items:center;padding:0;cursor:pointer}
.sp-rm svg.i{width:14px;height:14px}
.sp-add{aspect-ratio:1;border:1.5px dashed var(--line);border-radius:var(--r-sm);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;color:var(--accent);font-size:12.5px;font-weight:600;cursor:pointer}
.sp-loc{display:flex;align-items:center;gap:8px;margin-top:12px;font-size:14px}
.sp-loc span{flex:1;min-width:0}
.sp-loc>svg.i{color:var(--accent);flex:none}
.sp-days{display:flex;flex-direction:column;gap:8px}
.sp-day{display:grid;grid-template-columns:62px minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:6px}
.sp-day .inp{min-height:38px;height:38px;padding:4px 6px;font-size:13.5px;width:100%;min-width:0}
.sp-dn{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:600;min-width:0}
.sp-dn input{width:18px;height:18px;accent-color:var(--accent);flex:none}
.sp-day.off .sp-dn{color:var(--muted)}
.sp-closed{grid-column:2/-1;color:var(--muted);font-size:13.5px}
.sp-holadd{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:6px;align-items:center}
.sp-holadd .inp{min-width:0;width:100%}
.sp-chk{display:flex;align-items:center;gap:10px;padding:9px 0;font-size:14px;cursor:pointer}
.sp-chk input{width:18px;height:18px;accent-color:var(--accent);flex:none}
.sp-prod{border-top:1px solid var(--line)}
.sp-pn{flex:1;min-width:0;display:flex;flex-direction:column}
.sp-pn small{color:var(--muted);font-size:12px}
.sp-cat{margin:12px 0 2px;font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.sp-save{margin:4px 0 20px}
/* preview: like a place page on a map app */
.spv{padding:0;overflow:hidden}
.spv-gal{display:flex;gap:4px;overflow-x:auto;scroll-snap-type:x mandatory;background:#F2F4F3;scrollbar-width:none}
.spv-gal::-webkit-scrollbar{display:none}
.spv-gal img{height:200px;width:auto;max-width:88%;object-fit:cover;scroll-snap-align:start;flex:none}
.spv-gal img:only-child{width:100%;max-width:100%}
.spv-nophoto{height:140px;width:100%;display:grid;place-items:center;color:var(--muted)}
.spv-nophoto svg.i{width:40px;height:40px}
.spv-body{padding:16px}
.spv-hd{display:flex;gap:12px;align-items:flex-start}
.spv-logo{width:48px;height:48px;border-radius:12px;object-fit:contain;border:1px solid var(--line);background:#fff;flex:none}
.spv-name{margin:0;font-size:21px;line-height:1.25}
.spv-sub{color:var(--muted);font-size:13.5px;margin-top:2px}
.spv-st{font-size:13.5px;font-weight:600;margin-top:4px}
.spv-st.on{color:var(--accent)}
.spv-st.off{color:var(--bad)}
.spv-acts{display:flex;gap:10px;margin:16px 0 4px;overflow-x:auto}
.spv-act{display:flex;flex-direction:column;align-items:center;gap:5px;font-size:12.5px;font-weight:600;color:var(--accent);text-decoration:none;min-width:72px}
.spv-act span{width:44px;height:44px;border-radius:50%;background:var(--accent-soft);display:grid;place-items:center}
.spv-acts .spv-act:first-child span{background:var(--accent);color:#fff}
.spv-about{margin:12px 0 0;font-size:14px;line-height:1.5;white-space:pre-line}
.spv-rows{margin-top:12px;border-top:1px solid var(--line)}
.spv-row{display:flex;gap:12px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line);font-size:14px}
.spv-row.top{align-items:flex-start}
.spv-row.top>svg.i{align-self:flex-start;margin-top:1px}
.spv-row>svg.i{color:var(--accent);flex:none}
.spv-hours{flex:1;display:flex;flex-direction:column;gap:4px}
.spv-hours>div{display:flex;justify-content:space-between;gap:10px}
.spv-hours>div.today{font-weight:700}
.spv-chips{display:flex;gap:6px;overflow-x:auto;margin-bottom:8px;scrollbar-width:none}

/* ---------- Messages (chat icon on the top bar): like WhatsApp, same look as the farmer app ---------- */
#userChip{display:flex;align-items:center;gap:8px}
.chat-btn{position:relative;width:38px;height:38px;background:#fff;color:var(--ink);text-decoration:none;flex:none}
.chat-btn svg.i{width:20px;height:20px}
.chat-btn.on{color:var(--accent);box-shadow:0 0 0 1.5px var(--accent)}
.wa-list{padding:4px 0;overflow:hidden}
.wa-row{position:relative;display:flex;align-items:center;gap:12px;padding:12px 16px;color:inherit;text-decoration:none;min-height:72px}
.wa-row[hidden]{display:none}
.wa-row:not(:last-child)::after{content:'';position:absolute;left:76px;right:0;bottom:0;height:1px;background:var(--line)}
.wa-av{flex:none;width:48px;height:48px;border-radius:50%;background:#F2F4F3;border:1px solid var(--line);color:var(--accent);font-weight:700;font-size:19px;display:grid;place-items:center;overflow:hidden}
.wa-mid{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.wa-mid b{font-size:16px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wa-prev{font-size:14px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wa-end{flex:none;align-self:flex-start;padding-top:4px}
.wa-when{font-size:12px;color:var(--muted)}
.wa-tk{font-size:11.5px;letter-spacing:-2px;color:var(--muted);margin-right:2px}
.wa-tk.read{color:#2F6BF2}
html:has(body.chat-mode),body.chat-mode,body.chat-mode .app,body.chat-mode main{background:#F2F4F3}
body.chat-mode main{padding-bottom:96px}
@media (max-width:760px){body.chat-mode #bnav{display:none!important}}
.wa-chat{display:flex;flex-direction:column;gap:4px}
.wa-day{text-align:center;margin:12px 0 6px}
.wa-day span{display:inline-block;background:#fff;color:var(--muted);font-size:12.5px;font-weight:600;padding:5px 12px;border-radius:8px;box-shadow:0 1px .5px rgba(20,30,25,.1)}
.wa-msg{display:flex}
.wa-msg.me{justify-content:flex-end}
.wa-bub{position:relative;max-width:min(86%,520px);background:#fff;border-radius:12px 0 12px 12px;padding:8px 12px 20px;box-shadow:0 1px .5px rgba(20,30,25,.13);min-width:110px;margin-right:8px;display:flex;flex-direction:column;gap:3px}
.wa-msg.me .wa-bub{background:#E3F3E8}
.wa-msg.me .wa-bub::before{content:'';position:absolute;right:-8px;top:0;border-top:10px solid #E3F3E8;border-right:8px solid transparent}
.wa-msg.me+.wa-msg.me .wa-bub{border-radius:12px}
.wa-msg.me+.wa-msg.me .wa-bub::before{display:none}
.wa-t{font-size:15px;font-weight:600;overflow-wrap:anywhere}
.wa-x{font-size:15px;line-height:1.45;white-space:pre-line;overflow-wrap:anywhere}
.wa-tm{position:absolute;right:10px;bottom:4px;font-size:11px;color:var(--muted)}
.wa-foot{position:fixed;left:0;right:0;bottom:0;z-index:30;background:#F2F4F3;padding:10px 12px calc(10px + env(safe-area-inset-bottom));display:flex;gap:8px;align-items:center;max-width:none}
.wa-foot .inp{flex:1;min-width:0;border-radius:24px;background:#fff;min-height:46px}
.wa-send,.wa-wa{flex:none;width:46px;height:46px;border-radius:50%;border:0;display:grid;place-items:center;cursor:pointer;padding:0}
.wa-send{background:var(--accent);color:#fff}
.wa-wa{background:#25D366;color:#fff}
.wa-send svg.i,.wa-wa svg.i{width:20px;height:20px}

/* ---------- Return Items ---------- */
.rt-head{display:flex;align-items:center;gap:12px}
.rt-head .main{min-width:0}
.rt-line{gap:10px}
.rt-line.off .t{color:var(--muted)}
.rt-qty{flex:none}
.rt-qty span{min-width:34px;text-align:center;font-weight:700}
.rt-all{display:block;margin:6px 0 10px auto}
.rt-how{width:100%}
.rt-how button{flex:1}
.rt-acc{display:flex;justify-content:space-between;gap:10px;margin-top:12px;padding:12px;border-radius:12px;background:#F4F6F5;font-size:14px}
/* ---------- History ---------- */
.hs-range{margin-bottom:10px}
.hs-filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin-bottom:10px}
.hs-filters .inp{min-width:0;width:100%}
.hs-list{padding:4px 0;overflow:hidden}
.hs-day{display:flex;justify-content:space-between;padding:12px 16px 6px;font-size:12.5px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.hs-row{all:unset;box-sizing:border-box;width:100%;display:flex;align-items:flex-start;gap:12px;padding:10px 16px;cursor:pointer;border-top:1px solid var(--line)}
.hs-row[hidden]{display:none}
.hs-row.on{background:#F7F8F8}
.hs-row .tile{flex:none;width:38px;height:38px}
.hs-m{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.hs-t{font-size:14.5px;font-weight:600;overflow-wrap:anywhere}
.hs-s{font-size:12.5px;color:var(--muted)}
.hs-s i{font-style:normal;background:#F2F4F3;border-radius:6px;padding:0 6px;margin-left:2px}
.hs-d{margin-top:6px;font-size:13.5px;line-height:1.45;color:var(--ink);white-space:pre-line;overflow-wrap:anywhere}
.hs-a{flex:none;font-size:14.5px;padding-top:2px}
/* offline bar: "No Internet · N Saved On Phone", then "Sending N Saved Entries…" */
.offline{white-space:nowrap;max-width:calc(100vw - 32px);overflow:hidden;text-overflow:ellipsis}

/* ---------- Add Stock: Read Supplier Invoice ---------- */
.rs-readbtn{margin-bottom:14px;cursor:pointer}
.rs-reading{display:flex;align-items:center;gap:12px;margin-bottom:14px}
.rs-reading .spin{width:20px;height:20px;border-width:2px;margin:0;flex:none}
.rs-read{margin-bottom:14px}
.rs-read .s{font-size:13px;margin-top:2px}
.rs-readtot{display:flex;justify-content:space-between;margin-top:10px;padding-top:10px;border-top:1px solid var(--line);font-size:14px}
.cust-dd-btn.rs-unmatched span:first-of-type{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.cust-dd-btn.rs-unmatched .pill{flex:none;margin-left:auto}
.cust-dd-btn.rs-unmatched{box-shadow:0 0 0 1.5px var(--warn)}
/* Settings: Dashboard Cards */
.dc-row{gap:8px}
.dc-chk{display:flex;align-items:center;gap:10px;flex:1;min-width:0;cursor:pointer}
.dc-chk input{width:18px;height:18px;accent-color:var(--accent);flex:none}
.dc-chk .tile{width:34px;height:34px;flex:none}
.dc-chk .t{font-weight:600;font-size:14.5px}
.dc-row.off .t{color:var(--muted)}
.dc-mv{display:flex;gap:6px;flex:none}
.dc-mv .icon-btn{width:34px;height:34px;box-shadow:none;background:#F2F4F3}
.dc-mv .icon-btn:disabled{opacity:.35}
svg.i.rot-up{transform:rotate(-90deg)}
svg.i.rot-dn{transform:rotate(90deg)}

/* billing payment modes: five buttons share the width on phones (Mixed was spilling out) */
.pos-modes{width:100%;max-width:100%;box-sizing:border-box}
.pos-modes button{flex:1 1 0;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:760px){.pos-modes{gap:2px;padding:3px}.pos-modes button{padding-left:2px;padding-right:2px;font-size:13px}}

/* phones: no bottom menu bar while the keyboard is open (typing in a box) */
@media (max-width:760px){body.kb-open #bnav,body.kb-open .tabbar,body.kb-open .fab{display:none!important}}

/* billing top on phones: Bill No. and Date side by side, Billed By as one short line below */
@media (max-width:760px){
  .pos-head{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 10px;align-items:end}
  .pos-hf input,.pos-hf .dp-btn{min-height:42px;font-size:14.5px}
  .pos-biller{grid-column:1/-1;flex-direction:row;align-items:center;gap:6px;padding:8px 12px;background:#F4F6F5;border-radius:10px}
  .pos-biller>span{font-size:13px}
  .pos-biller .pos-by{min-height:0;font-size:14px;font-weight:700}
}

/* Stock: one summary card, then All / Low Stock / Out Of Stock (also the list filter) */
.ss-card{margin-bottom:14px}
.ss-top{display:flex;align-items:center;gap:14px}
.ss-top .tile{width:46px;height:46px;flex:none}
.ss-l{font-size:13px;color:var(--muted);font-weight:600}
.ss-v{font-size:26px;font-weight:700;line-height:1.2}
.ss-s{font-size:13px;color:var(--muted);margin-top:2px}
.ss-fs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.ss-f{border:0;background:#F4F6F5;border-radius:12px;padding:10px 6px;display:flex;flex-direction:column;align-items:center;gap:2px;cursor:pointer;font:inherit;color:var(--ink);min-width:0}
.ss-f b{font-size:18px}
.ss-f span{font-size:12px;color:var(--muted);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.ss-f.warn b{color:var(--warn)}
.ss-f.bad b{color:var(--bad)}
.ss-f.on{background:#fff;box-shadow:0 0 0 1.5px var(--accent)}

/* billing item: company + pack, then HSN / GST / stock as small tags */
.bt-co{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px;font-size:13px;margin-top:2px}
.bt-co .bt-cn{color:var(--accent);font-weight:600}
.bt-co b{font-weight:700;color:var(--ink)}
.bt-tags{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}
.bt-tags span{font-size:11.5px;font-weight:600;color:var(--muted);background:#F2F4F3;border-radius:6px;padding:2px 7px;white-space:nowrap}
.bt-tags span.warn{color:var(--warn);background:var(--warn-soft)}
.bt-tags span.bad{color:var(--bad);background:var(--bad-soft)}

/* Import From Tally: what was found, as plain list rows */
button.tl-row{width:100%;border:0;background:none;text-align:left;font:inherit;color:inherit;cursor:pointer;border-radius:0}
button.tl-row:not(:last-child){border-bottom:1px solid var(--line)}
.tl-row .main{min-width:0}
.tl-row .t{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.tl-row>b{flex:none;font-size:15px}

.ss-f small{font-size:11.5px;color:var(--muted);font-weight:600;margin-top:1px}

/* Stock list: profit per unit and % (before GST) */
.pf-tag{display:inline-block;margin-top:4px;font-size:11.5px;font-weight:600;color:var(--accent);background:var(--accent-soft);border-radius:6px;padding:2px 7px;white-space:nowrap}
.pf-tag.bad{color:var(--bad);background:var(--bad-soft)}

/* Stock list row: name + stock, company / pack, then Price / MRP / Profit, then tags */
.st-main{min-width:0;flex:1}
.st-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.st-top .t{min-width:0;overflow-wrap:anywhere}
.st-qty{flex:none;display:flex;align-items:baseline;gap:4px;white-space:nowrap}
.st-qty b{font-size:17px}
.st-qty span{font-size:12px;color:var(--muted);font-weight:600}
.st-qty.warn b{color:var(--warn)}
.st-qty.bad b{color:var(--bad)}
.st-sub{margin-top:2px}
.st-sub .pos-co{font-weight:600}
.st-kv{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:8px}
.st-kv>div{background:#F4F6F5;border-radius:10px;padding:6px 8px;min-width:0;display:flex;flex-direction:column;gap:1px}
.st-kv span{font-size:11px;color:var(--muted);font-weight:600}
.st-kv b{font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.st-kv .st-pf{background:var(--accent-soft)}
.st-kv .st-pf b{color:var(--accent)}
.st-kv .st-pf.bad{background:var(--bad-soft)}
.st-kv .st-pf.bad b{color:var(--bad)}

/* product popup: Stock / Price boxes */
.pv-sub{font-size:13px;color:var(--muted);margin:-4px 0 6px}
.pv-h{font-size:14px;font-weight:700;margin:14px 0 8px;color:var(--ink)}
.pv-g{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.pv-g.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.pv-c{background:#F4F6F5;border-radius:12px;padding:9px 11px;min-width:0;display:flex;flex-direction:column;gap:1px}
.pv-c span{font-size:11.5px;color:var(--muted);font-weight:600}
.pv-c b{font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pv-c small{font-size:11px;color:var(--muted)}
.pv-c.warn b{color:var(--warn)}
.pv-c.bad b{color:var(--bad)}
.pv-c.profit{background:var(--accent-soft)}
.pv-c.profit b{color:var(--accent)}
.pv-c.loss{background:var(--bad-soft)}
.pv-c.loss b{color:var(--bad)}

/* product popup: batches */
.pv-bs{display:flex;flex-direction:column;gap:8px}
.pv-b{background:#F4F6F5;border-radius:12px;padding:10px 12px}
.pv-bt{display:flex;justify-content:space-between;align-items:baseline;gap:10px}
.pv-bt>b{font-size:15px;min-width:0;overflow-wrap:anywhere}
.pv-bt>span{flex:none;font-size:12.5px;color:var(--muted);font-weight:600;white-space:nowrap}
.pv-bt>span b{font-size:16px;color:var(--ink)}
.pv-bm{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:6px}
.pv-bc{font-size:12.5px;color:var(--muted)}
.pv-bc b{color:var(--ink)}
.pv-adj{margin-left:auto;font-size:13px}

.st-kv.four{grid-template-columns:repeat(4,minmax(0,1fr))}
.st-kv>div.warn b{color:var(--warn)}
.st-kv>div.bad b{color:var(--bad)}
.st-kv span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:420px){.st-kv{gap:5px}.st-kv>div{padding:6px 6px}.st-kv span{font-size:10.5px}.st-kv b{font-size:13px}}

/* Stock list row v2: photo + name on top, one full-width strip of figures */
.st-row{display:block;padding:14px 0;cursor:pointer;border-bottom:1px solid var(--line)}
.st-row:last-child{border-bottom:0}
.st-row[hidden]{display:none}
.st-hd{display:flex;align-items:center;gap:12px;min-width:0}
.st-hd .tile,.st-hd .pimg,.st-hd img{flex:none}
.st-nm{flex:1;min-width:0}
.st-nm .t{font-weight:700;font-size:15.5px;overflow-wrap:anywhere}
.st-nm .s{font-size:13px;margin-top:1px}
.st-nm .pos-co{font-weight:600}
.st-tags{flex:none;display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.st-tags:empty{display:none}
.st-row .st-kv{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;margin-top:10px;background:#F4F6F5;border-radius:12px;overflow:hidden}
.st-row .st-kv.four{grid-template-columns:repeat(4,minmax(0,1fr))}
.st-row .st-kv>div{background:none;border-radius:0;padding:8px 4px;text-align:center;align-items:center}
.st-row .st-kv>div+div{border-left:1px solid #E3E8E5}
.st-row .st-kv span{font-size:11px}
.st-row .st-kv b{font-size:15px}
.st-row .st-kv .st-pf{background:none}
.st-row .st-kv .st-pf b{color:var(--accent)}
.st-row .st-kv .st-pf.bad b{color:var(--bad)}

/* Bills tabs: three fit on one line on phones */
.bl-tabs button{white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis}
@media (max-width:420px){.bl-tabs button{padding-left:6px;padding-right:6px;font-size:13px}}

/* Add Stock: Read Supplier Invoice (Take Photo / Choose File) */
.rs-readcard{margin-bottom:14px}
.rs-readbtns{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}
.rs-readbtns .btn{cursor:pointer;justify-content:center}

/* typed dates (ui/datepicker.js): a date box without .inp looks like one; a wrong date gets a red edge */
.dt-in{font-variant-numeric:tabular-nums;letter-spacing:.3px}
.dt-in:not(.inp){border:1px solid var(--line);background:#FAFCFB;border-radius:12px;padding:10px 12px;font:inherit;font-size:14px;font-weight:500;width:100%;min-width:0;color:var(--ink)}
.dt-in.dt-bad{border-color:var(--bad)!important;box-shadow:0 0 0 2px rgba(220,38,38,.12)}

/* distributor / agent dates (ui/datepicker.js): Day · Month · Year dropdowns in one row */
.dt-dd{display:flex;gap:6px;width:100%;min-width:0}
.dt-sel{flex:1 1 0;min-width:0;border:1px solid var(--line);background:#FAFCFB;border-radius:12px;padding:10px 8px;font:inherit;font-size:14px;font-weight:500;color:var(--ink);font-variant-numeric:tabular-nums}
.dt-sel.dt-y{flex:1.3 1 0}
.dt-dd-sm{flex:0 0 auto;width:auto}
.dt-dd-sm .dt-sel{flex:0 0 auto;height:38px;padding:0 6px;border-radius:10px;background:#fff;font-weight:600}
.bl-find .dt-dd-sm .dt-sel{height:46px}
.pr-d .dt-dd-sm{flex:1 1 auto;width:100%}.pr-d .dt-dd-sm .dt-sel{flex:1 1 0}
@media (max-width:640px){.dt-sel{font-size:16px;min-height:46px}.dt-dd-sm .dt-sel{min-height:0}}

/* typed day box in toolbars (Bills, Reports): a narrow box beside the search, not the whole row */
.dt-in.rc-cal{flex:0 0 128px;width:128px;max-width:128px;height:38px;padding:0 10px;margin:0;border:1px solid var(--line);border-radius:10px;background:#fff;font:inherit;font-size:14px;font-weight:600;color:var(--ink)}
.bl-find .dt-in.rc-cal{height:46px}
.pr-d .dt-in.rc-cal{flex:1 1 auto;width:100%;max-width:none}

/* supplier bill screen (#supbill): items as small cards, key facts in two columns on phones */
.sb-kv{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
@media (min-width:700px){.sb-kv{grid-template-columns:repeat(4,minmax(0,1fr))}}
.sb-items{display:flex;flex-direction:column;gap:10px}
.sb-item{border:1px solid var(--line);border-radius:12px;padding:12px;background:#fff}
.sb-item[data-act]{cursor:pointer}
.sb-top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.sb-top b{font-size:15px;line-height:1.3;min-width:0}
.sb-top .pill{flex:none}
.sb-meta{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:6px;font-size:12.5px;color:var(--muted)}
.sb-meta b{color:var(--ink);font-weight:600}
.sb-amt{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-top:10px;padding-top:10px;border-top:1px dashed var(--line);font-size:13.5px}
.sb-amt b{font-size:15px}

/* Imported Files → View: an Excel sheet as a table (scrolls sideways on a phone) */
.xl-view{max-height:62vh;overflow:auto;border:1px solid var(--line);border-radius:10px;background:#fff}
.xl-view table{border-collapse:collapse;font-size:12px;min-width:100%}
.xl-view td{border-bottom:1px solid var(--line);border-right:1px solid var(--line);padding:5px 8px;white-space:nowrap;color:var(--ink)}
.xl-view tr:first-child td{font-weight:600}
