/* ======================= ADERÊNCIA ======================= */

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.cal-nav b {
  font-family: "Baloo 2", sans-serif;
  font-size: 16px;
}

/* 7 colunas fixas, sempre começando na segunda. O dia 1 é empurrado por
   .cal-pad até a coluna do seu dia da semana — assim todo mês tem o mesmo
   formato, comece no dia que começar. */
.cal-head,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.cal-head {
  margin-bottom: 5px;
}
.cal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 0;
  border-radius: 9px;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  background: var(--field);
  color: var(--ink);
}
.cd-n {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.cd-r {
  font-size: 9px;
  line-height: 1;
  opacity: 0.85;
}

/* Cores próprias, não os tokens de macro: aqui verde/amarelo/vermelho têm
   significado semântico e precisam de contraste suficiente para o texto
   branco por cima. */
.cal-day.green {
  background: var(--ok);
  color: var(--on-accent);
}
.cal-day.yellow {
  background: var(--warn);
  color: var(--on-accent);
}
.cal-day.red {
  background: var(--bad);
  color: var(--on-accent);
}
.cal-day.empty {
  background: var(--field);
  color: var(--muted);
}
.cal-day.future {
  background: transparent;
  color: var(--muted);
  opacity: 0.45;
}
.cal-day.today {
  outline: 2px solid var(--blue-solid);
  outline-offset: 1px;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--muted);
}
.cal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.cal-legend .sw {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-block;
}
.cal-legend .sw.green {
  background: var(--ok);
}
.cal-legend .sw.yellow {
  background: var(--warn);
}
.cal-legend .sw.red {
  background: var(--bad);
}
.cal-legend .sw.empty {
  background: var(--field);
  border: 1px solid var(--line);
}

/* .stat-row nasceu com 3 colunas (TMB/gasto/meta). Aqui são 4 números, e a
   quarta cairia sozinha numa linha — 2×2 divide melhor a largura do celular. */
#aStats .stat-row {
  grid-template-columns: repeat(2, 1fr);
}

.day-detail {
  margin: 0;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--ink);
}
