*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* ===== KANAF THEME ===== */
  --navy: #004346;       /* dark teal - dark surfaces / headers */
  --navy-light: #f2f2f2;  /* darkgreen - lighter dark surfaces */
  --navy-mid: #00564f;    /* teal-green - gradient midpoint */
  --gold: #FF8C00;        /* darkorange - primary accent / buttons */
  --gold-light: #FFA940;  /* lighter orange - hover state */
  --white: #FFFFFF;
  --gray-100: #f0f0f0;    /* light page background */
  --gray-200: #d3d3d3;    /* lightgray */
  --gray-400: #94A3B8;
  --gray-600: #64748B;
  --green: #228B22;       /* darkgreen success */
  --red: #EF4444;
  --blue: #3B82F6;
  --shadow: 0 4px 24px rgba(0,0,0,0.18);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.28);
}

/* ===== DARK MODE =====
   Most of this app's colors are hardcoded inline styles (style="...") or
   plain hex values scattered across this file, not CSS variables — so a
   "swap the variables" dark theme would miss the majority of the app.
   Instead, dark mode inverts the whole page's colors (light backgrounds
   become dark, dark text becomes light, and the navy/gold brand hues
   survive since hue-rotate(180deg) brings them back close to their
   original hue after the invert). Photos and the logo are inverted a
   second time so they cancel out and still look normal. Toggled by
   toggleDarkMode() in script.js, which adds/removes this class on <html>. */
html.dark-mode {
  filter: invert(1) hue-rotate(180deg);
  background: #fff;
}

html.dark-mode img {
  filter: invert(1) hue-rotate(180deg);
}

body {
  font-family: 'Inter', sans-serif;
  background: #f2f2f2;
  color: var(--navy);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== SCREENS ===== */

.screen {
  display: none;
}

.screen.active {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ===== PRINT / "DOWNLOAD RESULT" ===== */
/* Triggered by the Download Result button (window.print()). Hides
   everything on the page except the student's result card, so saving
   the print dialog as PDF gives a clean, single result slip. */
@media print {
  body * {
    visibility: hidden;
  }
  #result-card, #result-card * {
    visibility: visible;
  }
  #result-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    box-shadow: none;
    margin: 0;
  }
  .no-print {
    display: none !important;
  }
}

/* ===== GLOBAL FOOTER (shown below every screen) ===== */

.app-footer {
  background: #004346;
  padding: 1.1rem 2rem;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.12);
}

.app-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.app-footer-brand {
  color: rgba(255,255,255,0.85);
  font-size: 0.82rem;
  font-weight: 600;
}

.app-footer-credit {
  color: rgba(255,255,255,0.85);
  font-size: 0.82rem;
}

.app-footer-credit strong {
  color: var(--gold);
  font-weight: 700;
}

@media (max-width: 480px) {
  .app-footer {
    padding: 1rem;
    text-align: center;
  }
  .app-footer-inner {
    justify-content: center;
  }
}

/* ===== GLOBAL HEADER (shown above every screen) ===== */

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: #004346;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  z-index: 1000;
}

.app-header .navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.app-header .navbar-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  background: white;
}

.app-header .navbar-title {
  font-family: 'times new roman', sans-serif;
  font-weight: 700;
  color: #ffffff;
  font-size: 2.4rem;
}

.app-header .navbar-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.app-header .navbar-admin-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  background: transparent;
  border: 1.5px solid var(--gold);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.2s;
}

.app-header .navbar-admin-link:hover {
  background: var(--gold);
  color: #004346;
}

.app-header .navbar-admin-link.hidden {
  display: none;
}

.app-header .navbar-theme-btn {
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 0.5rem 0.7rem;
}

/* Every screen sits below the fixed header so nothing is ever hidden behind it. */
.screen {
  padding-top: 66px;
}

@media (max-width: 480px) {
  .app-header {
    padding: 0 1rem;
  }
  .app-header .navbar-title {
    font-size: 0.9rem;
  }
}

.landing-card {
  background: lightgray;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  max-width: 500px;
  width: 100%;
  text-align: center;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.logo-ring {
  width: 80px;
  height: 80px;
  border: 3px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
}
.logo-ring img{
  width:100px;
  height: 100px;
  border-radius: 50%;
}

.landing-card h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.09rem;
  color:darkgreen;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.landing-card .tagline {
  color: black;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ===== BUTTONS ===== */

.btn {
  padding: 0.9rem 1.5rem;
  border-radius: 12px;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy);
}

.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255,140,0,0.4);
}

.btn-secondary {
  background: transparent;
  color: darkgreen;
  border: 1.5px solid rgba(0,0,0,0.25);
}

.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-danger {
  background: var(--red);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-success {
  background: var(--green);
  color: white;
}

.btn-success:hover {
  background: #1f6b1f;
}

.btn-outline-white {
  background: transparent;
  color: white;
  border: 1.5px solid rgba(0,0,0,0.3);
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-blue {
  background: rgba(59,130,246,0.15);
  color: var(--blue);
  border: 1px solid rgba(59,130,246,0.3);
}

.btn-blue:hover {
  background: var(--blue);
  color: white;
}

/* ===== FORMS ===== */

.form-page {
  align-items: center;
  justify-content: center;
  padding: 2rem;
  padding-top: 90px;
  background: linear-gradient(135deg, #f2f2f2 0%, #f0f0f0 100%);
}

#screen-login {
  position: relative;
  overflow: hidden;
}

.welcome-heading {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.09rem;
  color: darkgreen;
  font-weight: 800;
  text-align: center;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

@media (max-width: 480px) {
  .welcome-heading {
    font-size: 1.6rem;
    margin-top: 0.5rem;
  }
}

.form-card {
  background: lightgray;
  color: #004346;
  border: 1px solid #004346;
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.form-card h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.form-card p.subtitle {
  color: var(--gray-400);
  font-size: 0.9rem;
  margin-bottom: 1.8rem;
}

/* ===== ADMIN CONTACT CARD (shown on login screen) ===== */

.admin-contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0, 67, 70, 0.06);
  border: 1px solid #004346;
  border-radius: 16px;
  padding: 1rem 1.2rem;
  max-width: 500px;
  width: 100%;
  margin-top: 1.2rem;
}

.admin-contact-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #004346;
  flex-shrink: 0;
}

.admin-contact-info {
  min-width: 0;
}

.admin-contact-name {
  font-weight: 700;
  color: #004346;
  font-size: 0.95rem;
}

.admin-contact-line {
  color: var(--gray-400);
  font-size: 0.85rem;
  word-break: break-word;
}

.admin-contact-link {
  display: block;
  color: #1877f2;
  font-weight: 600;
  text-decoration: none;
}

.admin-contact-link:hover {
  text-decoration: underline;
}

/* ===== CONTACT US PAGE (full page, no boxed card) ===== */

.contact-page {
  padding: 66px 0 0 !important;
  background: #f2f2f2;
}

.contact-hero {
  position: relative;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 2rem 1.5rem 2.4rem;
  text-align: center;
  color: white;
}

.contact-hero .back-link {
  position: absolute;
  top: 1.2rem;
  left: 1.2rem;
  margin-bottom: 0;
}

.contact-hero-eyebrow {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--gold-light);
  margin-bottom: 1.1rem;
  padding-top: 0.2rem;
}

.contact-hero-photo,
.contact-hero-photo-placeholder {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  margin: 0 auto 0.9rem;
  border: 3px solid var(--gold);
  box-shadow: 0 4px 18px rgba(0,0,0,0.25);
}

.contact-hero-photo {
  object-fit: cover;
}

.contact-hero-photo-placeholder {
  background: rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}

#my-profile-avatar {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
}

.contact-hero-name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
}

.contact-hero-role {
  color: var(--gold-light);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.contact-body {
  max-width: 460px;
  margin: 0 auto;
  padding: 1.8rem 1.5rem 2.5rem;
}

#contact-us-empty {
  color: var(--gray-400);
  font-size: 0.95rem;
}

.contact-section {
  margin-bottom: 1.8rem;
}

.contact-section-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 0.7rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 0;
  text-decoration: none;
  color: var(--navy);
  border-bottom: 1px solid rgba(0,67,70,0.1);
  transition: transform 0.15s;
}

.contact-row:last-child {
  border-bottom: none;
}

a.contact-row:hover {
  transform: translateX(4px);
}

.contact-row-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: rgba(0,67,70,0.08);
}

.contact-row-text {
  font-weight: 600;
  font-size: 0.92rem;
  word-break: break-word;
}

.contact-icons-row {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.contact-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 600;
}

.contact-icon-glyph {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  box-shadow: 0 3px 10px rgba(0,0,0,0.18);
  transition: transform 0.15s;
}

.contact-icon-btn:hover .contact-icon-glyph {
  transform: translateY(-3px);
}

.contact-icon-facebook .contact-icon-glyph {
  background: #1877F2;
  font-family: Georgia, 'times new roman', serif;
  font-weight: 800;
  font-style: italic;
}

.contact-icon-telegram .contact-icon-glyph {
  background: #29A9EA;
}

.contact-icon-whatsapp .contact-icon-glyph {
  background: #25D366;
}

@media (max-width: 480px) {
  .contact-hero {
    padding: 1.6rem 1rem 2rem;
  }
  .contact-body {
    padding: 1.5rem 1.1rem 2rem;
  }
}


/* ===== FULL PROFILE CARDS (Student + Admin, in the My History modal) ===== */

.profiles-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.profile-card {
  flex: 1 1 220px;
  background: rgba(0, 67, 70, 0.05);
  border: 1px solid #004346;
  border-radius: 16px;
  padding: 1.2rem 1rem;
  text-align: center;
}

.profile-card-header {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--navy);
  margin-bottom: 0.8rem;
}

.profile-avatar-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.6rem;
}

.profile-avatar-img {
  object-fit: cover;
  border: 2px solid #004346;
}

.profile-card-name {
  font-weight: 700;
  color: #004346;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.profile-card-line {
  font-size: 0.8rem;
  color: var(--gray-400);
  word-break: break-word;
  margin-bottom: 0.15rem;
}

.profile-card-stats {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed rgba(0, 67, 70, 0.25);
  font-size: 0.78rem;
  color: #004346;
  font-weight: 600;
}

/* ===== STUDENT COURSE LIST + CODE ENTRY ===== */

.course-select-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.course-select-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: white;
  border: 1px solid rgba(0,67,70,0.2);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, transform 0.15s;
}

.course-select-card:hover {
  border-color: #004346;
  transform: translateY(-2px);
}

.course-select-card .cs-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.course-select-card .cs-info {
  flex: 1;
}

.course-select-card .cs-name {
  font-weight: 700;
  font-size: 1rem;
  color: #004346;
}

.course-select-card .cs-meta {
  font-size: 0.78rem;
  color: #4b5563;
  margin-top: 0.2rem;
}

.course-code-card {
  background: white;
  border: 1px solid rgba(0,67,70,0.2);
  border-radius: 14px;
  padding: 1.5rem;
  text-align: center;
}

.course-code-icon {
  font-size: 2.4rem;
  margin-bottom: 0.4rem;
}

.course-code-card h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: #004346;
  margin-bottom: 0.8rem;
}

.course-instructions {
  list-style: none;
  text-align: left;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.2rem;
  font-size: 0.85rem;
  color: #004346;
}

.course-instructions li {
  padding: 0.25rem 0;
  display: flex;
  gap: 0.5rem;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #004346;
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border: 1.5px solid #004346;
  background: lightgray;
  color: #004346;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: border 0.2s;
  outline: none;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  background: rgba(255,140,0,0.06);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--gray-400);
}

.form-group select option {
  background: #f0f0f0;
}

.form-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #FCA5A5;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 1rem;
  display: none;
}

.form-error.show {
  display: block;
}

.form-error.notice-green {
  background: rgba(0, 100, 0, 0.1);
  border: 1px solid rgba(0, 100, 0, 0.35);
  color: darkgreen;
  font-weight: 600;
}

.form-success {
  background: rgba(34,139,34,0.1);
  border: 1px solid rgba(34,139,34,0.3);
  color: #86EFAC;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 1rem;
  display: none;
}

.form-success.show {
  display: block;
}

#settings-msg {
  color: darkgreen;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--gray-400);
  font-size: 0.85rem;
  cursor: pointer;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
  background: none;
  border: none;
}

.back-link:hover {
  color: var(--gold);
}

.admin-badge {
  display: inline-block;
  background: rgba(255,140,0,0.15);
  color: var(--gold);
  border: 1px solid rgba(255,140,0,0.3);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ===== COURSE SELECT ===== */

.course-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.course-card-select {
  padding: 1rem;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.1);
  background: lightgray;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.course-card-select:hover {
  border-color: darkgreen;
  background: rgba(255,140,0,0.06);
}

.course-card-select.selected {
  border-color: darkgreen;
  background: rgba(140,255,0,0.12);
}

.course-card-select .c-icon {
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}

.course-card-select .c-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--white);
}

.course-card-select .c-meta {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 0.2rem;
}

/* ===== EXAM ===== */

/* Blocks selecting/highlighting question text and options while a live
   exam is on screen (body.exam-no-copy is toggled by showScreen() in
   script.js). The copy/cut/selectstart/contextmenu JS guards back this
   up so copying isn't possible even via keyboard shortcuts. */
body.exam-no-copy .question-text,
body.exam-no-copy .options-list,
body.exam-no-copy .option-item {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#screen-exam {
  background: var(--gray-100);
  color: var(--navy);
  flex-direction: column;
}

.moodle-page-header {
  background: white;
  padding: 1.25rem 1.75rem 0.75rem;
  border-bottom: 1px solid var(--gray-200);
}

.moodle-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.moodle-brand-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.moodle-brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.moodle-brand-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

.moodle-brand-sub {
  font-size: 0.68rem;
  color: var(--gray-600);
  line-height: 1.2;
}

.moodle-back-pill {
  display: inline-block;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.18s;
  margin-bottom: 1rem;
}

.moodle-back-pill:hover {
  background: var(--gray-200);
}

.moodle-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.moodle-exam-heading {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.25;
}

.moodle-exam-subheading {
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-top: 0.4rem;
}

.moodle-timer-box {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  background: white;
}

.moodle-timer-label {
  font-size: 0.78rem;
  color: var(--gray-600);
  font-weight: 600;
}

.moodle-timer-value {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  transition: color 0.2s;
}

.moodle-timer-value.danger {
  color: #EF4444;
}

.exam-exit-link {
  margin-top: 0.35rem;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--gray-400);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.exam-exit-link:hover {
  color: #ffffff;
}


/* ===== EXAM PROFILE MENU (avatar + chevron dropdown) ===== */

.exam-profile {
  position: relative;
}

.exam-profile-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.2rem;
}

.exam-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.exam-profile-chevron {
  color: white;
  font-size: 0.9rem;
  line-height: 1;
  transition: transform 0.18s;
}

.exam-profile.open .exam-profile-chevron {
  transform: rotate(180deg);
}

.exam-profile-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: white;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  min-width: 230px;
  padding: 0.6rem;
  z-index: 50;
}

.exam-profile-menu.show {
  display: block;
}

.exam-profile-menu-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem 0.5rem 0.8rem;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 0.4rem;
}

.exam-avatar-lg {
  width: 44px;
  height: 44px;
  font-size: 0.95rem;
}

.exam-profile-menu-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy);
}

.exam-profile-menu-id {
  font-size: 0.75rem;
  color: var(--gray-600);
  margin-top: 0.1rem;
}

.exam-profile-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0.65rem 0.5rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: background 0.15s;
}

.exam-profile-menu-item:hover {
  background: var(--gray-100);
}

.exam-profile-menu-item.danger {
  color: #C0392B;
}

.exam-profile-menu-static {
  cursor: default;
  color: var(--gray-600);
}

.exam-profile-menu-static:hover {
  background: transparent;
}

.exam-progress-bar {
  height: 4px;
  background: var(--gray-200);
}

.exam-progress-fill {
  height: 100%;
  background: var(--gold);
  transition: width 0.3s;
}

/* ===== MOODLE-STYLE QUIZ BODY (sidebar + main) ===== */

.moodle-quiz-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.moodle-sidebar {
  flex-shrink: 0;
  width: 190px;
}

.moodle-q-info-box {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.moodle-q-info-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.moodle-q-info-status {
  font-size: 0.78rem;
  color: var(--gray-600);
  font-weight: 600;
}

.moodle-q-info-status.answered {
  color: var(--green);
}

.moodle-q-info-marks {
  font-size: 0.76rem;
  color: var(--gray-600);
  margin-top: 0.35rem;
  margin-bottom: 0.85rem;
}

.moodle-flag-btn {
  width: 100%;
  background: transparent;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.18s;
}

.moodle-flag-btn:hover {
  border-color: var(--gold);
  color: var(--navy);
}

.moodle-flag-btn.flagged {
  background: rgba(255,140,0,0.12);
  border-color: var(--gold);
  color: var(--navy);
}

.moodle-main {
  flex: 1;
  min-width: 0;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.5rem;
}

.question-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s;
  font-weight: 400;
  color: var(--navy);
}

.option-item:hover {
  background: var(--gray-100);
}

.option-item.selected {
  background: rgba(59,130,246,0.08);
  border-color: rgba(59,130,246,0.25);
}

.option-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--gray-400);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s;
}

.option-item.selected .option-radio {
  border-color: var(--blue);
}

.option-radio-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.15s;
}

.option-item.selected .option-radio-dot {
  opacity: 1;
  transform: scale(1);
}

.option-label-letter {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--navy);
}

.option-label-text {
  color: var(--navy);
}

.moodle-page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-200);
}

.btn-nav {
  padding: 0.65rem 1.4rem;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
}

.btn-prev {
  background: var(--gray-200);
  color: var(--navy);
}

.btn-prev:hover {
  background: var(--gray-400);
}

.btn-next-q {
  background: var(--blue);
  color: white;
}

.btn-next-q:hover {
  background: #2563eb;
}

.btn-submit-exam {
  background: var(--green);
  color: white;
}

.btn-submit-exam:hover {
  background: #1f6b1f;
}

/* ===== QUIZ NAVIGATION (full-width block below the main quiz body) ===== */

.moodle-quiznav-block {
  background: white;
  border-top: 1px solid var(--gray-200);
  padding: 1.25rem 1.5rem 1.75rem;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.moodle-quiznav-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.85rem;
}

.q-nav-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.q-nav-item {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  border: 2px solid var(--gray-200);
  background: white;
  color: var(--navy);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.q-nav-item:hover {
  border-color: var(--gold);
}

.q-nav-item.answered {
  background: rgba(45,140,66,0.12);
  border-color: var(--green);
  color: var(--green);
}

.q-nav-item.current {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
}

.q-nav-item.flagged::after {
  content: '';
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #EF4444;
  border: 1.5px solid white;
}

@media (max-width: 700px) {
  .moodle-quiz-body {
    flex-direction: column;
  }
  .moodle-sidebar {
    width: 100%;
  }
  .moodle-q-info-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    gap: 0.75rem;
  }
  .moodle-q-info-marks {
    display: none;
  }
  .moodle-flag-btn {
    width: auto;
    flex-shrink: 0;
  }
}

/* ===== RESULT ===== */

#screen-result {
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
}

.result-card {
  background: lightgray;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  max-width: 520px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.result-score-ring {
  width: 140px;
  height: 140px;
  margin: 0 auto 1.5rem;
  position: relative;
}

.result-score-ring svg {
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
}

.result-score-ring svg circle {
  fill: none;
  stroke-width: 10;
}

.result-score-ring .bg {
  stroke: rgba(255,255,255,0.08);
}

.result-score-ring .fill {
  stroke: var(--gold);
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s ease;
}

.result-score-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.result-score-text .pct {
  font-family: 'Montserrat', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
}

.result-score-text .lbl {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.result-card h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.result-card p {
  color: var(--gray-400);
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
}

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-box {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 1rem 0.5rem;
  border: 1px solid rgba(255,255,255,0.07);
}

.stat-box .num {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
}

.stat-box .lbl {
  font-size: 0.72rem;
  color: var(--gray-400);
  margin-top: 0.2rem;
}

.stat-box.correct .num {
  color: var(--green);
}

.stat-box.wrong .num {
  color: var(--red);
}

.stat-box.total .num {
  color: var(--gold);
}

.result-status {
  padding: 0.7rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
  display: inline-block;
}

.status-pass {
  background: rgba(34,139,34,0.15);
  color: var(--green);
  border: 1px solid rgba(34,139,34,0.3);
}

.status-fail {
  background: rgba(239,68,68,0.15);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.3);
}

.submitted-note {
  background: rgba(255,140,0,0.08);
  border: 1px solid rgba(255,140,0,0.2);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.83rem;
  color: var(--gold-light);
}

/* ===== BLOCKED ===== */

#screen-blocked {
  align-items: center;
  justify-content: center;
  padding: 2rem;
  padding-top: 90px;
  background: linear-gradient(135deg, var(--navy) 0%, #1a0a0a 100%);
}

.blocked-card {
  background: lightgray;
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  max-width: 460px;
  width: 100%;
  text-align: center;
  margin: auto;
}

.blocked-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.blocked-card h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--red);
  margin-bottom: 0.75rem;
}

.blocked-card p {
  color: var(--gray-400);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ===== ADMIN ===== */

#screen-admin {
  background: var(--gray-100);
  color: var(--navy);
  flex-direction: column;
}

.admin-header {
  background: var(--navy);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-header h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.admin-header span {
  font-size: 0.8rem;
  color: var(--gray-400);
}

.admin-tabs {
  background: #f0f0f0;
  border-bottom: 2px solid var(--gray-200);
  display: flex;
  padding: 0 2rem;
  overflow-x: auto;
}

.tab-btn {
  padding: 1rem 1.25rem;
  border: none;
  background: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--navy);
}

.tab-btn.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.admin-body {
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-stat-card {
  background: lightgray;
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border-left: 4px solid var(--gold);
}

.admin-stat-card .label {
  font-size: 0.78rem;
  color: var(--gray-600);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-stat-card .value {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--navy);
}

.admin-stat-card.pass {
  border-left-color: var(--green);
}

.admin-stat-card.fail {
  border-left-color: var(--red);
}

.admin-stat-card.courses {
  border-left-color: var(--blue);
}

.section-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1rem;
}

.results-table-wrap {
  background: #f0f0f0;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  max-height: 65vh;
  overflow: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
}

.results-table thead {
  background: var(--navy);
  color: white;
  position: sticky;
  top: 0;
  z-index: 1;
}

.results-table th {
  padding: 0.9rem 1rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.results-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.88rem;
  color: var(--navy);
}

.results-table tr:last-child td {
  border-bottom: none;
}

.results-table tr:hover td {
  background: var(--gray-100);
}

.dept-group-row td {
  background: #004346;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
  letter-spacing: 0.02em;
}

.dept-group-row:hover td {
  background: #004346;
}

.badge {
  display: inline-block;
  padding: 0.22rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-pass {
  background: rgba(34,139,34,0.1);
  color: #1f6b1f;
}

.badge-fail {
  background: rgba(239,68,68,0.1);
  color: #dc2626;
}

.badge-course {
  background: rgba(59,130,246,0.1);
  color: var(--blue);
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--gray-400);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.clear-btn {
  background: rgba(239,68,68,0.1);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.25);
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.clear-btn:hover {
  background: var(--red);
  color: white;
}

/* ===== COURSE MANAGER ===== */

.dept-folder-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 1.8rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.dept-folder-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md, 0 6px 16px rgba(0,0,0,0.08));
  border-color: #004346;
}

.dept-folder-icon {
  font-size: 2.2rem;
  margin-bottom: 0.6rem;
}

.dept-folder-name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: #004346;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.dept-folder-count {
  font-size: 0.8rem;
  color: var(--gray-600);
}

.courses-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.course-mgr-card {
  background: lightgray;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border-top: 4px solid var(--gold);
  position: relative;
}

.course-mgr-card .c-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.course-mgr-card .c-icon-big {
  font-size: 2rem;
}

.course-mgr-card .c-actions {
  display: flex;
  gap: 0.4rem;
}

.course-mgr-card h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.3rem;
}

.course-mgr-card .c-desc {
  font-size: 0.82rem;
  color: var(--gray-600);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.course-mgr-card .c-stats {
  display: flex;
  gap: 1rem;
}

.course-mgr-card .c-stat {
  font-size: 0.78rem;
  color: var(--gray-600);
}

.c-quick-settings {
  margin-top: 0.9rem;
  padding: 0.7rem 0.85rem;
  background: #f8fafc;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.c-quick-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #004346;
}

.c-stepper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.c-stepper button {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--gray-300, #cbd5e1);
  background: white;
  color: #004346;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}

.c-stepper button:hover {
  background: #e2f3f3;
}

.c-stepper span {
  min-width: 48px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-700, #334155);
}

.course-mgr-card .c-stat strong {
  color: var(--navy);
  font-weight: 700;
}

.course-mgr-card .c-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 0.5rem;
}

.btn-manage-q {
  flex: 1;
  padding: 0.5rem;
  border-radius: 8px;
  border: none;
  background: rgba(255,140,0,0.12);
  color: #92651a;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-manage-q:hover {
  background: var(--gold);
  color: var(--navy);
}

.btn-edit-c {
  padding: 0.35rem 0.7rem;
  border-radius: 7px;
  border: 1px solid rgba(59,130,246,0.3);
  background: rgba(59,130,246,0.08);
  color: var(--blue);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-edit-c:hover {
  background: var(--blue);
  color: white;
}

.btn-del-c {
  padding: 0.35rem 0.7rem;
  border-radius: 7px;
  border: 1px solid rgba(239,68,68,0.25);
  background: rgba(239,68,68,0.08);
  color: var(--red);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-del-c:hover {
  background: var(--red);
  color: white;
}

/* ===== QUESTION MANAGER ===== */

.q-panel-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.q-panel-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--blue);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.q-panel-back:hover {
  background: var(--blue);
  color: white;
}

.q-panel-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}

.q-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.q-card {
  background: lightgray;
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border-left: 4px solid var(--gold);
}

.q-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.q-card-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}

.q-card-text {
  font-weight: 600;
  color: var(--navy);
  font-size: 0.9rem;
  line-height: 1.4;
}

.q-card-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 1rem;
  margin-top: 0.6rem;
}

.q-card-opt {
  font-size: 0.78rem;
  color: var(--gray-600);
}

.q-card-opt.correct {
  color: var(--green);
  font-weight: 700;
}

.q-card-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.btn-edit-q {
  background: rgba(59,130,246,0.1);
  color: var(--blue);
  border: 1px solid rgba(59,130,246,0.2);
  padding: 0.3rem 0.65rem;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}

.btn-edit-q:hover {
  background: var(--blue);
  color: white;
}

.btn-del-q {
  background: rgba(239,68,68,0.1);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
  padding: 0.3rem 0.65rem;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}

.btn-del-q:hover {
  background: var(--red);
  color: white;
}

/* ===== SETTINGS ===== */

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.settings-card {
  background: lightgray;
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.settings-card h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.setting-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.setting-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
}

.setting-hint {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 0.1rem;
}

.setting-input {
  width: 75px;
  padding: 0.4rem 0.6rem;
  border-radius: 7px;
  border: 1.5px solid var(--gray-200);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
  text-align: center;
  outline: none;
}

.setting-input:focus {
  border-color: var(--gold);
}

.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--gray-200);
  border-radius: 24px;
  transition: 0.3s;
}

.toggle-slider:before {
  position: absolute;
  content: '';
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #f0f0f0;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider {
  background: var(--gold);
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* ===== MODAL ===== */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: white;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 2rem;
  max-width: 580px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  max-height: 92vh;
  overflow-y: auto;
}

#submit-modal .modal,
#course-modal .modal {
  background: lightgray;
}

.course-modal-divider {
  font-weight: 700;
  font-size: 0.85rem;
  color: #004346;
  border-top: 1px solid rgba(0,67,70,0.2);
  margin: 1.2rem 0 0.8rem;
  padding-top: 1rem;
}

.modal h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.modal p.modal-sub {
  color: var(--gray-400);
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}

.modal-center {
  text-align: center;
}

.modal-center h3 {
  margin-bottom: 0.5rem;
}

.modal-center p {
  color: var(--gray-400);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.modal-btns {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.modal-btns .btn {
  flex: 1;
}

.opts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.correct-select {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.correct-btn {
  padding: 0.4rem 1rem;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.15);
  background: transparent;
  color: var(--gray-400);
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.correct-btn.active {
  border-color: var(--green);
  color: var(--green);
  background: rgba(34,139,34,0.1);
}

.results-filter {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-select {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1.5px solid var(--gray-200);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--navy);
  background: #f0f0f0;
  outline: none;
  cursor: pointer;
}

/* ===== RESULT ACTIONS ===== */

.result-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.result-actions .btn {
  flex: 1;
  min-width: 140px;
}

/* ===== REVIEW SCREEN ===== */

#screen-review {
  background: var(--gray-100);
  color: var(--navy);
  flex-direction: column;
}

.review-header {
  background: var(--navy);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.review-header-info h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.review-header-info p {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 0.1rem;
}

.review-body {
  flex: 1;
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.review-card {
  background: lightgray;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  border-left: 5px solid var(--gray-200);
}

.review-card.correct {
  border-left-color: var(--green);
}

.review-card.wrong {
  border-left-color: var(--red);
}

.review-card.skipped {
  border-left-color: var(--gray-400);
}

.review-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.review-q-num {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-600);
  margin-bottom: 0.3rem;
}

.review-q-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.5;
}

.review-badge {
  flex-shrink: 0;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.review-badge.correct {
  background: rgba(34,139,34,0.12);
  color: #1f6b1f;
}

.review-badge.wrong {
  background: rgba(239,68,68,0.12);
  color: #dc2626;
}

.review-badge.skipped {
  background: rgba(148,163,184,0.15);
  color: var(--gray-600);
}

.review-opts {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.review-opt {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.9rem;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--navy);
  background: var(--gray-100);
  border: 2px solid transparent;
}

.review-opt.is-correct {
  background: rgba(34,139,34,0.08);
  border-color: var(--green);
  color: #1f6b1f;
  font-weight: 700;
}

.review-opt.is-student-wrong {
  background: rgba(239,68,68,0.08);
  border-color: var(--red);
  color: #dc2626;
}

.review-opt-letter {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--gray-200);
  color: var(--navy);
  flex-shrink: 0;
}

.review-opt.is-correct .review-opt-letter {
  background: var(--green);
  color: white;
}

.review-opt.is-student-wrong .review-opt-letter {
  background: var(--red);
  color: white;
}

.review-opt-tag {
  margin-left: auto;
  font-size: 0.72rem;
  opacity: 0.8;
}

/* ===== QUESTION TYPE SELECTOR ===== */

.qtype-select {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.qtype-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.12);
  background: transparent;
  color: var(--gray-400);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.qtype-btn.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(255,140,0,0.08);
}

/* ===== RESPONSIVE ===== */

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

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .opts-grid {
    grid-template-columns: 1fr;
  }

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

  .moodle-quiz-body {
    padding: 1rem;
  }

  .moodle-main {
    padding: 1rem;
  }

  .moodle-quiznav-block {
    padding: 1rem 1rem 1.25rem;
  }

  .moodle-page-header {
    padding: 1rem 1.1rem 0.6rem;
  }

  .moodle-exam-heading {
    font-size: 1.2rem;
  }

  .moodle-heading-row {
    flex-direction: column;
    align-items: stretch;
  }

  .moodle-timer-box {
    align-self: flex-start;
  }

  .admin-body {
    padding: 1rem;
  }

  .admin-tabs {
    padding: 0 0.5rem;
  }

  .tab-btn {
    padding: 0.75rem 0.75rem;
    font-size: 0.8rem;
  }
}

/* ===== COURSE HIDE/SHOW ===== */

.btn-toggle-c {
  border: none;
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-toggle-visible {
  background: rgba(239,68,68,0.12);
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.25);
}

.btn-toggle-visible:hover {
  background: rgba(239,68,68,0.22);
}

.btn-toggle-hidden {
  background: rgba(34,139,34,0.12);
  color: #22c55e;
  border: 1px solid rgba(34,139,34,0.25);
}

.btn-toggle-hidden:hover {
  background: rgba(34,139,34,0.22);
}

.course-hidden-card {
  opacity: 0.65;
  border: 2px dashed rgba(239,68,68,0.35) !important;
}

.hidden-badge {
  display: inline-block;
  background: rgba(239,68,68,0.12);
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  margin-bottom: 0.4rem;
}
