/* ============================================================================
   DASHBOARD DO GITHUB (pages/dashboard.html)
   Usa as variáveis de style.css
   ============================================================================ */

.perfil-gh {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.2rem;
}
.perfil-gh img { width: 84px; height: 84px; border-radius: 50%; border: 2px solid var(--primary); }
.perfil-gh .info { flex: 1 1 260px; }
.perfil-gh h2 { font-size: 1.4rem; }
.perfil-gh .login { font-family: var(--mono); color: var(--primary); font-size: 0.9rem; }
.perfil-gh .bio { color: var(--muted); margin-top: 0.3rem; }
.perfil-gh .meta { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; color: var(--muted); font-size: 0.88rem; margin-top: 0.5rem; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.2rem;
  margin-top: 1.2rem;
}
.painel {
  grid-column: span 6;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  min-width: 0;
}
.painel.largo { grid-column: span 12; }
.painel.terco { grid-column: span 4; }
.painel.dois-tercos { grid-column: span 8; }
.painel h3 { font-size: 1rem; margin-bottom: 0.2rem; }
.painel .sub { color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }

/* Linguagens: rosca + lista */
.langs { display: grid; grid-template-columns: 200px 1fr; gap: 1.5rem; align-items: center; }
.langs .grafico { position: relative; width: 200px; height: 200px; }
.lang-lista { list-style: none; display: grid; gap: 0.55rem; }
.lang-lista li { display: grid; grid-template-columns: auto 1fr auto; gap: 0.6rem; align-items: center; font-size: 0.92rem; }
.lang-lista .barra { grid-column: 1 / -1; height: 4px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.lang-lista .barra span { display: block; height: 100%; border-radius: 4px; }
.lang-lista .pct { font-variant-numeric: tabular-nums; color: var(--muted); }

.grafico-barras { position: relative; height: 240px; }

/* Mapa de calor de atividade */
.heatmap-wrap { overflow-x: auto; padding-bottom: 0.3rem; }
.heatmap {
  display: grid;
  grid-template-rows: repeat(7, 13px);
  grid-auto-flow: column;
  grid-auto-columns: 13px;
  gap: 3px;
  width: max-content;
}
.heatmap i { border-radius: 3px; background: var(--surface-2); }
.heatmap i[data-n="1"] { background: #0b4f58; }
.heatmap i[data-n="2"] { background: #087887; }
.heatmap i[data-n="3"] { background: #00a3b8; }
.heatmap i[data-n="4"] { background: #4dd9ea; }
.heatmap-legenda { display: flex; align-items: center; gap: 4px; font-size: 0.78rem; color: var(--muted); margin-top: 0.7rem; }
.heatmap-legenda i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* Atividade recente */
.feed { list-style: none; display: grid; gap: 0.2rem; }
.feed li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.feed li:last-child { border-bottom: none; }
.feed .ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); font-size: 0.85rem; }
.feed a { color: var(--text); text-decoration: none; font-weight: 600; }
.feed a:hover { color: var(--primary); }
.feed time { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }

/* Tabela de repositórios */
.tabela-wrap { overflow-x: auto; }
.tabela { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tabela th, .tabela td { padding: 0.65rem 0.6rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tabela th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.tabela td.num, .tabela th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tabela a { color: var(--text); text-decoration: none; font-weight: 600; }
.tabela a:hover { color: var(--primary); }
.tabela tbody tr:hover { background: var(--surface-2); }

.aviso-cache { color: var(--muted); font-size: 0.82rem; margin-top: 1.5rem; }

@media (max-width: 900px) {
  .painel, .painel.terco, .painel.dois-tercos { grid-column: span 12; }
}
@media (max-width: 520px) {
  .langs { grid-template-columns: 1fr; justify-items: center; }
  .lang-lista { width: 100%; }
}

/* ---- ajustes: mapa de atividade com resumo ao lado ---- */
.painel { align-self: start; }
.atividade { display: grid; grid-template-columns: minmax(0, 400px) 1fr; gap: 2rem; align-items: start; }
.heatmap {
  grid-template-rows: repeat(7, auto);
  grid-auto-columns: 1fr;
  gap: 4px;
  width: 100%;
}
.heatmap i { aspect-ratio: 1; border-radius: 4px; }
.resumo { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.resumo div { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 0.8rem 1rem; min-width: 0; }
.resumo dt { color: var(--muted); font-size: 0.82rem; }
.resumo dd { font-size: 1.25rem; font-weight: 800; overflow-wrap: anywhere; }
@media (max-width: 900px) { .atividade { grid-template-columns: 1fr; } }
