/* Analytics-Seite — Grundlagen (Schriften, Farben, Rahmen, Karten) kommen aus base.css. */
:root { --series-4: #7C4DFF; }

.range-switch {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.range-switch button {
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.range-switch button:hover { color: var(--text-secondary); }
.range-switch button.active { background: var(--brand); color: #fff; }

/* ---- kpi row ---- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kpi-tile {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  position: relative;
  overflow: hidden;
  animation: fadeSlideIn 0.5s ease both;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.kpi-tile:hover {
  border-color: rgba(255, 67, 38, 0.35);
  transform: translateY(-1px);
}
.kpi-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, var(--brand-glow), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.kpi-tile:hover::before { opacity: 1; }
.kpi-label {
  font-size: 12.5px;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-bottom: 10px;
}
.kpi-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -0.01em;
  line-height: 1;
}
.kpi-value.accent { color: var(--brand); }

/* ---- grids ---- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}


.chart-wrap { height: 160px; position: relative; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }

.chart-tooltip {
  position: absolute;
  top: 8px;
  pointer-events: none;
  background: #1C1C1C;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  transform: translateX(-50%);
  z-index: 2;
}
.chart-tooltip .tt-date { color: var(--text-tertiary); margin-bottom: 2px; }
.chart-tooltip .tt-value { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.chart-tooltip[hidden] { display: none; }

.chart-hover-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.15);
  pointer-events: none;
  z-index: 1;
}

/* ---- retention bars ---- */
.retention-bars { display: flex; flex-direction: column; gap: 16px; }
.retention-row { display: flex; align-items: center; gap: 14px; }
.retention-row .r-label { width: 46px; font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.retention-row .r-track {
  flex: 1;
  height: 10px;
  background: #1C1C1C;
  border-radius: 6px;
  overflow: hidden;
}
.retention-row .r-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF4326, #FF8E7B);
  border-radius: 6px;
  width: 0%;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.retention-row .r-value { width: 52px; text-align: right; font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.retention-row .r-meta { font-size: 11px; color: var(--text-tertiary); width: 90px; }

/* ---- funnel ---- */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-step { display: flex; flex-direction: column; gap: 6px; }
.funnel-step-head { display: flex; justify-content: space-between; font-size: 13px; }
.funnel-step-head .f-label { color: var(--text-secondary); }
.funnel-step-head .f-count { font-family: var(--font-display); font-weight: 600; color: var(--text-primary); }
.funnel-track { height: 26px; background: #1C1C1C; border-radius: 6px; overflow: hidden; }
.funnel-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF4326, #E5331A);
  width: 0%;
  border-radius: 6px;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
}
.funnel-fill span { font-size: 11px; font-weight: 700; color: #fff; }

/* ---- bar list (feature adoption) ---- */
.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-list-row { display: flex; align-items: center; gap: 12px; }
.bar-list-row .bl-label { width: 110px; font-size: 13px; color: var(--text-secondary); flex-shrink: 0; }
.bar-list-row .bl-track { flex: 1; height: 8px; background: #1C1C1C; border-radius: 5px; overflow: hidden; }
.bar-list-row .bl-fill { height: 100%; background: var(--brand); border-radius: 5px; width: 0%; transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1); }
.bar-list-row .bl-value { width: 40px; text-align: right; font-size: 12.5px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }

/* ---- engagement segments ---- */
.segment-viz { display: flex; flex-direction: column; gap: 14px; }
.segment-bar { display: flex; height: 34px; border-radius: 8px; overflow: hidden; }
.segment-bar div { transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1); }
.seg-power { background: var(--brand); }
.seg-casual { background: #3A3A3A; }
.seg-risk { background: var(--warning); }
.segment-legend { display: flex; gap: 18px; flex-wrap: wrap; }
.segment-legend-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-secondary); }
.segment-legend-dot { width: 9px; height: 9px; border-radius: 3px; }

/* ---- stat list ---- */
.stat-list { display: flex; flex-direction: column; gap: 14px; }
.stat-row { display: flex; justify-content: space-between; align-items: baseline; }
.stat-row .s-label { font-size: 13px; color: var(--text-secondary); }
.stat-row .s-value { font-family: var(--font-display); font-weight: 600; font-size: 19px; }

/* ---- motion ---- */
.kpi-tile:nth-child(1) { animation-delay: 0.02s; }
.kpi-tile:nth-child(2) { animation-delay: 0.06s; }
.kpi-tile:nth-child(3) { animation-delay: 0.10s; }
.kpi-tile:nth-child(4) { animation-delay: 0.14s; }
.kpi-tile:nth-child(5) { animation-delay: 0.18s; }


@media (max-width: 860px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-tile { padding: 16px; }
  .kpi-value { font-size: 28px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .card-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .range-switch { width: 100%; }
  .range-switch button { flex: 1; min-height: 36px; }
}

/* FLYD-299: Hinweis unter einer Kennzahl (z.B. „ohne 7 Testkonten“) */
.kpi-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; }

/* FLYD-301: App & KI */
.card-stats { margin-top: 14px; }
.card-note { font-size: 12px; line-height: 1.5; color: var(--text-tertiary); margin: 12px 0 0; }
.card-note a { color: var(--text-secondary); }
