:root {
  --or: #e8590c; --or-d: #c2410c; --or-l: #fff1e6;
  --gr: #2b8a3e; --gr-l: #ebfbee; --rd: #c92a2a; --rd-l: #fff5f5;
  --bg: #f6f3ee; --card: #fff; --tx: #1f1f1f; --mu: #6b6b6b; --ln: #ece7df;
  --dark: #1f1f1f; --r: 14px;
  --sh: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--tx); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
input, select { width: 100%; padding: 11px 12px; border: 1.5px solid var(--ln); border-radius: 10px; background: #fff; outline: none; }
input:focus, select:focus { border-color: var(--or); }
label { display: block; font-size: 13px; color: var(--mu); margin: 12px 0 5px; }
h2 { font-size: 15px; margin: 18px 4px 8px; }
.hidden { display: none !important; }
.muted { color: var(--mu); }
.small { font-size: 12.5px; }
.pos { color: var(--gr); } .neg { color: var(--rd); }
.b { font-weight: 700; }
.row { display: flex; align-items: center; gap: 8px; }
.row > .grow { flex: 1; min-width: 0; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* topo */
.top { position: sticky; top: 0; z-index: 20; background: var(--or); color: #fff; padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top, 0px)); display: flex; align-items: center; gap: 10px; }
.top h1 { font-size: 17px; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .ic { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.18); color: #fff; font-size: 17px; display: grid; place-items: center; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 12px 12px calc(90px + var(--safe-b)); }

/* navegação inferior */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--ln); display: flex; justify-content: space-around; padding: 6px 4px calc(6px + var(--safe-b)); }
.nav button { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; color: var(--mu); padding: 4px 0; border-radius: 10px; }
.nav button .e { font-size: 21px; line-height: 1; }
.nav button.on { color: var(--or); font-weight: 700; }

/* cartões e listas */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 14px; margin-bottom: 10px; }
.list { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; margin-bottom: 10px; }
.item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--ln); width: 100%; text-align: left; }
.item:last-child { border-bottom: 0; }
button.item:active { background: #faf7f2; }
.av { width: 36px; height: 36px; border-radius: 50%; background: var(--or-l); color: var(--or); font-weight: 700; font-size: 13px; display: grid; place-items: center; flex: none; }
.tile { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 12px 14px; }
.tile .k { font-size: 12px; color: var(--mu); }
.tile .v { font-size: 19px; font-weight: 800; margin-top: 2px; }
.dark { background: var(--dark); color: #fff; }
.dark .k { color: #bbb; }
.hero { text-align: center; padding: 18px 14px; border-radius: var(--r); margin-bottom: 10px; }
.hero.pos { background: var(--gr-l); }
.hero.neg { background: var(--rd-l); }
.hero.zero { background: #f1f3f5; color: var(--tx); }
.hero .k { font-size: 13px; font-weight: 700; }
.hero .v { font-size: 34px; font-weight: 800; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: #f1f3f5; color: var(--mu); }
.badge.red { background: var(--rd-l); color: var(--rd); }
.badge.or { background: var(--or-l); color: var(--or-d); }
.badge.gr { background: var(--gr-l); color: var(--gr); }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 14px; border-radius: 12px; font-weight: 700; background: #fff; border: 1.5px solid var(--ln); min-height: 46px; }
.btn.full { width: 100%; }
.btn.or { background: var(--or); color: #fff; border-color: var(--or); }
.btn.gr { background: var(--gr); color: #fff; border-color: var(--gr); }
.btn.rd { background: #fff; color: var(--rd); border-color: #ffc9c9; }
.btn.lt { background: var(--or-l); color: var(--or-d); border-color: var(--or-l); }
.btn.dk { background: var(--dark); color: #fff; border-color: var(--dark); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 7px 10px; min-height: 34px; font-size: 13px; border-radius: 10px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 99px; background: #fff; font-weight: 600; font-size: 13.5px; box-shadow: var(--sh); }
.chip.on { background: var(--dark); color: #fff; }
.seg { display: flex; background: #ece7df; border-radius: 12px; padding: 3px; margin-bottom: 10px; }
.seg button { flex: 1; padding: 9px; border-radius: 10px; font-weight: 600; color: var(--mu); }
.seg button.on { background: #fff; color: var(--tx); box-shadow: var(--sh); }

/* vender */
.sell { display: grid; gap: 12px; }
.who { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: var(--r); box-shadow: var(--sh); padding: 10px 12px; width: 100%; text-align: left; margin-bottom: 10px; }
.prods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.prod { position: relative; background: #fff; border-radius: 12px; box-shadow: var(--sh); padding: 12px 8px; min-height: 86px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.prod .n { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.prod .p { color: var(--or); font-weight: 800; }
.prod .s { font-size: 11px; color: var(--mu); }
.prod .q { position: absolute; top: -6px; right: -6px; background: var(--or); color: #fff; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.prod.blk { background: #f8f0f0; opacity: .75; }
.prod.blk .n { text-decoration: line-through; }
.prod.blk .p { color: var(--rd); font-size: 12px; }
.prod.out { opacity: .4; }
.cart { background: #fff; border-radius: var(--r); box-shadow: var(--sh); padding: 12px; }
.cart .line { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--ln); }
.cart .line:last-of-type { border-bottom: 0; }
.qty { display: flex; align-items: center; gap: 4px; }
.qty button { width: 32px; height: 32px; border-radius: 8px; border: 1.5px solid var(--ln); font-weight: 800; }
.qty span { width: 22px; text-align: center; font-weight: 700; }
.alert { border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 10px; }
.alert.red { background: var(--rd-l); color: var(--rd); }
.alert.or { background: var(--or-l); color: var(--or-d); }
.alert.gr { background: var(--gr-l); color: var(--gr); }
.alert.info { background: #e7f5ff; color: #1864ab; }

/* modal (folha de baixo no celular) */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.42); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + var(--safe-b)); animation: up .18s ease-out; }
.sheet h3 { margin: 0 0 4px; font-size: 18px; }
@keyframes up { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }

.toast { position: fixed; left: 50%; bottom: calc(86px + var(--safe-b)); transform: translateX(-50%); z-index: 80; background: var(--dark); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; max-width: 92vw; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.err { background: var(--rd); }

/* barras */
.bar { height: 7px; background: #f1ece4; border-radius: 99px; overflow: hidden; margin-top: 5px; }
.bar i { display: block; height: 100%; background: var(--or); border-radius: 99px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; color: var(--mu); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--ln); }
table.t td { padding: 9px 6px; border-bottom: 1px solid var(--ln); }
table.t td.r, table.t th.r { text-align: right; }

/* PIN */
.pin { max-width: 360px; margin: 30px auto; text-align: center; }
.pin .dots { display: flex; justify-content: center; gap: 10px; margin: 14px 0 18px; min-height: 14px; }
.pin .dots i { width: 13px; height: 13px; border-radius: 50%; background: var(--or); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pad button { height: 60px; border-radius: 14px; background: #fff; box-shadow: var(--sh); font-size: 22px; font-weight: 600; }
.pad button.go { background: var(--or); color: #fff; font-size: 17px; }

/* switch */
.sw { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--ln); }
.sw:last-child { border-bottom: 0; }
.tg { position: relative; width: 48px; height: 28px; flex: none; }
.tg input { opacity: 0; width: 0; height: 0; position: absolute; }
.tg span { position: absolute; inset: 0; background: #dee2e6; border-radius: 99px; transition: .15s; }
.tg span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.tg input:checked + span { background: var(--rd); }
.tg input:checked + span::after { transform: translateX(20px); }

/* tablet e computador */
@media (min-width: 820px) {
  .sell { grid-template-columns: 1fr 380px; align-items: start; }
  .sell .side { position: sticky; top: 76px; }
  .prods { grid-template-columns: repeat(4, 1fr); }
  .prod { min-height: 100px; }
  .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
  .sheet-bg { align-items: center; }
  .sheet { border-radius: 20px; }
  .nav { justify-content: center; gap: 30px; }
}
@media (min-width: 1100px) { .prods { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 380px) { .prods { grid-template-columns: repeat(2, 1fr); } }
.r { text-align: right; }
.sheet .btn.full, .card .btn.full { margin-top: 8px; }
.sheet .grid2, .sheet .grid3 { margin-top: 8px; }
.cart .between { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--ln); }
.hero .v + .b { margin-top: 2px; }
#main > .grid2, #main .cols > div > .grid2 { margin-bottom: 10px; }
#main .row { margin: 10px 0; }
.pin h3 { margin: 6px 0 2px; }
.pin > .b { font-size: 34px; }
.pin .card { text-align: left; margin-top: 18px; }
ol.small { padding-left: 18px; margin: 8px 0; }
ol.small li { margin-bottom: 4px; }
.pixbar { display: block; width: 100%; text-align: left; border: 0; }
.tg.on-green input:checked + span { background: var(--gr); }
.nav button { position: relative; }
.nav .dot { position: absolute; top: 0; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--rd); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
ol.tut { padding-left: 20px; margin: 10px 0 14px; }
ol.tut li { margin-bottom: 9px; line-height: 1.45; }
.top .ic#btnHelp { font-weight: 800; }
textarea.pixcode { width: 100%; padding: 10px; border: 1.5px solid var(--ln); border-radius: 10px; font: 12px/1.35 ui-monospace, Menlo, monospace; word-break: break-all; resize: none; background: #faf7f2; margin-top: 6px; }
.payb { margin-top: 12px; }
.item.pixitem { flex-direction: column; align-items: stretch; gap: 3px; }
.item.pixitem .grid2 { margin-top: 6px; }
.alert.yel { background: #fff9db; color: #7a5c00; }
.shiftbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.badge + .badge { margin-left: 2px; }
.card .badge { margin: 3px 2px 0 0; }
.qtyline { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--ln); }
.qtyline:last-child { border-bottom: 0; }
.seg.four button { font-size: 13px; padding: 9px 4px; }
.top.dark-top { background: var(--dark); }
.hostx { color: var(--rd); font-weight: 800; padding: 0 2px; }
.grid3 + h2, .grid2 + .btn.full { margin-top: 10px; }
.top .logo { width: 34px; height: 34px; border-radius: 10px; object-fit: contain; background: #fff; flex: none; }
.logoprev { width: 72px; height: 72px; border-radius: 14px; border: 1.5px solid var(--ln); display: grid; place-items: center; overflow: hidden; flex: none; background: #fff; }
.logoprev img { width: 100%; height: 100%; object-fit: contain; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sw-c { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--ln); }
.sw-c.on { box-shadow: 0 0 0 3px var(--tx); }
.swatches input[type="color"] { width: 44px; height: 38px; padding: 2px; }

/* toque no tablet: sem zoom por toque duplo, sem "puxar para atualizar" sem querer, sem zoom ao digitar no iPhone */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overscroll-behavior-y: contain; }
button, .chip, .prod, .item, .tg, .pad button { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
input, select, textarea { font-size: 16px; }
.btn:active, .prod:active, .chip:active { transform: scale(.97); }
.updbar { position: fixed; left: 50%; transform: translateX(-50%); top: calc(64px + env(safe-area-inset-top, 0px)); z-index: 60; background: var(--dark); color: #fff; border-radius: 12px; padding: 11px 16px; font-weight: 700; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 92vw; }
@media (orientation: landscape) and (max-height: 520px) { .nav button .e { font-size: 18px; } .top { padding-top: 8px; padding-bottom: 8px; } }
