/* Design-System aus dem FamilienHub uebernommen: Nunito/Fredoka, cremefarben,
   runde Karten, weiche Schatten. Akzent hier gruen statt blau. */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800&family=Fredoka+One&display=swap');

:root {
  --bg: #FFFBF0;
  --card: #ffffff;
  --text: #2b2b2b;
  --muted: #767676;          /* 4.5:1 auf weiss — WCAG AA */
  --accent: #2E9E6B;
  --accent-soft: #E7F5EE;
  --error: #EF233C;
  --radius: 16px;
  --shadow: 0 1px 6px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}

/* ── Login ── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100dvh; padding: 20px; }
.login-card {
  background: var(--card); border-radius: 24px; box-shadow: var(--shadow);
  padding: 28px 22px; width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 14px;
}
.login-card h1 { font-family: 'Fredoka One', cursive; font-size: 1.6rem; margin: 0 0 6px; text-align: center; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 800; }
.login-card input, .login-card button { font: inherit; }
.login-card input {
  padding: 12px 14px; border: 2px solid #eee; border-radius: 12px;
  font-size: 1rem; font-weight: 700; color: var(--text); outline: none; min-height: 46px;
}
.login-card input:focus { border-color: var(--accent); }
.login-card button {
  margin-top: 6px; padding: 13px; border: 0; border-radius: 12px;
  background: var(--accent); color: #fff; font-size: 1rem; font-weight: 800;
  min-height: 48px; cursor: pointer;
}
.login-error { background: #FFF1F2; color: var(--error); border-radius: 10px; padding: 9px 12px; margin: 0; font-size: 0.88rem; }

/* ── App ── */
.app-head { padding: calc(14px + env(safe-area-inset-top)) 18px 6px; }
.app-head h1 { font-family: 'Fredoka One', cursive; font-size: 1.35rem; margin: 0; }
.app-head-date { color: var(--muted); font-size: 0.82rem; font-weight: 700; }

.pages { padding: 10px 14px 20px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.card-title { font-size: 0.78rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 10px; }

.kcal-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.kcal-big { font-family: 'Fredoka One', cursive; font-size: 1.9rem; color: var(--accent); }
.kcal-target { color: var(--muted); font-size: 0.85rem; }

.entry-list { display: flex; flex-direction: column; gap: 4px; }
.entry { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid #f4f4f4; }
.entry-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-kcal { color: var(--muted); font-variant-numeric: tabular-nums; }
.entry-del { border: 0; background: none; color: var(--muted); font-size: 1.3rem; line-height: 1; width: 32px; height: 32px; cursor: pointer; }
.empty, .chart-empty { color: var(--muted); font-size: 0.88rem; font-weight: 600; margin: 6px 0; }

.add-row { display: flex; gap: 7px; margin-top: 12px; }
.add-row input { flex: 1; min-width: 0; padding: 10px 12px; border: 2px solid #eee; border-radius: 12px; font: inherit; font-size: 0.95rem; outline: none; min-height: 44px; }
.add-row input:focus { border-color: var(--accent); }
.add-row input[type=number] { flex: 0 0 88px; }
.add-row button { flex: 0 0 auto; padding: 0 18px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font: inherit; font-weight: 800; min-height: 44px; cursor: pointer; }

.chart { color: var(--accent); }
.spark { width: 100%; height: auto; display: block; }
.spark-max, .spark-min { fill: var(--muted); font-size: 9px; font-weight: 700; }

/* ── Bottom-Nav ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex;
  background: #fff; border-top: 1px solid #f0f0f0;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -1px 8px rgba(0,0,0,0.04);
}
.nav-tab {
  flex: 1 1 0; min-width: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 0.72rem; font-weight: 800; color: var(--muted);
  text-decoration: none; text-align: center; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.nav-tab.active { color: var(--accent); }

/* ── Toast ── */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(20px);
  bottom: calc(84px + env(safe-area-inset-bottom));
  background: #2b2b2b; color: #fff; padding: 11px 18px; border-radius: 12px;
  font-size: 0.9rem; max-width: calc(100vw - 32px); white-space: normal;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--error); }
