:root {
  --navy: #2e3c56;
  --dark-navy: #21263b;
  --darkest: #1e1b2c;
  --off-white: #f2f1eb;
  --white: #ffffff;

  /* Tons de destaque derivados da cor da marca (não mais um roxo fixo -
     acompanham a marca automaticamente, ver nota no report.html sobre
     color-mix em vez de rgba fixo). */
  --peri-10: color-mix(in srgb, var(--brand-primary, var(--series-1)) 10%, transparent);
  --peri-20: color-mix(in srgb, var(--brand-primary, var(--series-1)) 20%, transparent);
  --peri-35: color-mix(in srgb, var(--brand-primary, var(--series-1)) 35%, transparent);

  /* Tema claro: fundo branco/cinza muito claro, texto escuro - ver .btn/.tag-pill/
     .icon-badge abaixo, que usam --white como texto por cima da cor da marca em vez
     de --darkest, já que a marca aqui é escura (diferente do tema roxo-claro original). */
  --page-plane: #f2f4f8;
  --surface-1: #ffffff;
  --surface-2: #eef1f6;
  --text-primary: #12202f;
  --text-secondary: rgba(18, 32, 47, 0.62);
  --text-muted: rgba(18, 32, 47, 0.42);
  --gridline: rgba(4, 32, 60, 0.10);
  --border: rgba(4, 32, 60, 0.14);
  --good: #0a8a4a;
  --critical: #c62828;

  --series-1: #3987e5;
  --series-2: #199e70;
  --series-3: #c98500;
  --series-4: #9085e9;

  --shadow-1: 0 10px 28px rgba(4, 32, 60, 0.10);
}

/* Modo "sem marca" (relatório white-label): troca a paleta da agência por tons
   neutros de cinza-azulado, tanto na tela quanto no PDF - usado quando o
   relatório vai direto para o cliente final sem expor a agência. */
body.white-label {
  --brand-primary: #64748b;
  --brand-secondary: #94a3b8;
  --series-1: #475569;
  --series-2: #64748b;
  --series-3: #94a3b8;
  --series-4: #cbd5e1;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Quicksand", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page-plane);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--brand-primary, var(--series-1)) 10%, transparent) 1px, transparent 1.5px);
  background-size: 26px 26px;
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

a { color: var(--brand-primary, var(--series-1)); }

/* Ícone recortado da seta da marca (usado no badge e nas pilulas de variação) */
.icon-seta {
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-image: url("../img/seta.png");
  mask-image: url("../img/seta.png");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

/* Ícone recortado do logo (usado no spinner de carregamento) */
.icon-logo-branco {
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-image: url("../img/logo-branco.png");
  mask-image: url("../img/logo-branco.png");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.icon-badge {
  --badge-size: 28px;
  width: var(--badge-size);
  height: var(--badge-size);
  min-width: var(--badge-size);
  border-radius: 9px;
  background: var(--brand-primary, var(--peri-20));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-badge .icon-seta { width: 52%; height: 52%; color: var(--white); }
.icon-badge--sm { --badge-size: 20px; border-radius: 6px; }
.icon-badge--bounce { animation: bounceArrow 1.8s ease-in-out infinite; }
@keyframes bounceArrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-primary, var(--peri-20));
  color: var(--white);
  font-family: "Poppins", sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 100px;
  margin-bottom: 14px;
}

.deco-bg {
  position: absolute;
  bottom: -60px;
  right: -50px;
  pointer-events: none;
  z-index: 0;
}
.deco-img { width: 220px; opacity: 0.05; transform: rotate(20deg); }

/* Cards com cantos orgânicos, entrando com uma leve animação de fade+slide */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 22px 22px 22px 8px;
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-1);
  animation: fadeSlideUp 0.5s ease both;
}
.card:nth-of-type(1) { animation-delay: 0.05s; }
.card:nth-of-type(2) { animation-delay: 0.12s; }
.card:nth-of-type(3) { animation-delay: 0.19s; }
.card:nth-of-type(4) { animation-delay: 0.26s; }
.card:nth-of-type(5) { animation-delay: 0.33s; }
.card:nth-of-type(6) { animation-delay: 0.40s; }

/* Topbar */
.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-family: "Poppins", sans-serif; font-weight: 700; color: var(--text-primary); letter-spacing: 0.01em; }
.topbar img.logo { height: clamp(26px, 5vw, 40px); width: auto; max-width: 55vw; flex-shrink: 0; }

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 12px;
  background: var(--brand-primary, var(--series-1));
  color: var(--white);
  text-decoration: none;
  border: none;
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px color-mix(in srgb, var(--brand-primary, var(--series-1)) 35%, transparent); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn.secondary:hover { color: var(--text-primary); border-color: var(--brand-primary, var(--series-1)); box-shadow: none; transform: none; }
.btn.danger { background: var(--critical); color: var(--white); }

.table-scroll { overflow-x: auto; }
.table-scroll table { white-space: nowrap; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--gridline); font-size: 14px; }
th { color: var(--text-muted); font-family: "Poppins", sans-serif; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 2px solid var(--gridline); }
tbody tr:nth-child(even) { background: rgba(4, 32, 60, 0.025); }
tbody tr:hover { background: var(--peri-10); }
tbody tr:last-child td { border-bottom: none; }
tr.row-highlight-good td:first-child { box-shadow: inset 3px 0 0 var(--good); }
tr.row-highlight-bad td:first-child { box-shadow: inset 3px 0 0 var(--critical); }

.post-thumb {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.post-thumb-empty { background: var(--surface-2); }

/* --- Listas de cartões (thumb + métricas): Melhores publicações, Anúncios, Campanhas, Conjuntos --- */
.post-card-list { display: flex; flex-direction: column; }
.post-card { display: flex; gap: 16px; padding: 16px 8px; border-bottom: 1px solid var(--gridline); }
.post-card:last-child { border-bottom: none; }
.post-card-highlight { box-shadow: inset 3px 0 0 var(--good); }
.post-card-thumb-link { flex-shrink: 0; }
.post-card-thumb {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.post-card-body { min-width: 0; flex: 1; }
.post-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.post-card-date { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 13px; color: var(--text-primary); }
.post-card-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); background: var(--surface-2); padding: 3px 9px; border-radius: 100px; }
.post-card-link { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--brand-primary, var(--series-4)); text-decoration: none; }
.post-card-link:hover { text-decoration: underline; }
.post-card-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 18px; }
.post-card-metrics-3col { grid-template-columns: repeat(3, 1fr); }
.post-card-metric { display: flex; flex-direction: column; }
.post-card-metric-label { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.post-card-metric-value { font-family: "Poppins", sans-serif; font-weight: 800; font-size: 15px; color: var(--text-primary); }
@media (max-width: 600px) {
  .post-card-metrics { grid-template-columns: repeat(2, 1fr); }
  .post-card-metrics-3col { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .post-card { flex-direction: column; }
  .post-card-thumb { width: 100%; height: auto; aspect-ratio: 1; }
}

.client-name-cell { display: flex; align-items: center; gap: 10px; }
.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text-primary);
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  font-family: "Poppins", sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  margin-left: 6px;
}
.status-pill.ok { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.status-pill.expired { background: color-mix(in srgb, var(--critical) 14%, transparent); color: var(--critical); }
.status-pill.unknown { background: var(--peri-10); color: var(--text-muted); }

.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.flash.sucesso { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good); }
.flash.erro { background: color-mix(in srgb, var(--critical) 12%, transparent); color: var(--critical); }
.flash.preview-flash { background: var(--peri-10); color: var(--brand-primary, var(--peri-20)); font-weight: 600; text-align: center; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-family: "Poppins", sans-serif; font-size: 11px; font-weight: 700; color: var(--brand-primary, var(--text-secondary)); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="color"],
.form-group input[type="file"],
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--text-primary);
  font-family: "Quicksand", sans-serif;
  font-size: 15px;
  font-weight: 600;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="file"]:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--brand-primary, var(--series-1));
  background: var(--peri-10);
}
.form-group input[type="color"] { height: 44px; padding: 4px; cursor: pointer; }

.password-field { position: relative; }
.password-field input { padding-right: 88px !important; }
.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 10px;
}
.password-toggle:hover { color: var(--brand-primary, var(--text-primary)); }

.help-text { font-size: 12px; color: var(--text-muted); margin-top: 5px; line-height: 1.5; }
.help-text code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 11px; }

.empty-state { text-align: center; padding: 32px 16px; color: var(--text-muted); font-size: 14px; }

/* Stat tiles */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.stat-tile {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 18px 18px 18px 6px;
  padding: 18px 20px;
  border-top: 3px solid var(--brand-primary, var(--series-1));
  box-shadow: var(--shadow-1);
}
.stat-tile .label { font-family: "Poppins", sans-serif; font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.stat-tile .value-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 8px 0 2px; }
.stat-tile .value { font-family: "Poppins", sans-serif; font-size: 30px; font-weight: 800; letter-spacing: -0.01em; animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.stat-tile .prev-value { font-size: 12px; color: var(--text-muted); }
.stat-tile .indisponivel { font-size: 13px; color: var(--text-muted); font-style: italic; margin-top: 8px; }

.delta-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 100px;
  white-space: nowrap;
}
.delta-pill .arrow { width: 9px; height: 9px; }
.delta-pill.up { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.delta-pill.down { background: color-mix(in srgb, var(--critical) 14%, transparent); color: var(--critical); }
.delta-pill.down .arrow { transform: rotate(180deg); }

/* Barra horizontal (breakdown por tipo de conteúdo), cresce ao carregar */
@keyframes growBar { from { width: 0%; } }
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.bar-row .bar-label { width: 130px; font-size: 13px; color: var(--text-secondary); flex-shrink: 0; }
.bar-track { flex: 1; background: var(--peri-10); border-radius: 100px; height: 16px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 100px; animation: growBar 0.9s cubic-bezier(0.4, 0, 0.2, 1) both; }
.bar-row .bar-value { width: 70px; text-align: right; font-family: "Poppins", sans-serif; font-size: 13px; font-weight: 700; color: var(--text-primary); flex-shrink: 0; }

h1, h2, h3 { margin-top: 0; font-family: "Poppins", sans-serif; }
h1 { letter-spacing: -0.01em; }
h2.section-title {
  font-size: 12px;
  color: var(--brand-primary, var(--text-secondary));
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gridline);
}

.report-header {
  position: relative;
  margin-bottom: 24px;
  padding: 24px 28px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 22px 22px 22px 8px;
  border-top: 4px solid var(--brand-primary, var(--series-1));
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.report-header > .report-meta-line,
.report-header > .ig-profile-card { position: relative; z-index: 1; }

.report-meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--text-muted);
}
.report-meta-line .tag-pill { margin-bottom: 0; }

.ig-profile-card { display: flex; align-items: center; gap: 16px; }
.ig-avatar {
  width: clamp(56px, 12vw, 84px);
  height: clamp(56px, 12vw, 84px);
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--brand-primary, var(--series-1));
  flex-shrink: 0;
}
.ig-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text-primary);
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  font-size: 28px;
}
.ig-profile-info { min-width: 0; }
.ig-username { font-family: "Poppins", sans-serif; font-weight: 800; font-size: clamp(18px, 3vw, 24px); color: var(--text-primary); word-break: break-word; }
.ig-name { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }

.actions-bar { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.btn.secondary.active { background: var(--peri-10); color: var(--brand-primary, var(--text-primary)); border-color: var(--brand-primary, var(--series-1)); }

.period-form { display: flex; align-items: center; gap: 8px; }
.period-form-sep { font-size: 13px; color: var(--text-muted); }
.period-form input[type="date"] {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-primary);
  font-family: "Quicksand", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color-scheme: light;
}
.period-form input[type="date"]:focus { outline: none; border-color: var(--brand-primary, var(--series-1)); }

.welcome-header { margin-bottom: 24px; }
.welcome-header h1 { font-size: 28px; }
.welcome-sub { color: var(--text-secondary); font-size: 15px; margin-top: 4px; }

.action-rows { display: flex; flex-direction: column; }
.action-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--gridline); }
.action-row:last-child { border-bottom: none; }
.action-row-text { flex-grow: 1; min-width: 0; }
.action-row-text h3 { font-size: 15px; margin: 0 0 2px; }
.action-row-text p { font-size: 13px; color: var(--text-secondary); margin: 0; line-height: 1.4; }
.action-row .btn { flex-shrink: 0; }
@media (max-width: 560px) {
  .action-row { flex-wrap: wrap; }
}

.client-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.client-card { display: flex; flex-direction: column; gap: 12px; }
.client-card-header { display: flex; align-items: center; gap: 10px; }
.client-card-header .avatar-sm { width: 40px; height: 40px; font-size: 15px; }
img.avatar-sm { object-fit: cover; }
.client-card-name { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 15px; }
.client-card-meta { font-size: 13px; color: var(--text-secondary); }
.client-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }

/* Loading overlay: exibido enquanto uma requisição à API do Instagram está em andamento */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--page-plane) 92%, transparent);
  z-index: 999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}
.loading-overlay.active { display: flex; }
.loading-overlay .loading-spinner {
  width: 56px;
  height: 56px;
  color: var(--brand-primary, var(--peri-20));
  animation: spin 2.4s linear infinite;
}
.loading-overlay .loading-text { font-family: "Poppins", sans-serif; font-size: 14px; color: var(--text-secondary); font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal de seleção de período, aberto ao clicar em "Gerar relatório" */
.period-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--page-plane) 80%, transparent);
  z-index: 998;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.period-modal-overlay.active { display: flex; }
.period-modal { max-width: 420px; width: 100%; }
.period-modal-quick { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.period-modal-custom { margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.period-modal-actions { display: flex; justify-content: flex-end; }
@media (prefers-reduced-motion: reduce) {
  .loading-overlay .loading-spinner,
  .card,
  .stat-tile .value,
  .bar-fill,
  .icon-badge--bounce { animation: none; }
}

/* --- Donut card (Visualizações / Interações: total + seguidores/não-seguidores) --- */
.donut-card { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; }
.donut-wrap { flex-shrink: 0; }
.donut {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.donut::before {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: var(--surface-1);
}
.donut-center { position: relative; z-index: 1; text-align: center; }
.donut-center .donut-label { font-size: 12px; color: var(--text-muted); }
.donut-center .donut-value { font-family: "Poppins", sans-serif; font-weight: 800; font-size: 26px; color: var(--text-primary); white-space: nowrap; line-height: 1.2; }
.donut-value-delta { margin-top: 4px; display: flex; justify-content: center; }
.donut-value-delta .delta-pill { font-size: 11px; }
.donut-legend { display: flex; flex-direction: column; gap: 10px; min-width: 180px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.donut-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.donut-legend-value { margin-left: auto; font-family: "Poppins", sans-serif; font-weight: 700; }
.donut-reach { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--gridline); font-size: 13px; color: var(--text-secondary); }
.donut-reach strong { color: var(--text-primary); }

/* --- Tabs (Todos / Seguidores / Não seguidores, Reels / Posts / Stories) --- */
.tab-radio { position: absolute; opacity: 0; pointer-events: none; }
.tabs-nav { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs-nav label {
  padding: 7px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tabs-nav label:hover { color: var(--text-primary); }
.tab-panel { display: none; }
.tab-radio-todos:checked ~ .tabs-nav label[for$="-todos"],
.tab-radio-seguidores:checked ~ .tabs-nav label[for$="-seguidores"],
.tab-radio-nao_seguidores:checked ~ .tabs-nav label[for$="-nao_seguidores"],
.tab-radio-reels:checked ~ .tabs-nav label[for$="-reels"],
.tab-radio-posts:checked ~ .tabs-nav label[for$="-posts"] {
  background: var(--peri-10);
  color: var(--brand-primary, var(--text-primary));
  border-color: var(--brand-primary, var(--series-1));
}
.tab-radio-todos:checked ~ .tab-panel-todos,
.tab-radio-seguidores:checked ~ .tab-panel-seguidores,
.tab-radio-nao_seguidores:checked ~ .tab-panel-nao_seguidores,
.tab-radio-reels:checked ~ .tab-panel-reels,
.tab-radio-posts:checked ~ .tab-panel-posts {
  display: block;
}
.tab-panel-print-label { display: none; font-family: "Poppins", sans-serif; font-weight: 700; font-size: 13px; margin: 14px 0 6px; }

/* --- Mini ranking cards (principais conteúdos por views/curtidas) --- */
.mini-ranking-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; }
.mini-ranking-card { display: block; text-decoration: none; color: inherit; }
.mini-ranking-thumb { width: 100%; aspect-ratio: 1; border-radius: 14px; object-fit: cover; background: var(--surface-2); }
.mini-ranking-value { font-family: "Poppins", sans-serif; font-weight: 800; font-size: 15px; margin-top: 8px; color: var(--text-primary); }
.mini-ranking-date { font-size: 12px; color: var(--text-muted); }
/* Stories: mesmo cartão dos destaques de carrossel, em formato vertical (9:16). */
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.story-grid-compacta { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; margin-top: 14px; }
.story-card { display: block; text-decoration: none; color: inherit; }
.story-thumb { display: block; width: 100%; aspect-ratio: 9 / 16; border-radius: 14px; object-fit: cover; background: var(--surface-2); }
.story-retencao { font-weight: 700; color: var(--text-primary); }
.story-unidade { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.story-lista { margin-top: 20px; }
.story-lista summary { cursor: pointer; font-weight: 600; color: var(--brand-primary, var(--text-primary)); padding: 8px 0; }
.mini-ranking-engagement { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--gridline); font-size: 11.5px; color: var(--text-secondary); }

/* --- Atividade do perfil --- */
.profile-activity-total { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.profile-activity-total .value { font-family: "Poppins", sans-serif; font-weight: 800; font-size: 32px; }
.profile-activity-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--gridline); font-size: 14px; }
.profile-activity-row:last-child { border-bottom: none; }
.profile-activity-row .row-value { display: flex; align-items: center; gap: 8px; font-family: "Poppins", sans-serif; font-weight: 700; }

/* --- Interações: números por tipo (curtidas/comentários/...) --- */
.interaction-numbers-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--gridline); font-size: 14px; }
.interaction-numbers-row:last-child { border-bottom: none; }
.interaction-numbers-row .row-value { font-family: "Poppins", sans-serif; font-weight: 700; }

/* --- Seguidores: bio estilo Instagram + crescimento + gráfico de linha --- */
.ig-bio-card { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 14px; }
.ig-bio-avatar {
  width: clamp(64px, 12vw, 96px);
  height: clamp(64px, 12vw, 96px);
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--brand-primary, var(--series-1));
  flex-shrink: 0;
}
.ig-bio-body { min-width: 0; flex: 1; }
.ig-bio-top { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 10px; }
.ig-bio-username { font-family: "Poppins", sans-serif; font-weight: 800; font-size: clamp(16px, 2.6vw, 19px); color: var(--text-primary); word-break: break-word; }
.ig-bio-counts { display: flex; gap: 20px; }
.ig-bio-count { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--text-muted); }
.ig-bio-count strong { font-family: "Poppins", sans-serif; font-weight: 800; font-size: 16px; color: var(--text-primary); }
.ig-bio-name { font-weight: 700; font-size: 14px; color: var(--text-primary); margin-bottom: 4px; }
.ig-bio-text { font-size: 13px; color: var(--text-secondary); white-space: pre-line; line-height: 1.5; }
.ig-bio-link { display: inline-block; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--brand-primary, var(--series-4)); text-decoration: none; }
.ig-bio-link:hover { text-decoration: underline; }
@media (max-width: 480px) {
  .ig-bio-card { flex-direction: column; align-items: center; text-align: center; }
  .ig-bio-top { flex-direction: column; align-items: center; }
}
.growth-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 20px; }
.growth-tile { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; }
.growth-tile .label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.growth-tile .value { font-family: "Poppins", sans-serif; font-weight: 800; font-size: 20px; }
.growth-tile-highlight { background: var(--surface-1); border: 1px solid var(--border); border-top: 3px solid var(--brand-primary, var(--series-1)); }
.growth-tile-highlight .value { font-size: 26px; margin-bottom: 6px; }
.growth-tile-highlight .delta-pill { font-size: 11px; }
.followers-chart { width: 100%; height: 140px; overflow: visible; }
.followers-chart polyline { fill: none; stroke: var(--brand-primary, var(--series-4)); stroke-width: 2; vector-effect: non-scaling-stroke; }
.followers-chart .chart-gridline { stroke: var(--gridline); stroke-width: 1; opacity: 0.5; }
.followers-chart-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* --- Gráfico de linha interativo (Alcance diário / Visualizações diárias) --- */
.interactive-chart-wrap { position: relative; }
.chart-metric-toggle { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.chart-toggle-btn {
  padding: 7px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chart-toggle-btn:hover { color: var(--text-primary); }
.chart-toggle-btn.active {
  background: var(--peri-10);
  color: var(--brand-primary, var(--text-primary));
  border-color: var(--brand-primary, var(--series-1));
}
.chart-svg { cursor: crosshair; }
.chart-hover-line { stroke: var(--text-muted); stroke-width: 1; opacity: 0.6; }
.chart-hover-dot { fill: var(--brand-primary, var(--series-4)); stroke: var(--surface-1); stroke-width: 1; }
.chart-tooltip {
  position: absolute;
  transform: translate(-50%, -120%);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 5;
}

/* --- Gráfico comparativo (período atual x período anterior, empilhados) --- */
.comparison-chart-wrap { position: relative; }
.comparison-chart-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; min-height: 32px; }
.comparison-chart-delta:empty { display: none; }
.comparison-chart-pair { display: flex; flex-direction: column; gap: 18px; }
.comparison-chart-row-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.comparison-chart-row-title { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); }
.comparison-chart-range { white-space: nowrap; }
.comparison-chart-body { position: relative; }
.comparison-chart-svg { width: 100%; height: 90px; overflow: visible; cursor: crosshair; }
.comparison-chart-svg polyline.chart-line { fill: none; stroke: var(--brand-primary, var(--series-4)); stroke-width: 2; vector-effect: non-scaling-stroke; }
.comparison-chart-row-anterior { opacity: 0.85; }
.comparison-chart-row-anterior .comparison-chart-svg polyline.chart-line { stroke: var(--text-muted); stroke-dasharray: 4 3; }
.comparison-chart-row-anterior .comparison-chart-row-title { text-transform: none; letter-spacing: normal; font-weight: 600; color: var(--text-muted); }

/* --- Público: demografia (cidades/países/faixa etária/gênero) --- */
.audience-block { margin-bottom: 22px; }
.audience-block:last-child { margin-bottom: 0; }
.audience-block-title { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin-bottom: 12px; }
.audience-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 20px; }
.audience-grid:last-child { margin-bottom: 0; }
@media (max-width: 600px) {
  .audience-grid { grid-template-columns: 1fr; }
}
.audience-panel-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; }

@media print {
  .tabs-nav { display: none !important; }
  .tab-panel { display: block !important; margin-bottom: 12px; }
  .tab-panel-print-label { display: block !important; }
}

/* --- Histórico de relatórios antigos (client_historico.html) --- */
.historico-passos { display: flex; flex-direction: column; gap: 24px; }
.historico-passo { display: flex; gap: 16px; align-items: flex-start; }
.historico-passo h3 { margin: 2px 0 4px; font-size: 16px; }
.historico-passo p { margin: 0 0 12px; color: var(--text-secondary); font-size: 14px; line-height: 1.5; max-width: 70ch; }
.historico-passo-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ffffff;
  background: var(--brand-secondary, var(--series-1));
}
.historico-niveis { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.nivel-tag { display: inline-block; min-width: 118px; padding: 2px 10px; margin-right: 8px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.nivel-essencial { background: #f07d1d; color: #ffffff; }
.nivel-recomendado { background: #fbc58f; color: #01253f; }
.nivel-opcional { background: #d9dde3; color: #01253f; }
.historico-upload { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.historico-upload input[type="file"] { font-size: 14px; max-width: 100%; }
.historico-erros { margin: 8px 0 0; padding-left: 20px; font-weight: 500; }
.historico-apagar { margin-top: 16px; }
.num { text-align: right; }
.resumo-sem-dado { color: var(--text-muted); }
