/* Identidade Vieira Júnior Alimentos: verde institucional + régua de listras (marrom → amarelo) */
:root {
  --green: #004621;
  --green-2: #0a6a36;
  --green-soft: #e7f1eb;
  --s1: #603913; --s2: #be1e2d; --s3: #ed1c24; --s4: #ef4136;
  --s5: #f15a29; --s6: #f7941e; --s7: #f6b454; --s8: #ffcb05;
  --orange: #f7941e;
  --red: #c8202f;
  --bg: #f6f5f1;
  --card: #ffffff;
  --ink: #1d2a22;
  --muted: #6b766f;
  --line: #e3e3dc;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.05);
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { min-height: 100vh; font-size: 15px; line-height: 1.4; }
a { color: var(--green-2); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.5rem; font-weight: 800; color: var(--green); }
h2 { font-size: 1.1rem; font-weight: 800; color: var(--green); }
h3 { font-size: .95rem; font-weight: 800; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.stripes { height: 6px; background: linear-gradient(90deg, var(--s1) 0 12.5%, var(--s2) 0 25%, var(--s3) 0 37.5%, var(--s4) 0 50%, var(--s5) 0 62.5%, var(--s6) 0 75%, var(--s7) 0 87.5%, var(--s8) 0); }

/* ---------- topo ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: #fff; box-shadow: 0 1px 0 var(--line); }
.topbar-in { display: flex; align-items: center; gap: 16px; padding: 8px 20px; max-width: 1400px; margin: 0 auto; }
.topbar .logo { height: 42px; mix-blend-mode: multiply; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { white-space: nowrap; text-decoration: none; color: var(--ink); font-weight: 700; padding: 8px 12px; border-radius: 999px; font-size: .92rem; }
.nav a:hover { background: var(--green-soft); }
.nav a.active { background: var(--green); color: #fff; }
.nav a.cta { background: var(--orange); color: #fff; }
.nav a.cta.active { background: var(--s5); }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: .85rem; white-space: nowrap; }
.user-chip .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 800; }

main { max-width: 1400px; margin: 0 auto; padding: 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- cartões, formulários ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card > h2 { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--orange); color: #fff; font-size: .8rem; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: .8rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
input, select, textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: 9px; padding: 10px 12px; width: 100%; min-height: 44px;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(11,106,63,.15); }
input[type=number] { -moz-appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input:disabled { background: #f1f1ec; color: var(--muted); }
label.req { }

/* segmentado (botões de escolha) */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { flex: 1 1 auto; min-height: 44px; border: 1.5px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 12px; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink); }
.seg button:hover { border-color: var(--green-2); }
.seg button.on { background: var(--green); border-color: var(--green); color: #fff; }
.seg button.on.warn { background: var(--s5); border-color: var(--s5); }
.seg button small { display: block; font-weight: 600; opacity: .8; font-size: .72rem; }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 10px; border: 1.5px solid transparent; font: inherit; font-weight: 800; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-2); }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: var(--s5); }
.btn-wa { background: #1fa855; color: #fff; }
.btn-wa:hover { background: #178a45; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--green-2); color: var(--green); }
.btn-danger { background: #fff; border-color: #f0c4c8; color: var(--red); }
.btn-danger:hover { background: #fdf0f1; }
.btn-sm { min-height: 34px; padding: 6px 10px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { background: none; border: none; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--muted); font-size: 1.1rem; line-height: 1; }
.icon-btn:hover { background: #f1f1ec; color: var(--red); }

/* ---------- combobox (busca de produto / fornecedor) ---------- */
.combo { position: relative; }
.combo input { padding-left: 38px; }
.combo .lupa { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1.5px solid var(--green-2); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15); max-height: 360px; overflow-y: auto; }
.combo-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid #f0f0ea; }
.combo-opt:last-child { border-bottom: none; }
.combo-opt.hl, .combo-opt:hover { background: var(--green-soft); }
.combo-opt .sku { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; background: #f1f1ec; padding: 2px 6px; border-radius: 5px; color: var(--green); font-weight: 700; white-space: nowrap; }
.combo-opt .nm { flex: 1; font-weight: 700; }
.combo-opt .meta { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.combo-opt mark { background: #ffe9a8; color: inherit; border-radius: 2px; }
.combo-opt.new { color: var(--s5); font-weight: 800; }
.combo-empty { padding: 12px; color: var(--muted); font-size: .9rem; }
.selected-box { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--green-2); background: var(--green-soft); border-radius: 9px; padding: 8px 12px; min-height: 44px; }
.selected-box .nm { font-weight: 800; flex: 1; }

/* ---------- itens do pedido ---------- */
.item { border: 1.5px solid var(--line); border-radius: 11px; padding: 12px; margin-top: 10px; background: #fff; }
.item.err { border-color: var(--red); }
.item-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.item-head .idx { width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; }
.item-head .nm { font-weight: 800; flex: 1; }
.item-grid { display: grid; grid-template-columns: 90px 110px 100px 130px 130px 1fr; gap: 10px; align-items: end; padding-bottom: 14px; }
.item-grid label.f { position: relative; }
.unit-def { position: absolute; left: 0; top: 100%; margin-top: 2px; font-size: 11px; white-space: nowrap; font-weight: 400; }
@media (max-width: 1000px) { .item-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 480px) { .item-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.item-sale { margin-top: 10px; padding: 10px 12px; background: #fff4e5; border: 1px dashed #f0b56a; border-radius: 10px; display: grid; grid-template-columns: 130px 130px 1fr; gap: 10px; align-items: end; }
.item-sale .gain { font-size: .88rem; line-height: 1.45; padding-bottom: 4px; }
@media (max-width: 640px) { .item-sale { grid-template-columns: 1fr 1fr; } .item-sale .gain { grid-column: 1 / -1; } }
.pos { color: #0a7a36; }
.neg { color: #c62828; }
.sale { color: #7a3e00; }
input.warn-input { border-color: #c62828 !important; background: #fdecea; }
.install-steps { margin: 6px 0 0; padding-left: 20px; line-height: 1.7; }
.install-steps .ico { display: inline-block; padding: 0 6px; border: 1px solid #ccc; border-radius: 6px; font-size: .85em; }
.item-total { text-align: right; }
.item-total .v { font-size: 1.15rem; font-weight: 800; color: var(--green); }
.item-dest { margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.item-dest .lbl { font-size: .75rem; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.chip.on { background: var(--green); color: #fff; border-color: var(--green); }
.chip.split { border-style: dashed; color: var(--s5); border-color: var(--s6); }
.chip.split.on { background: var(--s6); color: #fff; border-style: solid; }
.split-box { margin-top: 10px; background: #fff8ec; border: 1.5px dashed var(--s7); border-radius: 10px; padding: 10px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)) auto; gap: 8px; align-items: end; }
@media (max-width: 700px) { .split-box { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.split-box .rest { font-weight: 800; font-size: .9rem; white-space: nowrap; padding-bottom: 12px; }
.split-box .rest.bad { color: var(--red); }
.split-box .rest.ok { color: var(--green-2); }
.hist { margin-top: 8px; font-size: .8rem; color: var(--muted); }
.hist b { color: var(--ink); }

.totals-bar { position: sticky; bottom: 0; z-index: 15; background: var(--green); color: #fff; border-radius: 14px 14px 0 0; padding: 12px 20px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; box-shadow: 0 -6px 20px rgba(0,0,0,.12); }
.totals-bar .t { display: flex; flex-direction: column; }
.totals-bar .t span { font-size: .72rem; text-transform: uppercase; opacity: .8; font-weight: 700; }
.totals-bar .t b { font-size: 1.25rem; }
.totals-bar .grow { flex: 1; }
.totals-bar .btn-orange { min-width: 180px; font-size: 1.05rem; }

/* ---------- tabelas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid #efefe9; vertical-align: top; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fafaf6; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 800; border-top: 2px solid var(--line); border-bottom: none; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.b-green { background: var(--green-soft); color: var(--green); }
.b-orange { background: #fff0dc; color: #b35d00; }
.b-red { background: #fde8ea; color: var(--red); }
.b-gray { background: #efefe9; color: var(--muted); }
.b-blue { background: #e6eefb; color: #2453a6; }

/* filtros */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; border-left: 5px solid var(--green); }
.kpi:nth-child(2) { border-left-color: var(--s6); }
.kpi:nth-child(3) { border-left-color: var(--s3); }
.kpi:nth-child(4) { border-left-color: var(--s8); }
.kpi:nth-child(5) { border-left-color: var(--s1); }
.kpi span { font-size: .75rem; text-transform: uppercase; font-weight: 800; color: var(--muted); }
.kpi b { display: block; font-size: 1.45rem; color: var(--ink); margin-top: 2px; }
.bars .row { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr auto; gap: 10px; align-items: center; padding: 6px 0; }
.bars .track { background: #f1f1ec; border-radius: 6px; height: 14px; overflow: hidden; }
.bars .fill { height: 100%; background: var(--green-2); border-radius: 6px; }
.bars .val { font-weight: 800; font-size: .88rem; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bars .lab { font-weight: 700; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* detalhe pedido */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 20px; }
.info-grid div > span:first-child { display: block; font-size: .72rem; text-transform: uppercase; font-weight: 800; color: var(--muted); }
.info-grid div b { font-size: 1rem; }
pre.wa { white-space: pre-wrap; background: #e9f7ee; border-radius: 10px; padding: 14px; font-family: inherit; font-size: .9rem; margin: 0; max-height: 420px; overflow: auto; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #fff 0%, var(--bg) 60%); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.1); overflow: hidden; }
.login-card .in { padding: 28px; display: grid; gap: 14px; }
.login-card .logo { display: block; width: 200px; margin: 0 auto 6px; mix-blend-mode: multiply; }

/* modal + toast */
.modal-bg { position: fixed; inset: 0; background: rgba(15,30,20,.45); z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal .mh { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal .mb { padding: 20px; display: grid; gap: 14px; }
.modal .mf { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
#toasts { position: fixed; top: 70px; right: 16px; z-index: 200; display: grid; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: 360px; font-weight: 700; animation: tin .2s ease-out; }
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }
@keyframes tin { from { transform: translateY(-8px); opacity: 0; } }
.alert { padding: 10px 14px; border-radius: 10px; font-size: .9rem; font-weight: 700; }
.alert-warn { background: #fff4e0; color: #8a4b00; border: 1px solid #ffd79a; }
.alert-info { background: var(--green-soft); color: var(--green); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

@media (max-width: 700px) {
  main { padding: 12px; }
  .topbar-in { padding: 6px 12px; gap: 10px; flex-wrap: wrap; }
  .topbar .logo { height: 34px; }
  .nav { order: 3; width: 100%; flex: none; }
  .user-chip .nm { display: none; }
  .card { padding: 14px; }
  .totals-bar { gap: 14px; padding: 10px 14px; }
  .totals-bar .btn-orange { width: 100%; }
  .hide-sm { display: none; }
}
@media print {
  .topbar, .page-head .actions, .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* Tipografia do manual: Advent (títulos / números) */
h1, h2, h3, .kpi b, .totals-bar .t b, .item-total .v, .nav a, .btn { font-family: 'Advent Pro', 'Nunito', system-ui, sans-serif; }
h1 { font-size: 1.75rem; letter-spacing: .01em; }
h2 { font-size: 1.3rem; }
.kpi b { font-size: 1.7rem; }

/* ---------- seleção de pedidos ---------- */
th.chk, td.chk { width: 36px; text-align: center; }
td.chk input, th.chk input { width: 20px; height: 20px; min-height: 0; accent-color: var(--green); cursor: pointer; }
.link-btn { background: none; border: none; padding: 0 0 0 6px; color: var(--s5); font: inherit; font-size: .75rem; font-weight: 700; cursor: pointer; text-decoration: underline; }
.selbar { position: sticky; bottom: 0; z-index: 15; background: var(--green); color: #fff; border-radius: 14px 14px 0 0; padding: 12px 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; box-shadow: 0 -6px 20px rgba(0,0,0,.15); }
.selbar .grow { flex: 1; }
.selbar .info b { font-size: 1.2rem; }
.selbar .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }

/* ---------- folha de impressão ---------- */
.print-sheet { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.ps-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.ps-head img { height: 48px; }
.ps-head .grow { flex: 1; }
.ps-legend { display: flex; gap: 8px; flex-wrap: wrap; font-size: .8rem; font-weight: 800; }
.ps-group { margin-top: 18px; break-inside: avoid-page; }
.ps-sup { display: flex; align-items: center; gap: 12px; background: #ffe9c7; border-top: 3px solid var(--orange); padding: 8px 12px; border-radius: 6px 6px 0 0; }
.ps-sup .grow { flex: 1; }
.ps-sup b { font-size: 1.1rem; color: var(--green); text-transform: uppercase; }
.print-sheet table { font-size: .82rem; }
.print-sheet th { background: var(--green); color: #fff; padding: 6px 8px; }
.print-sheet td { padding: 5px 8px; border: 1px solid #e3e3dc; }
.print-sheet tbody tr:nth-child(even) td { background: #f9f9f6; }
.print-sheet tfoot td { background: #eff5f1; border: 1px solid #e3e3dc; }
.print-sheet .q, .ps-legend .q { color: #1f4fa8; font-weight: 800; }
.print-sheet .p, .ps-legend .p { color: #0a7a36; font-weight: 800; }
.nf { display: inline-block; padding: 4px 10px; border-radius: 6px; font-weight: 800; font-size: .8rem; white-space: nowrap; }
.nf-yes { background: #c8efd0; color: #0a5c2a; }
.nf-no { background: #e53935; color: #fff; }
.nf-rom { background: #e0e0e0; color: #555; }
.ps-total { margin-top: 18px; background: var(--green); color: #fff; padding: 12px 16px; border-radius: 8px; font-size: 1.1rem; text-align: right; }

@media print {
  @page { size: A4 landscape; margin: 8mm; }
  main { padding: 0; max-width: none; }
  .print-sheet { box-shadow: none; padding: 0; }
  .selbar, #toasts { display: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-sheet thead { display: table-header-group; }
}
@media (max-width: 700px) {
  .selbar { padding: 10px 12px; gap: 6px; }
  .selbar .info { width: 100%; }
  .selbar .grow { display: none; }
  .selbar .btn { flex: 1 1 45%; min-height: 38px; padding: 6px 8px; font-size: .9rem; }
}

/* ---------- relatórios / gráficos ---------- */
.kpi small { display: block; font-size: .78rem; color: var(--muted); margin-top: 2px; }
.rep-hint { margin: -6px 0 10px; }
.viz-empty { padding: 24px; text-align: center; color: var(--muted); font-size: .9rem; }
.viz { display: block; max-width: 100%; overflow: visible; font-family: 'Nunito', system-ui, sans-serif; }
.viz .grid { stroke: #ecece6; stroke-width: 1; }
.viz .base { stroke: #c9c9c1; stroke-width: 1; }
.viz .ax { fill: var(--muted); font-size: 11px; }
.viz .lbl { fill: var(--ink); font-size: 11px; font-weight: 800; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.viz .hit { fill: transparent; cursor: crosshair; }
.viz .hit:hover { fill: rgba(0,70,33,.06); }
.viz-tip { position: fixed; z-index: 300; pointer-events: none; display: none; background: #1d2a22; color: #fff; font-size: .82rem; line-height: 1.45; padding: 8px 11px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 300px; }
.viz-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.viz-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.vb { display: grid; gap: 2px; }
.vb-row { display: grid; grid-template-columns: minmax(110px, 34%) 1fr auto; gap: 10px; align-items: center; padding: 5px 4px; border-radius: 6px; }
.vb-row:hover { background: #f6f6f1; }
.vb-row.clickable { cursor: pointer; }
.vb-lab { font-size: .88rem; font-weight: 700; min-width: 0; }
.vb-lab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vb-lab small { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vb-tag { font-style: normal; font-size: .68rem; font-weight: 800; padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.vb-tag.up { background: var(--green-soft); color: var(--green); }
.vb-tag.down { background: #fff0dc; color: #8a4b00; }
.vb-track { height: 14px; background: #f1f1ec; border-radius: 0 4px 4px 0; }
.vb-track.stack { display: flex; gap: 2px; background: transparent; height: 20px; }
.vb-fill { height: 100%; border-radius: 0 4px 4px 0; }
.vb-seg { height: 100%; min-width: 3px; display: grid; place-items: center; color: #fff; font-size: .7rem; cursor: default; }
.vb-seg:first-child { border-radius: 0; }
.vb-seg:last-child { border-radius: 0 4px 4px 0; }
.vb-seg b { text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.vb-val { font-size: .85rem; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.rep-table td { font-size: .86rem; }
.pr-min { color: #0a7a36; font-weight: 800; white-space: nowrap; }
.pr-max { color: #c8202f; font-weight: 800; white-space: nowrap; }
.mini { display: inline-block; width: 60px; height: 8px; background: #f1f1ec; border-radius: 4px; margin-right: 6px; vertical-align: middle; overflow: hidden; }
.mini div { height: 100%; background: var(--green-2); }
@media (max-width: 560px) { .vb-row { grid-template-columns: 1fr auto; } .vb-row .vb-track { grid-column: 1 / -1; grid-row: 2; } }
@media print { .rep-opts, #fcard { display: none !important; } .card { break-inside: avoid; } }

/* ---------- histórico de edições ---------- */
details.edit { border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-top: 10px; background: #fff; }
details.edit[open] { border-color: var(--s7); background: #fffdf8; }
details.edit summary { cursor: pointer; list-style-position: inside; }
table.diff { margin-top: 10px; font-size: .86rem; }
table.diff td { border-bottom: 1px solid #efefe9; }
table.diff td.del { background: #fdecee; color: #8f1d27; text-decoration: line-through; text-decoration-color: rgba(143,29,39,.4); }
table.diff td.ins { background: #e8f6ec; color: #0a5c2a; font-weight: 700; }
.vt-wrap { margin-top: 12px; }
.vt-wrap h3 { margin-bottom: 6px; }
table.vt { font-size: .8rem; }
table.vt td, table.vt th { padding: 5px 6px; }
tr.vt-del td { background: #fdecee; }
tr.vt-ins td { background: #e8f6ec; }

/* conferente: sem preço de custo, totais em R$ e pagamento */
body.hide-prices .pc { display: none !important; }
