/* backend/kalorien.css */

body {
  font-family: -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  background: #f5f5f7;
  margin: 0;
  padding: 20px;
  color: #333;
  overflow-x: hidden;
}

h1 {
  font-weight: 600;
  font-size: 28px;
  color: #111;
  margin-bottom: 20px;
  text-align: center;
}

.card {
  background: white;
  border-radius: 18px;
  padding: 20px;
  margin: 0 auto 20px auto;
  max-width: 900px;
  width: 100%;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  box-sizing: border-box;
}

.big-number {
  font-size: 28px;
  font-weight: 700;
  color: #111;
}

.label {
  color: #666;
  font-size: 14px;
  margin-bottom: 6px;
}

.flex {
  display: flex;
  gap: 20px;
}

.flex-center {
  justify-content: center;
}

.col {
  flex: 1;
  text-align: center;
}

.chart-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.chart-col {
  width: 45%;
  min-width: 300px;
}

.chart-container {
  width: 100%;
  aspect-ratio: 2 / 1;
  position: relative;
}

/* Wichtig: Canvas bekommt feste Höhe aus dem Container */
.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  display: block;
}

.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.toggle-label {
  font-size: 13px;
  color: #007aff;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 15px;
}

table td {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.collapse-content {
  display: none;
  margin-top: 10px;
}
.tooltip-hm {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: #000;
  color: #fff;
  font-size: 11px;
  border-radius: 4px;
  white-space: nowrap;
  display: none;
  z-index: 20;
}
/* Letzte 7 Tage: kompakt + Mahlzeiten einklappbar */
.recent-table th {
  text-align: left;
  font-weight: 600;
  color: #666;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.recent-table td {
  vertical-align: top;
}

.meals-cell {
  text-align: right;
  white-space: nowrap;
}

.meals-toggle {
  border: 0;
  background: transparent;
  color: #007aff;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.meals-toggle:hover {
  text-decoration: underline;
}

.meals-empty {
  color: #aaa;
}

.meals-detail-row td {
  border-bottom: 1px solid #eee;
  padding-top: 0;
}

.meals-detail {
  background: #f5f5f7;
  border-radius: 12px;
  padding: 12px;
  line-height: 1.35;
  font-size: 14px;
  color: #333;
  word-break: break-word;
}
/* Charts 7/30 in einer Card */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.charts-item {
  width: 100%;
}

/* Wenn der Bildschirm schmal ist, untereinander */
@media (max-width: 820px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}
/* Nur 365-Tage-Chart kleiner machen */
.chart-container.chart-365 {
  height: 220px;       /* stell hier ein, z.B. 220 bis 320 */
  aspect-ratio: auto;  /* überschreibt 2/1 nur für diesen Chart */
}