/* =========================================================================
   Vermissungs-Index – Dashboard
   Ergänzt style.css (Tokens, Hintergrund, Toast, .page, .index, .link).
   ========================================================================= */

/* ---------- Seitengerüst ------------------------------------------------- */
.page--dash {
  justify-content: flex-start;
  max-width: 760px;
  gap: 16px;
}

.head--dash {
  position: relative;
  width: 100%;
  text-align: center;
}
.backlink {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--accent-deep);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.7);
}
.backlink:hover { background: rgba(255, 255, 255, 0.85); }

/* Der große Wert darf hier etwas kleiner sein als auf der Herz-Seite */
.index--dash .index__value { font-size: clamp(2.9rem, 15vw, 4.4rem); }
/* auf dem Dashboard läuft die Seite von oben nach unten – kein auto-Margin */
.index--dash { margin-top: 0; }

/* ---------- Karten ------------------------------------------------------- */
.card {
  width: 100%;
  padding: 14px 14px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-brd);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.card__title {
  margin: 2px 0 10px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-deep);
  letter-spacing: -0.01em;
}

/* ---------- Zeitraum-Umschalter ------------------------------------------ */
.range {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 999px;
}
.range__btn {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 0;
  min-height: 44px;
  padding: 8px 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
  touch-action: manipulation;
}
.range__btn:hover { color: var(--accent-deep); }
.range__btn.is-active {
  background: #fff;
  color: var(--accent-deep);
  box-shadow: 0 3px 10px rgba(186, 60, 104, 0.18);
}

/* ---------- Chart -------------------------------------------------------- */
.chart {
  position: relative;
  width: 100%;
  min-height: 200px;
}
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }

/* Achsen & Gitter */
.grid-line { stroke: rgba(146, 74, 100, 0.16); stroke-width: 1; }
.axis-label {
  fill: var(--ink-soft);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
}
.line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.area { stroke: none; }
.dot { fill: #fff; stroke: var(--accent); stroke-width: 2; }
.cursor-line { stroke: rgba(200, 60, 110, 0.45); stroke-width: 1; stroke-dasharray: 3 3; }
.cursor-dot { fill: var(--accent-deep); }

/* Meldungen im Chart-Bereich (lädt / leer / offline) */
.chart__msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 12px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 600;
  pointer-events: none;
}
.chart__msg[hidden] { display: none; }

/* Tooltip */
.tip {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, -120%);
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--card-brd);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
}
.tip.is-visible { opacity: 1; }
.tip__time { display: block; font-weight: 600; color: var(--ink-soft); font-size: 0.72rem; }

/* ---------- Ereignisliste ------------------------------------------------ */
.events {
  list-style: none;
  margin: 0;
  padding: 0;
}
.event {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid rgba(150, 96, 111, 0.12);
  font-size: 0.9rem;
}
.event:last-child { border-bottom: 0; }

.event__badge {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  padding: 4px 9px;
  border-radius: 999px;
  background: linear-gradient(160deg, #ff9ec0, #e8467c);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(200, 50, 100, 0.22);
}
.event__time { flex: 1 1 auto; color: var(--ink); font-weight: 600; }

.empty {
  margin: 10px 0 6px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 600;
}
.empty[hidden] { display: none; }

/* ---------- Etwas mehr Raum auf großen Schirmen -------------------------- */
@media (min-width: 640px) {
  .card { padding: 18px 20px 20px; }
  .event { font-size: 0.95rem; padding: 11px 2px; }
}
