/* Fontes do sistema: carregam sem internet e são rápidas em qualquer aparelho. */
:root{color-scheme:light dark;--bg:light-dark(#ffffff,#130a0e);--ink:light-dark(#1a0f13,#f6edf0);--muted:light-dark(#6d5a62,#bba5af);--wine:light-dark(#7a1233,#b8325e);--wine2:light-dark(#5c0c26,#8d1f45);--soft:light-dark(#f8eff2,#221219);--card:light-dark(#ffffff,#1b0e14);--line:light-dark(#eadde2,#3a2430);--ice:light-dark(#0a7fa1,#4cc3e3);--icebg:light-dark(#e6f6fb,#0d2a33);--warn:light-dark(#b93c06,#fb923c);--warnbg:light-dark(#fff1e8,#3a1d0c);--ok:light-dark(#0f7a4b,#34d399)}
*{box-sizing:border-box;min-width:0}
html,body,#root{height:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;overflow-x:clip;-webkit-tap-highlight-color:transparent}
h1,h2,h3{letter-spacing:-.02em;line-height:1.1;margin:0}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:none}
button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--ice);outline-offset:2px}
.boot{max-width:520px;margin:15vh auto;padding:0 16px;text-align:center}
.app{display:flex;flex-direction:column;height:100%}
header{background:var(--wine);color:#fff;display:flex;align-items:center;gap:8px 10px;padding:10px max(16px,2vw);padding-top:max(10px,env(safe-area-inset-top));flex-wrap:wrap}
header h1{font-size:20px;font-weight:800;margin-right:auto}
.pill{display:flex;align-items:center;gap:7px;background:rgba(255,255,255,.15);border-radius:99px;padding:5px 12px;font-size:13px;white-space:nowrap;color:#fff}
.pill.off{background:#ffd3c2;color:#3a0d00;font-weight:700}
.dot{width:9px;height:9px;border-radius:50%;background:#7cf0b4}
.dot.off{background:#ffb199}
.pill.off .dot{background:#b93c06}
.update{display:flex;align-items:center;gap:10px;justify-content:center;flex-wrap:wrap;background:var(--icebg);padding:8px 16px;font-weight:600}
.body{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;overflow:hidden}
main{overflow:auto;padding:18px max(16px,2vw) 130px}
nav{order:2;display:flex;background:var(--card);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}
nav button{flex:1;padding:8px 2px 10px;font-size:12px;font-weight:600;color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:3px;min-height:56px}
nav button svg{width:22px;height:22px}
nav button.on{color:var(--wine)}
@media(min-width:900px){.body{grid-template-columns:200px minmax(0,1fr);grid-template-rows:minmax(0,1fr)}nav{order:0;flex-direction:column;border-top:0;border-right:1px solid var(--line);padding:12px 8px;gap:4px}nav button{flex:none;flex-direction:row;justify-content:flex-start;gap:12px;font-size:15px;padding:12px 14px;border-radius:10px}nav button.on{background:var(--soft)}main{padding-bottom:24px}}
.h2row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:14px}
.h2row h2{font-size:28px}
.sp{flex:1}
.btn{background:var(--wine);color:#fff;border-radius:10px;padding:10px 16px;font-weight:600;min-height:44px;display:inline-flex;align-items:center;justify-content:center;gap:8px}
.btn:hover{background:var(--wine2)}
.btn.ice{background:var(--ice);color:#fff}
.btn.ghost{background:var(--soft);color:var(--ink)}
.btn.line{background:none;border:1px solid var(--line);color:var(--ink)}
.btn.warn{background:var(--warn);color:#fff}
.btn.sm{min-height:38px;padding:6px 10px;font-size:14px}
.btn.lg{min-height:56px;font-size:18px}
.btn:disabled{opacity:.45;cursor:not-allowed}
.full{width:100%}
input,select{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:10px 12px;font-size:16px;min-height:44px;width:100%}
input:disabled{opacity:.6}
label{font-size:14px;font-weight:600;display:grid;gap:4px}
label.check{display:flex;align-items:center;gap:10px;font-weight:500}
label.check input{width:22px;min-height:22px}
.search{max-width:320px}
.mb{margin-bottom:12px}.mt{margin-top:18px}.pad{padding:24px 12px}.center{text-align:center}.right{text-align:right}
.muted{color:var(--muted)}.small{font-size:13px}
.err{color:var(--warn);font-weight:600;margin:0}
.warn-text{color:var(--warn);font-weight:600}
.ok{color:var(--ok)}.ice{color:var(--ice)}
.form{display:grid;gap:12px}
.narrow{max-width:460px;margin:4vh auto;display:grid;gap:12px}
.narrow h2{font-size:34px}
.empty-state{max-width:460px;margin:8vh auto;text-align:center;display:grid;gap:12px;justify-items:center}
.split{display:grid;gap:18px}
@media(min-width:1100px){.split{grid-template-columns:minmax(0,1fr) 360px;align-items:start}.cartcol{position:sticky;top:0}}
@media(max-width:1099px){.cartcol{display:none}}
.chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px;margin-bottom:12px}
.chip{flex:none;border:1px solid var(--line);border-radius:99px;padding:8px 14px;font-size:14px;font-weight:600;min-height:40px;white-space:nowrap}
.chip.on{background:var(--wine);border-color:var(--wine);color:#fff}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.prod{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:12px;text-align:left;display:grid;gap:6px;min-height:118px;align-content:space-between;transition:transform .1s}
.prod:hover{border-color:var(--wine)}
.prod:active{transform:scale(.97)}
.prod b{font-size:15px;line-height:1.25;font-weight:600}
.prod .pr{font-size:20px;font-weight:800;color:var(--wine);white-space:nowrap}
.prod .st{font-size:13px;color:var(--muted)}
.prod .st.low{color:var(--warn);font-weight:600}
.prod.out{opacity:.45}
.cupom{background:var(--card);border:1px solid var(--line);border-radius:16px;overflow:hidden}
.cupom .top{background:var(--soft);padding:14px 16px;display:flex;align-items:center;gap:8px}
.cupom .top h3{font-size:20px;flex:1}
.lines{max-height:46vh;overflow:auto}
.ln{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 10px;padding:10px 16px;border-bottom:1px dashed var(--line)}
.ln .nm{font-weight:600;font-size:15px}
.ln .tt{font-weight:600;white-space:nowrap;text-align:right}
.qty{display:flex;align-items:center;gap:6px}
.qty button{width:40px;height:40px;border-radius:9px;background:var(--soft);font-weight:700;font-size:18px}
.qty span{min-width:24px;text-align:center;font-weight:600}
.tot{padding:14px 16px;display:grid;gap:10px}
.big{display:flex;justify-content:space-between;align-items:baseline;gap:10px}
.big strong{font-size:34px;font-weight:800;color:var(--ice);white-space:nowrap}
.huge{font-size:24px;white-space:nowrap}
.banner{background:var(--icebg);border:1px solid var(--ice);border-radius:12px;padding:10px 14px;display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:12px;font-weight:600}
.banner span{flex:1}
.banner.warn{background:var(--warnbg);border-color:var(--warn)}
.cartbar{position:fixed;left:12px;right:12px;bottom:calc(68px + env(safe-area-inset-bottom));background:var(--ice);color:#fff;border-radius:14px;padding:12px 16px;display:flex;justify-content:space-between;align-items:center;font-weight:700;box-shadow:0 6px 18px rgba(0,0,0,.25);min-height:52px;z-index:5}
@media(min-width:900px){.cartbar{left:216px;bottom:16px}}
@media(min-width:1100px){.cartbar{display:none}}
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(10em,1fr));gap:10px;margin:14px 0 18px}
.kpi{background:var(--soft);border-radius:14px;padding:14px}
.kpi span{font-size:13px;color:var(--muted);font-weight:600}
.kpi b{display:block;font-size:clamp(22px,3vw,30px);white-space:nowrap}
.cols{display:grid;gap:18px}
@media(min-width:800px){.cols{grid-template-columns:repeat(2,minmax(0,1fr))}}
.panel{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:16px}
.panel h3{font-size:18px;margin-bottom:12px}
.bar{display:grid;grid-template-columns:6em minmax(0,1fr) auto;gap:10px;align-items:center;margin:8px 0;font-size:14px}
.bar i{display:block;height:14px;border-radius:4px;background:var(--ice);min-width:2px}
.bar em{font-style:normal;font-weight:600;white-space:nowrap}
.scroll{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:15px}
th{text-align:left;font-size:13px;color:var(--muted);font-weight:600;padding:8px;border-bottom:1px solid var(--line)}
td{padding:10px 8px;border-bottom:1px solid var(--line);vertical-align:middle}
td.n,th.n{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.badge{display:inline-block;font-size:12px;font-weight:700;border-radius:6px;padding:2px 7px;background:var(--warnbg);color:var(--warn);white-space:nowrap}
.badge.ok{background:var(--icebg);color:var(--ice)}
tr.canc td{opacity:.5}
tr.canc td:nth-child(5){text-decoration:line-through}
.row2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.mv{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 0;border-bottom:1px dashed var(--line);font-size:15px}
.mv b{white-space:nowrap}
.overlay{position:fixed;inset:0;background:rgba(15,5,9,.55);display:flex;align-items:flex-end;justify-content:center;z-index:20}
.sheet{background:var(--bg);width:100%;max-width:520px;max-height:92%;overflow:auto;border-radius:18px 18px 0 0;padding:20px 18px calc(24px + env(safe-area-inset-bottom));display:grid;gap:12px}
@media(min-width:600px){.overlay{align-items:center;padding:16px}.sheet{border-radius:18px}}
.sheet h2{font-size:24px}
.hd{display:flex;align-items:center;gap:10px}
.hd h2{flex:1}
.x{width:44px;height:44px;border-radius:10px;background:var(--soft);font-size:22px;flex:none}
.x.sm{width:32px;height:32px;font-size:16px}
.pays{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.pays button{min-height:56px;border-radius:12px;border:2px solid var(--line);font-weight:700;font-size:16px}
.pays button:hover{border-color:var(--ice);color:var(--ice)}
.receipt{background:#fffdf8;color:#1b1b1b;font:14px/1.45 "Courier New",monospace;padding:18px 16px;border-radius:4px;border:1px solid #e9e4d8}
.receipt .c{text-align:center}
.receipt .r{display:flex;justify-content:space-between;gap:8px}
.receipt hr{border:0;border-top:1px dashed #999;margin:8px 0}
.toast{position:fixed;left:50%;top:72px;transform:translateX(-50%);background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:10px;font-weight:600;font-size:15px;opacity:0;pointer-events:none;transition:opacity .2s;z-index:30;max-width:90vw;text-align:center}
.toast.show{opacity:1}
@media(prefers-reduced-motion:reduce){.prod,.toast{transition:none}}
@media(max-width:600px){.h2row h2{font-size:24px}header h1{font-size:18px}table{font-size:14px}.stack thead{display:none}.stack tr{display:grid;padding-block:8px;border-bottom:1px solid var(--line)}.stack td{display:flex;justify-content:space-between;gap:12px;border:0;padding:4px 0;text-align:right}.stack td::before{content:attr(data-l);color:var(--muted);font-size:13px;text-align:left}}
/* Impressão do cupom em impressora térmica (80 mm) pelo navegador */
@media print{body *{visibility:hidden}.receipt,.receipt *{visibility:visible}.receipt{position:absolute;left:0;top:0;width:72mm;border:0;padding:0;font-size:12px}@page{margin:4mm}}
.gate{min-height:100%;display:grid;place-items:start center;padding:6vh 16px 32px}
.login{width:100%;max-width:420px;display:grid;gap:14px}
.login h2{font-size:32px}
.users{display:grid;grid-template-columns:repeat(auto-fit,minmax(8em,1fr));gap:8px}
.users button,.pick{border:2px solid var(--line);border-radius:14px;padding:14px;text-align:left;display:grid;gap:2px;min-height:64px;background:var(--card)}
.users button.on{border-color:var(--wine);background:var(--soft)}
.pick:hover{border-color:var(--wine)}
.pinv{font-size:34px;letter-spacing:.3em;text-align:center;min-height:44px}
.pad{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.pad button{min-height:60px;border-radius:12px;background:var(--soft);font-size:24px;font-weight:700}
.sub{border-top:1px solid var(--line);margin-top:12px;padding-top:12px;display:grid;gap:10px}
.h2row.tight{margin-bottom:6px}
.nowrap{white-space:nowrap}
