@import url("https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400;500;600;700;800&display=swap");

:root {
  --primary: #4f46e5;
  --secondary: #8b5cf6;
  --dark: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --light: #f8fafc;
  --border: #e2e8f0;
  --surface: #ffffff;
  --page-bg: linear-gradient(135deg, #f8fbff 0%, #f5f3ff 100%);

  --success-bg: #dcfce7;
  --success-text: #15803d;
  --warning-bg: #fef3c7;
  --warning-text: #b45309;
  --danger-bg: #fee2e2;
  --danger-text: #b91c1c;
  --info-bg: #dbeafe;
  --info-text: #1d4ed8;
  --neutral-bg: #f1f5f9;
  --neutral-text: #475569;
}

:root[data-theme="dark"] {
  --dark: #f1f5f9;
  --text: #cbd5e1;
  --muted: #94a3b8;
  --light: #0f172a;
  --border: #1e293b;
  --surface: #111827;
  --page-bg: linear-gradient(135deg, #0b1120 0%, #131025 100%);

  --success-bg: #0f2e1c;
  --success-text: #4ade80;
  --warning-bg: #3a2c0d;
  --warning-text: #fbbf24;
  --danger-bg: #3a1414;
  --danger-text: #f87171;
  --info-bg: #12233f;
  --info-text: #60a5fa;
  --neutral-bg: #1e293b;
  --neutral-text: #cbd5e1;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --dark: #f1f5f9;
    --text: #cbd5e1;
    --muted: #94a3b8;
    --light: #0f172a;
    --border: #1e293b;
    --surface: #111827;
    --page-bg: linear-gradient(135deg, #0b1120 0%, #131025 100%);

    --success-bg: #0f2e1c;
    --success-text: #4ade80;
    --warning-bg: #3a2c0d;
    --warning-text: #fbbf24;
    --danger-bg: #3a1414;
    --danger-text: #f87171;
    --info-bg: #12233f;
    --info-text: #60a5fa;
    --neutral-bg: #1e293b;
    --neutral-text: #cbd5e1;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Roboto Slab", Georgia, "Segoe UI", serif;
  color: var(--text);
  background: var(--page-bg);
  line-height: 1.6;
  min-height: 100vh;
}

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

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

h1, h2, h3, h4 {
  color: var(--dark);
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.container {
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.2);
}

.btn-secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--border);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
}

.btn-block {
  width: 100%;
}

/* Top navigation */
.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topnav-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.7rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--dark);
  white-space: nowrap;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex: 1;
  flex-wrap: wrap;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.6rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
}

.nav-link .chevron {
  font-size: 0.65rem;
  transition: transform 0.15s ease;
}

.nav-item.open .nav-link .chevron {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 230px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-item.open .dropdown-menu {
  display: flex;
}

.dropdown-menu a {
  display: flex;
  flex-direction: column;
  padding: 0.55rem 0.7rem;
  border-radius: 0.6rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dark);
}

.dropdown-menu a small {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.76rem;
}

.dropdown-menu a:hover {
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
}

.topnav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--neutral-bg);
  position: relative;
  cursor: pointer;
}

.theme-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: transform 0.15s ease;
}

:root[data-theme="dark"] .theme-toggle::after {
  transform: translateX(20px);
}

.lang-toggle {
  width: auto;
  height: 26px;
  padding: 0 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--neutral-bg);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.lang-toggle:hover {
  background: var(--surface);
  border-color: var(--primary);
  color: var(--primary);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
}

.user-menu:hover {
  background: rgba(79, 70, 229, 0.08);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

img.avatar {
  object-fit: cover;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-meta strong {
  font-size: 0.85rem;
  color: var(--dark);
}

.user-meta span {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: capitalize;
}

/* Page layout */
.page {
  padding: 2rem 0 4rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  padding: 1.3rem;
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.04);
}

/* Stat cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.stat-card .stat-icon {
  font-size: 1.2rem;
  margin-bottom: 0.2rem;
}

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--dark);
}

.stat-card .stat-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.stat-card.highlight {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
}

.stat-card.highlight .stat-value,
.stat-card.highlight .stat-label {
  color: white;
}

/* Filters row */
.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1.2rem;
}

.filters-row input,
.filters-row select {
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  min-width: 170px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.2rem;
}

.tab {
  padding: 0.7rem 0.1rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 640px;
}

table.data-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}

table.data-table tr:last-child td {
  border-bottom: none;
}

table.data-table tbody tr:hover {
  background: rgba(79, 70, 229, 0.04);
}

.cell-name {
  font-weight: 600;
  color: var(--dark);
}

.cell-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Pills / badges */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.pill-success { background: var(--success-bg); color: var(--success-text); }
.pill-warning { background: var(--warning-bg); color: var(--warning-text); }
.pill-danger { background: var(--danger-bg); color: var(--danger-text); }
.pill-info { background: var(--info-bg); color: var(--info-text); }
.pill-neutral { background: var(--neutral-bg); color: var(--neutral-text); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.empty-state .icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* Forms */
.form-field {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dark);
}

.form-field input,
.form-field textarea,
.form-field select {
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
}

.form-field textarea {
  resize: vertical;
  min-height: 90px;
}

.form-error {
  background: var(--danger-bg);
  color: var(--danger-text);
  padding: 0.7rem 0.9rem;
  border-radius: 0.7rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}

.form-error.visible {
  display: block;
}

/* Login page */
.login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.login-banner {
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  padding: 3rem 1.5rem 3.5rem;
  text-align: center;
}

:root[data-theme="dark"] .login-banner {
  background: linear-gradient(135deg, #131025, #0b1120);
}

.login-banner h1 {
  font-size: 1.7rem;
  margin-bottom: 0.5rem;
}

.login-banner p {
  color: var(--muted);
  max-width: 420px;
  margin: 0 auto;
}

.login-body {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  padding: 2rem;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
  height: fit-content;
}

.login-role-hint {
  background: var(--info-bg);
  color: var(--info-text);
  border-radius: 0.8rem;
  padding: 0.8rem 1rem;
  font-size: 0.8rem;
  margin-bottom: 1.2rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}

.modal-overlay.visible {
  display: flex;
}

.modal-box {
  background: var(--surface);
  border-radius: 1.1rem;
  padding: 1.6rem;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
}

.modal-box-wide {
  max-width: 720px;
}

.modal-box .modal-close {
  float: right;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--muted);
}

/* Utility */
.muted { color: var(--muted); }
.text-right { text-align: right; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.gap-sm { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.mt-lg { margin-top: 1.5rem; }
.section-title { margin-bottom: 1rem; }
.loading-row { padding: 2rem; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
  .topnav-inner { flex-wrap: wrap; }
  .topnav-links { order: 3; width: 100%; }
}

/* Session card grid (instructor/admin Attendance) */
.session-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.session-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.session-card .session-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
}

.session-card h4 {
  margin: 0.2rem 0 0;
  font-size: 0.98rem;
  color: var(--dark);
}

/* Session detail layout: roster + right sidebar */
.session-detail-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .session-detail-layout { grid-template-columns: 1fr; }
}

.roster-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
}

.roster-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.roster-row:last-child {
  border-bottom: none;
}

.roster-row .roster-who {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
}

.detail-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row .detail-icon {
  font-size: 1rem;
  margin-top: 0.1rem;
}

.detail-row .detail-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 700;
}

.detail-row .detail-value {
  font-size: 0.88rem;
  color: var(--dark);
  font-weight: 600;
}

.audit-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 360px;
  overflow-y: auto;
}

.audit-item {
  font-size: 0.83rem;
  color: var(--text);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.audit-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.audit-item .audit-time {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.presence-icon-group {
  display: flex;
  gap: 0.5rem;
}

.presence-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--muted);
  font-family: inherit;
  transition: transform 0.1s ease;
}

.presence-icon-btn:hover {
  transform: scale(1.08);
}

.presence-icon-btn.present-btn.selected {
  background: #22c55e;
  border-color: #22c55e;
  color: white;
}

.presence-icon-btn.absent-btn.selected {
  background: #ef4444;
  border-color: #ef4444;
  color: white;
}

.absence-reason-note {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.status-select-inline {
  padding: 0.35rem 0.6rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  font: inherit;
  font-size: 0.8rem;
  background: var(--surface);
  color: var(--text);
}

/* Admin sign-in / setup — deliberately distinct "back office" treatment */
.admin-banner {
  background: linear-gradient(135deg, #0f172a, #1e1b4b);
  color: white;
}

.admin-banner p {
  color: rgba(255, 255, 255, 0.7);
}

.admin-banner .eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: white;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.admin-login-card {
  border-top: 4px solid #1e1b4b;
}

/* Progress bars (student progress, instructor guild cards) */
.progress-track {
  background: var(--neutral-bg);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-fill {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  height: 100%;
}

.guild-course-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.5rem 0 0.8rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
}

.guild-course-heading:first-child {
  margin-top: 0;
}

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack .avatar {
  width: 26px;
  height: 26px;
  font-size: 0.68rem;
  border: 2px solid var(--surface);
  margin-left: -8px;
}

.avatar-stack .avatar:first-child {
  margin-left: 0;
}

/* Rich course card (instructor dashboard "My Courses") */
.course-card {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  padding: 1.1rem 1.3rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.course-card:last-child {
  margin-bottom: 0;
}

.course-card .course-icon {
  width: 54px;
  height: 54px;
  border-radius: 1rem;
  background: linear-gradient(135deg, #fb923c, #f97316);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.course-card .course-card-body {
  flex: 1;
  min-width: 220px;
}

.course-card .course-card-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

/* Tasks widget (instructor dashboard) */
.task-list {
  display: flex;
  flex-direction: column;
}

.task-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}

.task-item:last-child {
  border-bottom: none;
}

.task-item .task-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--dark);
}

.task-item .task-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.task-item .task-side {
  text-align: right;
  flex-shrink: 0;
}

.task-item .task-date {
  font-size: 0.75rem;
  color: var(--muted);
}

/* My Students preview rows (instructor dashboard) */
.student-mini-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
}

a.student-mini-row:hover {
  background: var(--neutral-bg);
  border-radius: 0.6rem;
}

.student-mini-row:last-child {
  border-bottom: none;
}

.student-mini-row .student-mini-info {
  flex: 1;
  min-width: 0;
}

.student-mini-row .student-mini-progress {
  width: 130px;
  flex-shrink: 0;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--dark);
}

/* Lesson body rendering: prose, code-editor-style blocks, figures */
.lesson-body p {
  margin: 0 0 1rem;
  line-height: 1.65;
  font-size: 0.95rem;
}

.lesson-body ul {
  margin: 0 0 1rem;
  padding-left: 1.3rem;
  line-height: 1.65;
  font-size: 0.95rem;
}

.lesson-body code {
  background: var(--neutral-bg);
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
  font-size: 0.85em;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.lesson-figure {
  margin: 0 0 1.2rem;
}

.lesson-figure img {
  max-width: 100%;
  border-radius: 0.7rem;
  border: 1px solid var(--border);
  display: block;
}

.lesson-figure figcaption {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.4rem;
  text-align: center;
}

.code-editor {
  margin: 0 0 1.2rem;
  border-radius: 0.8rem;
  overflow: hidden;
  background: #1e1e2e;
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.12);
}

.code-editor-titlebar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.9rem;
  background: #262638;
}

.code-editor-dots {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.code-editor-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.code-editor-dots span:nth-child(1) { background: #ff5f56; }
.code-editor-dots span:nth-child(2) { background: #ffbd2e; }
.code-editor-dots span:nth-child(3) { background: #27c93f; }

.code-editor-filename {
  font-size: 0.78rem;
  color: #cbd5e1;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.code-editor-body {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  color: #e2e8f0;
  font-size: 0.85rem;
  line-height: 1.55;
}

.code-editor-body code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  background: none;
  padding: 0;
}

/* Student welcome page (pre-onboarding) */
.welcome-illustration {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-radius: 1.3rem;
  padding: 2rem 1.5rem 2.5rem;
  color: white;
  text-align: center;
}

.welcome-callout {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 0.9rem;
  padding: 0.9rem 1.1rem;
  font-weight: 700;
  font-size: 0.9rem;
  margin: 0 auto 2.2rem;
  max-width: 320px;
}

.welcome-doc-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 2.2rem;
}

.welcome-doc {
  width: 120px;
  height: 140px;
  background: white;
  border-radius: 0.8rem;
  position: relative;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.18);
}

.welcome-doc-arrow {
  color: rgba(255, 255, 255, 0.55);
  font-size: 1.1rem;
}

.welcome-doc-badge {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -14px;
  white-space: nowrap;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

.welcome-doc-badge-edit { background: #f97316; color: white; }
.welcome-doc-badge-verified { background: #2563eb; color: white; top: -14px; bottom: auto; }

.welcome-stat-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.welcome-stat {
  background: white;
  color: var(--dark);
  border-radius: 0.8rem;
  padding: 0.7rem 1.1rem;
  font-weight: 800;
  font-size: 1.05rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.3;
}

.welcome-stat small { font-weight: 600; font-size: 0.66rem; color: var(--muted); }
.welcome-stat-hired { background: #22c55e; color: white; }

/* Student onboarding wizard */
.onboarding-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .onboarding-layout { grid-template-columns: 1fr; }
}

.onboarding-progress-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  padding: 1.3rem;
  text-align: center;
  margin-bottom: 1rem;
}

.onboarding-progress-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.onboarding-progress-ring::before {
  content: "";
  position: absolute;
  inset: 6px;
  background: var(--surface);
  border-radius: 50%;
}

.onboarding-progress-ring span {
  position: relative;
  z-index: 1;
  font-weight: 800;
  color: var(--dark);
}

.onboarding-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  overflow: hidden;
}

.onboarding-step {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.onboarding-step:last-child { border-bottom: none; }

.onboarding-step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--neutral-bg);
  color: var(--muted);
  flex-shrink: 0;
}

.onboarding-step-current { color: var(--primary); }
.onboarding-step-current .onboarding-step-dot { background: var(--primary); color: white; }
.onboarding-step-done { color: var(--dark); }
.onboarding-step-done .onboarding-step-dot { background: #22c55e; color: white; }
.onboarding-step-clickable { cursor: pointer; }
.onboarding-step-clickable:hover { background: rgba(79, 70, 229, 0.05); }

.onboarding-step-card { min-height: 360px; }

.onboarding-upload-preview {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin: 1rem 0 1.5rem;
}

.onboarding-upload-preview img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}

.onboarding-language-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.6rem;
}

.onboarding-language-row .lang-name,
.onboarding-language-row .lang-level {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  font: inherit;
  background: var(--surface);
  color: var(--text);
}

.onboarding-language-row .lang-name { flex: 1; }

.lesson-nav-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Student dashboard: current/upcoming session banner */
.session-banner {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-radius: 1.2rem;
  padding: 1.4rem 1.6rem;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.session-banner .session-banner-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 0.3rem;
}

.session-banner h3 {
  color: white;
  font-size: 1.15rem;
  margin: 0 0 0.4rem;
}

.session-banner .session-banner-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
}

/* Student dashboard: profile progression card */
.profile-progress-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  padding: 1.2rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.profile-progress-card .profile-progress-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-progress-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.profile-progress-ring::before {
  content: "";
  position: absolute;
  inset: 6px;
  background: var(--surface);
  border-radius: 50%;
}

.profile-progress-ring span {
  position: relative;
  z-index: 1;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--dark);
}

/* Rating popup */
.rating-steps {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.rating-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.rating-step .rating-step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--neutral-bg);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.rating-step.rating-step-active { color: var(--primary); }
.rating-step.rating-step-active .rating-step-dot { background: var(--primary); color: white; }
.rating-step.rating-step-done { color: var(--dark); }
.rating-step.rating-step-done .rating-step-dot { background: #22c55e; color: white; }

.rating-step-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.rating-scale {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0 0.5rem;
}

.rating-scale-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.rating-scale-btn {
  width: 40px;
  height: 40px;
  border-radius: 0.7rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
}

.rating-scale-btn:hover { border-color: var(--primary); }
.rating-scale-btn.selected { background: var(--primary); color: white; border-color: var(--primary); }

.rating-scale-face { font-size: 1.1rem; }
.rating-scale-face-low { color: #ef4444; }
.rating-scale-face-mid { color: #f59e0b; }
.rating-scale-face-high { color: #22c55e; }

.rating-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

/* Admin student-progress: onboarding Profile card */
.profile-photo-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.profile-photo-row .avatar {
  width: 72px;
  height: 72px;
  font-size: 1.4rem;
}

.profile-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem 1.5rem;
  margin-bottom: 1.3rem;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.profile-section-heading {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--dark);
  margin: 1.2rem 0 0.6rem;
}

.profile-section-heading:first-child { margin-top: 0; }

/* Auth pages (login / register) */
.auth-page {
  min-height: 100vh;
  background: var(--page-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
}

.auth-topbar {
  width: 100%;
  max-width: 480px;
  display: flex;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.auth-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.9rem;
  border-radius: 0.8rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  padding: 2rem;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--dark);
  margin-bottom: 1.5rem;
}

.auth-brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.auth-card h2 {
  font-size: 1.15rem;
  margin-bottom: 1.2rem;
}

.auth-social-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.auth-social-btn {
  flex: 1 1 0;
  min-width: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 0.5rem;
  font-size: 0.82rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 0 1.2rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-password-wrap {
  position: relative;
}

.auth-password-wrap input {
  width: 100%;
  padding-right: 2.6rem;
}

.auth-password-toggle {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.95rem;
  padding: 0.2rem;
}

/* Final project catalog + detail page */
.project-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.project-card-thumb {
  height: 110px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0.8rem;
  font-size: 2.4rem;
}

.project-card-body {
  padding: 1.1rem 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.project-card-body h3 {
  font-size: 1rem;
  margin: 0;
}

.project-card-desc {
  font-size: 0.82rem;
  color: var(--muted);
  min-height: 2.4em;
}

.project-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--dark);
  padding: 0;
  margin-bottom: 0.2rem;
}

.project-hero-icon {
  width: 60px;
  height: 60px;
  border-radius: 1rem;
  background: var(--neutral-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.project-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.project-worked-on {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.project-meta-row {
  display: flex;
  gap: 1.6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

.project-link-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-link-list a {
  color: var(--primary);
  font-size: 0.88rem;
  word-break: break-all;
}

.project-steps-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
}

@media (max-width: 800px) {
  .project-steps-layout { grid-template-columns: 1fr; }
}

.project-step-item {
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 1rem 1.2rem;
  margin-bottom: 0.8rem;
  cursor: pointer;
}

.project-step-item:last-child { margin-bottom: 0; }

.project-step-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  color: var(--primary);
  font-size: 0.92rem;
}

.project-step-header .step-toggle-icon {
  margin-left: auto;
  color: var(--muted);
  font-weight: 400;
}

.project-step-desc {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.6;
  display: none;
}

.project-step-item.open .project-step-desc { display: block; }

.project-students-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  max-width: 760px;
  margin: 0 auto;
}

.project-student-card {
  border: 2px solid var(--border);
  border-radius: 1rem;
  padding: 1.3rem;
  text-align: center;
  position: relative;
}

.project-student-rank {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  background: var(--info-bg);
  color: var(--info-text);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.project-student-card .avatar {
  width: 56px;
  height: 56px;
  font-size: 1.1rem;
  margin: 0 auto 0.7rem;
}

.project-locked-card {
  text-align: center;
  padding: 3rem 1.5rem;
}

/* Collapsible course-content tree (instructor/admin course preview) */
.course-tree-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .course-tree-layout { grid-template-columns: 1fr; }
}

.course-tree-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  padding: 1rem;
  max-height: 75vh;
  overflow-y: auto;
  position: sticky;
  top: 5rem;
}

.course-tree-sidebar input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  font: inherit;
  background: var(--light);
  color: var(--text);
  margin-bottom: 0.8rem;
}

.course-tree-module {
  border-bottom: 1px solid var(--border);
}

.course-tree-module:last-child { border-bottom: none; }

.course-tree-module-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.3rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--dark);
}

.course-tree-module-header .chevron {
  font-size: 0.65rem;
  color: var(--muted);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.course-tree-module.open .course-tree-module-header .chevron {
  transform: rotate(90deg);
}

.course-tree-module-count {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
}

.course-tree-items {
  display: none;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0 0 0.6rem 1.7rem;
}

.course-tree-module.open .course-tree-items {
  display: flex;
}

.course-tree-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.6rem;
  border-radius: 0.6rem;
  font-size: 0.84rem;
  color: var(--text);
  cursor: pointer;
}

.course-tree-item:hover { background: rgba(79, 70, 229, 0.06); }

.course-tree-item.active {
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  font-weight: 700;
}

.course-tree-item .item-icon {
  flex-shrink: 0;
  font-size: 0.85rem;
}

.course-tree-item.checkpoint-item { color: #b45309; }
.course-tree-item.checkpoint-item.active { color: var(--primary); }
.course-tree-item.locked-item { opacity: 0.55; cursor: not-allowed; }

.course-tree-content {
  min-height: 440px;
}

.course-tree-content h3 {
  margin-bottom: 0.3rem;
}

/* Checkpoint evaluation (instructor "Rate Student" flow) */
.checkpoint-rate-layout {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.checkpoint-left-card {
  flex: 1 1 420px;
  max-width: 560px;
}

.checkpoint-right-col {
  flex: 1 1 360px;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checkpoint-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.checkpoint-title-row h3 {
  margin: 0;
}

.link-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 1.1rem;
  overflow: hidden;
}

.link-field span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-field a {
  flex-shrink: 0;
  color: var(--muted);
}

.checkpoint-submitter {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}

.checkpoint-meta-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text);
}

.checkpoint-meta-list .muted {
  font-size: 0.78rem;
}

/* Verdict panel — initial "what's your verdict" choice */
.verdict-panel h4 {
  font-size: 0.98rem;
  margin-bottom: 0.4rem;
}

.verdict-panel p {
  font-size: 0.85rem;
}

.verdict-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* AI loading card */
.ai-loading-card {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  border-radius: 1.1rem;
  padding: 1.3rem;
  color: white;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ai-loading-card .pill-ai-status {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f97316;
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.ai-loading-card .ai-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

.ai-loading-card p {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Score badge card */
.score-badge-card {
  border-radius: 1.1rem;
  padding: 1.3rem;
  color: white;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
}

.score-badge-card.variant-success { background: #22c55e; }
.score-badge-card.variant-warning { background: #f59e0b; }
.score-badge-card.variant-danger { background: #ef4444; }

.score-badge-card .score-badge-who {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.score-badge-card .score-badge-who .avatar {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.score-badge-card .score-badge-who strong {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.score-badge-card .score-badge-percent {
  font-size: 2.6rem;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
}

.score-badge-card .score-badge-label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.3rem;
}

/* Criteria cards */
.criteria-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.criteria-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  padding: 1.3rem;
}

.criteria-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.criteria-card-top h4 {
  margin: 0;
  font-size: 1rem;
}

.criteria-feedback-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.criteria-feedback-box {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  padding: 0.9rem 1rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text);
}

.criteria-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.9rem;
  font-size: 0.85rem;
}

.link-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0;
  color: var(--primary);
}

.link-action.muted-action {
  color: var(--muted);
}

.link-action:hover {
  text-decoration: underline;
}

.criteria-edit-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.criteria-edit-row input[type="number"] {
  width: 70px;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  font: inherit;
  background: var(--surface);
  color: var(--text);
}

/* Reject-checkpoint reason panel */
.reject-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0;
  margin-bottom: 1rem;
}

.reject-back-link:hover {
  color: var(--primary);
}

/* Instructor student detail page */
.student-detail-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .student-detail-layout { grid-template-columns: 1fr; }
}

.student-sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  padding: 1.4rem;
  text-align: center;
}

.student-sidebar-card .avatar {
  width: 84px;
  height: 84px;
  font-size: 1.8rem;
  margin: 0 auto 0.8rem;
}

.student-sidebar-card h2 {
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}

.student-sidebar-pills {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.8rem 0 1rem;
  flex-wrap: wrap;
}

.student-info-list {
  text-align: left;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 0.4rem;
}

.student-info-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.85rem;
}

.student-info-row:last-child { border-bottom: none; }
.student-info-row .label { color: var(--muted); }
.student-info-row .value { font-weight: 600; text-align: right; }

.student-progress-block {
  text-align: left;
  margin: 1rem 0;
}

.overview-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.overview-stat-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem;
}

.overview-stat-mini .value { font-size: 1.3rem; font-weight: 800; }
.overview-stat-mini .label { font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 0.25rem; }
.overview-stat-mini a { color: var(--primary); text-decoration: none; }

.pending-panel-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.pending-panel-item {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.pending-panel-item:last-child { border-bottom: none; }
.pending-panel-item .cell-sub { margin-top: 0.2rem; }

.progress-insight-card {
  text-align: center;
  padding: 1.5rem 1.2rem;
}

.progress-insight-card h3 {
  font-size: 1.05rem;
  margin: 0.5rem 0;
}

.progress-insight-card.variant-danger h3 { color: var(--danger-text); }
.progress-insight-card.variant-warning h3 { color: var(--warning-text); }
.progress-insight-card.variant-success h3 { color: var(--success-text); }

.progress-insight-desc {
  color: var(--muted);
  font-size: 0.85rem;
  max-width: 380px;
  margin: 0 auto 1.2rem;
}

.expected-progress-track {
  position: relative;
  height: 8px;
  background: var(--neutral-bg);
  border-radius: 999px;
  margin: 1.8rem 0.5rem 0.5rem;
}

.expected-progress-track .progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
}

.progress-insight-card.variant-danger .expected-progress-track .progress-fill { background: var(--danger-text); }
.progress-insight-card.variant-warning .expected-progress-track .progress-fill { background: var(--warning-text); }
.progress-insight-card.variant-success .expected-progress-track .progress-fill { background: var(--success-text); }

.expected-marker {
  position: absolute;
  top: -14px;
  bottom: -6px;
  width: 2px;
  background: var(--text);
}

.expected-marker .expected-label {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

.expected-progress-track .current-label {
  position: absolute;
  top: 14px;
  font-size: 0.8rem;
  font-weight: 700;
  transform: translateX(-50%);
}

.score-mini-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
}

.score-mini-card + .score-mini-card { border-top: 1px solid var(--border); }

.score-mini-card .score-mini-label { font-weight: 700; font-size: 0.9rem; }
.score-mini-card .score-mini-sub { font-size: 0.78rem; color: var(--muted); margin: 0.15rem 0 0.3rem; }
.score-mini-card .score-mini-sub a { color: var(--primary); text-decoration: none; }
.score-mini-card .score-mini-value { font-size: 1.4rem; font-weight: 800; }

.attendance-summary-banner {
  background: var(--success-text);
  color: white;
  border-radius: 1rem;
  padding: 1.4rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.attendance-summary-banner .percent { font-size: 1.8rem; font-weight: 800; }
.attendance-summary-banner .message { font-size: 0.85rem; opacity: 0.95; }
.attendance-summary-banner a { color: white; font-weight: 700; text-decoration: underline; }

.attendance-summary-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
  text-align: center;
  padding: 0 0.5rem;
}

.attendance-summary-side .value { font-size: 1.3rem; font-weight: 800; }
.attendance-summary-side .label { font-size: 0.75rem; color: var(--muted); }
