*{box-sizing:border-box}
html,body{margin:0;padding:0}
:root{
    --bg:#f3f6fb;
    --bg-soft:#f8faff;
    --card:#ffffff;
    --card-soft:#fbfdff;
    --text:#172033;
    --text-soft:#5f6b85;
    --line:#e4eaf3;
    --line-strong:#d7deea;
    --primary:#2563eb;
    --primary-dark:#1d4ed8;
    --primary-soft:#eaf2ff;
    --success-bg:#dcfce7;
    --success-text:#166534;
    --warning-bg:#fef3c7;
    --warning-text:#92400e;
    --danger-bg:#fee2e2;
    --danger-text:#991b1b;
    --info-bg:#dbeafe;
    --info-text:#1d4ed8;
    --shadow-sm:0 8px 24px rgba(15,23,42,.05);
    --shadow-md:0 16px 42px rgba(15,23,42,.08);
    --shadow-lg:0 24px 70px rgba(15,23,42,.12);
    --radius:18px;
    --radius-sm:12px;
    --sidebar-width:270px;
    --topbar-height:76px;
}

body{
    font-family:Arial,Helvetica,sans-serif;
    background:var(--bg);
    color:var(--text);
    line-height:1.45;
}

a{color:inherit}
img{max-width:100%;display:block}
button,input,select,textarea{font:inherit}

.hidden{display:none!important}
.text-right{text-align:right}
.w-full{width:100%}
.mt-12{margin-top:12px}
.mt-16{margin-top:16px}
.mb-0{margin-bottom:0}

.app-shell{
    min-height:100vh;
}

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

.app-main--dashboard{
    background:
        radial-gradient(circle at top right, rgba(37,99,235,.06), transparent 25%),
        linear-gradient(180deg,#f7faff 0%, #f3f6fb 100%);
}

.app-content{
    flex:1 1 auto;
    padding:14px 14px 18px;
}

.app-content--dashboard{
    padding:12px 12px 18px;
}

.page-card{
    background:var(--card);
    border:1px solid rgba(228,234,243,.95);
    border-radius:var(--radius);
    padding:16px;
    margin:0 0 14px;
    box-shadow:var(--shadow-sm);
}

.page-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
}

.page-title{
    margin:0 0 6px;
    font-size:24px;
    line-height:1.15;
    font-weight:800;
    color:#0f172a;
}

.page-subtitle{
    margin:0;
    color:var(--text-soft);
    font-size:14px;
}

.section-title{
    margin:0;
    font-size:18px;
    font-weight:800;
    color:#0f172a;
}

.sub-section-title{
    margin:0 0 10px;
    font-size:15px;
    font-weight:800;
    color:#0f172a;
}

.section-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    margin-bottom:14px;
}

.section-link{
    font-size:13px;
    font-weight:700;
    color:var(--primary);
    text-decoration:none;
    white-space:nowrap;
}

.section-link:hover{
    text-decoration:underline;
}

.button-link{
    border:none;
    background:none;
    padding:0;
    cursor:pointer;
}

.muted-text{
    color:var(--text-soft);
    font-size:13px;
    margin-top:4px;
}

.empty-line{
    color:var(--text-soft);
    font-size:14px;
    padding:8px 0;
}

.grid-2,
.grid-3,
.stats-grid{
    display:grid;
    gap:14px;
    margin:0 0 14px;
}

.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.stats-grid{grid-template-columns:repeat(4,minmax(0,1fr))}

.stack-form{
    display:grid;
    gap:12px;
}

.inline-form{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr)) auto;
    gap:12px;
    align-items:end;
}

.inline-form-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
}

.inline-form-grid-3{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
}

.form-row{
    display:flex;
    flex-direction:column;
    gap:6px;
}

.form-row label{
    font-size:13px;
    font-weight:700;
    color:#344054;
}

.form-row input,
.form-row select,
.form-row textarea,
.form-control{
    width:100%;
    border:1px solid var(--line-strong);
    border-radius:12px;
    padding:10px 12px;
    font-size:14px;
    background:#fff;
    color:#111827;
    outline:none;
    transition:.18s ease;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus,
.form-control:focus{
    border-color:var(--primary);
    box-shadow:0 0 0 3px rgba(37,99,235,.10);
}

.checkbox-row{
    flex-direction:row;
    align-items:center;
    gap:8px;
}

.checkbox-row label{
    display:flex;
    align-items:center;
    gap:8px;
    font-weight:600;
}

.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    border:none;
    border-radius:12px;
    padding:10px 14px;
    cursor:pointer;
    font-size:14px;
    font-weight:700;
    text-decoration:none;
    transition:.16s ease;
    white-space:nowrap;
}

.btn:hover{transform:translateY(-1px)}
.btn:active{transform:translateY(0)}

.btn-primary{
    background:var(--primary);
    color:#fff;
    box-shadow:0 10px 24px rgba(37,99,235,.18);
}
.btn-primary:hover{background:var(--primary-dark)}

.btn-secondary{
    background:#f8fafc;
    color:#111827;
    border:1px solid var(--line);
}

.btn-danger{
    background:#dc2626;
    color:#fff;
}
.btn-danger:hover{background:#b91c1c}

.alert{
    padding:12px 14px;
    border-radius:12px;
    font-size:14px;
    font-weight:600;
}

.alert-success{
    background:#ecfdf5;
    color:#065f46;
    border:1px solid #a7f3d0;
}

.alert-danger{
    background:#fef2f2;
    color:#991b1b;
    border:1px solid #fecaca;
}

.list-stack{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.list-item{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    padding:12px 13px;
    border:1px solid var(--line);
    border-radius:14px;
    background:#fff;
}

.clickable-row{
    text-decoration:none;
    color:inherit;
}

.clickable-row:hover{
    background:#f8fbff;
    border-color:#d6e5ff;
}

.status-badge,
.payment-chip{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:86px;
    padding:6px 11px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
    text-transform:capitalize;
    white-space:nowrap;
}

.status-active{
    background:var(--success-bg);
    color:var(--success-text);
}
.status-pending{
    background:var(--warning-bg);
    color:var(--warning-text);
}
.status-rejected{
    background:var(--danger-bg);
    color:var(--danger-text);
}
.status-info{
    background:var(--info-bg);
    color:var(--info-text);
}

.payment-chip{
    background:#ecfdf5;
    color:#166534;
}

.detail-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px 16px;
    font-size:14px;
}

.action-row{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-top:14px;
}

.section-divider{
    border:none;
    border-top:1px solid var(--line);
    margin:16px 0;
}

.stat-card{
    background:#fff;
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:16px;
    box-shadow:var(--shadow-sm);
}

.stat-label{
    font-size:12px;
    color:var(--text-soft);
    margin-bottom:8px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.04em;
}
.stat-value{
    font-size:26px;
    font-weight:800;
    color:#111827;
    line-height:1.1;
}
.stat-sub{
    margin-top:8px;
    font-size:12px;
    color:var(--text-soft);
}

.mini-grid-2{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
}
.mini-summary-card{
    border:1px solid var(--line);
    border-radius:14px;
    padding:14px;
    background:linear-gradient(180deg,#ffffff 0%, #fafcff 100%);
}
.mini-summary-title{
    font-weight:800;
    margin-bottom:10px;
}
.mini-summary-list{
    display:grid;
    gap:8px;
    font-size:14px;
}

.quick-links{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
}
.quick-links--actions{
    grid-template-columns:1fr;
}
.quick-link{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:11px 12px;
    text-decoration:none;
    border-radius:12px;
    background:#eff6ff;
    color:#1d4ed8;
    font-weight:700;
    border:1px solid #bfdbfe;
    cursor:pointer;
}
.quick-link:hover{
    background:#dbeafe;
}

.data-table{
    width:100%;
    border-collapse:collapse;
    background:#fff;
}
.data-table th,
.data-table td{
    border:1px solid var(--line);
    padding:10px;
    text-align:left;
    font-size:14px;
    vertical-align:top;
}
.data-table th{
    background:#f8fafc;
    font-weight:800;
}

.marks-form-block{
    display:flex;
    flex-direction:column;
    gap:12px;
    margin-bottom:18px;
}
.marks-subject-title{
    margin:0;
    font-size:15px;
    font-weight:800;
}
.marks-table-wrap{
    overflow:auto;
}

.topbar-actions,
.header-actions{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.page-toolbar{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-bottom:14px;
}

/* sidebar */

.app-sidebar{
    position:fixed;
    top:0;
    left:0;
    width:var(--sidebar-width);
    height:100vh;
    background:linear-gradient(180deg,#0f172a 0%, #111827 48%, #172033 100%);
    color:#fff;
    display:flex;
    flex-direction:column;
    padding:16px 14px;
    gap:16px;
    overflow-y:auto;
    z-index:1000;
    box-shadow:20px 0 50px rgba(15,23,42,.15);
}

.app-sidebar__brand{
    display:flex;
    align-items:center;
    gap:12px;
    padding:4px 6px 14px;
    border-bottom:1px solid rgba(255,255,255,.08);
}

.app-sidebar__logo,
.app-sidebar__avatar,
.app-topbar__avatar{
    width:40px;
    height:40px;
    border-radius:999px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:800;
    background:linear-gradient(135deg,#3b82f6 0%, #2563eb 100%);
    color:#fff;
    flex:0 0 auto;
}

.app-sidebar__title{
    font-size:16px;
    font-weight:800;
    color:#fff;
}

.app-sidebar__subtitle,
.app-sidebar__user-role{
    font-size:12px;
    color:rgba(255,255,255,.65);
}

.app-sidebar__user{
    display:flex;
    align-items:center;
    gap:12px;
    padding:6px 6px;
    border:1px solid rgba(255,255,255,.06);
    border-radius:14px;
    background:rgba(255,255,255,.04);
}

.app-sidebar__user-name{
    font-size:14px;
    font-weight:700;
    color:#fff;
}

.app-sidebar__nav,
.app-sidebar__footer{
    display:flex;
    flex-direction:column;
    gap:7px;
}

.app-sidebar__nav{flex:1 1 auto}

.app-sidebar__link{
    display:flex;
    align-items:center;
    gap:10px;
    min-height:44px;
    padding:10px 12px;
    border-radius:12px;
    text-decoration:none;
    color:rgba(255,255,255,.88);
    font-size:14px;
    font-weight:700;
    transition:.16s ease;
}

.app-sidebar__link-icon{
    min-width:28px;
    height:28px;
    border-radius:10px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:rgba(255,255,255,.08);
    font-size:12px;
    font-weight:800;
}

.app-sidebar__link:hover{
    background:rgba(255,255,255,.08);
    color:#fff;
}

.app-sidebar__link.is-active{
    background:linear-gradient(135deg,#2563eb 0%, #1d4ed8 100%);
    color:#fff;
    box-shadow:0 14px 28px rgba(37,99,235,.22);
}

.app-sidebar__link.is-active .app-sidebar__link-icon{
    background:rgba(255,255,255,.16);
}

.app-sidebar__link--danger:hover{
    background:rgba(220,38,38,.18);
    color:#fff;
}

/* topbar */

.app-topbar{
    position:sticky;
    top:0;
    z-index:900;
    display:grid;
    grid-template-columns:auto 1fr auto;
    align-items:center;
    gap:14px;
    min-height:var(--topbar-height);
    padding:12px 14px;
    background:rgba(247,250,255,.92);
    backdrop-filter:blur(10px);
    border-bottom:1px solid rgba(228,234,243,.9);
}

.app-topbar__left,
.app-topbar__right{
    display:flex;
    align-items:center;
    gap:12px;
}

.app-topbar__center{
    min-width:0;
}

.app-topbar__page{
    display:flex;
    flex-direction:column;
    gap:2px;
}

.app-topbar__title{
    font-size:19px;
    font-weight:800;
    color:#0f172a;
}

.app-topbar__subtitle{
    font-size:12px;
    color:var(--text-soft);
}

.app-topbar__menu-btn{
    display:none;
    width:40px;
    height:40px;
    border:1px solid var(--line);
    border-radius:12px;
    background:#fff;
    cursor:pointer;
    font-size:18px;
    box-shadow:var(--shadow-sm);
}

.dashboard-searchbar{
    width:100%;
}

.dashboard-searchbar .form-control{
    height:44px;
    border-radius:14px;
    background:#fff;
    box-shadow:var(--shadow-sm);
}

.app-topbar__chip{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:40px;
    padding:0 14px;
    border-radius:999px;
    border:1px solid var(--line);
    background:#fff;
    text-decoration:none;
    font-size:13px;
    font-weight:700;
    color:#111827;
}

.app-topbar__profile{
    display:flex;
    align-items:center;
    gap:10px;
    text-decoration:none;
    color:#111827;
    padding:4px 6px;
    border-radius:12px;
}

.app-topbar__profile:hover{background:#fff}
.app-topbar__name{
    font-size:14px;
    font-weight:700;
}

/* modals */

.app-modal{
    position:fixed;
    inset:0;
    background:rgba(15,23,42,.48);
    display:none;
    align-items:center;
    justify-content:center;
    padding:24px;
    z-index:2000;
}
.app-modal.is-open{display:flex}

.app-modal__dialog{
    width:min(720px,100%);
    max-height:calc(100vh - 48px);
    overflow:auto;
    background:#fff;
    border-radius:20px;
    box-shadow:var(--shadow-lg);
}

.app-modal__header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:18px 18px 0;
}

.app-modal__title{
    margin:0;
    font-size:18px;
    font-weight:800;
}

.app-modal__body{padding:18px}

.app-modal__close{
    border:none;
    background:#f3f4f6;
    width:36px;
    height:36px;
    border-radius:999px;
    cursor:pointer;
    font-size:18px;
    font-weight:700;
    line-height:1;
}

.modal-open{overflow:hidden}

.app-toast-host{
    position:fixed;
    top:16px;
    right:16px;
    z-index:2500;
    display:flex;
    flex-direction:column;
    gap:10px;
    width:min(360px,calc(100vw - 32px));
}

/* unified dashboard */

.dashboard-shell{
    display:flex;
    flex-direction:column;
    gap:14px;
}

.dashboard-overview-card{
    background:
        radial-gradient(circle at top right, rgba(37,99,235,.10), transparent 32%),
        linear-gradient(135deg,#ffffff 0%, #f7fbff 100%);
    border-color:rgba(37,99,235,.12);
    box-shadow:var(--shadow-md);
}

.dashboard-overview-card__head{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:16px;
}

.dashboard-overview-card__actions{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    justify-content:flex-end;
}

.dashboard-overview-card__chips{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:14px;
}

.dashboard-module-switcher{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:16px;
}

.dashboard-module-chip{
    border:1px solid var(--line);
    background:#fff;
    color:#111827;
    border-radius:999px;
    padding:9px 14px;
    font-size:13px;
    font-weight:800;
    cursor:pointer;
    transition:.16s ease;
}

.dashboard-module-chip:hover{
    border-color:#bfd4ff;
    background:#f8fbff;
}

.dashboard-module-chip.is-active{
    background:var(--primary);
    border-color:var(--primary);
    color:#fff;
    box-shadow:0 12px 28px rgba(37,99,235,.18);
}

.dashboard-layout{
    display:grid;
    grid-template-columns:minmax(0,1fr) 310px;
    gap:14px;
    align-items:start;
}

.dashboard-workspace{
    min-width:0;
}

.dashboard-panel{
    display:none;
}

.dashboard-panel.is-active{
    display:block;
    animation:fadeSlideIn .18s ease;
}

@keyframes fadeSlideIn{
    from{opacity:.3;transform:translateY(4px)}
    to{opacity:1;transform:translateY(0)}
}

.dashboard-action-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
}

.action-card{
    border:1px solid var(--line);
    border-radius:16px;
    background:linear-gradient(180deg,#ffffff 0%, #fbfdff 100%);
    padding:14px;
    text-align:left;
    cursor:pointer;
    box-shadow:none;
    transition:.16s ease;
}

.action-card:hover{
    transform:translateY(-2px);
    border-color:#cfe0ff;
    box-shadow:var(--shadow-sm);
}

.action-card__top{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    margin-bottom:8px;
}

.action-card__label{
    font-size:13px;
    font-weight:800;
    color:#334155;
    text-transform:uppercase;
    letter-spacing:.03em;
}

.action-card__value{
    font-size:28px;
    font-weight:800;
    line-height:1;
    color:#0f172a;
}

.action-card__sub{
    font-size:13px;
    color:var(--text-soft);
    line-height:1.4;
}

.dashboard-mini-stats{
    margin-bottom:14px;
}

.dashboard-kpi-list{
    display:grid;
    gap:10px;
}

.dashboard-kpi-row{
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:center;
    font-size:14px;
    padding:10px 0;
    border-bottom:1px solid var(--line);
}

.dashboard-kpi-row:last-child{border-bottom:none;padding-bottom:0}
.dashboard-kpi-row:first-child{padding-top:0}

.dashboard-inline-actions{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    justify-content:flex-end;
}

.dashboard-module-grid{
    display:grid;
    grid-template-columns:1.15fr .85fr;
    gap:14px;
    margin-top:12px;
}

.dashboard-module-card{
    border:1px solid var(--line);
    border-radius:16px;
    padding:14px;
    background:linear-gradient(180deg,#ffffff 0%, #fbfdff 100%);
}

.dashboard-module-card h3{
    margin:0 0 12px;
    font-size:15px;
    font-weight:800;
    color:#0f172a;
}

.dashboard-big-number{
    font-size:28px;
    font-weight:800;
    line-height:1.1;
    color:#0f172a;
}

.dashboard-bullet-list{
    margin:0;
    padding-left:18px;
    color:#334155;
    display:grid;
    gap:8px;
    font-size:14px;
}

.workspace-note{
    padding:12px 13px;
    border-radius:14px;
    border:1px dashed #bfd4ff;
    background:#f8fbff;
    color:#35507e;
    font-size:13px;
    margin-bottom:12px;
}

.dashboard-context-rail{
    position:sticky;
    top:calc(var(--topbar-height) + 12px);
    display:flex;
    flex-direction:column;
    gap:14px;
}

.dashboard-context-block{
    border:1px solid var(--line);
    border-radius:14px;
    padding:12px;
    background:#fbfdff;
}

.dashboard-context-title{
    font-size:12px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.04em;
    color:#64748b;
    margin-bottom:8px;
}

.dashboard-context-value{
    font-size:16px;
    font-weight:800;
    color:#0f172a;
}

/* existing shared hero utility if older pages still render */

.hero-bar,
.dashboard-hero{
    background:linear-gradient(135deg,#ffffff 0%, #f8fbff 100%);
    border:1px solid rgba(37,99,235,.08);
}

.hero-actions,
.dashboard-hero-actions{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    align-items:center;
}

.chip-row,
.dashboard-hero-chips{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:14px;
}

.summary-grid,
.action-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:14px;
}

.summary-card{
    display:flex;
    flex-direction:column;
    gap:8px;
    padding:14px;
    border:1px solid var(--line);
    border-radius:16px;
    background:linear-gradient(180deg,#fff 0%, #fbfdff 100%);
}

/* responsive */

@media (max-width:1280px){
    .dashboard-layout{
        grid-template-columns:minmax(0,1fr) 280px;
    }
    .dashboard-action-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

@media (max-width:1200px){
    .stats-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}

@media (max-width:1100px){
    .dashboard-layout{
        grid-template-columns:1fr;
    }
    .dashboard-context-rail{
        position:static;
        top:auto;
    }
}

@media (max-width:1024px){
    .grid-3,
    .summary-grid,
    .action-grid{
        grid-template-columns:1fr 1fr;
    }
    .inline-form{
        grid-template-columns:1fr 1fr;
    }
    .dashboard-module-grid{
        grid-template-columns:1fr;
    }
}

@media (max-width:900px){
    .app-sidebar{
        transform:translateX(-100%);
        transition:transform .2s ease;
    }
    .app-sidebar.is-open{
        transform:translateX(0);
    }
    .app-main{
        margin-left:0;
    }
    .app-topbar{
        grid-template-columns:auto 1fr auto;
    }
    .app-topbar__menu-btn{
        display:inline-flex;
        align-items:center;
        justify-content:center;
    }
    .app-topbar__name{
        display:none;
    }
    .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .inline-form-grid,
    .inline-form-grid-3{
        grid-template-columns:1fr;
    }
}

@media (max-width:768px){
    .grid-2,
    .grid-3,
    .stats-grid,
    .mini-grid-2,
    .quick-links,
    .inline-form,
    .detail-grid,
    .dashboard-action-grid,
    .summary-grid,
    .action-grid{
        grid-template-columns:1fr;
    }

    .app-content,
    .app-content--dashboard{
        padding:10px 10px 16px;
    }

    .page-card{
        padding:14px;
        margin:0 0 10px;
    }

    .page-title{
        font-size:21px;
    }

    .app-topbar{
        grid-template-columns:auto 1fr;
        gap:10px;
    }

    .app-topbar__center{
        grid-column:1 / -1;
        order:3;
    }

    .dashboard-overview-card__head,
    .page-head{
        flex-direction:column;
    }

    .dashboard-overview-card__actions,
    .dashboard-inline-actions{
        width:100%;
        justify-content:flex-start;
    }

    .list-item{
        align-items:flex-start;
        flex-direction:column;
    }

    .status-badge,
    .payment-chip{
        align-self:flex-start;
    }

    .app-modal{
        padding:12px;
    }

    .app-modal__dialog{
        width:100%;
        max-height:calc(100vh - 24px);
    }
}