/**
 * Landing #programs dashboard: hero stat tiles, toolbar (search + sort),
 * category chips, card grid shell, and empty state.
 *
 * Tier 3 product surface consuming only Tier 1/2 vars (--theme-*, --accent-*,
 * --space-*, --radius-*, --motion-*, --text-*, --weight-*, --tracking-*,
 * --font-display). The prog-cards themselves are styled by programs.css.
 */

/* — Hero stat tiles — */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
  width: 100%;
  max-width: 28rem;
  margin: var(--space-lg) 0 0;
  padding: 0;
  list-style: none;
}

.dash-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--theme-border);
  border-radius: var(--radius-lg);
  background: var(--theme-bg-elevated);
}

.dash-stat__value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: 1;
  color: var(--theme-color);
}

.dash-stat__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--theme-color-dim);
}

/* — Toolbar: search row + sort control — */
.dash__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.dash__search,
.dash__sort {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--theme-border-strong);
  border-radius: var(--radius-md);
  background: var(--theme-bg-elevated);
  color: var(--theme-color-dim);
  transition:
    border-color var(--motion-hover),
    box-shadow var(--motion-hover);
}

.dash__search {
  flex: 1 1 14rem;
  min-width: 0;
}

.dash__search:focus-within,
.dash__sort:focus-within {
  border-color: var(--accent-500);
  box-shadow: 0 0 0 3px var(--theme-focus-ring);
}

.dash__search-icon {
  width: var(--icon-size-inline);
  height: var(--icon-size-inline);
  flex-shrink: 0;
}

.dash__search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--theme-color);
  font: inherit;
}

.dash__search-input:focus,
.dash__search-input:focus-visible,
.dash__sort-select:focus,
.dash__sort-select:focus-visible {
  outline: none; /* the wrapper shows the focus ring via :focus-within */
  box-shadow: none;
}

.dash__sort-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.dash__sort-select {
  border: 0;
  background: none;
  color: var(--theme-color);
  font: inherit;
  font-weight: var(--weight-medium);
  cursor: pointer;
}

/* — Category chips — */
.dash__chips {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  overflow-x: auto;
  scrollbar-width: none;
}

.dash__chips::-webkit-scrollbar {
  display: none;
}

.dash__chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-md);
  border: 1px solid var(--theme-border-strong);
  border-radius: var(--radius-pill);
  background: var(--theme-bg-elevated);
  color: var(--theme-color-dim);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  cursor: pointer;
  transition:
    color var(--motion-hover),
    background var(--motion-hover),
    border-color var(--motion-hover);
}

.dash__chip:hover {
  color: var(--theme-color);
  border-color: var(--accent-500);
}

.dash__chip.is-active {
  background: var(--theme-color);
  border-color: var(--theme-color);
  color: var(--theme-bg);
}

/* — Result count + grid + empty state — */
.dash__count {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-sm);
  color: var(--theme-color-dim);
}

/* uruguide grid pattern: 2 columns on phones, auto-fill 240px tracks from 40rem */
.dash__grid {
  display: grid;
  gap: var(--space-xs);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 40rem) {
  .dash__grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

.dash__empty {
  margin: 0;
  padding: var(--space-3xl) var(--space-md);
  text-align: center;
  color: var(--theme-color-dim);
}

/* — Future paid tier CTA slot (subtle, single line) — */
.dash__note {
  margin: var(--space-lg) 0 0;
  font-size: var(--text-sm);
  color: var(--theme-color-muted);
}

.dash__note a {
  color: var(--theme-color-dim);
  font-weight: var(--weight-semibold);
}

/* — Copy link confirmation — */
.prog-dialog__copy.is-copied {
  border-color: var(--accent-500);
  color: var(--theme-color);
}

/* — Desktop: hero is centered from 900px (landing.css), stats follow — */
@media (min-width: 900px) {
  .dash-stats {
    margin-inline: auto;
  }

  .dash-stat {
    align-items: center;
  }
}
