/* --- Kennzahl-Kachel, Veränderung, Sparkline (DESIGN 2.4, 5) ------------------------------- */

.stat-tile {
  position: relative;
  display: grid;
  gap: var(--space-2);
  align-content: center;
  justify-items: center;
  min-width: 0;
  padding: var(--space-5) var(--space-4);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-tile);
  background: var(--gradient-card);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.stat-tile--start {
  grid-template-columns: minmax(0, 1fr) auto;
  justify-items: start;
  text-align: left;
}

.stat-tile--start .stat-tile__spark {
  grid-row: 1 / span 3;
  grid-column: 2;
  align-self: center;
}

.stat-tile--glow-up {
  background: var(--glow-pos-light), var(--gradient-card);
  box-shadow: var(--glow-pos), var(--shadow-card);
}

.stat-tile--glow-down {
  background: var(--glow-neg-light), var(--gradient-card);
  box-shadow: var(--glow-neg), var(--shadow-card);
}

.stat-tile__label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-1);
  font-size: 0.9375rem;
  font-weight: 500;
}

.stat-tile__label .icon {
  color: var(--text-2);
}

.stat-tile__value {
  font: var(--text-value);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stat-tile__value--up { color: var(--pos); }
.stat-tile__value--down { color: var(--neg); }

.stat-tile__spark {
  width: 120px;
  height: 32px;
}

.change {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.change--up { color: var(--pos); }
.change--down { color: var(--neg); }
.change--flat { color: var(--text-2); }
.change--neutral { color: var(--text-1); }

.sparkline {
  display: block;
  width: 120px;
  height: 32px;
  overflow: visible;
}

.sparkline path {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.sparkline--up path { stroke: var(--pos); }
.sparkline--down path { stroke: var(--neg); }
.sparkline--flat path { stroke: var(--text-2); }
.sparkline--neutral path { stroke: var(--text-1); }
.sparkline--accent path { stroke: var(--accent); }
