/* Identidade Diversité: verde #364F1A · mostarda #D5B616 · creme #FBF6E6 / #FFF9DC */
:root {
  --verde: #364f1a;
  --mostarda: #d5b616;
  --creme: #fbf6e6;
  --creme-2: #fff9dc;
  --bg: #fbf6e6;
  --surface: #fffdf5;
  --surface-2: #f4edd3;
  --ink: #26301a;
  --ink-2: #4f5841;
  --muted: #868a72;
  --line: #e7dfc0;
  --accent: #364f1a;
  --accent-ink: #fff9dc;
  --accent-soft: #e6ebd6;
  --olive: #4c7a22;
  --olive-soft: #e5eed3;
  --gold: #9c8406;
  --gold-soft: #fbf2c4;
  --danger: #b3261e;
  --danger-soft: #f9dedc;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(40, 50, 20, .06), 0 4px 16px rgba(40, 50, 20, .06);
  --listras: repeating-linear-gradient(90deg, var(--mostarda) 0 18px, var(--creme-2) 18px 34px);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --nav-w: 232px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font: 15px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; font-family: var(--sans); font-weight: 600; letter-spacing: 0; }

/* ---------- navegação ---------- */
.nav {
  position: fixed; inset: 0 auto 0 0; width: var(--nav-w); padding: 22px 14px;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 18px; z-index: 10;
}
/* marca no menu: faixa de listras + logotipo */
.marca { display: block; margin: -22px -14px 4px; padding: 0 0 12px; text-decoration: none; }
.marca .listras { height: 14px; background: var(--listras); }
.marca .logotipo { display: block; width: 168px; margin: 14px auto 0; }
.marca .selo-logo { display: none; width: 56px; height: 56px; border-radius: 14px; margin: 10px auto 0; object-fit: cover; box-shadow: var(--shadow); }
h1, h2 { color: var(--verde); }
.nav nav a.destaque { background: var(--mostarda) !important; color: var(--verde) !important; font-weight: 700; }
.nav nav a.destaque:hover { filter: brightness(1.05); }
.nav nav a.ativo { background: var(--accent-soft); color: var(--verde); font-weight: 600; }
.kpi.destaque { background: var(--verde) !important; border-color: var(--verde) !important; color: var(--creme-2) !important; }
.kpi.destaque .rot, .kpi.destaque .sub { color: #cfd8b8 !important; }
.etapa-n { background: var(--mostarda); color: var(--verde); }
.btn.primario { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15); }
.listras-topo { height: 6px; background: var(--listras); border-radius: 99px; opacity: .9; }
.nav nav { display: flex; flex-direction: column; gap: 2px; }
.nav nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  text-decoration: none; color: var(--ink-2); font-weight: 500;
}
.nav nav a i { width: 20px; height: 20px; display: grid; place-items: center; font-style: normal; }
.nav nav a i svg { width: 20px; height: 20px; }
.nav nav a:hover { background: var(--surface-2); }
.nav nav a.ativo { background: var(--accent-soft); color: var(--accent); }
.nav nav a.destaque { background: var(--accent); color: var(--accent-ink); margin: 4px 0 8px; }
.nav nav a.destaque:hover { filter: brightness(1.06); }
.rodape-nav { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 0 10px; }
.link-sutil { font-size: 12.5px; color: var(--muted); text-decoration: none; word-break: break-all; }
a.link-sutil:hover { color: var(--accent); }

main { margin-left: var(--nav-w); padding: 28px 32px 60px; max-width: 1320px; }
.carregando { color: var(--muted); padding: 40px 0; }

/* ---------- topo de página ---------- */
.topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.topo p { margin: 4px 0 0; color: var(--muted); }
.acoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primario { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primario:hover { filter: brightness(1.06); }
.btn.perigo { color: var(--danger); }
.btn.perigo:hover { background: var(--danger-soft); }
.btn.peq { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.btn.fantasma { border-color: transparent; background: transparent; }
.btn.fantasma:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.campo small { color: var(--muted); font-size: 12px; }
input[type=text], input[type=search], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=month], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); outline: none; font-size: 16px;
}
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.grade { display: grid; gap: 14px; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.busca { position: relative; flex: 1; min-width: 200px; max-width: 380px; }
.busca input { padding-left: 38px; }
.busca::before { content: '⌕'; position: absolute; left: 13px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 18px; }

.segmentado { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 11px; gap: 2px; flex-wrap: wrap; }
.segmentado button { border: 0; background: transparent; padding: 7px 13px; border-radius: 8px; font-weight: 500; color: var(--ink-2); cursor: pointer; font-size: 14px; }
.segmentado button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.opcoes { display: flex; gap: 8px; flex-wrap: wrap; }
.opcoes label { position: relative; }
.opcoes input { position: absolute; opacity: 0; pointer-events: none; }
.opcoes label span {
  display: inline-block; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer; background: var(--surface); font-size: 14px; font-weight: 500;
}
.opcoes input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- cartões ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 20px; }
.card h2 { margin-bottom: 14px; }
.card-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-cab h2 { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 18px 20px; }
.kpi .rot { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .val { font: 600 27px var(--serif); margin-top: 6px; letter-spacing: -.02em; }
.kpi .sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.kpi.destaque { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.kpi.destaque .rot, .kpi.destaque .sub { color: #cfc4b8; }
.dupla { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.pilha { display: flex; flex-direction: column; gap: 18px; }

/* ---------- tabelas e listas ---------- */
.tabela { width: 100%; border-collapse: collapse; }
.tabela th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tabela td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela tbody tr.clica { cursor: pointer; }
.tabela tbody tr.clica:hover { background: var(--surface-2); }
.tabela .num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rolagem { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lista { display: flex; flex-direction: column; }
.lista .item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.lista .item:last-child { border-bottom: 0; }
.lista .item .cresce { flex: 1; min-width: 0; }
.lista .item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista .item .s { font-size: 13px; color: var(--muted); }
.lista .item .s.vermelho { color: var(--danger); font-weight: 600; }
.vazio { color: var(--muted); text-align: center; padding: 34px 12px; }
.vazio b { display: block; color: var(--ink-2); font-size: 16px; margin-bottom: 4px; }

.selo { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.selo.disponivel { background: var(--olive-soft); color: var(--olive); }
.selo.reservada { background: var(--gold-soft); color: var(--gold); }
.selo.vendida { background: var(--surface-2); color: var(--ink-2); }
.selo.devolvida { background: var(--danger-soft); color: var(--danger); }
.selo.consig { background: var(--accent-soft); color: var(--accent); }
.selo.entrada { background: var(--olive-soft); color: var(--olive); }
.selo.saida { background: var(--danger-soft); color: var(--danger); }
.verde { color: var(--olive); }
.vermelho { color: var(--danger); }
.mudo { color: var(--muted); }

/* ---------- peças ---------- */
.filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.vitrine { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 16px; }
.peca { overflow: hidden; cursor: pointer; transition: transform .15s; display: flex; flex-direction: column; }
.peca:hover { transform: translateY(-2px); }
.peca .foto { aspect-ratio: 4 / 5; background: var(--surface-2); position: relative; }
.peca .foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.peca .foto .selo { position: absolute; top: 8px; left: 8px; }
.peca .foto .cod { position: absolute; bottom: 8px; right: 8px; background: rgba(255, 253, 249, .92); padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.peca .info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.peca .info .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peca .info .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peca .info .p { font: 600 18px var(--serif); margin-top: 4px; }
.sem-foto { width: 100%; height: 100%; display: grid; place-items: center; color: #c9bcad; }
.sem-foto svg { width: 42%; height: 42%; }
.mini { width: 46px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--surface-2); flex: none; }
.mini img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* foto no formulário */
.foto-campo { display: block; aspect-ratio: 4 / 5; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; overflow: hidden; position: relative; }
.foto-campo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-campo .dica { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); text-align: center; padding: 16px; font-size: 14px; }
.foto-campo .dica svg { width: 40px; height: 40px; }
.foto-campo input { display: none; }
.form-peca { display: grid; grid-template-columns: 220px 1fr; gap: 22px; }

/* ---------- vender (PDV) ---------- */
.pdv { display: grid; grid-template-columns: 1fr 400px; gap: 18px; align-items: start; }
.pdv .resultado { max-height: calc(100vh - 230px); overflow: auto; }
.carrinho { position: sticky; top: 20px; }
.carrinho .item input { width: 104px; min-height: 38px; text-align: right; padding: 6px 10px; }
.total-linha { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; }
.total-linha.grande { font: 600 26px var(--serif); border-top: 1px solid var(--line); margin-top: 6px; padding-top: 14px; }
.x { border: 0; background: none; color: var(--muted); font-size: 20px; cursor: pointer; width: 32px; height: 32px; border-radius: 8px; }
.x:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- embalagem ---------- */
.contador { margin-left: auto; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; }
.nav nav a { position: relative; }
.passo { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex: none; }
.passo button { width: 38px; height: 38px; border: 0; background: var(--surface); font-size: 18px; cursor: pointer; }
.passo button:hover { background: var(--surface-2); }
.passo b { min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.pedidos { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; align-items: start; }
.endereco { margin-top: 10px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; font-size: 14px; white-space: pre-wrap; }
a.alerta { text-decoration: none; background: var(--gold-soft); border-color: #ecdcb3; display: block; }
a.alerta.vermelho-suave { background: var(--danger-soft); border-color: #f0c4c0; color: var(--ink); }

.chip-var { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.link-var { font-size: 12.5px; color: var(--accent); text-decoration: none; font-weight: 500; }
.link-var:hover { text-decoration: underline; }
.tabela tr.cat-tab td { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); padding-top: 18px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.tabela tr.grupo-linha td { background: var(--surface-2); padding-top: 9px; padding-bottom: 9px; }
.tabela tr.var-linha td:first-child { padding-left: 28px; }
.ramo { color: var(--muted); margin-right: 2px; }
.emb-secao { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 0 4px; }
.emb-grupo { font-weight: 600; padding: 8px 0 2px; font-size: 14px; }
.lista.emb-sel .item.emb-on .t { color: var(--accent); }
.kit-cab, .kit-linha { display: grid; grid-template-columns: 1fr 118px 118px 90px; gap: 10px; align-items: center; }
.kit-cab { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding-bottom: 6px; border-bottom: 1px solid var(--line); text-align: center; }
.kit-linha { padding: 7px 0; border-bottom: 1px solid var(--line); }
.kit-lista .emb-grupo { padding-top: 10px; }
@media (max-width: 560px) { .kit-cab, .kit-linha { grid-template-columns: 1fr 104px 104px; } .kit-cab span:last-child, .kit-linha input { display: none; } }

/* ---------- listas estilizadas ---------- */
.combo { position: relative; width: 100%; }
.combo input { padding-right: 42px; }
.combo-seta { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; border-radius: 8px; padding: 0; }
.combo-seta:hover { background: var(--surface-2); }
.combo-seta svg, .sel-btn svg { width: 18px; height: 18px; flex: none; transition: transform .15s; }
.combo.aberto .combo-seta svg, .sel.aberto .sel-btn svg { transform: rotate(180deg); }
.combo.aberto input { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sel { position: relative; width: 100%; }
.sel-btn {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 10px 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  cursor: pointer; text-align: left; font-size: 16px; color: var(--ink);
}
.sel-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-btn svg { color: var(--muted); }
.sel.aberto .sel-btn, .sel-btn:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.sel-btn:disabled { opacity: .6; cursor: not-allowed; }
.painel-lista {
  position: fixed; z-index: 3000; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 14px 36px rgba(40, 25, 10, .18), 0 2px 6px rgba(40, 25, 10, .08); overflow: auto; padding: 6px;
  overscroll-behavior: contain; animation: abre .12s ease-out; color: var(--ink);
}
@keyframes abre { from { opacity: 0; transform: translateY(-4px); } }
.painel-lista .op { padding: 10px 12px; border-radius: 9px; cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 15px; line-height: 1.3; }
.painel-lista .op:hover, .painel-lista .op.ativo { background: var(--surface-2); }
.painel-lista .op.sel { font-weight: 600; color: var(--accent); }
.painel-lista .op.sel::after { content: '✓'; margin-left: auto; padding-left: 8px; }
.painel-lista .op.sel .op-extra { margin-left: auto; }
.op-extra { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.painel-lista .op.op-rodape {
  position: sticky; bottom: -6px; margin: 6px -6px -6px; padding: 13px 18px; border-radius: 0;
  background: var(--surface); border-top: 1px solid var(--line); color: var(--accent); font-weight: 600;
}
.painel-lista .op.op-rodape:hover, .painel-lista .op.op-rodape.ativo { background: var(--accent-soft); }
.op-vazio { padding: 12px; color: var(--muted); font-size: 14px; }
.op-busca { position: sticky; top: -6px; background: var(--surface); margin: -6px -6px 6px; padding: 8px; border-bottom: 1px solid var(--line); z-index: 1; }
.op-busca input { min-height: 40px; font-size: 15px; }
.bolinha { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); flex: none; display: inline-block; }

/* campos com R$ e % */
.campo-afixo { position: relative; width: 100%; }
.campo-afixo .prefixo, .campo-afixo .sufixo { position: absolute; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; pointer-events: none; }
.campo-afixo .prefixo { left: 12px; }
.campo-afixo .sufixo { right: 12px; }
.campo-afixo.com-prefixo input { padding-left: 40px; }
.campo-afixo.com-sufixo input { padding-right: 34px; }
.carrinho .item .campo-afixo { width: 128px; flex: none; }
.carrinho .item .campo-afixo input { width: 100%; }
.x:focus-visible, .btn:focus-visible, .chip-tam:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
dialog.modal:focus { outline: none; }

/* formulário da peça: seções, tamanhos */
.secao-form { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }
.grade > .secao-form:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.tam-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 44px; }
.chip-tam {
  min-width: 50px; height: 44px; padding: 0 14px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 11px; font-weight: 600; cursor: pointer; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--ink);
}
.chip-tam:hover { border-color: var(--ink-2); }
.chip-tam.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-tam.outro { border-style: dashed; color: var(--accent); font-weight: 500; }
.chip-tam.removivel { cursor: default; padding-right: 6px; }
.chip-tam.removivel button { border: 0; background: rgba(255, 255, 255, .15); color: inherit; width: 26px; height: 26px; border-radius: 7px; cursor: pointer; font-size: 16px; }
.chip-tam.removivel button:hover { background: var(--danger); }
.tam-dica { color: var(--muted); font-size: 14px; margin-right: 4px; }
.tam-editor { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--bg); }
.grades { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.grade-op { text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 3px; color: var(--ink); }
.grade-op:hover { border-color: var(--accent); background: var(--accent-soft); }
.grade-op span { font-size: 12.5px; color: var(--muted); }

/* cadastros */
.lista-cat { display: flex; flex-direction: column; padding: 0 8px 8px; }
.cat-linha { display: grid; grid-template-columns: 190px 1fr auto; gap: 14px; align-items: center; padding: 12px; border-top: 1px solid var(--line); }
.cat-nome { display: flex; flex-direction: column; }
.cat-nome .mudo { font-size: 12.5px; }
.cat-tams { display: flex; flex-wrap: wrap; gap: 6px; }
.add-linha { display: flex; gap: 8px; align-items: center; }
.add-linha input[type=text] { flex: 1; }
.cor-pick { width: 48px; height: 44px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; flex: none; }
.cor-pick.grande { width: 100%; }
.chips-cad { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-cad { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: 14.5px; font-weight: 500; color: var(--ink); }
.chip-cad:hover { border-color: var(--accent); background: var(--accent-soft); }
.chip-cad small { background: var(--surface-2); border-radius: 99px; padding: 1px 7px; font-size: 11.5px; color: var(--ink-2); }
@media (max-width: 700px) { .cat-linha { grid-template-columns: 1fr auto; } .cat-tams { grid-column: 1 / -1; grid-row: 2; } }

.pdv .resultado { max-height: 340px; }
/* embalagem na venda: linhas compactas por categoria */
.emb-cat + .emb-cat { margin-top: 16px; }
.emb-cat-tit { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 8px; }
.emb-linhas { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 8px; }
.emb-linha {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; min-height: 58px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); position: relative; transition: border-color .15s, background .15s;
}
.emb-linha.on { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.emb-linha.on::before { content: ''; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.emb-info { flex: 1; min-width: 0; }
.emb-n { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emb-v { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 2px; }
.emb-est { font-size: 12px; color: var(--muted); margin-top: 1px; }
.emb-est.vermelho { color: var(--danger); font-weight: 600; }
.vars { display: flex; gap: 4px; flex: none; }
.var-chip {
  position: relative; min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); font-weight: 600; font-size: 13px; cursor: pointer; color: var(--ink-2);
}
.var-chip:hover { border-color: var(--ink-2); }
.var-chip.foco { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.var-chip i { position: absolute; top: -7px; right: -7px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: #fff; font: 700 10.5px/17px var(--sans); text-align: center; }
.emb-linha .passo { flex: none; }
.emb-linha .passo button { width: 34px; height: 34px; }
.emb-linha .passo b { min-width: 26px; }
.brinde-caixa { display: flex; flex-direction: column; gap: 8px; }
.brinde-caixa .emb-cat-tit { margin-bottom: 0; }
.brinde-caixa .emb-n { white-space: normal; line-height: 1.25; }
.brinde-caixa .emb-linha { flex-wrap: wrap; }
@media (max-width: 960px) { .emb-linhas { grid-template-columns: 1fr; } }
/* paginação */
.paginacao { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 2px 4px; font-size: 13.5px; }
.card-pag .paginacao { padding: 12px 16px 14px; border-top: 1px solid var(--line); }
.pag-botoes { display: flex; gap: 4px; align-items: center; }
.pag { min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-weight: 600; cursor: pointer; color: var(--ink-2); font-size: 14px; }
.pag:hover:not(:disabled) { border-color: var(--ink-2); }
.pag.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pag:disabled { opacity: .35; cursor: default; }
.pag-ret { color: var(--muted); padding: 0 4px; }

/* item da sacola */
.sac-item { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); margin-bottom: 8px; }
.sac-foto { width: 64px; height: 80px; border-radius: 10px; overflow: hidden; background: var(--surface-2); flex: none; }
.sac-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sac-foto .sem-foto svg { width: 50%; height: 50%; }
.sac-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sac-topo { display: flex; align-items: flex-start; gap: 6px; }
.sac-tit { flex: 1; font-weight: 600; font-size: 15px; line-height: 1.3; word-break: break-word; }
.sac-topo .x { margin: -6px -6px 0 0; flex: none; }
.sac-sub { font-size: 12.5px; color: var(--muted); }
.sac-cod { font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sac-preco { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.sac-valores { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sac-valores b { font: 600 19px var(--serif); }
.sac-valores s { font-size: 13px; }
.selo-desc { display: inline-block; background: var(--olive-soft); color: var(--olive); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.desc-geral { display: flex; gap: 8px; align-items: center; }
.desc-geral .segmentado { flex: none; }
.desc-geral .campo-afixo, .desc-geral input { flex: 1; }
.desc-preview { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.desc-preview b { font: 600 24px var(--serif); }
.sac-vazia { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 22px 12px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); font-size: 13.5px; }
.sac-vazia svg { width: 34px; height: 34px; color: #c9bcad; }
.sac-vazia b { color: var(--ink-2); font-size: 15px; }
/* venda em etapas */
.etapa-cab { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.etapa-cab h2 { margin: 0; font-size: 19px; }
.etapa-cab p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.etapa-n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: 14px; margin-top: 1px; }
.car-sec { padding: 14px 0; border-top: 1px solid var(--line); }
.car-sec:first-child { margin-top: 6px; }
.car-tit { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 8px; }
.segmentado.largo { display: flex; width: 100%; }
.segmentado.largo button { flex: 1; padding: 10px 8px; }
.pg-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.pg-op { padding: 10px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--ink-2); }
.pg-op:hover { border-color: var(--ink-2); }
.pg-op.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.resumo-venda { margin-top: 4px; padding: 14px 16px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.resumo-venda .total-linha { font-size: 14px; color: var(--ink-2); }
.resumo-venda .total-linha.grande { color: var(--ink); font-size: 26px; }
.lucro-est { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.lucro-est div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; display: flex; flex-direction: column; }
.lucro-est span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.lucro-est b { font-size: 16px; }
.lucro-est small { font-size: 11px; color: var(--muted); }
.lucro-est div:last-child { background: var(--olive-soft); border-color: transparent; }
.lucro-est div:last-child b { color: var(--olive); }
.lucro-est.neg div:last-child { background: var(--danger-soft); }
.lucro-est.neg div:last-child b { color: var(--danger); }
.emb-duas { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.col-tit { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 15px; padding-bottom: 8px; margin-bottom: 10px; border-bottom: 2px solid var(--ink); }
.col-tit span { font-size: 13px; color: var(--muted); font-weight: 600; }
.emb-col .emb-linhas { grid-template-columns: 1fr; }
.brinde-col { background: var(--bg); border-radius: 14px; padding: 12px; border: 1px solid var(--line); }
@media (max-width: 1180px) { .emb-duas { grid-template-columns: 1fr; } }

/* custos da venda */
.custos-venda { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.custos-tit { padding: 12px 16px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); background: var(--bg); border-bottom: 1px solid var(--line); }
.tabela-custos td { padding: 8px 16px; font-size: 14px; }
.tabela-custos tr.cg td { background: var(--surface-2); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); padding-top: 9px; padding-bottom: 9px; }
.tabela-custos td:nth-child(2) { font-size: 13px; }
.custos-resumo { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.custos-resumo div { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.custos-resumo div + div { border-left: 1px solid var(--line); }
.custos-resumo span { font-size: 12.5px; color: var(--muted); }
.custos-resumo b { font: 600 20px var(--serif); }
.custos-resumo .lucro { background: var(--olive-soft); }
.custos-resumo .lucro b { color: var(--olive); }
.custos-resumo .lucro.neg { background: var(--danger-soft); }
.custos-resumo .lucro.neg b { color: var(--danger); }
.custos-resumo small { font-size: 12px; color: var(--ink-2); font-weight: 600; }

/* compras */
.compra-itens { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--bg); }
.compra-cab, .compra-linha { display: grid; grid-template-columns: minmax(0, 2.2fr) 120px 140px 120px 36px; gap: 10px; align-items: center; }
.compra-cab { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 2px 8px; }
.compra-linha { margin-bottom: 8px; }
.compra-real { display: flex; flex-direction: column; font-size: 14px; line-height: 1.2; }
.compra-real small { font-size: 11.5px; color: var(--muted); }
.compra-rodape { margin-top: 16px; }
.compra-total { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); display: flex; flex-wrap: wrap; gap: 6px 24px; align-items: baseline; }
.compra-total div { display: flex; gap: 8px; align-items: baseline; }
.compra-total .grande { margin-left: auto; font: 600 22px var(--serif); }
.compra-total .grande span { font-size: 15px; font-family: var(--sans); font-weight: 500; }
.sug-linha { cursor: pointer; gap: 14px; }
.sug-linha input[type=checkbox] { width: 20px; height: 20px; flex: none; }
.sug-qtd { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sug-qtd input { width: 80px; min-height: 38px; text-align: center; font-weight: 600; }
.compra-hist { gap: 14px; }
.compra-un { color: var(--ink-2); font-weight: 500; }
.compra-cab, .compra-linha { grid-template-columns: minmax(0, 2fr) 120px 140px 150px 36px; }
@media (max-width: 760px) {
  .compra-cab { display: none; }
  .compra-linha { grid-template-columns: 1fr 1fr 36px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
  .compra-linha .sel { grid-column: 1 / -1; }
  .compra-real { grid-column: 1 / 3; }
  .compra-hist { flex-wrap: wrap; }
}
.leva { font-size: 12.5px; color: var(--accent); margin-top: 2px; }
.leva.mudo { color: var(--muted); }
.acomp-caixa { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--bg); }
.acomp-linha { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; margin-bottom: 10px; }

/* ---------- barras ---------- */
.barras { display: flex; align-items: flex-end; gap: 6px; height: 130px; padding-top: 10px; }
.barras .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.barras .b div { width: 100%; max-width: 28px; background: var(--accent); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.barras .b.zero div { background: var(--line); }
.barras .b span { font-size: 11px; color: var(--muted); }
.cat { margin-bottom: 12px; }
.cat .l { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px; }
.cat .trilho { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.cat .trilho div { height: 100%; border-radius: 99px; }

/* ---------- modal: cabeçalho e rodapé fixos, conteúdo rola no meio ---------- */
dialog.modal {
  border: 0; padding: 0; border-radius: 20px; background: var(--surface); color: var(--ink);
  width: min(580px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain;
  box-shadow: 0 24px 70px rgba(30, 40, 15, .28);
}
dialog.modal.largo { width: min(860px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(35, 43, 27, .5); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: modalIn .16s ease-out; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal-in { padding: 0 26px; }
.modal-in > :not(.modal-cab):not(.modal-pe):first-child { margin-top: 24px; }
.modal-cab {
  position: sticky; top: 0; z-index: 6; background: var(--surface);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 20px 0 14px; margin-bottom: 18px; border-bottom: 1px solid var(--line);
}
.modal-cab h2 { font-size: 21px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.modal-cab .x { width: 38px; height: 38px; background: var(--surface-2); flex: none; }
.modal-pe {
  position: sticky; bottom: 0; z-index: 6; background: var(--surface);
  display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  padding: 14px 0 20px; margin-top: 22px; border-top: 1px solid var(--line);
}
.modal-pe .esq { margin-right: auto; }
.modal-in > .modal-pe:last-child { margin-bottom: 0; }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1000; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 500; animation: sobe .2s ease-out; }
.toast.erro { background: var(--danger); color: #fff; }
.toast.com-acao { pointer-events: auto; display: flex; align-items: center; gap: 14px; }
.toast.com-acao button { border: 0; background: var(--accent); color: #fff; font-weight: 600; padding: 7px 12px; border-radius: 8px; cursor: pointer; }
.cod-auto { display: inline-block; font: 700 14px var(--sans); letter-spacing: .04em; background: var(--surface-2); border: 1px solid var(--line); padding: 3px 10px; border-radius: 8px; vertical-align: middle; color: var(--ink-2); }
@keyframes sobe { from { opacity: 0; transform: translateY(8px); } }

/* ---------- conta e usuários ---------- */
#conta-caixa { margin-top: auto; padding: 0 4px; }
#conta-caixa + .rodape-nav { margin-top: 10px; }
.conta-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); cursor: pointer; font-weight: 600; color: var(--ink); }
.conta-btn:hover { border-color: var(--verde); }
.conta-av { width: 32px; height: 32px; border-radius: 50%; background: var(--verde); color: var(--creme-2); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.conta-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conta-topo { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.conta-acoes { display: flex; flex-direction: column; gap: 8px; }
.conta-op { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; text-decoration: none; color: var(--ink); }
.conta-op:hover { border-color: var(--verde); background: var(--accent-soft); }
.conta-op span { font-size: 13px; color: var(--muted); }
.conta-op.sair b { color: var(--danger); }
.aviso-senha { background: var(--gold-soft); border: 1px solid #e9d892; border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.forca { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.forca i { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }
.forca[data-n="1"] i { width: 33%; background: var(--danger); }
.forca[data-n="2"] i { width: 66%; background: var(--gold); }
.forca[data-n="3"] i { width: 100%; background: var(--olive); }
.usu-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.usu-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.usu-card.desat { opacity: .65; }
.usu-topo { display: flex; align-items: center; gap: 12px; }
.usu-info { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--ink-2); }
.usu-acoes { border-top: 1px solid var(--line); padding-top: 12px; }
.cred-box { display: grid; gap: 8px; padding: 14px 16px; border-radius: 14px; background: var(--bg); border: 1px dashed var(--verde); margin: 12px 0; }
.cred-box div { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cred-box span { color: var(--muted); font-size: 13px; }
.cred-box b { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 15px; user-select: all; }
.senha-gerar { display: flex; gap: 8px; }
.senha-gerar input { flex: 1; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; }
@media (min-width: 961px) and (max-width: 1280px) { .conta-nome { display: none; } .conta-btn { justify-content: center; padding: 8px 4px; } }
@media (max-width: 960px) {
  #conta-caixa { margin: 0; padding: 0; display: flex; align-items: center; }
  .conta-btn { flex-direction: column; gap: 2px; padding: 4px 6px; border: 0; background: transparent; font-size: 10.5px; font-weight: 500; width: auto; }
  .conta-av { width: 26px; height: 26px; font-size: 11px; }
}

/* ---------- janela de peça em blocos ---------- */
.fp { display: flex; flex-direction: column; gap: 14px; }
.fp-bloco { border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; background: var(--surface); }
.fp-tit { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--verde); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.fp-tit::before { content: ''; width: 14px; height: 14px; border-radius: 4px; background: var(--listras); background-size: 8px 100%; }
.fp-topo { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; background: var(--bg); }
.fp-foto { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fp-foto .foto-campo { width: 150px; }
.fp-foto .foto-campo .dica { font-size: 13px; }
.fp-ident { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fp-3 { --cols: 3; }
.origem-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.origem-toggle label { position: relative; }
.origem-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.origem-toggle span { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; }
.origem-toggle span b { font-size: 15px; }
.origem-toggle span small { font-size: 12.5px; color: var(--muted); }
.origem-toggle input:checked + span { border-color: var(--verde); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--verde); }
.origem-toggle input:disabled + span { opacity: .6; cursor: not-allowed; }
.prev-lucro { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; font-size: 13.5px; }
.prev-lucro:empty { display: none; }
.prev-lucro > div { flex: 1; min-width: 150px; display: flex; flex-direction: column; padding: 10px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.prev-lucro span { font-size: 12px; color: var(--muted); font-weight: 600; }
.prev-lucro b { font: 600 20px var(--serif); }
.prev-lucro small { font-size: 12px; color: var(--ink-2); }
.prev-lucro .voce { background: var(--olive-soft); border-color: transparent; }
.prev-lucro .voce b { color: var(--olive); }
.prev-lucro .voce.neg { background: var(--danger-soft); }
.prev-lucro .voce.neg b { color: var(--danger); }
.modal-cab .selo { font-family: var(--sans); font-size: 12px; }
@media (max-width: 700px) {
  .fp-topo { grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
  .fp-foto .foto-campo { width: 110px; }
  .fp-3 { --cols: 1; }
}
@media (max-width: 480px) { .fp-topo { grid-template-columns: 1fr; } .origem-toggle { grid-template-columns: 1fr; } }

/* ---------- reserva ---------- */
.reserva-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 18px; border-radius: 14px; background: var(--gold-soft); border: 1px solid #e9d892; font-size: 14px; }
.reserva-pecas { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.reserva-peca { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.reserva-peca .t { font-weight: 600; }
.reserva-peca .s { font-size: 12.5px; color: var(--muted); }
.txt-reserva { color: var(--gold); }

/* ---------- fiado ---------- */
.pg-op.fiado.on { background: var(--gold); border-color: var(--gold); color: #fff; }
.fiado-box { margin-top: 12px; padding: 14px; border-radius: 14px; background: var(--gold-soft); border: 1px solid #e9d892; }
.fiado-aviso { background: var(--danger-soft); color: var(--danger); font-weight: 600; font-size: 13px; padding: 8px 10px; border-radius: 9px; margin-bottom: 10px; }
.parc-grade { display: flex; flex-wrap: wrap; gap: 6px; }
.parc-grade .pg-op { min-width: 52px; padding: 8px 10px; }
.parc-prev { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow: auto; }
.parc-prev div { display: grid; grid-template-columns: 48px 1fr auto; gap: 8px; font-size: 13.5px; padding: 6px 10px; background: var(--surface); border-radius: 8px; }
.pg-radio { position: relative; }
.pg-radio input { position: absolute; opacity: 0; }
.pg-radio span { display: block; text-align: center; padding: 10px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.pg-radio input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.parc-vencida td { background: color-mix(in srgb, var(--danger-soft) 55%, transparent); }

/* ---------- perfil da cliente ---------- */
.cli-cab { display: flex; align-items: center; gap: 18px; margin: 12px 0 18px; flex-wrap: wrap; }
.cli-avatar { width: 68px; height: 68px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 600 26px var(--serif); flex: none; }
.cli-cab h1 { font-size: 28px; }
.cli-contatos { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; margin-top: 4px; }
.cli-contatos a { color: var(--accent); font-weight: 600; text-decoration: none; }
.cli-obs { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); white-space: pre-wrap; }
.kpi-alerta { background: var(--danger-soft); border-color: #f0c4c0; }
.kpi-alerta .val { color: var(--danger); }
.kpi-aviso { background: var(--gold-soft); border-color: #e9d892; }
.cli-gosto { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 18px; }
.cli-gosto div { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cli-gosto span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-right: 4px; }
.cli-compras { display: flex; flex-direction: column; gap: 12px; }
.cli-compra { overflow: hidden; }
.cli-compra-cab { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.cli-compra-total { font: 600 19px var(--serif); }
.cli-pecas { padding: 6px 16px; }
.cli-peca { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.cli-peca + .cli-peca { border-top: 1px dashed var(--line); }
.cli-peca .t { font-weight: 600; }
.cli-peca .s { font-size: 12.5px; color: var(--muted); }
.cli-compra-rodape { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.cli-compra-rodape .btn { margin-left: auto; }

/* ---------- toque (iPad): alvos maiores ---------- */
@media (pointer: coarse) {
  .btn.peq { min-height: 40px; padding: 0 14px; }
  .passo button, .emb-linha .passo button { width: 42px; height: 42px; }
  .var-chip { min-width: 40px; height: 40px; }
  .x { width: 40px; height: 40px; }
  .pag { min-width: 42px; height: 42px; }
  .painel-lista .op { padding: 13px 14px; }
}

/* ---------- iPad na horizontal / telas médias: menu lateral compacto ---------- */
@media (min-width: 961px) and (max-width: 1280px) {
  :root { --nav-w: 92px; }
  .nav { padding: 14px 8px; gap: 12px; }
  .marca { margin: -14px -8px 0; padding-bottom: 6px; }
  .marca .logotipo { display: none; }
  .marca .selo-logo { display: block; }
  .nav nav a { flex-direction: column; gap: 4px; padding: 9px 4px; font-size: 11px; text-align: center; line-height: 1.15; }
  .nav nav a.destaque { margin: 2px 0 6px; }
  .contador { position: absolute; top: 4px; right: 10px; height: 17px; min-width: 17px; font-size: 10px; padding: 0 4px; }
  .rodape-nav { padding: 0; text-align: center; }
  #ipad-url, .so-largo { display: none; }
  main { padding: 24px 22px 50px; }
  .pdv { grid-template-columns: minmax(0, 1fr) 370px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- responsivo (iPad retrato / telas menores) ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pdv { grid-template-columns: 1fr 360px; }
}
@media (max-width: 960px) {
  :root { --nav-w: 0px; }
  .nav {
    inset: auto 0 0 0; width: auto; height: auto; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line);
  }
  .marca, .rodape-nav { display: none; }
  .nav nav { flex-direction: row; flex: 1; justify-content: space-around; }
  .nav nav a { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 11.5px; flex: 1; }
  .nav nav a.destaque { margin: 0; }
  .contador { position: absolute; top: 2px; right: calc(50% - 22px); height: 17px; min-width: 17px; font-size: 10px; padding: 0 4px; }
  .pedidos { grid-template-columns: 1fr; }
  main { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .dupla, .pdv { grid-template-columns: 1fr; }
  .carrinho { position: static; }
  .pdv .resultado { max-height: 46vh; }
  .form-peca { grid-template-columns: 1fr; }
  .form-peca .foto-campo { max-width: 170px; margin: 0 auto; width: 100%; }
  h1 { font-size: 26px; }
}
@media (max-width: 560px) {
  .grade { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .kpi .val { font-size: 22px; }
  .vitrine { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .nav nav a span { font-size: 9.5px; }
  .nav nav a { padding: 6px 1px; }
}
