:root {
  color-scheme: dark;
  --bg: #0f1116;
  --panel: #181c23;
  --panel-2: #232933;
  --line: #313846;
  --text: #edf1f7;
  --muted: #a7b0c0;
  --accent: #32c0a8;
  --blue: #2f8cff;
  --good: #60d394;
  --bad: #f06767;
  --warning: #ffc107;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -2;
  background-image: url("./assets/dashboard-background.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

body::after {
  z-index: -1;
  background:
    radial-gradient(circle at 18% 0%, rgb(50 192 168 / 0.16), transparent 30%),
    linear-gradient(180deg, rgb(8 11 16 / 0.7), rgb(8 11 16 / 0.92) 34%, rgb(8 11 16 / 0.96));
  backdrop-filter: blur(1px);
}

a,
button,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.student-shell {
  position: relative;
  z-index: 0;
  display: grid;
  gap: 18px;
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar,
.hero-panel,
.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(18 22 29 / 0.58);
  backdrop-filter: blur(8px) saturate(112%);
  box-shadow: 0 18px 44px rgb(0 0 0 / 0.18);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  font-weight: 850;
}

.brand img {
  width: 250px;
  max-width: 40vw;
  max-height: 42px;
  object-fit: contain;
  object-position: left center;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}

.site-nav a:hover,
.primary-action:hover,
.secondary-action:hover,
.review-link:hover {
  border-color: var(--accent);
}

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.student-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.avatar {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 25%);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgb(50 192 168 / 0.24), rgb(47 140 255 / 0.12)),
    #121820;
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.05;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

p,
small {
  color: var(--muted);
}

.user-switcher {
  display: grid;
  gap: 7px;
  min-width: 260px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 10px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.metric-card {
  padding: 16px;
}

.metric-card span {
  display: block;
  overflow-wrap: anywhere;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 8px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.mode-card {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 20px;
  min-height: 260px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background-position: center;
  background-size: cover;
  box-shadow: 0 18px 44px rgb(0 0 0 / 0.18);
}

.mode-card.anatomy {
  border-color: color-mix(in srgb, var(--accent), transparent 48%);
  background-image:
    linear-gradient(90deg, rgb(12 16 22 / 0.9), rgb(12 16 22 / 0.72) 46%, rgb(12 16 22 / 0.46)),
    linear-gradient(180deg, rgb(0 0 0 / 0.1), rgb(0 0 0 / 0.42)),
    url("./assets/anatomy-card.png");
}

.mode-card.diagnosis {
  border-color: color-mix(in srgb, var(--blue), transparent 50%);
  background-image:
    linear-gradient(90deg, rgb(12 16 22 / 0.9), rgb(12 16 22 / 0.72) 46%, rgb(12 16 22 / 0.46)),
    linear-gradient(180deg, rgb(0 0 0 / 0.1), rgb(0 0 0 / 0.42)),
    url("./assets/diagnosis-card.png");
}

.mode-card h2,
.mode-card p,
.mode-card .eyebrow,
.mode-card .mode-actions {
  position: relative;
}

.mode-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mode-choice-group {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.mode-choice-group p {
  justify-self: center;
  max-width: 31ch;
  color: rgb(237 241 247 / 0.92);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.22;
  text-align: center;
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.55);
}

.mode-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
}

.mode-choice svg {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mode-choice strong {
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.1;
}

.primary-action {
  border-color: color-mix(in srgb, var(--accent), transparent 20%);
  background: linear-gradient(135deg, var(--accent), #209987);
  color: #06110f;
}

.secondary-action {
  background: rgb(35 41 51 / 0.88);
}

.secondary-action:hover {
  background: rgb(44 53 66 / 0.94);
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-title > div {
  display: grid;
  gap: 4px;
}

.domain-grid,
.collection-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.domain-card,
.collection-item {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(18 23 32 / 0.62);
  backdrop-filter: blur(6px) saturate(110%);
}

.domain-card-header,
.collection-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.domain-card strong,
.collection-item strong {
  color: var(--text);
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
  padding: 14px;
}

.chart-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(18 23 32 / 0.62);
  backdrop-filter: blur(6px) saturate(110%);
}

.chart-card-wide {
  grid-column: span 2;
}

.chart-card h3 {
  margin: 0;
  font-size: 15px;
}

.chart-card p {
  margin-top: 3px;
  font-size: 12px;
}

.chart-card canvas {
  width: 100%;
  min-height: 210px;
  border-radius: 6px;
  background: rgb(11 15 21 / 0.72);
}

.collection-item {
  padding: 0;
  overflow: hidden;
}

.collection-header {
  width: 100%;
  padding: 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.collection-header:hover {
  background: rgb(255 255 255 / 0.03);
}

.collection-detail {
  display: none;
  gap: 8px;
  padding: 0 12px 12px;
}

.collection-item.open .collection-detail {
  display: grid;
}

.collection-case {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgb(13 19 28 / 0.68);
}

.collection-case-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.collection-case-title strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-case-title small {
  color: var(--muted);
  font-size: 12px;
}

.review-link {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(18 24 32 / 0.72);
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #0b1018;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(13 19 28 / 0.68);
  color: var(--muted);
  font-size: 12px;
}

.pill.good {
  border-color: color-mix(in srgb, var(--good), transparent 40%);
  color: var(--good);
}

.pill.bad {
  border-color: color-mix(in srgb, var(--bad), transparent 40%);
  color: var(--bad);
}

.empty-state {
  padding: 16px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .topbar,
  .hero-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .summary-grid,
  .mode-grid,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .chart-card-wide {
    grid-column: auto;
  }

  .user-switcher {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .mode-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .student-profile {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .brand img {
    max-width: 100%;
  }
}
