:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-soft: #f9fbfe;
  --line: #dce4ee;
  --line-strong: #c8d5e4;
  --ink: #233447;
  --ink-soft: #607083;
  --blue-100: #e6f0fb;
  --blue-200: #d5e7fa;
  --blue-400: #7fa7cf;
  --blue-600: #476d96;
  --sand-100: #f5eddf;
  --sand-200: #e9dcc5;
  --mint-100: #e2f2ea;
  --mint-500: #5b8c75;
  --rose-100: #fbecee;
  --shadow: 0 14px 32px rgba(52, 77, 105, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(213, 231, 250, 0.48), transparent 24%),
    linear-gradient(180deg, #fbfdff 0%, #f5f2ec 100%);
  color: var(--ink);
  font-family: "Sora", sans-serif;
}

button,
a {
  font: inherit;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

a {
  text-decoration: none;
}

.app-shell {
  width: min(1420px, calc(100% - 28px));
  margin: 14px auto;
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
  gap: 18px;
}

.sidebar,
.main-panel {
  min-height: calc(100vh - 28px);
  border: 1px solid rgba(220, 228, 238, 0.9);
  box-shadow: var(--shadow);
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 22px 18px;
  background:
    radial-gradient(circle at top, rgba(245, 237, 223, 0.55), transparent 24%),
    linear-gradient(180deg, rgba(245, 250, 255, 0.96), rgba(240, 246, 252, 0.9));
  border-radius: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 6px;
}

.brand__crest {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--blue-200), var(--sand-100));
  color: var(--blue-600);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand__copy strong,
.brand__copy small {
  display: block;
}

.brand__copy small {
  margin-top: 3px;
  color: var(--ink-soft);
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-nav a,
.mobile-nav a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  color: var(--ink-soft);
  font-weight: 600;
  transition:
    background-color 180ms ease,
    transform 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus-visible,
.sidebar-nav a.is-active,
.mobile-nav a.is-active {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(127, 167, 207, 0.16);
}

.nav-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue-400), var(--sand-200));
}

.sidebar-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(220, 228, 238, 0.9);
}

.sidebar-card--soft {
  background: linear-gradient(180deg, rgba(245, 237, 223, 0.65), rgba(255, 255, 255, 0.82));
}

.sidebar-card__label,
.eyebrow {
  margin: 0;
  color: var(--blue-600);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-card strong,
.student-chip strong,
.metric-row strong,
.stat-box strong,
.board-row strong,
.table-row strong,
.history-item strong,
.step-card strong {
  display: block;
}

.sidebar-card span,
.metric-row span,
.agenda-card span,
.board-row span,
.table-row span,
.badge-card p,
.history-item span,
.step-card span,
.stat-box span,
.profile-banner__copy span {
  color: var(--ink-soft);
  line-height: 1.6;
}

.main-panel {
  background: rgba(255, 255, 255, 0.86);
  border-radius: 34px;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.topbar h1,
.module h2,
.profile-banner__copy h2 {
  margin: 6px 0 0;
  font-family: "Newsreader", serif;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.topbar h1 {
  font-size: clamp(2rem, 3vw, 3.1rem);
  line-height: 0.98;
  max-width: 13ch;
}

.module h2,
.profile-banner__copy h2 {
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.02;
}

.topbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.ghost-button,
.pill-button,
.filter-pill {
  border: 0;
  background: rgba(245, 249, 253, 0.96);
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

.ghost-button:hover,
.pill-button:hover,
.filter-pill:hover,
.ghost-button:focus-visible,
.pill-button:focus-visible,
.filter-pill:focus-visible,
.filter-pill.is-active {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--blue-200), var(--sand-100));
  box-shadow: 0 12px 24px rgba(70, 104, 143, 0.12);
}

.student-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 12px;
  border-radius: 20px;
  background: rgba(249, 252, 255, 0.92);
  border: 1px solid var(--line);
}

.student-chip__avatar,
.profile-avatar {
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-weight: 700;
  color: var(--blue-600);
  background: linear-gradient(135deg, var(--blue-200), var(--sand-100));
}

.student-chip__avatar {
  width: 40px;
  height: 40px;
  font-size: 0.92rem;
}

.student-chip small {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
}

.dashboard-grid,
.profile-layout,
.leaderboard-layout {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.dashboard-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.module {
  background: var(--panel);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 20px;
}

.module--hero {
  grid-column: span 7;
  background:
    radial-gradient(circle at top right, rgba(230, 240, 251, 0.78), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.module--wide {
  grid-column: span 12;
}

.dashboard-grid > .module:nth-child(2) {
  grid-column: span 5;
}

.dashboard-grid > .module:nth-child(3),
.dashboard-grid > .module:nth-child(4) {
  grid-column: span 6;
}

.module__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.inline-link {
  color: var(--blue-600);
  font-weight: 700;
}

.hero-metrics {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 24px;
  margin-top: 18px;
  align-items: center;
}

.ring-card {
  display: grid;
  place-items: center;
  padding: 10px;
}

.progress-ring {
  --progress: 0deg;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, white 54%, transparent 55%),
    conic-gradient(var(--blue-400) 0deg, var(--blue-600) var(--progress), rgba(220, 228, 238, 0.95) var(--progress), rgba(220, 228, 238, 0.95) 360deg);
  display: grid;
  place-items: center;
}

.progress-ring__inner {
  display: grid;
  place-items: center;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: white;
  box-shadow: inset 0 0 0 1px rgba(220, 228, 238, 0.9);
}

.progress-ring__inner strong {
  font-size: 1.6rem;
}

.progress-ring__inner span {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.hero-details,
.agenda-list,
.mini-board,
.event-preview-grid,
.badge-strip,
.history-stack,
.next-steps,
.event-board,
.badge-cabinet,
.leaderboard-table {
  display: grid;
  gap: 14px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.metric-row:last-child {
  border-bottom: 0;
}

.agenda-card,
.board-row,
.table-row,
.event-card,
.badge-card,
.history-item,
.step-card,
.stat-box {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.agenda-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
}

.agenda-card__date {
  display: grid;
  place-items: center;
  min-height: 72px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--blue-100), var(--sand-100));
  text-align: center;
}

.agenda-card__date strong {
  font-size: 1.2rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: white;
  color: var(--blue-600);
  font-weight: 700;
}

.mini-board {
  margin-top: 18px;
}

.board-row,
.table-row {
  display: grid;
  align-items: center;
  gap: 14px;
  padding: 14px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.board-row:hover,
.table-row:hover,
.event-card:hover,
.badge-card:hover,
.step-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(70, 104, 143, 0.08);
  background: white;
}

.board-row {
  grid-template-columns: 56px minmax(0, 1fr) auto;
}

.rank-badge {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--blue-200), var(--sand-100));
  font-weight: 700;
  color: var(--blue-600);
}

.delta-chip {
  display: inline-flex;
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--mint-100);
  color: var(--mint-500);
  font-weight: 700;
}

.badge-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
}

.badge-card {
  padding: 16px;
}

.badge-glyph {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--blue-200), var(--sand-100));
  color: var(--blue-600);
  font-weight: 700;
}

.badge-card p {
  margin: 6px 0 0;
}

.event-preview-grid,
.event-board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.event-card {
  overflow: hidden;
}

.event-art {
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(circle at 22% 22%, rgba(245, 237, 223, 0.98), transparent 16%),
    radial-gradient(circle at 76% 24%, rgba(213, 231, 250, 0.98), transparent 19%),
    linear-gradient(180deg, #edf4fb 0%, #f9fbfe 100%);
  position: relative;
}

.event-art::before,
.event-art::after {
  content: "";
  position: absolute;
  border-radius: 999px;
}

.event-art::before {
  inset: auto 18px 18px 18px;
  height: 20px;
  background: linear-gradient(90deg, var(--blue-200), transparent);
}

.event-art::after {
  width: 86px;
  height: 86px;
  right: 22px;
  bottom: 34px;
  background: linear-gradient(135deg, rgba(127, 167, 207, 0.22), rgba(245, 237, 223, 0.56));
}

.event-card__body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.event-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.event-card__footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.event-card__footer button {
  border: 0;
  border-radius: 14px;
  min-height: 42px;
  padding: 0 14px;
  background: linear-gradient(135deg, var(--blue-200), var(--sand-100));
  cursor: pointer;
  font-weight: 700;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.leaderboard-layout {
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: start;
}

.leaderboard-summary {
  display: grid;
  gap: 14px;
}

.summary-tile {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.summary-tile strong {
  font-size: 1.35rem;
}

.leaderboard-table {
  margin-top: 4px;
}

.table-row {
  grid-template-columns: 70px minmax(220px, 1.4fr) 1fr 220px;
}

.table-row__progress {
  display: grid;
  gap: 8px;
}

.bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(220, 228, 238, 0.92);
}

.bar-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-400), var(--blue-600));
  transition: width 900ms cubic-bezier(0.19, 1, 0.22, 1);
}

.profile-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-hero {
  grid-column: span 2;
}

.profile-banner {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.profile-avatar {
  width: 110px;
  height: 110px;
  border-radius: 28px;
  font-size: 1.8rem;
}

.profile-banner__copy p {
  margin: 8px 0 10px;
  color: var(--blue-600);
  font-weight: 700;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.stat-box {
  padding: 16px;
}

.progress-block {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.badge-cabinet {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.history-item {
  padding: 16px;
}

.history-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.next-steps {
  margin-top: 18px;
}

.step-card {
  padding: 16px;
}

.mobile-nav {
  display: none;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .event-preview-grid,
  .event-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .badge-strip,
  .badge-cabinet {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-row {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .table-row__progress {
    grid-column: 1 / -1;
  }

  .leaderboard-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: min(100% - 20px, 100%);
  }

  .sidebar {
    min-height: auto;
  }

  .main-panel {
    min-height: auto;
  }

  .dashboard-grid,
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .module--hero,
  .dashboard-grid > .module:nth-child(2),
  .dashboard-grid > .module:nth-child(3),
  .dashboard-grid > .module:nth-child(4),
  .module--wide,
  .profile-hero {
    grid-column: auto;
  }

  .hero-metrics,
  .profile-banner,
  .topbar {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .topbar h1 {
    max-width: none;
  }

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

@media (max-width: 720px) {
  .sidebar {
    display: none;
  }

  .main-panel {
    padding: 18px 18px 86px;
  }

  .event-preview-grid,
  .event-board,
  .badge-strip,
  .badge-cabinet {
    grid-template-columns: 1fr;
  }

  .agenda-card,
  .board-row,
  .profile-banner {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .metric-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .mobile-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
  }

  .mobile-nav a {
    justify-content: center;
    padding: 12px 10px;
    border-radius: 14px;
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .bar-fill,
  .sidebar-nav a,
  .mobile-nav a,
  .ghost-button,
  .pill-button,
  .filter-pill,
  .board-row,
  .table-row,
  .event-card,
  .badge-card,
  .step-card {
    transition: none;
  }
}
