.student-portal{min-height:100vh;background:linear-gradient(150deg,#f6fbff,#e7f1ff);color:#133156}
.student-portal>header{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#082b51;color:white;padding:12px max(18px,calc((100vw - 1080px)/2))}
.sp-brand{display:flex;align-items:center;gap:10px;font-weight:800}.sp-brand img{width:45px}.sp-brand small{display:block;font-weight:500;color:#bce0ff}
.sp-content{max-width:1120px;margin:auto;padding:clamp(12px,3vw,28px)}
.sp-hero{background:linear-gradient(112deg,#092f58,#066bb1);color:white;border-radius:20px;padding:24px;display:flex;align-items:center;gap:18px}
.sp-hero img{width:72px;height:72px;object-fit:cover;border-radius:50%;border:3px solid white}.sp-hero h1{margin:4px 0;font-size:clamp(20px,4vw,34px)}.sp-hero p{margin:0;color:#e2f2ff}
.sp-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:14px 0}.sp-summary .card{margin:0}.sp-summary strong{display:block;font-size:clamp(18px,3vw,26px);margin-top:6px}
.sp-tabs{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:12px}.sp-tabs [aria-pressed=true]{background:#105aa9;color:white}
.sp-panel h2{font-size:19px;margin:0 0 10px}.sp-panel :is(.tablewrap,p)+h2{margin-top:22px}.sp-panel thead{background:#e8f2ff}
@media(max-width:530px){.sp-summary{grid-template-columns:1fr}.sp-hero{padding:14px;gap:10px}.sp-hero img{width:53px;height:53px}}
.sp-course,.sp-activity{padding:12px;border:1px solid #cbdff1;border-radius:12px;margin-bottom:8px;background:#f6faff}
.sp-course summary,.sp-activity summary{cursor:pointer;font-weight:700}
.sp-course summary small,.sp-activity summary strong{display:inline-block;margin-left:8px;color:#105aa9}
.sp-course+h2,.sp-panel .tablewrap+h2{margin-top:20px}.sp-instructions{white-space:pre-wrap;overflow-wrap:anywhere}
.sp-classroom-grid {
 display: grid;
 grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
 gap: 14px;
 margin: 14px 0 24px;
}
.sp-classroom-card {
 display: grid;
 align-content: start;
 gap: 8px;
 text-align: left;
 padding: 20px;
 color: #133156;
 background: linear-gradient(155deg, #e6f2ff, #fff 78%);
 border: 1px solid #bed5ed;
 border-radius: 14px;
 cursor: pointer;
}
.sp-classroom-card:hover, .sp-classroom-card:focus-visible { border-color: #105aa9; }
.sp-classroom-card strong { font-size: 1.15rem; }
.sp-classroom-card span, .sp-classroom-card small { color: #365675; }
.sp-classroom-card .sp-open-classroom { color: #105aa9; font-weight: 700; }
.sp-classroom-banner {
 margin: 14px 0;
 padding: clamp(16px, 4vw, 28px);
 border-radius: 14px;
 background: linear-gradient(110deg, #092f58, #066bb1);
 color: #fff;
 overflow-wrap: anywhere;
}
.sp-classroom-banner h2 { color: inherit; font-size: clamp(1.35rem, 3vw, 2rem); margin: 5px 0; }
.sp-classroom-banner p { margin: 4px 0; }
.sp-resource-list { list-style: none; padding: 0; }
.sp-resource-list li {
 display: flex;
 align-items: center;
 justify-content: space-between;
 flex-wrap: wrap;
 gap: 12px;
 padding: 12px;
 border-bottom: 1px solid #cbdff1;
 overflow-wrap: anywhere;
}
.sp-resource-list small { display: block; margin-top: 4px; }
.sp-classroom-group + .sp-classroom-group { margin-top: 20px; }

.sp-header-actions { display:flex; align-items:center; gap:10px; }
.sp-bell { position:relative; flex:none; min-width:42px; padding:7px; }
.sp-bell img { display:block; width:25px; height:25px; object-fit:contain; margin:auto; }
.sp-bell [data-notice-count] {
 position:absolute; top:-5px; right:-5px; min-width:18px; padding:2px 4px;
 border-radius:20px; background:#b52239; color:white; font-size:.7rem; line-height:1.2;
}
.sp-notice-heading { display:flex; align-items:center; flex-wrap:wrap; justify-content:space-between; gap:8px; }
.sp-notice-heading h2 { margin:0; }
.sp-notice-panel ul { list-style:none; margin:10px 0 0; padding:0; }
.sp-notice-panel li + li { margin-top:6px; }
.sp-notice-panel .sp-notice-item {
 display:grid; gap:4px; width:100%; padding:12px; text-align:left; border:1px solid #cedeef;
 border-radius:10px; background:#fff; color:inherit; font:inherit; overflow-wrap:anywhere;
}
.sp-notice-panel [data-open-notice] { cursor:pointer; }
.sp-notice-panel [data-open-notice]:hover { border-color:#4787bd; }
.sp-notice-panel .sp-notice-new { border-left:4px solid #105aa9; background:#edf6ff; }
.sp-notice-panel .sp-notice-item small, .sp-notice-panel .sp-notice-item span { color:#365675; font-size:.85rem; }

@media screen and (max-width:600px) {
 .student-portal > header {
   display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:10px 12px;
 }
 .sp-brand {min-width:0;gap:6px}
 .sp-brand span {min-width:0;overflow-wrap:anywhere}
 .sp-brand img {width:34px;flex:none}
 .sp-brand button {flex:none;min-width:38px;padding-inline:7px}
 .sp-header-actions {gap:5px;justify-self:end}
 .sp-header-actions .btn {min-height:44px;padding-inline:8px;line-height:1.15;font-size:.85rem}
 .sp-header-actions .sp-bell {min-width:44px}
 .sp-hero > div {min-width:0;overflow-wrap:anywhere}
 .sp-hero img {flex:none}
 .sp-tabs .btn {min-height:44px;white-space:normal}
 .sp-panel :is(select,textarea,input:not([type=checkbox],[type=radio])) {min-width:0;max-width:100%;font-size:16px}
}
@media screen and (max-width:340px) {
 .sp-brand {font-size:.85rem}
 .sp-brand img {width:29px}
 .sp-header-actions .btn:not(.sp-bell) {max-width:72px;white-space:normal}
}

/* Student dashboard */
.sp-dashboard {
 display:grid;
 grid-template-columns:clamp(190px,17vw,260px) minmax(0,1fr);
 grid-template-rows:auto 1fr;
 background:linear-gradient(130deg,#f4f8ff,#dcecff);
 color:#101e53;
}
.sp-dashboard > header {
 grid-column:2; display:flex; padding:10px clamp(14px,2.3vw,34px); min-height:62px;
 color:#10245c; background:#f7faff; border-bottom:1px solid #d6e5fa;
}
.sp-dashboard .sp-brand small { color:#172b62; font-weight:600; padding-left:13px; border-left:1px solid #afcaec; }
.sp-dashboard .sp-brand img { width:37px; }
.sp-account { display:flex; gap:8px; align-items:center; max-width:245px; text-align:left; }
.sp-account img { width:24px; height:24px; object-fit:contain; }
.sp-sidebar {
 grid-column:1; grid-row:1 / span 2; display:flex; flex-direction:column; gap:20px;
 padding:18px 10px; color:#fff;
 background:
  radial-gradient(ellipse at -60% -6%,#087de1 26%,transparent 27%),
  radial-gradient(ellipse at 135% 104%,#0755ac 34%,transparent 34.5%),
  linear-gradient(155deg,#03285a,#032150 65%,#064486);
}
.sp-side-brand { display:grid; justify-items:center; gap:4px; text-align:center; line-height:1.2; }
.sp-side-brand img { width:65px; height:65px; object-fit:contain; }
.sp-side-brand strong { font-size:1.3rem; }
.sp-side-brand span { font-size:.82rem; }
.sp-side-brand b { margin-top:4px; padding:6px 14px; border-radius:30px; background:#0867d6; font-size:.85rem; }
.sp-sidebar nav { display:grid; gap:4px; }
.sp-sidebar nav button {
 display:flex; align-items:center; gap:11px; padding:9px 12px; border:0; border-radius:12px; text-align:left;
 color:inherit; background:transparent; font:inherit; font-size:.87rem; font-weight:680; cursor:pointer;
}
.sp-sidebar nav button:hover { background:#ffffff1a; }
.sp-sidebar nav button[aria-current="page"] { background:linear-gradient(105deg,#009bf0,#065ee5 52%,#743bea); }
.sp-sidebar nav img { flex:none; width:26px; height:26px; padding:3px; border-radius:7px; background:#eff6ff; object-fit:contain; }
.sp-sidebar .sp-exit { margin:auto 4px 0; border-radius:28px; border:1px solid #c1ddff; color:white; background:#0c4c947a; text-align:center; }
.sp-dashboard .sp-content { grid-column:2; width:100%; max-width:none; margin:0; min-width:0; padding:clamp(12px,1.5vw,24px); }
.sp-dashboard .sp-hero {
 min-height:170px; gap:18px; border:1px solid white; border-radius:20px;
 background:linear-gradient(95deg,#0752a8 14%,#0b6ecbdf 47%,#056bc228 100%),url('/static/assets/campus-home-hero.jpg') right center/cover;
 box-shadow:0 5px 14px #0654a929;
}
.sp-dashboard .sp-hero > img { width:clamp(72px,10vw,140px); height:clamp(72px,10vw,140px); border:4px solid white; box-shadow:0 5px 15px #00234f55; flex:none; }
.sp-dashboard .sp-hero h1 { color:#fff; font-size:clamp(1.4rem,3vw,2.7rem); line-height:1.04; }
.sp-dashboard .sp-program { font-size:clamp(.95rem,1.7vw,1.35rem); font-weight:700; }
.sp-hero-facts { display:flex; flex-wrap:wrap; gap:6px 12px; margin-top:12px; padding:8px 10px; background:#003373b8; border-radius:10px; font-size:.85rem; }
.sp-home-layout { display:grid; grid-template-columns:minmax(0,2.1fr) minmax(235px,1fr); gap:12px; margin-top:12px; align-items:start; }
.sp-home-main,.sp-home-rail { min-width:0; }
.sp-dashboard .sp-summary { margin:0 0 12px; gap:8px; grid-template-columns:repeat(3,minmax(0,1fr)); }
.sp-dashboard .sp-summary .card,.sp-dashboard .sp-rail-card,.sp-dashboard .sp-panel.card {
 border:1px solid #dbeaff; border-radius:17px; background:#f9fbffeb; box-shadow:0 4px 12px #1b5ca51d;
}
.sp-dashboard .sp-summary .card { display:flex; align-items:center; gap:8px; padding:10px; min-width:0; }
.sp-dashboard .sp-summary strong { margin:2px 0 0; font-size:clamp(.95rem,1.8vw,1.7rem); overflow-wrap:anywhere; }
.sp-metric-icon { display:grid; place-items:center; flex:0 0 35px; height:38px; border-radius:10px; background:#e4f2ff; }
.sp-metric-icon img { width:24px; height:24px; object-fit:contain; }
.sp-dashboard .sp-classroom-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; margin:10px 0 0; }
.sp-dashboard .sp-classroom-card {
 position:relative; min-height:103px; min-width:0; padding:11px 28px 11px 10px; gap:3px; overflow:hidden;
 background:radial-gradient(ellipse 110% 52% at 106% 112%,var(--sp-wave) 98%,transparent),linear-gradient(125deg,var(--sp-light),var(--sp-wave));
 border:1px solid #ffffff91; color:#10224d; border-radius:16px; overflow-wrap:anywhere;
}
.sp-classroom-card:nth-child(6n+1) { --sp-light:#e7f9ff; --sp-wave:#a6dff9; }
.sp-classroom-card:nth-child(6n+2) { --sp-light:#f1e7ff; --sp-wave:#dac0fa; }
.sp-classroom-card:nth-child(6n+3) { --sp-light:#e4fff3; --sp-wave:#b8efda; }
.sp-classroom-card:nth-child(6n+4) { --sp-light:#fff0fa; --sp-wave:#f4c7e6; }
.sp-classroom-card:nth-child(6n+5) { --sp-light:#fff9e2; --sp-wave:#fbe7a7; }
.sp-classroom-card:nth-child(6n+6) { --sp-light:#f2eeff; --sp-wave:#d9d0f8; }
.sp-course-icon img { width:22px; height:22px; object-fit:contain; }
.sp-dashboard .sp-open-classroom { position:absolute; right:7px; bottom:8px; border-radius:50%; background:white; padding:4px 6px; color:#034aa4; }
.sp-home-rail { display:grid; gap:10px; }
.sp-dashboard .sp-rail-card { padding:12px; margin:0; }
.sp-rail-card h2 { display:flex; align-items:center; gap:7px; font-size:1rem; margin:0 0 10px; }
.sp-rail-card h2 img { width:24px; height:24px; object-fit:contain; }
.sp-progress { display:flex; align-items:center; gap:10px; }
.sp-progress p { margin:0; font-size:.85rem; }
.sp-progress p span { display:block; margin-top:4px; }
.sp-progress-ring { display:grid; place-items:center; flex:0 0 67px; height:67px; border-radius:50%; background:conic-gradient(#0a66df var(--progress),#d5e9ff 0); }
.sp-progress-ring strong { display:grid; place-items:center; width:51px; height:51px; border-radius:50%; background:#f8fbff; }
.sp-balance-link { display:flex; align-items:center; gap:9px; width:100%; padding:8px; border:0; border-radius:12px; background:#dcf7ed; color:#096644; text-align:left; cursor:pointer; font:inherit; }
.sp-balance-link img { width:29px; height:29px; object-fit:contain; }
.sp-balance-link strong { display:block; font-size:1.25rem; }
.sp-balance-link b { margin-left:auto; }
.sp-quick { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.sp-quick button { display:grid; justify-items:center; gap:3px; padding:6px; min-height:44px; border:1px solid #dbeaff; border-radius:10px; color:#152a62; background:#f0f7ff; font:inherit; font-size:.75rem; cursor:pointer; }
.sp-quick img { width:21px; height:21px; object-fit:contain; }
.sp-dashboard [hidden] { display:none !important; }
@media(max-width:1050px){ .sp-dashboard .sp-classroom-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:850px){ .sp-dashboard { grid-template-columns:1fr; } .sp-dashboard > header,.sp-dashboard .sp-content { grid-column:1; } .sp-dashboard > header { grid-row:1; } .sp-sidebar { grid-column:1; grid-row:auto; padding:8px; display:flex; gap:8px; } .sp-side-brand { display:none; } .sp-sidebar nav { max-height:11rem; overflow-y:auto; } .sp-sidebar .sp-exit { margin:0; align-self:start; } }
@media(max-width:660px){ .sp-home-layout { grid-template-columns:minmax(0,1fr); } .sp-dashboard .sp-summary .card { flex-direction:column; text-align:center; } .sp-dashboard .sp-brand small,.sp-account span { display:none; } .sp-dashboard .sp-hero { padding:12px; } }
