/* ============================================================
   Code Way Academy · dashboard
   Loaded after site.css and console.css.
   ============================================================ */

.dashboard-page .dash-main {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: clamp(42px, 7vw, 84px) auto 90px;
}

.dash-head {
  max-width: 800px;
  margin-bottom: 28px;
}

.dash-head h1 {
  max-width: 16ch;
  margin: 16px 0;
  font-size: clamp(38px, 5.6vw, 62px);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 1;
}

.dash-head h1 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--sky);
}

.dash-head > p {
  max-width: 60ch;
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.75;
}

.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.dash-loading {
  margin: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--faint);
  font-size: 13px;
}

.dash-loading.is-error {
  border-color: rgba(251, 113, 133, 0.4);
  color: var(--red);
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.dash-stat {
  display: grid;
  gap: 3px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
}

.dash-stat span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dash-stat strong {
  overflow: hidden;
  font-size: 22px;
  font-weight: 620;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-stat em {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 350px);
  gap: 18px;
  align-items: start;
}

.dash-main-col,
.dash-side {
  display: grid;
  gap: 16px;
}

.dash-card {
  padding: clamp(18px, 2.6vw, 26px);
  border-radius: 22px;
}

.dash-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dash-card-head h2 {
  margin: 5px 0 0;
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 620;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.dash-card-head > a,
.dash-card-head > span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.dash-card-head > a:hover {
  color: var(--sky);
}

.dash-badge {
  padding: 4px 8px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 999px;
  color: var(--sky) !important;
  font-family: var(--mono);
  font-size: 7.5px !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.dash-badge.is-locked {
  border-color: var(--line);
  color: var(--faint) !important;
}

.dash-continue-copy {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.dash-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.dash-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sky), var(--blue), var(--magenta));
  transition: width 0.6s var(--ease);
}

.dash-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  color: var(--faint);
  font-size: 10.5px;
}

.dash-track-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dash-track {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
}

.dash-track.is-live {
  border-color: rgba(56, 189, 248, 0.32);
}

.dash-track.is-future {
  opacity: 0.66;
}

.dash-track-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dash-track-top strong {
  font-size: 12.5px;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.dash-track-top span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.dash-track.is-live .dash-track-top span {
  color: var(--sky);
}

.dash-track p {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.dash-track a,
.dash-track-foot {
  margin-top: auto;
  padding-top: 6px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.dash-track a:hover {
  color: var(--sky);
}

.dash-project-list {
  display: grid;
  gap: 8px;
}

.dash-project {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
}

.dash-project.is-locked {
  opacity: 0.68;
}

.dash-project.is-open {
  border-color: rgba(56, 189, 248, 0.24);
}

.dash-project-num {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.dash-project-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.dash-project-copy strong {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-project-copy p {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-project-note {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dash-project-action {
  display: flex;
  justify-content: flex-end;
}

.dash-project-action .btn {
  height: 32px;
  padding: 0 10px;
  font-size: 10px;
}

.dash-project-action span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dash-plan {
  display: grid;
  gap: 6px;
}

.dash-plan strong {
  font-size: 20px;
  font-weight: 620;
  letter-spacing: -0.04em;
}

.dash-plan > span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dash-plan p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.dash-plan .btn {
  margin-top: 4px;
}

.dash-skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dash-skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
}

.dash-skill-chip b {
  color: var(--sky);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
}

.dash-empty {
  margin: 0;
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.7;
}

.dash-class-name {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 620;
  letter-spacing: -0.03em;
}

.dash-class-meta {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.dash-verify {
  display: inline-flex;
  margin-top: 4px;
  color: var(--sky);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

.dash-verify:hover {
  text-decoration: underline;
}

.dash-teacher-actions {
  display: grid;
  gap: 7px;
  margin-top: 4px;
}

.dash-teacher-actions .btn {
  width: 100%;
  justify-content: center;
}

.dash-note {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.6;
}

@media (max-width: 980px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }

  .dash-side {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .dash-stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .dash-main {
    width: calc(100% - 24px);
    margin-top: 34px;
  }

  .dash-side {
    grid-template-columns: 1fr;
  }

  .dash-track-grid {
    grid-template-columns: 1fr;
  }

  .dash-project {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .dash-project-action {
    grid-column: 2;
    justify-content: flex-start;
  }

  .dash-account-link {
    display: none;
  }
}

@media (max-width: 520px) {
  .dash-stats {
    grid-template-columns: 1fr;
  }

  .dash-actions .btn {
    width: 100%;
  }
}
