:root {
  --bg: #f5f7f6; --card: #fff; --ink: #14201d; --muted: #5d6b67; --line: #e2e8e6;
  --pri: #0f766e; --pri-d: #0b5e58; --pri-l: #e6f4f2;
  --ok: #15803d; --ok-l: #e7f6ec; --warn: #b45309; --warn-l: #fdf3e4; --red: #b91c1c; --red-l: #fdecec; --blue: #1d4ed8; --blue-l: #e9effd;
  --r: 12px; --sh: 0 1px 2px rgba(16,24,22,.06), 0 2px 8px rgba(16,24,22,.05);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg);
  font-size: 15px; line-height: 1.45;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: var(--pri); }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
h3 { font-size: 1.02rem; }
.muted { color: var(--muted); margin: 0; }
.hint { color: var(--muted); font-size: .82rem; }
.hint .ok { color: var(--ok); } .hint .warn { color: var(--warn); }
.r { text-align: right; } .nowrap { white-space: nowrap; }
.dim { opacity: .55; }

/* botões e campos */
.btn { border: 1px solid transparent; border-radius: 9px; padding: .55rem 1rem; font: inherit; font-weight: 600; cursor: pointer; background: #eef2f1; color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--pri); color: #fff; } .btn.primary:hover:not(:disabled) { background: var(--pri-d); }
.btn.ghost { background: transparent; border-color: var(--line); } .btn.ghost:hover:not(:disabled) { background: #f0f4f3; }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--red); margin-right: auto; }
.btn.sm { padding: .3rem .65rem; font-size: .85rem; }
.btn.block { width: 100%; }
.in { width: 100%; font: inherit; padding: .55rem .7rem; border: 1px solid #cfd8d5; border-radius: 9px; background: #fff; color: var(--ink); }
.in:focus { outline: 2px solid var(--pri); outline-offset: -1px; border-color: var(--pri); }
.in[readonly] { background: #f3f6f5; }
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .8rem; }
.field .lbl { font-weight: 600; font-size: .88rem; }
.field.req .lbl::after { content: " *"; color: var(--red); }
.check { display: flex; align-items: center; gap: .5rem; margin: .4rem 0 .8rem; }
.msg { min-height: 1.2em; margin: .6rem 0 0; font-size: .9rem; }
.msg.err { color: var(--red); } .msg.ok { color: var(--ok); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .9rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 .9rem; }
.grid2.cards-grid { align-items: start; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; } .row.end { justify-content: flex-end; }
details.help { background: var(--pri-l); border-radius: 9px; padding: .55rem .8rem; margin: -.2rem 0 .9rem; font-size: .88rem; }
details.help summary { cursor: pointer; font-weight: 600; color: var(--pri-d); }
details.help ul { margin: .5rem 0 0; padding-left: 1.1rem; }
.subcard { background: #f7faf9; border: 1px dashed var(--line); border-radius: 10px; padding: .8rem; margin: .4rem 0 .8rem; }
.subcard > b { display: block; margin-bottom: .6rem; font-size: .9rem; }

/* login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.2rem; background: linear-gradient(160deg, #e3f1ee, var(--bg)); }
.auth-card { width: 100%; max-width: 380px; background: #fff; border-radius: 18px; padding: 1.8rem; box-shadow: var(--sh); }
.auth-card.wide { max-width: 480px; }
.auth-card h1 { font-size: 1.5rem; }
.logo-big { width: 56px; height: 56px; border-radius: 15px; background: var(--pri); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.25rem; margin-bottom: 1rem; }
.switch { text-align: center; margin: 1rem 0 0; font-size: .9rem; }
.center { min-height: 100vh; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--pri); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.who { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.who-btn { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .7rem .4rem; border: 2px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; }
.who-btn.on { border-color: var(--pri); background: var(--pri-l); }
.who-btn small { color: var(--muted); font-size: .75rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--pri); color: #fff; display: grid; place-items: center; font-weight: 700; }
.avatar.sm { width: 26px; height: 26px; font-size: .8rem; }
.in.pin { font-size: 1.6rem; letter-spacing: .6em; text-align: center; }

/* layout */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: #0f1f1c; color: #cfe2de; padding: 1rem .7rem; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand { display: flex; gap: .65rem; align-items: center; padding: .3rem .4rem 1.2rem; }
.brand b { display: block; color: #fff; } .brand small { color: #8fb1aa; font-size: .75rem; }
.logo { width: 38px; height: 38px; border-radius: 11px; background: var(--pri); color: #fff; display: grid; place-items: center; font-weight: 800; }
.side nav a { display: flex; gap: .7rem; align-items: center; padding: .6rem .7rem; border-radius: 9px; color: inherit; text-decoration: none; margin-bottom: 2px; }
.side nav a:hover { background: #18312c; }
.side nav a.on { background: var(--pri); color: #fff; }
.side svg, .bnav svg { width: 19px; height: 19px; flex: none; }
main { min-width: 0; }
.top { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.5rem; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top h1 { font-size: 1.25rem; margin: 0; margin-right: auto; }
.chip-user { display: flex; align-items: center; gap: .45rem; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: .2rem .7rem .2rem .25rem; font: inherit; font-size: .88rem; cursor: pointer; }
.sync { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); }
.sync i { width: 9px; height: 9px; border-radius: 50%; background: #9aa6a3; }
.sync.ok i { background: var(--ok); } .sync.busy i { background: var(--blue); animation: pulse 1s infinite; } .sync.off i { background: var(--warn); } .sync.err i { background: var(--red); }
@keyframes pulse { 50% { opacity: .3; } }
.view { padding: 1.3rem 1.5rem 6rem; max-width: 1200px; }
.bnav { display: none; }

/* blocos */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.card-head h3 { margin: 0; }
.card.alert { border-left: 4px solid var(--warn); background: var(--warn-l); }
.alist { margin: 0; padding-left: 1.1rem; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar .muted { max-width: 640px; }
.banner { background: var(--blue-l); color: #1e3a8a; padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.banner.warn { background: var(--warn-l); color: #7c3a05; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi { background: #fff; border-radius: var(--r); box-shadow: var(--sh); padding: 1rem 1.1rem; }
.kpi small { color: var(--muted); display: block; } .kpi b { font-size: 1.5rem; }
.kpi.red b { color: var(--red); } .kpi.green b { color: var(--ok); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.pcard { margin: 0; display: flex; flex-direction: column; gap: .55rem; }
.pc-head { display: flex; justify-content: space-between; align-items: start; }
.pc-head small { display: block; color: var(--muted); }
.big { font-size: 1.6rem; font-weight: 800; color: var(--pri-d); } .big small { font-size: .85rem; font-weight: 500; color: var(--muted); }
.split { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .85rem; color: var(--muted); } .split b { color: var(--ink); }
.chip { display: inline-block; padding: .12rem .55rem; border-radius: 99px; font-size: .76rem; font-weight: 600; background: #eef2f1; color: var(--muted); }
.chip.ok { background: var(--ok-l); color: var(--ok); } .chip.warn { background: var(--warn-l); color: var(--warn); }
.chip.red { background: var(--red-l); color: var(--red); } .chip.blue { background: var(--blue-l); color: var(--blue); }
.chips-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .8rem; }
.empty { text-align: center; padding: 2.5rem 1rem; background: #fff; border-radius: var(--r); border: 1px dashed #cdd7d4; }
.empty p { color: var(--muted); }
.tw { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
.t th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.t th.r { text-align: right; }
.t td { padding: .6rem; border-bottom: 1px solid #eff3f2; vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }

/* modal e aviso */
.overlay { position: fixed; inset: 0; background: rgba(10,20,18,.45); display: grid; place-items: center; padding: 1rem; z-index: 50; overflow: auto; }
.modal { background: #fff; border-radius: 16px; padding: 1.4rem; width: 100%; max-width: 460px; max-height: calc(100vh - 2rem); overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 720px; }
.modal h2 { font-size: 1.2rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; position: sticky; bottom: -1.4rem; background: #fff; padding: .8rem 0 0; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: #14201d; color: #fff; padding: .7rem 1.1rem; border-radius: 10px; z-index: 99; box-shadow: var(--sh); max-width: 90vw; }
.toast.ok { background: var(--ok); } .toast.err { background: var(--red); }
.prows { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .6rem; }
.prow { display: grid; grid-template-columns: 2.2fr 1fr 1fr 1.2fr auto; gap: .5rem; align-items: end; background: #f7faf9; padding: .6rem; border-radius: 10px; }
.prow .field { margin: 0; }
.xbtn { border: 0; background: transparent; color: var(--red); font-size: 1.1rem; cursor: pointer; padding: .5rem; }
.ptotal { font-weight: 700; text-align: right; padding: .4rem 0; }

/* celular */
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .top { padding: .8rem 1rem; }
  .view { padding: 1rem 1rem 6rem; }
  .bnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); z-index: 20; overflow-x: auto; padding-bottom: env(safe-area-inset-bottom); }
  .bnav a { flex: 1 0 70px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem .2rem; font-size: .68rem; color: var(--muted); text-decoration: none; }
  .bnav a.on { color: var(--pri); }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .prow { grid-template-columns: 1fr 1fr; } .prow .grow { grid-column: 1 / -1; }
  .sync { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .t { font-size: .85rem; }
}
.hint .warn, .hint b.warn { color: var(--warn); }
.wide-card { grid-column: span 2; }
@media (max-width: 1100px) { .wide-card { grid-column: auto; } }
.dist-info { background: #f7faf9; border-radius: 10px; padding: .1rem .8rem .2rem; margin: -.3rem 0 .8rem; }
.dist-info:empty { display: none; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .55rem 0 .15rem; }
.kv.big2 b { font-size: 1.25rem; color: var(--pri-d); }
.dist-info .row { margin: .4rem 0; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.guide .gsvg { background: #eef2f1; border-radius: 12px; padding: .6rem; margin-bottom: 1rem; }
.bill-svg { width: 100%; height: auto; display: block; }
.gsteps { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; }
.gstep { display: flex; gap: .7rem; align-items: flex-start; }
.gstep p { margin: .15rem 0 0; color: var(--muted); font-size: .9rem; }
.gnum { flex: none; width: 26px; height: 26px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
@media (max-width: 600px) { .guide .gsvg { overflow-x: auto; } .bill-svg { min-width: 620px; } }
.nick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .45rem; }
.nick-item { display: flex; align-items: center; gap: .4rem; }
.nick-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--pri-l); color: var(--pri-d); font-size: .75rem; font-weight: 700; display: grid; place-items: center; }
.brows { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .6rem; }
.brow { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr .7fr 1fr auto; gap: .5rem; align-items: end; background: #f7faf9; padding: .6rem; border-radius: 10px; }
.brow .field { margin: 0; }
.btag { font-size: .72rem; color: var(--blue); min-height: 0; }
@media (max-width: 820px) { .brow { grid-template-columns: 1fr 1fr; } }
.check-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 .8rem; }
.step { display: flex; gap: .8rem; align-items: flex-start; padding: .8rem 0; border-top: 1px solid var(--line); }
.step:first-of-type { border-top: 0; }
.step .grow { flex: 1; min-width: 0; }
.step b { display: block; margin-bottom: .4rem; }
.open-list { display: flex; flex-direction: column; gap: .5rem; margin: .4rem 0 .6rem; }
.open-row { background: #f7faf9; border-radius: 10px; padding: .6rem .7rem; display: flex; flex-direction: column; gap: .45rem; }
.open-head { display: flex; align-items: center; gap: .6rem; }
.open-head .xbtn { padding: .2rem .4rem; }
.open-head b { margin: 0; }
.open-row .in { max-width: 140px; }
.open-res { font-size: .88rem; color: var(--pri-d); font-weight: 600; }
.open-res.bad { color: var(--red); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-left: auto; }
.seg button { border: 0; background: #fff; padding: .3rem .7rem; font: inherit; font-size: .82rem; cursor: pointer; }
.seg button.on { background: var(--pri); color: #fff; }
.frac { display: flex; gap: .4rem; flex-wrap: wrap; }
.frac .btn.on { background: var(--pri-l); border-color: var(--pri); color: var(--pri-d); }
.check-sum { background: var(--pri-l); border-radius: 10px; padding: .3rem .9rem .6rem; }
.kv.small { padding-top: .2rem; font-size: .9rem; color: var(--muted); }
.kv b.ok { color: var(--ok); } .kv b.warn { color: var(--warn); }
.nfe-head { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: .8rem; background: #f7faf9; border-radius: 10px; padding: .7rem .9rem; margin-bottom: .8rem; }
.nfe-head small { display: block; color: var(--muted); font-size: .75rem; }
.nfe-rows { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .6rem; }
.nfe-row { display: grid; grid-template-columns: 1fr 1.2fr; gap: .8rem; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; }
.nfe-desc b { font-size: .9rem; display: block; }
.nfe-desc .chip { margin-top: .3rem; }
.nfe-desc .chip:empty { display: none; }
.nfe-map { display: flex; gap: .6rem; align-items: end; }
.nfe-map .field { margin: 0; }
.nfe-map .grow { flex: 1; min-width: 0; }
@media (max-width: 820px) { .nfe-row { grid-template-columns: 1fr; } .nfe-head { grid-template-columns: 1fr 1fr; } }
/* calculadora */
tr.click { cursor: pointer; } tr.click:hover td { background: #f7faf9; }
.chip.ok { background: var(--ok-l); color: var(--ok); } .chip.bad { background: var(--red-l); color: var(--red); }
.calc-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 1rem; align-items: start; }
.calc-side { position: sticky; top: 76px; }
@media (max-width: 1000px) { .calc-grid { grid-template-columns: 1fr; } .calc-side { position: static; } }
.parts { display: flex; flex-direction: column; gap: .7rem; margin-top: .6rem; }
.card-in { border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem; background: #fbfcfc; }
.part-head { display: flex; gap: .6rem; align-items: center; margin-bottom: .6rem; }
.part-head .in { flex: 1; }
.fil-rows, .sup-rows, .fix-rows { display: flex; flex-direction: column; gap: .35rem; margin: .35rem 0 .5rem; }
.fil-row { display: flex; gap: .5rem; align-items: center; }
.fil-row select.in { flex: 1; min-width: 0; }
.fil-row .grow { flex: 1; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid #cfd8d5; flex: none; }
.swatch.none { background: repeating-linear-gradient(45deg, #eee, #eee 3px, #fff 3px, #fff 6px); }
.drop { border: 2px dashed #b9cbc6; border-radius: 12px; padding: 1.4rem; text-align: center; cursor: pointer; display: flex; flex-direction: column; gap: .3rem; color: var(--muted); }
.drop:hover { background: var(--pri-l); border-color: var(--pri); }
.drop b { color: var(--pri-d); }
.result { display: flex; flex-direction: column; gap: .7rem; }
.res-cost { background: #fff; border-radius: var(--r); box-shadow: var(--sh); padding: .8rem 1rem; }
.res-cost .big2 { font-size: 1.35rem; color: var(--pri-d); }
.ch-card { background: #fff; border-radius: var(--r); box-shadow: var(--sh); padding: .8rem 1rem; border-left: 4px solid var(--line); }
.ch-card.ok { border-left-color: var(--ok); } .ch-card.warn { border-left-color: var(--warn); } .ch-card.bad { border-left-color: var(--red); }
.ch-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.ch-prices { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.ch-prices small { display: block; color: var(--muted); font-size: .74rem; }
.ch-card .hint { margin: .4rem 0; }
label.mini { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--muted); }
label.mini .in { padding: .3rem .5rem; font-size: .85rem; }
.cfg-sec { border-top: 1px solid var(--line); padding: .9rem 0 .4rem; }
.cfg-sec h4 { margin: 0 0 .5rem; font-size: .95rem; }
.pay-rows { display: flex; flex-direction: column; gap: .3rem; margin: .4rem 0; }
.pay-row { display: grid; grid-template-columns: 1fr 100px 100px; gap: .5rem; align-items: center; }
.pay-row.head span { font-size: .75rem; color: var(--muted); text-transform: uppercase; }
.ch-cfg { display: flex; flex-direction: column; gap: .5rem; }
.ch-cfg-item { border: 1px solid var(--line); border-radius: 10px; padding: .5rem .8rem; }
.ch-cfg-item .check { margin: .2rem 0 .4rem; }
.full-card { grid-column: 1 / -1; }
.inst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .4rem .8rem; margin: .5rem 0 .7rem; }
.inst { display: flex; align-items: center; gap: .4rem; }
.inst > span:first-child { width: 28px; font-weight: 600; font-size: .85rem; }
.inst .in { padding: .35rem .5rem; }
.pay-rows, .fix-rows { max-width: 560px; }
.ev-res { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; background: var(--pri-l); border-radius: 10px; padding: .6rem .8rem; margin-bottom: .6rem; }
.ev-res small { display: block; color: var(--muted); font-size: .75rem; }
.sec-title { margin: 1.2rem 0 .6rem; font-size: 1.02rem; }

/* PDV (caixa) */
.pdv { display: grid; grid-template-columns: 1fr 360px; gap: 1rem; align-items: start; }
.pdv-ctx { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-bottom: .8rem; }
.pdv-ch { display: flex; flex-direction: column; gap: .25rem; min-width: 180px; } .pdv-ch .lbl { font-weight: 600; font-size: .82rem; color: var(--muted); }
.ev-pick { flex: 1; text-align: left; min-height: 42px; }
.pdv-tools { display: flex; gap: .6rem; align-items: center; margin-bottom: .8rem; flex-wrap: wrap; }
.pdv-search { flex: 1; min-width: 180px; }
.pdv-today a { font-weight: 600; text-decoration: none; white-space: nowrap; }
.pdv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.pdv-item { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; text-align: left; padding: .8rem; min-height: 118px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--sh); font: inherit; color: var(--ink); cursor: pointer; transition: transform .08s; -webkit-tap-highlight-color: transparent; }
.pdv-item:active, .pdv-item.bump { transform: scale(.97); }
.pdv-item.out { background: #fafbfb; }
.pdv-sw { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); }
.pdv-name { font-weight: 600; line-height: 1.25; }
.pdv-price { font-size: 1.15rem; font-weight: 800; color: var(--pri); margin-top: auto; }
.pdv-stock { font-size: .75rem; color: var(--muted); }
.pdv-item.out .pdv-stock { color: var(--warn); }
.pdv-badge { position: absolute; top: .5rem; right: .5rem; min-width: 26px; height: 26px; padding: 0 .4rem; border-radius: 13px; background: var(--pri); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: .85rem; }
.pdv-cart { position: sticky; top: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 1rem; display: flex; flex-direction: column; gap: .7rem; max-height: calc(100vh - 2rem); overflow: auto; }
.pdv-cart-head { display: flex; align-items: center; gap: .5rem; } .pdv-cart-head h3 { margin: 0; flex: 1; }
.pdv-close { display: none; }
.pdv-lines { display: flex; flex-direction: column; }
.pdv-line { display: grid; grid-template-columns: 1fr auto auto; gap: .6rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.pdv-lname { display: flex; flex-direction: column; min-width: 0; } .pdv-lname b { overflow: hidden; text-overflow: ellipsis; }
.linkish { border: 0; background: none; padding: 0; color: var(--pri); font: inherit; font-size: .82rem; cursor: pointer; text-align: left; text-decoration: underline dotted; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.qty button { width: 36px; height: 36px; border: 0; background: #f0f4f3; font-size: 1.2rem; font-weight: 700; cursor: pointer; color: var(--ink); }
.qty span { min-width: 30px; text-align: center; font-weight: 700; }
.pdv-sum > div { display: flex; justify-content: space-between; padding: .2rem 0; }
.pdv-total { font-size: 1.3rem; font-weight: 800; border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .5rem !important; }
.pdv-emptycart { text-align: center; padding: 1.5rem 0; }
.btn.big { padding: .9rem 1rem; font-size: 1.05rem; }
.pdv-bar { display: none; }
.pay-total { display: flex; flex-direction: column; align-items: center; padding: .4rem 0 .8rem; } .pay-total b { font-size: 2rem; }
.lbl-s { font-weight: 600; font-size: .88rem; margin: 0 0 .4rem; }
.pay-btns { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; margin-bottom: .8rem; }
.pay-btn { padding: .9rem .5rem; border: 2px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink); }
.pay-btn.on { border-color: var(--pri); background: var(--pri-l); color: var(--pri-d); }
.troco { font-size: 1.2rem; font-weight: 800; color: var(--ok); }
.kpis.sm { grid-template-columns: repeat(4, 1fr); margin: .4rem 0; }
@media (max-width: 1000px) {
  .pdv { grid-template-columns: 1fr; }
  .pdv-cart { display: none; }
  .pdv.cart-open .pdv-cart { display: flex; position: fixed; inset: auto 0 0 0; top: auto; max-height: 85vh; border-radius: 16px 16px 0 0; z-index: 40; padding-bottom: calc(1rem + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0,0,0,.2); }
  .pdv.cart-open::before { content: ""; position: fixed; inset: 0; background: rgba(10,20,18,.35); z-index: 39; }
  .pdv-close { display: inline-block; }
  .pdv-bar { display: block; position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 30; }
  .pdv-bar .btn { box-shadow: 0 6px 20px rgba(15,118,110,.35); }
  .kpis.sm { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .pdv-bar { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .pdv-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .55rem; }
  .pdv-item { min-height: 108px; padding: .7rem; }
}
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 1000px) { .pdv { padding-bottom: 5rem; } }
.calc-actions { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; padding: 1rem 0; border-top: 1px solid var(--line); }
@media (max-width: 1000px) { .calc-actions .btn.primary { flex: 1 1 100%; order: -1; } }
.btn.dots { font-size: 1.2rem; line-height: 1; padding: .2rem .6rem; color: var(--muted); }
