/* Dashboard header — overrides showcase .header rules at 768px+ */
.header.header--dash {
  flex-wrap: nowrap;
  width: min(calc(100% - 1.25rem), 40rem);
  padding: 0.45rem 0.55rem 0.45rem 0.9rem;
}

.header--dash .header__bar {
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  gap: 0.5rem;
}

.header--dash .header__logo img {
  height: 1.6rem;
  max-width: 6.5rem;
  width: auto;
  object-fit: contain;
}

.dash-header__nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: nowrap;
}

.dash-header__email {
  font-size: 0.7rem;
  color: var(--muted);
  max-width: 6.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: none;
}

/* Phone */
@media (max-width: 479px) {
  .header.header--dash {
    width: min(calc(100% - 1rem), 100%);
    border-radius: 1.35rem;
    padding: 0.4rem 0.45rem 0.4rem 0.75rem;
  }

  .dash-header__email {
    display: none !important;
  }

  .btn--logout .btn--logout-label {
    display: none;
  }

  .btn--logout {
    padding: 0.5rem;
    min-width: 2.35rem;
    justify-content: center;
  }

  .dash-header__link {
    padding: 0.4rem 0.55rem;
    font-size: 0.75rem;
  }
}

/* Tablet */
@media (min-width: 480px) and (max-width: 1023px) {
  .header.header--dash {
    width: min(calc(100% - 1.5rem), 36rem);
  }

  .dash-header__email:not(.hidden) {
    display: none;
  }

  .dash-header__link {
    padding: 0.4rem 0.65rem;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .header.header--dash {
    width: min(calc(100% - 2rem), 42rem);
  }

  .header--dash .header__logo img {
    height: 1.75rem;
    max-width: none;
  }

  .dash-header__email:not(.hidden) {
    display: inline-block;
    max-width: 9rem;
  }
}

.dash-header__link,
.btn--logout {
  white-space: nowrap;
  flex-shrink: 0;
}

.dash-header__link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}

.dash-header__link:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.btn--logout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--muted) 28%, transparent);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn--logout svg {
  width: 1rem;
  height: 1rem;
}

.btn--logout:hover {
  transform: scale(1.03);
  border-color: color-mix(in srgb, var(--accent-strong) 40%, transparent);
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.btn--logout.hidden {
  display: none;
}

.dash-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.25rem;
}

/* Panel entrance */
#dashboard-panel.is-entering .dash-animate {
  animation: dash-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#dashboard-panel.is-entering .dash-hero.dash-animate {
  animation-delay: 0.05s;
}

#dashboard-panel.is-entering .dash-journey.dash-animate {
  animation-delay: 0.12s;
}

#dashboard-panel.is-entering .dash-stats.dash-animate {
  animation-delay: 0.2s;
}

#dashboard-panel.is-entering .dash-step--enter {
  animation: dash-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#dashboard-panel.is-entering .stat-pill {
  animation: dash-rise 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#dashboard-panel.is-entering .stat-pill:nth-child(1) { animation-delay: 0.28s; }
#dashboard-panel.is-entering .stat-pill:nth-child(2) { animation-delay: 0.34s; }
#dashboard-panel.is-entering .stat-pill:nth-child(3) { animation-delay: 0.4s; }

@keyframes dash-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#dashboard-panel.is-leaving {
  animation: dash-panel-out 0.35s ease forwards;
}

@keyframes dash-panel-out {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.stat-pill {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--text) 8%, transparent);
}

.app-card {
  animation: dash-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.app-card:nth-child(2) { animation-delay: 0.06s; }
.app-card:nth-child(3) { animation-delay: 0.12s; }

@media (prefers-reduced-motion: reduce) {
  #dashboard-panel.is-entering .dash-animate,
  #dashboard-panel.is-entering .dash-step--enter,
  #dashboard-panel.is-entering .stat-pill,
  .app-card,
  #dashboard-panel.is-leaving {
    animation: none;
  }
  .stat-pill:hover {
    transform: none;
  }
}
