/* Copyright (c) 2026 Brownie, LLC. All rights reserved. */

/*
 * The school dashboard (views/dashboard.ts): the tiles, the filters, the
 * waiting cards and the sections under the chart. Builds on the cards,
 * page header and segmented control in app.css and the charts in
 * team-progress.css.
 */

.dashboard-header {
  display: grid;
  gap: 6px;
}

.dashboard-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
}

.dashboard-filters [hidden] {
  display: none;
}

.dashboard-next-steps:empty {
  display: none;
}

.dashboard-body {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.dashboard-waiting {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-waiting-text {
  display: grid;
  gap: 2px;
}

.dashboard-waiting-text span {
  color: var(--color-review-text);
  font-size: 0.9rem;
}

/* The tiles (four, or two while lapsed): one row when the page is wide enough, two by two when it
   isn't, one column on a phone. Sized by the page's own width (beside the
   rail), not the window's, so the fourth tile never sits alone. */
.dashboard-body {
  container-type: inline-size;
}

.dashboard-tiles {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

@container (min-width: 420px) {
  .dashboard-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container (min-width: 660px) {
  .dashboard-tiles {
    grid-template-columns: none;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
  }
}

.dashboard-tile {
  display: grid;
  align-content: start;
  gap: 2px;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.dashboard-tile-label {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.dashboard-tile-value {
  font: 700 2.5rem/1.1 var(--font-display);
  overflow-wrap: anywhere;
}

/* A tournament's name, not a number. */
.dashboard-tile-value.is-small {
  font-size: 1.6rem;
}

.dashboard-tile-note {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

a.dashboard-tile-note,
.dashboard-tile-note.is-up {
  color: var(--color-accent-strong);
  font-weight: 600;
}

.dashboard-tile-note.is-short {
  color: var(--color-review-text);
  font-weight: 600;
}

.dashboard-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 16px;
}

.dashboard-section {
  align-content: start;
}

.dashboard-section h2,
.dashboard-chart h2 {
  margin: 0;
  font-size: 1.35rem;
}

.dashboard-section p {
  margin: 0;
}

.dashboard-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dashboard-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  min-height: 44px;
  border-bottom: 1px solid var(--color-divider);
}

.dashboard-list li:last-child {
  border-bottom: 0;
}

.dashboard-list a {
  flex: 1 1 8em;
  min-width: 0;
}

.dashboard-list li > :not(a) {
  flex: none;
}

.dashboard-rank {
  width: 1.2em;
  color: var(--color-text-muted);
  font: 700 1.15rem var(--font-display);
}

.dashboard-change {
  min-width: 3.5em;
  color: var(--color-accent-strong);
  font: 700 1.3rem var(--font-display);
  text-align: right;
}

.dashboard-hint {
  color: var(--color-review-text);
  font-weight: 600;
}

.dashboard-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dashboard-chips a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-page);
  color: var(--color-text);
  text-decoration: none;
}

.dashboard-lapsed h2 {
  margin: 0;
}

.dashboard-lapsed p {
  margin: 0;
}

/* The rail's way back to Today (shell/main.ts), under the sync status. */
.rail-footer .rail-today {
  min-height: 36px;
  margin: 0 -8px;
  padding: 0 8px;
  color: var(--color-accent-strong);
  font-weight: 600;
}
