/**
 * dashboard.css
 * Layout-Konzept: eine ruhige, einspaltige Saeule, die den Bogen eines
 * Tages nachzeichnet - Begruessung wie ein Sonnenaufgang oben,
 * Empfehlungen als sanfte Orientierung, die Schnellerfassung fuer den
 * gegenwaertigen Moment, und der Verlauf des bereits gelebten Tages
 * darunter.
 */
.tk-dashboard {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-12);
}

.tk-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.tk-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 500;
  color: var(--moon);
}
.tk-brand svg { color: var(--dusk); }

.tk-header-actions { display: flex; gap: var(--space-2); }

.tk-account-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 168px;
  height: 40px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-full);
  background: var(--void-3);
  border: 1px solid var(--border-subtle);
  color: var(--mist);
  font-size: 12.5px;
  font-weight: 700;
  transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}
.tk-account-chip-btn:hover { color: var(--moon); background: var(--void-4); }
.tk-account-chip-btn:active { transform: scale(0.96); }
.tk-account-chip-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tk-account-chip-btn svg { flex-shrink: 0; color: var(--dusk); }

.tk-greeting-block {
  margin-bottom: var(--space-6);
  animation: tk-fade-up 500ms cubic-bezier(0.2, 0.7, 0.3, 1);
}
.tk-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--mist);
  margin-bottom: var(--space-2);
}
.tk-greeting {
  font-size: 32px;
  line-height: 1.2;
}

.tk-stats-strip {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
  animation: tk-fade-up 500ms cubic-bezier(0.2, 0.7, 0.3, 1) 60ms both;
}
.tk-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--void-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--mist);
}
.tk-stat-chip svg { color: var(--dawn); }

.tk-section {
  margin-bottom: var(--space-8);
  animation: tk-fade-up 520ms cubic-bezier(0.2, 0.7, 0.3, 1) 100ms both;
}
.tk-section-last { margin-bottom: 0; }
.tk-section h2 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 15px;
  font-weight: 700;
  color: var(--moon);
  margin-bottom: var(--space-4);
}
.tk-section h2 svg { color: var(--dusk); }

.tk-section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.tk-section-heading-row h2 { margin-bottom: 0; }

.tk-segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-full);
  background: var(--void-3);
  border: 1px solid var(--border-subtle);
}
.tk-segmented button {
  min-width: 64px;
  padding: 7px 12px;
  border-radius: var(--radius-full);
  color: var(--mist);
  font-size: 12.5px;
  font-weight: 700;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.tk-segmented button.is-selected {
  background: var(--dusk-soft);
  color: var(--moon);
}

/* Auswertung */
.tk-analytics-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--mist);
  font-size: 13px;
  margin-bottom: var(--space-4);
}
.tk-analytics-summary strong {
  color: var(--moon);
  font-size: 14px;
}
.tk-chart-block {
  background: var(--void-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}
.tk-chart-block:last-child { margin-bottom: 0; }
.tk-chart-block h3 {
  font-size: 13px;
  font-weight: 800;
  color: var(--moon);
  margin-bottom: var(--space-3);
}
.tk-chart-empty {
  padding: var(--space-4);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--mist);
  font-size: 13px;
  text-align: center;
}
.tk-bar-chart { display: flex; flex-direction: column; gap: var(--space-3); }
.tk-bar-row { display: grid; gap: var(--space-2); }
.tk-bar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: 12.5px;
  color: var(--mist);
}
.tk-bar-label span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tk-bar-label strong { color: var(--moon); }
.tk-bar-track {
  height: 9px;
  border-radius: var(--radius-full);
  background: var(--void-4);
  overflow: hidden;
}
.tk-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--cat-color);
}
.tk-trend-legend {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--mist);
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: var(--space-3);
}
.tk-dot-mood,
.tk-dot-energy {
  width: 9px;
  height: 9px;
  border-radius: var(--radius-full);
  display: inline-block;
}
.tk-dot-mood { background: var(--rose); }
.tk-dot-energy { background: var(--tide); }
.tk-trend-scroll {
  overflow-x: auto;
  padding-bottom: 2px;
}
.tk-trend-chart {
  min-width: 100%;
  height: 132px;
  display: grid;
  grid-template-columns: repeat(7, minmax(34px, 1fr));
  gap: var(--space-2);
  align-items: end;
}
.tk-trend-chart.is-month {
  min-width: 860px;
  grid-template-columns: repeat(31, minmax(20px, 1fr));
  gap: 5px;
}
.tk-trend-day {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: var(--space-2);
  justify-items: center;
}
.tk-trend-bars {
  width: 100%;
  max-width: 36px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}
.tk-trend-bar {
  width: 10px;
  min-height: 3px;
  border-radius: var(--radius-full) var(--radius-full) 3px 3px;
  transition: height var(--transition-base);
}
.tk-trend-chart.is-month .tk-trend-bar { width: 7px; }
.tk-trend-mood { background: var(--rose); }
.tk-trend-energy { background: var(--tide); }
.tk-trend-bar.is-empty {
  height: 3px !important;
  background: var(--void-4);
}
.tk-trend-label {
  color: var(--mist-dim);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* Empfehlungen */
.tk-rec-list { display: flex; flex-direction: column; gap: var(--space-3); }
.tk-rec-card {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  background: var(--void-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.tk-rec-card:hover { border-color: var(--border-default); transform: translateY(-1px); }
.tk-rec-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--dusk-soft);
  color: var(--dusk);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tk-rec-body { flex: 1; min-width: 0; }
.tk-rec-body h4 { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.tk-rec-body p { font-size: 13px; color: var(--mist); line-height: 1.5; }
.tk-rec-actions { display: flex; gap: var(--space-1); flex-shrink: 0; }
.tk-rec-action-btn, .tk-rec-dismiss {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mist);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.tk-rec-action-btn:hover { background: var(--dusk-soft); color: var(--dusk); }
.tk-rec-dismiss:hover { background: var(--void-4); color: var(--moon); }

.tk-rec-empty {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--void-2);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  color: var(--mist);
  font-size: 13.5px;
}
.tk-rec-empty svg { color: var(--meadow); flex-shrink: 0; }

/* Schnellerfassung */
.tk-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: var(--space-3);
}
.tk-quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-2);
  background: var(--void-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--mist);
  transition: all var(--transition-fast);
}
.tk-quick-btn:hover {
  border-color: var(--cat-color);
  color: var(--moon);
  transform: translateY(-2px);
}
.tk-quick-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--cat-color) 16%, transparent);
  color: var(--cat-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Zeitverlauf */
.tk-timeline-list { display: flex; flex-direction: column; }
.tk-timeline-item {
  display: grid;
  grid-template-columns: 44px 28px 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.tk-timeline-item:last-child { border-bottom: none; }
.tk-timeline-time { font-size: 12.5px; font-weight: 700; color: var(--mist); font-variant-numeric: tabular-nums; }
.tk-timeline-dot {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--cat-color) 18%, transparent);
  color: var(--cat-color);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tk-timeline-content { min-width: 0; }
.tk-timeline-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--moon);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tk-timeline-meta { font-size: 12px; color: var(--mist-dim); margin-top: 1px; }
.tk-timeline-delete {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mist-dim);
  opacity: 0;
  transition: opacity var(--transition-fast), color var(--transition-fast), background-color var(--transition-fast);
}
.tk-timeline-item:hover .tk-timeline-delete { opacity: 1; }
.tk-timeline-delete:hover { color: var(--danger); background: var(--void-3); }

.tk-timeline-empty {
  padding: var(--space-6);
  text-align: center;
  color: var(--mist);
  font-size: 13.5px;
  background: var(--void-2);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
}

@media (max-width: 420px) {
  .tk-greeting { font-size: 27px; }
  .tk-quick-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .tk-section-heading-row { align-items: flex-start; flex-direction: column; }
  .tk-segmented { width: 100%; }
  .tk-segmented button { flex: 1; }
  .tk-account-chip-btn {
    width: 40px;
    padding: 0;
    justify-content: center;
  }
  .tk-account-chip-btn span { display: none; }
}
