:root {
  --brand: #f58220;
  --brand-dark: #d96500;
  --yellow: #f7c84b;
  --green: #4c8f17;
  --green-dark: #2f6f11;
  --ink: #252019;
  --muted: #7d756c;
  --soft: #fffaf2;
  --line: #f0e4d2;
  --sidebar: #ffffff;
  --surface: #ffffff;
  --surface-alt: #fffaf2;
  --shadow: rgba(245, 130, 32, 0.07);
  --topbar: rgba(255, 255, 255, 0.92);
}

[data-theme="dark"] {
  --ink: #fff7ea;
  --muted: #c9b9a6;
  --soft: #211812;
  --line: #3a2a1f;
  --sidebar: #17110d;
  --surface: #211812;
  --surface-alt: #2b1f16;
  --shadow: rgba(0, 0, 0, 0.28);
  --topbar: rgba(23, 17, 13, 0.92);
}

* {
  box-sizing: border-box;
}

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

.auth-page {
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 15% 18%, rgba(247, 200, 75, 0.28), transparent 32%),
    radial-gradient(circle at 82% 14%, rgba(76, 143, 23, 0.12), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #fff7ea 52%, #fefcf6 100%);
}

[data-theme="dark"] .auth-page {
  background:
    radial-gradient(circle at 15% 18%, rgba(247, 200, 75, 0.16), transparent 32%),
    radial-gradient(circle at 82% 14%, rgba(76, 143, 23, 0.18), transparent 28%),
    linear-gradient(135deg, #130e0a 0%, #211812 54%, #151f0f 100%);
}

.auth-shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1fr 460px;
  gap: 34px;
  align-items: center;
}

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

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 32px rgba(245, 130, 32, 0.14);
}

[data-theme="dark"] .brand-logo {
  background: #fff;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
}

.brand-logo-lg {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  padding: 6px;
}

.auth-brand h1 {
  max-width: 650px;
  margin: 22px 0 16px;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  font-weight: 800;
}

.brand-copy {
  max-width: 560px;
  color: var(--muted);
  font-size: 1.05rem;
}

.eyebrow,
.section-kicker {
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 800;
}

.auth-brand .eyebrow {
  color: var(--green);
  margin-top: 22px;
}

.auth-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.auth-highlights span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 12px 30px rgba(245, 130, 32, 0.09);
  font-size: 0.9rem;
}

.auth-card .card {
  border-radius: 24px;
  border: 1px solid var(--line) !important;
  background: var(--surface);
  color: var(--ink);
}

.form-control,
.form-select,
.input-group-text,
.btn {
  border-radius: 12px;
}

.form-control,
.form-select,
.input-group-text {
  background-color: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.form-control:focus,
.form-select:focus {
  background-color: var(--surface);
  color: var(--ink);
  border-color: var(--brand);
  box-shadow: 0 0 0 0.25rem rgba(245, 130, 32, 0.18);
}

.form-control::placeholder {
  color: var(--muted);
}

.text-secondary {
  color: var(--muted) !important;
}

.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-dark);
  --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-active-bg: var(--brand-dark);
  --bs-btn-active-border-color: var(--brand-dark);
}

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--sidebar);
  color: var(--ink);
  padding: 24px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  box-shadow: 12px 0 38px rgba(245, 130, 32, 0.06);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 34px;
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
}

.sidebar-brand small {
  color: var(--muted);
  font-size: 0.74rem;
}

.class-sidebar-banner {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin: -16px 0 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-alt);
}

.class-image-view-button {
  width: 100%;
  height: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.class-sidebar-banner img,
.class-dashboard-banner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.class-sidebar-banner-placeholder,
.class-dashboard-banner-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #fff;
  background: linear-gradient(135deg, rgba(245, 130, 32, 0.88), rgba(76, 143, 23, 0.88));
}

.class-workspace-page .sidebar {
  padding: 0;
}

.class-workspace-page .sidebar-brand,
.class-workspace-page .sidebar-nav,
.class-workspace-page .sidebar-footer {
  margin-right: 24px;
  margin-left: 24px;
}

.class-workspace-page .sidebar-brand {
  margin-top: 24px;
}

.class-workspace-page .class-sidebar-banner {
  margin-right: 0;
  margin-left: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

.class-workspace-page .topbar {
  padding-right: 28px;
  padding-left: 28px;
}

.class-workspace-dashboard .content-wrap {
  padding-top: 0;
  padding-right: 0;
  padding-left: 0;
}

.class-workspace-dashboard .content-wrap > .alert,
.class-workspace-dashboard .content-wrap > .row:not(.class-wallpaper-row),
.class-workspace-dashboard .content-wrap > .panel-card {
  margin-right: 28px;
  margin-left: 28px;
}

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

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 11px 13px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 14px;
  transition: background 0.2s, color 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: linear-gradient(135deg, rgba(245, 130, 32, 0.12), rgba(247, 200, 75, 0.16));
  color: var(--brand-dark);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-radius: 16px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.sidebar-footer p {
  color: var(--muted);
  font-size: 0.75rem;
}

.main-panel {
  min-width: 0;
}

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 28px;
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.user-menu {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}

.theme-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.84rem;
  box-shadow: 0 12px 28px var(--shadow);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.theme-toggle:hover {
  border-color: rgba(245, 130, 32, 0.48);
  color: var(--brand-dark);
  transform: translateY(-1px);
}

.auth-theme-toggle {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 10;
}

.avatar {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--yellow));
  color: #fff;
  font-weight: 800;
}

.content-wrap {
  padding: 28px;
}

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 30px;
  margin-bottom: 24px;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(circle at right top, rgba(247, 200, 75, 0.4), transparent 32%),
    linear-gradient(135deg, var(--brand) 0%, #e87514 54%, var(--green-dark) 100%);
}

.hero-panel h2 {
  font-weight: 800;
  letter-spacing: -0.04em;
}

.hero-panel p {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 0;
}

.metric-card,
.panel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 16px 42px var(--shadow);
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-border-color: var(--line);
}

.dropdown-menu {
  --bs-dropdown-bg: var(--surface);
  --bs-dropdown-color: var(--ink);
  --bs-dropdown-link-color: var(--ink);
  --bs-dropdown-link-hover-bg: var(--soft);
  --bs-dropdown-link-hover-color: var(--brand-dark);
  --bs-dropdown-border-color: var(--line);
}

.text-primary,
.text-info {
  color: var(--brand) !important;
}

.text-success {
  color: var(--green) !important;
}

.bg-primary-subtle,
.bg-info-subtle {
  background-color: rgba(245, 130, 32, 0.13) !important;
}

.bg-success-subtle {
  background-color: rgba(76, 143, 23, 0.13) !important;
}

.bg-warning-subtle {
  background-color: rgba(247, 200, 75, 0.2) !important;
}

.text-bg-primary {
  background-color: var(--brand) !important;
}

.text-bg-success {
  background-color: var(--green) !important;
}

.metric-icon {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  margin-bottom: 18px;
}

.metric-card p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

.metric-card h3 {
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}

.table > :not(caption) > * > * {
  padding: 16px 12px;
}

.module-form label {
  font-weight: 700;
  color: var(--ink);
}

.table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.search-bar .input-group {
  min-height: 46px;
}

.learner-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.learner-card {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 14px 34px var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.learner-card:hover {
  transform: translateY(-7px);
  border-color: rgba(245, 130, 32, 0.42);
  box-shadow: 0 24px 56px rgba(245, 130, 32, 0.16);
}

.learner-card-media {
  height: 168px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(245, 130, 32, 0.16), rgba(76, 143, 23, 0.18));
}

.learner-card-media img,
.learner-photo-placeholder {
  width: 100%;
  height: 100%;
}

.learner-card-media img {
  object-fit: cover;
  transition: transform 0.25s ease;
}

.learner-card:hover .learner-card-media img {
  transform: scale(1.04);
}

.learner-photo-placeholder {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 2.3rem;
  font-weight: 800;
  background:
    radial-gradient(circle at 22% 20%, rgba(247, 200, 75, 0.65), transparent 34%),
    linear-gradient(135deg, var(--brand), var(--green-dark));
}

.learner-card-body,
.learner-card-footer {
  padding: 16px;
}

.learner-card-body {
  flex: 1;
}

.learner-card h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
}

.learner-number,
.learner-notes {
  color: var(--muted);
  font-size: 0.86rem;
}

.learner-number {
  margin: 4px 0 0;
}

.learner-meta {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.85rem;
}

.learner-meta span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-wrap: anywhere;
}

.learner-notes {
  margin: 14px 0 0;
}

.learner-card-footer {
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
}

.learner-progress {
  height: 9px;
  background: rgba(125, 117, 108, 0.14);
}

.learner-progress .progress-bar {
  background: linear-gradient(135deg, var(--brand), var(--green));
}

.learner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 180px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: var(--surface-alt);
}

.empty-state i {
  color: var(--brand);
  font-size: 2rem;
}

.learner-directory-panel {
  background: #f5f9fc;
}

[data-theme="dark"] .learner-directory-panel {
  background: var(--surface);
}

.learner-directory-panel .search-bar {
  width: 100%;
  max-width: none;
}

.learner-card {
  position: relative;
  min-height: 100%;
  text-align: center;
  border-radius: 24px;
  border-color: #e8eef3;
  background: #fff;
  box-shadow: 0 10px 24px rgba(31, 49, 69, 0.06);
}

.learner-card:hover {
  transform: translateY(-8px);
  border-color: rgba(74, 160, 255, 0.42);
  box-shadow: 0 18px 38px rgba(31, 49, 69, 0.14);
}

.learner-card-body {
  padding: 18px 16px 14px;
}

.learner-card-media {
  width: 164px;
  height: 164px;
  margin: 28px auto 16px;
  overflow: hidden;
  border-radius: 50%;
  border: 4px solid #fff;
  background: #eef4f8;
  box-shadow: 0 8px 18px rgba(31, 49, 69, 0.14);
}

.learner-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.learner-photo-viewer-button {
  width: 100%;
  height: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.learner-photo-viewer-button:focus-visible {
  outline: 3px solid rgba(245, 130, 32, 0.75);
  outline-offset: 3px;
}

.learner-photo-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(135deg, #39a66b, #4aa0ff);
}

.class-workspace-learner-grid .learner-card-media {
  width: 120px;
  height: 120px;
  margin-top: 28px;
  margin-bottom: 16px;
  border-width: 5px;
}

.class-workspace-learner-grid .learner-photo-placeholder {
  font-size: 1.45rem;
}

.class-dashboard-banner {
  overflow: hidden;
  height: auto;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

.class-dashboard-banner .class-image-view-button {
  height: auto;
}

.class-dashboard-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.class-dashboard-banner-placeholder {
  min-height: 240px;
  font-size: 2.4rem;
}

.class-teacher-profile-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.class-teacher-profile {
  display: grid;
  gap: 18px;
  justify-items: center;
  padding-top: 12px;
  text-align: center;
}

.class-teacher-photo {
  width: 132px;
  height: 132px;
  overflow: hidden;
  border: 5px solid #fff;
  border-radius: 50%;
  background: #eef4f8;
  box-shadow: 0 12px 28px rgba(31, 49, 69, 0.14);
}

.class-teacher-photo img,
.class-teacher-photo span {
  width: 100%;
  height: 100%;
}

.class-teacher-photo img {
  object-fit: cover;
}

.class-teacher-photo span {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #39a66b, #4aa0ff);
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.material-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.material-preview {
  height: 160px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(245, 130, 32, 0.12), rgba(57, 166, 107, 0.12));
}

.material-preview img,
.material-preview video,
.material-preview .class-image-view-button {
  width: 100%;
  height: 100%;
}

.material-preview img,
.material-preview video {
  object-fit: cover;
}

.material-icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: #f58220;
  font-size: 2rem;
  background: #fff;
  box-shadow: 0 12px 28px rgba(31, 49, 69, 0.12);
}

.material-card-body {
  padding: 18px;
}

.material-card h3 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
}

.material-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.material-type {
  color: #f58220;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.material-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.78rem;
}

.material-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.quiz-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.quiz-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.quiz-card-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #f58220;
  font-size: 1.4rem;
  background: rgba(245, 130, 32, 0.12);
}

.quiz-card h3 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
}

.quiz-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.quiz-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.quiz-stats span {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.74rem;
  background: var(--surface-alt);
}

.quiz-question-builder {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-alt);
}

.quiz-question-builder + .quiz-question-builder {
  margin-top: 16px;
}

.quiz-timer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: var(--surface-alt);
}

.quiz-timer-bar strong {
  color: #f58220;
  font-size: 1.5rem;
}

.quiz-take-question {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.quiz-take-question + .quiz-take-question {
  margin-top: 18px;
}

.quiz-take-question h3 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
}

.quiz-choice-list {
  display: grid;
  gap: 10px;
}

.quiz-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  background: var(--surface-alt);
}

.quiz-choice input {
  margin-top: 4px;
}

.quiz-result-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 36px;
  border-radius: 20px;
  text-align: center;
  background: var(--surface-alt);
}

.quiz-result-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 2.4rem;
  font-weight: 900;
}

.assignment-detail {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-alt);
}

.assignment-detail p {
  color: var(--text);
}

.learner-status-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 3px 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
}

.learner-status-pill.is-active,
.learner-status-pill.is-completed {
  background: #36c46f;
}

.learner-status-pill.is-hold {
  background: #f5b23c;
}

.learner-status-pill.is-danger {
  background: #ef4d4d;
}

.learner-rate {
  position: absolute;
  top: 13px;
  right: 13px;
  color: #5d6877;
  font-size: 0.78rem;
  font-weight: 800;
}

.learner-card h3 {
  margin: 0;
  color: #263241;
  font-size: 0.98rem;
  font-weight: 800;
}

.learner-number {
  margin: 4px 0 0;
  color: #8b99a8;
  font-size: 0.72rem;
}

.learner-meta {
  display: grid;
  gap: 6px;
  margin: 12px auto 0;
  color: #7f8d9c;
  font-size: 0.72rem;
}

.learner-meta span {
  justify-content: center;
  overflow-wrap: anywhere;
}

.learner-card-footer {
  padding: 0 0 16px;
  border-top: 1px solid #eef3f7;
  background: #fff;
}

.learner-card-footer > .d-flex,
.learner-progress {
  margin-left: 16px;
  margin-right: 16px;
}

.learner-card-footer > .d-flex {
  padding-top: 12px;
  color: #5d6877;
  font-size: 0.72rem;
}

.learner-progress {
  height: 6px;
  margin-bottom: 12px;
  background: #edf3f7;
}

.learner-progress .progress-bar {
  background: linear-gradient(135deg, #36c46f, #4aa0ff);
}

.learner-icon-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.learner-icon-actions form {
  margin: 0;
}

.enrollment-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.enrollment-card .learner-card-body {
  padding-top: 22px;
}

.enrollment-date {
  position: absolute;
  top: 13px;
  right: 13px;
  color: #7f8d9c;
  font-size: 0.68rem;
  font-weight: 800;
}

.enrollment-card-footer {
  padding: 14px 16px 16px;
}

.enrollment-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.enrollment-card-actions form {
  margin: 0;
}

.learner-icon-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #dce7ef;
  border-radius: 50%;
  background: #f8fbfd;
  color: #4f8fd8;
  text-decoration: none;
  transition: transform 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
}

.learner-icon-button:hover {
  transform: translateY(-2px);
  border-color: #4aa0ff;
  background: #4aa0ff;
  color: #fff;
}

.learner-icon-button.is-danger {
  color: #d95555;
}

.learner-icon-button.is-danger:hover {
  border-color: #d95555;
  background: #d95555;
  color: #fff;
}

.class-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.class-card {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 14px 34px var(--shadow);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.class-card:hover {
  transform: translateY(-7px);
  border-color: rgba(245, 130, 32, 0.42);
  box-shadow: 0 24px 56px rgba(245, 130, 32, 0.16);
}

.class-card-open-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.class-wallpaper {
  position: relative;
  aspect-ratio: 8 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(245, 130, 32, 0.18), rgba(76, 143, 23, 0.22));
}

.class-wallpaper img,
.class-wallpaper-placeholder {
  width: 100%;
  height: 100%;
}

.class-wallpaper img {
  object-fit: cover;
  transition: transform 0.25s ease;
}

.class-card:hover .class-wallpaper img {
  transform: scale(1.04);
}

.class-wallpaper-placeholder {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 2rem;
  background:
    radial-gradient(circle at 20% 18%, rgba(247, 200, 75, 0.56), transparent 32%),
    linear-gradient(135deg, var(--brand), var(--green-dark));
}

.class-status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.class-status-badge.is-active {
  background: #36c46f;
}

.class-status-badge.is-inactive {
  background: #7f8d9c;
}

.class-card-body {
  flex: 1;
  padding: 18px;
}

.class-card h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
}

.class-teacher,
.class-description {
  color: var(--muted);
  font-size: 0.86rem;
}

.class-teacher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.class-description {
  margin: 0;
}

.class-card-footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
}

.class-card-footer form {
  margin: 0;
}

.table-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.table-actions form {
  margin: 0;
}

.teacher-cell,
.teacher-photo-preview {
  display: flex;
  align-items: center;
  gap: 12px;
}

.teacher-cell img,
.teacher-cell > span,
.teacher-photo-preview img {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.teacher-cell img,
.teacher-photo-preview img {
  object-fit: cover;
}

.teacher-cell > span {
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--green));
}

.teacher-photo-preview span {
  color: var(--muted);
  font-size: 0.86rem;
}

.teacher-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.teacher-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  text-align: center;
  border: 1px solid #e8eef3;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(31, 49, 69, 0.06);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.teacher-card:hover {
  transform: translateY(-8px);
  border-color: rgba(74, 160, 255, 0.42);
  box-shadow: 0 18px 38px rgba(31, 49, 69, 0.14);
}

.teacher-card-body {
  flex: 1;
  padding: 18px 16px 14px;
}

.teacher-card-media {
  width: 118px;
  height: 118px;
  margin: 22px auto 16px;
  overflow: hidden;
  border-radius: 50%;
  border: 5px solid #fff;
  background: #eef4f8;
  box-shadow: 0 8px 18px rgba(31, 49, 69, 0.14);
}

.teacher-card-media img,
.teacher-card-media span {
  width: 100%;
  height: 100%;
}

.teacher-card-media img {
  object-fit: cover;
}

.teacher-card-media span {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.7rem;
  font-weight: 800;
  background: linear-gradient(135deg, #39a66b, #4aa0ff);
}

.teacher-card h3 {
  margin: 0;
  color: #263241;
  font-size: 0.98rem;
  font-weight: 800;
}

.teacher-card-meta {
  display: grid;
  gap: 7px;
  margin: 14px auto 0;
  color: #7f8d9c;
  font-size: 0.72rem;
}

.teacher-card-meta span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  overflow-wrap: anywhere;
}

.teacher-card-footer {
  padding: 14px 16px 16px;
  border-top: 1px solid #eef3f7;
  background: #fff;
}

.teacher-class-count {
  display: grid;
  gap: 2px;
  color: #5d6877;
  font-size: 0.72rem;
}

.teacher-class-count strong {
  color: #263241;
  font-size: 1.2rem;
  line-height: 1;
}

[data-theme="dark"] .teacher-card,
[data-theme="dark"] .teacher-card-footer {
  border-color: var(--line);
  background: var(--surface);
}

[data-theme="dark"] .teacher-card h3,
[data-theme="dark"] .teacher-class-count strong {
  color: var(--ink);
}

[data-theme="dark"] .teacher-card-meta,
[data-theme="dark"] .teacher-class-count {
  color: var(--muted);
}

.learner-hero {
  margin-bottom: 22px;
}

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

.course-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 16px 42px var(--shadow);
}

.course-catalog-card form {
  margin-top: 18px;
}

.course-wallpaper {
  aspect-ratio: 8 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(245, 130, 32, 0.18), rgba(76, 143, 23, 0.22));
}

.course-wallpaper img,
.course-wallpaper-placeholder {
  width: 100%;
  height: 100%;
}

.course-wallpaper img {
  object-fit: cover;
}

.course-wallpaper-placeholder {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 2rem;
  background:
    radial-gradient(circle at 16% 20%, rgba(247, 200, 75, 0.55), transparent 32%),
    linear-gradient(135deg, var(--brand), var(--green-dark));
}

.course-card-content {
  padding: 22px;
}

.course-card-header,
.course-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.course-code {
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.course-card h2 {
  margin: 14px 0 8px;
  font-size: 1.25rem;
  font-weight: 800;
}

.course-card p,
.course-meta,
.classmate-chip small {
  color: var(--muted);
}

.course-card p {
  margin-bottom: 16px;
}

.course-meta {
  justify-content: flex-start;
  font-size: 0.86rem;
}

.course-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.classmate-list {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.classmate-list h3 {
  margin-bottom: 12px;
  font-size: 0.9rem;
  font-weight: 800;
}

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

.classmate-chip {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-alt);
}

.classmate-chip img,
.classmate-chip > span {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.classmate-chip img {
  object-fit: cover;
}

.classmate-chip > span {
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--green));
}

.classmate-chip div {
  min-width: 0;
}

.classmate-chip strong,
.classmate-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-content {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
}

#classModal .modal-dialog,
#learnerModal .modal-dialog {
  height: calc(100vh - 32px);
  max-height: calc(100vh - 32px);
  margin-top: 16px;
  margin-bottom: 16px;
}

#classModal .modal-content,
#learnerModal .modal-content {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

#classModal .module-form,
#learnerModal .module-form {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

#classModal .modal-body,
#learnerModal .modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#classModal .modal-footer,
#learnerModal .modal-footer {
  flex-shrink: 0;
  background: var(--surface);
  border-top-color: var(--line);
}

.image-preview-modal .modal-body {
  display: grid;
  place-items: center;
  padding: 18px;
}

.image-preview-modal img {
  width: min(100%, 720px);
  max-height: 72vh;
  object-fit: contain;
  border-radius: 14px;
  background: var(--surface-alt);
}

.task-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

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

.task-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 991px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

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

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .content-wrap,
  .topbar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .class-workspace-page .topbar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .class-workspace-dashboard .content-wrap {
    padding-right: 0;
    padding-left: 0;
  }

  .class-workspace-dashboard .content-wrap > .alert,
  .class-workspace-dashboard .content-wrap > .row:not(.class-wallpaper-row),
  .class-workspace-dashboard .content-wrap > .panel-card {
    margin-right: 18px;
    margin-left: 18px;
  }

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

  .learner-grid,
  .teacher-card-grid,
  .enrollment-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .course-grid,
  .classmate-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  .auth-page {
    padding: 18px;
  }

  .auth-card .card-body,
  .content-wrap {
    padding: 18px;
  }

  .learner-grid,
  .teacher-card-grid,
  .enrollment-card-grid {
    grid-template-columns: 1fr;
  }

  .class-card-grid {
    grid-template-columns: 1fr;
  }
}
