/* ==========================================================
   Descomplica Direito — melhorias do Dashboard
   ========================================================== */

/* ---------- Barras de meta nos cards ---------- */
.dd-meta {
  margin-top: 6px;
}

.dd-meta-barra {
  height: 6px;
  border-radius: 6px;
  background: #e5ecf9;
  overflow: hidden;
}

.dd-meta-barra i {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: #0071bc;
  transition: width .6s ease;
}

.dd-meta-txt {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #0071bc;
}

.painel-resumo .resumo-card:nth-child(-n+4) .dd-meta-barra {
  background: rgba(255, 255, 255, .22);
}

.painel-resumo .resumo-card:nth-child(-n+4) .dd-meta-barra i {
  background: #d4af37;
}

.painel-resumo .resumo-card:nth-child(-n+4) .dd-meta-txt {
  color: #d4af37;
}

body.tema-escuro .dd-meta-barra {
  background: rgba(255, 255, 255, .12);
}

body.tema-escuro .dd-meta-txt {
  color: #7cc0ef;
}

/* ---------- Linha de medidores ---------- */
.dd-medidores {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
  align-items: stretch;
}

.dd-medidor {
  min-width: 0;
}

.dd-medidor-corpo {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
}

.dd-svg {
  width: 100%;
  max-width: 150px;
  height: auto;
}

.dd-svg-rosca {
  max-width: 110px;
}

.dd-g-fundo {
  stroke: #e5ecf9;
}

.dd-g-num {
  font-size: 22px;
  font-weight: 800;
  fill: #1f2937;
}

.dd-svg-rosca .dd-g-num {
  font-size: 20px;
  fill: #0071bc;
}

.dd-rot {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
}

.dd-sub {
  font-size: 11px;
  color: #64748b;
}

/* Hoje */
.dd-hoje {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dd-hoje-l {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #e5ecf9;
  font-size: 13px;
  color: #1f2937;
  text-align: left;
}

.dd-hoje-l b {
  flex: 1;
  font-weight: 600;
}

.dd-hoje-l em {
  font-style: normal;
  font-weight: 800;
}

.dd-hoje-tot {
  background: #0b1d33;
  color: #fff;
}

.dd-luz {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Pontos de atenção */
.dd-medidor-corpo:has(.dd-atencao),
.dd-medidor-corpo:has(.dd-vazio),
.dd-medidor-corpo:has(.dd-ok) {
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
  gap: 8px;
}

.dd-atencao {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #fdecec;
  border-left: 4px solid #e74c3c;
}

.dd-atencao b {
  display: block;
  font-size: 13px;
  color: #1f2937;
}

.dd-atencao small {
  font-size: 11px;
  color: #64748b;
}

.dd-atencao strong {
  color: #c0392b;
  font-size: 15px;
}

.dd-link {
  font-size: 12px;
  font-weight: 700;
  color: #0071bc;
  text-decoration: none;
}

.dd-vazio,
.dd-ok {
  font-size: 13px;
  color: #64748b;
  padding: 8px 0;
}

.dd-ok {
  color: #1e8e5a;
  font-weight: 600;
}

/* ---------- Desempenho por disciplina ---------- */
.dd-disc {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  flex: 1;
}

.dd-disc-linha {
  display: grid;
  grid-template-columns: minmax(170px, 1.7fr) 2.2fr 46px 52px;
  align-items: center;
  gap: 12px;
}

.dd-disc-nome {
  font-size: 13px;
  color: #1f2937;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dd-disc-q {
  font-size: 11px;
  color: #94a3b8;
  text-align: right;
}

/* ---------- Nota do gráfico de evolução ---------- */
.dd-nota-graf {
  margin-top: 8px;
  font-size: 11px;
  text-align: center;
  color: #94a3b8;
}

/* ---------- Tema escuro ---------- */
body.tema-escuro .dd-g-fundo {
  stroke: rgba(255, 255, 255, .12);
}

body.tema-escuro .dd-g-num,
body.tema-escuro .dd-rot,
body.tema-escuro .dd-disc-nome,
body.tema-escuro .dd-atencao b {
  color: #e6eef5;
  fill: #e6eef5;
}

body.tema-escuro .dd-svg-rosca .dd-g-num {
  fill: #7cc0ef;
}

body.tema-escuro .dd-sub,
body.tema-escuro .dd-atencao small {
  color: #94a3b8;
}

body.tema-escuro .dd-hoje-l {
  background: rgba(255, 255, 255, .08);
  color: #e6eef5;
}

body.tema-escuro .dd-hoje-tot {
  background: #061824;
}

body.tema-escuro .dd-atencao {
  background: rgba(231, 76, 60, .14);
}

body.tema-escuro .dd-atencao strong {
  color: #f87171;
}

body.tema-escuro .dd-link {
  color: #7cc0ef;
}

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .dd-medidores {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .dd-medidores {
    grid-template-columns: 1fr;
  }

  .dd-disc-linha {
    grid-template-columns: 1fr 44px;
    gap: 4px 10px;
  }

  .dd-disc-nome {
    grid-column: 1 / -1;
  }

  .dd-disc-q {
    display: none;
  }
}

#dashBarChart:has(.dd-disc) {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ---------- Medidores mais baixos ---------- */
.dd-medidor.dash-inner-card {
  padding: 12px 16px;
}

.dd-medidor .dash-inner-titulo {
  margin: -12px -16px 8px -16px;
  padding: 9px 16px;
}

.dd-medidor-corpo {
  gap: 0;
}

.dd-svg {
  max-width: 104px;
}

.dd-svg-rosca {
  max-width: 82px;
}

.dd-g-num {
  font-size: 20px;
}

.dd-rot {
  font-size: 12px;
}

.dd-sub {
  font-size: 10px;
}

.dd-hoje {
  gap: 5px;
}

.dd-hoje-l {
  padding: 4px 10px;
  font-size: 12px;
}

.dd-luz {
  width: 11px;
  height: 11px;
}

.dd-medidor-corpo:has(.dd-atencao),
.dd-medidor-corpo:has(.dd-vazio),
.dd-medidor-corpo:has(.dd-ok) {
  gap: 5px;
}

.dd-atencao {
  padding: 5px 10px;
}

.dd-atencao b {
  font-size: 12px;
}

.dd-atencao strong {
  font-size: 14px;
}

/* ==========================================================
   Cores dos 4 primeiros cards — modelo azul da cabine
   ========================================================== */
html body .painel-resumo .resumo-card:nth-child(-n+4),
html body.tema-escuro .painel-resumo .resumo-card:nth-child(-n+4) {
  background: linear-gradient(135deg, #061b33, #0a3d75) !important;
  border: 1px solid rgba(198, 215, 242, .14);
}

html body .painel-resumo .resumo-card:nth-child(-n+4) .label {
  color: #c6d7f2 !important;
}

html body .painel-resumo .resumo-card:nth-child(-n+4) .resumo-card-icone {
  background: rgba(255, 255, 255, .12) !important;
  color: #c6d7f2 !important;
}

html body .painel-resumo .resumo-card:nth-child(-n+4) .resumo-card-delta {
  color: #f5b301 !important;
}

html body .painel-resumo .resumo-card:nth-child(-n+4) .dd-meta-barra {
  background: rgba(255, 255, 255, .16);
}

html body .painel-resumo .resumo-card:nth-child(-n+4) .dd-meta-barra i {
  background: #f5b301;
}

html body .painel-resumo .resumo-card:nth-child(-n+4) .dd-meta-txt {
  color: #f5b301;
}

/* ==========================================================
   Saudação — modelo cartão branco (Olá, aluno)
   ========================================================== */
html body .dash-perfil {
  background: #ffffff;
  border: 1px solid #c6d7f2;
  border-radius: 14px;
  padding: 9px 18px 9px 10px;
  box-shadow: 0 2px 10px rgba(0, 113, 188, .10);
}

html body .dash-perfil-avatar {
  width: 38px;
  height: 38px;
  font-size: 16px;
  background: #0071bc;
  box-shadow: none;
}

html body .dash-perfil-nome {
  color: #1f2937;
  font-size: 15px;
}

html body:not(.tema-escuro) .dash-perfil-sub,
html body .dash-perfil-sub {
  color: #0071bc !important;
  font-size: 12.5px !important;
  font-weight: 600;
}

html body.tema-escuro .dash-perfil {
  background: #0f1c2b;
  border-color: rgba(198, 215, 242, .18);
}

html body.tema-escuro .dash-perfil-nome {
  color: #e6eef5;
}

html body.tema-escuro .dash-perfil-sub {
  color: #7cc0ef !important;
}
