/* 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(--brand-accent); border-color: var(--brand-accent); color: var(--brand-accent-text); }

.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-pill); 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(--brand-accent); }
.rep-week-preset-btn.primary { background: var(--brand-accent); border-color: var(--brand-accent); color: var(--brand-accent-text); }
.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-pill); 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); }
.btn-copy-rep-end { margin-left: auto; }

.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; }
.btn-copy-section {
  margin-left: auto; display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--text-2); cursor: pointer; flex-shrink: 0;
}
.btn-copy-section svg { width: 14px; height: 14px; }
.btn-copy-section:hover { color: var(--text-1); border-color: var(--brand-accent); }
.btn-copy-section.copied { background: var(--good); border-color: var(--good); color: #fff; }
.rep-semanal-section-hd .sec-badge {
  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-pill); 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(--brand-accent); color: var(--brand-accent-text); }
.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: "Inter", -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, var(--lucri-iris), var(--lucri-iris-deep)); }
.rp-cover-title { margin: 0; font-size: 58px; font-weight: 600; line-height: .98; letter-spacing: -.02em; font-family: "Fraunces", Georgia, serif; font-style: italic; }
.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, var(--lucri-iris), var(--lucri-iris-deep));
  -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-top: 3px solid var(--grid); border-radius: 12px; padding: 18px;
  display: flex; flex-direction: column; justify-content: space-between; min-height: 0;
  transition: border-color .15s ease;
}
/* Cada tile de um grid de 4 (Resumo do mês, ou os secundários de cada rede)
   pega uma cor da paleta genérica categórica (--c1..--c4, já validada pro
   uso "comparar métricas lado a lado" — regra 5 do CLAUDE.md) como acento no
   topo. Antes eram 4 caixas idênticas sem nenhuma pista visual de qual é
   qual num relance; e a régua .rp-lab→.rp-num→delta sempre colava no topo,
   deixando metade do tile vazia sem função — justify-content:space-between
   acima faz esse espaço reservado virar respiro proposital (delta ancorado
   embaixo), não sobra sem explicação. */
.rp-grid-4 .rp-tile:nth-child(1), .rp-grid-2x2 .rp-tile:nth-child(1) { border-top-color: var(--c1); }
.rp-grid-4 .rp-tile:nth-child(2), .rp-grid-2x2 .rp-tile:nth-child(2) { border-top-color: var(--c2); }
.rp-grid-4 .rp-tile:nth-child(3), .rp-grid-2x2 .rp-tile:nth-child(3) { border-top-color: var(--c3); }
.rp-grid-4 .rp-tile:nth-child(4), .rp-grid-2x2 .rp-tile:nth-child(4) { border-top-color: var(--c4); }
.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;
}

/* Contagem de posts por tipo (slide "· por tipo de post") — a tabela ao
   lado só mostra médias por tipo, não quantos posts formam cada coluna;
   sem isso "média de $ Pessoal" e "média de Carrossel" pareciam
   igualmente confiáveis mesmo quando um tipo tinha 1 post e outro 15. */
.rp-type-counts {
  display: flex; gap: 16px; margin: 4px 0 14px; font-size: 13px; color: #52514e; flex-wrap: wrap;
}
.rp-type-counts b { color: #0b0b0b; font-weight: 800; }
.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; }
/* O texto de um divider ocupa só a metade superior-esquerda do slide — o
   resto ficava vazio sem função. Um glow radial na cor da marca (mesmo
   gradiente iris→iris-deep do selo/gradiente da capa, não uma cor nova)
   preenche isso de propósito, sem competir com o texto (opacidade baixa,
   atrás do conteúdo via z-index). */
.rp-divider::before {
  content: ''; position: absolute; z-index: 0; pointer-events: none;
  width: 60%; aspect-ratio: 1; right: -12%; bottom: -18%; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--lucri-iris) 55%, transparent) 0%, transparent 70%);
  filter: blur(8px);
}
.rp-dark.rp-divider::before { opacity: .16; }
.rp-gray.rp-divider::before { opacity: .3; }
.rp-divider .dv-eyebrow, .rp-divider .dv-headline, .rp-divider .dv-meta,
.rp-divider .dv-index, .rp-divider .dv-title, .rp-divider .dv-sub { position: relative; z-index: 1; }
.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: 44px; font-weight: 600; line-height: 1.05; letter-spacing: -.01em; max-width: 80%; margin: 0 0 26px; font-family: "Fraunces", Georgia, serif; font-style: italic; }
.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: 42px; font-weight: 600; letter-spacing: -.01em; line-height: 1.05; margin: 0 0 14px; font-family: "Fraunces", Georgia, serif; font-style: italic; }
.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; border: 1px solid var(--grid); border-radius: 12px; padding: 16px;
}
.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-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; }

/* A pergunta acima de cada campo (.rp-lab) usava o mesmo tratamento discreto
   de legenda de tile — correto pra "Postagens no mês", pouco pra uma
   pergunta que ancora um parágrafo de análise real. :has() em vez de mudar
   .rp-lab global (que também rotula tile em todo o resto do deck). */
.rp-lab:has(+ .rp-insight-ta), .rp-lab:has(+ .rp-plan-ta) { font-size: 14.5px; font-weight: 700; margin-bottom: 6px; }
.rp-dark .rp-lab:has(+ .rp-insight-ta) { color: #fff !important; }
.rp-insight-ta, .rp-plan-ta {
  width: 100%; min-height: 90px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2);
  border-left: 3px solid var(--lucri-iris);
  background: rgba(255,255,255,.06); color: inherit; padding: 12px 14px; font-size: 14px; line-height: 1.5;
  font-family: inherit; resize: vertical;
}
.rp-gray .rp-insight-ta, .rp-gray .rp-plan-ta { border-color: var(--grid); border-left-color: var(--lucri-iris); 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; }
}
