/* ===== Documento da proposta (tela + impressão/PDF) ===== */

.pdoc {
  --pd-navy: #15254c;
  --pd-ink: #1b2437;
  --pd-muted: #667085;
  --pd-line: #e4e8f0;
  --pd-soft: #f4f7fc;
  --pd-accent: #1a66ff;
  --pd-accent-2: #29e3ff;
  --pd-hero-a: #0c1733;
  --pd-hero-b: #15254c;
  --pd-pad: 16mm;

  width: 210mm;
  min-height: 297mm;
  background: #fff;
  color: var(--pd-ink);
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  font-size: 9.6pt;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  box-sizing: border-box;
}
.pdoc *, .pdoc *::before, .pdoc *::after { box-sizing: border-box; }
.pdoc.pd-chat {
  --pd-accent: #00a6e0;
  --pd-accent-2: #29e3ff;
  --pd-hero-a: #03040a;
  --pd-hero-b: #0b1433;
}

.pd-layout { width: 100%; border-collapse: collapse; flex: 1; }
.pd-layout > tbody > tr > td, .pd-layout > tfoot > tr > td { padding: 0; vertical-align: top; }
.pd-foot-space { height: 0; }

/* Hero */
.pd-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 11mm var(--pd-pad) 10mm;
  background:
    radial-gradient(120mm 70mm at 100% 0%, color-mix(in srgb, var(--pd-accent) 55%, transparent), transparent 70%),
    radial-gradient(90mm 60mm at 0% 120%, color-mix(in srgb, var(--pd-accent-2) 22%, transparent), transparent 70%),
    linear-gradient(135deg, var(--pd-hero-a), var(--pd-hero-b));
}
.pd-hero::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1.6mm;
  background: linear-gradient(90deg, var(--pd-accent-2), var(--pd-accent));
}
.pd-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8mm; }
.pd-logo { height: 15mm; width: auto; display: block; }
.pd-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.6mm; font-size: 8.6pt; color: rgba(255,255,255,.75); }
.pd-meta b { color: #fff; font-weight: 700; }
.pd-hero-title { margin-top: 9mm; }
.pd-kicker {
  display: inline-block;
  font-size: 8pt;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--pd-accent-2);
}
.pd-hero h1 { margin: 1mm 0 0; font-size: 27pt; line-height: 1.1; font-weight: 800; letter-spacing: -.01em; }
.pd-hero p { margin: 1.5mm 0 0; font-size: 11pt; color: rgba(255,255,255,.78); }

/* Corpo */
.pd-body { padding: 8mm var(--pd-pad) 6mm; }
.pd-label { display: block; font-size: 7.4pt; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--pd-muted); }
.pd-muted { color: var(--pd-muted); }

.pd-client {
  display: flex;
  justify-content: space-between;
  gap: 8mm;
  padding: 5mm 6mm;
  border: 1px solid var(--pd-line);
  border-left: 1.4mm solid var(--pd-accent);
  border-radius: 3mm;
  background: var(--pd-soft);
  break-inside: avoid;
}
.pd-client h2 { margin: .8mm 0 .6mm; font-size: 15pt; line-height: 1.2; color: var(--pd-navy); font-weight: 800; }
.pd-client p { margin: .3mm 0 0; }
.pd-client-side { text-align: right; min-width: 45mm; }

.pd-intro { margin: 6mm 0 0; font-size: 10pt; }

.pd-h {
  margin: 7mm 0 3mm;
  font-size: 11.5pt;
  font-weight: 800;
  color: var(--pd-navy);
  display: flex;
  align-items: center;
  gap: 2.5mm;
  break-after: avoid;
}
.pd-h::before { content: ''; width: 5mm; height: 1.2mm; border-radius: 1mm; background: linear-gradient(90deg, var(--pd-accent-2), var(--pd-accent)); }

/* Tabela de itens */
.pd-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--pd-line); border-radius: 3mm; overflow: hidden; }
.pd-table th {
  background: var(--pd-navy);
  color: #fff;
  text-align: left;
  font-size: 7.8pt;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2.6mm 3.4mm;
}
.pd-table td { padding: 2.4mm 3.4mm; border-top: 1px solid var(--pd-line); vertical-align: middle; }
.pd-table tr { break-inside: avoid; }
.pd-table tbody tr:nth-child(even):not(.pd-group) td { background: #fbfcfe; }
.pd-group td {
  background: color-mix(in srgb, var(--pd-accent) 8%, #fff) !important;
  color: var(--pd-accent);
  font-size: 7.6pt;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding-top: 1.6mm;
  padding-bottom: 1.6mm;
}
.pd-prod strong { display: block; font-weight: 700; color: var(--pd-navy); }
.pd-prod small { display: block; color: var(--pd-muted); font-size: 8pt; line-height: 1.35; }
.pd-bill { text-align: center; white-space: nowrap; }
.pd-bill span {
  display: inline-block;
  font-size: 7.6pt;
  font-weight: 700;
  padding: .5mm 2mm;
  border-radius: 10mm;
  background: var(--pd-soft);
  color: var(--pd-muted);
  border: 1px solid var(--pd-line);
}
.pd-qty { text-align: center; white-space: nowrap; }
.pd-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
th.pd-bill, th.pd-qty { text-align: center; }
th.pd-num { text-align: right; }
.pd-strong { font-weight: 700; color: var(--pd-navy); }
.pd-free {
  display: inline-block;
  font-size: 7.6pt;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .5mm 2mm;
  border-radius: 10mm;
  color: #067647;
  background: #dcfae6;
}
.pd-num s { display: block; font-size: 7.6pt; color: var(--pd-muted); font-weight: 400; }
.pd-empty { text-align: center; color: var(--pd-muted); padding: 6mm !important; }

/* Totais */
.pd-cards { display: grid; gap: 3mm; margin-top: 4mm; break-inside: avoid; }
.pd-cards-1 { grid-template-columns: 1fr; }
.pd-cards-2 { grid-template-columns: 1.3fr 1fr; }
.pd-cards-3 { grid-template-columns: 1.3fr 1fr 1fr; }
.pd-card {
  border: 1px solid var(--pd-line);
  border-radius: 3mm;
  padding: 3.6mm 4.5mm;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.pd-card span { font-size: 7.6pt; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--pd-muted); }
.pd-card strong { font-size: 15pt; font-weight: 800; color: var(--pd-navy); line-height: 1.25; font-variant-numeric: tabular-nums; }
.pd-card small { color: var(--pd-muted); font-size: 7.8pt; }
.pd-card-main {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--pd-hero-b), var(--pd-accent));
}
.pd-card-main span, .pd-card-main small { color: rgba(255,255,255,.8); }
.pd-card-main strong { color: #fff; font-size: 20pt; }

.pd-conds {
  display: flex;
  flex-wrap: wrap;
  gap: 2mm 8mm;
  margin-top: 4mm;
  padding: 3mm 4.5mm;
  border-radius: 3mm;
  background: var(--pd-soft);
  break-inside: avoid;
}
.pd-conds div { display: flex; flex-direction: column; }
.pd-conds span { font-size: 7.4pt; color: var(--pd-muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.pd-conds b { color: var(--pd-navy); }

.pd-notes {
  list-style: none;
  margin: 3mm 0 0;
  padding: 3mm 4.5mm;
  border-radius: 3mm;
  background: #fff8e1;
  border: 1px solid #f7e2a3;
  break-inside: avoid;
}
.pd-notes li { position: relative; padding-left: 4mm; font-size: 8.8pt; font-weight: 600; color: #6b4e00; }
.pd-notes li::before { content: '*'; position: absolute; left: 0; font-weight: 800; }

/* Recursos */
.pd-features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2mm 6mm; }
.pd-features li { display: flex; gap: 2.2mm; align-items: flex-start; break-inside: avoid; font-size: 9pt; }
.pd-features svg {
  flex: none;
  width: 4.4mm;
  height: 4.4mm;
  margin-top: .3mm;
  padding: .6mm;
  border-radius: 50%;
  fill: #fff;
  background: linear-gradient(135deg, var(--pd-accent-2), var(--pd-accent));
}

/* Assinatura */
.pd-sign { margin-top: 8mm; break-inside: avoid; }
.pd-sign p { margin: 0 0 2mm; }
.pd-sign-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 6mm;
  margin-top: 5mm;
  padding-top: 4mm;
  border-top: 1px solid var(--pd-line);
}
.pd-sign-person strong { color: var(--pd-navy); font-size: 10.5pt; }
.pd-sign-person span { color: var(--pd-muted); }
.pd-sign-person small { display: block; color: var(--pd-muted); font-size: 8.4pt; }
.pd-sign-logos { display: flex; align-items: center; gap: 5mm; }
.pd-sign-logos img { height: 12mm; width: auto; max-width: 60mm; object-fit: contain; }

/* Clientes */
.pd-clients { margin-top: 8mm; break-inside: avoid; border-radius: 3mm; overflow: hidden; border: 1px solid var(--pd-line); }
.pd-clients-title {
  text-align: center;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: 8.6pt;
  color: var(--pd-navy);
  padding: 2mm;
  background: var(--pd-soft);
}
.pd-clients img { display: block; width: 100%; height: auto; }

/* Rodapé */
.pd-footer {
  order: 2;
  margin-top: auto;
  padding: 3.2mm var(--pd-pad) 4mm;
  border-top: .8mm solid var(--pd-accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-size: 7.4pt;
  line-height: 1.45;
  color: var(--pd-muted);
  background: #fff;
}
.pd-footer strong { color: var(--pd-navy); letter-spacing: .08em; font-size: 7.8pt; }

/* ===== Impressão =====
   O rodapé impresso usa as "margin boxes" do @page (gerado em doc.js com os dados da empresa),
   assim ele se repete corretamente em todas as páginas, junto com a numeração. */
@media print {
  html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; }
  .pdoc { display: block; width: 100%; min-height: 0; box-shadow: none !important; }
  .pd-footer { display: none; }
}
