/* ============================================================
   TECSA – App Paciente | evolucao_v5.css
   Design tokens from Figma: HANDOFFs / node 2901-16994
   Reusa as variáveis e o .card definidos em home_v5.css (mesmo layout).
   ============================================================ */

:root {
  --color-calendar-perfeito: #58E590;
}

/* ============================================================
   TOPO ESCURO: nav de datas + abas de período + resumo + insights
   ============================================================ */
.evolucao-top-bar {
  background: var(--color-principal);
  padding: 8px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.evolucao-date-range {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.evolucao-date-range-label {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-white);
  white-space: nowrap;
  padding: 0 16px;
}

.evolucao-period-tabs {
  display: flex;
  gap: 8px;
  width: 100%;
}
.evolucao-period-tab {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 8px;
  border: 1px solid var(--color-white);
  background: transparent;
  box-shadow: 0 2px 2px 0 rgba(0,0,0,0.05);
  color: var(--color-white);
  text-align: center;
}
.evolucao-period-tab.active {
  background: rgba(0,0,0,0.5);
}
.evolucao-period-tab-main {
  font-size: 16px;
  font-weight: 600;
  line-height: normal;
}
.evolucao-period-tab-sub {
  font-size: 12px;
  font-weight: 400;
  line-height: normal;
}

.evolucao-hero {
  background: linear-gradient(to bottom, var(--color-principal), var(--color-principal-dk));
  padding: 16px 16px 24px;
  flex-shrink: 0;
}

/* ---------- RESUMO card ---------- */
.evolucao-resumo-card {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.evolucao-resumo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}
.evolucao-resumo-header-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.evolucao-resumo-title-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-bottom: 12px;
}
.evolucao-resumo-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-white);
  white-space: nowrap;
}
.evolucao-info-icon { width: 12px; height: 12px; object-fit: contain; flex-shrink: 0; }

.evolucao-resumo-kcal-row {
  display: flex;
  align-items: center;
  gap: 11px;
}
.evolucao-resumo-flame { width: 20px; height: 28.67px; object-fit: contain; flex-shrink: 0; }
.evolucao-resumo-kcal-text p { color: var(--color-white); white-space: nowrap; }
.evolucao-resumo-kcal-text .num { font-size: 30px; font-weight: 600; }
.evolucao-resumo-kcal-text .unit { font-size: 18px; font-weight: 400; }
.evolucao-resumo-kcal-text .label { font-size: 14px; font-weight: 400; }

.evolucao-resumo-ring-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.evolucao-resumo-ring {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}
.evolucao-resumo-ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.evolucao-resumo-ring-track {
  fill: none;
  stroke: rgba(255,255,255,0.2);
  stroke-width: 11;
}
.evolucao-resumo-ring-arc {
  fill: none;
  stroke: var(--color-secundaria);
  stroke-width: 11;
  stroke-linecap: round;
  transition: stroke-dasharray 0.8s ease;
}
.evolucao-resumo-ring-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  color: var(--color-white);
}
.evolucao-resumo-ring-pct span { font-size: 24px; }
.evolucao-resumo-plano-text {
  font-size: 12px;
  color: var(--color-white);
  white-space: nowrap;
  line-height: 1.4;
}
.evolucao-resumo-plano-text strong { font-size: 14px; font-weight: 600; }

.evolucao-resumo-divider {
  height: 1px;
  width: 100%;
  background: rgba(255,255,255,0.15);
}

.evolucao-resumo-nutrientes {
  display: flex;
  gap: 24px;
  align-items: center;
  width: 100%;
}
.evolucao-nutriente {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.evolucao-nutriente-valor {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-white);
}
.evolucao-nutriente-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 100px;
  overflow: hidden;
}
.evolucao-nutriente-bar-fill { height: 100%; border-radius: 100px; }
.evolucao-nutriente-bar-fill.proteinas    { background: var(--color-macro-protein); }
.evolucao-nutriente-bar-fill.carboidratos { background: var(--color-macro-carbs); }
.evolucao-nutriente-bar-fill.fibras       { background: var(--color-macro-fiber); }
.evolucao-nutriente-bar-fill.gorduras     { background: var(--color-macro-fat); }
.evolucao-nutriente-label {
  font-size: 12px;
  color: var(--color-white);
}

/* ---------- INSIGHTS row ---------- */
.evolucao-insights {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.evolucao-insight-card {
  flex: 1;
  min-width: 0;
  background: var(--color-white);
  border-radius: 8px;
  box-shadow: 0 2px 2px 0 rgba(0,0,0,0.05);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.evolucao-insight-icon { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.evolucao-insight-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.evolucao-insight-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-principal);
  line-height: normal;
}
.evolucao-insight-label {
  font-size: 10px;
  color: var(--color-text);
  line-height: normal;
}

/* ============================================================
   CORPO CLARO: mensagem de status + calendário
   ============================================================ */
.evolucao-body {
  background: var(--color-bg-grey);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- MSG_STATUS ---------- */
.evolucao-msg-status {
  display: flex;
  align-items: center;
  gap: 8px;
}
.evolucao-msg-text-row {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.evolucao-msg-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-calendar-perfeito);
  flex-shrink: 0;
}
.evolucao-msg-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 16px;
}
.evolucao-msg-badge-col {
  width: 100px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.evolucao-msg-badge-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
}
.evolucao-msg-gradient-bar {
  position: relative;
  height: 8px;
  border-radius: 100px;
  background: linear-gradient(to right, var(--color-alert), var(--color-warning) 51.44%, var(--color-calendar-perfeito));
}
.evolucao-msg-gradient-marker {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 16px;
  background: var(--color-text);
  border-radius: 1px;
}

/* ---------- CALENDARIO_EVOLUCAO ---------- */
.evolucao-calendario-weekdays {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}
.evolucao-calendario-weekdays span {
  width: 40px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #A4A4A4;
}

.evolucao-calendario-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  row-gap: 8px;
  width: 100%;
}
.evolucao-calendario-day {
  width: 40px;
  height: 40px;
  border-radius: 80px;
  background: var(--color-white);
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  color: #676565;
}
.evolucao-calendario-day.perfeito { border-color: var(--color-calendar-perfeito); }
.evolucao-calendario-day.regular  { border-color: var(--color-warning); }
.evolucao-calendario-day.alerta   { border-color: var(--color-alert); }
.evolucao-calendario-day.futuro   { border-color: transparent; color: #C4C4C4; }

.evolucao-calendario-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  background: #F6F3F3;
  border-radius: 4px;
  padding: 4px 0;
  margin-top: 8px;
  width: 100%;
}
.evolucao-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--color-text);
  white-space: nowrap;
}
.evolucao-legend-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.evolucao-legend-item .dot.perfeito { background: var(--color-calendar-perfeito); }
.evolucao-legend-item .dot.regular  { background: var(--color-warning); }
.evolucao-legend-item .dot.alerta   { background: var(--color-alert); }

/* ============================================================
   GRÁFICO DE BARRAS (reusado por Histórico, Hidratação, Atividade)
   ============================================================ */
.evolucao-bar-chart {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 145px;
  padding-top: 8px;
}
.evolucao-bar-chart-gridlines {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.evolucao-bar-chart-gridlines span {
  display: block;
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
}
.evolucao-bar-col {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}
.evolucao-bar-fill {
  width: 17px;
  border-radius: 40px 40px 0 0;
  flex-shrink: 0;
}
.evolucao-bar-baseline {
  width: 55px;
  max-width: 100%;
  height: 1px;
  background: #E4E0E0;
  flex-shrink: 0;
}
.evolucao-bar-label {
  font-size: 12px;
  color: #707070;
  padding-top: 4px;
  text-align: center;
  white-space: nowrap;
}

/* ============================================================
   HISTÓRICO (nutrientes)
   ============================================================ */
.evolucao-filtros-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  margin: 0 -4px;
}
.evolucao-filtros-scroll::-webkit-scrollbar { display: none; }
.evolucao-filtros {
  display: flex;
  gap: 10px;
  padding: 10px 4px;
  width: max-content;
}
.evolucao-filtro-pill {
  padding: 12px;
  border-radius: 8px;
  background: var(--color-bg-light);
  color: var(--color-text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.evolucao-filtro-pill.active {
  background: var(--color-principal);
  color: var(--color-white);
}

.evolucao-historico-legenda {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  flex-wrap: wrap;
}
.evolucao-legenda-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}
.evolucao-legenda-item .linha {
  width: 10px;
  height: 0;
  border-top: 1px solid var(--color-text);
  display: inline-block;
}
.evolucao-legenda-item .linha.meta-kcal { border-top-color: var(--color-principal); }
.evolucao-legenda-item .linha.media     { border-top-color: var(--color-warning); border-top-style: dashed; }

/* ============================================================
   HIDRATAÇÃO (Água)
   ============================================================ */
.evolucao-hidratacao-topo {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 4px 0;
}
.evolucao-hidratacao-total {
  flex: 1;
  min-width: 0;
  text-align: center;
}
.evolucao-hidratacao-total .num { font-size: 42px; font-weight: 600; color: var(--color-text); }
.evolucao-hidratacao-total .unit { font-size: 20px; font-weight: 600; color: var(--color-text); }
.evolucao-hidratacao-total .label { font-size: 14px; font-weight: 600; color: var(--color-text); }
.evolucao-hidratacao-desc {
  width: 156px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: #5C5B5B;
  padding: 2px 0 4px;
}

.evolucao-hidratacao-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #FFF9C0;
  border-radius: 8px;
  padding: 8px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
}
.evolucao-hidratacao-divisor {
  width: 1px;
  height: 14px;
  background: var(--color-text);
  flex-shrink: 0;
}

/* ============================================================
   EVOLUÇÃO (PESO)
   ============================================================ */
.evolucao-peso .card-header { position: relative; }
.evolucao-peso-menu-btn {
  width: 18px;
  height: 19px;
  margin-left: auto;
  flex-shrink: 0;
}
.evolucao-peso-menu-btn img { width: 100%; height: 100%; object-fit: contain; }

.evolucao-peso-stats {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 0;
}
.evolucao-peso-atual {
  flex: 1;
  min-width: 0;
  text-align: center;
  border-right: 1px solid var(--color-bg-light);
  padding-right: 11px;
}
.evolucao-peso-atual .num { font-size: 45px; font-weight: 600; color: var(--color-principal); }
.evolucao-peso-atual .unit { font-size: 20px; font-weight: 400; color: var(--color-principal); }
.evolucao-peso-delta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 2px 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}
.evolucao-peso-delta-icon { width: 13px; height: 18.57px; object-fit: contain; }

.evolucao-peso-imc {
  flex: 1;
  min-width: 0;
  text-align: center;
}
.evolucao-peso-imc-label { font-size: 10px; font-weight: 600; color: var(--color-text); padding: 2px 0 4px; }
.evolucao-peso-imc-valor { font-size: 22px; font-weight: 600; color: var(--color-text); }
.evolucao-peso-imc-valor .unit { font-size: 16px; font-weight: 400; }
.evolucao-peso-imc-bar {
  width: 100%;
  height: 6px;
  border-radius: 100px;
  background: linear-gradient(to right, #CB1A1A, #E2E0E0 73.558%);
  margin: 4px 0;
  position: relative;
}
.evolucao-peso-imc-bar-fill {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 12px;
  background: var(--color-text);
  border-radius: 1px;
}
.evolucao-peso-imc-caption { font-size: 12px; font-weight: 400; color: var(--color-text); }

.evolucao-peso-grafico {
  width: 100%;
  padding: 8px 0;
}
.evolucao-peso-grafico img {
  width: 100%;
  aspect-ratio: 661 / 257;
  object-fit: cover;
  border-radius: 8px;
}

/* ============================================================
   ATIVIDADE FÍSICA
   ============================================================ */
.evolucao-atividade-stats {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 4px 0;
}
.evolucao-atividade-treinos {
  width: 200px;
  flex-shrink: 0;
  text-align: center;
}
.evolucao-atividade-treinos .num { font-size: 50px; font-weight: 600; color: var(--color-principal); line-height: normal; }
.evolucao-atividade-treinos .label { font-size: 14px; font-weight: 400; color: var(--color-principal); }

.evolucao-atividade-detalhes {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.evolucao-atividade-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.evolucao-atividade-icon { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.evolucao-atividade-item p { color: var(--color-text); white-space: nowrap; }
.evolucao-atividade-item .num { font-size: 18px; font-weight: 600; }
.evolucao-atividade-item .unit { font-size: 14px; font-weight: 400; }
.evolucao-atividade-item .label { font-size: 14px; font-weight: 400; }

.evolucao-atividade-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #FFF9C0;
  border-radius: 8px;
  padding: 8px;
  margin-top: 16px;
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text);
  text-align: center;
}
.evolucao-atividade-footer img { width: 16px; height: 16px; object-fit: contain; }

/* ============================================================
   SINTOMAS
   ============================================================ */
.evolucao-sintomas-body {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
  padding-top: 4px;
}
.evolucao-sintomas-principal {
  flex: 1;
  min-width: 0;
  text-align: center;
}
.evolucao-sintomas-nome { font-size: 14px; font-weight: 600; color: var(--color-text); }
.evolucao-sintomas-valor { font-size: 60px; font-weight: 600; color: var(--color-principal); padding-top: 2px; }
.evolucao-sintomas-nivel { font-size: 14px; font-weight: 400; color: var(--color-text); }
.evolucao-sintomas-escala {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
}
.evolucao-sintomas-escala span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #999999;
}
.evolucao-sintomas-escala span.ativo { background: var(--color-principal); }

.evolucao-sintomas-situacao {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.evolucao-sintomas-situacao-icon { width: 50px; height: 50px; object-fit: contain; flex-shrink: 0; }
.evolucao-sintomas-situacao p { color: var(--color-text); white-space: nowrap; }
.evolucao-sintomas-situacao .label { font-size: 12px; font-weight: 400; }
.evolucao-sintomas-situacao .valor { font-size: 16px; font-weight: 600; }
.evolucao-sintomas-situacao .valor span:last-child { font-size: 12px; font-weight: 400; }
