:root {
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface2: #f9f8f5;
  --border: rgba(0,0,0,0.09);
  --border2: rgba(0,0,0,0.16);
  --text1: #1c1b18;
  --text2: #5a5955;
  --text3: #9a9892;
  --accent: #1D9E75;
  --accent-light: #E1F5EE;
  --accent-dark: #0a5c43;
  --danger: #D85A30;
  --warn: #EF9F27;
  /* Höhe der eigentlichen Tab-Zeile (ohne Abstand/Home-Indicator) */
  --nav-h: 56px;
  --nav-pad-top: 8px;
  --header-h: 52px;
  --font: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --capture-content-max: 800px;
  /* Admin: nutzt volle Hauptspalte bis zu dieser Obergrenze (siehe .app-main:has(.admin-shell)) */
  --admin-main-max: min(1560px, calc(100vw - 220px));
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181816; --surface: #222220; --surface2: #1e1e1c;
    --border: rgba(255,255,255,0.08); --border2: rgba(255,255,255,0.14);
    --text1: #eeecea; --text2: #aaa9a4; --text3: #686762;
    --accent-light: #04342C; --accent-dark: #5DCAA5;
  }
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #root { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text1); -webkit-text-size-adjust: 100%; }

.app-shell { display: flex; flex-direction: column; height: 100%; max-width: 600px; margin: 0 auto; }
.app-header {
  height: var(--header-h); display: flex; align-items: center; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.app-logo { font-size: 18px; font-weight: 700; color: var(--accent); letter-spacing: -0.02em; }
/* unten: Tab-Leiste + Abstand nach oben zur Leiste + Home-Indicator (iPhone) */
.app-main {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px calc(var(--nav-h) + var(--nav-pad-top) + env(safe-area-inset-bottom, 0px) + 20px);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  display: flex;
  align-items: center;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 20;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  justify-content: flex-start;
  gap: 2px;
  padding: var(--nav-pad-top) 6px env(safe-area-inset-bottom, 0px);
  min-height: calc(var(--nav-h) + var(--nav-pad-top) + env(safe-area-inset-bottom, 0px));
  height: auto;
  box-sizing: border-box;
}
.bottom-nav::-webkit-scrollbar {
  display: none;
}
.nav-item {
  flex: 0 0 auto;
  min-width: 56px;
  max-width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text3);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
  padding: 2px 4px 4px;
  box-sizing: border-box;
}
.nav-item span {
  font-size: 10px;
  line-height: 1.15;
  text-align: center;
  max-width: 100%;
}
.nav-item.active { color: var(--accent); }
.nav-item svg { flex-shrink: 0; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.card + .card { margin-top: 12px; }
.card-title { font-size: 13px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.stat-val { font-size: 26px; font-weight: 700; color: var(--text1); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text3); margin-top: 3px; }
.stat-delta { font-size: 12px; font-weight: 600; margin-top: 4px; }
.delta-pos { color: var(--accent); }
.delta-neg { color: var(--danger); }

/* Form */
.form-section { margin-bottom: 20px; }
.form-section-title {
  font-size: 13px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.form-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.form-row:last-child { border-bottom: none; }
.form-label { flex: 1; font-size: 14px; color: var(--text1); }
.form-sub { font-size: 11px; color: var(--text3); display: block; margin-top: 1px; }
.form-input {
  width: 90px; padding: 7px 10px; text-align: right;
  font-family: var(--font); font-size: 15px; font-weight: 500; color: var(--text1);
  background: var(--surface2); border: 1.5px solid var(--border2);
  border-radius: 8px; transition: border-color 0.15s;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-unit { font-size: 12px; color: var(--text3); width: 24px; }

/* Einstellungen Profil: Label als Überschrift oben, volle Breite, linksbündig */
.settings-page__field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.settings-page__field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text1);
  text-align: left;
  line-height: 1.3;
}
.settings-page__field .form-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  box-sizing: border-box;
}
.form-select {
  font-family: var(--font); font-size: 13px; color: var(--text1);
  background: var(--surface2); border: 1.5px solid var(--border2);
  border-radius: 8px; padding: 7px 10px; width: 100%;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font); font-size: 14px; font-weight: 600;
  padding: 10px 18px; border-radius: 10px; border: none; cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: white; }
.btn-secondary { background: var(--surface2); border: 1px solid var(--border2); color: var(--text2); }
.btn-danger { background: #FCEBEB; color: var(--danger); }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; pointer-events: none; }

/* Badge */
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }

/* AI content */
.ai-content { font-size: 14px; line-height: 1.7; color: var(--text2); white-space: pre-wrap; }
.ai-content strong { color: var(--text1); font-weight: 600; }

/* Photo grid */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-thumb { aspect-ratio: 1; border-radius: 8px; object-fit: cover; width: 100%; cursor: pointer; }

/* Tabs */
.tabs { display: flex; gap: 4px; background: var(--surface2); border-radius: 10px; padding: 3px; margin-bottom: 16px; }
.tab { flex: 1; text-align: center; padding: 7px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text3); cursor: pointer; border: none; background: transparent; font-family: var(--font); }
.tab.active { background: var(--surface); color: var(--text1); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* Section */
.section-gap { margin-bottom: 16px; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; }

/* Verlauf: Mobile Tabs horizontale Leiste, Desktop vertikal links (P4 / RESPONSIVE_UI §5.2) */
.history-page__title {
  margin-bottom: 12px;
}

.history-page__layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.history-tabs {
  margin-bottom: 0;
}

.history-tabs__scroller {
  display: flex;
  flex-direction: row;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.history-tabs__scroller::-webkit-scrollbar {
  display: none;
}

.history-tab-btn {
  white-space: nowrap;
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.history-tab-btn:hover {
  border-color: var(--accent);
  color: var(--text1);
}

.history-tab-btn.history-tab-btn--active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.history-tab-btn.history-tab-btn--active:hover {
  color: white;
}

@media (min-width: 1024px) {
  .history-page__layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
  }

  .history-tabs {
    flex: 0 0 260px;
    max-width: 280px;
    position: sticky;
    top: 16px;
    align-self: flex-start;
  }

  .history-tabs__scroller {
    flex-direction: column;
    overflow-x: visible;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
    padding-bottom: 0;
    gap: 8px;
  }

  .history-tab-btn {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    border-radius: 10px;
    white-space: normal;
    flex-shrink: 0;
    padding: 10px 14px;
  }

  .history-content {
    flex: 1;
    min-width: 0;
  }
}

/* KI-Analyse (P5): Mobile Prompt-Leiste oben / horizontal, Desktop links ~300px (RESPONSIVE_UI §5.3) */
.analysis-page__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.analysis-page__header > div:first-child {
  flex: 1;
  min-width: 0;
}

.analysis-split {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.analysis-split__nav {
  display: flex;
  flex-direction: row;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.analysis-split__nav::-webkit-scrollbar {
  display: none;
}

.analysis-split__nav-item {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.analysis-split__nav-item:hover {
  border-color: var(--accent);
  color: var(--text1);
}

.analysis-split__nav-item--active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.analysis-split__nav-item--active:hover {
  color: white;
}

.analysis-split__nav-item--active .muted {
  color: rgba(255, 255, 255, 0.88) !important;
}

.analysis-split__nav-cat-count {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.92;
}

.analysis-split__nav-item--active .analysis-split__nav-cat-count {
  color: rgba(255, 255, 255, 0.95);
  opacity: 1;
}

a.analysis-split__nav-item {
  text-decoration: none;
  box-sizing: border-box;
}

.analysis-split__main {
  min-width: 0;
}

@media (min-width: 1024px) {
  .analysis-split {
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
  }

  .analysis-split__nav-wrap {
    flex: 0 0 300px;
    max-width: 320px;
    position: sticky;
    top: 16px;
    align-self: flex-start;
  }

  .analysis-split__nav {
    flex-direction: column;
    overflow-x: visible;
    overflow-y: auto;
    max-height: calc(100vh - 140px);
    padding-bottom: 0;
    gap: 8px;
  }

  .analysis-split__nav-item {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    border-radius: 10px;
    white-space: normal;
  }

  .analysis-split__main {
    flex: 1;
  }
}

/* Erfassung: eine einheitliche Inhaltsbreite (Desktop), zentriert; mobil volle Breite */
.capture-page {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (min-width: 1024px) {
  .capture-page {
    max-width: var(--capture-content-max);
    margin-left: auto;
    margin-right: auto;
  }
}

/* Erfassung: Sub-Navigation (Mobil = Chips, Desktop = linke Spalte) */
.capture-shell {
  width: 100%;
}

.capture-shell__layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.capture-shell__nav {
  display: flex;
  flex-direction: row;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.capture-shell__nav::-webkit-scrollbar {
  display: none;
}

.capture-shell__nav-item {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
}

.capture-shell__nav-item:hover {
  border-color: var(--accent);
  color: var(--text1);
}

.capture-shell__nav-item--active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.capture-shell__nav-item--active:hover {
  color: white;
}

.capture-shell__nav-item--highlight:not(.capture-shell__nav-item--active) {
  border-color: #7f77dd88;
  background: #7f77dd14;
}

.capture-shell__nav-icon {
  font-size: 15px;
  line-height: 1;
}

.capture-shell__nav-label {
  line-height: 1.2;
}

.capture-shell__main {
  min-width: 0;
}

@media (min-width: 1024px) {
  .capture-shell__layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
  }

  .capture-shell__nav-wrap {
    flex: 0 0 260px;
    max-width: 280px;
    position: sticky;
    top: 16px;
    align-self: flex-start;
  }

  .capture-shell__nav {
    flex-direction: column;
    overflow-x: visible;
    overflow-y: auto;
    max-height: calc(100vh - 140px);
    padding-bottom: 0;
    gap: 8px;
  }

  .capture-shell__nav-item {
    width: 100%;
    justify-content: flex-start;
    border-radius: 10px;
    white-space: normal;
    padding: 9px 12px;
  }

  .capture-shell__main {
    flex: 1;
  }
}

/* Einstellungen: gleiche Split-Struktur wie Analyse/Admin */
.settings-shell {
  width: 100%;
}

/* Referenzwerte: Übersichtskacheln (responsive, bis 4 Spalten Desktop) */
.ref-value-tiles-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 520px) {
  .ref-value-tiles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .ref-value-tiles-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .ref-value-tiles-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.ref-value-tile {
  display: block;
  width: 100%;
  margin: 0;
  padding: 14px 14px 12px;
  text-align: left;
  font-family: var(--font);
  border-radius: 12px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  color: var(--text1);
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ref-value-tile:hover {
  border-color: var(--accent);
}

.ref-value-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ref-value-tile--active {
  border-color: var(--accent);
  background: var(--surface2);
}

/* Admin: Split-Layout wie .analysis-split (nur Gruppen in der Nav) */
.admin-shell {
  width: 100%;
}

.admin-page {
  width: 100%;
  min-width: 0;
}

/* Desktop: volle Breite der Admin-Spalte (nicht wie Erfassung 800px); Lesegröße leicht skaliert */
@media (min-width: 1024px) {
  .admin-page {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    font-size: clamp(15px, 0.88rem + 0.25vw, 18px);
  }
}

.muted { color: var(--text3); font-size: 13px; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--text3); }
.empty-state h3 { font-size: 16px; color: var(--text2); margin-bottom: 6px; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideDown {
  from { transform: translate(-50%, -20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* Additional vars */
:root {
  --warn-bg: #FAEEDA;
  --warn-text: #7a4b08;
}
@media (prefers-color-scheme: dark) {
  :root {
    --warn-bg: #3a2103;
    --warn-text: #FAC775;
  }
}

/* Header with profile avatar */
.app-header { display:flex; align-items:center; justify-content:space-between; }
.app-header a { display:flex; }

/* ── Responsive shell: Desktop sidebar (≥1024px) — spec RESPONSIVE_UI.md ───── */
.app-shell__column {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.desktop-sidebar {
  display: none;
  flex-direction: column;
  width: 220px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 0 16px;
}

.desktop-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.desktop-sidebar__logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  flex-shrink: 0;
  opacity: 0.85;
}

.desktop-sidebar__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.desktop-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  padding: 0 0 12px;
}

.desktop-sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 13px;
  text-decoration: none;
  color: var(--text2);
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  transition: background 0.15s, color 0.15s;
}

.desktop-sidebar__link:hover {
  background: var(--surface2);
  color: var(--text1);
}

.desktop-sidebar__link.desktop-sidebar__link--active {
  background: var(--accent-light);
  color: var(--accent);
  border-left-color: var(--accent);
}

.desktop-sidebar__footer {
  border-top: 1px solid var(--border);
  padding: 16px 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.desktop-sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.desktop-sidebar__user-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.desktop-sidebar__user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desktop-sidebar__user-tier {
  font-size: 11px;
  color: var(--text3);
  text-transform: lowercase;
}

.desktop-sidebar__logout {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.desktop-sidebar__logout:hover {
  color: var(--danger);
  background: rgba(216, 90, 48, 0.08);
}

@media (max-width: 1023px) {
  .app-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 600px;
    margin: 0 auto;
  }
}

@media (min-width: 1024px) {
  .app-shell {
    display: block;
    max-width: none;
    margin: 0;
    width: 100%;
    min-height: 100%;
  }

  .desktop-sidebar {
    display: flex;
  }

  .app-shell__column {
    margin-left: 220px;
    min-height: 100vh;
  }

  .app-header--mobile {
    display: none !important;
  }

  .bottom-nav {
    display: none !important;
  }

  .app-main {
    padding: 24px 32px 32px;
    padding-bottom: max(32px, env(safe-area-inset-bottom, 0px));
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
  }

  /* Admin: mehr horizontaler Raum für Tabellen auf großen Screens (:has ~2022+, sonst bleibt 1200px) */
  .app-main:has(.admin-shell) {
    max-width: var(--admin-main-max);
  }

  /* Dashboard (P3): Begrüßung + Kennzahlen-Zeile */
  .dashboard-greeting {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
  }

  .dashboard-greeting__meta {
    margin-top: 0 !important;
    text-align: right;
  }
}

/* ── Dashboard layout (Mobile baseline + Desktop im Block oben teilweise) ─ */

.dashboard-page {
  width: 100%;
}

.dashboard-greeting {
  margin-bottom: 16px;
}

/*
 * Dashboard-Raster (KPI, Nebeneinander-Kacheln): 2 / 4 Spalten.
 * StatCard, DashboardTile: span via --tile-sm / --tile-lg (JS clamp).
 */
.dashboard-stat-grid,
.dashboard-tile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-stat-grid--mobile-4col,
.dashboard-tile-grid--mobile-4col {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-stat-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 12px 10px;
  border: 1px solid var(--border);
  transition: border-color 0.15s;
}

.dashboard-stat-card,
.dashboard-tile {
  min-width: 0;
  box-sizing: border-box;
  grid-column: span var(--tile-sm, 1);
}

@media (min-width: 1024px) {
  .dashboard-stat-card,
  .dashboard-tile {
    grid-column: span var(--tile-lg, 1);
  }
}

/* ── Dashboard-Abschnitte (Überschrift + Trennlinie) ─ */
.dashboard-section {
  margin-bottom: 22px;
}

.dashboard-section:last-child {
  margin-bottom: 0;
}

.dashboard-section__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.dashboard-section__headline {
  flex: 1;
  min-width: 0;
}

.dashboard-section__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.dashboard-section__description {
  font-size: 12px;
  color: var(--text3);
  margin: 4px 0 0 0;
  line-height: 1.35;
  max-width: 640px;
}

.dashboard-section__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-section__actions {
  flex-shrink: 0;
}

.dashboard-pill-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Ernährung/Aktivität: Raster wie KPI; Kacheln per DashboardTile steuerbar */
.dashboard-summary-row.dashboard-tile-grid {
  margin-bottom: 0;
}

.dashboard-erholung-grid .dashboard-tile > .card,
.dashboard-summary-row .dashboard-tile > .card {
  height: 100%;
}

@media (min-width: 1024px) {
  .dashboard-stat-grid,
  .dashboard-tile-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }
}
