/* Visual style follows FitCRM: Manrope, light/dark tokens, lime accent, cards. */
/* Manrope (SIL OFL) is served from our own server: works offline and nothing goes to Google. */
@font-face{font-family:Manrope;font-style:normal;font-weight:400 800;font-display:swap;src:url(/fonts/manrope-cyrillic.woff2) format("woff2");
  unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:Manrope;font-style:normal;font-weight:400 800;font-display:swap;src:url(/fonts/manrope-latin.woff2) format("woff2");
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
:root{
  --bg:#F3F4F1;--surface:#FFFFFF;--surface2:#E9EBE6;--line:#D9DCD4;--fg:#15171A;--muted:#5D636B;
  --accent:#4E7A00;--accent-bg:#C6F432;--on-accent:#15171A;--warn:#B45309;--bad:#B42318;--good:#2F6B00;--info:#1D4ED8;
  --font:Manrope,system-ui,-apple-system,"Segoe UI",sans-serif;--ctl:48px;
  --chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23575D65' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#111316;--surface:#1C1F24;--surface2:#262A31;--line:#30353D;--fg:#F2F3F5;--muted:#A3A8B0;
  --accent:#C6F432;--accent-bg:#C6F432;--on-accent:#111316;--warn:#FFB066;--bad:#FF8A80;--good:#C6F432;--info:#93C5FD;color-scheme:dark;--chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23A3A8B0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}}
:root[data-theme="dark"]{
  --bg:#111316;--surface:#1C1F24;--surface2:#262A31;--line:#30353D;--fg:#F2F3F5;--muted:#A3A8B0;
  --accent:#C6F432;--accent-bg:#C6F432;--on-accent:#111316;--warn:#FFB066;--bad:#FF8A80;--good:#C6F432;--info:#93C5FD;color-scheme:dark;--chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23A3A8B0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}

*{box-sizing:border-box}
[hidden]{display:none!important}
html{min-height:100%}
body{margin:0;min-height:100dvh;background:var(--bg);color:var(--fg);font-family:var(--font);font-size:15px;-webkit-text-size-adjust:100%}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
h1{font-size:24px;margin:0}
h2{font-size:16px;margin:0}
.muted{color:var(--muted);font-size:13px}
.num{font-variant-numeric:tabular-nums}

/* top bar */
.top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px max(16px,env(safe-area-inset-right)) 12px max(16px,env(safe-area-inset-left));
  padding-top:max(12px,env(safe-area-inset-top));border-bottom:1px solid var(--line);background:var(--surface)}
.brand{font-weight:800;font-size:18px;display:flex;align-items:center;gap:10px;min-width:0;white-space:nowrap}
.brand .drop{width:30px;height:30px;border-radius:9px;background:var(--accent-bg);color:var(--on-accent);display:grid;place-items:center;font-size:16px;flex:0 0 auto}
.who{display:flex;align-items:center;gap:8px;min-width:0}
.who span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* layout */
.shell{display:flex;max-width:1200px;margin:0 auto;gap:20px;padding:20px max(16px,env(safe-area-inset-right)) 20px max(16px,env(safe-area-inset-left))}
.side{flex:0 0 200px;display:flex;flex-direction:column;gap:4px}
.side button{display:flex;align-items:center;gap:10px;text-align:left;border:0;background:transparent;padding:11px 14px;border-radius:10px;font-weight:700;color:var(--muted)}
.side button.on{background:var(--accent-bg);color:var(--on-accent);font-weight:800}
@media (hover:hover){.side button:not(.on):hover{background:var(--surface2);color:var(--fg)}}
.side .ico{width:20px;text-align:center}
.main{flex:1;min-width:0;display:flex;flex-direction:column;gap:16px}

/* phone: bottom tab bar with icons, label only on the active tab */
@media (max-width:760px){
  .side{position:fixed;left:0;right:0;bottom:0;z-index:5;flex-direction:row;justify-content:space-around;gap:0;background:var(--surface);border-top:1px solid var(--line);
    padding:6px max(8px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))}
  .side button{flex-direction:column;gap:2px;padding:6px 10px;font-size:12px;min-height:48px;justify-content:center;flex:1;align-items:center}
  .side button .lbl{display:none}
  .side button.on .lbl{display:block}
  .side .ico{font-size:18px}
  .shell{padding-bottom:calc(84px + env(safe-area-inset-bottom))}
  .who>span{display:none}
}

.card{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:18px;display:flex;flex-direction:column;gap:12px;min-width:0}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.between{justify-content:space-between}
.list{display:flex;flex-direction:column;gap:8px}
.item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--bg);text-align:left;width:100%;color:var(--fg)}
.item .t{display:flex;flex-direction:column;gap:2px;min-width:0}
.item b{overflow-wrap:anywhere}
button.item{cursor:pointer}
@media (hover:hover){button.item:hover{border-color:var(--accent)}}

.pill{display:inline-block;padding:3px 9px;border-radius:999px;font-size:12px;font-weight:700;background:var(--surface2);color:var(--muted);white-space:nowrap}
.pill.good{color:var(--good)}
.pill.bad{color:var(--bad)}
.pill.demo{background:var(--warn);color:#fff;border:0;font:inherit;font-size:12px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;cursor:pointer;margin-left:4px}
.offline{position:sticky;top:0;z-index:50;background:var(--warn);color:#fff;font-weight:700;font-size:14px;text-align:center;
  padding:calc(8px + env(safe-area-inset-top)) 16px 8px}
.demo-note{border:2px solid var(--warn)}
.demo-note p{margin:0}
.card>p{margin:0}

/* controls */
.btn{height:var(--ctl);min-height:var(--ctl);padding:0 18px;border-radius:12px;border:1px solid var(--line);background:var(--surface);font-weight:700;font-size:16px;line-height:1;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap}
.btn.primary{background:var(--accent-bg);color:var(--on-accent);border-color:transparent}
.btn.ghost{background:transparent}
.btn.sm{height:40px;min-height:40px;padding:0 14px;font-size:14px}
.btn:disabled{opacity:.5;cursor:default}
label.f{display:flex;flex-direction:column;gap:6px;font-weight:600;font-size:14px}
label.f small{font-weight:400;color:var(--muted)}
/* one look for every field: same height, radius, padding, font; native look of select / checkbox switched off */
input,select{-webkit-appearance:none;appearance:none;height:var(--ctl);min-height:var(--ctl);border:1px solid var(--line);border-radius:12px;background-color:var(--surface);padding:0 14px;font-size:16px;font-weight:400;line-height:normal;width:100%;margin:0}
select{padding-right:42px;background-image:var(--chev);background-repeat:no-repeat;background-position:right 16px center;cursor:pointer}
input:focus,select:focus{outline:none;border-color:var(--accent)}
.check{display:flex;align-items:center;gap:12px;font-weight:600;min-height:var(--ctl);cursor:pointer}
.check input{width:26px;height:26px;min-height:0;flex:0 0 auto;padding:0;border:2px solid var(--line);border-radius:8px;background:transparent;display:grid;place-items:center;cursor:pointer}
.check input:checked{background:var(--accent-bg);border-color:transparent}
.check input:checked::after{content:'';width:6px;height:12px;border:solid var(--on-accent);border-width:0 3px 3px 0;transform:translateY(-1px) rotate(45deg)}
.err{color:var(--bad);font-weight:600;min-height:1.2em}
.form{display:flex;flex-direction:column;gap:14px}

.seg{display:flex;background:var(--surface2);border-radius:12px;padding:3px}
.seg button{flex:1;border:0;background:transparent;padding:8px 14px;border-radius:9px;font-weight:700;color:var(--muted);min-height:40px}
.seg button.on{background:var(--accent-bg);color:var(--on-accent)}

/* login */
.login{max-width:400px;margin:0 auto;padding:max(48px,env(safe-area-inset-top)) 16px 32px;display:flex;flex-direction:column;gap:20px}
.login .brand{justify-content:center;font-size:22px}

/* bottom sheet; JS keeps it above the on-screen keyboard */
.sheet-bg{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:20;display:flex;align-items:flex-end;justify-content:center}
.sheet{background:var(--surface);width:100%;max-width:520px;max-height:90dvh;overflow:auto;border-radius:20px 20px 0 0;padding:20px 16px max(20px,env(safe-area-inset-bottom))}
@media (min-width:761px){.sheet-bg{align-items:center}.sheet{border-radius:20px}}

/* audit */
.chg{font-size:13px;color:var(--muted);overflow-wrap:anywhere}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(96px + env(safe-area-inset-bottom));background:var(--fg);color:var(--bg);padding:10px 16px;border-radius:12px;font-weight:700;z-index:30}
.form .row .btn{flex:1 1 0}

/* text states */
.good{color:var(--good)}
.warn{color:var(--warn)}
.bad{color:var(--bad)}
.note{margin:0;padding:10px 14px;border-radius:12px;background:var(--surface2);overflow-wrap:anywhere}
.card.tight{padding:14px;gap:6px}
a.btn{text-decoration:none;color:inherit}
input[type=search]::-webkit-search-decoration{-webkit-appearance:none}
label.filebtn{align-self:flex-start;cursor:pointer}
details>summary{cursor:pointer;padding:8px 0;list-style:none}
details>summary::-webkit-details-marker{display:none}
details>summary::before{content:'▸ '}
details[open]>summary::before{content:'▾ '}
details .list{margin-top:8px}
/* address row: text on top, actions below on narrow screens */
.item.col{flex-wrap:wrap}
.item.col>.t{flex:1 1 220px}
.item .num,.item .pill{white-space:nowrap}
.item>.row{flex-wrap:nowrap;flex:0 0 auto}
.item.col>.row{flex-wrap:wrap;flex:1 1 auto}

/* stage 2: orders, delivery, stock */
.pill.info{color:var(--info)}
.pill.warn{color:var(--warn)}
.grow{flex:1 1 0;min-width:0;width:auto}
.row.nowrap{flex-wrap:nowrap}
.datebar{flex-wrap:wrap}
.datebar input{flex:1 1 100%}
.datebar .btn{flex:1 1 80px}
.item.col>.row>.num:last-child{margin-left:auto}
.chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{flex:0 0 auto;border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:0 14px;height:40px;font-weight:700;font-size:14px;color:var(--fg);white-space:nowrap}
.chip.on{background:var(--accent-bg);color:var(--on-accent);border-color:transparent}
.chip .num{opacity:.7}
.kv{display:grid;grid-template-columns:minmax(90px,auto) 1fr;gap:8px 14px;align-items:baseline}
.kv>span:nth-child(odd){color:var(--muted);font-size:14px}
.kv>span{overflow-wrap:anywhere;min-width:0}
.link{border:0;background:none;padding:0;color:var(--accent);font:inherit;font-weight:700;text-align:left;cursor:pointer;text-decoration:underline}
.actions{display:flex;flex-wrap:wrap;gap:8px}
.actions .btn{flex:1 1 auto;min-width:120px}
.stepper{display:flex;align-items:center;gap:6px;flex:0 0 auto}
.stepper button{width:var(--ctl);height:var(--ctl);border-radius:12px;border:1px solid var(--line);background:var(--surface);font-size:22px;font-weight:700;line-height:1;color:var(--fg)}
.stepper input{width:56px;text-align:center;padding:0 4px;font-variant-numeric:tabular-nums}
.sum{display:flex;flex-direction:column;gap:6px;padding:12px 14px;border-radius:12px;background:var(--surface2)}
.f .lbl{font-weight:600;font-size:14px}
div.f{display:flex;flex-direction:column;gap:6px}
.tiles{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.tiles>div{display:flex;flex-direction:column;gap:4px;padding:10px;border-radius:12px;background:var(--surface2);min-width:0}
.tiles b{font-size:22px}
.num{font-variant-numeric:tabular-nums}
@media (max-width:420px){.tiles{grid-template-columns:repeat(2,1fr)}}
.side .tab-more{display:none}
@media (max-width:760px){
  .side button.extra{display:none}
  .side .tab-more{display:flex}
}

/* stage 3: cash desk */
.stack{display:flex;flex-direction:column;gap:16px}
.strike{text-decoration:line-through}
.main>.chips,.main>.datebar{margin-bottom:12px}
.tiles.money b{font-size:17px;white-space:nowrap}
.row.split>.btn{flex:1 1 0}

/* compact: narrower content column on a computer, tighter cards and rows everywhere */
.main{max-width:760px;gap:12px}
.card{padding:14px 16px;gap:10px;border-radius:14px}
.list{gap:6px}
.item{padding:10px 12px;gap:10px;border-radius:10px}
.btn.sm{height:36px;min-height:36px;padding:0 12px}
.chip{height:36px}
.tiles{gap:8px}
.tiles>div{padding:8px 10px}
/* wide enough: text left, status and actions right on one line */
@media (min-width:561px){
  .item.col{flex-wrap:nowrap}
  .item.col>.t{flex:1 1 auto}
  .item.col>.row{flex:0 0 auto;flex-wrap:nowrap;justify-content:flex-end}
}

/* stage 4: courier page — large address, big buttons */
.big{font-size:22px}
.cashbar{gap:4px}
.corder{gap:8px}
.corder.on{border-color:var(--warn)}
.corder .addr{font-size:21px;font-weight:800;line-height:1.2;overflow-wrap:anywhere}
.corder .addr2{font-size:16px;font-weight:600}
.corder .btn{height:52px;min-height:52px}
.chips.wrap{flex-wrap:wrap;overflow:visible}
.shell.courier{max-width:600px}

.tgbox{display:flex;flex-direction:column;gap:10px}

/* stage 6: reports */
.bar{display:grid;grid-template-columns:minmax(90px,auto) 1fr auto;gap:10px;align-items:center;font-size:14px}
.bar .track{height:10px;border-radius:6px;background:var(--surface2);overflow:hidden}
.bar .track>span{display:block;height:100%;background:var(--accent-bg);border-radius:6px;width:0}
.tiles.money:has(>div:nth-child(3):last-child){grid-template-columns:repeat(3,1fr)}
@media (max-width:420px){.tiles.money:has(>div:nth-child(3):last-child){grid-template-columns:repeat(2,1fr)}}

/* one height for small controls: segmented switch = chips = small buttons (36 px) */
.seg button{min-height:36px;height:36px;padding:0 14px;border-radius:10px;font-size:14px}
/* phone tab bar: fixed height, one-line label */
@media (max-width:760px){
  .side button{height:56px;min-height:56px}
  .side button .lbl{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:104px}
  .side button.on{flex:1.6}
}

.theme-btn{width:40px;padding:0;font-size:18px}
@media (max-width:760px){.theme-btn{width:36px}}
