/* ---------- Relatórios */
.rp-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.rp-pick-card {
  display: flex; align-items: center; gap: 12px; text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; cursor: pointer; box-shadow: var(--shadow);
}
.rp-pick-card:hover { border-color: var(--accent); }
.rp-pick-card img, .rp-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; }
.rp-avatar { display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; font-size: 18px; }
.rp-avatar.big { width: 60px; height: 60px; font-size: 24px; }
.rp-pick-card b { display: block; }
.rp-pick-card small { color: var(--muted); }

.rp-banner { background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; display: flex; gap: 8px; align-items: center; font-weight: 600; }
.rp-banner.info svg { animation: rp-spin 1s linear infinite; }
.rp-banner.err { background: #fde8e8; color: var(--err); }
@keyframes rp-spin { to { transform: rotate(360deg); } }

.rp-print-head { display: none; }
.rp-profile { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.rp-profile > img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.rp-profile h2 { margin: 0 0 2px; font-size: 19px; }
.rp-profile .muted { display: flex; align-items: center; gap: 6px; }
.rp-followers, .rp-period { display: flex; flex-direction: column; align-items: flex-end; }
.rp-followers b { font-size: 24px; line-height: 1.1; }
.rp-followers span, .rp-period span { color: var(--muted); font-size: 12px; }
.rp-period { padding-left: 16px; border-left: 1px solid var(--line); }

.rp-tabs { position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; overflow-x: auto; background: var(--bg); padding: 10px 0; margin: 4px 0 0; }
.rp-tabs a { padding: 7px 12px; border-radius: 99px; text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap; }
.rp-tabs a:hover { background: var(--accent-soft); color: var(--accent); }

.rp-sec { scroll-margin-top: 60px; margin-top: 14px; }
.rp-sec h4 { margin: 18px 0 8px; font-size: 13.5px; color: var(--muted); font-weight: 700; }
.rp-sec-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.rp-sec-head h3 { margin: 0; flex: 1; }

.rp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.rp-tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rp-tile { background: #fafaff; border: 1px solid var(--line-soft); border-radius: 9px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.rp-tile .l { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.rp-tile b { font-size: 22px; letter-spacing: -.3px; }
.rp-tile b small { font-size: 15px; color: var(--muted); font-weight: 600; }
.rp-tile.hero b { font-size: 26px; }
.rp-tiles.slim .rp-tile b { font-size: 19px; }
.rp-tile b.pos { color: var(--ok); }
.rp-tile b.neg { color: var(--err); }
.rp-delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; }
.rp-delta svg { width: 13px; height: 13px; }
.rp-delta.up { color: var(--ok); }
.rp-delta.down { color: var(--err); }
.rp-delta.flat { color: var(--muted); }

.rp-chart { width: 100%; height: auto; display: block; overflow: visible; }
.rp-chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.rp-chart .ax { fill: var(--muted); font-size: 11px; }
.rp-chart .hit { fill: transparent; }
.rp-chart .hit:hover { fill: rgba(109, 40, 217, .05); }
.rp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; margin: 6px 0; color: var(--text); }
.rp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rp-legend i, #rp-tip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

#rp-tip {
  position: fixed; z-index: 100; display: none; pointer-events: none; background: #1f1b2d; color: #fff; font-size: 12.5px;
  padding: 8px 10px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); max-width: 260px;
}
#rp-tip b { display: block; margin-bottom: 3px; }
#rp-tip span { display: flex; align-items: center; gap: 6px; }

.rp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 32px; }
.rp-stack { display: flex; height: 14px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--card); }
.rp-stack span { display: block; height: 100%; }
.rp-hbars { display: flex; flex-direction: column; gap: 6px; }
.rp-hbar { display: grid; grid-template-columns: 150px 1fr 56px; align-items: center; gap: 10px; font-size: 12.5px; }
.rp-hbar .k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.rp-hbar .track { height: 12px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.rp-hbar .fill { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.rp-hbar .v { text-align: right; font-weight: 700; }

.rp-seg { display: inline-flex; background: var(--line-soft); border-radius: 8px; padding: 3px; }
.rp-seg button { border: 0; background: none; padding: 5px 10px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.rp-seg button.on { background: var(--card); color: var(--accent); box-shadow: var(--shadow); }

.rp-best { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; margin-bottom: 14px; align-items: stretch; }
.rp-best-card { display: flex; gap: 12px; border: 1px solid var(--line-soft); background: #fafaff; border-radius: 9px; padding: 12px; text-decoration: none; color: var(--text); }
.rp-best-card .rp-thumb { width: 72px; height: 96px; }
.rp-best-card .l { color: var(--accent); font-weight: 700; font-size: 12.5px; }
.rp-best-card p { margin: 4px 0; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rp-best .rp-tiles { grid-template-columns: 1fr; gap: 8px; }

.rp-thumb { width: 40px; height: 52px; border-radius: 6px; object-fit: cover; flex: none; display: block; background: var(--line-soft); }
.rp-thumb.ph { background: linear-gradient(135deg, var(--accent-soft), var(--line-soft)); }
.rp-table-wrap { overflow-x: auto; }
.rp-table th { white-space: nowrap; }
.rp-table td { white-space: nowrap; }
.rp-pub { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); white-space: normal; min-width: 240px; max-width: 360px; }
.rp-pub span { font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.rp-best-times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rp-best-times > div { background: var(--accent-soft); border-radius: 9px; padding: 12px 14px; display: flex; flex-direction: column; }
.rp-best-times .l { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.rp-best-times b { color: var(--accent); font-size: 17px; }
.rp-vbars { display: flex; gap: 4px; align-items: flex-end; height: 140px; }
.rp-vbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.rp-vbar .rp-col { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; }
.rp-vbar .fill { width: 100%; background: #c9b6ef; border-radius: 4px 4px 0 0; }
.rp-vbar.top .fill { background: var(--accent); }
.rp-vbar .k { font-size: 11px; color: var(--muted); }
.rp-foot { margin-top: 14px; }

@media (max-width: 900px) {
  .rp-grid2, .rp-best, .rp-best-times { grid-template-columns: 1fr; }
  .rp-tiles.three { grid-template-columns: 1fr; }
  .rp-hbar { grid-template-columns: 110px 1fr 50px; }
  .rp-period { border-left: 0; padding-left: 0; align-items: flex-start; }
}

/* ---------- PDF (Gerar PDF = imprimir) */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sidebar, .rp-noprint, .rp-banner, #toast, #rp-tip { display: none !important; }
  .view { padding: 0; }
  .rp-print-head { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--accent); margin-bottom: 10px; }
  .card { box-shadow: none; }
  .rp-sec { break-inside: avoid; page-break-inside: avoid; }
  #rp-reels, #rp-posts, #rp-stories { break-inside: auto; }
  .rp-table-wrap { overflow: visible; }
  .rp-table { font-size: 10.5px; }
}
