/* NutriPanel — Clean Apple Health & MyFitnessPal Views */

/* ---------- Diário: Calorias & Macronutrientes (Hero) ---------- */
.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: center;
}

.hero-kcal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-right: 40px;
  border-right: 1px solid var(--line);
}

.ring {
  position: relative;
  width: 170px;
  height: 170px;
  flex: none;
}

.ring svg {
  transform: rotate(-90deg);
  display: block;
  width: 100%;
  height: 100%;
}

.ring circle {
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.ring-mid {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.ring-num {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.ring-cap {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 5px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ring-over {
  color: var(--critical) !important;
}

.kcal-sum {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.kcal-sum b {
  color: #ffffff;
  font-weight: 600;
}

/* Macro Rings (Apple Activity Style) */
.macros-wrap {
  flex: 1;
  min-width: 0;
}

.macros-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.mrings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mring {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  min-width: 0;
  padding: 14px 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 0.15s ease;
}

.mring:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.mring-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.mring .ring {
  width: 86px;
  height: 86px;
}

.mring .ring-num {
  font-size: 18px;
  font-weight: 700;
}

.mring .ring-cap {
  font-size: 10.5px;
  margin-top: 1px;
}

.mring-left {
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.mring-left.over {
  color: var(--critical);
  font-weight: 600;
}

/* ---------- Barras de Macro ---------- */
.macros {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.macro-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
}

.macro-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.macro-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  color: #ffffff;
}

.macro-val i {
  font-style: normal;
  color: var(--muted);
}

.track {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.fill {
  height: 100%;
  border-radius: var(--pill);
  transition: width 0.4s ease;
}

/* ---------- Estatísticas ---------- */
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-k {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-v {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.stat-v small {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.stat-n {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Refeições MyFitnessPal Style ---------- */
.meal {
  border-top: 1px solid var(--line);
  padding: 16px 0 8px;
}

.meal:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.meal-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.meal-n {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 15.5px;
  font-weight: 700;
  color: #ffffff;
}

.meal-k {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--hairline);
  margin-bottom: 6px;
  transition: all 0.12s ease;
}

.entry:hover {
  background: rgba(255, 255, 255, 0.04);
}

.entry-b {
  flex: 1;
  min-width: 0;
}

.entry-l {
  font-size: 14px;
  font-weight: 600;
  color: #f2f2f7;
  line-height: 1.3;
}

.entry-m {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}

.entry-k {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.entry-k::after {
  content: " kcal";
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.del {
  border: 0;
  background: transparent;
  color: var(--muted-dark);
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.12s ease;
}

.del:hover {
  color: var(--critical);
  background: rgba(255, 69, 58, 0.12);
}

.del svg {
  width: 14px;
  height: 14px;
  display: block;
}

/* ---------- Chips Apple Pill ---------- */
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  padding: 5px 12px;
  min-height: 30px;
  border-radius: var(--pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s ease;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.chip.on {
  border: 1px solid rgba(10, 132, 255, 0.35);
  background: rgba(10, 132, 255, 0.12);
  color: var(--primary);
  font-weight: 600;
}

/* ---------- Gráficos ---------- */
.chart {
  position: relative;
  width: 100%;
}

.chart svg {
  display: block;
  width: 100%;
  overflow: visible;
}

.ax {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--muted);
}

.gridline {
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 1;
}

.goalline {
  stroke: rgba(10, 132, 255, 0.5);
  stroke-width: 1.25;
  stroke-dasharray: 4 4;
}

.tip {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  transform: translate(-50%, -115%);
  background: #1c1d22;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s ease;
  box-shadow: var(--shadow-2);
}

.tip.on {
  opacity: 1;
}

.tip .tk {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--primary);
  display: block;
}

/* ---------- Sequência (Streak Card) ---------- */
.streak {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.streak-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.streak-flame {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: #ff9f0a;
}

.streak-n {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.streak-l {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  font-weight: 500;
}

.sdays {
  display: flex;
  gap: 8px;
}

.sd-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.sd-w {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 600;
}

.sd {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 10.5px;
}

.sd.on {
  background: rgba(48, 209, 88, 0.2);
  border-color: rgba(48, 209, 88, 0.45);
  color: var(--good);
}

.sd.now {
  border-color: var(--primary);
}

.sd-n {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

/* Tabelas */
.scroll-x {
  overflow-x: auto;
  border-radius: var(--r-sm);
}

.data {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 13.5px;
}

.data th {
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--line);
}

.data th:first-child, .data td:first-child {
  text-align: left;
}

.data td {
  padding: 12px;
  border-bottom: 1px solid var(--divider-soft);
  color: #ffffff;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.data tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Responsividade Mobile Hero */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .hero-kcal {
    border-right: 0;
    padding-right: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 24px;
  }
  .mrings {
    grid-template-columns: 1fr;
  }
}

/* ---------- Calendário & Agenda ---------- */
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 14px;
}

.cal-dow {
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 0;
  text-transform: uppercase;
}

.cal-cell {
  position: relative;
  min-height: 58px;
  padding: 7px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
  color: var(--ink);
}

.cal-cell:hover:not(.fut):not(.blank) {
  background: rgba(255, 255, 255, 0.06);
}

.cal-cell.blank {
  background: transparent;
  border: 0;
  cursor: default;
}

.cal-cell.fut {
  opacity: 0.2;
  cursor: default;
}

.cal-cell.ok {
  background: rgba(48, 209, 88, 0.1);
  border-color: rgba(48, 209, 88, 0.3);
  color: #30d158;
}

.cal-cell.over {
  background: rgba(255, 69, 58, 0.1);
  border-color: rgba(255, 69, 58, 0.3);
  color: #ff453a;
}

.cal-cell.today {
  box-shadow: 0 0 0 2px var(--primary);
}

.cal-cell span {
  font-size: 12.5px;
  font-weight: 600;
}

.cal-cell em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
}

/* ---------- Fotos ---------- */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.shot {
  margin: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--canvas-surface);
  border: 1px solid var(--line);
}

.shot img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}

.shot figcaption {
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink);
}

.vs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.vs figure {
  margin: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--canvas-surface);
  border: 1px solid var(--line);
}

.vs img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}

.vs figcaption {
  padding: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Lista de Alimentos no Modal ---------- */
.food-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
}

.food-hit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  transition: all 0.12s ease;
  color: var(--ink);
  width: 100%;
}

.food-hit:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
}

.food-hit b {
  display: block;
  font-size: 13.5px;
  color: #ffffff;
}

.food-hit em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
}