/* Página Relatório — porta as abas "Envio Semanal" e "Exportar Relatório"
   do v1 (../../index.html, tab-relatorio) pro 2.0. Só esses dois modos
   (não "Por Data" / "Análise Completa" do v1) — ver relatorio.js. */

.rep-mode-bar { display: flex; gap: 8px; margin-bottom: var(--space-4); flex-wrap: wrap; }
.rep-mode-btn {
  display: flex; align-items: center; gap: 8px; padding: 9px 16px;
  border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .12s ease, color .12s ease;
}
.rep-mode-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.rep-mode-btn:hover { color: var(--text-1); }
.rep-mode-btn.active { background: var(--c1); border-color: var(--c1); color: #fff; }

.rep-panel { display: none; }
.rep-panel.active { display: block; }

.rep-semanal-bar, .rep-export-bar {
  display: flex; align-items: flex-end; gap: var(--space-3); flex-wrap: wrap;
  margin-bottom: var(--space-5); padding: var(--space-4);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
}
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field label { font-size: 11px; color: var(--text-2); font-weight: 600; }
.form-field input, .form-field select {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 10px;
  font-size: 13px; background: var(--page); color: var(--text-1); font-family: inherit;
}
.rep-week-preset-btn {
  display: flex; align-items: center; gap: 6px; padding: 9px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--page);
  color: var(--text-1); font-size: 12px; font-weight: 600; cursor: pointer;
}
.rep-week-preset-btn svg { width: 14px; height: 14px; }
.rep-week-preset-btn:hover { border-color: var(--c1); }
.rep-week-preset-btn.primary { background: var(--c1); border-color: var(--c1); color: #fff; }
.rep-date-info { font-size: 12px; color: var(--text-2); font-weight: 600; }
.btn-copy-rep {
  display: flex; align-items: center; gap: 8px; padding: 9px 16px; border: none;
  border-radius: var(--radius-sm); background: var(--badge-bg); color: #fff;
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.btn-copy-rep svg { width: 14px; height: 14px; }
.btn-copy-rep.copied { background: var(--good); }

.rep-semanal-section { margin-bottom: var(--space-6); }
.rep-semanal-section-hd { display: flex; align-items: center; gap: 10px; margin-bottom: var(--space-3); }
.rep-semanal-section-hd .plat-name { font-size: 15px; font-weight: 700; }
.rep-semanal-section-hd .sec-badge {
  margin-left: auto; font-size: 11px; font-weight: 700; color: var(--text-2);
  background: var(--grid); border-radius: var(--radius-pill); padding: 3px 10px;
}

/* ---------- deck de exportação (impressão/PDF) ---------- */
.report-overlay {
  display: none; position: fixed; inset: 0; z-index: 2000; overflow-y: auto;
  background: #17171a;
}
.report-overlay.open { display: block; }
.report-toolbar {
  position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between;
  padding: 12px 24px; background: rgba(23,23,26,.92); backdrop-filter: blur(6px);
}
.report-toolbar-btn {
  display: flex; align-items: center; gap: 8px; padding: 9px 16px; border: none;
  border-radius: var(--radius-sm); background: rgba(255,255,255,.1); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.report-toolbar-btn svg { width: 16px; height: 16px; }
.report-toolbar-btn.primary { background: var(--c1); }
.report-slides { max-width: 1040px; margin: 0 auto; padding: 32px 24px 80px; display: flex; flex-direction: column; gap: 28px; }
.rp-slide {
  aspect-ratio: 16/9; background: #fff; color: #0b0b0b; border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35); padding: 5.5% 6%; display: flex; flex-direction: column;
  position: relative; overflow: hidden; font-family: "SF Pro Display", -apple-system, system-ui, sans-serif;
}
.rp-cover { padding: 0; justify-content: flex-end; }
.rp-cover .cover-mark { position: absolute; top: 8%; left: 7%; width: 46px; height: 46px; }
.rp-cover .cover-word { position: absolute; top: 8%; left: calc(7% + 60px); line-height: 46px; font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.rp-cover-content { position: absolute; left: 7%; bottom: 12%; right: 7%; }
.rp-cover-pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700;
  color: #52514e; margin-bottom: 16px; text-transform: uppercase; letter-spacing: .04em;
}
.rp-cover-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(135deg, #22c7dd, #22e08a); }
.rp-cover-title { margin: 0; font-size: 58px; font-weight: 800; line-height: .98; letter-spacing: -.02em; }
.rp-cover-hook { margin-top: 22px; font-size: 15px; color: #52514e; display: flex; align-items: baseline; gap: 10px; }
.rp-cover-hook b {
  font-size: 22px; font-weight: 800; color: #0b0b0b;
  background: linear-gradient(90deg, #22c7dd, #22e08a);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.rp-dark { background: #14131f; color: #fff; }
.rp-gray { background: #f2f2f0; }

.rp-head { display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--grid); padding-bottom: 12px; margin-bottom: 18px; }
.rp-h2 { margin: 0; font-size: 22px; font-weight: 700; }
.rp-sub { color: #898781; font-size: 13px; }

.rp-grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; flex: 1; min-height: 0; }
.rp-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; flex: 1; min-height: 0; }
.rp-tile {
  border: 1px solid var(--grid); border-radius: 12px; padding: 16px; display: flex; flex-direction: column;
  min-height: 0;
}
.rp-tick { display: inline-block; width: 20px; height: 4px; border-radius: 2px; margin-bottom: 8px; }
.rp-lab { font-size: 12px; color: #898781; }
.rp-num { font-family: inherit; font-weight: 800; line-height: 1; font-size: 30px; font-variant-numeric: tabular-nums; }
.rp-tile .rp-num { margin: 6px 0; }
.rp-delta { font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.rp-delta.up { color: var(--good); }
.rp-delta.down { color: var(--critical); }

/* hero + secundários + faixa (slides de plataforma) */
.rp-hero-split { display: flex; gap: 28px; flex: 1; min-height: 0; }
.rp-hero-col { flex: 0 0 38%; display: flex; flex-direction: column; justify-content: center; }
.rp-hero-lab { font-size: 12.5px; color: #898781; font-weight: 600; }
.rp-hero-num { font-size: 52px; font-weight: 800; line-height: 1; margin: 8px 0 10px; font-variant-numeric: tabular-nums; }
.rp-hero-spark { margin-top: 18px; height: 64px; }
.rp-hero-spark svg { width: 100%; height: 100%; overflow: visible; }
.rp-secondary-col { flex: 1; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.rp-grid-2x2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; min-height: 0; }
.rp-tile.compact { padding: 13px 16px; }
.rp-tile.compact .rp-num { font-size: 22px; margin: 4px 0 0; }
.rp-stat-strip {
  display: flex; gap: 22px; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--grid);
  font-size: 12.5px; color: #52514e; flex-wrap: wrap;
}
.rp-stat-strip b { color: #0b0b0b; font-weight: 700; font-variant-numeric: tabular-nums; }

/* divisores — destaque do mês (dark) e abertura de seção (gray) */
.rp-divider { justify-content: center; align-items: flex-start; }
.rp-divider .dv-eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 18px; }
.rp-dark.rp-divider .dv-eyebrow { color: #7fe0b0; }
.rp-divider .dv-headline { font-size: 42px; font-weight: 800; line-height: 1.08; letter-spacing: -.01em; max-width: 80%; margin: 0 0 26px; }
.rp-divider .dv-meta { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.rp-dark.rp-divider .dv-meta { color: #b9b8c6; }
.rp-divider .dv-meta .dv-num { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rp-dark.rp-divider .dv-meta .dv-num { color: #fff; }
.rp-divider .dv-index { font-size: 13px; font-weight: 700; color: #898781; margin-bottom: 14px; }
.rp-divider .dv-title { font-size: 40px; font-weight: 800; letter-spacing: -.01em; line-height: 1.05; margin: 0 0 14px; }
.rp-divider .dv-sub { font-size: 14.5px; color: #52514e; max-width: 60%; }

.rp-eng-row { display: grid; grid-template-columns: 1fr repeat(2,110px); align-items: center; padding: 10px 0; border-bottom: 1px solid var(--grid); font-size: 13px; }
.rp-eng-row .rp-num { font-size: 18px; }

.rp-chart-wrap { flex: 1; min-height: 0; }
.rp-chart-wrap svg { width: 100%; height: 100%; }

/* o tooltip compartilhado (charts.js) é z-index:1000 no style.css — abaixo
   do overlay do deck (2000), senão fica escondido atrás dele. */
#chart-tooltip { z-index: 2100; }

.rp-eng-split { display: flex; gap: 20px; flex: 1; min-height: 0; }
.rp-eng-split .rp-chart-wrap { border: 1px solid var(--grid); border-radius: 12px; padding: 16px; }

.rp-top3-card { border: 1px solid var(--grid); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.rp-top3-name { font-weight: 700; font-size: 13px; line-height: 1.3; }
.rp-top3-type { font-size: 11px; color: #898781; }
.rp-top3-stats { display: flex; gap: 10px; }
.rp-top3-stats .rp-num { font-size: 17px; }

.rp-insight-ta, .rp-plan-ta {
  width: 100%; min-height: 90px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.06); color: inherit; padding: 10px; font-size: 13px; font-family: inherit;
  resize: vertical;
}
.rp-gray .rp-insight-ta, .rp-gray .rp-plan-ta { border-color: var(--grid); background: #fff; color: #0b0b0b; }

@media print {
  .shell, .report-toolbar { display: none !important; }
  body { background: #fff !important; }
  .report-overlay { position: static; overflow: visible; background: transparent; }
  .report-slides { max-width: none; margin: 0; padding: 0; gap: 0; }
  .rp-slide { aspect-ratio: auto; width: 100vw; height: 100vh; page-break-after: always; box-shadow: none; border-radius: 0; }
  @page { size: landscape; margin: 0; }
}
