/* KPIs */
.kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
@media (min-width: 720px) {
  .kpis { grid-template-columns: repeat(4, 1fr); }
}
.kpi-card {
  background: white;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  border-left: 4px solid #cbd5e1;
}
.kpi-blue   { border-left-color: #2563eb; }
.kpi-orange { border-left-color: #f59e0b; }
.kpi-green  { border-left-color: #059669; }
.kpi-red    { border-left-color: #dc2626; }
.kpi-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 4px;
}
.kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}
.kpi-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Gráfico de meses (barras verticais com CSS) */
.grafico-meses {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  height: 200px;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
}
.mes-coluna {
  flex: 1;
  min-width: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
}
.mes-barra {
  width: 80%;
  background: linear-gradient(to top, #2563eb, #60a5fa);
  border-radius: 6px 6px 0 0;
  min-height: 2px;
  position: relative;
  transition: opacity 0.2s;
}
.mes-barra:hover { opacity: 0.85; }
.mes-valor {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: #1e40af;
  white-space: nowrap;
  background: white;
  padding: 1px 4px;
  border-radius: 4px;
}
.mes-label {
  font-size: 10px;
  color: #64748b;
  margin-top: 4px;
  text-align: center;
  text-transform: capitalize;
  font-weight: 500;
}
.mes-coluna.atual .mes-barra {
  background: linear-gradient(to top, #059669, #34d399);
}
.mes-coluna.atual .mes-valor {
  color: #047857;
}

/* Tabela rank com barra horizontal */
.tabela-rank {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rank-linha {
  display: flex;
  align-items: center;
  gap: 12px;
}
.rank-posicao {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.rank-posicao.top1 { background: #fbbf24; color: white; }
.rank-posicao.top2 { background: #94a3b8; color: white; }
.rank-posicao.top3 { background: #d97706; color: white; }

.rank-conteudo {
  flex: 1;
  min-width: 0;
}
.rank-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.rank-nome {
  font-weight: 600;
  font-size: 14px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-valor {
  font-weight: 700;
  font-size: 14px;
  color: #059669;
  white-space: nowrap;
  flex-shrink: 0;
}
.rank-sub {
  font-size: 11px;
  color: #94a3b8;
}
.rank-barra-bg {
  height: 4px;
  background: #f1f5f9;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.rank-barra-fill {
  height: 100%;
  background: linear-gradient(to right, #2563eb, #60a5fa);
  border-radius: 2px;
}
.rank-barra-fill.qty { background: linear-gradient(to right, #f59e0b, #fbbf24); }
.rank-barra-fill.warning { background: linear-gradient(to right, #dc2626, #f87171); }
