:root {
  --primary-color: #0487dd;
  --primary-dark:  #0370b8;
  --primary-tint:  #eff6ff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f5f0eb;
  color: #1a1a1a;
  min-height: 100vh;
}

/* ── Header ── */
.app-header {
  background: #fff;
  border-bottom: 1px solid #e5e0d8;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.app-logo {
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.app-logo img {
  height: 48px;
  width: auto;
}
.app-header h1 { font-size: 1.05rem; font-weight: 700; color: #1a1a1a; }
.app-header p  { font-size: .75rem; color: #8a7d70; margin-top: .1rem; }

/* ── Stepper ── */
.stepper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1.25rem 1rem .75rem;
  background: #fff;
  border-bottom: 1px solid #e5e0d8;
  gap: 0;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 140px;
  position: relative;
}
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 19px;
  left: calc(50% + 22px);
  right: calc(-50% + 22px);
  height: 2px;
  background: #e5e0d8;
  transition: background .3s;
}
.step.done:not(:last-child)::after { background: var(--primary-color); }
.step-circle {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  background: #ede8e2;
  color: #9a8a7a;
  margin-bottom: .4rem;
  transition: background .2s, color .2s;
  z-index: 1;
}
.step.active .step-circle { background: var(--primary-color); color: #fff; }
.step.done   .step-circle { background: var(--primary-color); color: #fff; }
.step-label { font-size: .78rem; font-weight: 700; color: #9a8a7a; text-align: center; }
.step-sub   { font-size: .68rem; color: #b0a090; text-align: center; }
.step.active .step-label,
.step.done   .step-label { color: var(--primary-color); }

/* ── Main ── */
main {
  max-width: 660px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

/* ── Stepper clicável ── */
.step { cursor: pointer; }
.step:hover .step-circle { opacity: .8; }

/* ── Step panels ── */
.step-panel { display: none; flex-direction: column; gap: .9rem; }
.step-panel.active { display: flex; }

/* ── Card ── */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  padding: 1.1rem 1.25rem;
}
.eco-positivo { border-left: 4px solid #2e7d32; }
.eco-positivo .eco-titulo { color: #2e7d32; font-weight: 700; font-size: .9rem; margin-bottom: .75rem; }
.eco-positivo .eco-destaque { color: #2e7d32; font-weight: 600; }
.eco-neutro { border-left: 4px solid #cbd5e1; }
.eco-neutro .eco-titulo { color: #64748b; font-weight: 700; font-size: .9rem; margin-bottom: .75rem; }
.eco-neutro .eco-msg { color: #94a3b8; font-size: .88rem; }
.eco-linha { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: .35rem; }
.eco-linha span { color: #64748b; }

.card-icon-row {
  display: flex; align-items: flex-start; gap: .85rem;
  margin-bottom: .9rem;
}
.card-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.ci-orange { background: var(--primary-tint); }
.ci-green  { background: #e8f5ee; }
.card-icon-title { font-size: .9rem; font-weight: 700; color: #1a1a1a; }
.card-icon-sub   { font-size: .75rem; color: #8a7d70; margin-top: .15rem; line-height: 1.4; }

/* ── Placeholder ── */
::placeholder {
  color: #c0b4a8;
  font-style: italic;
}

/* ── Campos ── */
.field label {
  display: block;
  font-size: .75rem; font-weight: 600;
  color: #5a5050; margin-bottom: .28rem;
}
.field input[type="text"],
.field input[type="number"] {
  width: 100%;
  padding: .58rem .8rem;
  border: 1.5px solid #ddd5cc;
  border-radius: 8px;
  font-size: .92rem;
  background: #fafaf9;
  transition: border-color .2s;
}
.field input:focus { outline: none; border-color: var(--primary-color); }

.fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .7rem;
}
@media (max-width: 400px) {
  .fields-row { grid-template-columns: 1fr; }
}

/* ── Upload ── */
.upload-area {
  border: 2px dashed #d5c8be;
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  position: relative;
  display: flex; align-items: center; gap: .85rem;
  transition: border-color .2s, background .2s;
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--primary-color); background: var(--primary-tint);
}
.upload-area input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-icon-box {
  width: 38px; height: 38px; background: var(--primary-tint);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.upload-text strong { font-size: .88rem; color: #1a1a1a; }
.upload-text p { font-size: .75rem; color: #8a7d70; margin-top: .1rem; }
.upload-arrow { margin-left: auto; font-size: 1.1rem; color: #9a8a7a; }
.upload-hint-mobile {
  display: none;
  font-size: .72rem; color: #8a7d70; line-height: 1.5;
  margin-top: .45rem; padding: .4rem .6rem;
  background: #f8fafc; border-left: 3px solid var(--primary-color);
  border-radius: 0 6px 6px 0;
}
@media (pointer: coarse) {
  .upload-hint-mobile { display: block; }
}
.file-status {
  font-size: .8rem; color: var(--primary-color); font-weight: 600; margin-top: .5rem;
  min-height: 1.1rem;
}

/* ── Row manual ── */
.manual-row { display: flex; gap: .55rem; align-items: flex-end; flex-wrap: wrap; }
.manual-row .field { margin: 0; }
.f-comp { flex: 2; min-width: 95px; }
.f-qtd  { flex: 1; min-width: 65px; }
.f-desc { flex: 3; min-width: 120px; }

.btn-plus {
  width: 40px; height: 40px; flex-shrink: 0;
  background: var(--primary-color); color: #fff;
  border: none; border-radius: 8px;
  font-size: 1.5rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.btn-plus:hover { background: var(--primary-dark); }

/* ── Lista de peças ── */
.list-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .65rem;
}
.list-title { font-size: .88rem; font-weight: 700; color: #1a1a1a; }
.btn-clear {
  background: none; border: none; color: #dc2626;
  font-size: .78rem; cursor: pointer; display: flex; align-items: center; gap: .25rem;
}
.list-empty {
  font-size: .83rem; color: #b0a090; font-style: italic;
  text-align: center; padding: .85rem 0;
}
.peca-item {
  display: flex; align-items: center; gap: .55rem;
  padding: .48rem 0; border-bottom: 1px solid #f0ebe5;
}
.peca-item:last-child { border-bottom: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-h { background: var(--primary-color); }
.dot-m { background: #059669; }
.dot-g { background: #059669; }
.peca-mm  { font-weight: 700; font-size: .92rem; color: #1a1a1a; min-width: 78px; }
.peca-qtd { font-size: .8rem; color: #8a7d70; }
.peca-nome { font-size: .83rem; color: #5a5050; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-rm { background: none; border: none; color: #c4b5aa; font-size: 1rem; cursor: pointer; line-height: 1; }
.btn-rm:hover { color: #dc2626; }
.peca-chk { width: 14px; height: 14px; cursor: pointer; accent-color: #7c6b5e; flex-shrink: 0; }

/* ── Estoque salvo ── */
.estoque-acoes {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; margin-bottom: .75rem;
}
.est-cb-mestre-label {
  display: flex; align-items: center; gap: .4rem;
  font-size: .78rem; font-weight: 600; color: #5a5050;
  cursor: pointer; user-select: none;
}
.est-cb-mestre-label input[type="checkbox"] {
  width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary-color);
}
.est-btn-acao {
  padding: .26rem .62rem;
  font-size: .72rem; font-weight: 600;
  background: #f5f0eb; color: #5a5050;
  border: 1.5px solid #ddd5cc; border-radius: 6px;
  cursor: pointer; transition: background .15s;
}
.est-btn-acao:hover { background: #ede8e2; }
.est-btn-acao.danger { color: #b91c1c; border-color: #fca5a5; background: #fef2f2; }
.est-btn-acao.danger:hover { background: #fee2e2; }
.estoque-item {
  display: flex; align-items: center; gap: .55rem;
  padding: .45rem 0; border-bottom: 1px solid #f0ebe5;
}
.estoque-item:last-child { border-bottom: none; }
.est-cb {
  accent-color: var(--primary-color); width: 16px; height: 16px;
  cursor: pointer; flex-shrink: 0;
}

/* ── Botões de navegação ── */
.nav-row { display: flex; gap: .65rem; align-items: center; margin-top: .25rem; }
.btn-next {
  flex: 1; padding: .88rem 1.5rem;
  background: var(--primary-color); color: #fff;
  border: none; border-radius: 10px;
  font-size: .97rem; font-weight: 700;
  cursor: pointer; transition: background .15s;
}
.btn-next:hover:not(:disabled) { background: var(--primary-dark); }
.btn-next:disabled { background: #ddd5cc; color: #a0908a; cursor: not-allowed; }
.btn-back {
  padding: .88rem 1.1rem;
  background: #fff; color: #5a5050;
  border: 1.5px solid #ddd5cc; border-radius: 10px;
  font-size: .92rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background .15s;
}
.btn-back:hover { background: #f5f0eb; }

/* ── Radio cards ── */
.estrategia-group { display: flex; flex-direction: column; gap: .6rem; }
.estrategia-card { cursor: pointer; }
.estrategia-card input[type="radio"] { display: none; }
.estrategia-card .inner {
  border: 2px solid #e5e0d8; border-radius: 10px;
  padding: .8rem 1rem; transition: border-color .15s, background .15s;
}
.estrategia-card input:checked + .inner { border-color: var(--primary-color); background: var(--primary-tint); }
.e-titulo { font-weight: 700; font-size: .88rem; color: #1a1a1a; margin-bottom: .18rem; }
.estrategia-card input:checked + .inner .e-titulo { color: var(--primary-color); }
.e-desc { font-size: .76rem; color: #8a7d70; line-height: 1.4; }
.estrategia-card.disabled-premium { cursor: not-allowed; pointer-events: none; opacity: .55; }
.premium-badge {
  display: inline-block; font-size: .6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; background: var(--primary-color); color: #fff;
  padding: .1rem .38rem; border-radius: 999px; vertical-align: middle; margin-left: .3rem;
}
.premium-hint {
  font-size: .7rem; color: #8a7d70; font-style: italic;
  margin-top: .35rem; line-height: 1.4;
}

/* ── Cards resumo (etapa 3) ── */
.resumo-grupos { display: flex; flex-direction: column; gap: .6rem; }
.resumo-grid   { display: grid; gap: .65rem; }
.resumo-grid-4 { grid-template-columns: repeat(4, 1fr); }
.resumo-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 460px) {
  .resumo-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .resumo-grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.resumo-secao-sep {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #8a7d70;
  padding-top: .5rem; border-top: 1.5px solid #e5e0d8;
}
.resumo-card {
  background: #fff; border: 1.5px solid #e5e0d8;
  border-radius: 10px; padding: .85rem .65rem; text-align: center;
}
.rc-icon     { font-size: 1.4rem; margin-bottom: .25rem; }
.rc-valor    { font-size: 1.35rem; font-weight: 800; color: #1a1a1a; line-height: 1; }
.rc-label    { font-size: .7rem; color: #8a7d70; margin-top: .2rem; }
.rc-valor-ok { color: #15803d !important; }

/* ── Resumo barra (etapa Material) ── */
.barra-resumo-info {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem;
  padding: .55rem .75rem;
  background: #f9f6f2; border-radius: 8px; border: 1.5px solid #e5e0d8;
}
.barra-resumo-valores { font-size: .88rem; font-weight: 700; color: #1a1a1a; }
.btn-link-config {
  font-size: .75rem; font-weight: 600; color: var(--primary-color);
  background: none; border: none; cursor: pointer; padding: 0;
  text-decoration: underline; white-space: nowrap;
}
.btn-link-config:hover { opacity: .75; }
.aviso-simples {
  font-size: .78rem; color: #92400e;
  background: #fef3c7; border: 1px solid #fcd34d;
  border-radius: 7px; padding: .45rem .65rem; margin-top: .55rem;
}

/* ── Chips ── */
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  background: #e8f5ee; color: #15803d;
  font-size: .78rem; font-weight: 600;
  padding: .22rem .6rem; border-radius: 999px;
}

/* ── Bar cards ── */
.bar-card { border: 1.5px solid #e5e0d8; border-radius: 10px; overflow: hidden; margin-bottom: .7rem; }
.bar-card:last-child { margin-bottom: 0; }
.bar-card-header {
  display: flex; align-items: center; gap: .55rem;
  padding: .6rem .9rem; background: #fafaf7; flex-wrap: wrap;
}
.bar-badge { font-size: .68rem; font-weight: 700; padding: .13rem .48rem; border-radius: 999px; }
.bb-nova    { background: #dbeafe; color: #1d4ed8; }
.bb-retalho { background: #dcfce7; color: #166534; }
.bar-num    { font-size: .88rem; font-weight: 700; color: #1a1a1a; }
.bar-meta   { font-size: .78rem; color: #8a7d70; }
.bar-pct    { font-size: .82rem; font-weight: 700; margin-left: auto; }
.bar-track  {
  display: flex; height: 38px;
  margin: 0 .9rem .6rem; border-radius: 7px;
  background: #f0ebe5;
}
.bar-seg {
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; min-width: 6px;
}
.bar-seg + .bar-seg { box-shadow: inset 3px 0 0 #fff; }
.bar-track > :first-child { border-radius: 7px 0 0 7px; }
.bar-track > :last-child  { border-radius: 0 7px 7px 0; }
.bar-track > :only-child  { border-radius: 7px; }
.bar-sobra { background: #e0d8d0; display: flex; align-items: center; justify-content: center; min-width: 0; }

@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .bar-track { border: 0.3mm solid #333; border-radius: 2mm !important; }
  .bar-track > :first-child { border-radius: 2mm 0 0 2mm !important; }
  .bar-track > :last-child  { border-radius: 0 2mm 2mm 0 !important; }
  .bar-track > :only-child  { border-radius: 2mm !important; }
  .bar-seg + .bar-seg { box-shadow: inset 4px 0 0 #000 !important; border-left: none !important; }
}
.bar-seg-lbl { font-size: .65rem; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; padding: 0 3px; pointer-events: none; }
.bar-sobra { background: #e0d8d0; display: flex; align-items: center; justify-content: center; overflow: hidden; min-width: 2px; }
.bar-sobra-lbl { font-size: .65rem; color: #9a8a7a; white-space: nowrap; overflow: hidden; padding: 0 3px; }
.bar-desc { padding: 0 .9rem .65rem; font-size: .78rem; color: #6b7280; }

/* ── Rodapé resultado ── */
.result-footer {
  display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .15rem;
}
.btn-f {
  padding: .62rem .95rem;
  background: #fff; color: #3a3030;
  border: 1.5px solid #ddd5cc; border-radius: 8px;
  font-size: .83rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: .35rem;
  transition: background .15s;
}
.btn-f:hover { background: #f5f0eb; }
.btn-f.primary { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.btn-f.primary:hover { background: var(--primary-dark); }

/* ── Loading / Erro ── */
#loading { display: none; text-align: center; padding: 2rem; color: #8a7d70; }
.spinner {
  display: inline-block; width: 26px; height: 26px;
  border: 3px solid #e5e0d8; border-top-color: var(--primary-color);
  border-radius: 50%; animation: spin .7s linear infinite; margin-bottom: .4rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.erro-box {
  background: #fef2f2; border: 1.5px solid #fca5a5;
  border-radius: 10px; padding: .85rem 1rem;
  color: #b91c1c; font-size: .85rem; display: none;
}

/* ── Colapsáveis ── */
.toggle-btn {
  width: 100%; background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  font-size: .85rem; font-weight: 700; color: #5a5050;
  padding: .35rem 0; border-bottom: 1px solid #f0ebe5; margin-bottom: .65rem;
}
.toggle-btn .arr { transition: transform .2s; font-size: .7rem; }
.toggle-btn.open .arr { transform: rotate(180deg); }

/* ── Botão configurações (stepper) ── */
.btn-config {
  align-self: center;
  margin-left: 1.5rem;
  padding: .35rem .7rem;
  background: none;
  border: 1.5px solid #ddd5cc;
  border-radius: 8px;
  font-size: .72rem;
  font-weight: 600;
  color: #9a8a7a;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-config:hover { background: #f5f0eb; border-color: #b0a090; color: #5a5050; }

/* ── Overlay ── */
.config-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1000;
}
.config-overlay.open { display: block; }

/* ── Drawer ── */
.config-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 360px;
  max-width: 100vw;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.config-drawer.open { transform: translateX(0); }

.config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid #e5e0d8;
  flex-shrink: 0;
}
.config-title { font-size: .95rem; font-weight: 700; color: #1a1a1a; }
.config-close {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; color: #9a8a7a; line-height: 1;
  padding: .25rem;
}
.config-close:hover { color: #1a1a1a; }

.config-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.config-section { display: flex; flex-direction: column; gap: .55rem; }
.config-section-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding-bottom: .3rem;
  border-bottom: 1px solid #f0ebe5;
}
.config-hint {
  font-size: .73rem;
  color: #9a8a7a;
  line-height: 1.45;
  margin-top: .2rem;
}

.config-footer {
  display: none;
}

/* ── Relatório ── */
#relatorio-pre {
  background: #1a1a2e; color: #e2e8f0;
  border-radius: 8px; padding: 1rem;
  font-family: "Courier New", monospace; font-size: .72rem;
  white-space: pre; overflow-x: auto; line-height: 1.5;
}

/* ── Plano de corte (visual) — título de seção ── */
.plano-visual-titulo {
  font-size: .78rem;
  font-weight: 700;
  color: #8a7d70;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .25rem 0 .1rem;
}

/* ── Relatório técnico ── */
.relatorio-acoes {
  display: flex;
  gap: .6rem;
  margin-bottom: .85rem;
  flex-wrap: wrap;
}
.btn-rel-acao {
  padding: .4rem .85rem;
  background: #f5f0eb;
  border: 1px solid #d8d0c8;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  color: #5a4f47;
  cursor: pointer;
  transition: background .15s;
}
.btn-rel-acao:hover { background: #ede5db; }

.rel-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .3rem;
  margin-bottom: .75rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid #e5e0d8;
}
.rel-projeto { font-size: .95rem; font-weight: 700; color: #2d2520; }
.rel-data    { font-size: .78rem; color: #8a7d70; }

.rel-resumo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .5rem;
  margin-bottom: .85rem;
}
.rel-item {
  background: #f5f0eb;
  border-radius: 6px;
  padding: .45rem .65rem;
}
.rel-item-destaque { background: #e8f5e9; }
.rel-label {
  display: block;
  font-size: .7rem;
  color: #8a7d70;
  margin-bottom: .18rem;
}
.rel-item strong { font-size: .9rem; color: #2d2520; }

.rel-config {
  background: #f9f6f2;
  border: 1px solid #e5e0d8;
  border-radius: 6px;
  padding: .55rem .85rem;
  margin-bottom: .85rem;
}
.rel-config-titulo {
  font-size: .7rem;
  font-weight: 700;
  color: #8a7d70;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .35rem;
}
.rel-config-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.25rem;
  font-size: .8rem;
  color: #5a4f47;
}

/* ── Modal PDF: opções de formato/orientação ── */
.pdf-opcao-grupo {
  margin-bottom: 1rem;
}
.pdf-opcao-label {
  font-size: .78rem;
  font-weight: 700;
  color: #5a4f47;
  margin-bottom: .45rem;
}
.pdf-opcao-radios {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.pdf-radio-label {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .875rem;
  color: #2d2520;
  cursor: pointer;
  padding: .4rem .85rem;
  border: 1px solid #ddd8d0;
  border-radius: 6px;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.pdf-radio-label:has(input:checked) {
  border-color: var(--primary-color);
  background: var(--primary-tint);
  font-weight: 600;
}
.pdf-radio-label input[type="radio"] {
  accent-color: var(--primary-color);
}

/* ── Tabela de entrada de peças ── */
.tabela-wrapper {
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid #e0d8d0;
}
.tabela-entrada {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.tabela-entrada th {
  background: #f5f0eb;
  padding: .45rem .6rem;
  text-align: left;
  font-size: .78rem;
  font-weight: 600;
  color: #5a4f47;
  border-bottom: 1px solid #e0d8d0;
}
.tabela-entrada td {
  padding: .3rem .4rem;
  border-bottom: 1px solid #f0ebe4;
}
.tabela-entrada tr:last-child td { border-bottom: none; }
.tabela-entrada input {
  width: 100%;
  border: 1px solid #ddd8d0;
  border-radius: 4px;
  padding: .35rem .5rem;
  font-size: .875rem;
  background: #fff;
  color: #2d2520;
  outline: none;
  transition: border-color .15s;
}
.tabela-entrada input:focus { border-color: var(--primary-color); }
.tabela-entrada input.celula-erro {
  border-color: #e53935;
  background: #fff5f5;
}
.tabela-acoes {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.tabela-aviso {
  margin-top: .6rem;
  padding: .5rem .75rem;
  background: #fff3e0;
  border: 1px solid #ffb74d;
  border-radius: 6px;
  color: #a04500;
  font-size: .82rem;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-box {
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  max-width: 480px;
  width: calc(100% - 2rem);
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.modal-titulo {
  font-size: 1rem;
  font-weight: 700;
  color: #2d2520;
  margin-bottom: .75rem;
}
.modelo-pre {
  background: #f5f0eb;
  border: 1px solid #e0d8d0;
  border-radius: 6px;
  padding: .75rem 1rem;
  font-family: "Courier New", monospace;
  font-size: .8rem;
  white-space: pre;
  overflow-x: auto;
  color: #2d2520;
  line-height: 1.6;
}

/* ── Upsell: otimização avançada ── */
.card-upsell {
  border-left: 4px solid #f59e0b;
  background: #fffbeb;
}
.upsell-titulo {
  font-size: .75rem;
  font-weight: 700;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .45rem;
}
.upsell-msg {
  font-size: .875rem;
  color: #5a4f47;
  line-height: 1.5;
  margin-bottom: .85rem;
}
.upsell-valor {
  color: #15803d;
  font-weight: 700;
}
.btn-upsell {
  display: inline-block;
  padding: .5rem 1.1rem;
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 700;
  cursor: not-allowed;
  opacity: .82;
}
