/* ============================================================
   Dashboard — the landing page, and the tile pages behind its
   section cards. Full width, no sidebar.

   The type scale here is deliberately narrow: one hero figure, one
   heading size, one label size, one note size. A dashboard goes wrong
   by having six sizes that all mean "important".
   ============================================================ */

body.no-sidebar .scrim { display: none; }

.main.dash {
  background:
    radial-gradient(900px 420px at 88% -10%, color-mix(in srgb, var(--brand-500) 14%, transparent), transparent 70%),
    radial-gradient(700px 380px at 5% 0%, color-mix(in srgb, var(--accent-500) 8%, transparent), transparent 65%),
    var(--bg);
}

.dash-wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 30px 72px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ---------- hero ---------- */

.dash-hero {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 34px 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
}
.dash-hero-text { flex: 1; min-width: 0; }

.dash-hero .kicker { display: flex; align-items: center; gap: 9px; }
.kicker-sub {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.dash-hero-text h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 14px 0 8px;
}
.dash-hero-text p {
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.65;
  max-width: 56ch;
  margin: 0;
}

.dash-hero-actions { margin-top: 22px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dash-hero-hint {
  font-size: 12.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 32ch;
}

/* ---------- the hero figure ---------- */

.dash-hero-dial { position: relative; flex-shrink: 0; display: grid; place-items: center; }
.dash-dial { display: block; }
/* A meter's unfilled track is a lighter step of the same hue, so the state
   reads across the whole arc rather than only where the fill stops. */
.dash-dial-track { fill: none; stroke: var(--meter-track); stroke-width: 11; }
.dash-dial-fill {
  fill: none;
  stroke: var(--brand);
  stroke-width: 11;
  stroke-linecap: round;
  transition: stroke-dasharray .7s var(--ease);
}
.dash-dial-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  line-height: 1;
}
/* The one number this page leads with. Sans rather than the display face —
   a display face at figure sizes reads as decoration — and proportional
   figures, since `tabular-nums` makes a standalone number look loose. */
.dash-dial-center strong {
  display: block;
  font-family: var(--font-body);
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -.03em;
  color: var(--text);
}
.dash-dial-center strong small { font-size: 22px; font-weight: 500; color: var(--text-3); margin-left: 1px; }
.dash-dial-center span {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .1em;
}

/* ---------- collapsible panels ---------- */

.dash-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.dash-panel-head {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 16px 22px;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  transition: background .12s var(--ease);
}
.dash-panel-head:hover { background: var(--surface-2); }

.dash-panel-chev {
  display: grid;
  place-items: center;
  color: var(--text-3);
  transform: rotate(90deg);
  transition: transform .2s var(--ease);
}
.dash-panel.shut .dash-panel-chev { transform: rotate(0deg); }

.dash-panel-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-2);
}
.dash-panel-note {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
}
.dash-panel-body { padding: 4px 22px 22px; }

/* ---------- the KPI row ---------- */

.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.dash-stat {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 15px 17px 16px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
/* Label first, then the value. Reading order matches the question being
   asked — "assessment score: 78%", not "78%… of what?". */
.dash-stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: .01em;
  margin-bottom: 6px;
}
.dash-stat-value {
  font-family: var(--font-body);
  font-size: 27px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.02em;
  color: var(--text);
}
.dash-stat-note { margin-top: 8px; font-size: 11.5px; line-height: 1.45; color: var(--text-3); }
.dash-stat .dash-meter { margin-top: 11px; }

/* ---------- meters ---------- */

.dash-meter {
  display: block;
  height: 5px;
  border-radius: 3px;
  background: var(--meter-track);
  overflow: hidden;
}
.dash-meter > i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--brand);
  transition: width .5s var(--ease);
}
/* Severity, always paired with words in the note beside it — never colour
   alone. These are the portal's status tokens rather than new hues, so each
   theme gets a step chosen for its own surface instead of one flipped from
   the other. */
.dash-meter > i.good { background: var(--ok-fg); }
.dash-meter > i.warn { background: var(--warn-fg); }

/* ---------- per-course progress ---------- */

.dash-courses { margin-top: 16px; border-top: 1px solid var(--line); }
.dash-course-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 42px 92px;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 11px 4px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  transition: background .12s var(--ease);
}
.dash-course-row:last-child { border-bottom: 0; }
.dash-course-row:hover { background: var(--surface-2); }
.dash-course-name {
  font-size: 13.5px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* A column of numbers is the one place tabular figures belong. */
.dash-course-num {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.dash-course-meta { font-size: 12px; color: var(--text-3); text-align: right; }

/* ---------- the section cards ---------- */

.dash-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.dash-section {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  text-align: left;
  padding: 26px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease);
}
.dash-section:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-300);
}
.dash-section:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.dash-section-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  flex-shrink: 0;
}
.dash-section-icon.docs { background: var(--brand-soft); color: var(--brand-text); }
.dash-section-icon.apis { background: var(--warn-bg); color: var(--warn-fg); }

.dash-section-body { flex: 1; min-width: 0; display: block; }
.dash-section-body strong { display: block; font-family: var(--font-display); font-size: 20px; }
.dash-section-body > span { display: block; margin-top: 4px; font-size: 12.5px; color: var(--brand-text); font-weight: 600; }
.dash-section-body em {
  display: block;
  margin-top: 9px;
  font-style: normal;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
}
.dash-section-go { color: var(--text-3); flex-shrink: 0; transition: transform .16s var(--ease), color .16s var(--ease); }
.dash-section:hover .dash-section-go { color: var(--brand); transform: translateX(4px); }

/* ---------- tile pages ---------- */

.dash-back {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.dash-back h1 { font-family: var(--font-display); font-size: 27px; letter-spacing: -.01em; }
.dash-back > span { font-size: 13px; color: var(--text-3); }
.dash-back .btn { align-self: center; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 16px;
}

.dash-tile {
  display: flex;
  flex-direction: column;
  gap: 9px;
  text-align: left;
  padding: 20px;
  min-height: 176px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease);
}
.dash-tile:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-300);
}
.dash-tile:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.dash-tile:disabled { opacity: .55; cursor: default; }

.dash-tile-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dash-tile-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
}
.dash-tile-icon {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  color: var(--brand-text);
}
.dash-tile-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.dash-tile-title {
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.35;
  /* Chapter titles vary wildly in length; clamp so every tile lines up. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dash-tile-meta { font-size: 12px; color: var(--text-3); }
.dash-tile-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dash-tile-desc p { margin: 0; }

.dash-tile-methods { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.dash-tile-count { font-size: 11.5px; color: var(--text-3); margin-right: 6px; }

.dash-tile-bar {
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
  margin-top: auto;
}
.dash-tile-bar > i {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--brand-500), var(--brand-400));
  transition: width .4s var(--ease);
}
.dash-tile-bar > i.complete { background: linear-gradient(90deg, var(--ok-fg), #34d399); }

.dash-tile-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-3);
}

/* ---------- brand button in the sidebar ---------- */

.brand {
  width: 100%;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
  border-radius: var(--r-md);
  transition: opacity .15s var(--ease);
}
.brand:hover { opacity: .82; }
.brand:hover .brand-home { color: var(--accent-400); }
.brand:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 3px; }
.brand-home {
  margin-left: auto;
  color: var(--nav-text-2);
  display: inline-flex;
  flex-shrink: 0;
  transition: color .15s var(--ease);
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-sections { grid-template-columns: minmax(0, 1fr); }
  .dash-hero { flex-direction: column-reverse; align-items: flex-start; gap: 22px; padding: 26px; }
  .dash-hero-text h1 { font-size: 27px; }
}

@media (max-width: 640px) {
  .dash-wrap { padding: 24px 16px 44px; gap: 22px; }
  .dash-stats { gap: 10px; }
  .dash-stat { padding: 14px 15px; }
  .dash-stat-value { font-size: 23px; }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ==================================================================
   Courses, and the Recent updates feed
   ================================================================== */

/* ---------- one course's page ---------- */

.dash-course-lead { color: var(--text-2); font-size: 13.5px; margin: -4px 0 18px; max-width: 70ch; }
.dash-course-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.dash-course-pct { font-size: 12.5px; color: var(--text-3); }
.dash-course-sub {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 28px 0 14px;
}



/* A card that is one of three rather than one of two: slightly tighter, and
   the blurb clamped so an uneven row of three does not stagger. */
.dash-section-body em {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dash-section-icon.guides { background: var(--brand-soft); color: var(--brand-text); }

@media (max-width: 1000px) {
  .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-sections { grid-template-columns: minmax(0, 1fr); }
  .dash-course-row { grid-template-columns: minmax(0, 1fr) 88px 40px; }
  .dash-course-meta { display: none; }
}

@media (max-width: 720px) {
  .dash-wrap { padding: 24px 16px 56px; gap: 16px; }
  .dash-hero { flex-direction: column-reverse; align-items: flex-start; gap: 22px; padding: 24px 22px; }
  .dash-hero-text h1 { font-size: 26px; }
  .dash-panel-body { padding: 4px 16px 18px; }
  .dash-panel-head { padding: 14px 16px; }
  .dash-panel-note { display: none; }
}
