:root {
  --bg-start: #f7f8fb;
  --bg-end: #f5f6f9;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --text: #141d2f;
  --muted: #5f6e84;
  --primary: #4a72b2;
  --primary-dark: #3b619d;
  --accent: #6f93cc;
  --accent-soft: #eaf0fb;
  --border: #dfe6f2;
  --shadow: 0 18px 40px rgba(43, 76, 130, 0.12);
  --shadow-soft: 0 10px 22px rgba(43, 76, 130, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Poppins", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(74, 114, 178, 0.11), transparent 32%),
    radial-gradient(circle at 85% 5%, rgba(80, 157, 206, 0.1), transparent 26%),
    linear-gradient(135deg, var(--bg-start), var(--bg-end));
  color: var(--text);
}

a {
  color: var(--primary);
  text-decoration: none;
}

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

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 0;
}

.topbar h1 {
  font-size: 2rem;
  margin: 0;
  letter-spacing: 0.01em;
  line-height: 1;
}

.topbar h1 a {
  color: #121826;
}

.topbar .container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1rem 0;
}

.lms-app .topbar .container {
  padding-left: 2rem;
  padding-right: 2rem;
}

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

.space-between {
  justify-content: space-between;
}

.username {
  font-weight: 500;
  color: #334155;
  font-size: 0.95rem;
}

.header-user {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.avatar-badge {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2ff;
  color: #1d4ed8;
  border: 1px solid #c7d2fe;
  font-weight: 700;
  font-size: 0.75rem;
}

.public-shell,
.app-shell {
  padding-bottom: 2rem;
}

.public-content {
  max-width: 1120px;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 5.6rem;
  padding: 1rem 0.8rem;
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 0.98), rgba(245, 251, 255, 0.96)),
    #fff;
}

.sidebar .eyebrow {
  color: #2a4d70;
  margin: 0 0.55rem 0.65rem;
}

.sidebar-menu {
  display: grid;
  gap: 0.25rem;
}

.sidebar-menu a {
  display: block;
  font-weight: 700;
  color: #1d4262;
  border-radius: 12px;
  padding: 0.62rem 0.72rem;
  border: 1px solid transparent;
}

.sidebar-menu a:hover {
  background: #edf6ff;
  border-color: #d7e8f8;
}

.sidebar-menu a.active {
  background: linear-gradient(120deg, rgba(17, 105, 151, 0.18), rgba(31, 155, 176, 0.22));
  color: #0d4d72;
  border-color: #b6d8ec;
}

.sidebar-logout {
  margin-top: 0.9rem;
  padding: 0 0.45rem;
}

.sidebar-logout .btn {
  width: 100%;
}

.content-area {
  min-width: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.15rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.hero {
  padding: 1.55rem;
  background:
    linear-gradient(115deg, rgba(17, 105, 151, 0.96), rgba(31, 155, 176, 0.92)),
    #116997;
  border: none;
  color: #f8fcff;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -58px;
  top: -58px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.05));
}

.hero h2 {
  margin: 0.2rem 0 0.5rem;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
}

.hero p {
  color: rgba(248, 252, 255, 0.96);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.78rem;
  opacity: 0.92;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.95rem;
  margin: 1rem 0;
}

.stat-card {
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 0.98), rgba(242, 248, 255, 0.92)),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.95rem 1rem;
  box-shadow: var(--shadow-soft);
}

.stat-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.stat-card h3 {
  margin: 0.35rem 0 0;
  font-size: 1.7rem;
}

.narrow {
  max-width: 440px;
  margin: 2rem auto;
}

.grid {
  display: grid;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.gap {
  gap: 0.75rem;
}

.btn {
  border: none;
  border-radius: 11px;
  padding: 0.62rem 1rem;
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(11, 84, 121, 0.24);
}

.secondary {
  background: #5e7d9f;
}

.secondary:hover {
  background: #4b6682;
}

.danger {
  background: #b42318;
}

.danger:hover {
  background: #961f17;
}

.inline-form {
  display: inline;
}

.inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.clean-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.course-item {
  border-left: 5px solid var(--primary);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(242, 248, 255, 0.9)),
    var(--surface-soft);
  padding: 0.78rem;
  border-radius: 12px;
  margin-bottom: 0.72rem;
  border: 1px solid #d3e3f4;
}

.course-link {
  font-weight: 700;
  color: #113960;
}

.course-item small {
  display: block;
  color: var(--muted);
  margin-top: 0.18rem;
}

.course-actions {
  margin-top: 0.35rem;
}

.course-actions a {
  font-size: 0.84rem;
  font-weight: 700;
}

.mini-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: #295877;
}

.mini-link-button {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.mini-link-danger {
  color: #b42318;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.58rem;
  background: var(--accent-soft);
  color: #1d6178;
  font-weight: 700;
  font-size: 0.78rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.rename-form {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.rename-form input[type="text"] {
  width: 230px;
  margin-top: 0;
}

.course-meta {
  color: #21435f;
}

.course-description {
  color: #5e7390;
  font-size: 0.95rem;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #f6f9ff;
  border: 1px solid #dbe7f8;
  border-radius: 999px;
  padding: 0.24rem 0.62rem;
  margin-right: 0.4rem;
  font-size: 0.85rem;
}

.elevated-card {
  border: 1px solid #e5edf7;
  box-shadow: 0 8px 24px rgba(24, 42, 68, 0.06);
}

.table-main-link {
  color: #2d5d89;
  font-weight: 600;
}

.empty-state {
  text-align: center;
  color: #8b9db5;
  padding: 0.85rem 0;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.progress-track {
  width: 110px;
  height: 8px;
  background: #e6edf7;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #5d87f0, #3a66df);
}

.progress-label {
  color: #5f728d;
  font-size: 0.8rem;
  font-weight: 700;
}

.lms-app {
  background:
    linear-gradient(145deg, #f4f7fc, #f2f5fb),
    #f4f7fc;
}

.lms-app .topbar {
  background: #ffffff;
  border-bottom: 1px solid #dde3eb;
  margin-bottom: 0;
}

.lms-app .app-shell {
  width: 100%;
  max-width: none;
  gap: 0;
  align-items: stretch;
}

.lms-app .sidebar {
  border-radius: 0;
  border: 0;
  border-right: 1px solid #e2eaf5;
  box-shadow: none;
  padding: 1.35rem 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.58);
  min-height: calc(100vh - 70px);
}

.lms-app .sidebar .eyebrow {
  color: #7c8fa7;
  font-size: 0.72rem;
}

.lms-app .sidebar-menu a {
  border-radius: 10px;
  padding: 0.58rem 0.7rem;
  color: #334e6d;
}

.lms-app .sidebar-menu a.active {
  background: #eef3ff;
  border-color: #dbe5fb;
  color: #2d46c3;
}

.lms-app .sidebar-logout {
  border-top: 1px solid #e7eef7;
  margin-top: 1.4rem;
  padding-top: 1.1rem;
}

.lms-app .content-area {
  padding: 1.6rem 2rem;
}

.lms-app .card {
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(20, 41, 67, 0.06);
}

.lms-app h2,
.lms-app h3 {
  letter-spacing: 0.01em;
  color: #141f31;
}

.lms-app .btn.secondary {
  background: #5d7fb2;
}

.lms-app .btn.secondary:hover {
  background: #4d6e9f;
}

.lms-app .lms-table {
  min-width: 900px;
}

.lms-app .lms-table th {
  background: #f8fbff;
  color: #607894;
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  padding-top: 0.86rem;
  padding-bottom: 0.86rem;
}

.lms-app .lms-table td {
  color: #1a2b43;
  padding-top: 0.92rem;
  padding-bottom: 0.92rem;
}

.lms-app .lms-table tbody tr:hover {
  background: #f8fbff;
}

.lms-app .pending-list .student-item.pending {
  background: #fbfdff;
  border-color: #e1e9f5;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.lms-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

.lms-table thead th {
  color: #305575;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: #f3f9ff;
}

.lms-table tbody tr:hover {
  background: #f8fcff;
}

.chapter-row {
  cursor: grab;
}

.chapter-row.dragging {
  opacity: 0.55;
}

.drag-cell {
  width: 30px;
}

.student-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  margin-bottom: 0.5rem;
}

.student-item span {
  font-weight: 700;
}

.student-item small {
  color: var(--muted);
}

.student-submeta {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.pending-list {
  display: grid;
  gap: 0.55rem;
}

.student-item.pending {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(7, 20, 39, 0.48);
  z-index: 20;
  padding: 1rem;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: min(520px, 95vw);
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(6, 26, 48, 0.22);
  padding: 1.05rem;
}

.modal-close {
  border: 0;
  background: #dfe8f2;
  color: #1c4568;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-weight: 700;
}

.chunk-list {
  display: grid;
  gap: 0.5rem;
}

.chapter-builder {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.builder-col {
  display: grid;
  gap: 0.7rem;
  align-content: start;
}

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

.form-error-block {
  grid-column: 1 / -1;
  border: 1px solid #efb4b4;
  background: #fff3f3;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  color: #8e1f1f;
  font-size: 0.84rem;
}

.field-label {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #234f73;
}

.chunk-panel {
  background: #f8fbff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
}

.quiz-builder {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.5rem;
}

.quiz-choice-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.quiz-choice-correct {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: #2c5374;
}

.linear-chunk-list {
  gap: 0.8rem;
}

.flow-chunk-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.chunk-card {
  display: block;
  border-radius: 13px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(242, 248, 255, 0.9)),
    var(--surface-soft);
  border: 1px solid var(--border);
  padding: 0.85rem;
}

.tiny-chunk-card {
  width: 200px;
  height: 200px;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 0.62rem;
  border: 1px solid #d8e4f4;
  box-shadow: 0 8px 18px rgba(25, 50, 83, 0.12);
  overflow: hidden;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(244, 250, 255, 0.94)),
    #fff;
}

.tiny-chunk-card:hover {
  box-shadow: 0 10px 22px rgba(25, 50, 83, 0.18);
}

.chunk-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  position: relative;
}

.tiny-chunk-card .chunk-card-head {
  gap: 0.3rem;
  margin-bottom: 0.25rem;
}

.chunk-head-left {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.chunk-card-head small {
  display: block;
  color: var(--muted);
}

.chunk-title-mini {
  display: block;
  font-size: 0.84rem;
  line-height: 1.2;
}

.chunk-type-mini {
  font-size: 0.72rem;
}

.chunk-order {
  margin: 0;
  font-size: 0.75rem;
  color: #497399;
  font-weight: 700;
}

.chunk-mini-body {
  flex: 1;
  font-size: 0.76rem;
  line-height: 1.3;
  color: #3e5572;
}

.chunk-card-foot {
  margin-top: 0.35rem;
  display: flex;
  justify-content: flex-end;
}

.chunk-card-foot .mini-link {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.chunk-edit-icon {
  border: 0;
  background: #efe8ff;
  color: #6414c4;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(104, 26, 201, 0.16);
}

.chunk-edit-icon:hover {
  background: #e7dcff;
}

.chunk-card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chunk-delete-form {
  margin: 0;
}

.chunk-delete-icon {
  border: 0;
  background: #ffe8eb;
  color: #b42338;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(180, 35, 56, 0.18);
}

.chunk-delete-icon svg {
  width: 14px;
  height: 14px;
}

.chunk-delete-icon:hover {
  background: #ffd9df;
}

.chunk-card-body p {
  margin: 0;
}

.chunk-preview-panel {
  height: 100%;
  border: 1px solid #dfe9f7;
  background: #f6faff;
  border-radius: 9px;
  padding: 0.45rem;
  overflow: hidden;
}

.text-preview p {
  font-size: 0.73rem;
  color: #334d69;
}

.image-preview {
  padding: 0;
}

.chunk-preview-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.chunk-preview-image {
  max-width: 320px;
  max-height: 180px;
  width: 100%;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.chunk-quiz-options {
  margin: 0.45rem 0 0;
  padding-left: 1.05rem;
}

.chunk-item {
  display: flex;
  align-items: start;
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fbfdff;
  padding: 0.6rem;
}

.chunk-item.dragging {
  opacity: 0.52;
}

.tiny-chunk-card.dragging {
  transform: scale(0.98);
}

.drag-handle {
  color: var(--muted);
  cursor: grab;
  user-select: none;
  font-size: 0.9rem;
}

form p {
  margin: 0;
}

label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #25486a;
}

input,
textarea,
select {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.58rem 0.65rem;
  border: 1px solid #c7dbef;
  border-radius: 9px;
  background: #fbfdff;
  color: #193654;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(35, 177, 196, 0.3);
  border-color: #37adc2;
}

.helptext,
form ul,
.muted-link {
  color: var(--muted);
  font-size: 0.84rem;
}

.auth-form ul {
  margin: 0.2rem 0 0;
  padding-left: 1.1rem;
}

.login-page .topbar {
  margin-bottom: 0.5rem;
}

.login-shell {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
  align-items: stretch;
  margin: 2rem auto;
}

.login-intro {
  background: linear-gradient(135deg, rgba(17, 105, 151, 0.96), rgba(31, 155, 176, 0.9));
  border-radius: 16px;
  color: #f8fcff;
  padding: 1.55rem;
  box-shadow: var(--shadow);
}

.dashboard-layout > .card {
  min-height: 100%;
}

.creator-card {
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 0.98), rgba(243, 249, 255, 0.92)),
    #fff;
}

.course-list-card .clean-list {
  margin-top: 0.35rem;
}

@keyframes riseFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-hero,
.stats-grid .stat-card,
.dashboard-layout .card {
  animation: riseFade 0.34s ease both;
}

.stats-grid .stat-card:nth-child(2) {
  animation-delay: 0.05s;
}

.stats-grid .stat-card:nth-child(3) {
  animation-delay: 0.1s;
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-hero,
  .stats-grid .stat-card,
  .dashboard-layout .card,
  .btn {
    animation: none;
    transition: none;
  }
}

.login-intro h2 {
  margin-top: 0.2rem;
  font-size: clamp(1.6rem, 2.5vw, 2rem);
}

.login-intro p,
.login-intro li {
  color: rgba(248, 252, 255, 0.95);
}

.login-intro li {
  margin-bottom: 0.45rem;
}

.login-card {
  padding: 1.25rem;
}

.login-card h2 {
  margin-top: 0;
}

p {
  margin: 0.3rem 0;
}

@media (max-width: 900px) {
  .two-col,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .chapter-builder {
    grid-template-columns: 1fr;
  }

  .quiz-choice-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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

  .sidebar {
    position: static;
  }

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

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

  .lms-table {
    min-width: 620px;
  }

  .lms-app .content-area {
    padding: 1rem;
  }

  .lms-app .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid #e2eaf5;
    padding: 1rem;
  }

  .lms-app .lms-table {
    min-width: 700px;
  }
}

@media (max-width: 580px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .topbar h1 {
    font-size: 1.65rem;
  }

  .lms-app .topbar .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .username {
    display: none;
  }

  .sidebar-menu {
    grid-template-columns: 1fr;
  }

  .lms-app .content-area {
    padding: 0.75rem;
  }

  .lms-app .card {
    border-radius: 14px;
    padding: 0.85rem;
  }

  .lms-app .section-head {
    align-items: flex-start;
  }

  .lms-app .btn,
  .lms-app .btn.secondary {
    width: 100%;
    justify-content: center;
  }

  .lms-app .table-wrap {
    overflow-x: visible;
  }

  .lms-app .lms-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  .lms-app .lms-table thead {
    display: none;
  }

  .lms-app .lms-table tbody {
    display: grid;
    gap: 0.55rem;
  }

  .lms-app .lms-table tr {
    display: grid;
    gap: 0.3rem;
    border: 1px solid #dfe9f6;
    border-radius: 12px;
    background: #fbfdff;
    padding: 0.55rem 0.65rem;
  }

  .lms-app .lms-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.7rem;
    border-bottom: 0;
    padding: 0.2rem 0;
    text-align: right;
    font-size: 0.88rem;
  }

  .lms-app .lms-table td::before {
    content: attr(data-label);
    color: #5f7692;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
  }

  .lms-app .lms-table td.drag-cell {
    justify-content: flex-end;
  }

  .lms-app .lms-table td.drag-cell::before {
    content: "Sort";
  }

  .lms-app .progress-wrap {
    min-width: 150px;
    justify-content: flex-end;
  }

  .lms-app .progress-track {
    width: 90px;
  }

  .lms-app .pending-list .student-item.pending {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Purple Teacher Console Theme */
.lms-app {
  background: #f4f2f8;
  color: #12182a;
}

.lms-app .container.app-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  min-height: 100vh;
}

.lms-app .sidebar {
  border: 0;
  border-right: 1px solid #ede7f9;
  border-radius: 0;
  box-shadow: none;
  background: #ffffff;
  padding: 1.6rem 1.2rem 1.2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.lms-app .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.2rem 0 1.2rem;
}

.lms-app .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(145deg, #7b1ee0, #5f09c7);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 12px 20px rgba(110, 24, 206, 0.2);
}

.lms-app .sidebar-brand h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
}

.lms-app .sidebar-brand h2 a {
  color: #111725;
}

.lms-app .sidebar-brand p {
  margin: 0.12rem 0 0;
  color: #5f19d0;
  font-weight: 700;
  font-size: 0.86rem;
}

.lms-app .eyebrow {
  color: #8a94a6;
  font-size: 0.72rem;
  margin: 0.2rem 0.65rem 0.65rem;
}

.lms-app .sidebar-menu {
  gap: 0.34rem;
}

.lms-app .sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: #2e425e;
  border-radius: 14px;
  font-weight: 700;
  padding: 0.7rem 0.9rem;
  border: 1px solid transparent;
}

.lms-app .sidebar-menu .menu-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  opacity: 0.9;
}

.lms-app .sidebar-menu a.active {
  background: linear-gradient(135deg, #8a2df1, #6511d5);
  color: #fff;
  box-shadow: 0 10px 22px rgba(107, 19, 203, 0.25);
  border-color: transparent;
}

.lms-app .sidebar-menu a:hover {
  background: #f4edff;
  color: #5c1ac5;
}

.lms-app .sidebar-logout {
  margin-top: auto;
  border-top: 1px solid #f1eafc;
  padding-top: 1.25rem;
}

.lms-app .logout-btn {
  width: 100%;
  border-radius: 14px;
  background: #fff8f8;
  border: 1px solid #f3d1d1;
  color: #e03939;
  font-weight: 700;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
}

.lms-app .logout-btn .icon {
  font-size: 0.95rem;
}

.lms-app .logout-btn:hover {
  background: #ffecec;
  color: #cb1f1f;
  box-shadow: none;
  transform: none;
}

.lms-app .content-area {
  padding: 1.8rem 2rem;
}

.lms-app .card {
  border-radius: 18px;
  border: 1px solid #e6def5;
  box-shadow: 0 14px 32px rgba(74, 36, 146, 0.12);
  background: #ffffff;
}

.lms-app .course-hero {
  padding: 1.6rem;
  border-top-width: 3px;
}

.lms-app .course-hero-head {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lms-app .course-icon {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  background: linear-gradient(145deg, #8a31f3, #6b11d7);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: 0 18px 32px rgba(109, 29, 204, 0.25);
}

.lms-app .course-description {
  color: #63738d;
  font-size: 1rem;
  font-style: italic;
}

.lms-app .meta-pill {
  background: #ede9f7;
  border-color: transparent;
  color: #2a2d57;
}

.lms-app .meta-pill strong {
  color: #5b14d0;
}

.lms-app h2 {
  color: #131a2d;
  margin: 0;
}

.lms-app h3 {
  color: #151e31;
  margin: 0;
}

.lms-app .btn {
  border-radius: 999px;
  background: linear-gradient(120deg, #8f2df3, #6b11d7);
  box-shadow: 0 12px 24px rgba(104, 26, 201, 0.3);
}

.lms-app .btn.secondary {
  background: #f1e7ff;
  color: #6414c4;
  box-shadow: 0 6px 14px rgba(104, 26, 201, 0.12);
}

.lms-app .btn.secondary:hover {
  background: #ddc9f9;
  color: #4f0fae;
  box-shadow: none;
}

.lms-app .lms-table {
  min-width: 900px;
}

.lms-app .lms-table th {
  color: #5d14ca;
  background: #f2ecfb;
  border-bottom-color: #e5dcf1;
}

.lms-app .lms-table td {
  border-bottom-color: #eae3f3;
}

.lms-app .lms-table tbody tr:hover {
  background: #f7f3fc;
}

.lms-app .table-main-link,
.lms-app .mini-link {
  color: #6b11d7;
}

.lms-app .progress-track {
  background: #e2ddee;
}

.lms-app .progress-fill {
  background: linear-gradient(90deg, #7f22ec, #5e0ecb);
}

.lms-app .pending-list .student-item.pending {
  background: #faf7ff;
  border-style: dashed;
  border-color: #e5dcf1;
}

.lms-app .modal-card {
  background: #fbfaff;
  border-color: #e5dcf1;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-badge.completed {
  background: #dbf7e3;
  color: #1c7a38;
}

.status-badge.progress {
  background: #e0e9ff;
  color: #2552d6;
}

.pill {
  background: #f0e5ff;
  color: #5122a8;
}

@media (max-width: 1024px) {
  .lms-app .container.app-shell {
    grid-template-columns: 1fr;
  }

  .lms-app .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid #e4deef;
  }

  .lms-app .sidebar-logout {
    margin-top: 1rem;
  }
}

@media (max-width: 640px) {
  .lms-app .content-area {
    padding: 1rem;
  }

  .lms-app .course-hero-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .lms-app .course-icon {
    width: 84px;
    height: 84px;
    font-size: 1.85rem;
  }
}

/* Stitch Screen Theme Override */
.lms-app {
  background: #f7f6f8;
  color: #121a2d;
  font-family: "Lexend", "Poppins", "Segoe UI", sans-serif;
}

.lms-app .container.app-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 100vh;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
}

.lms-app .sidebar {
  padding: 1.45rem 1rem 1rem;
  border-right: 1px solid #dfe6f2;
  background: #ffffff;
  min-height: 100vh;
}

.lms-app .sidebar .eyebrow {
  display: none;
}

.lms-app .sidebar-brand {
  margin: 0.2rem 0 1.45rem;
}

.lms-app .brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: linear-gradient(140deg, #4a72b2, #3f67a8);
  font-size: 1.05rem;
}

.lms-app .brand-mark svg {
  width: 24px;
  height: 24px;
  color: #ffffff;
}

.lms-app .sidebar-brand h2 {
  font-size: 2rem;
  letter-spacing: 0;
}

.lms-app .sidebar-brand p {
  color: #4a72b2;
  font-size: 0.9rem;
  font-weight: 700;
}

.lms-app .sidebar-menu {
  gap: 0.42rem;
}

.lms-app .sidebar-menu a {
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.72rem 1rem;
  color: #4e6078;
}

.lms-app .sidebar-menu .menu-icon {
  width: 20px;
  height: 20px;
}

.lms-app .sidebar-menu a:hover {
  background: #edf3fc;
  color: #3f67a8;
}

.lms-app .sidebar-menu a.active {
  background: linear-gradient(135deg, #4f79bc, #416cae);
  color: #ffffff;
  box-shadow: 0 10px 16px rgba(63, 103, 168, 0.24);
}

.lms-app .sidebar-logout {
  margin-top: auto;
  border-top: 1px solid #e4eaf5;
  padding-top: 1rem;
}

.lms-app .logout-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  justify-content: flex-start;
  box-shadow: none;
  border-radius: 0;
  padding: 0.55rem 0.3rem;
  font-weight: 800;
}

.lms-app .logout-btn:hover {
  color: #cf2d2d;
  background: transparent;
}

.lms-app .content-area {
  width: 100%;
  min-width: 0;
  padding: 1.55rem 1.6rem;
  display: grid;
  gap: 1rem;
  align-content: start;
}

.lms-app .content-area > * {
  width: 100%;
  max-width: none;
}

.lms-app .stats-grid {
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.lms-app .card {
  border-radius: 24px;
  border: 1px solid #dfe6f2;
  box-shadow: none;
  background: #ffffff;
}

.lms-app .course-hero {
  border-top: 0 !important;
  padding: 1.45rem 1.55rem;
  display: grid;
  gap: 1rem;
}

.lms-app .course-hero-head {
  gap: 1.1rem;
}

.lms-app .course-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
}

.lms-app .course-hero-main {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.lms-app .course-hero-copy {
  min-width: 0;
}

.lms-app .course-icon {
  width: 108px;
  height: 108px;
  border-radius: 18px;
  font-size: 2rem;
  background: linear-gradient(145deg, #4a72b2, #5b89cc);
  box-shadow: 0 14px 26px rgba(72, 110, 172, 0.28);
}

.lms-app .course-icon svg {
  width: 56px;
  height: 56px;
  color: #ffffff;
}

.lms-app .course-hero h2 {
  font-size: 2.95rem;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.lms-app .course-description {
  margin-top: 0.25rem;
  color: #72829a;
  font-style: italic;
  font-weight: 600;
}

.lms-app .course-meta {
  margin-top: 0.42rem;
}

.lms-app .course-meta.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.lms-app .meta-pill {
  padding: 0.34rem 0.68rem;
  background: #eaf0fb;
  color: #395f99;
  border: none;
  font-weight: 700;
}

.lms-app .meta-pill strong {
  color: #456ca8;
}

.lms-app .course-hero-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lms-app .course-facts {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  font-size: 0.8rem;
  color: #6f83a1;
}

.lms-app .course-facts span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.lms-app .course-facts span strong {
  color: #456ca8;
  font-weight: 700;
}

.lms-app .section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.46rem;
}

.lms-app .section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4a72b2;
  line-height: 0;
}

.lms-app .section-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.lms-app .btn {
  border-radius: 999px;
  background: linear-gradient(135deg, #4f79bc, #416cae);
  box-shadow: 0 8px 18px rgba(63, 103, 168, 0.26);
  font-weight: 800;
  padding: 0.62rem 1.2rem;
}

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

.lms-app .btn.secondary {
  background: #eaf0fb;
  color: #456ca8;
  box-shadow: inset 0 0 0 1px #ccdbf0;
}

.lms-app .btn.secondary:hover {
  background: #dfe8f7;
  box-shadow: inset 0 0 0 1px #bfd1ec;
}

.lms-app .btn.danger {
  background: #ba1f38;
  color: #fff;
  box-shadow: 0 8px 16px rgba(186, 31, 56, 0.28);
}

.lms-app .table-wrap {
  border: 1px solid #dfe6f2;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
}

.lms-app .lms-table {
  min-width: 920px;
}

.lms-app .lms-table th {
  background: #f1f5fb;
  color: #3f67a8;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.lms-app .lms-table td {
  border-bottom: 1px solid #e4ebf6;
  color: #2f3a52;
}

.lms-app .lms-table tbody tr:hover {
  background: #f7faff;
}

.lms-app .table-main-link {
  color: #2f3a52;
  font-weight: 800;
}

.lms-app .mini-link {
  color: #3f67a8;
}

.lms-app .mini-link-danger {
  color: #be2d49;
}

.lms-app .student-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.lms-app .avatar-badge {
  width: 30px;
  height: 30px;
  background: #eaf0fb;
  border: 1px solid #ccdbf0;
  color: #456ca8;
  font-size: 0.72rem;
}

.lms-app .avatar-badge.soft {
  width: 34px;
  height: 34px;
  background: #f1f5fb;
}

.lms-app .progress-track {
  width: 180px;
  height: 8px;
  background: #d8e0ed;
}

.lms-app .progress-fill {
  background: linear-gradient(90deg, #4f79bc, #3f67a8);
}

.lms-app .progress-label {
  color: #3f67a8;
}

.lms-app .status-badge.completed {
  background: #dff6e9;
  color: #2d9c57;
}

.lms-app .status-badge.progress {
  background: #e8f0ff;
  color: #3b66b4;
}

.lms-app .score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.24rem 0.58rem;
  background: #dfe8f7;
  color: #3f67a8;
  font-weight: 800;
  font-size: 0.82rem;
}

.lms-app .pending-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.78rem;
}

.lms-app .student-item.pending {
  margin: 0;
  background: #fbfdff;
  border: 1px dashed #d8e2f2;
  border-radius: 20px;
  padding: 0.7rem 0.8rem;
  min-width: 330px;
}

.lms-app .student-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
}

.lms-app .student-chip span {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lms-app .student-chip small {
  color: #8d9ab0;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 800;
  font-size: 0.64rem;
}

.lms-app .student-submeta {
  margin-top: 0.08rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  font-size: 0.72rem;
}

.lms-app .pending-list .btn.secondary {
  padding: 0.45rem 0.88rem;
}

.lms-app .empty-state {
  color: #909ab1;
}

.lms-app .chunk-panel,
.lms-app .chunk-preview-panel {
  background: #f8fbff;
  border-color: #d8e3f3;
}

.lms-app .chunk-card,
.lms-app .tiny-chunk-card {
  border-color: #d8e3f3;
  background: linear-gradient(160deg, #ffffff, #f6faff);
  box-shadow: 0 8px 18px rgba(61, 96, 150, 0.12);
}

.lms-app .chunk-order,
.lms-app .chunk-mini-body,
.lms-app .text-preview p {
  color: #496387;
}

.lms-app .chunk-edit-icon {
  background: #e5effc;
  color: #3f67a8;
  box-shadow: 0 6px 14px rgba(72, 110, 172, 0.2);
}

.lms-app .chunk-edit-icon:hover {
  background: #dce9fb;
}

.lms-app .chunk-delete-icon {
  background: #fdebed;
  color: #b42338;
  box-shadow: 0 6px 14px rgba(180, 35, 56, 0.18);
}

.lms-app .chunk-delete-icon:hover {
  background: #fbdde2;
}

.lms-app .field-label,
.lms-app label {
  color: #385885;
}

.lms-app input,
.lms-app textarea,
.lms-app select {
  border-color: #c9d8ee;
  background: #fcfdff;
  color: #1d3253;
}

.lms-app input:focus,
.lms-app textarea:focus,
.lms-app select:focus {
  outline: 2px solid rgba(74, 114, 178, 0.25);
  border-color: #5e86c3;
}

.lms-app .modal-backdrop {
  background: rgba(19, 32, 53, 0.42);
}

.lms-app .modal-card {
  background: #ffffff;
  border-color: #dce5f3;
}

.lms-app .publish-note {
  margin: 0;
  color: #5f6e84;
  font-size: 0.9rem;
}

@media (max-width: 1180px) {
  .lms-app .course-hero h2 {
    font-size: 2.2rem;
  }
}

@media (max-width: 1024px) {
  .lms-app .container.app-shell {
    grid-template-columns: 1fr;
  }

  .lms-app .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid #dfe6f2;
  }
}

@media (max-width: 700px) {
  .lms-app .course-hero-layout {
    grid-template-columns: 1fr;
  }

  .lms-app .course-hero-main {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .lms-app .course-hero-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .lms-app .course-icon {
    width: 84px;
    height: 84px;
  }

  .lms-app .course-hero h2 {
    font-size: 1.7rem;
  }

  .lms-app .course-hero-actions {
    width: 100%;
  }

  .lms-app .course-hero-actions .btn,
  .lms-app .course-hero-actions form {
    width: 100%;
  }

  .lms-app .course-facts {
    font-size: 0.76rem;
    gap: 0.45rem 0.75rem;
  }

  .lms-app .course-facts span {
    width: 100%;
  }

  .lms-app .student-item.pending {
    min-width: 0;
    width: 100%;
  }
}
