:root {
  --ct-ink: #182338;
  --ct-ink-soft: #536076;
  --ct-primary: #2457c5;
  --ct-primary-dark: #1a4198;
  --ct-surface: #ffffff;
  --ct-canvas: #f4f6f8;
  --ct-border: #dfe4ea;
  --ct-success: #18794e;
  --ct-success-soft: #e8f5ee;
  --ct-warning: #8a5a00;
  --ct-warning-soft: #fff3d6;
  --ct-danger: #b42318;
  --ct-danger-soft: #fff0ee;
  --ct-sidebar: #162033;
}

html {
  min-height: 100%;
  font-size: 16px;
  max-width: 100%;
  overflow-x: clip;
}

body {
  min-height: 100vh;
  margin: 0;
  max-width: 100%;
  overflow-x: clip;
  color: var(--ct-ink);
  background: var(--ct-canvas);
  font-family: "Manrope", "Trebuchet MS", sans-serif;
  letter-spacing: 0;
}

a {
  color: var(--ct-primary);
}

a:hover {
  color: var(--ct-primary-dark);
}

.btn {
  min-height: 42px;
  border-radius: 6px;
  font-weight: 600;
  padding: 0.55rem 1rem;
}

.btn-sm {
  min-height: 36px;
  padding: 0.4rem 0.75rem;
}

.btn-primary {
  color: #fff;
  background: var(--ct-primary);
  border-color: var(--ct-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  color: #fff;
  background: var(--ct-primary-dark);
  border-color: var(--ct-primary-dark);
}

.btn-outline-secondary {
  color: var(--ct-ink);
  background: var(--ct-surface);
  border-color: #b9c2ce;
}

.btn:focus-visible,
.form-control:focus-visible,
.module-link:focus-visible,
.back-link:focus-visible,
.menu-button:focus-visible {
  outline: 3px solid rgba(36, 87, 197, 0.28);
  outline-offset: 2px;
  box-shadow: none;
}

.app-shell {
  min-height: 100vh;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1020;
  flex-direction: column;
  padding: 1.25rem 1rem;
  color: #fff;
  background: var(--ct-sidebar);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  color: inherit;
}

.brand-mark {
  display: inline-grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: var(--ct-primary);
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
  letter-spacing: 0;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  margin-top: 0.1rem;
  color: #aeb9cb;
  font-size: 0.7rem;
  font-weight: 500;
}

.module-nav {
  margin-top: 2.25rem;
}

.nav-label {
  margin: 0 0 0.65rem 0.7rem;
  color: #8996aa;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-label-spaced {
  margin-top: 2rem;
}

.module-link {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  padding: 0.55rem 0.7rem;
  color: #d6ddea;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.module-link:hover,
.module-link.active {
  color: #fff;
  background: #26344d;
}

.module-link-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #b9c8e2;
  border: 1px solid #53627b;
  border-radius: 5px;
  font-size: 0.62rem;
  font-weight: 700;
}

.module-link.active .module-link-mark {
  color: #fff;
  background: var(--ct-primary);
  border-color: var(--ct-primary);
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  margin-top: auto;
  padding: 0.9rem 0.7rem 0;
  color: #c4ccda;
  border-top: 1px solid #344159;
  font-size: 0.75rem;
}

.sidebar-foot small {
  margin-top: 0.2rem;
  color: #8996aa;
  font-size: 0.68rem;
}

.app-workspace {
  min-width: 0;
}

.app-topbar {
  display: flex;
  min-height: 68px;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  background: var(--ct-surface);
  border-bottom: 1px solid var(--ct-border);
}

.brand-mobile {
  color: var(--ct-ink);
}

.menu-button {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--ct-border);
  border-radius: 6px;
}

.menu-button span {
  width: 17px;
  height: 2px;
  background: var(--ct-ink);
}

.topbar-account {
  margin-left: auto;
}

.account-nav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.account-nav form {
  margin: 0;
}

.account-identity {
  align-items: center;
  gap: 0.55rem;
}

.account-identity > span:last-child {
  min-width: 0;
}

.account-identity small,
.account-identity strong {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-identity small {
  color: var(--ct-ink-soft);
  font-size: 0.65rem;
}

.account-identity strong {
  font-size: 0.78rem;
  font-weight: 600;
}

.account-avatar {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--ct-primary-dark);
  background: #e8eefc;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

.app-main {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  overflow-x: hidden;
}

.page-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}

.page-header h1 {
  margin: 0;
  color: var(--ct-ink);
  font-size: 1.75rem;
  font-weight: 700;
}

.page-eyebrow {
  margin: 0 0 0.4rem;
  color: var(--ct-primary);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.page-description {
  max-width: 680px;
  margin: 0.55rem 0 0;
  color: var(--ct-ink-soft);
  font-size: 0.92rem;
  line-height: 1.6;
}

.page-action {
  width: 100%;
}

.page-actions {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 0.65rem;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.section-heading p {
  margin: 0.3rem 0 0;
  color: var(--ct-ink-soft);
  font-size: 0.8rem;
}

.home-header {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--ct-border);
}

.module-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.module-tile {
  display: grid;
  min-width: 0;
  min-height: 116px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem;
  color: var(--ct-ink);
  background: var(--ct-surface);
  border: 1px solid var(--ct-border);
  border-radius: 8px;
  text-decoration: none;
}

.module-tile:hover {
  color: var(--ct-ink);
  border-color: #aebad0;
  box-shadow: 0 8px 20px rgba(24, 35, 56, 0.06);
}

.module-tile:focus-visible {
  outline: 3px solid rgba(36, 87, 197, 0.28);
  outline-offset: 2px;
}

.module-tile-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--ct-primary);
  background: #e8eefc;
  border-radius: 7px;
  font-size: 0.7rem;
  font-weight: 700;
}

.module-tile-mark-admin {
  color: var(--ct-success);
  background: var(--ct-success-soft);
}

.module-tile-content {
  min-width: 0;
}

.module-tile-content strong,
.module-tile-content small {
  display: block;
  overflow-wrap: anywhere;
}

.module-tile-content strong {
  font-size: 0.92rem;
}

.module-tile-content small {
  margin-top: 0.35rem;
  color: var(--ct-ink-soft);
  font-size: 0.74rem;
  line-height: 1.5;
}

.module-tile-arrow {
  color: var(--ct-primary);
  font-size: 1.2rem;
}

.course-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.course-card {
  min-width: 0;
  overflow: hidden;
  background: var(--ct-surface);
  border: 1px solid var(--ct-border);
  border-radius: 8px;
}

.course-card-topline,
.course-card-body,
.course-meta {
  padding-right: 1.15rem;
  padding-left: 1.15rem;
}

.course-card-topline {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid #edf0f3;
}

.course-code {
  overflow-wrap: anywhere;
  color: var(--ct-primary);
  font-size: 0.75rem;
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
}

.status-active {
  color: var(--ct-success);
  background: var(--ct-success-soft);
}

.status-draft {
  color: var(--ct-warning);
  background: var(--ct-warning-soft);
}

.status-archived {
  color: var(--ct-ink-soft);
  background: #edf0f3;
}

.course-card-body {
  min-height: 126px;
  padding-top: 1.15rem;
  padding-bottom: 1.15rem;
}

.course-card-body h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
}

.course-card-body p {
  margin: 0.55rem 0 0;
  color: var(--ct-ink-soft);
  font-size: 0.78rem;
  line-height: 1.5;
}

.course-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding-top: 0.9rem;
  padding-bottom: 0.95rem;
  background: #fafbfc;
  border-top: 1px solid #edf0f3;
}

.course-meta div + div {
  padding-left: 1rem;
  border-left: 1px solid var(--ct-border);
}

.course-meta dt {
  color: var(--ct-ink-soft);
  font-size: 0.65rem;
  font-weight: 600;
}

.course-meta dd {
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
  font-size: 0.75rem;
  font-weight: 600;
}

.course-card-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.15rem;
  border-top: 1px solid var(--ct-border);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

.course-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.detail-panel,
.student-list {
  background: var(--ct-surface);
  border: 1px solid var(--ct-border);
  border-radius: 8px;
}

.detail-panel {
  padding: 1.25rem;
}

.detail-list {
  margin: 0;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--ct-border);
}

.detail-list dt {
  color: var(--ct-ink-soft);
  font-size: 0.75rem;
}

.detail-list dd {
  margin: 0;
  text-align: right;
  font-size: 0.78rem;
  font-weight: 600;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.detail-actions form,
.student-actions form {
  margin: 0;
}

.course-tools {
  display: grid;
  gap: 0.7rem;
}

.course-tools a,
.course-tool-disabled {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0.9rem;
  border: 1px solid var(--ct-border);
  border-radius: 6px;
  text-decoration: none;
}

.course-tools strong,
.course-tools small {
  display: block;
  grid-column: 1;
}

.course-tools small {
  margin-top: 0.2rem;
  color: var(--ct-ink-soft);
  font-size: 0.7rem;
}

.course-tools span:last-child {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}

.course-tool-disabled {
  opacity: 0.65;
}

.form-shell-narrow {
  max-width: 620px;
}

.student-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.student-toolbar .section-heading {
  margin: 0;
}

.search-form {
  display: flex;
  gap: 0.5rem;
}

.search-form .form-control {
  min-width: 0;
}

.student-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem;
}

.student-row + .student-row {
  border-top: 1px solid var(--ct-border);
}

.student-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--ct-primary-dark);
  background: #e8eefc;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

.student-identity {
  min-width: 0;
}

.student-identity strong,
.student-identity small {
  display: block;
  overflow-wrap: anywhere;
}

.student-identity strong {
  font-size: 0.82rem;
}

.student-identity small {
  margin-top: 0.2rem;
  color: var(--ct-ink-soft);
  font-size: 0.7rem;
}

.student-actions {
  grid-column: 1 / -1;
}

.import-preview {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--ct-surface);
  border: 1px solid var(--ct-border);
  border-radius: 8px;
}

.preview-table-wrap { overflow-x: auto; }
.preview-table { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.preview-table th,
.preview-table td { padding: 0.7rem; text-align: left; border-bottom: 1px solid var(--ct-border); }

.grade-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.grade-summary div,
.grade-create-panel,
.grade-category { padding: 1rem; background: var(--ct-surface); border: 1px solid var(--ct-border); border-radius: 8px; }
.grade-summary small,
.grade-summary strong { display: block; }
.grade-summary small { color: var(--ct-ink-soft); font-size: 0.68rem; }
.grade-summary strong { margin-top: 0.3rem; font-size: 1rem; }
.grade-create-panel { margin-bottom: 1rem; }
.grade-category-list { display: grid; gap: 1rem; }
.grade-category.inactive,
.activity-row.inactive { opacity: 0.6; }
.grade-category-header { display: flex; flex-direction: column; gap: 0.7rem; padding-bottom: 1rem; border-bottom: 1px solid var(--ct-border); }
.grade-category-header > form { margin: 0; }
.grade-inline-form,
.activity-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
.grade-activities { display: grid; gap: 0.6rem; padding-top: 1rem; }
.activity-row { padding: 0.75rem; background: #fafbfc; border: 1px solid var(--ct-border); border-radius: 6px; }
.activity-new { background: #f1f5ff; }

.gradebook-form { min-width: 0; max-width: 100%; overflow: hidden; contain: inline-size; }
.gradebook-wrap { width: 100%; min-width: 0; overflow: auto; contain: layout paint; max-height: 70vh; background: var(--ct-surface); border: 1px solid var(--ct-border); border-radius: 8px; }
.gradebook-table { min-width: 900px; width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.72rem; }
.gradebook-table th,
.gradebook-table td { padding: 0.55rem; text-align: center; border-right: 1px solid var(--ct-border); border-bottom: 1px solid var(--ct-border); }
.gradebook-table thead th { position: sticky; top: 0; z-index: 2; color: var(--ct-ink); background: #eef2f7; }
.gradebook-table thead tr:nth-child(2) th { top: 43px; }
.gradebook-student { position: sticky; left: 0; z-index: 1; min-width: 210px; text-align: left !important; background: var(--ct-surface); }
.gradebook-table thead .gradebook-student { z-index: 3; background: #eef2f7; }
.gradebook-student strong,
.gradebook-student small { display: block; }
.gradebook-student small { margin-top: 0.2rem; color: var(--ct-ink-soft); font-weight: 400; }
.grade-input { width: 78px; min-height: 36px; padding: 0.35rem; text-align: center; border: 1px solid #b9c2ce; border-radius: 5px; }
.grade-total { background: #f7f9fc; font-weight: 700; }
.grade-final { color: #fff; background: var(--ct-primary); font-weight: 700; }
.gradebook-actions { display: flex; justify-content: flex-end; margin-top: 1rem; }

.session-list { display: grid; gap: 0.75rem; }
.session-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem; padding: 1rem; color: var(--ct-ink); background: var(--ct-surface); border: 1px solid var(--ct-border); border-radius: 8px; text-decoration: none; }
.session-row strong,
.session-row small,
.attendance-row strong,
.attendance-row small { display: block; }
.session-row small,
.attendance-row small { margin-top: 0.2rem; color: var(--ct-ink-soft); font-size: 0.7rem; }
.session-status-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.session-status-actions form { margin: 0; }
.session-detail-grid { display: grid; gap: 1rem; }
.session-qr { display: block; width: min(100%, 260px); margin: 0 auto 1rem; image-rendering: pixelated; }
.one-time-code { margin-top: 1rem; padding: 1rem; text-align: center; color: var(--ct-warning); background: var(--ct-warning-soft); border-radius: 6px; }
.one-time-code small,
.one-time-code strong { display: block; }
.one-time-code strong { margin-top: 0.3rem; font-size: 1.6rem; letter-spacing: 0.2rem; }
.one-time-code span { display: block; margin-top: 0.5rem; font-size: 0.78rem; }
.access-code-unavailable { margin-top: 1rem; padding: 1rem; color: var(--ct-ink-soft); background: var(--ct-canvas); border: 1px solid var(--ct-border); border-radius: 6px; }
.access-code-unavailable p { margin-bottom: 0.75rem; }
.attendance-list { display: grid; }
.attendance-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem; padding: 0.8rem 0; border-top: 1px solid var(--ct-border); }
.attendance-row > div { display: flex; gap: 0.4rem; }
.attendance-row form { margin: 0; }
.attendance-public { width: min(100%, 560px); margin: 3rem auto; padding: 2rem; text-align: center; background: var(--ct-surface); border: 1px solid var(--ct-border); border-radius: 8px; }
.attendance-public .brand-mark { margin: 0 auto 1.2rem; }
.attendance-public-form { display: grid; gap: 1rem; margin-top: 1.5rem; text-align: left; }
.attendance-code-input { text-align: center; font-size: 1.2rem; letter-spacing: 0.2rem; }
.attendance-alerts { margin-top: 1rem; }
.alert-list { display: grid; gap: 0.75rem; }
.alert-row { display: grid; gap: 0.75rem; padding: 0.9rem; background: #fff8e8; border: 1px solid #eed59c; border-radius: 6px; }
.alert-row strong,
.alert-row small,
.alert-row code { display: block; }
.alert-row small { margin-top: 0.2rem; color: var(--ct-ink-soft); font-size: 0.7rem; }
.alert-row code { margin-top: 0.4rem; overflow-wrap: anywhere; color: var(--ct-warning); }
.alert-row form { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; }
.alert-row form .form-control { flex: 1 1 220px; }
.report-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.report-summary div { padding: 1rem; background: var(--ct-surface); border: 1px solid var(--ct-border); border-radius: 8px; }
.report-summary small,
.report-summary strong { display: block; }
.report-summary small { color: var(--ct-ink-soft); font-size: 0.68rem; }
.report-summary strong { margin-top: 0.3rem; font-size: 1.1rem; }
.report-students { margin-bottom: 1rem; }
.audit-list { display: grid; }
.audit-list article { padding: 0.8rem 0; border-top: 1px solid var(--ct-border); }
.audit-list strong,
.audit-list small,
.audit-list code { display: block; }
.audit-list small { margin-top: 0.2rem; color: var(--ct-ink-soft); font-size: 0.68rem; }
.audit-list code { margin-top: 0.35rem; overflow-wrap: anywhere; }
.pagination-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }

.empty-state {
  padding: 3rem 1.25rem;
  text-align: center;
  background: var(--ct-surface);
  border: 1px dashed #b9c2ce;
  border-radius: 8px;
}

.empty-state-mark {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  place-items: center;
  color: var(--ct-primary);
  background: #e8eefc;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
}

.empty-state h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.empty-state p {
  max-width: 480px;
  margin: 0.65rem auto 1.2rem;
  color: var(--ct-ink-soft);
  font-size: 0.85rem;
  line-height: 1.6;
}

.back-link {
  display: inline-flex;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.back-link::before {
  content: "←";
  margin-right: 0.4rem;
}

.form-shell {
  max-width: 860px;
  background: var(--ct-surface);
  border: 1px solid var(--ct-border);
  border-radius: 8px;
}

.form-section {
  margin: 0;
  padding: 1.35rem 1.15rem 1.5rem;
  border: 0;
}

.form-section + .form-section {
  border-top: 1px solid var(--ct-border);
}

.form-section legend {
  float: none;
  width: auto;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.form-section > p {
  margin: 0.35rem 0 1.2rem;
  color: var(--ct-ink-soft);
  font-size: 0.78rem;
}

.form-label {
  margin-bottom: 0.4rem;
  color: var(--ct-ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.optional-label {
  margin-left: 0.25rem;
  color: var(--ct-ink-soft);
  font-size: 0.65rem;
  font-weight: 500;
}

.form-control {
  min-height: 44px;
  color: var(--ct-ink);
  border-color: #b9c2ce;
  border-radius: 6px;
  font-size: 0.88rem;
}

.form-control:focus {
  border-color: var(--ct-primary);
  box-shadow: 0 0 0 3px rgba(36, 87, 197, 0.14);
}

.field-validation-error {
  display: block;
  margin-top: 0.35rem;
  color: var(--ct-danger);
  font-size: 0.72rem;
}

.form-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  background: #fafbfc;
  border-top: 1px solid var(--ct-border);
  border-radius: 0 0 8px 8px;
}

.form-panel {
  padding: 1.25rem;
  background: var(--ct-surface);
  border: 1px solid var(--ct-border);
  border-radius: 8px;
}

.user-table-wrap {
  border: 1px solid var(--ct-border);
  background: var(--ct-surface);
  border-radius: 8px;
}

.user-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.user-table th,
.user-table td {
  padding: 0.9rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--ct-border);
  vertical-align: middle;
}

.user-table th {
  color: var(--ct-ink-soft);
  background: #eef2f7;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.user-table tbody tr:last-child td { border-bottom: 0; }
.user-table td:first-child strong,
.user-table td:first-child small { display: block; }
.user-table td:first-child small { margin-top: 0.2rem; color: var(--ct-ink-soft); overflow-wrap: anywhere; }
.user-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.user-actions form { margin: 0; }
.btn-outline-danger { color: var(--ct-danger); border-color: #e4aaa4; }
.btn-outline-danger:hover,
.btn-outline-danger:focus { color: #fff; background: var(--ct-danger); border-color: var(--ct-danger); }
.user-form-panel { max-width: 860px; }
.user-form-panel h2 { margin: 0 0 1.25rem; font-size: 1.1rem; }
.form-grid { display: grid; gap: 1rem; }
.form-grid-wide { grid-column: 1 / -1; }

.alert {
  border-radius: 6px;
  font-size: 0.82rem;
}

.alert:empty,
.validation-summary-valid {
  display: none;
}

.public-body {
  background: #eef1f5;
}

.public-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1rem;
  background: var(--ct-surface);
  border-bottom: 1px solid var(--ct-border);
}

.public-header .brand {
  color: var(--ct-ink);
}

.public-main {
  width: min(100% - 2rem, 1120px);
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.login-shell {
  display: grid;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--ct-surface);
  border: 1px solid var(--ct-border);
  border-radius: 8px;
}

.login-form-panel {
  padding: 1.5rem 1.25rem;
}

.login-form-heading {
  margin-bottom: 1.5rem;
}

.login-form-heading h2 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
}

.login-form-heading > p:last-child {
  color: var(--ct-ink-soft);
  font-size: 0.78rem;
  line-height: 1.6;
}

.login-form-heading > p:last-child {
  margin: 0.45rem 0 0;
}

.login-form-panel .form-check-label {
  color: var(--ct-ink-soft);
  font-size: 0.76rem;
}

.mobile-navigation {
  width: min(84vw, 320px);
  color: #fff;
  background: var(--ct-sidebar);
}

.mobile-navigation .offcanvas-header {
  border-bottom: 1px solid #344159;
}

.mobile-navigation .btn-close {
  filter: invert(1) grayscale(1);
}

@media (min-width: 576px) {
  .page-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .page-header-compact {
    display: block;
  }

  .page-action {
    width: auto;
  }

  .page-actions { width: auto; flex-direction: row; }

  .form-actions {
    flex-direction: row;
    justify-content: flex-end;
  }

  .public-header {
    padding-right: 2rem;
    padding-left: 2rem;
  }
}

@media (max-width: 767.98px) {
  .gradebook-table thead th,
  .gradebook-student {
    position: static;
  }
}

@media (min-width: 768px) {
  .app-main {
    padding: 2rem 2rem 4rem;
  }

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

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

  .course-detail-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  }

  .student-toolbar {
    flex-direction: row;
    align-items: end;
    justify-content: space-between;
  }

  .search-form {
    width: min(100%, 420px);
  }

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

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

  .student-actions {
    grid-column: auto;
  }

  .grade-category-header { flex-direction: row; align-items: center; justify-content: space-between; }
  .grade-inline-form { grid-template-columns: minmax(180px, 1fr) 110px 90px auto; }
  .activity-row { grid-template-columns: minmax(180px, 1fr) 120px 80px 150px auto auto; align-items: center; }
  .session-row { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
  .session-detail-grid { grid-template-columns: minmax(300px, 0.75fr) minmax(0, 1.25fr); }
  .attendance-row { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
  .report-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .form-section {
    padding: 1.6rem 1.75rem 1.8rem;
  }

  .form-actions {
    padding: 1.15rem 1.75rem;
  }

  .login-form-panel {
    padding: 2.5rem;
  }
}

@media (min-width: 992px) {
  .app-workspace {
    margin-left: 248px;
  }

  .app-topbar {
    min-height: 76px;
    justify-content: flex-end;
    padding-right: 2.25rem;
    padding-left: 2.25rem;
  }

  .app-main {
    padding: 2.5rem 2.5rem 4rem;
  }

  .page-header h1 {
    font-size: 2rem;
  }
}

@media (min-width: 1200px) {
  .course-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}