@font-face { font-family: 'Anton'; src: url(/fonts/anton.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Poppins'; font-weight: 400; src: url(/fonts/poppins-400.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Poppins'; font-weight: 500; src: url(/fonts/poppins-500.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Poppins'; font-weight: 600; src: url(/fonts/poppins-600.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Poppins'; font-weight: 700; src: url(/fonts/poppins-700.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Poppins'; font-weight: 800; src: url(/fonts/poppins-800.woff2) format('woff2'); font-display: swap; }

:root {
  --red: #E3262F; --red-d: #B81C24; --yel: #FFD21F; --yel-d: #F2B705; --grn: #1E9E4A; --ink: #1E1E24; --muted: #6F6F7A;
  --bg: #F4F1EA; --card: #fff; --line: #E7E2D8; --tag: #FFE45C; --r: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Poppins', system-ui, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.4; padding-bottom: 150px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.price { font-family: 'Anton', Impact, sans-serif; letter-spacing: .3px; }

/* ---------- topo estilo fachada ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--red); color: #fff; box-shadow: 0 3px 0 var(--yel), 0 6px 18px rgba(0,0,0,.18); }
.top .in { max-width: 860px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #fff; }
.logo i { width: 38px; height: 38px; border-radius: 10px; background: var(--yel); color: var(--red); display: grid; place-items: center; font-style: normal; font-size: 21px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.logo b { font-family: 'Anton'; font-weight: 400; font-size: 25px; letter-spacing: .5px; line-height: 1; }
.logo b span { color: var(--yel); }
.top .sp { flex: 1; }
.top .back { border: 0; background: rgba(255,255,255,.16); color: #fff; width: 38px; height: 38px; border-radius: 10px; font-size: 20px; }
.top .ttl { flex: 1; min-width: 0; font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.awning { height: 12px; background: repeating-linear-gradient(90deg, #fff 0 22px, var(--red) 22px 44px); border-bottom: 1px solid rgba(0,0,0,.08); }
.awning::after { content: ''; display: block; height: 12px; background: radial-gradient(circle at 11px 0, #fff 11px, transparent 11.5px) 0 0 / 44px 12px repeat-x, radial-gradient(circle at 33px 0, var(--red) 11px, transparent 11.5px) 0 0 / 44px 12px repeat-x; transform: translateY(12px); }
main { max-width: 860px; margin: 0 auto; padding: 22px 14px 10px; }

h2.h { font-size: 20px; margin: 6px 2px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.muted { color: var(--muted); }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 2px; }

/* ---------- botões ---------- */
.btn { border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 700; font-size: 15px; background: var(--red); color: #fff; box-shadow: 0 3px 0 var(--red-d); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--red-d); }
.btn.y { background: var(--yel); color: var(--ink); box-shadow: 0 3px 0 var(--yel-d); }
.btn.g { background: var(--grn); box-shadow: 0 3px 0 #157636; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 2px 0 var(--line); border: 1.5px solid var(--line); }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .55; }
.in-f { width: 100%; border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 11px 12px; font-size: 16px; }
.in-f:focus { outline: none; border-color: var(--red); }
label.f { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 12px 0 5px; text-transform: uppercase; letter-spacing: .4px; }

/* ---------- cards de lista (encarte) ---------- */
.lists { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .lists { grid-template-columns: 1fr 1fr; } }
.lcard { background: #fff; border-radius: var(--r); padding: 14px; box-shadow: 0 2px 0 var(--line); border: 1.5px solid var(--line); cursor: pointer; position: relative; overflow: hidden; }
.lcard::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--red); }
.lcard.done::before { background: var(--grn); }
.lcard h3 { margin: 0 0 2px 4px; font-size: 16px; }
.lcard .meta { margin-left: 4px; font-size: 12.5px; color: var(--muted); }
.lcard .bar { height: 8px; background: #F1ECE2; border-radius: 99px; margin: 10px 0 8px 4px; overflow: hidden; }
.lcard .bar i { display: block; height: 100%; background: var(--grn); border-radius: 99px; }
.lcard .row { display: flex; justify-content: space-between; align-items: flex-end; margin-left: 4px; }
.lcard .row small { font-size: 11px; color: var(--muted); display: block; font-weight: 600; text-transform: uppercase; }
.lcard .row b.price { font-size: 22px; color: var(--red); font-weight: 400; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty .big { font-size: 46px; }

/* ---------- gôndola ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.addbox { position: relative; flex: 1; min-width: 220px; }
.addbox .in-f { padding-left: 42px; font-weight: 600; border-color: var(--yel); background: #FFFDF0; }
.addbox::before { content: '＋'; position: absolute; left: 14px; top: 9px; font-size: 22px; font-weight: 800; color: var(--red); }
.sugg { position: absolute; left: 0; right: 0; top: 100%; z-index: 12; background: #fff; border: 2px solid var(--yel); border-top: 0; border-radius: 0 0 12px 12px; box-shadow: 0 10px 24px rgba(0,0,0,.14); max-height: 300px; overflow: auto; display: none; }
.sugg.open { display: block; }
.sugg button { display: flex; width: 100%; border: 0; background: none; padding: 10px 12px; text-align: left; gap: 8px; align-items: center; border-bottom: 1px solid #F3EFE6; }
.sugg button:hover, .sugg button:focus { background: #FFF8D6; outline: none; }
.sugg button .n { flex: 1; font-weight: 600; }
.sugg button small { color: var(--muted); font-size: 11.5px; display: block; font-weight: 500; }
.chipbtn { border: 1.5px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 12px; font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.chipbtn.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.aisle { margin: 16px 0 6px; display: flex; align-items: center; gap: 8px; }
.aisle .sign { display: inline-flex; align-items: center; gap: 8px; background: var(--c, #444); color: #fff; padding: 6px 12px 6px 8px; border-radius: 10px 10px 10px 2px; font-weight: 800; font-size: 13.5px; text-transform: uppercase; letter-spacing: .4px; box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.aisle .sign i { font-style: normal; background: rgba(255,255,255,.22); width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: 16px; }
.aisle .cnt { font-size: 12px; color: var(--muted); font-weight: 700; }
.aisle .ln { flex: 1; height: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 10px); }
.shelf { background: #fff; border-radius: var(--r); box-shadow: 0 2px 0 var(--line); border: 1.5px solid var(--line); overflow: hidden; }
.item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #F3EFE6; min-height: 64px; }
.item:last-child { border-bottom: 0; }
.ck { flex: none; width: 34px; height: 34px; border-radius: 10px; border: 2.5px solid #CFC8BA; background: #fff; display: grid; place-items: center; font-size: 19px; color: #fff; font-weight: 800; }
.item.on .ck { background: var(--grn); border-color: var(--grn); }
.item .nm { flex: 1; min-width: 0; cursor: pointer; }
.item .nm b { display: block; font-size: 15px; font-weight: 600; line-height: 1.2; }
.item.on .nm b { text-decoration: line-through; color: #8C8C94; }
.item .nm small { font-size: 12px; color: var(--muted); }
.item .nm small .up { color: var(--red); font-weight: 700; } .item .nm small .dn { color: var(--grn); font-weight: 700; }
/* etiqueta de preço */
.tag { flex: none; min-width: 84px; text-align: right; cursor: pointer; border: 0; padding: 0; background: none; }
.tag .t { display: inline-block; background: var(--tag); border-radius: 6px 6px 6px 6px; padding: 3px 9px 2px; position: relative; box-shadow: 0 2px 0 var(--yel-d); clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%); padding-left: 14px; }
.tag .t .price { font-size: 19px; color: var(--red); line-height: 1.15; }
.tag .t .price sup { font-size: 11px; }
.tag small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 700; margin-top: 2px; text-transform: uppercase; }
.tag.est .t { background: #F1ECE2; box-shadow: 0 2px 0 #DDD5C6; }
.tag.est .t .price { color: #6F6F7A; }
.tag.paid .t { background: var(--grn); box-shadow: 0 2px 0 #157636; }
.tag.paid .t .price { color: #fff; }
.qtyb { flex: none; font-weight: 800; font-size: 13px; background: #F1ECE2; border-radius: 8px; padding: 3px 7px; }

/* ---------- caixa (barra inferior) ---------- */
.till { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(#2A2A31, #1B1B20); color: #fff; box-shadow: 0 -6px 20px rgba(0,0,0,.25); }
.till .in { max-width: 860px; margin: 0 auto; }
.lcd { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 6px; }
.lcd div { background: #0F2A17; border-radius: 10px; padding: 6px 10px; border: 1px solid #234E2E; box-shadow: inset 0 2px 6px rgba(0,0,0,.5); }
.lcd small { display: block; font-size: 10px; font-weight: 700; color: #7FD99A; letter-spacing: .6px; text-transform: uppercase; }
.lcd .price { font-size: 22px; color: #9BFFB4; text-shadow: 0 0 8px rgba(80,255,130,.35); line-height: 1.1; }
.lcd div:first-child .price { font-size: 26px; }
.lcd div.warn { background: #3A0E10; border-color: #6B1F23; } .lcd div.warn small { color: #FF9A9E; } .lcd div.warn .price { color: #FFB3B6; text-shadow: none; }
.till .act { display: flex; gap: 8px; margin-top: 7px; align-items: center; }
.till .act .prog { flex: 1; font-size: 12px; color: #CFCFD6; }
.till .act .prog .b { height: 6px; background: #3A3A44; border-radius: 99px; overflow: hidden; margin-top: 3px; }
.till .act .prog .b i { display: block; height: 100%; background: var(--yel); }
.net { display: none; position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 30; background: #3A0E10; color: #FFD3D5; font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 99px; }
.net.show { display: block; }

/* ---------- folha de preço (teclado) ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; display: none; }
.sheet.open { display: block; }
.sheet .bg { position: absolute; inset: 0; background: rgba(20,20,25,.55); }
.sheet .pn { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); max-height: 94vh; overflow: auto; }
.sheet h3 { margin: 0; font-size: 18px; }
.sheet .sub { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.ref { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.ref div { background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 7px 8px; text-align: center; }
.ref small { display: block; font-size: 10px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.ref .price { font-size: 18px; color: var(--ink); }
.ref .src { font-size: 10px; color: var(--muted); }
.display { background: #0F2A17; border-radius: 14px; padding: 8px 14px; display: flex; align-items: center; justify-content: space-between; box-shadow: inset 0 2px 8px rgba(0,0,0,.5); }
.display small { color: #7FD99A; font-weight: 700; font-size: 11px; text-transform: uppercase; }
.display .price { font-size: 38px; color: #9BFFB4; }
.cmp { font-size: 12.5px; font-weight: 700; margin: 6px 2px 0; min-height: 18px; }
.cmp.up { color: var(--red); } .cmp.dn { color: var(--grn); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 10px; }
.pad button { border: 0; background: #fff; border-radius: 12px; height: 52px; font-size: 22px; font-weight: 700; box-shadow: 0 3px 0 var(--line); }
.pad button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.qrow { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.qrow .q { display: flex; align-items: center; background: #fff; border-radius: 12px; border: 1.5px solid var(--line); }
.qrow .q button { border: 0; background: none; width: 42px; height: 42px; font-size: 20px; font-weight: 800; color: var(--red); }
.qrow .q span { min-width: 46px; text-align: center; font-weight: 800; }
.qrow .lt { flex: 1; text-align: right; font-size: 13px; color: var(--muted); }
.qrow .lt b { display: block; color: var(--ink); font-size: 18px; }

/* ---------- tabelas / histórico ---------- */
.box { background: #fff; border-radius: var(--r); border: 1.5px solid var(--line); box-shadow: 0 2px 0 var(--line); padding: 4px 14px; margin-bottom: 14px; }
.r { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #F3EFE6; }
.r:last-child { border: 0; }
.r .g { flex: 1; min-width: 0; }
.r .g b { display: block; font-size: 14.5px; }
.r .g small { color: var(--muted); font-size: 12px; }
.r .v { text-align: right; }
.r .v .price { font-size: 19px; }
.pill { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.pill.up { background: #FFE3E4; color: var(--red-d); } .pill.dn { background: #DDF5E5; color: #157636; } .pill.eq { background: #EEE; color: #666; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: #fff; border-radius: 14px; padding: 12px; border: 1.5px solid var(--line); }
.kpi small { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.kpi .price { display: block; font-size: 26px; color: var(--red); }
.spark { width: 100%; height: 90px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; }
.sw { position: relative; width: 46px; height: 26px; display: inline-block; flex: none; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw span { position: absolute; inset: 0; background: #CCC; border-radius: 99px; cursor: pointer; transition: .2s; }
.sw span::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.sw input:checked + span { background: var(--grn); }
.sw input:checked + span::before { transform: translateX(20px); }

/* ---------- navegação ---------- */
nav.nb { position: fixed; left: 0; right: 0; bottom: 0; z-index: 24; background: #fff; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 3px solid var(--yel); padding-bottom: env(safe-area-inset-bottom); }
nav.nb a { text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 700; display: flex; flex-direction: column; align-items: center; padding: 7px 0 8px; }
nav.nb a span { font-size: 21px; }
nav.nb a.on { color: var(--red); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--red); background-image: radial-gradient(rgba(255,255,255,.08) 2px, transparent 2px); background-size: 22px 22px; }
.login form { width: 100%; max-width: 370px; background: #fff; border-radius: 22px; padding: 26px 20px 22px; box-shadow: 0 6px 0 var(--red-d), 0 20px 50px rgba(0,0,0,.3); text-align: center; position: relative; }
.login .lg { font-family: 'Anton'; font-size: 44px; color: var(--red); line-height: 1; }
.login .lg span { color: var(--ink); }
.login .slogan { background: var(--yel); display: inline-block; padding: 3px 12px; border-radius: 6px; font-weight: 800; font-size: 13px; margin: 8px 0 14px; transform: rotate(-2deg); }
.err { background: #FFE3E4; color: var(--red-d); border-radius: 10px; padding: 9px 12px; font-size: 13px; font-weight: 700; margin-top: 10px; display: none; text-align: left; }
.toast { position: fixed; left: 50%; top: 14px; transform: translateX(-50%) translateY(-150%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 99px; font-size: 13px; font-weight: 700; z-index: 60; transition: transform .25s; max-width: 92vw; }
.toast.show { transform: translateX(-50%); }
.modal { position: fixed; inset: 0; z-index: 45; background: rgba(20,20,25,.55); display: none; align-items: flex-end; justify-content: center; }
.modal.open { display: flex; }
.modal .mp { background: var(--bg); width: 100%; max-width: 520px; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; }
@media (min-width: 600px) { .modal { align-items: center; } .modal .mp { border-radius: 22px; } }
.mbtns { display: flex; gap: 8px; margin-top: 14px; }
.mbtns .btn { flex: 1; }
.receipt { background: #fff; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; padding: 14px; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.08); position: relative; }
.receipt::after { content: ''; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px; background: radial-gradient(circle at 6px 0, #fff 6px, transparent 6.5px) 0 0 / 12px 10px repeat-x; }
.receipt .l { display: flex; justify-content: space-between; gap: 8px; }
.receipt hr { border: 0; border-top: 1px dashed #999; margin: 8px 0; }
