:root {
  --primary-color: #15803d;
  --primary-dark: #14532d;
  --primary-medium: #16a34a;
  --primary-light: #dcfce7;
  --accent-color: #22c55e;
  --background-color: #f8fafc;
  --card-color: #ffffff;
  --text-color: #1f2937;
  --muted-color: #64748b;
  --border-color: #e2e8f0;
  --danger-color: #b91c1c;
  --warning-color: #a16207;
  --sidebar-width: 276px;
  --sidebar-collapsed-width: 78px;
  --portal-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
}

html, body {
  background: var(--background-color);
  color: var(--text-color);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

a { color: var(--primary-color); }
a:hover, a:focus { color: var(--primary-dark); }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(34, 197, 94, 0.35);
  outline-offset: 2px;
}

.student-portal-page,
.student-portal-page .wrapper,
.student-portal-page .content-wrapper {
  min-height: 100vh;
  background: var(--background-color);
}

.student-portal-page .content-wrapper {
  margin-left: var(--sidebar-width);
  padding-top: 0;
  transition: margin-left 180ms ease;
}

.student-portal-page.portal-sidebar-collapsed .content-wrapper {
  margin-left: var(--sidebar-collapsed-width);
}

.student-portal-page .content-wrapper > .container {
  width: 100%;
  max-width: 1440px;
  padding: 28px 32px 42px;
}

.student-portal-page .content { padding: 0; }
.student-portal-page .main-footer { margin-left: var(--sidebar-width); }
.student-portal-page.portal-sidebar-collapsed .main-footer { margin-left: var(--sidebar-collapsed-width); }

.portal-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(180deg, var(--primary-dark) 0%, #0f3f24 100%);
  box-shadow: 8px 0 30px rgba(20, 83, 45, 0.16);
  transition: width 180ms ease, transform 180ms ease;
}

.portal-sidebar-head {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.portal-brand {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.portal-brand:hover,
.portal-brand:focus { color: #fff; text-decoration: none; }
.portal-brand img { width: 44px; height: 44px; border-radius: 50%; background: #fff; object-fit: cover; }
.portal-brand span { min-width: 0; display: flex; flex-direction: column; }
.portal-brand strong { font-size: 16px; line-height: 1.2; white-space: nowrap; }
.portal-brand small { margin-top: 3px; color: rgba(255,255,255,.7); font-size: 12px; }

.portal-sidebar-collapse {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 9px;
  color: #fff;
  background: rgba(255,255,255,.08);
}

.portal-sidebar-collapse:hover,
.portal-sidebar-collapse:focus { background: rgba(255,255,255,.17); }

.portal-student-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 14px 8px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.08);
}

.portal-avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--primary-dark);
  background: var(--primary-light);
  font-size: 18px;
}

.portal-student-photo {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.28);
  border-radius: 12px;
  background: #fff;
}

.portal-student-summary > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.portal-student-summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.portal-student-summary small { margin-top: 3px; color: rgba(255,255,255,.72); }

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

.portal-nav-label {
  display: block;
  padding: 6px 10px 9px;
  color: rgba(255,255,255,.55);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.portal-nav-link {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 3px 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  color: rgba(255,255,255,.82);
  background: transparent;
  text-align: left;
  transition: color 140ms ease, background 140ms ease, transform 140ms ease;
}

.portal-nav-link i { flex: 0 0 20px; width: 20px; text-align: center; font-size: 16px; }
.portal-nav-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-nav-link:hover,
.portal-nav-link:focus { color: #fff; background: rgba(255,255,255,.11); text-decoration: none; }
.portal-nav-link.active { color: var(--primary-dark); background: var(--primary-light); font-weight: 700; }

.portal-nav-tree { margin: 3px 0; }
.portal-nav-tree-toggle { margin: 0; }
.portal-nav-tree-toggle .portal-tree-caret {
  flex: 0 0 auto;
  width: auto;
  margin-left: auto;
  transition: transform 140ms ease;
}
.portal-nav-tree.open .portal-tree-caret { transform: rotate(180deg); }
.portal-sidebar-subnav {
  display: none;
  margin: 4px 0 7px 13px;
  padding-left: 8px;
  border-left: 1px solid rgba(255,255,255,.17);
}
.portal-nav-tree.open .portal-sidebar-subnav { display: block; }
.portal-subnav-link {
  min-height: 38px;
  padding: 8px 9px;
  font-size: 12px;
}
.portal-subnav-link i { font-size: 14px; }

.portal-sidebar-footer {
  padding: 10px 12px 14px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.portal-sidebar-footer form { margin: 0; }

.portal-sidebar-collapsed .portal-sidebar { width: var(--sidebar-collapsed-width); }
.portal-sidebar-collapsed .portal-brand span,
.portal-sidebar-collapsed .portal-student-summary > span:last-child,
.portal-sidebar-collapsed .portal-nav-link span,
.portal-sidebar-collapsed .portal-nav-label { display: none; }
.portal-sidebar-collapsed .portal-sidebar-head { padding-left: 17px; flex-direction: column; }
.portal-sidebar-collapsed .portal-sidebar-collapse { position: absolute; top: 58px; right: 7px; border-radius: 50%; background: var(--primary-medium); }
.portal-sidebar-collapsed .portal-sidebar-collapse i { transform: rotate(180deg); }
.portal-sidebar-collapsed .portal-brand { flex: none; }
.portal-sidebar-collapsed .portal-brand img { width: 42px; height: 42px; }
.portal-sidebar-collapsed .portal-student-summary { justify-content: center; margin-top: 26px; padding: 8px; }
.portal-sidebar-collapsed .portal-nav-link { justify-content: center; padding-inline: 8px; }
.portal-sidebar-collapsed .portal-sidebar-subnav,
.portal-sidebar-collapsed .portal-tree-caret { display: none; }

.portal-grade-filter {
  max-width: 430px;
  margin: 24px 0;
}
.portal-grade-filter label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-color);
  font-size: 13px;
  font-weight: 700;
}
.portal-grade-table th,
.portal-grade-table td { text-align: center; white-space: nowrap; }
.portal-grade-table th:nth-child(-n+2),
.portal-grade-table td:nth-child(-n+2) { text-align: left; }
.grade-value { color: #111827; font-weight: 700; }
.grade-locked { color: var(--muted-color); text-align: center; }
.grade-credentials-complete { color: var(--primary-color); }
.grade-credentials-pending { color: #b91c1c; }
.portal-nothing-follows { margin: 18px 0; color: var(--muted-color); text-align: center; }
.portal-grade-legend { margin-top: 12px; color: var(--muted-color); font-size: 12px; }
.college-grade-content { max-width: 1100px; margin: 0 auto; padding: 0; }
.college-grade-content .invoice h3 { margin: 0 0 24px; color: #111; line-height: 1.4; }
.college-grade-content address { color: #1f2937; line-height: 1.75; }
.college-grade-period { margin: 8px 0 22px; }
.college-grade-notes { margin-top: 18px; padding: 0; }
.college-grade-notes .well { margin-top: 10px; }
.lacking-credentials { color: #b91c1c; font-weight: 700; }
.legend-box { margin-top: 15px; font-size: 90%; }
.college-permit-content { max-width: 1100px; margin: 0 auto; padding: 0; }
.college-permit-content .invoice h3 { margin: 0 0 24px; color: #111; line-height: 1.4; }
.college-permit-content address { color: #1f2937; line-height: 1.75; }
.college-permit-table { margin-top: 18px; }

.soa-amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.college-soa-content { max-width: 1080px; margin: 0 auto; }
.college-soa {
  margin: 0;
  overflow: hidden;
  color: #111827;
  border-radius: 12px !important;
  box-shadow: none !important;
}
.college-soa-header {
  margin-bottom: 22px;
  padding: 22px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: radial-gradient(circle at 8% 14%, rgba(34,197,94,.14), transparent 32%), #f7fff9;
}
.college-soa-header p { margin: 0; }
.college-soa-title {
  width: 100%;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  color: #111;
  font-size: 24px;
  text-align: center;
}
.college-soa-student {
  margin-bottom: 20px;
  padding: 14px 18px;
  border: 1px solid rgba(34,197,94,.22);
  border-radius: 10px;
  background: #f7fff9;
}
.college-soa-student address { margin: 0; color: #1f2937; line-height: 1.75; }
.college-soa-student strong { color: #111; }
.college-soa-section-title { margin: 24px 0 12px; }
.college-soa-section-title h2 { margin: 0 0 6px; color: #111; font-size: 18px; font-weight: 700; }
.college-soa-section-title p { margin: 0; color: var(--muted-color); font-size: 13px; }
.college-soa-table-wrap {
  width: 100%;
  margin-bottom: 18px;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #fff;
}
.college-soa-table { min-width: 680px; margin-bottom: 0; }
.college-soa-table > tbody > tr > td,
.college-soa-table > thead > tr > th { padding: 10px 16px; border-color: var(--border-color); vertical-align: middle; }
.college-soa-table > tbody > tr > td:first-child { width: 52%; color: #1f2937; }
.college-soa-table > tbody > tr > td:nth-child(2),
.college-soa-table > tbody > tr > td:nth-child(3) { width: 24%; }
.college-soa-table a { color: var(--primary-color); font-weight: 700; }
.college-soa-empty {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(34,197,94,.25);
  border-radius: 12px;
  color: var(--muted-color);
  background: #f7fff9;
}
.college-soa-empty i { margin-top: 2px; color: var(--primary-color); font-size: 20px; }
.college-soa-empty strong { display: block; margin-bottom: 6px; color: #111; font-size: 15px; }
.college-soa-empty p { margin: 0; }
.soa-reminder { margin-top: 10px; padding: 8px 10px; border: 1px solid #f5c6cb; border-radius: 4px; color: #8a2a2a; background: #fcebea; font-size: 12px; }
.college-soa-print-action { margin-top: 16px; text-align: right; }

.portal-mobile-bar,
.portal-nav-overlay { display: none; }

.portal-page-shell {
  max-width: 1180px;
  margin: 0 auto;
}

.portal-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.portal-eyebrow {
  margin: 0 0 7px;
  color: var(--primary-color);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.portal-page-title {
  margin: 0;
  color: var(--text-color);
  font-size: clamp(27px, 4vw, 38px);
  font-weight: 750;
  letter-spacing: -.025em;
}

.portal-page-copy { max-width: 680px; margin: 9px 0 0; color: var(--muted-color); font-size: 15px; line-height: 1.65; }

.portal-card,
.student-portal-page .invoice,
.student-portal-page .box,
.student-portal-page .login-box-body {
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--card-color);
  box-shadow: var(--portal-shadow);
}

.portal-card { padding: 24px; }
.student-portal-page .invoice { padding: 26px; }
.student-portal-page .box { border-top: 0; }
.student-portal-page .box-header { padding: 18px 20px; border-color: var(--border-color); }
.student-portal-page .box-title { color: var(--text-color); font-weight: 700; }

.portal-dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 34px 0;
}

.portal-welcome {
  position: relative;
  overflow: hidden;
  padding: 32px;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(130deg, var(--primary-dark), var(--primary-color) 62%, var(--primary-medium));
  box-shadow: 0 18px 40px rgba(20, 83, 45, .22);
}
.portal-welcome::after { content: ""; position: absolute; width: 240px; height: 240px; right: -65px; top: -90px; border: 46px solid rgba(255,255,255,.1); border-radius: 50%; }
.portal-welcome .portal-eyebrow { color: var(--primary-light); }
.portal-welcome h1 { position: relative; z-index: 1; margin: 0; font-size: clamp(28px, 4vw, 42px); font-weight: 750; }
.portal-welcome p:last-child { position: relative; z-index: 1; max-width: 720px; margin: 12px 0 0; color: rgba(255,255,255,.82); line-height: 1.65; }

.portal-section-heading { margin: 30px 0 14px; }
.portal-section-heading h2 { margin: 0; color: var(--text-color); font-size: 20px; font-weight: 750; }
.portal-section-heading p { margin: 5px 0 0; color: var(--muted-color); }

.portal-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.portal-quick-card {
  min-height: 158px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  color: var(--text-color);
  background: var(--card-color);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.portal-quick-card:hover,
.portal-quick-card:focus { color: var(--text-color); border-color: #86efac; transform: translateY(-3px); box-shadow: 0 15px 32px rgba(21,128,61,.12); text-decoration: none; }
.portal-quick-icon { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 12px; color: var(--primary-dark); background: var(--primary-light); font-size: 19px; }
.portal-quick-card strong { font-size: 16px; }
.portal-quick-card small { margin-top: 6px; color: var(--muted-color); line-height: 1.45; }

.portal-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 28px; }
.portal-info-item { padding: 15px 0; border-bottom: 1px solid var(--border-color); }
.portal-info-item span { display: block; margin-bottom: 5px; color: var(--muted-color); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.portal-info-item strong { display: block; color: var(--text-color); font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }

.portal-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn.portal-primary,
.student-portal-page .btn-primary { border-color: var(--primary-color); color: #fff; background: var(--primary-color); }
.btn.portal-primary:hover,
.btn.portal-primary:focus,
.student-portal-page .btn-primary:hover,
.student-portal-page .btn-primary:focus { border-color: var(--primary-dark); color: #fff; background: var(--primary-dark); }
.btn.portal-secondary { border-color: #bbf7d0; color: var(--primary-dark); background: var(--primary-light); }
.btn.portal-secondary:hover,
.btn.portal-secondary:focus { border-color: #86efac; color: var(--primary-dark); background: #bbf7d0; }

.portal-alert { border: 0; border-left: 4px solid; border-radius: 10px; }
.portal-alert.alert-danger { border-left-color: var(--danger-color); background: #fef2f2; color: #991b1b; }
.portal-alert.alert-success { border-left-color: var(--primary-medium); background: #f0fdf4; color: var(--primary-dark); }
.portal-alert.alert-info { border-left-color: #0284c7; background: #f0f9ff; color: #075985; }

.portal-student-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--border-color);
}
.portal-student-meta > div { min-height: 82px; padding: 15px 16px; background: #fff; }
.portal-student-meta span { display: block; color: var(--muted-color); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.portal-student-meta strong { display: block; margin-top: 6px; color: var(--text-color); font-size: 14px; overflow-wrap: anywhere; }

.portal-table-wrap { overflow-x: auto; border: 1px solid var(--border-color); border-radius: 12px; }
.student-portal-page .portal-table { margin: 0; background: #fff; }
.student-portal-page .portal-table > thead > tr > th { padding: 13px 14px; border-bottom: 2px solid #bbf7d0; color: var(--primary-dark); background: #f0fdf4; font-size: 12px; letter-spacing: .03em; text-transform: uppercase; }
.student-portal-page .portal-table > tbody > tr > td { padding: 14px; border-color: var(--border-color); vertical-align: middle; }
.student-portal-page .portal-table > tbody > tr:hover { background: #f8fffa; }
.portal-amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.portal-total-row td { color: var(--primary-dark); background: #f0fdf4; font-weight: 750; }

.portal-status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.portal-status.available { color: #166534; background: #dcfce7; }
.portal-status.unavailable { color: #991b1b; background: #fee2e2; }

.portal-empty { padding: 48px 20px; text-align: center; color: var(--muted-color); }
.portal-empty i { display: block; margin-bottom: 12px; color: #94a3b8; font-size: 34px; }
.portal-empty strong { display: block; margin-bottom: 6px; color: var(--text-color); font-size: 17px; }

.portal-reminder { margin-top: 18px; padding: 12px 14px; border: 1px solid #fde68a; border-radius: 10px; color: #854d0e; background: #fffbeb; font-size: 12px; }

.portal-auth-page { min-height: 100vh; background: radial-gradient(circle at 10% 10%, #dcfce7 0, transparent 30%), var(--background-color); }
.portal-auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(360px,.85fr); }
.portal-auth-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: clamp(42px,7vw,96px); color: #fff; background: linear-gradient(145deg, var(--primary-dark), var(--primary-color)); }
.portal-auth-hero::after { content:""; position:absolute; right:-130px; bottom:-160px; width:430px; height:430px; border:75px solid rgba(255,255,255,.08); border-radius:50%; }
.portal-auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; margin-bottom: 48px; }
.portal-auth-brand img { width: 60px; height: 60px; border-radius: 50%; background: #fff; }
.portal-auth-brand strong { display: block; font-size: 17px; }
.portal-auth-brand span { color: rgba(255,255,255,.75); }
.portal-auth-hero h1 { position: relative; z-index: 1; max-width: 650px; margin: 0; font-size: clamp(36px,5vw,62px); font-weight: 760; line-height: 1.06; letter-spacing: -.04em; }
.portal-auth-hero > p { position: relative; z-index: 1; max-width: 590px; margin: 22px 0 0; color: rgba(255,255,255,.82); font-size: 17px; line-height: 1.7; }
.portal-auth-services { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.portal-auth-services span { padding: 8px 12px; border: 1px solid rgba(255,255,255,.17); border-radius: 999px; color: rgba(255,255,255,.87); background: rgba(255,255,255,.08); font-size: 12px; }
.portal-auth-panel { display: flex; align-items: center; justify-content: center; padding: 34px; }
.portal-login-card { width: min(100%, 440px); padding: 34px; border: 1px solid var(--border-color); border-radius: 20px; background: #fff; box-shadow: var(--portal-shadow); }
.portal-login-card h2 { margin: 0; color: var(--text-color); font-size: 27px; font-weight: 750; }
.portal-login-card > p { margin: 8px 0 24px; color: var(--muted-color); line-height: 1.55; }
.portal-login-card label { color: var(--text-color); font-size: 13px; }
.portal-login-card .form-control { height: 46px; border-color: var(--border-color); border-radius: 9px; box-shadow: none; }
.portal-login-card .form-control:focus { border-color: var(--primary-medium); box-shadow: 0 0 0 3px rgba(34,197,94,.14); }
.portal-login-card .form-group { margin-bottom: 18px; }
.portal-login-button { width: 100%; min-height: 47px; border: 0; border-radius: 9px; color: #fff; background: var(--primary-color); font-weight: 750; }
.portal-login-button:hover,
.portal-login-button:focus { background: var(--primary-dark); }
.portal-login-note { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border-color); color: var(--muted-color); font-size: 12px; line-height: 1.5; }
.portal-checkbox { display: flex; align-items: center; gap: 7px; color: var(--muted-color); font-weight: 500 !important; }

@media (max-width: 1100px) {
  .portal-quick-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .portal-student-meta { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 991px) {
  .student-portal-page { padding-top: 62px; }
  .student-portal-page .content-wrapper,
  .student-portal-page.portal-sidebar-collapsed .content-wrapper,
  .student-portal-page .main-footer,
  .student-portal-page.portal-sidebar-collapsed .main-footer { margin-left: 0; }
  .student-portal-page .content-wrapper > .container { padding: 22px 18px 34px; }
  .portal-mobile-bar { position: fixed; inset: 0 0 auto; z-index: 1035; height: 62px; display: flex; align-items: center; gap: 12px; padding: 8px 14px; color: #fff; background: var(--primary-dark); box-shadow: 0 5px 18px rgba(15,23,42,.14); }
  .portal-mobile-bar a { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; }
  .portal-mobile-bar a:hover,
  .portal-mobile-bar a:focus { color: #fff; text-decoration: none; }
  .portal-mobile-bar img { width: 40px; height: 40px; border-radius: 50%; background: #fff; }
  .portal-mobile-menu { width: 40px; height: 40px; padding: 0; border: 1px solid rgba(255,255,255,.18); border-radius: 9px; color: #fff; background: rgba(255,255,255,.08); }
  .portal-sidebar,
  .portal-sidebar-collapsed .portal-sidebar { width: min(88vw, 300px); transform: translateX(-105%); }
  .portal-nav-open .portal-sidebar { transform: translateX(0); }
  .portal-sidebar-collapsed .portal-brand span,
  .portal-sidebar-collapsed .portal-student-summary > span:last-child,
  .portal-sidebar-collapsed .portal-nav-link span,
  .portal-sidebar-collapsed .portal-nav-label { display: initial; }
  .portal-sidebar-collapsed .portal-sidebar-head { padding: 14px 14px 14px 18px; flex-direction: row; }
  .portal-sidebar-collapsed .portal-sidebar-collapse { position: static; border-radius: 9px; background: rgba(255,255,255,.08); }
  .portal-sidebar-collapsed .portal-sidebar-collapse i { transform: none; }
  .portal-sidebar-collapsed .portal-student-summary { justify-content: flex-start; margin-top: 16px; padding: 13px; }
  .portal-sidebar-collapsed .portal-nav-link { justify-content: flex-start; padding-inline: 12px; }
  .portal-sidebar-collapsed .portal-tree-caret { display: inline-block; margin-left: auto; }
  .portal-sidebar-collapsed .portal-nav-tree.open .portal-sidebar-subnav { display: block; }
  .portal-sidebar-collapse { display: none; }
  .portal-nav-overlay { position: fixed; inset: 0; z-index: 1038; background: rgba(15,23,42,.48); backdrop-filter: blur(2px); }
  .portal-nav-open .portal-nav-overlay { display: block; }
  .portal-auth-shell { grid-template-columns: 1fr; }
  .portal-auth-hero { min-height: 390px; padding: 48px 28px; }
  .portal-auth-brand { margin-bottom: 34px; }
  .portal-auth-panel { padding: 30px 18px 48px; }
}

@media (max-width: 640px) {
  .portal-page-header { flex-direction: column; }
  .portal-quick-grid,
  .portal-info-grid { grid-template-columns: 1fr; }
  .portal-welcome { padding: 25px 22px; }
  .portal-card,
  .student-portal-page .invoice { padding: 18px; border-radius: 13px; }
  .portal-student-meta { grid-template-columns: 1fr; }
  .portal-login-card { padding: 26px 22px; }
  .portal-auth-hero { min-height: 0; padding: 28px 22px 30px; }
  .portal-auth-brand { margin-bottom: 22px; }
  .portal-auth-brand img { width: 48px; height: 48px; }
  .portal-auth-hero h1 { font-size: 32px; }
  .portal-auth-hero > p { margin-top: 14px; font-size: 14px; line-height: 1.55; }
  .portal-auth-services { display: none; }
  .portal-auth-panel { padding-top: 20px; }
}

@media print {
  @page { size: A4; margin: 13mm; }
  body { color: #111 !important; background: #fff !important; }
  .portal-sidebar,
  .portal-mobile-bar,
  .portal-nav-overlay,
  .portal-actions,
  .main-footer,
  .no-print,
  button { display: none !important; }
  .student-portal-page { padding: 0 !important; }
  .student-portal-page .content-wrapper,
  .student-portal-page.portal-sidebar-collapsed .content-wrapper { margin: 0 !important; background: #fff !important; }
  .student-portal-page .content-wrapper > .container { max-width: none; padding: 0; }
  .portal-card,
  .student-portal-page .invoice { border: 0; box-shadow: none; padding: 0; }
  .portal-table-wrap { overflow: visible; border-color: #777; }
  .portal-table { break-inside: auto; }
  .portal-table tr { break-inside: avoid; break-after: auto; }
  .portal-table thead { display: table-header-group; }
  a { color: #111 !important; text-decoration: none !important; }
}
