:root {
  --navy: #001A33;
  --navy-deep: #000D1A;
  --navy-mid: #0B2A4A;
  --navy-soft: #132F4C;
  --gold: #E5B80B;
  --gold-bright: #F5C518;
  --gold-dark: #9A7B08;
  --white: #FFFFFF;
  --canvas: #F4F6F9;
  --surface: #FFFFFF;
  --text: #142033;
  --muted: #667085;
  --border: #E4E7EC;
  --success: #067647;
  --danger: #B42318;
  --warn: #B54708;
  --info: #175CD3;
  --shadow: 0 8px 24px rgba(0, 26, 51, 0.06);
  --shadow-lg: 0 18px 40px rgba(0, 26, 51, 0.1);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-w: 272px;
  --font: "Urbanist", sans-serif;
}

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

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(229, 184, 11, 0.14), transparent 55%),
    radial-gradient(700px 360px at -5% 20%, rgba(0, 26, 51, 0.06), transparent 50%),
    var(--canvas);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--navy-mid); text-decoration: none; }
a:hover { color: var(--gold-dark); }
img { max-width: 100%; display: block; }

.icon { width: 20px; height: 20px; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }

/* Auth / Login — white brand left, navy form right */
.auth-page {
  --mx: 50%;
  --my: 50%;
  --px: 0;
  --py: 0;
  min-height: 100vh;
  margin: 0;
  background: #FFFFFF;
  overflow-x: hidden;
  overflow-y: auto;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 46%) 1fr;
}

.auth-brand {
  position: relative;
  overflow: hidden;
  color: #001A33;
  padding: 40px 36px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #FFFFFF;
  border-right: 1px solid #E4E7EC;
  animation: authBrandIn .7s ease both;
}

.auth-fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

.auth-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Soft floating circles */
.auth-float {
  position: absolute;
  border-radius: 50%;
  display: block;
  background: #001A33;
  opacity: .07;
  animation: authSoftFloat 10s ease-in-out infinite;
}
.auth-bg-dark .auth-float {
  background: #FFFFFF;
  opacity: .1;
}
.f1 { width: 120px; height: 120px; top: 8%; left: -20px; }
.f2 { width: 80px; height: 80px; bottom: 16%; right: 8%; animation-duration: 12s; animation-delay: -2s; }
.f3 { width: 48px; height: 48px; top: 55%; left: 20%; animation-duration: 9s; animation-delay: -4s; }
.f4 { width: 140px; height: 140px; top: 10%; right: -30px; }
.f5 { width: 90px; height: 90px; bottom: 12%; left: 8%; animation-duration: 13s; animation-delay: -3s; }
.f6 { width: 56px; height: 56px; top: 48%; left: 48%; animation-duration: 8s; animation-delay: -1s; }

/* Small square chips */
.auth-chip {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: #001A33;
  opacity: .12;
  animation: authChipDrift 8s ease-in-out infinite;
}
.auth-bg-dark .auth-chip {
  background: #FFFFFF;
  opacity: .18;
}
.ch1 { top: 22%; right: 20%; }
.ch2 { bottom: 28%; left: 16%; width: 10px; height: 10px; animation-delay: -2s; }
.ch3 { top: 20%; left: 18%; animation-delay: -1s; }
.ch4 { top: 60%; right: 22%; width: 12px; height: 12px; animation-delay: -3s; }
.ch5 { bottom: 22%; left: 42%; width: 9px; height: 9px; animation-delay: -4s; }

.auth-brand-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.auth-logo {
  width: 168px;
  height: auto;
  max-height: 168px;
  object-fit: contain;
  display: block;
  margin: 0 auto 22px;
  animation: authLogoPop .65s .15s ease both;
}

.auth-title {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #001A33;
  max-width: 18ch;
}

.auth-tagline {
  margin: 0 0 14px;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: none;
  color: #0B2A4A;
}

.auth-desc {
  margin: 0;
  font-size: .98rem;
  line-height: 1.5;
  font-weight: 500;
  color: #667085;
  max-width: 32ch;
}

.auth-foot {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 18px;
  z-index: 1;
  margin: 0;
  font-size: .76rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: .01em;
  color: #98A2B3;
  text-align: center;
}
.auth-foot span {
  display: block;
  margin-top: 2px;
  font-weight: 600;
  color: #667085;
}

.auth-main {
  position: relative;
  display: grid;
  place-items: center;
  padding: 36px 24px;
  background: #001A33;
  overflow: hidden;
}

.auth-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  background: #FFFFFF;
  border-radius: 16px;
  padding: 28px 28px 30px;
  border: 0;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  animation: rise .55s .1s ease both;
}

.auth-portal-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 22px;
}

.auth-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  border-radius: 12px;
  border: 0;
  background: #F2F4F7;
  color: #001A33;
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 800;
  cursor: pointer;
  opacity: 1;
  box-shadow: none;
  transition: background .2s ease, color .2s ease, transform .15s ease, box-shadow .15s ease;
}

.auth-tab:hover {
  color: #001A33;
  background: #E4E7EC;
  transform: translateY(-1px);
}

.auth-tab.active {
  border: 0;
  background: #001A33;
  color: #FFFFFF;
  box-shadow: 0 8px 18px rgba(0, 26, 51, 0.28);
}

.auth-tab .icon { color: currentColor; }

/* Keep both portal tabs looking clickable (never “disabled”) */
.auth-page.portal-staff .auth-tab[data-portal="student"],
.auth-page.portal-student .auth-tab[data-portal="staff"] {
  opacity: 1;
  color: #001A33;
  background: #F2F4F7;
  border: 0;
}

.auth-heading { margin-bottom: 18px; }
.auth-heading h2 {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 800;
  color: #001A33;
  letter-spacing: -0.02em;
}
.auth-heading p {
  margin: 0;
  color: #667085;
  font-size: .92rem;
  font-weight: 500;
  line-height: 1.45;
}

.auth-form { display: grid; gap: 14px; }
.auth-field label {
  display: block;
  margin-bottom: 6px;
  font-size: .86rem;
  font-weight: 700;
  color: #001A33;
}
.auth-field input {
  width: 100%;
  border: 1.5px solid #D0D5DD;
  border-radius: 12px;
  padding: 13px 14px;
  font: inherit;
  font-weight: 500;
  color: var(--text);
  background: #FFFFFF;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.auth-field input:focus {
  outline: none;
  border-color: #001A33;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(0, 26, 51, 0.15);
}

.password-wrap {
  position: relative !important;
  display: block !important;
  width: 100%;
}
.password-wrap > input[type="password"],
.password-wrap > input[type="text"] {
  display: block;
  width: 100%;
  padding-right: 48px !important;
  box-sizing: border-box;
}
.password-toggle {
  position: absolute !important;
  top: 50% !important;
  right: 10px !important;
  left: auto !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  width: 34px;
  height: 34px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #667085;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  line-height: 1;
}
.password-toggle:hover {
  color: #001A33;
  background: #F2F4F7;
}
.password-toggle .icon {
  width: 18px;
  height: 18px;
  display: block;
}
.auth-field .password-wrap input:focus {
  outline: none;
  border-color: #001A33;
  box-shadow: 0 0 0 3px rgba(0, 26, 51, 0.15);
}

.btn-auth {
  width: 100%;
  margin-top: 6px;
  border: 0;
  border-radius: 12px;
  padding: 15px 16px;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 800;
  color: #FFFFFF;
  cursor: pointer;
  background: #001A33;
  box-shadow: 0 10px 22px rgba(0, 26, 51, 0.28);
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn-auth:hover {
  transform: translateY(-2px);
  background: #0B2A4A;
  box-shadow: 0 12px 26px rgba(0, 26, 51, 0.34);
}
.btn-auth:active {
  transform: translateY(0);
  background: #000D1A;
}
.btn-auth:focus-visible {
  outline: 3px solid rgba(229, 184, 11, 0.55);
  outline-offset: 2px;
}

/* Student submit — gold fill, no border */
.btn-auth-student,
.portal-student .btn-auth {
  color: #001A33;
  background: linear-gradient(180deg, #F5C518 0%, #E5B80B 100%);
  border: 0;
  box-shadow: 0 10px 22px rgba(229, 184, 11, 0.4);
}
.btn-auth-student:hover,
.portal-student .btn-auth:hover {
  background: linear-gradient(180deg, #FFD84A 0%, #F5C518 100%);
  border: 0;
  box-shadow: 0 12px 26px rgba(229, 184, 11, 0.5);
}

.auth-form[hidden] { display: none !important; }
.auth-hint { margin: 6px 0 0; font-size: .82rem; }
.auth-mobile-name,
.auth-mobile-foot { display: none; }

.portal-student .auth-brand {
  background: #FFFFFF;
}
.portal-student .auth-tab.active {
  border: 0;
  background: #001A33;
  color: #FFFFFF;
  box-shadow: 0 8px 18px rgba(0, 26, 51, 0.28);
}

@keyframes authBrandIn {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: none; }
}
@keyframes authLogoPop {
  from { opacity: 0; transform: scale(.86); }
  to { opacity: 1; transform: none; }
}
@keyframes authPanelPulse {
  from { opacity: .88; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.auth-panel-pulse { animation: authPanelPulse .35s ease both; }

@keyframes authSoftFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(16px, -12px); }
}
@keyframes authChipDrift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-10px, 14px) rotate(20deg); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-float,
  .auth-chip {
    animation: none !important;
  }
  .auth-fx { display: none; }
}

/* Legacy login helpers (kept for safety) */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}
.login-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 22px;
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
  animation: rise .5s ease both;
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand img {
  width: 92px; height: 92px; object-fit: contain; margin: 0 auto 14px;
}
.login-brand h1 {
  font-size: 1.35rem; font-weight: 800; line-height: 1.25;
  color: var(--navy); margin: 0 0 6px;
}
.login-brand p { margin: 0; color: var(--muted); font-size: .92rem; font-weight: 500; }

/* Shell */
.app-shell {
  display: flex;
  min-height: 100vh;
  min-width: 0;
  width: 100%;
  overflow-x: hidden;
}

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  border-right: 1px solid rgba(229,184,11,.2);
}

.sidebar-brand {
  display: flex; gap: 12px; align-items: center;
  padding: 22px 18px 14px;
}

.brand-logo {
  width: 48px; height: 48px; object-fit: contain;
  border-radius: 0; background: transparent; padding: 0;
  box-shadow: none;
}

.brand-text strong {
  display: block; font-size: 1.15rem; font-weight: 800;
  color: var(--gold-bright); letter-spacing: .02em;
}
.brand-text span { font-size: .78rem; color: rgba(255,255,255,.65); font-weight: 500; }

.sidebar-role { padding: 0 18px 10px; }
.role-pill {
  display: inline-flex; align-items: center;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(229,184,11,.16); color: var(--gold-bright);
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}

.sidebar-nav {
  padding: 8px 12px; overflow-y: auto; flex: 1;
  scrollbar-width: thin;
}

.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; margin-bottom: 4px;
  border-radius: 12px;
  color: rgba(255,255,255,.78);
  font-size: .94rem; font-weight: 600;
  transition: background .2s ease, color .2s ease, transform .15s ease;
}

.nav-link:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(229,184,11,.28), rgba(229,184,11,.08));
  color: var(--gold-bright);
  box-shadow: inset 3px 0 0 var(--gold);
}

.nav-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.06);
}
.nav-link.active .nav-icon { background: rgba(229,184,11,.18); color: var(--gold-bright); }

.nav-group { margin-bottom: 4px; }
.nav-parent {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.nav-caret {
  margin-left: auto;
  opacity: .7;
  font-size: .75rem;
  transition: transform .2s ease;
}
.nav-group.open .nav-caret { transform: rotate(180deg); }
.nav-children {
  display: none;
  padding: 2px 0 6px 12px;
}
.nav-group.open .nav-children { display: block; }
.nav-sub {
  font-size: .88rem !important;
  padding: 9px 10px !important;
}
.nav-sub .nav-icon {
  width: 28px;
  height: 28px;
}

.dept-card {
  display: block;
  padding: 18px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
  color: inherit;
}
.dept-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(229,184,11,.45);
  color: inherit;
}
.dept-card h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--navy);
}
.dept-card p { margin: 0; color: var(--muted); font-size: .88rem; font-weight: 500; }
.dept-card .count {
  margin-top: 12px;
  font-weight: 800;
  color: var(--gold-dark);
  font-size: 1.35rem;
}

.programs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 980px) {
  .programs-layout {
    grid-template-columns: 1fr;
  }
}

.subject-rows { display: grid; gap: 10px; }
.subject-row {
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #F8FAFC;
}
.subject-row .form-row { margin-bottom: 0; }
.course-sem-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.course-subject-list { display: flex; flex-direction: column; gap: 8px; }
.course-subject {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #F8FAFC;
  overflow: hidden;
}
.course-subject summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  font-weight: 600;
  color: var(--navy);
}
.course-subject summary::-webkit-details-marker { display: none; }
.course-subject summary::after {
  content: '+';
  font-weight: 800;
  color: var(--muted);
  flex: 0 0 auto;
}
.course-subject[open] summary::after { content: '−'; }
.course-subject-main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  min-width: 0;
}
.course-subject-main strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--gold-dark);
}
.course-subject-meta {
  color: var(--muted);
  font-size: .84rem;
  white-space: nowrap;
}
.course-subject-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.course-subject-body h4 {
  margin: 12px 0 6px;
  font-size: .9rem;
  font-weight: 800;
  color: var(--navy);
}
.course-outline {
  white-space: pre-wrap;
  line-height: 1.55;
  color: #344054;
  font-size: .93rem;
}
@media (max-width: 700px) {
  .course-sem-nav .btn { flex: 1 1 auto; text-align: center; }
  .course-subject summary { align-items: flex-start; }
}

.att-status-select {
  min-width: 130px;
}

.sidebar-footer {
  padding: 14px; border-top: 1px solid rgba(255,255,255,.08);
}

.user-chip { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.user-avatar {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: var(--navy-deep); display: grid; place-items: center;
  font-weight: 800; font-size: 1rem;
  overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-meta strong { display: block; font-size: .9rem; font-weight: 700; }
.user-meta small { color: rgba(255,255,255,.55); font-size: .72rem; word-break: break-all; }

.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 28px 8px;
}

.topbar-text { flex: 1; min-width: 0; }
.page-title {
  margin: 0; font-size: 1.7rem; font-weight: 800;
  color: var(--navy); letter-spacing: -.03em;
}
.page-sub { margin: 4px 0 0; color: var(--muted); font-size: .9rem; font-weight: 500; }

.topbar-badge {
  display: none;
  padding: 8px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--border);
  color: var(--muted); font-size: .8rem; font-weight: 600;
  box-shadow: var(--shadow);
}
@media (min-width: 900px) { .topbar-badge { display: inline-flex; } }

.topbar-end {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}
.topbar-notify { position: relative; }
.topbar-notify-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  color: var(--navy);
  box-shadow: var(--shadow);
}
.topbar-notify-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #B42318;
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.topbar-notify-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(360px, 86vw);
  max-height: min(70vh, 480px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 40;
}
.topbar-notify-head {
  padding: 12px 14px 8px;
  font-weight: 800;
  color: var(--navy);
  border-bottom: 1px solid var(--border);
}
.topbar-notify-empty { margin: 0; padding: 16px; color: var(--muted); }
.topbar-notify-item {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border-bottom: 1px solid #F2F4F7;
  color: inherit;
}
.topbar-notify-item:hover { background: rgba(229,184,11,.12); }
.topbar-notify-item strong {
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold-dark, #9A6700);
}
.topbar-notify-item span { font-weight: 700; color: var(--navy); font-size: .86rem; }
.topbar-notify-item small, .topbar-notify-item em {
  color: var(--muted);
  font-size: .75rem;
  font-style: normal;
}
.topbar-notify-foot {
  display: flex;
  gap: 12px;
  padding: 10px 14px 12px;
}
.topbar-notify-foot a { font-size: .8rem; font-weight: 700; }

.menu-toggle {
  display: none; border: 1px solid var(--border); background: #fff;
  border-radius: 12px; width: 42px; height: 42px;
  place-items: center; cursor: pointer; color: var(--navy);
}

.content { padding: 12px 28px 36px; flex: 1; }
.app-footer { padding: 8px 28px 24px; color: var(--muted); font-size: .84rem; font-weight: 500; }

/* Layout helpers */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: grid; gap: 18px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.text-muted { color: var(--muted); }
.text-gold { color: var(--gold-dark); font-weight: 700; }

/* Cards */
.stat-card, .panel {
  background: var(--surface);
  border: 1px solid rgba(0, 26, 51, 0.05);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: rise .45s ease both;
}

.stat-card {
  padding: 20px;
  display: flex; gap: 14px; align-items: flex-start;
  position: relative; overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-card::after {
  content: ""; position: absolute; right: -24px; top: -24px;
  width: 100px; height: 100px; border-radius: 50%;
  background: radial-gradient(circle, rgba(229,184,11,.18), transparent 70%);
}

.stat-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(0,26,51,.08), rgba(229,184,11,.16));
  color: var(--navy); flex-shrink: 0;
}
.stat-body { min-width: 0; }
.stat-card .label { color: var(--muted); font-size: .84rem; font-weight: 600; margin-bottom: 6px; }
.stat-card .value {
  font-size: 1.9rem; font-weight: 800; color: var(--navy);
  line-height: 1; letter-spacing: -.03em;
}
.stat-card .value.value-text {
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: -.02em;
}
.stat-card .hint { margin-top: 8px; font-size: .8rem; color: var(--gold-dark); font-weight: 600; }
a.feature-card { color: inherit; text-decoration: none; }
a.feature-card .label { color: var(--navy); }
a.feature-card .value-text { font-size: 1rem; font-weight: 700; }

.panel { padding: 22px; }
.panel-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 16px;
}
.panel-header-wrap { flex-wrap: wrap; }
.panel-header h2 {
  margin: 0; font-size: 1.15rem; font-weight: 800;
  color: var(--navy); letter-spacing: -.02em;
  display: flex; align-items: center; gap: 8px;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}
.filter-count {
  display: flex;
  align-items: flex-end;
  padding-bottom: 4px;
}
.count-pill {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: #F2F4F7;
  color: var(--navy);
  font-size: .85rem;
  font-weight: 700;
}

.record-list {
  display: grid;
  gap: 12px;
}
/* Enrollment list header: title + session/PDF on one control row */
.enroll-students-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 16px;
}
.enroll-students-header h2 {
  flex: 1 1 auto;
  min-width: 160px;
  margin: 0;
}
.enroll-toolbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
}
.enroll-toolbar-label {
  font-size: .84rem;
  font-weight: 700;
  color: var(--navy);
}
.enroll-toolbar-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
}
.enroll-toolbar-row select {
  width: min(220px, 55vw);
  min-width: 140px;
  flex: 1 1 auto;
}
.enroll-toolbar-row .btn {
  flex: 0 0 auto !important;
  width: auto !important;
  white-space: nowrap;
}
.enroll-record-list .record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}
.enroll-record-list .record-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.enroll-record-list .record-actions form {
  margin: 0;
  display: inline-flex;
}
.enroll-record-list .record-actions .btn {
  white-space: nowrap;
}
.record-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.record-card:hover {
  border-color: rgba(229,184,11,.4);
  box-shadow: var(--shadow);
}
.record-main { min-width: 0; flex: 1; }
.record-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.record-title strong {
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy);
}
.record-sub {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 500;
  word-break: break-word;
}
.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.record-meta > span {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  color: var(--navy-mid);
  font-size: .75rem;
  font-weight: 700;
}
.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0;
}
.record-actions form { margin: 0; display: inline-flex; flex-wrap: wrap; gap: 8px; }
.record-note {
  margin: 8px 0 0;
  color: var(--text);
  font-size: .9rem;
  line-height: 1.45;
  word-break: break-word;
}
.record-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  width: 100%;
}
.record-form select,
.record-form input[type="text"],
.record-form input[type="number"],
.record-form input[type="file"] {
  width: auto;
  min-width: 120px;
  flex: 1 1 140px;
  margin: 0;
}

.semester-layout {
  max-width: 920px;
}

/* Forms */
.form-row { display: grid; gap: 14px; margin-bottom: 14px; }
.form-row.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

label {
  display: block; font-size: .84rem; font-weight: 700;
  color: var(--navy-mid); margin-bottom: 6px;
}

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="time"],
input[type="datetime-local"], input[type="file"], select, textarea {
  width: 100%; border: 1px solid var(--border); background: #fff;
  border-radius: var(--radius-sm); padding: 11px 12px;
  font: inherit; color: var(--text); font-weight: 500;
  transition: border-color .2s ease, box-shadow .2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(229,184,11,.18);
}
textarea { min-height: 110px; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 12px; padding: 11px 16px;
  font: inherit; font-weight: 700; cursor: pointer;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn .icon { width: 16px; height: 16px; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: var(--navy-deep);
  box-shadow: 0 8px 18px rgba(229,184,11,.28);
}
.btn-navy { background: var(--navy); color: #fff; }
.btn-ghost {
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,.22);
}
.btn-outline {
  background: #fff; color: var(--navy);
  border: 1px solid var(--border);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 11px; font-size: .84rem; border-radius: 10px; }
.btn-block { width: 100%; }

.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 680px; }
table.data th, table.data td {
  padding: 13px 12px; text-align: left;
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
table.data th {
  color: var(--muted); font-size: .74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  background: #F8FAFC;
  white-space: nowrap;
}
table.data tr:hover td { background: rgba(229,184,11,.04); }
table.data td { overflow-wrap: anywhere; word-break: normal; }
table.data td.actions,
table.data td:has(.btn) {
  white-space: nowrap;
  width: 1%;
  overflow-wrap: normal;
}
table.data td.actions .btn,
table.data td.actions form,
table.data td:has(.btn) form {
  white-space: nowrap;
}
table.data td form {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
}
table.data.marks-table { min-width: 860px; }
.inline-form { display: inline-flex; margin: 0; }
.portal-lock-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.portal-lock-bar > span { flex: 1 1 220px; }
.portal-lock-bar .inline-form { flex: 0 0 auto; }
.result-student-list { display: grid; gap: 14px; }
.result-student {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.result-student-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding: 12px 14px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border);
}
.result-student .table-wrap {
  border-radius: 0;
  margin: 0;
}
.result-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  justify-content: flex-end;
}

.badge {
  display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px;
  font-size: .74rem; font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-success { background: #DCFAE6; color: var(--success); }
.badge-danger { background: #FEE4E2; color: var(--danger); }
.badge-warn { background: #FEF0C7; color: var(--warn); }
.badge-info { background: #D1E9FF; color: var(--info); }
.badge-muted { background: #F2F4F7; color: var(--muted); }

.alert {
  padding: 12px 14px; border-radius: 12px; margin-bottom: 16px;
  font-size: .93rem; font-weight: 600; animation: rise .35s ease both;
}
.alert-success { background: #DCFAE6; color: var(--success); border: 1px solid #ABEFC6; }
.alert-error { background: #FEE4E2; color: var(--danger); border: 1px solid #FECDCA; }
.alert-info { background: #D1E9FF; color: var(--info); border: 1px solid #B2DDFF; }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.sem-seq {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.sem-seq .btn,
.sem-seq-add,
.sem-seq-add .btn {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}
.sem-seq-add { display: inline-flex; }

table.data td input[type="number"] {
  width: 4.8rem;
  max-width: 100%;
  padding: 6px 8px;
}

/* Keep Edit / Remove side-by-side in data tables */
/* Keep table-cell display — flex on <td> breaks/overlaps columns */
table.data td.actions {
  display: table-cell;
  width: 1%;
  white-space: nowrap;
  text-align: right;
  vertical-align: middle;
}
table.data td.actions .row-actions {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
table.data td.actions form {
  display: inline-block;
  margin: 0;
  padding: 0;
  vertical-align: middle;
}
table.data td.actions > .btn,
table.data td.actions > a.btn {
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
}
table.data td.actions > .btn:first-child,
table.data td.actions > a.btn:first-child {
  margin-left: 0;
}

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li {
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.list-plain li:last-child { border-bottom: none; }
.list-plain li strong { font-weight: 700; color: var(--navy); }

.notice-item h3 { margin: 0 0 6px; font-size: 1rem; font-weight: 700; color: var(--navy); }

.item-row {
  display: flex; gap: 12px; align-items: flex-start;
}
.item-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: #F2F4F7; color: var(--navy); flex-shrink: 0;
}

.progress {
  height: 8px; background: #EEF2F6; border-radius: 999px; overflow: hidden;
}
.progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
}

.login-hints {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px dashed var(--border);
  font-size: .82rem; color: var(--muted); font-weight: 500;
}
.login-hints code {
  background: #F2F4F7; padding: 1px 6px; border-radius: 6px;
  color: var(--navy); font-weight: 600;
}

.welcome-banner {
  background: #001A33;
  color: #fff;
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: none;
  border: 1px solid #001A33;
  position: relative;
  overflow: hidden;
}
.welcome-banner:has(.welcome-banner-main) {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.welcome-banner::after { display: none; }
.welcome-banner-main { min-width: 0; flex: 1; }
.welcome-banner h2 {
  margin: 0 0 6px;
  font-size: 1.3rem;
  font-weight: 800;
  color: #FFFFFF;
}
.welcome-banner p {
  margin: 0;
  color: #D0D5DD;
  font-weight: 500;
  max-width: 60ch;
  line-height: 1.45;
}
.welcome-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px !important;
  color: #F5C518 !important;
  font-size: .88rem;
  font-weight: 600;
}
.welcome-login .icon { flex-shrink: 0; color: #F5C518; }
.welcome-clock {
  flex-shrink: 0;
  text-align: right;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(245,197,24,.35);
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 168px;
}
.welcome-clock .clock-label {
  display: block;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #F5C518;
  font-weight: 700;
  margin-bottom: 4px;
}
.welcome-clock .clock-date {
  display: block;
  color: #E6EAF0;
  font-size: .82rem;
  font-weight: 600;
}
.welcome-clock .clock-time {
  display: block;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.topbar-clock {
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  line-height: 1.2;
}
.topbar-clock .clock-date { font-size: .72rem; font-weight: 600; color: var(--muted); }
.topbar-clock .clock-time {
  font-size: .88rem;
  font-weight: 800;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.sidebar-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 30;
}
.sidebar-backdrop.show { display: block; }
body.nav-open { overflow: hidden; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-count { grid-column: 1 / -1; }

  .record-card {
    flex-direction: column;
    align-items: stretch;
  }
  .record-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .record-actions .btn,
  .record-actions form { width: 100%; margin: 0; }
  .record-actions form .btn { flex: 1 1 calc(50% - 4px); min-width: 96px; width: auto; }
  .record-actions > :only-child,
  .record-actions form:only-child { grid-column: 1 / -1; }

  .table-wrap:not(.keep-table) { overflow: visible; }
  .table-wrap.keep-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table.data:not(.keep-cols) { min-width: 0 !important; }
  table.data:not(.keep-cols) thead { display: none; }
  table.data:not(.keep-cols),
  table.data:not(.keep-cols) tbody,
  table.data:not(.keep-cols) tr,
  table.data:not(.keep-cols) td { display: block; width: 100%; }
  table.data:not(.keep-cols) tbody { display: grid; gap: 10px; }
  table.data:not(.keep-cols) tr {
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 10px 12px;
    box-shadow: var(--shadow);
  }
  table.data:not(.keep-cols) tr:hover td { background: transparent; }
  table.data:not(.keep-cols) td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #F2F4F7;
    text-align: right;
    white-space: normal;
    width: 100%;
  }
  table.data:not(.keep-cols) td:last-child { border-bottom: 0; }
  table.data:not(.keep-cols) td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    text-align: left;
    flex: 0 0 38%;
    max-width: 42%;
  }
  table.data:not(.keep-cols) td:not([data-label])::before,
  table.data:not(.keep-cols) td[data-label=""]::before { display: none; }
  table.data:not(.keep-cols) td.actions,
  table.data:not(.keep-cols) td:last-child:not([data-label]),
  table.data:not(.keep-cols) td:has(.btn) {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    padding-top: 10px;
    text-align: left;
    white-space: normal;
  }
  table.data:not(.keep-cols) td.actions::before,
  table.data:not(.keep-cols) td:has(.btn)::before { display: none; }
  table.data:not(.keep-cols) td.actions .btn,
  table.data:not(.keep-cols) td.actions form,
  table.data:not(.keep-cols) td:has(.btn) .btn,
  table.data:not(.keep-cols) td:has(.btn) form { flex: 1 1 auto; min-width: 96px; }
  table.data:not(.keep-cols) td.actions form .btn,
  table.data:not(.keep-cols) td:has(.btn) form .btn { width: 100%; }
  table.data:not(.keep-cols) .empty {
    text-align: center;
    border: 0;
    box-shadow: none;
    padding: 20px 8px;
  }
  table.data:not(.keep-cols) .empty td {
    display: block;
    text-align: center;
    border: 0;
    padding: 0;
  }
  table.data:not(.keep-cols) .empty td::before { display: none; }
  table.data.marks-table { min-width: 0 !important; }
  table.data:not(.keep-cols) td input[type="number"] {
    width: 100%;
    max-width: 160px;
    margin-left: auto;
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0;
    transform: translateX(-105%);
    transition: transform .25s ease;
    width: min(280px, 86vw);
    height: 100dvh;
    max-height: 100vh;
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-toggle { display: inline-grid; }
  .main-wrap { width: 100%; min-width: 0; }
  .grid-2, .grid-3, .grid-4,
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
  .content, .topbar, .app-footer { padding-left: 14px; padding-right: 14px; }
  .topbar { padding-top: 14px; gap: 10px; }
  .page-title { font-size: 1.25rem; }
  .page-sub { font-size: .84rem; }
  .panel { padding: 14px; border-radius: 14px; }
  .panel-header,
  .panel-header-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .panel-header > .btn,
  .panel-header > a.btn { width: 100%; }
  .panel-header .actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .panel-header .actions .btn { width: 100%; }
  .panel-header .actions .btn:only-child,
  .panel-header .actions > :only-child { grid-column: 1 / -1; }
  .filter-bar { grid-template-columns: 1fr; width: 100%; }
  .filter-bar select,
  .filter-bar input { width: 100%; max-width: 100%; }
  .record-card {
    flex-direction: column;
    align-items: stretch;
  }
  .enroll-students-header {
    align-items: stretch;
  }
  .enroll-toolbar {
    width: 100%;
  }
  .enroll-toolbar-row {
    width: 100%;
  }
  .enroll-toolbar-row select {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
  }
  .record-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .record-actions .btn,
  .record-actions form { width: 100%; margin: 0; }
  .record-actions form .btn { flex: 1 1 calc(50% - 4px); min-width: 96px; width: auto; }
  .record-actions > :only-child,
  .record-actions form:only-child { grid-column: 1 / -1; }
  .record-actions a.btn-navy { grid-column: 1 / -1; }
  .enroll-record-list .record-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .welcome-banner { padding: 18px 16px; flex-direction: column; align-items: stretch; }
  .welcome-banner h2 { font-size: 1.15rem; }
  .welcome-banner p { max-width: none; }
  .welcome-clock { text-align: left; min-width: 0; }
  .dept-card .count { font-size: 1.15rem; }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
  input, select, textarea { font-size: 16px; } /* avoid iOS zoom */
  .topbar-badge { display: none !important; }
  .topbar-notify { display: block; }
  .role-student .topbar-badge {
    display: inline-flex !important;
    flex-direction: column;
    align-items: flex-end;
    padding: 6px 10px;
    white-space: nowrap;
  }
  .role-student .topbar-clock .clock-date { font-size: .64rem; }
  .role-student .topbar-clock .clock-time { font-size: .78rem; }

  .result-student-head {
    flex-direction: column;
    align-items: stretch;
  }
  .result-student-head .actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .result-student-head .actions .btn,
  .result-student-head .actions form { width: 100%; margin: 0; }
  .result-student-head .actions form .btn { width: 100%; }
  .result-status { justify-content: flex-end; }
  .portal-lock-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .portal-lock-bar .btn { width: 100%; }
}

@media (max-width: 900px) {
  .auth-page {
    background: #001A33;
  }
  .auth-shell {
    grid-template-columns: 1fr;
    min-height: 100vh;
    grid-template-rows: auto 1fr;
  }
  .auth-fx,
  .auth-brand .auth-bg,
  .auth-main .auth-bg {
    display: none;
  }
  .auth-brand {
    order: 0;
    min-height: auto;
    padding: 28px 20px 12px;
    border: 0;
    background: #001A33;
    justify-content: flex-end;
    animation: none;
  }
  .auth-brand-inner {
    max-width: none;
  }
  .auth-logo {
    width: 76px;
    max-height: 76px;
    margin: 0 auto 10px;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
  }
  .auth-title,
  .auth-desc,
  .auth-foot,
  .auth-tagline {
    display: none;
  }
  .auth-mobile-name {
    display: block;
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #F5C518;
  }
  .auth-main {
    order: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 16px 28px;
    min-height: auto;
    background: #001A33;
  }
  .auth-panel {
    width: 100%;
    max-width: 440px;
    padding: 20px 16px 22px;
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  }
  .auth-portal-tabs {
    gap: 8px;
    margin-bottom: 16px;
  }
  .auth-heading {
    margin-bottom: 14px;
  }
  .auth-heading h2 {
    font-size: 1.22rem;
  }
  .auth-heading p {
    font-size: .86rem;
  }
  .auth-hint {
    font-size: .76rem;
  }
  .auth-mobile-foot {
    display: block;
    margin: 18px 0 0;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
  }
  .portal-student .auth-brand {
    background: #001A33;
  }
}

@media (max-width: 560px) {
  .stat-card .value { font-size: 1.5rem; }
  .record-actions { grid-template-columns: 1fr; }
  .record-actions a.btn-navy { grid-column: auto; }
  .login-card { padding: 28px 20px; }
  .auth-tab { font-size: .8rem; padding: 12px 6px; }
  .auth-tab .icon { display: none; }
  .auth-tab span { white-space: nowrap; }
  .content { padding-bottom: 28px; }
  .panel-header .actions { grid-template-columns: 1fr; }
  .course-subject-meta { white-space: normal; text-align: right; }
  .user-meta strong { font-size: .84rem; }
  .programs-layout,
  .stack { gap: 14px; }
  .enroll-toolbar-row {
    flex-wrap: nowrap;
  }
}

/* Student academic pages — MAGSCU navy / gold chrome */
.std-page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 12px;
}
.std-chrome { margin-bottom: 16px; }
.std-bar {
  padding: 10px 14px;
  font-size: .9rem;
  font-weight: 650;
  line-height: 1.45;
}
.std-bar-info {
  background: var(--navy-soft);
  color: #fff;
  border-radius: 10px 10px 0 0;
}
.std-bar-notice {
  background: #DCFAE6;
  color: var(--success);
  border-left: 4px solid var(--gold);
  font-weight: 600;
}
.std-bar-program {
  background: var(--navy);
  color: var(--gold-bright);
  letter-spacing: .04em;
  font-size: .82rem;
  font-weight: 700;
}
.std-bar-warn {
  background: #FEE4E2;
  color: var(--danger);
  font-weight: 700;
}
.std-bar-extra {
  background: #FEF0C7;
  color: var(--gold-dark);
}
.std-sem-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--border);
  border-top: 0;
  background: #fff;
  border-radius: 0 0 10px 10px;
  overflow: hidden;
}
.std-sem-tab {
  padding: 10px 16px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--navy);
  border-right: 1px solid var(--border);
}
.std-sem-tab:hover { background: rgba(229,184,11,.12); color: var(--navy); }
.std-sem-tab.active {
  background: var(--navy);
  color: var(--gold-bright);
}
.std-section-head {
  background: #DCFAE6;
  color: var(--navy);
  font-weight: 700;
  padding: 10px 14px;
  margin: 0 0 12px;
  border-radius: 8px;
  border-left: 4px solid var(--gold);
}
.qec-stars { letter-spacing: 2px; font-size: 1.05rem; }
.qec-stars .on { color: var(--gold); }
.qec-stars .off { color: #D0D5DD; }
.profile-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #1a4a73 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 24px 20px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.profile-hero::after {
  content: "";
  position: absolute;
  right: -40px; top: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(229,184,11,.18);
}
.profile-hero-inner { display: flex; gap: 18px; align-items: center; position: relative; z-index: 1; }
.profile-photo-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; flex-shrink: 0; }
.profile-photo {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  display: grid; place-items: center;
  font-size: 2rem; font-weight: 800;
  flex-shrink: 0; border: 3px solid rgba(255,255,255,.35);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  margin: 0;
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-photo-hint {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: rgba(0, 26, 51, .72);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 0 6px;
  text-align: center;
}
.profile-photo-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.profile-hero .btn-primary.btn-sm {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}
.profile-hero .profile-photo-remove {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.45);
}
.profile-hero .profile-photo-remove:hover { border-color: #fff; color: var(--gold); }
.profile-hero h2 { margin: 0 0 4px; font-size: 1.35rem; }
.profile-hero p { margin: 0; opacity: .85; font-weight: 600; }
.profile-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
.profile-dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; margin: 0; }
.profile-dl dt { color: var(--muted); font-weight: 650; font-size: .85rem; }
.profile-dl dd { margin: 0; font-weight: 650; color: var(--navy); }
.enrolled-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  background: #F8FAFC;
}
.enrolled-card strong { color: var(--navy); display: block; margin-bottom: 6px; }
.fee-voucher {
  max-width: 640px;
  margin: 0 auto;
  background: #fff;
  border: 2px solid var(--navy);
  padding: 24px;
}
.fee-voucher h2 { margin: 0 0 4px; color: var(--navy); }
.tt-grid td { vertical-align: top; font-size: .82rem; }
.tt-slot { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.tt-slot:last-child { border-bottom: 0; }
.tt-slot strong { display: block; color: var(--navy); }

.tt-sheet {
  border: 2px solid var(--navy);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  margin-top: 8px;
}
.tt-sheet-banner {
  background: var(--navy);
  color: #fff;
  text-align: center;
  padding: 14px 12px 12px;
}
.tt-sheet-banner strong {
  display: block;
  color: var(--gold-bright);
  font-size: 1.05rem;
  letter-spacing: .02em;
}
.tt-sheet-banner span {
  display: block;
  margin-top: 2px;
  font-size: .85rem;
  opacity: .9;
}
.tt-sheet-title {
  margin: 12px 14px 4px;
  text-align: center;
  color: var(--navy);
  font-size: 1.15rem;
}
.tt-sheet-sub {
  margin: 0 14px 12px;
  text-align: center;
  color: var(--navy-mid);
  font-weight: 700;
}
.tt-day-block { padding: 0 12px 14px; }
.tt-day-label {
  background: var(--navy);
  color: var(--gold-bright);
  font-weight: 800;
  letter-spacing: .04em;
  padding: 7px 12px;
  border-radius: 6px 6px 0 0;
}
.tt-sheet-grid {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  border: 1px solid var(--navy);
}
.tt-sheet-grid th,
.tt-sheet-grid td {
  border: 1px solid var(--navy);
  padding: 8px 6px;
  text-align: center;
  vertical-align: top;
  font-size: .78rem;
}
.tt-sheet-grid th {
  background: var(--gold);
  color: var(--navy);
  font-weight: 800;
  white-space: nowrap;
}
.tt-sheet-grid td { min-width: 110px; }
.tt-break {
  background: #F4F6F9;
  font-weight: 800;
  color: var(--navy);
  writing-mode: horizontal-tb;
}
.tt-cell { padding: 4px 2px; }
.tt-cell strong { display: block; color: var(--navy); }
.tt-cell em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
}
.tt-cell span { display: block; color: var(--navy-mid); font-weight: 650; }

.result-card, .att-sheet {
  background: #fff;
  border: 2px solid var(--navy);
  border-radius: 12px;
  padding: 22px 22px 16px;
  margin-bottom: 18px;
}
.result-card-head, .att-sheet-head {
  text-align: center;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.result-card-head-row {
  display: block;
  text-align: center;
}
.result-photo {
  width: 92px;
  height: 110px;
  object-fit: cover;
  border: 2px solid var(--navy);
  border-radius: 6px;
  background: #F4F6F9;
  flex-shrink: 0;
}
.result-photo-fallback {
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--navy);
  background: var(--gold);
}
.result-uni, .att-sheet-head p {
  margin: 0;
  color: var(--navy);
  font-weight: 800;
  letter-spacing: .02em;
}
.result-card-head h2, .att-sheet-head h2 {
  margin: 6px 0 4px;
  color: var(--navy);
  font-size: 1.25rem;
}
.result-degree { margin: 0; font-weight: 700; color: var(--navy-mid); }
.result-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
  margin: 0 0 16px;
}
.result-meta div { display: grid; grid-template-columns: 140px 1fr; gap: 4px 10px; align-items: baseline; }
.result-meta dt { margin: 0; color: var(--muted); font-weight: 650; font-size: .82rem; }
.result-meta dd { margin: 0; font-weight: 750; color: var(--navy); }
.result-sem-title {
  margin: 0 0 8px;
  background: var(--navy);
  color: var(--gold-bright);
  padding: 8px 12px;
  font-size: .95rem;
  border-radius: 6px;
}
.result-table th, .result-table td { font-size: .82rem; }
.result-total td { background: #F4F6F9; border-top: 2px solid var(--navy); }
.result-grand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px solid var(--gold);
  background: rgba(229, 184, 11, .12);
  font-weight: 700;
  color: var(--navy);
}
.result-grand strong { font-size: 1.15rem; }
.result-notes { font-size: .82rem; color: var(--muted); }
.result-notes ul { margin: 4px 0 0; padding-left: 18px; }
.att-days { overflow-x: auto; }
.att-days-table th, .att-days-table td {
  font-size: .72rem;
  text-align: center;
  white-space: nowrap;
  min-width: 52px;
}
.att-mark { font-weight: 800; }
.att-p { color: var(--success); }
.att-a { color: var(--danger); }
.att-l { color: var(--warn); }

.fee-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.fee-summary-grid.has-exam {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.fee-summary-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #F8FAFC;
}
.fee-summary-card span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.fee-summary-card strong {
  font-size: 1.2rem;
  color: var(--navy);
}
.fee-summary-card.is-paid {
  background: #ECFDF3;
  border-color: #ABEFC6;
}
.fee-summary-card.is-paid strong { color: var(--success); }
.fee-summary-card.is-due {
  background: #FFFAEB;
  border-color: #FEDF89;
}
.fee-summary-card.is-due strong { color: var(--warn); }
.fee-summary-card.is-exam {
  background: #EFF6FF;
  border-color: #BFDBFE;
}
.fee-summary-card.is-exam strong { color: #1D4ED8; }
.fee-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.fee-breakdown-item {
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #FAFBFC;
}
.fee-breakdown-item span {
  display: block;
  color: var(--muted);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.fee-breakdown-item strong {
  font-size: 1rem;
  color: var(--navy);
}
.fee-inst-table { min-width: 520px; }
.fee-inst-table td:last-child,
.fee-inst-table th:last-child { text-align: center; }
.fee-inst-table td:nth-child(4),
.fee-inst-table th:nth-child(4) { text-align: right; }

@media (max-width: 900px) {
  .fee-summary-grid,
  .fee-summary-grid.has-exam { grid-template-columns: 1fr; }
}

@media print {
  @page { size: A4 portrait; margin: 10mm; }
  html, body {
    background: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .sidebar, .topbar, .app-footer, .menu-toggle, .no-print, .std-chrome, .std-page-title, .alert {
    display: none !important;
  }
  .app-shell, .main-wrap, .content {
    display: block;
    padding: 0;
    margin: 0;
    background: #fff;
    width: 100%;
  }
  .print-surface, .result-card, .att-sheet, .tt-sheet {
    box-shadow: none;
    border-radius: 0;
    margin: 0;
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .result-sem-title, .result-grand, .std-section-head {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-dl { grid-template-columns: 1fr; gap: 2px; }
  .profile-dl dt { margin-top: 8px; }
  .result-meta, .result-meta div { grid-template-columns: 1fr; }
  .profile-hero-inner {
    flex-direction: column;
    text-align: center;
  }
  .profile-hero .actions { justify-content: center; }
  .std-sem-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .std-sem-tab { flex: 0 0 auto; }
  .result-card, .att-sheet, .tt-sheet { padding: 12px 10px 10px; }
  .result-grand { flex-wrap: wrap; }
}
