/* ================================================================
   BAIAC Intelligence Academy — Student Panel CSS
   Complete stylesheet — covers all pages in student/
   ================================================================ */

/* ── CSS Variables ─────────────────────────────────────────────── */
:root {
  --color-bg-page:        #EBEBF0;
  --color-bg-card:        #FFFFFF;
  --color-bg-surface:     #F4F4F8;
  --color-topnav:         #0A1628;
  --color-accent:         #1E40AF;
  --color-accent-hover:   #1E3A8A;
  --color-accent-light:   #EFF6FF;
  --color-text-primary:   #0F0F1A;
  --color-text-secondary: #52525B;
  --color-text-inverse:   #FFFFFF;
  --color-danger:         #DC2626;
  --color-success:        #16A34A;
  --color-warning:        #D97706;
  --color-border:         #C4C4D4;
  --color-correct:        #DCFCE7;
  --color-correct-text:   #15803D;
  --color-incorrect:      #FEE2E2;
  --color-incorrect-text: #B91C1C;
  --radius-sm:  2px;
  --radius-md:  4px;
  --radius-lg:  6px;
  --radius-xl:  8px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md:  0 3px 8px rgba(0,0,0,0.14);
  --shadow-lg:  0 8px 20px rgba(0,0,0,0.16);
  --transition: 0.14s ease;
  --sidebar-w:  220px;
  --topnav-h:   60px;
}

/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--color-bg-page);
  color: var(--color-text-primary);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
h4 { font-size: 15px; font-weight: 700; }
h5 { font-size: 14px; font-weight: 700; }
h6 { font-size: 13px; font-weight: 700; }
img { max-width: 100%; height: auto; }
strong { font-weight: 600; }
small { font-size: 0.85em; }

/* ── Student Sidebar ────────────────────────────────────────────── */
.student-sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--color-topnav);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 90;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: var(--topnav-h);
}
.student-sidebar::-webkit-scrollbar { width: 3px; }
.student-sidebar::-webkit-scrollbar-track { background: transparent; }
.student-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

.student-nav { list-style: none; padding: 12px 0; margin: 0; }
.student-nav__divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 8px 12px;
}
.student-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: rgba(255,255,255,0.58);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.student-nav__link:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.92);
  text-decoration: none;
}
.student-nav__link--active {
  background: rgba(37,99,235,0.2);
  color: #93C5FD;
  border-left-color: var(--color-accent);
}
.student-nav__link--logout:hover {
  background: rgba(239,68,68,0.12);
  color: #FCA5A5;
  border-left-color: var(--color-danger);
}
.student-nav__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  opacity: 0.8;
}
.student-nav__link--active .student-nav__icon,
.student-nav__link:hover .student-nav__icon { opacity: 1; }

/* ── Top Navigation ─────────────────────────────────────────────── */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--topnav-h);
  background: var(--color-topnav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 0;
  padding-left: calc(var(--sidebar-w) + 20px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}
.topnav__brand {
  display: flex;
  align-items: stretch;
  background: #FFFFFF;
  padding: 0 20px;
  height: var(--topnav-h);
  position: absolute;
  left: 0;
  top: 0;
  width: var(--sidebar-w);
}
.topnav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text-inverse);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}
.topnav__logo:hover { text-decoration: none; opacity: 0.9; }
.topnav__logo-img {
  height: 38px;
  width: auto;
  display: block;
  object-fit: contain;
}
.topnav__right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.topnav__user { display: flex; align-items: center; gap: 10px; }
.topnav__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.15);
}
.topnav__avatar--photo {
  object-fit: cover;
  object-position: center;
  background: none;
  padding: 0;
}
.topnav__username {
  color: #CBD5E1;
  font-size: 13px;
  font-weight: 500;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topnav__link {
  color: #94A3B8;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.topnav__link:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.topnav__logout {
  color: #94A3B8;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.12);
  transition: all var(--transition);
}
.topnav__logout:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); color: #FCA5A5; text-decoration: none; }

/* ── Page Container ─────────────────────────────────────────────── */
main {
  margin-left: var(--sidebar-w);
  padding-top: var(--topnav-h);
  min-height: 100vh;
}
.page-container {
  max-width: 100%;
  padding: 36px 32px 60px;
}
.page-header { margin-bottom: 28px; }
.page-header h1 { color: var(--color-text-primary); margin-bottom: 4px; }
.page-header p { color: var(--color-text-secondary); font-size: 14px; }

/* ── Flash / Alert ───────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid transparent;
}
.alert-success, .alert.alert-success { background: #DCFCE7; color: #15803D; border-color: #BBF7D0; }
.alert-error,   .alert.alert-error   { background: #FEE2E2; color: #B91C1C; border-color: #FECACA; }
.alert-warning, .alert.alert-warning { background: #FEF9C3; color: #92400E; border-color: #FDE68A; }
.alert-info,    .alert.alert-info    { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.alert-danger,  .alert.alert-danger  { background: #FEE2E2; color: #B91C1C; border-color: #FECACA; }

/* ── Utility — Bootstrap-compat ─────────────────────────────────── */
.text-center  { text-align: center; }
.text-end     { text-align: right; }
.text-muted   { color: var(--color-text-secondary) !important; }
.text-success { color: var(--color-success) !important; }
.text-danger  { color: var(--color-danger)  !important; }
.text-warning { color: var(--color-warning) !important; }
.text-primary { color: var(--color-accent)  !important; }
.text-info    { color: #0891B2 !important; }
.text-white   { color: #fff !important; }
.fw-bold, .font-weight-bold { font-weight: 700 !important; }
.small        { font-size: 0.85em; }
.mb-0  { margin-bottom: 0 !important; }
.mb-1  { margin-bottom: 4px !important; }
.mb-2  { margin-bottom: 8px !important; }
.mb-3  { margin-bottom: 16px !important; }
.mb-4  { margin-bottom: 24px !important; }
.mt-0  { margin-top: 0 !important; }
.mt-1  { margin-top: 4px !important; }
.mt-2  { margin-top: 8px !important; }
.mt-3  { margin-top: 16px !important; }
.mt-4  { margin-top: 24px !important; }
.mt-5  { margin-top: 48px !important; }
.me-1  { margin-right: 4px !important; }
.me-2  { margin-right: 8px !important; }
.ms-2  { margin-left: 8px !important; }
.ms-auto { margin-left: auto !important; }
.p-0   { padding: 0 !important; }
.py-4  { padding-top: 24px !important; padding-bottom: 24px !important; }
.py-5  { padding-top: 48px !important; padding-bottom: 48px !important; }
.d-flex { display: flex !important; }
.d-block { display: block !important; }
.d-none  { display: none !important; }
.d-md-block { display: block; }
.d-none.d-md-block { display: none; }
.align-items-center   { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end  { justify-content: flex-end !important; }
.flex-wrap { flex-wrap: wrap !important; }
.gap-2 { gap: 8px !important; }
.hidden { display: none !important; }
.w-100 { width: 100% !important; }

/* Bootstrap grid — simplified 12-col approximation */
.container-fluid { width: 100%; }
.row { display: flex; flex-wrap: wrap; gap: 0; margin: 0 -8px; }
.row > * { padding: 0 8px; }
.col-12  { flex: 0 0 100%; max-width: 100%; }
.col-md-3  { flex: 0 0 25%;    max-width: 25%; }
.col-md-6  { flex: 0 0 50%;    max-width: 50%; }
.col-md-9  { flex: 0 0 75%;    max-width: 75%; }
.col-md-12 { flex: 0 0 100%;   max-width: 100%; }
.col-lg-2  { flex: 0 0 16.666%; max-width: 16.666%; }
.col-lg-10 { flex: 0 0 83.333%; max-width: 83.333%; }

/* ── Bootstrap Accordion (custom, no JS dep rewrite) ─────────────── */
.accordion { border-radius: var(--radius-lg); overflow: hidden; }
.accordion-item {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  margin-bottom: 6px;
  border-radius: var(--radius-lg) !important;
  overflow: hidden;
}
.accordion-header { margin: 0; }
.accordion-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  background: var(--color-bg-card);
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
}
.accordion-button:hover { background: var(--color-bg-surface); }
.accordion-button::after {
  content: '▾';
  margin-left: auto;
  font-size: 12px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.accordion-button.collapsed::after { transform: rotate(-90deg); }
.accordion-button:not(.collapsed) { background: var(--color-accent-light); color: var(--color-accent); }
.accordion-collapse { display: none; }
.accordion-collapse:not(.collapse) { display: block; }
.accordion-collapse.show { display: block; }
.accordion-body { padding: 16px 18px; font-size: 14px; }
/* Border-colour priority classes */
.accordion-item.border-danger  { border-left: 4px solid var(--color-danger)  !important; }
.accordion-item.border-warning { border-left: 4px solid var(--color-warning) !important; }
.accordion-item.border-success { border-left: 4px solid var(--color-success) !important; }

/* ── List group ──────────────────────────────────────────────────── */
.list-group { display: flex; flex-direction: column; }
.list-group-flush .list-group-item:first-child { border-top: none; }
.list-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
  font-size: 14px;
}
.list-group-item:first-child { border-top: none; }
.list-group-item.list-group-item-warning { background: #FFFBEB; }

/* ── Badge ───────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
/* BEM badges used in dashboard / exam centre */
.badge--blue    { background: #EFF6FF; color: #1D4ED8; }
.badge--gray    { background: #F1F5F9; color: #475569; }
.badge--green   { background: #F0FDF4; color: #15803D; }
.badge--red     { background: #FEF2F2; color: #B91C1C; }
.badge--yellow  { background: #FEFCE8; color: #A16207; }
.badge--orange  { background: #FFF7ED; color: #C2410C; }
/* Bootstrap badge colours */
.badge.bg-success, .bg-success { background: #DCFCE7 !important; color: #15803D; }
.badge.bg-warning, .bg-warning { background: #FEF9C3 !important; color: #92400E; }
.badge.bg-danger,  .bg-danger  { background: #FEE2E2 !important; color: #B91C1C; }
.badge.bg-primary, .bg-primary { background: #EFF6FF !important; color: #1D4ED8; }
.badge.bg-info,    .bg-info    { background: #E0F2FE !important; color: #0369A1; }
.badge.bg-secondary,.bg-secondary { background: #F1F5F9 !important; color: #475569; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { opacity: 0.85; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* BEM variants (used in dashboard, profile, exam pages) */
.btn--primary  { background: var(--color-accent); color: #fff; }
.btn--primary:hover { background: var(--color-accent-hover); color: #fff; }
.btn--outline  { background: transparent; color: var(--color-accent); border: 1.5px solid var(--color-accent); }
.btn--outline:hover { background: var(--color-accent-light); }
.btn--ghost    { background: var(--color-bg-surface); color: var(--color-text-primary); border: 1px solid var(--color-border); }
.btn--ghost:hover { background: var(--color-border); }
.btn--danger   { background: var(--color-danger); color: #fff; }
.btn--danger:hover { background: #B91C1C; }
.btn--full     { width: 100%; }
.btn--sm       { padding: 6px 12px; font-size: 12px; }
.btn--lg       { padding: 12px 24px; font-size: 14px; }

/* Bootstrap variants (used in courses, modules, results, exam_centre) */
.btn-primary   { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.btn-primary:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); color: #fff; text-decoration: none; }
.btn-secondary { background: #F1F5F9; color: var(--color-text-primary); border-color: var(--color-border); }
.btn-secondary:hover { background: #E2E8F0; color: var(--color-text-primary); text-decoration: none; }
.btn-success   { background: var(--color-success); color: #fff; border-color: var(--color-success); }
.btn-success:hover { background: #15803D; color: #fff; text-decoration: none; }
.btn-danger    { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.btn-danger:hover { background: #B91C1C; color: #fff; text-decoration: none; }
.btn-warning   { background: #F59E0B; color: #fff; border-color: #F59E0B; }
.btn-warning:hover { background: #D97706; color: #fff; text-decoration: none; }
.btn-info      { background: #0891B2; color: #fff; border-color: #0891B2; }
.btn-info:hover { background: #0E7490; color: #fff; text-decoration: none; }
.btn-outline-secondary { background: transparent; color: var(--color-text-secondary); border: 1.5px solid var(--color-border); }
.btn-outline-secondary:hover { background: var(--color-bg-surface); text-decoration: none; }
.btn-sm  { padding: 5px 11px; font-size: 12px; }
.btn-xs  { padding: 3px 8px;  font-size: 11px; }
.btn-lg  { padding: 11px 22px; font-size: 15px; }

/* ── Card ────────────────────────────────────────────────────────── */
.card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
/* BEM card used in profile */
.card .card__header,
.card__header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-surface);
}
.card__title  { font-size: 15px; font-weight: 600; color: var(--color-text-primary); }
.card__subtitle { font-size: 13px; color: var(--color-text-secondary); margin-top: 2px; }
/* Bootstrap card used in results, courses */
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--color-text-primary); }
.card-body { padding: 20px 22px; }
.card-text  { font-size: 14px; color: var(--color-text-secondary); margin-bottom: 8px; }
/* padding convenience for card children */
.card > .form-group { padding: 0 22px; }
.card > .form-group:first-of-type { padding-top: 20px; }
.card > .form-row { padding: 0 22px; }
.card > button, .card > .btn { margin: 0 22px 22px; }

/* ── Forms ────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  color: var(--color-text-primary);
  background: var(--color-bg-card);
  transition: border-color var(--transition);
  outline: none;
  appearance: none;
}
.form-control:focus { border-color: var(--color-accent); }
.form-control:disabled { background: var(--color-bg-surface); color: var(--color-text-secondary); cursor: not-allowed; }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--color-text-secondary); margin-top: 4px; }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-divider { border: none; border-top: 1px dashed var(--color-border); margin: 24px 0; }

/* ── Stats Row (dashboard) ───────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-card__body { display: flex; flex-direction: column; min-width: 0; }
.stat-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-card__icon--blue   { background: #EFF6FF; color: #1D4ED8; }
.stat-card__icon--green  { background: #F0FDF4; color: #15803D; }
.stat-card__icon--yellow { background: #FEFCE8; color: #A16207; }
.stat-card__icon--purple { background: #F5F3FF; color: #7C3AED; }
.stat-card__icon--red    { background: #FEF2F2; color: #B91C1C; }
.stat-card__number { font-size: 26px; font-weight: 700; color: var(--color-text-primary); line-height: 1.1; }
.stat-card__label  { font-size: 12px; color: var(--color-text-secondary); font-weight: 500; margin-top: 2px; }

/* ── Section Title ───────────────────────────────────────────────── */
.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
}

/* ── Module Card Grid (dashboard) ───────────────────────────────── */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.module-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.module-card:hover { box-shadow: var(--shadow-md); border-color: #CBD5E1; }
.module-card__header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.module-card__order {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  background: rgba(0,0,0,0.18);
  border-radius: 99px;
  padding: 2px 10px;
}
.module-card__icon { opacity: 0.7; }
.module-card__body { padding: 16px; }
.module-card__title { font-size: 14px; font-weight: 600; color: var(--color-text-primary); margin-bottom: 6px; line-height: 1.4; }
.module-card__desc  { font-size: 12px; color: var(--color-text-secondary); margin-bottom: 10px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.module-card__meta  { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Exam Card Grid (dashboard) ─────────────────────────────────── */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.exam-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 22px 20px 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.exam-card:hover { box-shadow: var(--shadow-md); border-color: #CBD5E1; }
.exam-card__course { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-accent); margin-bottom: 6px; }
.exam-card__title  { font-size: 15px; font-weight: 600; color: var(--color-text-primary); margin-bottom: 14px; line-height: 1.4; }
.exam-card__meta   { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.exam-card__divider { border: none; border-top: 1px solid var(--color-border); margin: 0 0 14px; }
.exam-card__footer { margin-top: auto; }

/* ── Profile Layout ──────────────────────────────────────────────── */
.profile-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}
.profile-avatar-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: 28px 20px;
  text-align: center;
}
.profile-avatar__circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), #7C3AED);
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 4px 16px rgba(37,99,235,0.3);
}
.profile-avatar__circle--img {
  background: none;
  padding: 0;
  overflow: hidden;
}
.profile-avatar__circle--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.profile-avatar__name     { font-size: 15px; font-weight: 600; color: var(--color-text-primary); margin-bottom: 4px; }
.profile-avatar__username { font-size: 12px; color: var(--color-text-secondary); margin-bottom: 16px; }
.profile-info-item { display: flex; flex-direction: column; text-align: left; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.profile-info-item:last-child { border-bottom: none; }
.profile-info-item__label  { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-secondary); margin-bottom: 2px; }
.profile-info-item__value  { font-size: 13px; font-weight: 500; color: var(--color-text-primary); }

/* ── Login Page ──────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--color-topnav);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--color-border);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
  background: #fff;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-logo-img { height: 52px; width: auto; display: block; object-fit: contain; }
.login-card h2 { font-size: 20px; font-weight: 700; color: var(--color-text-primary); margin-bottom: 6px; text-align: center; }
.login-desc { font-size: 13px; color: var(--color-text-secondary); margin-bottom: 24px; text-align: center; }

/* ── Courses Page ────────────────────────────────────────────────── */
/* .dashboard-container / .dashboard-content are legacy wrappers — neutralise them
   so they don't add unwanted double-padding inside .page-container */
.dashboard-container { width: 100%; }
.dashboard-content   { width: 100%; }
.welcome-section {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.welcome-section h2 { font-size: 20px; color: var(--color-text-primary); margin-bottom: 4px; }
.welcome-section p  { font-size: 14px; color: var(--color-text-secondary); }

.course-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
}
.course-header {
  background: var(--color-topnav);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.course-header h3 { color: #fff; font-size: 16px; margin: 0; display: flex; align-items: center; gap: 8px; }
.progress-info { padding: 16px 22px 0; }
.progress-stats { display: flex; gap: 24px; margin-bottom: 12px; }
.stat-item { display: flex; flex-direction: column; }
.stat-item .stat-value { font-size: 18px; font-weight: 700; color: var(--color-text-primary); }
.stat-item .stat-label { font-size: 12px; color: var(--color-text-secondary); }
.progress-bar-container {
  height: 6px;
  background: var(--color-border);
  border-radius: 99px;
  overflow: hidden;
  margin: 0 22px 16px;
}
.progress-bar-container .progress-bar {
  height: 100%;
  background: var(--color-accent);
  border-radius: 99px;
  transition: width 0.4s ease;
}
.modules-list { padding: 8px 0 16px; }

/* Module items in courses/modules list */
.module-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-card);
  transition: background var(--transition);
}
.module-item:first-child { border-top: none; }
.module-item:hover { background: var(--color-bg-surface); }
.module-item.locked    { opacity: 0.6; }
.module-item.completed { background: #F0FDF4; }
.module-item.current   { background: #EFF6FF; border-left: 3px solid var(--color-accent); }
.module-item.available { background: var(--color-bg-card); }
.module-info  { flex: 1; min-width: 0; }
.module-number { font-size: 11px; font-weight: 600; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 3px; }
.module-title  { font-size: 14px; font-weight: 600; color: var(--color-text-primary); }
.module-description { font-size: 12px; color: var(--color-text-secondary); margin-top: 3px; }
.module-status { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.term-modules  { }

/* Status badges in module items */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}
.status-badge.completed { background: #DCFCE7; color: #15803D; }
.status-badge.current   { background: #EFF6FF; color: #1D4ED8; }
.status-badge.available { background: #F0FDF4; color: #15803D; }
.status-badge.locked    { background: #F1F5F9; color: #475569; }

/* Action buttons in module list */
.btn-review, .btn-continue, .btn-start {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.btn-review   { background: var(--color-bg-surface); color: var(--color-text-secondary); border: 1px solid var(--color-border); }
.btn-review:hover { background: var(--color-border); text-decoration: none; }
.btn-continue { background: var(--color-accent); color: #fff; }
.btn-continue:hover { background: var(--color-accent-hover); text-decoration: none; color: #fff; }
.btn-start    { background: var(--color-success); color: #fff; }
.btn-start:hover { background: #15803D; text-decoration: none; color: #fff; }

/* ── Exam Centre (ec-* classes) ──────────────────────────────────── */
.ec-course-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 28px;
}
.ec-course-header {
  background: var(--color-topnav);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.ec-course-title { font-size: 16px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 8px; }
.ec-course-progress { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.ec-progress-text  { font-size: 12px; color: rgba(255,255,255,0.7); }
.ec-mini-progress  { height: 5px; width: 120px; background: rgba(255,255,255,0.2); border-radius: 99px; overflow: hidden; }
.ec-mini-bar { height: 100%; background: #22C55E; border-radius: 99px; transition: width 0.3s ease; }
.ec-exams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 20px;
}
.ec-exam-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition);
}
.ec-exam-card:hover { box-shadow: var(--shadow-md); }
.ec-exam-card.ec-final-exam { border: 2px solid #7C3AED; }
.ec-status-passed   { border-left: 4px solid var(--color-success) !important; }
.ec-status-failed   { border-left: 4px solid var(--color-danger) !important; }
.ec-status-available { border-left: 4px solid var(--color-accent) !important; }
.ec-status-locked   { border-left: 4px solid var(--color-border) !important; }
.ec-status-in_progress { border-left: 4px solid var(--color-warning) !important; }
.ec-exam-status-ribbon {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.ec-exam-body { padding: 16px; flex: 1; }
.ec-exam-term-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-light);
  border-radius: 99px;
  padding: 3px 10px;
  margin-bottom: 10px;
}
.ec-exam-title { font-size: 15px; font-weight: 600; color: var(--color-text-primary); margin-bottom: 12px; line-height: 1.4; }
.ec-exam-details { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.ec-detail-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--color-text-secondary); }
.ec-detail-item i { color: var(--color-accent); }
.ec-module-progress { margin-top: 12px; }
.ec-exam-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-surface);
}
.ec-result-display {
  text-align: center;
  padding: 8px 0;
  margin-bottom: 10px;
}
.ec-result-display.passed .ec-score { color: var(--color-success); }
.ec-result-display.failed .ec-score { color: var(--color-danger); }
.ec-score { font-size: 28px; font-weight: 800; line-height: 1; }
.ec-score-label { font-size: 12px; color: var(--color-text-secondary); margin-top: 3px; }
.ec-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.ec-btn:hover { text-decoration: none; opacity: 0.9; }
.ec-btn-primary { background: var(--color-accent); color: #fff; }
.ec-btn-success { background: var(--color-success); color: #fff; }
.ec-btn-warning { background: #F59E0B; color: #fff; }
.ec-btn-outline { background: transparent; color: var(--color-accent); border: 1.5px solid var(--color-accent); }
.ec-request-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
}
.ec-request-status.pending  { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.ec-request-status.rejected { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.ec-locked-message {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-secondary);
  background: var(--color-bg-surface);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--color-border);
}

/* Stats grid inside exam centre card */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.stat-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--color-bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}
.stat-box .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-box .stat-icon svg { width: 24px; height: 24px; }
.stat-box .stat-body { }
.stat-box .stat-value  { font-size: 24px; font-weight: 800; line-height: 1; margin-bottom: 3px; }
.stat-box .stat-label  { font-size: 12px; color: var(--color-text-secondary); }
.dashboard-stats-card { border: 1px solid var(--color-border); }

/* ── Exam Interface (take_exam.php) ──────────────────────────────── */
.exam-page { background: var(--color-bg-page); min-height: 100vh; }
.exam-topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--color-topnav);
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.exam-topbar__title { font-size: 14px; font-weight: 600; color: #fff; max-width: 400px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exam-topbar__center { display: flex; align-items: center; gap: 10px; }
.exam-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  padding: 6px 16px;
}
.exam-timer__icon { font-size: 16px; }
.exam-timer__display { font-size: 18px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; min-width: 58px; text-align: center; }
.exam-timer--warning .exam-timer__display { color: #FCD34D; }
.exam-timer--danger  .exam-timer__display { color: #FCA5A5; }
.exam-layout { display: flex; max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; gap: 20px; align-items: flex-start; }
.exam-sidebar { width: 220px; flex-shrink: 0; position: sticky; top: 82px; max-height: calc(100vh - 100px); overflow-y: auto; }
.exam-sidebar__card { background: var(--color-bg-card); border-radius: var(--radius-lg); border: 1px solid var(--color-border); box-shadow: var(--shadow-sm); padding: 16px; min-height: calc(100vh - 120px); }
.exam-sidebar__title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--color-text-secondary); margin-bottom: 12px; }
.q-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.q-nav__btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  background: var(--color-bg-surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.q-nav__btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.q-nav__btn--current { border-color: var(--color-accent); background: var(--color-accent); color: #fff; }
.q-nav__btn--answered { border-color: #22C55E; background: #DCFCE7; color: #15803D; }
.q-nav__btn--answered.q-nav__btn--current { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.q-nav__btn--skipped  { border-color: #D97706; background: #FEF3C7; color: #92400E; }
.q-nav__btn--skipped.q-nav__btn--current  { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.q-nav__btn--flagged  { outline: 2px solid #EF4444; outline-offset: 1px; }
.exam-sidebar__legend { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--color-text-secondary); }
.legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.legend-dot--current  { background: var(--color-accent); }
.legend-dot--answered { background: #22C55E; }
.legend-dot--skipped  { background: #D97706; }
.legend-dot--flagged  { background: #EF4444; }
.legend-dot--pending  { background: var(--color-border); border: 1px solid #CBD5E1; }
.exam-sidebar__progress { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--color-border); }
.progress-label { font-size: 11px; color: var(--color-text-secondary); margin-bottom: 6px; font-weight: 500; }
.progress-bar { height: 6px; background: var(--color-border); border-radius: 99px; overflow: hidden; }
.progress-bar__fill { height: 100%; background: var(--color-accent); border-radius: 99px; transition: width 0.3s ease; }
.exam-main { flex: 1; min-width: 0; }
.question-card { background: var(--color-bg-card); border-radius: var(--radius-lg); border: 1px solid var(--color-border); box-shadow: var(--shadow-sm); padding: 28px; margin-bottom: 16px; }
.question-card__header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.question-card__num { width: 32px; height: 32px; border-radius: 8px; background: var(--color-accent-light); color: var(--color-accent); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.question-card__text { font-size: 15px; font-weight: 500; color: var(--color-text-primary); line-height: 1.6; padding-top: 4px; }
.question-card__marks { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--color-text-secondary); background: var(--color-bg-surface); padding: 3px 10px; border-radius: 99px; white-space: nowrap; flex-shrink: 0; }
.options-grid { display: flex; flex-direction: column; gap: 10px; }
.option-tile { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; border-radius: var(--radius-md); border: 1.5px solid var(--color-border); background: var(--color-bg-card); cursor: pointer; transition: all var(--transition); user-select: none; }
.option-tile:hover { border-color: var(--color-accent); background: var(--color-accent-light); }
.option-tile__letter { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--color-border); background: var(--color-bg-surface); color: var(--color-text-secondary); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all var(--transition); }
.option-tile__text { font-size: 14px; color: var(--color-text-primary); line-height: 1.5; padding-top: 1px; }
.option-tile--selected { border-color: var(--color-accent); background: var(--color-accent); }
.option-tile--selected .option-tile__letter { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.2); color: #fff; }
.option-tile--selected .option-tile__text  { color: #fff; font-weight: 500; }
.option-tile--correct { border-color: #22C55E; background: var(--color-correct); pointer-events: none; }
.option-tile--correct .option-tile__letter { border-color: #22C55E; background: #22C55E; color: #fff; }
.option-tile--correct .option-tile__text   { color: var(--color-correct-text); font-weight: 500; }
.option-tile--incorrect { border-color: var(--color-danger); background: var(--color-incorrect); pointer-events: none; }
.option-tile--incorrect .option-tile__letter { border-color: var(--color-danger); background: var(--color-danger); color: #fff; }
.option-tile--incorrect .option-tile__text  { color: var(--color-incorrect-text); font-weight: 500; }
/* Question action row (skip/flag inside card) */
.question-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--color-border); }
.btn--flag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-md);
  font-size: 12px; font-weight: 600; cursor: pointer; border: 1.5px solid #D97706;
  background: #FEF3C7; color: #92400E; transition: all var(--transition);
}
.btn--flag:hover { background: #FDE68A; }
.btn--flag--active { background: #EF4444; border-color: #DC2626; color: #fff; }
.btn--flag--active:hover { background: #DC2626; }

/* Skip button */
.btn--skip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 18px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1.5px solid #D97706; background: #FEF3C7; color: #92400E;
  transition: all var(--transition);
}
.btn--skip:hover { background: #FDE68A; }

.exam-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; gap: 12px; }
.exam-nav__left  { display: flex; gap: 10px; flex-wrap: wrap; }
.exam-nav__right { display: flex; gap: 10px; margin-left: auto; }

/* ── Results Page ─────────────────────────────────────────────────── */
.result-summary { background: var(--color-bg-card); border-radius: var(--radius-lg); border: 1px solid var(--color-border); box-shadow: var(--shadow-sm); padding: 36px 28px; text-align: center; margin-bottom: 28px; }
.result-summary__score { font-size: 52px; font-weight: 800; color: var(--color-text-primary); line-height: 1; margin-bottom: 6px; }
.result-summary__score span { font-size: 28px; font-weight: 400; color: var(--color-text-secondary); }
.result-summary__percentage { font-size: 18px; font-weight: 600; color: var(--color-text-secondary); margin-bottom: 16px; }
.result-summary__badge { display: inline-flex; align-items: center; gap: 6px; padding: 8px 22px; border-radius: 99px; font-size: 15px; font-weight: 700; letter-spacing: 0.04em; margin-bottom: 20px; }
.result-summary__badge--pass { background: #DCFCE7; color: #15803D; }
.result-summary__badge--fail { background: #FEE2E2; color: #B91C1C; }
.result-summary__meta { display: flex; justify-content: center; gap: 32px; flex-wrap: wrap; }
.result-meta-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.result-meta-item__val   { font-size: 16px; font-weight: 700; color: var(--color-text-primary); }
.result-meta-item__label { font-size: 11px; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.review-list { display: flex; flex-direction: column; gap: 14px; }
.review-item { background: var(--color-bg-card); border-radius: var(--radius-lg); border: 1px solid var(--color-border); padding: 20px; box-shadow: var(--shadow-sm); }
.review-item__header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.review-item__num { width: 28px; height: 28px; border-radius: 7px; background: var(--color-bg-surface); color: var(--color-text-secondary); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.review-item__question { font-size: 14px; font-weight: 500; color: var(--color-text-primary); line-height: 1.5; }
.review-item__marks { margin-left: auto; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; flex-shrink: 0; }
.review-item__marks--earned { background: #DCFCE7; color: #15803D; }
.review-item__marks--zero   { background: #FEE2E2; color: #B91C1C; }
.review-item__answers { display: flex; flex-direction: column; gap: 6px; }
.review-answer { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13px; }
.review-answer__label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; min-width: 80px; color: var(--color-text-secondary); }
.review-answer--correct  { background: var(--color-correct);   color: var(--color-correct-text); font-weight: 500; }
.review-answer--incorrect { background: var(--color-incorrect); color: var(--color-incorrect-text); }
.review-answer--skipped  { background: #F1F5F9; color: var(--color-text-secondary); font-style: italic; }

/* ── Modal ────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.is-open { opacity: 1; pointer-events: all; }
.modal-card { background: #fff; border-radius: var(--radius-xl); padding: 32px 28px; max-width: 440px; width: 100%; box-shadow: var(--shadow-lg); }
.modal-card__icon { width: 52px; height: 52px; border-radius: 50%; background: #FEF9C3; display: flex; align-items: center; justify-content: center; font-size: 24px; margin: 0 auto 16px; }
.modal-card__title { font-size: 18px; font-weight: 700; text-align: center; color: var(--color-text-primary); margin-bottom: 8px; }
.modal-card__body  { font-size: 14px; color: var(--color-text-secondary); text-align: center; margin-bottom: 24px; line-height: 1.6; }
.modal-card__stats { display: flex; justify-content: center; gap: 24px; margin-bottom: 24px; padding: 14px; background: var(--color-bg-surface); border-radius: var(--radius-md); }
.modal-stat { text-align: center; }
.modal-stat__val   { font-size: 22px; font-weight: 700; color: var(--color-text-primary); }
.modal-stat__label { font-size: 11px; color: var(--color-text-secondary); font-weight: 500; }
.modal-card__actions { display: flex; gap: 10px; }
.modal-card__actions .btn { flex: 1; }

/* ── Empty State ─────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; background: var(--color-bg-card); border-radius: var(--radius-lg); border: 1px dashed var(--color-border); }
.empty-state__icon  { font-size: 48px; margin-bottom: 12px; }
.empty-state__title { font-size: 16px; font-weight: 600; color: var(--color-text-primary); margin-bottom: 6px; }
.empty-state__desc  { font-size: 13px; color: var(--color-text-secondary); }

/* ── Course / Modules section (from legacy student/module.php) ───── */
.course-section {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
}
.course-section h3 { font-size: 16px; font-weight: 600; color: var(--color-text-primary); margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.course-section h3 .section-icon { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.module-list { display: flex; flex-direction: column; gap: 10px; }
.module-item-legacy {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-surface);
  transition: background 0.18s, border-color 0.18s;
}
.module-item-legacy:hover { background: #ffffff; border-color: #C7D2FE; }
.module-icon { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%); color: #ffffff; font-size: 17px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.module-item-legacy .module-meta { flex: 1; min-width: 0; }
.module-item-legacy .module-title { font-size: 14px; font-weight: 600; color: var(--color-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.module-item-legacy .module-desc  { font-size: 12px; color: var(--color-text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.module-item-legacy .module-order { font-size: 11px; font-weight: 600; color: var(--color-text-secondary); background: var(--color-border); border-radius: 6px; padding: 2px 8px; flex-shrink: 0; }
.module-list .empty-state { text-align: center; padding: 28px 0; color: var(--color-text-secondary); font-size: 13px; }

/* ── Modules page top bar ────────────────────────────────────────── */
.modules-page { }

/* ── Notifications page ─────────────────────────────────────────── */
.text-center.py-5 { text-align: center; padding: 48px 0; }

/* ── Scrollbar ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: #CBD5E1; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .student-sidebar { transform: translateX(-100%); transition: transform 0.22s ease; }
  .student-sidebar.is-open { transform: translateX(0); }
  .topnav { padding-left: 16px !important; }
  .topnav__brand { width: auto; position: static; }
  main { margin-left: 0; }
  .page-container { margin-left: 0; }
}

@media (max-width: 768px) {
  .topnav__username { display: none; }
  .page-container { padding: 20px 16px 40px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .module-grid { grid-template-columns: 1fr 1fr; }
  .exam-grid  { grid-template-columns: 1fr; }
  .ec-exams-grid { grid-template-columns: 1fr; padding: 12px; }
  .form-row   { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
  .exam-layout { flex-direction: column; }
  .exam-sidebar { width: 100%; position: static; }
  .q-nav { grid-template-columns: repeat(6, 1fr); }
  .result-summary__meta { gap: 20px; }
  .result-summary__score { font-size: 40px; }
  .stats-grid { grid-template-columns: 1fr; }
  .row { margin: 0; }
  .row > * { padding: 0; flex: 0 0 100%; max-width: 100%; }
  .col-md-3, .col-md-6, .col-md-9, .col-md-12, .col-lg-2, .col-lg-10 { flex: 0 0 100%; max-width: 100%; }
  .d-none.d-md-block { display: none !important; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .module-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
  .exam-topbar { padding: 0 16px; }
  .exam-topbar__title { font-size: 12px; max-width: 160px; }
}

@media (min-width: 768px) {
  .d-none.d-md-block { display: block !important; }
}
