body { background:#f8fafc; }.card { border-radius:1rem; }.navbar-brand { font-weight:700; }


.badge-card {
  min-height: 130px;
  border-radius: 18px;
  padding: 16px 10px;
  text-align: center;
  color: #fff;
  box-shadow: 0 8px 18px rgba(0,0,0,.15);
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: help;
}
.badge-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,.22);
}
.badge-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  margin-bottom: 10px;
  background: rgba(255,255,255,.18);
}
.badge-title {
  font-weight: 700;
  font-size: .95rem;
}
.badge-gold { background: linear-gradient(135deg, #c58b00, #ffd65a); color: #332300; }
.badge-blue { background: linear-gradient(135deg, #0d6efd, #4dabf7); }
.badge-green { background: linear-gradient(135deg, #198754, #63e6be); }
.badge-purple { background: linear-gradient(135deg, #6f42c1, #b197fc); }
.badge-red { background: linear-gradient(135deg, #dc3545, #ff8787); }
.badge-dark { background: linear-gradient(135deg, #212529, #868e96); }

/* Course brand image sizing */
.course-brand-img,
.card-img-top {
  width: 100%;
  max-width: 100%;
  height: 160px;
  max-height: 160px;
  object-fit: contain;
  object-position: center;
  background: #f8f9fa;
  display: block;
}


/* Modern Student Dashboard */
.lms-dashboard {
  background: #f5f8fc;
  margin: -1.5rem;
  padding: 2rem;
  min-height: calc(100vh - 56px);
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.dash-header h1 {
  font-weight: 800;
  margin: 0;
}

.dash-header p {
  color: #6c757d;
  margin: 6px 0 0;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1.1fr .95fr;
  gap: 20px;
}

.dash-card {
  background: #fff;
  border: 1px solid #e7edf5;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(20, 40, 80, .06);
  padding: 22px;
}

.dash-card h4 {
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 18px;
}

.overall-wrap {
  display: flex;
  align-items: center;
  gap: 34px;
}

.progress-ring {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, white 74%, transparent 76% 100%),
    conic-gradient(#0d6efd calc(var(--pct) * 1%), #e7edf5 0);
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring strong {
  font-size: 2.2rem;
  display: block;
  text-align: center;
}

.progress-ring span {
  color: #6c757d;
  font-size: .9rem;
}

.progress-stats {
  flex: 1;
}

.progress-stats div {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
}

.progress-stats strong {
  margin-left: auto;
}

.dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
}

.dot.green { background: #20c997; }
.dot.blue { background: #0d6efd; }
.dot.gray { background: #adb5bd; }

.level-flex {
  display: flex;
  gap: 24px;
  align-items: center;
}

.level-badge {
  width: 120px;
  height: 135px;
  background: linear-gradient(135deg, #60a5fa, #0d6efd);
  clip-path: polygon(50% 0%, 92% 20%, 92% 70%, 50% 100%, 8% 70%, 8% 20%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 30px rgba(13, 110, 253, .25);
}

.level-star {
  color: white;
  font-size: 50px;
}

.level-card h2 {
  color: #0d6efd;
  font-weight: 800;
  margin-bottom: 4px;
}

.level-card p {
  color: #6c757d;
  font-size: .9rem;
}

.mini-progress {
  height: 8px;
  background: #e9eef5;
  border-radius: 999px;
  overflow: hidden;
  min-width: 140px;
}

.mini-progress div {
  height: 100%;
  background: #0d6efd;
  border-radius: 999px;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.course-progress-row {
  display: grid;
  grid-template-columns: 52px 1fr 48px 92px;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.course-progress-row img,
.course-thumb-placeholder {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 10px;
  background: #eef3f8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.course-progress-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.status-pill {
  font-size: .75rem;
  padding: 5px 8px;
  border-radius: 999px;
  text-align: center;
}

.status-pill.in-progress {
  background: #e7f1ff;
  color: #0d6efd;
}

.status-pill.not-started {
  background: #f1f3f5;
  color: #6c757d;
}

.achievement-row {
  display: grid;
  grid-template-columns: 50px 1fr 60px;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.achievement-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.achievement-blue { background: linear-gradient(135deg, #74c0fc, #0d6efd); }
.achievement-green { background: linear-gradient(135deg, #63e6be, #12b886); }
.achievement-purple { background: linear-gradient(135deg, #b197fc, #7950f2); }
.achievement-gold { background: linear-gradient(135deg, #ffd43b, #f08c00); }
.achievement-red { background: linear-gradient(135deg, #ff8787, #e03131); }

.achievement-row p {
  margin: 2px 0 0;
  color: #6c757d;
  font-size: .85rem;
}

.achievement-row span {
  color: #198754;
  font-size: .8rem;
}

.completed-course-card {
  background: white;
  border: 1px solid #d7f0df;
  border-radius: 14px;
  overflow: hidden;
  height: 100%;
}

.completed-course-card img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: #f8f9fa;
}

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

  .overall-wrap,
  .level-flex {
    flex-direction: column;
    align-items: flex-start;
  }

  .course-progress-row {
    grid-template-columns: 52px 1fr;
  }

  .course-progress-row strong,
  .course-progress-row .status-pill {
    grid-column: 2;
  }
}


.category-level-row {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid #edf1f7;
  padding: 14px 0;
}

.category-level-main span {
  font-weight: 700;
  color: #0d6efd;
}

@media (max-width: 768px) {
  .category-level-row {
    grid-template-columns: 1fr;
  }
}


/* Mobile navbar fixes */
@media (max-width: 991px) {
  .navbar-nav {
    padding-top: 0.75rem;
  }

  .navbar-nav .nav-link {
    padding: 0.65rem 0;
    border-top: 1px solid rgba(255,255,255,.08);
  }

  .dash-header {
    gap: 1rem;
    flex-wrap: wrap;
  }
}

/* Dashboard course progress thumbnails */
.course-progress-row img,
.course-thumb-placeholder {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px;
  max-width: 52px;
  max-height: 52px;
  object-fit: cover !important;
  object-position: center;
  overflow: hidden;
  border-radius: 10px;
}

/* Dashboard course progress thumbnails */
.course-progress-row img,
.course-thumb-placeholder {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px;
  max-width: 52px;
  max-height: 52px;
  object-fit: cover !important;
  object-position: center;
  overflow: hidden;
  border-radius: 10px;
}

/* Force dashboard course-progress images to stay inside frame */
.course-progress-thumb {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  overflow: hidden !important;
  border-radius: 10px !important;
  background: #eef3f8 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.course-progress-thumb img {
  width: 100% !important;
  height: 100% !important;
  max-width: 52px !important;
  max-height: 52px !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
}

.course-progress-row {
  grid-template-columns: 52px 1fr 48px 92px !important;
  overflow: hidden !important;
}

.course-progress-row > img {
  width: 52px !important;
  height: 52px !important;
  max-width: 52px !important;
  max-height: 52px !important;
  object-fit: cover !important;
  border-radius: 10px !important;
}

.course-progress-thumb {
  width: 52px !important;
  height: 52px !important;
  overflow: hidden !important;
  border-radius: 10px !important;
  flex-shrink: 0 !important;
}

.course-progress-thumb img {
  width: 52px !important;
  height: 52px !important;
  object-fit: cover !important;
  display: block !important;
}


/* FINAL dashboard thumbnail fix */
.course-progress-thumb {
  width: 52px !important;
  height: 52px !important;
  overflow: hidden !important;
  border-radius: 10px !important;
  background: #eef3f8 !important;
}

.course-progress-thumb img {
  width: 52px !important;
  height: 52px !important;
  object-fit: contain !important;
  object-position: center !important;
}


.course-expired {
  opacity: 0.45;
  filter: grayscale(75%);
  position: relative;
}



.course-expired-alert {
  font-weight: 600;
}


/* Expired courses are faded but still clickable/manageable */
.course-expired {
  opacity: 0.55 !important;
  filter: grayscale(65%) !important;
}

.course-expired .btn,
.course-expired a {
  pointer-events: auto !important;
}


/* FINAL expired course visual state */
.course-expired,
.course-expired *,
.card.course-expired,
.card.course-expired * {
  opacity: 0.62 !important;
  filter: grayscale(80%) !important;
}

.course-expired a,
.course-expired button,
.course-expired .btn {
  pointer-events: auto !important;
  cursor: pointer !important;
}


/* Quiz results export button layout */
.quiz-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.quiz-results-header h1 {
  margin: 0;
  flex: 1 1 auto;
}

.quiz-export-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 576px) {
  .quiz-results-header {
    align-items: stretch;
  }

  .quiz-results-header h1 {
    width: 100%;
  }

  .quiz-export-btn {
    width: 100%;
    text-align: center;
  }
}


.quiz-export-row {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 1rem 0;
}

@media (max-width: 576px) {
  .quiz-export-row {
    justify-content: stretch;
  }

  .quiz-export-row .btn {
    width: 100%;
  }
}


.quiz-export-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 576px) {
  .quiz-export-row .btn {
    width: 100%;
  }
}


.status-pill.completed {
  background: #d1e7dd;
  color: #0f5132;
}


/* Admin users tables: keep Internal and Customers aligned */
.users-table {
  table-layout: fixed;
  width: 100%;
}

.users-table th,
.users-table td {
  vertical-align: middle;
  white-space: nowrap;
}

.users-table td:nth-child(2) {
  overflow-wrap: anywhere;
  white-space: normal;
}

.users-table td:last-child {
  text-align: right;
}

@media (max-width: 768px) {
  .users-table {
    table-layout: auto;
  }

  .users-table th,
  .users-table td {
    white-space: normal;
  }

  .users-table td:last-child {
    text-align: left;
  }
}

/* Admin users page consistent columns */
.users-table {
  width: 100%;
  table-layout: fixed;
}

.users-table .col-name { width: 16%; }
.users-table .col-email { width: 30%; }
.users-table .col-role { width: 10%; }
.users-table .col-groups { width: 18%; }
.users-table .col-actions { width: 26%; }

.users-table td,
.users-table th {
  vertical-align: middle;
}

.users-table td:nth-child(2) {
  overflow-wrap: anywhere;
}

.users-table td:last-child .btn,
.users-table td:last-child form {
  margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
  .users-table {
    table-layout: auto;
    min-width: 850px;
  }
}


.admin-back-btn {
  display: inline-block;
}

@media (max-width: 576px) {
  .admin-back-btn {
    width: 100%;
    text-align: center;
  }
}


.user-back-btn {
  display: inline-block;
}

@media (max-width: 576px) {
  .user-back-btn {
    width: 100%;
    text-align: center;
    margin-bottom: 0.5rem;
  }
}


.page-back-btn{
    display:inline-block;
}

@media (max-width:768px){
    .page-back-btn{
        width:100%;
        text-align:center;
        margin-bottom:1rem;
    }
}



/* Uniform course cards on Courses page */
.course-card,
.card.h-100 {
  height: 100%;
}

.card.h-100 {
  display: flex;
  flex-direction: column;
  min-height: 300px;
}

.card.h-100 .card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card.h-100 img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  object-position: center;
  background: #fff;
  padding: 12px;
}

.card.h-100 h5 {
  min-height: 48px;
  margin-bottom: 0.5rem;
}

.card.h-100 .btn,
.card.h-100 form {
  margin-top: auto;
}

.card.h-100 p {
  display: none !important;
}


/* Lesson video player */
.lesson-video-player {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 720px !important;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #000;
  display: block;
  border-radius: 10px;
}

.lesson-body {
  line-height: 1.6;
  margin-bottom: 1rem;
}

.lesson-body p {
  margin-bottom: 1rem;
}

.lesson-body {
  line-height: 1.6;
  margin-bottom: 1rem;
}

.lesson-body p {
  margin: 0 0 1rem 0;
}

.lesson-body ul,
.lesson-body ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}
