:root{
    --mb-purple:#6d45f5;
    --mb-purple-soft:#eee8ff;
    --mb-bg:#fbfbfc;
    --mb-line:#e5e7eb;
    --mb-text:#1f232b;
    --mb-muted:#5d6675;
}

*{ box-sizing:border-box; }
body{
    margin:0;
    font-family: Arial, sans-serif;
    background:var(--mb-bg)!important;
    color:var(--mb-text);
}
a{ color:var(--mb-purple); }

.student-shell{
    min-height:calc(100vh - 1px);
    background:var(--mb-bg);
    display:grid;
    grid-template-columns:248px minmax(0,1fr);
}
.student-main{
    min-width:0;
    padding:44px 54px;
}
.mobile-topbar{ display:none; }
.sidebar-scrim{ display:none; }

.sidebar{
    min-height:100vh;
    background:#fff;
    border-right:1px solid var(--mb-line);
    display:flex;
    flex-direction:column;
    padding:24px 12px 20px;
}
.sidebar-inner{ display:flex; flex-direction:column; min-height:100%; }
.brand-row{
    display:flex;
    align-items:center;
    gap:10px;
    padding:0 8px 16px;
    border-bottom:1px solid var(--mb-line);
    margin-bottom:14px;
}
.brand-mark{
    width:38px;
    height:38px;
    border-radius:8px;
    background:var(--mb-purple);
    display:grid;
    place-items:center;
    color:#fff;
    font-size:21px;
    box-shadow:0 5px 14px rgba(109,69,245,.18);
}
.brand-name{ font-weight:800; font-size:15px; color:#111827; }
.student-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    padding:0 8px 16px;
    font-size:12px;
    color:#111827;
}
.portal-tag{
    background:#f4f4f5;
    border-radius:7px;
    padding:5px 10px;
    font-size:11px;
    color:#111827;
}
.side-nav{ display:grid; gap:7px; }
.nav-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    height:38px;
    padding:0 10px;
    border-radius:7px;
    color:#151922;
    text-decoration:none;
    font-size:14px;
}
.nav-item span:first-child{ display:inline-flex; align-items:center; gap:8px; }
.nav-item i{ width:16px; text-align:center; font-size:15px; }
.nav-item:hover{ background:#f5f5f6; color:#151922; }
.nav-item.active{ background:var(--mb-purple-soft); color:var(--mb-purple); font-weight:700; }
.sidebar-bottom{
    margin-top:auto;
    border-top:1px solid var(--mb-line);
    padding:18px 8px 0;
}
.signed-in{ display:flex; gap:9px; align-items:center; margin-bottom:12px; }
.avatar{
    width:29px;
    height:29px;
    border-radius:50%;
    background:#efe7ff;
    color:#5d32d6;
    display:grid;
    place-items:center;
    font-size:13px;
    flex:0 0 auto;
}
.signed-in small{ display:block; color:var(--mb-muted); line-height:1.25; }
.signed-in strong{ display:block; color:#111827; font-size:11px; overflow-wrap:anywhere; }
.sign-out{ width:100%; justify-content:flex-start; background:#f7f7f8; }
.burger-btn{
    width:38px;
    height:34px;
    border-radius:5px;
    border:1px solid var(--mb-line);
    background:#fff;
    color:#151922;
    display:grid;
    place-items:center;
    font-size:21px;
    line-height:1;
}

.buddy-btn,
.btn{
    border-radius:5px!important;
    letter-spacing:0!important;
}
.btn-primary,
.buddy-btn.primary{
    background:var(--mb-purple)!important;
    border-color:var(--mb-purple)!important;
    color:#fff!important;
}
.form-control,
.form-select,
.input-group-text{
    border-radius:6px!important;
    border-color:var(--mb-line)!important;
    min-height:38px;
    font-size:14px;
}

.sdash-wrap,
.sless-wrap,
.sinv-wrap{
    background:transparent!important;
    border-radius:0!important;
    padding:0!important;
}
.sdash-hero,
.sless-hero,
.sinv-hero{
    background:transparent!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    padding:0!important;
    margin-bottom:30px!important;
}
.sdash-title,
.sless-title,
.sinv-title{
    font-size:23px!important;
    line-height:1.15!important;
    margin:0 0 8px!important;
    font-weight:800!important;
    letter-spacing:0!important;
}
.sdash-sub,
.sless-hero .text-muted,
.sinv-hero .text-muted{
    color:var(--mb-muted)!important;
    font-size:14px!important;
}
.s-card,
.card{
    background:#fff!important;
    border:1px solid var(--mb-line)!important;
    border-radius:13px!important;
    box-shadow:none!important;
}
.metric{ display:flex; align-items:center; gap:12px; }
.pill,
.badge{
    border-radius:6px!important;
}
.metric-icon{
    width:44px;
    height:44px;
    display:grid;
    place-items:center;
    background:#f6f3ff;
    border:1px solid #e5ddff;
    color:#5d32d6;
    font-size:18px;
}
.metric-icon.green{
    background:#eaf7ef;
    border-color:#cdebd8;
    color:#146c43;
}
.metric-icon.gold{
    background:#fff7df;
    border-color:#f4d68a;
    color:#8a5a00;
}
.metric-value{
    font-size:1.35rem;
    font-weight:800;
    margin:0;
    line-height:1.1;
    letter-spacing:0;
}
.metric-label{ margin:0; color:var(--mb-muted); font-size:.92rem; }
.metric-icon,
.file-dot{
    border-radius:8px!important;
}
.table thead th{
    border-bottom:1px solid var(--mb-line)!important;
    color:var(--mb-muted)!important;
    font-weight:700!important;
    font-size:.8rem!important;
    text-transform:uppercase;
    letter-spacing:.04em!important;
    background:#fafafa!important;
}
.table td{ vertical-align:middle; }

.portal-panel{
    background:#fff;
    border:1px solid var(--mb-line);
    border-radius:13px;
    overflow:hidden;
    margin-bottom:22px;
}
.portal-panel-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    padding:16px 20px;
    border-bottom:1px solid var(--mb-line);
}
.portal-panel-title{ margin:0; font-size:15px; font-weight:800; }
.portal-panel-body{ padding:20px; }
.empty-state{
    min-height:120px;
    display:grid;
    place-items:center;
    color:var(--mb-muted);
    font-size:14px;
    border:1px dashed #d6d9df;
    border-radius:8px;
    background:#fcfcfd;
    text-align:center;
    padding:16px;
}

.auth-body,
.sp-wrap,
.slogin-wrap{
    min-height:100vh;
    display:grid;
    place-items:center;
    padding:22px;
    background:var(--mb-bg)!important;
}
.sp-card,
.slogin-card,
.auth-container{
    border:1px solid var(--mb-line)!important;
    border-radius:13px!important;
    box-shadow:none!important;
    background:#fff!important;
}
.sp-hero,
.slogin-hero{
    background:#fff!important;
    border-bottom:1px solid var(--mb-line)!important;
}

@media (max-width:760px){
    .student-shell{ display:block; }
    .mobile-topbar{
        display:flex;
        position:sticky;
        top:0;
        z-index:50;
        height:56px;
        align-items:center;
        justify-content:space-between;
        gap:12px;
        padding:0 16px;
        background:#fff;
        border-bottom:1px solid var(--mb-line);
    }
    .mobile-topbar .brand-mini{ display:flex; align-items:center; gap:9px; font-weight:800; }
    .mobile-topbar .brand-mark{ width:31px; height:31px; font-size:17px; border-radius:7px; }
    .sidebar{
        position:fixed;
        inset:0 auto 0 0;
        width:min(82vw,280px);
        z-index:80;
        transform:translateX(-105%);
        transition:transform .18s ease;
        box-shadow:8px 0 28px rgba(15,23,42,.14);
    }
    .sidebar-scrim{
        position:fixed;
        inset:0;
        z-index:70;
        background:rgba(15,23,42,.32);
        border:0;
    }
    .student-shell.sidebar-open .sidebar{ transform:translateX(0); }
    .student-shell.sidebar-open .sidebar-scrim{ display:block; }
    .student-main{ padding:28px 16px 36px; }
}
