/* statistik.css — Kacheln mit Verlauf, dazu die Detailansicht.

   Die Diagramme sind Koordinatensysteme: Linie 2px, Hilfslinien als
   durchgezogene Haarlinien eine Stufe über der Fläche, der Sollwert
   gestrichelt, damit er sich vom Raster unterscheidet. Beschriftet wird der
   Endpunkt und die Achse — keine Zahl an jedem Punkt. */

.statistik { gap: 14px; }
.statistik-seitenkopf { display: grid; gap: 4px; margin-bottom: 2px; }

/* ---------- Kachel ---------- */

.statistik-kachel {
  display: grid; gap: 10px;
  padding: 16px 16px 12px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius-gross);
  text-decoration: none;
  transition: border-color var(--wechsel);
}
.statistik-kachel:hover { border-color: var(--tinte-leise); }
.statistik-kachel:active { background: var(--flaeche-hoch); }

.statistik-kopf {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.statistik-titel {
  font-size: 17px; font-weight: 600;
  color: var(--tinte);
}
.statistik-wert-block { display: flex; align-items: baseline; gap: 4px; }

/* Der große Wert steht für sich — dort sind proportionale Ziffern ruhiger
   als tabellarische, die auf dieser Größe auseinanderfallen. Tabellarisch
   bleibt, was untereinander steht: Achsen und Liste. */
.statistik-wert {
  font-size: 28px; font-weight: 600;
  color: var(--tinte);
  font-variant-numeric: proportional-nums;
  letter-spacing: -0.01em;
}
.statistik-einheit { font-size: 15px; color: var(--tinte-gedimmt); }

.statistik-flaeche { height: 120px; }
.statistik-flaeche--klein { height: 90px; }
.statistik-svg { display: block; width: 100%; height: 100%; overflow: visible; }

.statistik-fuss {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}

.statistik-delta {
  font-size: 13px; font-weight: 600;
  color: var(--tinte-gedimmt);
  font-variant-numeric: tabular-nums;
}
.statistik-delta--gut { color: var(--akzent); }
.statistik-delta--schlecht { color: var(--warnung); }

.statistik-leer {
  display: flex; align-items: center;
  height: 100%;
  font-size: 13px;
  color: var(--tinte-leise);
}

/* ---------- Die Marken im Diagramm ---------- */

.statistik-linie {
  fill: none;
  stroke: var(--akzent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.statistik-punkt, .statistik-endpunkt { fill: var(--akzent); }
.statistik-endpunkt { stroke: var(--flaeche); stroke-width: 2; }

.statistik-raster, .statistik-achslinie {
  stroke: var(--linie);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.statistik-soll {
  stroke: var(--tinte-leise);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
}
/* Achsenbeschriftung in --tinte-gedimmt, nicht in --tinte-leise: Auf 11px
   käme das Leise nur auf 3,15:1 gegen die Karte und wäre nicht mehr lesbar.
   Die Sollwert-Linie selbst darf leise bleiben — als Grafik reichen ihr
   3:1, und sie soll hinter der Datenlinie zurücktreten. */
.statistik-achse, .statistik-soll-text {
  fill: var(--tinte-gedimmt);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* ---------- Detailansicht ---------- */

.statistik-detail { gap: 16px; }
.statistik-detail-kopf { display: grid; gap: 4px; }
.statistik-gross { padding: 16px 12px 8px; height: 252px; }
.statistik-gross .statistik-svg { height: 220px; }

.statistik-kennzahlen {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--linie);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  overflow: hidden;
}
.statistik-kennzahl {
  display: grid; gap: 2px;
  padding: 12px 14px;
  background: var(--flaeche);
}
.statistik-kennzahl dt { font-size: 13px; color: var(--tinte-gedimmt); }
.statistik-kennzahl dd {
  font-size: 17px; font-weight: 600;
  color: var(--tinte);
  font-variant-numeric: tabular-nums;
}

/* Viele Übungen werden zu vielen kleinen Diagrammen, nicht zu vielen Farben
   in einem: Sechs Linien in einem Koordinatensystem bräuchten sechs Töne,
   und die App hat genau einen. */
.statistik-kleine { display: grid; gap: 12px; }
.statistik-klein {
  display: grid; gap: 6px;
  padding: 12px 14px 8px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
}
.statistik-klein-titel {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 15px;
  color: var(--tinte-gedimmt);
}
.statistik-klein-wert {
  font-size: 17px; font-weight: 600;
  color: var(--tinte);
  font-variant-numeric: tabular-nums;
}

.statistik-tabelle {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.statistik-tabelle caption { text-align: left; padding-bottom: 8px; }
.statistik-tabelle td {
  padding: 9px 4px;
  border-bottom: 1px solid var(--linie);
  color: var(--tinte);
}
.statistik-tabelle td:first-child { color: var(--tinte-gedimmt); width: 40%; }

/* Der Weg in die Statistik — steht unter dem Kalender, als Fläche wie alles
   andere Antippbare in dieser App. Vorher war es eine kleine Textzeile und
   damit das einzige Bedienelement, das kein Kasten war. */
.kalender-statistik {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 72px;
  margin-top: 4px;
  padding: 14px 16px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius-gross);
  text-decoration: none;
  transition: border-color var(--wechsel), background-color var(--wechsel);
}
.kalender-statistik:hover { border-color: var(--tinte-leise); }
.kalender-statistik:active { background: var(--flaeche-hoch); }

.kalender-statistik-text { display: grid; gap: 2px; min-width: 0; }
.kalender-statistik-titel {
  font-size: 22px; font-weight: 600; letter-spacing: -0.005em;
  color: var(--tinte);
}
.kalender-statistik-unter {
  font-size: 13px;
  color: var(--tinte-gedimmt);
}
.kalender-statistik-pfeil {
  flex: none;
  color: var(--akzent);
  transform: scaleX(-1);        /* derselbe Pfeil, gespiegelt */
}
