/**
 * Home Feature Components
 *
 * Revenue overview chrome and shared states used by the dashboard. The page
 * frame itself (sidebar, header) lives in portal-shell.css. Fresh .home-*
 * namespace, no !important. Deliberately does not reuse .revenue-tab /
 * .tab-exit / .tab-enter-active: those carry hardcoded 250/350ms animations
 * that the JS there mirrors, and cross-wiring them would couple these
 * components to that screen's timing.
 */

/* ========================================
   REVENUE TAB
   ======================================== */

.home-revenue-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
}

.home-revenue-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-4);
  flex-wrap: wrap;
}

.home-revenue-scope {
  display: flex;
  gap: var(--spacing-2);
}

.home-revenue-scope-label {
  display: inline-flex;
  align-items: center;
  min-height: var(--spacing-11);
  padding: 0 var(--spacing-4);
  border-radius: var(--radius-full);
  background: var(--color-primary-50);
  color: var(--color-primary);
  font-family: var(--font-family-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.home-revenue-period {
  min-width: 0;
}

.home-revenue-dashboard-host {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
}

.home-revenue-dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
}

.home-revenue-actions {
  display: flex;
  justify-content: flex-end;
}

.home-revenue-detail-link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  min-height: var(--spacing-11);
  padding: 0 var(--spacing-4);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  font-family: var(--font-family-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: var(--transition-colors);
}

.home-revenue-detail-link:hover {
  background: var(--color-slate-100);
}

.home-revenue-detail-link:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

/* ========================================
   STATES
   ======================================== */

.home-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--spacing-3);
  padding: var(--spacing-12) var(--spacing-6);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  border: 1px solid var(--color-slate-200);
  box-shadow: var(--shadow-card);
}

.home-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--spacing-14);
  height: var(--spacing-14);
  border-radius: var(--radius-full);
  background: var(--color-slate-100);
  color: var(--color-slate-500);
}

.home-state-icon-warning {
  background: var(--color-warning-light);
  color: var(--color-warning-dark);
}

.home-state-icon-error {
  background: var(--color-error-light);
  color: var(--color-error-dark);
}

.home-state-title {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-xl);
  color: var(--color-text-primary);
}

.home-state-message {
  font-family: var(--font-family-secondary);
  font-size: var(--font-size-sm);
  /* slate-500, not slate-400: the lighter step is ~2.8:1 on white and fails AA. */
  color: var(--color-slate-text-muted);
  max-width: var(--narrow-max-width);
  line-height: var(--line-height-relaxed);
}

.home-state-action {
  margin-top: var(--spacing-2);
}

/* ========================================
   FEINSCHLIFF: UMSATZENTWICKLUNG IM HOME
   ======================================== */

/* The embedded revenue dashboard (db-*) inherits its own styling; in the Home
   context the bars settle a touch softer and every amount uses tabular digits
   so columns of numbers align. Scoped to the host, nothing global. */
.home-revenue-dashboard-host .db-cat-bar-fill {
  transition: width 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-revenue-dashboard-host .db-avg-value,
.home-revenue-dashboard-host .db-cat-avg-value,
.home-revenue-dashboard-host .db-cat-count,
.home-revenue-dashboard-host .db-cat-metric-value {
  font-variant-numeric: tabular-nums;
}

/* Legend / label typo: quiet caps line up with the intranet chip idiom. */
.home-revenue-dashboard-host .db-avg-label,
.home-revenue-dashboard-host .db-cat-avg-label {
  letter-spacing: 0.02em;
}

.home-revenue-scope-label {
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .home-revenue-dashboard-host .db-cat-bar-fill {
    transition: none;
  }
}
