:root {
  --header-bg: url('assets/images/estatistica-header.jpg');
  --header-overlay: rgba(0, 0, 0, 0.50);
  --primary:   #0f3c46;
  --secondary: #1f6f78;
  --bg:        #f4f6f8;
  --success:   #27ae60;
  --danger:    #e74c3c;
  --warning:   #e67e22;
  --info:      #2980b9;
}

*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body { background: var(--bg); color: #333; }

/* ── Título ── */
.page-title-bar {
  background: #fff;
  padding: 20px 40px;
  border-bottom: 1px solid #e8ecee;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.page-title-bar h1 { font-size: 22px; font-weight: 700; color: var(--primary); margin-bottom: 2px; }
.page-title-bar p  { font-size: 13px; color: #9aabb0; }

/* ── Loading ── */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 0;
  color: #9aabb0;
  font-size: 14px;
}
.spinner {
  width: 24px; height: 24px;
  border: 3px solid #dde6e8;
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Container ── */
.page-container {
  max-width: 1000px;
  margin: 28px auto 80px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ── Seção genérica ── */
.stats-section {
  background: #fff;
  border-radius: 18px;
  padding: 28px 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}
.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.section-sub {
  font-size: 13px;
  color: #9aabb0;
  margin-bottom: 22px;
}

/* ══════════════════════════════════════════
   BLOCO 1 — VISÃO GERAL
   ══════════════════════════════════════════ */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.overview-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border-radius: 14px;
  padding: 18px 20px;
  border-left: 4px solid #d0dfe2;
  transition: transform 0.15s, box-shadow 0.15s;
}
.overview-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.09); }
.overview-card--accent { border-left-color: var(--secondary); }
.overview-card--fire   { border-left-color: #e67e22; }

.overview-icon { font-size: 28px; flex-shrink: 0; }

.overview-body { display: flex; flex-direction: column; }

.overview-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.overview-card--accent .overview-value { color: var(--secondary); }
.overview-card--fire   .overview-value { color: #e67e22; }

.overview-label { font-size: 12px; color: #9aabb0; margin-top: 3px; }
.overview-sub   { font-size: 11px; color: #bbb; margin-top: 2px; }

/* ══════════════════════════════════════════
   BLOCO 2 — DISTRIBUIÇÃO
   ══════════════════════════════════════════ */
.dist-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dist-bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 44px 110px;
  align-items: center;
  gap: 12px;
}

.dist-label { font-size: 14px; font-weight: 600; color: #555; }

.bar-track {
  height: 12px;
  background: #eef2f3;
  border-radius: 99px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 99px;
  width: 0%;
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.bar-fill--red    { background: var(--danger); }
.bar-fill--orange { background: var(--warning); }
.bar-fill--green  { background: var(--success); }
.bar-fill--blue   { background: var(--info); }

.bar-pct   { font-size: 13px; font-weight: 700; color: var(--primary); text-align: right; }
.bar-count { font-size: 12px; color: #9aabb0; }

/* ══════════════════════════════════════════
   BLOCO 3 — TOP BARALHOS
   ══════════════════════════════════════════ */
.top-decks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deck-stat-row {
  display: grid;
  grid-template-columns: 28px 1fr 160px 52px;
  align-items: center;
  gap: 12px;
}

.deck-stat-rank {
  font-size: 13px;
  font-weight: 700;
  color: #ccc;
}

.deck-stat-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck-stat-bar-wrap {
  height: 8px;
  background: #eef2f3;
  border-radius: 99px;
  overflow: hidden;
}

.deck-stat-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary), var(--accent, #27ae60));
  border-radius: 99px;
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.deck-stat-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary);
  text-align: right;
}

/* ══════════════════════════════════════════
   BLOCO 4 — ATIVIDADE DIÁRIA
   ══════════════════════════════════════════ */
.daily-grid {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 80px;
  padding-top: 8px;
  overflow-x: auto;
}

.day-cell {
  flex: 1;
  min-width: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  cursor: default;
}

.day-cell::before {
  content: '';
  display: block;
  width: 100%;
  height: var(--h, 0%);
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease;
}

.day-cell--empty::before  { background: #e8edf0; min-height: 4px; }
.day-cell--low::before    { background: #a8d5bc; }
.day-cell--high::before   { background: var(--success); }

.day-label {
  font-size: 9px;
  color: #bbb;
  margin-top: 4px;
  white-space: nowrap;
  transform: rotate(-45deg);
  transform-origin: center;
  display: none; /* mostra só em hover */
}

.day-cell:hover .day-label { display: block; }

/* ── Utilitários ── */
.no-data   { font-size: 14px; color: #9aabb0; text-align: center; padding: 20px 0; }
.error-row { font-size: 14px; color: var(--danger); text-align: center; padding: 40px 0; }

/* ── Responsivo ── */
@media (max-width: 860px) {
  .overview-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .overview-grid       { grid-template-columns: 1fr; }
  .dist-bar-row        { grid-template-columns: 90px 1fr 36px; }
  .dist-bar-row .bar-count { display: none; }
  .deck-stat-row       { grid-template-columns: 24px 1fr 40px; }
  .deck-stat-bar-wrap  { display: none; }
  .stats-section       { padding: 20px 18px; }
}
