/**
 * Student app — sidebar shell (mirrors admin panel structure).
 */

:root {
  --student-sidebar-w: 260px;
  --student-sidebar-bg: #0a1d4a;
  --student-sidebar-bg-grad: linear-gradient(180deg, #0a1d4a 0%, #102560 60%, #1e3a8a 100%);
  --student-sidebar-border: rgba(148, 163, 184, 0.14);
  --student-sidebar-text: #c4cce4;
  --student-sidebar-heading: #8a96b8;
  --student-sidebar-active-bg: rgba(255, 153, 51, 0.16);
  --student-sidebar-active-fg: #ffffff;
  --student-topbar-h: 56px;
  --student-content-max: 1180px;
}

html,
body.student-body {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

html::-webkit-scrollbar,
body.student-body::-webkit-scrollbar,
body.student-body *::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent !important;
}

html::-webkit-scrollbar-button,
body.student-body::-webkit-scrollbar-button,
body.student-body *::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

html::-webkit-scrollbar-thumb,
body.student-body::-webkit-scrollbar-thumb,
body.student-body *::-webkit-scrollbar-thumb {
  background: transparent !important;
}

html::-webkit-scrollbar-track,
body.student-body::-webkit-scrollbar-track,
body.student-body *::-webkit-scrollbar-track {
  background: transparent !important;
}

.student-body {
  min-height: 100vh;
}

.student-body.has-sidebar {
  overflow-x: hidden;
}

.student-shell {
  display: flex;
  min-height: 100vh;
  background:
    radial-gradient(900px 360px at 100% 0%, rgba(255, 153, 51, 0.06), transparent 65%),
    radial-gradient(800px 320px at 0% 100%, rgba(19, 136, 8, 0.05), transparent 60%),
    var(--bg);
}

.student-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--student-sidebar-w);
  z-index: 100;
  background: var(--student-sidebar-bg-grad);
  color: var(--student-sidebar-text);
  border-right: 1px solid var(--student-sidebar-border);
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.student-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.05rem 1rem 1.1rem;
  border-bottom: 1px solid var(--student-sidebar-border);
  color: #f1f5f9;
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  position: relative;
}

.student-sidebar__brand::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--saffron), var(--saffron-dark));
  opacity: 0.92;
}

.student-sidebar__brand:hover {
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
}

.student-sidebar__brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffd58a, var(--saffron) 55%, #c9690a 100%);
  color: #fff;
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0;
  line-height: 1;
  font-family: "Georgia", "Times New Roman", serif;
  box-shadow: 0 4px 10px rgba(232, 122, 19, 0.32), inset 0 0 0 2px #ffffff;
  flex-shrink: 0;
}

.student-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0 1.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.student-sidebar__nav::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.student-sidebar__nav::-webkit-scrollbar-button {
  display: none;
}

.student-nav-group {
  margin-top: 1rem;
  padding: 0 0.65rem;
}

.student-nav-group:first-child {
  margin-top: 0.35rem;
}

.student-nav-group__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--student-sidebar-heading);
  padding: 0.35rem 0.5rem 0.5rem;
}

.student-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem 0.55rem 0.85rem;
  border-radius: 8px;
  color: var(--student-sidebar-text);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 2px;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.student-nav__link:hover {
  color: var(--student-sidebar-active-fg);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.student-nav__link.is-active {
  color: #fff;
  background: var(--student-sidebar-active-bg);
  border-color: rgba(255, 153, 51, 0.32);
  font-weight: 700;
}

.student-nav__link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--saffron), var(--saffron-dark));
}

.student-nav__link:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 2px;
}

.student-nav__badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
}

.student-sidebar__footer {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--student-sidebar-border);
  font-size: 0.8rem;
  color: var(--student-sidebar-heading);
}

.student-sidebar__user {
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
  word-break: break-word;
}

.student-sidebar__home {
  display: block;
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
  color: #94a3b8;
  text-decoration: none;
}

.student-sidebar__home:hover {
  color: #fff;
  text-decoration: underline;
}

.student-sidebar__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.84rem;
  text-decoration: none;
}

.student-sidebar__logout:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fecaca;
  text-decoration: none;
}

.student-main {
  flex: 1;
  margin-left: var(--student-sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.student-topbar__menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.student-topbar__menu:hover {
  background: #eef2f7;
}

.student-topbar__menu-line {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  margin: 3px 0;
}

.student-scroll {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Tricolor strip at the top of every student page — matches the homepage */
.student-scroll::before {
  content: "";
  display: block;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg,
    var(--saffron) 0%, var(--saffron) 33.33%,
    #ffffff 33.33%, #ffffff 66.66%,
    var(--portal-green) 66.66%, var(--portal-green) 100%);
  flex-shrink: 0;
}

.student-page {
  flex: 1;
  width: 100%;
  max-width: var(--student-content-max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.25rem;
}

.student-page .alert:first-child {
  margin-top: 0;
}

.student-page .data-table {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.student-page .data-table th,
.student-page .data-table td {
  padding: 0.65rem 0.75rem;
}

.student-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.student-shell--sidebar-open .student-sidebar-backdrop {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 900px) {
  .student-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }

  .student-shell--sidebar-open .student-sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.25);
  }

  .student-main {
    margin-left: 0;
  }

  .student-topbar__menu {
    display: inline-flex;
    flex-direction: column;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 95;
  }
}

@media print {
  .student-sidebar,
  .student-sidebar-backdrop,
  .student-topbar__menu {
    display: none !important;
  }

  .student-main {
    margin-left: 0 !important;
  }

  .student-page {
    padding: 0;
    max-width: none;
  }
}

/* =========================================================================
   Student internship design system — applies to every page rendered inside
   .student-page (the content wrapper from includes/student_header.php).
   Targets existing markup so individual pages need no changes.
   ========================================================================= */

/* Page hero — first h1 becomes a polished page header. */
.student-page > h1:first-of-type {
  margin: 0 0 0.4rem;
  font-size: clamp(1.5rem, 2.5vw, 1.9rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.025em;
  line-height: 1.18;
  position: relative;
  padding-left: 0.95rem;
}

.student-page > h1:first-of-type::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--saffron), var(--saffron-dark));
}

.student-page > h1:first-of-type + p.muted {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.96rem;
  max-width: 72ch;
  padding-left: 0.95rem;
}

.student-page > h1:first-of-type + p.muted + .grid,
.student-page > h1:first-of-type + p.muted + .card,
.student-page > h1:first-of-type + p.muted + table,
.student-page > h1:first-of-type + .grid,
.student-page > h1:first-of-type + .card,
.student-page > h1:first-of-type + table {
  margin-top: 0.25rem;
}

/* Cards — richer surface on student pages. */
.student-page .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  padding: 1.25rem 1.35rem;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.student-page .card:hover {
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.student-page .card > h2:first-child,
.student-page .card > h3:first-child {
  margin: 0 0 0.85rem;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.student-page .card > h2:first-child::before,
.student-page .card > h3:first-child::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--saffron), var(--saffron-dark));
  box-shadow: 0 0 0 3px rgba(255, 153, 51, 0.18);
}

/* Stat blocks — used heavily on dashboard. */
.student-page .stat-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.student-page .stat {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 0.15rem;
}

/* Forms — inputs feel modern. */
.student-page label {
  display: block;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text);
  margin: 0.85rem 0 0.3rem;
}

.student-page .card > form > label:first-child,
.student-page .card label:first-of-type {
  margin-top: 0;
}

.student-page input[type="text"],
.student-page input[type="email"],
.student-page input[type="url"],
.student-page input[type="password"],
.student-page input[type="number"],
.student-page input[type="date"],
.student-page input[type="datetime-local"],
.student-page input[type="search"],
.student-page input[type="tel"],
.student-page input[type="file"],
.student-page select,
.student-page textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.student-page input[type="file"] {
  padding: 0.5rem 0.6rem;
  background: #f8fafc;
}

.student-page textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.student-page input:focus,
.student-page select:focus,
.student-page textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.student-page .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Buttons inside student pages get slightly nicer hover. */
.student-page .btn {
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.student-page .btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.student-page .btn-primary:hover {
  box-shadow: 0 6px 14px rgba(29, 78, 216, 0.22);
}

/* Tables — internship-themed. */
.student-page .data-table {
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  width: 100%;
}

.student-page .card .data-table {
  border: none;
  border-radius: 0;
  background: transparent;
}

.student-page .data-table thead th {
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.student-page .data-table tbody td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
}

.student-page .data-table tbody tr:last-child td {
  border-bottom: none;
}

.student-page .data-table tbody tr:hover {
  background: rgba(29, 78, 216, 0.035);
}

/* Badge / status pills used by tasks, doubts, notifications, etc. */
.student-page .badge-pill {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: capitalize;
  background: rgba(29, 78, 216, 0.1);
  color: var(--accent);
  border: 1px solid rgba(29, 78, 216, 0.2);
}

.student-page .badge-pill.badge-warn {
  background: rgba(194, 65, 12, 0.1);
  color: var(--warn);
  border-color: rgba(194, 65, 12, 0.22);
}

.student-page .badge-pill.badge-success,
.student-page .badge-pill.badge-ok {
  background: rgba(21, 128, 61, 0.1);
  color: var(--success);
  border-color: rgba(21, 128, 61, 0.22);
}

.student-page .badge-pill[class*="reject"],
.student-page .badge-pill[class*="closed"],
.student-page .badge-pill.badge-error,
.student-page .badge-pill.badge-danger {
  background: rgba(185, 28, 28, 0.1);
  color: var(--error);
  border-color: rgba(185, 28, 28, 0.22);
}

/* Alerts — softer and accent-themed. */
.student-page .alert {
  border-radius: 12px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  margin: 0 0 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.student-page .alert-error,
.student-page .alert.alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.student-page .alert-success,
.student-page .alert.alert-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.student-page .alert-info,
.student-page .alert.alert-info {
  background: #ecfeff;
  border-color: #a5f3fc;
  color: #155e75;
}

/* Progress bar polish. */
.student-page .progress-bar {
  height: 8px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
  border: none;
}

.student-page .progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Grids — restate so they always work even where the global rules aren't loaded yet. */
.student-page .grid { display: grid; gap: 1rem; }
@media (min-width: 800px) {
  .student-page .grid-2 { grid-template-columns: 1fr 1fr; }
  .student-page .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Quick-links rows — turn .card > p with btn-ghosts into a wrapping toolbar. */
.student-page .card > p > .btn + .btn { margin-left: 0.3rem; }

/* Doubt thread styling polish (existing classes from doubts.php). */
.student-page .doubt-thread {
  padding: 1rem 0;
  border-bottom: 1px dashed var(--border);
}
.student-page .doubt-thread:last-child { border-bottom: none; padding-bottom: 0; }
.student-page .doubt-thread__header {
  display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap;
}
.student-page .doubt-thread__title { margin: 0; font-size: 1rem; font-weight: 700; color: var(--text); }
.student-page .doubt-thread__meta { color: var(--muted); font-size: 0.82rem; margin: 0.25rem 0 0.65rem; }
.student-page .doubt-thread__q-label,
.student-page .doubt-reply__label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
  color: var(--muted); margin-bottom: 0.35rem; display: block;
}
.student-page .doubt-thread__q-body {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font-size: 0.93rem;
  line-height: 1.55;
}
.student-page .doubt-reply {
  margin-top: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: rgba(29, 78, 216, 0.05);
  border: 1px solid rgba(29, 78, 216, 0.18);
}
.student-page .doubt-reply__body { font-size: 0.93rem; line-height: 1.55; }
.student-page .doubt-reply__meta { color: var(--muted); font-size: 0.78rem; margin-top: 0.35rem; }

/* Leaderboard rank styling */
.student-page .leader-rank {
  font-weight: 800;
  color: var(--accent);
  width: 2.25rem;
}
.student-page .data-table tbody tr:nth-child(1) .leader-rank { color: #d97706; }
.student-page .data-table tbody tr:nth-child(2) .leader-rank { color: #6b7280; }
.student-page .data-table tbody tr:nth-child(3) .leader-rank { color: #b45309; }

/* Certificate frame polish. */
.student-page .cert-frame {
  background: linear-gradient(160deg, #ffffff 0%, #fff5e6 60%, #f0fdf4 100%);
  border: 2px solid rgba(232, 122, 19, 0.4);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  padding: 2.25rem 2rem;
  position: relative;
  overflow: hidden;
}
.student-page .cert-frame::before,
.student-page .cert-frame::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 153, 51, 0.18), transparent 70%);
  pointer-events: none;
}
.student-page .cert-frame::before { top: -90px; left: -90px; }
.student-page .cert-frame::after { bottom: -90px; right: -90px; }
.student-page .cert-frame > * { position: relative; }

/* "← Dashboard" / generic back link */
.student-page > p > a[href*="index.php"]:first-child {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.student-page > p > a[href*="index.php"]:first-child:hover { text-decoration: underline; }

/* =========================================================================
   Checklist (career toolkit + curriculum)
   ========================================================================= */
.s-checklist {
  margin: 1.25rem 0;
  background: linear-gradient(160deg, #ffffff 0%, #eff6ff 75%, #ecfeff 100%);
  border: 1px solid rgba(29, 78, 216, 0.18);
}

.s-checklist__head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.s-checklist__eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.s-checklist__title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.s-checklist__title-wrap::before {
  display: none !important;
}

.s-checklist__sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  max-width: 60ch;
}

.s-checklist__progress {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 110px;
  text-align: right;
}

.s-checklist__pct {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.s-checklist__count {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  margin-top: 0.2rem;
}

.s-checklist__bar {
  margin-bottom: 1rem;
}

.s-checklist__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.s-checklist__item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.s-checklist__item:hover {
  border-color: rgba(29, 78, 216, 0.4);
  background: var(--surface-muted);
}

.s-checklist__row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.s-checklist__cb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 0.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.s-checklist__cb:hover {
  border-color: var(--accent);
}

.s-checklist__cb:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.s-checklist__cb:checked {
  background: linear-gradient(135deg, var(--success), #166534);
  border-color: var(--success);
}

.s-checklist__cb:checked::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) translate(-1px, -1px);
}

.s-checklist__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.s-checklist__label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.s-checklist__desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.s-checklist__steps {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 0.35rem;
  font-weight: 500;
}

.s-checklist__meta {
  font-size: 0.74rem;
  color: var(--success);
  font-weight: 600;
  margin-top: 0.15rem;
}

.s-checklist__item.is-done {
  background: rgba(21, 128, 61, 0.05);
  border-color: rgba(21, 128, 61, 0.3);
}

.s-checklist__item.is-done .s-checklist__label {
  color: #166534;
  text-decoration: line-through;
  text-decoration-color: rgba(21, 128, 61, 0.5);
  text-decoration-thickness: 1.5px;
}

/* Dashboard checklist: ring + per-page scoreboard */
.s-dash-check {
  margin-top: 1rem;
}

.s-dash-check__layout {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 1.25rem 1.5rem;
  align-items: start;
}

@media (max-width: 720px) {
  .s-dash-check__layout {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .s-dash-check__board {
    width: 100%;
    text-align: left;
  }
}

.s-dash-check__ring-wrap {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto;
}

.s-dash-ring__svg {
  display: block;
}

.s-dash-check__ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.s-dash-check__ring-pct {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.s-dash-check__ring-meta {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  margin-top: 0.15rem;
}

.s-dash-check__ring-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 0.35rem;
}

.s-dash-check__board-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.s-dash-check__rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.s-dash-check__row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.s-dash-check__row:hover {
  border-color: rgba(29, 78, 216, 0.45);
  text-decoration: none;
}

.s-dash-check__row.is-partial {
  border-color: rgba(29, 78, 216, 0.35);
  background: rgba(29, 78, 216, 0.04);
}

.s-dash-check__row.is-full {
  border-color: rgba(21, 128, 61, 0.45);
  background: rgba(21, 128, 61, 0.06);
}

.s-dash-check__row-name {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.s-dash-check__row-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.s-dash-mini-ring {
  --mini-pct: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(#1d4ed8 calc(var(--mini-pct) * 3.6deg), #e2e8f0 0);
}

.s-dash-mini-ring__inner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
}

/* Curriculum (student/modules.php) */
.curr-hero {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.curr-hero__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.curr-hero__sub {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
  font-size: 0.95rem;
}

.curr-hero__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.curr-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  text-align: left;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.curr-stat__num {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
}

.curr-stat__label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
  margin-top: 0.2rem;
}

.curr-progress {
  margin-bottom: 1.25rem;
}

.curr-progress__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.curr-progress__label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--muted);
}

.curr-progress__meta {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 600;
  margin-top: 0.15rem;
}

.curr-progress__pct {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}

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

@media (min-width: 1024px) {
  .curr-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.curr-module {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1.25rem 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.curr-module:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.curr-module__head {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.curr-module__num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.18), rgba(59, 130, 246, 0.28));
  color: var(--accent);
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}

.curr-module__title-wrap {
  min-width: 0;
  flex: 1;
}

.curr-module__title {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.curr-module__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.curr-module__count {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.curr-module__empty {
  margin: 0;
  font-size: 0.9rem;
}

.curr-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: capitalize;
}

.curr-pill--ok {
  background: rgba(21, 128, 61, 0.12);
  color: var(--success);
}

.curr-pill--warn {
  background: rgba(194, 65, 12, 0.12);
  color: var(--warn);
}

.curr-pill--danger {
  background: rgba(185, 28, 28, 0.12);
  color: var(--error);
}

.curr-lessons {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.curr-lesson {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--border);
}

.curr-lesson:last-child {
  border-bottom: none;
  padding-bottom: 0.25rem;
}

.curr-lesson__num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #eef2f7;
  color: var(--text);
  font-weight: 700;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

.curr-lesson__body {
  min-width: 0;
  flex: 1;
}

.curr-lesson__title {
  margin: 0 0 0.25rem;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.curr-lesson__notes {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.curr-lesson__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.curr-lesson__actions .btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

.curr-empty {
  text-align: center;
  padding: 2.25rem 1.5rem;
}

.curr-empty h3 {
  margin: 0 0 0.35rem;
}

.curr-footer-cta {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-start;
}

@media (min-width: 720px) {
  .curr-hero {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
  .curr-hero__stats {
    width: 380px;
  }
}

/* Guest (login / register) */
.student-body--guest {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(255, 153, 51, 0.14), transparent 60%),
    radial-gradient(1000px 500px at 10% 110%, rgba(19, 136, 8, 0.08), transparent 60%),
    linear-gradient(160deg, #eef2f8 0%, #f5f7fb 50%, #eef2f8 100%);
  position: relative;
}

.student-body--guest::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 50;
  background: linear-gradient(90deg,
    var(--saffron) 0%, var(--saffron) 33.33%,
    #ffffff 33.33%, #ffffff 66.66%,
    var(--portal-green) 66.66%, var(--portal-green) 100%);
}

.student-auth-header {
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  margin-top: 4px;
}

.student-auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.student-auth-brand:hover {
  text-decoration: none;
  color: var(--accent);
}

.student-auth-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1.25rem 3rem;
}

.student-auth-inner {
  width: 100%;
  max-width: 520px;
}

.student-auth-inner .alert {
  margin-bottom: 1rem;
}

/* Doubt threads — outer card + question box */
.doubt-thread {
  margin-top: 1rem;
  padding: 1.1rem 1.15rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.doubt-thread:first-of-type {
  margin-top: 0.75rem;
}

.doubt-thread__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.doubt-thread__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}

.doubt-thread__meta {
  margin: 0.35rem 0 0.85rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.doubt-thread__question {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid #dbe4f0;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.doubt-thread__q-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.doubt-thread__q-body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #1a2744;
}

/* Doubt thread — admin reply (readable contrast vs old dark card) */
.doubt-reply {
  margin-top: 1rem;
  padding: 1rem 1.1rem 0.95rem;
  border-radius: var(--radius);
  border: 1px solid #c7d2fe;
  border-left: 4px solid var(--accent);
  background: linear-gradient(165deg, #eff6ff 0%, #eef2ff 45%, #e0e7ff 100%);
  box-shadow: 0 2px 12px rgba(29, 78, 216, 0.08);
}

.doubt-reply__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.45rem;
}

.doubt-reply__body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #102a43;
}

.doubt-reply__meta {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(15, 39, 54, 0.1);
  font-size: 0.82rem;
  color: #486581;
}
