:root {
  --lms-primary: #1f5fbf;
  --lms-accent: #198754;
  --lms-sidebar: #2f3b52;
  --lms-header: #ffffff;
}

body {
  background: #f5f7fb;
}

.sidebar-dark {
  --cui-sidebar-bg: var(--lms-sidebar);
}

.header {
  background: var(--lms-header);
}

.btn-primary {
  --cui-btn-bg: var(--lms-primary);
  --cui-btn-border-color: var(--lms-primary);
  --cui-btn-hover-bg: color-mix(in srgb, var(--lms-primary), #000 12%);
  --cui-btn-hover-border-color: color-mix(in srgb, var(--lms-primary), #000 12%);
}

.btn-success {
  --cui-btn-bg: var(--lms-accent);
  --cui-btn-border-color: var(--lms-accent);
}

@media (min-width: 992px) {
  #sidebar.sidebar-fixed ~ .wrapper {
    margin-left: var(--cui-sidebar-width, 16rem);
    width: calc(100% - var(--cui-sidebar-width, 16rem));
    transition: margin-left .15s ease, width .15s ease;
  }

  body.sidebar-hide #sidebar.sidebar-fixed ~ .wrapper,
  #sidebar.sidebar-hide ~ .wrapper {
    margin-left: 0;
    width: 100%;
  }

  body.sidebar-narrow #sidebar.sidebar-fixed ~ .wrapper,
  #sidebar.sidebar-narrow ~ .wrapper {
    margin-left: var(--cui-sidebar-narrow-width, 4rem);
    width: calc(100% - var(--cui-sidebar-narrow-width, 4rem));
  }
}

@media (max-width: 991.98px) {
  #sidebar.sidebar-fixed ~ .wrapper {
    margin-left: 0;
    width: 100%;
  }
}

.wrapper .container-lg,
.wrapper .lms-main-container {
  max-width: 100%;
}

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

.header .container-fluid {
  gap: .75rem;
}

.header .header-nav .nav-link {
  white-space: nowrap;
}

.lms-auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, #eef4ff 0%, #f8fafc 100%);
}

.lms-auth-card {
  width: 100%;
  max-width: 420px;
}

.sidebar .nav-link.disabled {
  opacity: .55;
  cursor: not-allowed;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.sidebar .nav-icon {
  flex: 0 0 1.25rem;
  width: 1.25rem;
  text-align: center;
  font-size: 1rem;
}

.lms-stat-card {
  min-height: 130px;
}

.lms-avatar-sm,
.lms-avatar-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  object-fit: cover;
  background: #dbeafe;
  color: #1f5fbf;
  font-weight: 700;
}

.lms-avatar-sm {
  width: 32px;
  height: 32px;
}

.lms-avatar-lg {
  width: 96px;
  height: 96px;
  border: 1px solid #d8dbe0;
}

.lms-checklist {
  max-height: 220px;
  overflow-y: auto;
}

.lms-course-card {
  border-top: 4px solid var(--lms-primary);
}

.lms-course-hero {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem;
  color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--lms-primary), #000 22%) 0%, var(--lms-primary) 55%, var(--lms-accent) 100%);
  border-radius: 8px;
}

.lms-theme-preview {
  border: 1px solid #d8dbe0;
  border-radius: 8px;
  overflow: hidden;
}

.lms-theme-preview-header {
  padding: .75rem 1rem;
  color: #fff;
  background: var(--lms-sidebar);
  font-weight: 700;
}

.lms-theme-preview-body {
  padding: 1rem;
  background: var(--lms-header);
}

.lms-course-dates {
  min-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}

.lms-course-tabs-card {
  overflow: hidden;
}

.lms-course-tabs {
  gap: .25rem;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  scrollbar-width: thin;
}

.lms-course-tabs .nav-link {
  white-space: nowrap;
}

.lms-course-quick-card {
  border-color: #e6e9ef;
  box-shadow: none;
}

.lms-activity-list .list-group-item:first-child {
  padding-top: 0;
}

.lms-activity-icon {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 2rem;
  border-radius: 50%;
  color: var(--lms-primary);
  background: color-mix(in srgb, var(--lms-primary), #fff 88%);
}

.lms-rich-editor {
  background: #fff;
}

.lms-rich-editor .ql-editor {
  min-height: 140px;
}

.lms-forum-body img {
  max-width: 100%;
  height: auto;
}

.lms-media-dropzone {
  display: flex;
  min-height: 170px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px dashed #c5c7d0;
  border-radius: .5rem;
  background: #f8f9fb;
  color: #2f3b52;
  text-align: center;
  transition: border-color .15s ease, background-color .15s ease;
}

.lms-media-dropzone:hover,
.lms-media-dropzone.is-dragover {
  border-color: var(--lms-primary);
  background: #f4f7ff;
}

.lms-media-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.lms-media-subtitle {
  color: #6b7280;
}

.lms-media-list,
.lms-media-current {
  display: grid;
  gap: .5rem;
}

.lms-media-selected-item,
.lms-media-current-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem .75rem;
  border: 1px solid #dee2e6;
  border-radius: .5rem;
  background: #fff;
}

.lms-media-library-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1rem;
  align-items: start;
}

.lms-media-library-browser {
  max-height: 58vh;
  overflow: auto;
  padding-right: .25rem;
}

.lms-media-library-sidebar {
  min-width: 0;
}

.lms-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: .75rem;
  min-height: 220px;
}

.lms-media-tile {
  position: relative;
  display: grid;
  grid-template-rows: 96px auto;
  gap: .5rem;
  width: 100%;
  min-width: 0;
  padding: .45rem;
  border: 1px solid #dee2e6;
  border-radius: .5rem;
  background: #fff;
  color: #374151;
  text-align: left;
}

.lms-media-tile:hover,
.lms-media-tile.is-selected {
  border-color: var(--lms-primary, #3c4b64);
  box-shadow: 0 0 0 .18rem rgba(50, 31, 219, .12);
}

.lms-media-tile.has-module-media {
  border-color: #198754;
}

.lms-media-selected-badge {
  position: absolute;
  align-self: start;
  justify-self: end;
  margin: .35rem;
  padding: .15rem .35rem;
  border-radius: .35rem;
  background: #198754;
  color: #fff;
  font-size: .7rem;
}

.lms-media-tile img,
.lms-media-video-thumb {
  width: 100%;
  height: 96px;
  object-fit: cover;
  border-radius: .35rem;
  background: #eef2f7;
}

.lms-media-video-thumb {
  display: grid;
  place-items: center;
  color: #3c4b64;
  font-size: 2rem;
}

.lms-media-tile span {
  overflow: hidden;
  font-size: .82rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lms-selected-media-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .5rem;
  align-items: center;
  padding: .45rem .5rem;
  border: 1px solid #dee2e6;
  border-radius: .5rem;
  background: #fff;
  font-size: .82rem;
}

.lms-selected-media-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lms-media-details {
  position: sticky;
  top: 0;
  min-height: 220px;
  padding: 1rem;
  border: 1px solid #dee2e6;
  border-radius: .5rem;
  background: #fff;
}

.lms-media-selected-thumb {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: .5rem;
  background: #eef2f7;
}

.lms-media-details .lms-media-video-thumb {
  height: 150px;
}

.lms-media-meta {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: .35rem .75rem;
  margin-bottom: 1rem;
  font-size: .875rem;
}

.lms-media-meta dt {
  color: #6b7280;
  font-weight: 600;
}

.lms-media-meta dd {
  min-width: 0;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 991.98px) {
  .lms-media-library-layout {
    grid-template-columns: 1fr;
  }

  .lms-media-details {
    position: static;
  }
}

.lms-video-gallery {
  display: grid;
  gap: 1rem;
}

.lms-module-cover {
  margin: 0 0 1rem;
}

.lms-module-cover img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: .75rem;
}

.lms-module-image img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: .5rem;
}

.lms-module-image figcaption {
  margin-top: .35rem;
  color: #6b7280;
  font-size: .875rem;
}

.lms-video-box {
  max-width: 860px;
}

.lms-video-player {
  display: block;
  width: 100%;
  max-height: 480px;
  border-radius: .5rem;
  background: #111827;
}

.lms-course-hero-cover {
  background-position: center;
  background-size: cover;
}

.lms-dashboard-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.5rem;
  border-radius: .75rem;
  background: linear-gradient(135deg, var(--lms-primary), #2f855a);
  color: #fff;
}

.lms-dashboard-date {
  display: grid;
  gap: .15rem;
  text-align: right;
}

.lms-dashboard-date span {
  opacity: .78;
}

.lms-dashboard-metric .card-body {
  display: flex;
  gap: .85rem;
  align-items: center;
}

.lms-dashboard-metric strong {
  display: block;
  font-size: 1.6rem;
  line-height: 1;
}

.lms-metric-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: .65rem;
  color: #fff;
  font-size: 1.25rem;
}

.lms-course-dashboard-card {
  overflow: hidden;
  color: inherit;
  transition: transform .16s ease, box-shadow .16s ease;
}

.lms-course-dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 .75rem 1.5rem rgba(15, 23, 42, .12);
}

.lms-course-dashboard-cover {
  display: grid;
  place-items: center;
  height: 118px;
  background-position: center;
  background-size: cover;
}

.lms-course-dashboard-cover.is-empty {
  background: linear-gradient(135deg, #e8eef8, #dbeafe);
  color: var(--lms-primary);
  font-size: 2rem;
}

.lms-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .35rem;
}

.lms-calendar-head {
  color: #6b7280;
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
}

.lms-calendar-day {
  min-height: 74px;
  padding: .35rem;
  border: 1px solid #e5e7eb;
  border-radius: .45rem;
  background: #fff;
}

.lms-calendar-day.is-empty {
  background: transparent;
  border-color: transparent;
}

.lms-calendar-number {
  display: block;
  margin-bottom: .2rem;
  color: #374151;
  font-size: .8rem;
  font-weight: 700;
}

.lms-calendar-event {
  display: block;
  overflow: hidden;
  margin-bottom: .2rem;
  padding: .1rem .25rem;
  border-radius: .25rem;
  background: rgba(31, 95, 191, .12);
  color: var(--lms-primary);
  font-size: .68rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.lms-calendar-more {
  color: #6b7280;
  font-size: .68rem;
}

.lms-upcoming-event {
  display: grid;
  gap: .25rem;
  padding: .65rem;
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  color: inherit;
  text-decoration: none;
}

.lms-upcoming-event:hover {
  border-color: var(--lms-primary);
}

.lms-upcoming-event small {
  color: #6b7280;
}

.lms-question-card {
  border-left: 4px solid var(--lms-primary);
}

.lms-evaluation-question {
  min-height: 420px;
}

.lms-answer-option {
  border: 1px solid #d8dbe0;
  border-radius: 8px;
  padding: .75rem .9rem .75rem 2.5rem;
  background: #fff;
}

.lms-answer-option:hover {
  border-color: var(--lms-primary);
  background: #f8fbff;
}

@media (max-width: 767.98px) {
  .lms-dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .lms-dashboard-date {
    text-align: left;
  }

  .lms-calendar-day {
    min-height: 58px;
    padding: .25rem;
  }
}

.lms-course-cover-preview {
  width: 220px;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: .5rem;
}

.lms-editor-card .ck-editor__editable {
  min-height: 620px;
}

.lms-editor-card .ck-content {
  font-size: 1rem;
  line-height: 1.65;
}

.lms-editor-card .ck-content img {
  max-width: 100%;
}

.table-responsive {
  overflow-x: auto;
}

.table .btn-group {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .25rem;
}

.table .btn-group > .btn,
.table .btn-group > a.btn {
  border-radius: .25rem !important;
}

#courses-table th:last-child,
#courses-table td:last-child {
  min-width: 260px;
}

.dt-container .row {
  row-gap: .75rem;
}

#modules-list .list-group-item > .d-flex {
  align-items: flex-start;
}

#modules-list .btn-group {
  flex-wrap: wrap;
  gap: .25rem;
  justify-content: flex-end;
}

#modules-list .btn-group > .btn,
#modules-list .btn-group > a.btn {
  border-radius: .25rem !important;
}

@media (max-width: 1399.98px) {
  .body {
    padding-left: .75rem !important;
    padding-right: .75rem !important;
  }

  .lms-course-hero {
    padding: 1.5rem;
  }

  .card-body {
    padding: 1rem;
  }

  .header .nav-link span:not(.lms-avatar-sm):not(.lms-avatar-placeholder) {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 1199.98px) {
  .header [data-lms-sidebar-label] {
    display: none;
  }

  #courses-table th:last-child,
  #courses-table td:last-child {
    min-width: 220px;
  }

  #modules-list .list-group-item > .d-flex {
    flex-direction: column;
  }

  #modules-list .list-group-item > .d-flex > div:last-child {
    width: 100%;
  }

  #modules-list .btn-group {
    justify-content: flex-start;
  }
}

@media (max-width: 767.98px) {
  .header .header-nav .nav-link span:not(.lms-avatar-sm):not(.lms-avatar-placeholder) {
    display: none;
  }

  .lms-course-hero {
    flex-direction: column;
    padding: 1.25rem;
  }

  .lms-course-tabs-card > .card-body {
    padding: .875rem;
  }

  .lms-course-dates {
    align-items: flex-start;
  }
}
