* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
}


/* ---------------- LOGIN ---------------- */

.login-page {
    min-height: 100vh;

    background:
        radial-gradient(circle at top, #292a43, #111426);

    color: white;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}


.login-card {
    width: 90%;
    max-width: 600px;

    padding: 45px 45px;

    background: rgba(255, 255, 255, 0.09);

    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 32px;

    text-align: center;
}


.logo {
    width: 100px;
    height: 100px;

    margin: auto;

    background: white;

    border-radius: 22px;

    display: flex;
    justify-content: center;
    align-items: center;

    overflow: hidden;
}

.logo img {
    width: 78%;
    height: 78%;
    object-fit: contain;
}


.login-card h1 {
    margin-top: 28px;
    margin-bottom: 8px;

    font-size: 32px;
}


.university {
    margin-top: 0;

    color: #c9cad5;
    font-size: 17px;
}


.login-icons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);

    gap: 20px;

    margin: 40px 0;
}


.login-icons > div {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 10px;
}


.icon {
    width: 64px;
    height: 64px;

    border-radius: 18px;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 26px;
}


.blue {
    background: #2363e9;
}

.purple {
    background: #a83ded;
}

.orange {
    background: #ff6715;
}

.green {
    background: #18ba61;
}


.sign-in {
    width: 100%;

    border: 0;

    padding: 20px;

    border-radius: 18px;

    color: white;

    font-size: 21px;
    font-weight: bold;

    cursor: pointer;

    background: linear-gradient(
        90deg,
        #266ced,
        #5541ea
    );
}


.sign-in:hover {
    filter: brightness(1.1);
}


.login-info {
    color: #aeb0bd;

    margin: 25px 0;
}


.shop {
    width: 100%;

    padding: 14px;

    border-radius: 14px;

    border: 1px solid rgba(255,255,255,0.08);

    background: transparent;

    color: white;

    font-size: 16px;
}


footer {
    margin-top: 35px;

    color: #8f92aa;
}


/* ---------------- MOBILE ---------------- */

@media (max-width: 600px) {

    .login-page {
        justify-content: flex-start;

        padding-top: 30px;
    }


    .login-card {
        width: calc(100% - 30px);

        padding: 35px 20px;

        border-radius: 25px;
    }


    .logo {
        width: 80px;
        height: 80px;

        font-size: 42px;
    }


    .login-card h1 {
        font-size: 26px;
    }


    .university {
        font-size: 14px;
    }


    .login-icons {
        gap: 8px;

        margin: 35px 0;
    }


    .icon {
        width: 55px;
        height: 55px;

        font-size: 22px;
    }


    .login-icons span {
        font-size: 12px;
    }


    footer {
        margin-bottom: 20px;
    }
}


/* =========================================================
   DASHBOARD
   ========================================================= */


.dashboard-page {
    margin: 0;

    min-height: 100vh;

    background: #eef5ff;

    color: #151b2b;
}


/* TOP BAR */

.topbar {
    height: 100px;

    background: white;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 0 35px;

    border-bottom: 1px solid #dfe5ec;
}


.topbar-left {
    display: flex;
    align-items: center;

    gap: 15px;
}


.small-logo {
    width: 55px;
    height: 55px;

    background: white;

    color: #bd1620;

    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 35px;
    font-weight: bold;

    border: 1px solid #eee;
}


.hello {
    font-size: 22px;
}


.topbar-subtitle {
    margin-top: 4px;

    font-size: 14px;

    color: #707a8d;
}


.topbar-right {
    display: flex;
    align-items: center;

    gap: 25px;

    font-size: 17px;
}


.profile-circle {
    width: 45px;
    height: 45px;

    border-radius: 50%;

    background: linear-gradient(
        135deg,
        #d72455,
        #a744eb
    );

    color: white;

    display: flex;
    align-items: center;
    justify-content: center;
}


/* MAIN CONTENT */

.dashboard-content {
    padding: 32px;
}


.dashboard-grid {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 22px;

    max-width: 1700px;

    margin: auto;
}


/* CARDS */

.dashboard-card {
    min-height: 245px;

    background: white;

    border-radius: 32px;

    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 35px;

    box-shadow:
        0 12px 25px rgba(44, 64, 88, 0.12);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}


.clickable {
    cursor: pointer;
}


.clickable:hover {
    transform: translateY(-3px);

    box-shadow:
        0 16px 30px rgba(44, 64, 88, 0.17);
}


.dashboard-card-icon {
    position: absolute;

    top: 32px;
    left: 32px;

    width: 75px;
    height: 75px;

    border-radius: 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: white;

    font-size: 32px;

    box-shadow:
        0 10px 20px rgba(0,0,0,0.12);
}


.faculty-color {
    background: #2464e9;
}


.canteen-color {
    background: #ff6514;
}


.facilities-color {
    background: #17ba61;
}


.payments-color {
    background: #da1c22;
}


.dashboard-card-text {
    text-align: center;
}


.dashboard-card-title {
    font-size: 22px;

    margin-bottom: 5px;
}


.dashboard-card-subtitle {
    font-size: 19px;

    color: #36415a;
}


.dashboard-arrow {
    position: absolute;

    bottom: 25px;
    right: 35px;

    font-size: 42px;

    line-height: 1;

    color: #9aa4b4;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1100px) {

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 650px) {

    .topbar {
        height: 75px;

        padding: 0 15px;
    }


    .small-logo {
        width: 43px;
        height: 43px;

        font-size: 26px;
    }


    .hello {
        font-size: 16px;
    }


    .topbar-subtitle {
        font-size: 11px;
    }


    .topbar-right {
        gap: 10px;

        font-size: 13px;
    }


    .topbar-right > span:nth-child(2) {
        display: none;
    }


    .profile-circle {
        width: 38px;
        height: 38px;
    }


    .dashboard-content {
        padding: 18px 14px;
    }


    .dashboard-grid {
        grid-template-columns: 1fr;

        gap: 16px;
    }


    .dashboard-card {
        min-height: 170px;

        border-radius: 24px;

        padding: 25px;
    }


    .dashboard-card-icon {
        width: 58px;
        height: 58px;

        top: 22px;
        left: 22px;

        border-radius: 16px;

        font-size: 25px;
    }


    .dashboard-card-title {
        font-size: 20px;
    }


    .dashboard-card-subtitle {
        font-size: 16px;
    }


    .dashboard-arrow {
        right: 25px;
        bottom: 18px;

        font-size: 35px;
    }

}

/* =========================================================
   FACULTY PAGE
   ========================================================= */


.faculty-page {
    background: #eef5ff;

    color: #151b2b;

    min-height: 100vh;
}


/* HEADER */

.faculty-topbar {
    height: 95px;

    background: white;

    border-bottom: 1px solid #dce3ec;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 35px;
}


.faculty-header-left {
    display: flex;
    align-items: center;

    gap: 16px;
}


.back-button {
    width: 60px;
    height: 60px;

    border: 1px solid #d7dce5;

    border-radius: 18px;

    background: white;

    cursor: pointer;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    font-size: 20px;

    transition: 0.15s;
}


.back-button:hover {
    background: #f5f6f8;
}


.back-button span {
    font-size: 10px;

    margin-top: 2px;
}


.faculty-header-title {
    font-size: 21px;
}


.faculty-header-subtitle {
    color: #717c90;

    font-size: 14px;

    margin-top: 3px;
}


.faculty-header-right {
    display: flex;
    align-items: center;

    gap: 24px;
}


/* DEMO BANNER */

.demo-banner {
    text-align: center;

    padding: 6px;

    background: #fff1c7;

    color: #795600;

    font-size: 12px;

    font-weight: bold;

    letter-spacing: 1px;
}


/* MAIN */

.faculty-content {
    padding: 28px 35px 50px;
}


/* NAV */

.faculty-nav {
    max-width: 1535px;

    margin: 0 auto 28px;

    background: white;

    border-radius: 22px;

    padding: 12px;

    display: flex;

    gap: 15px;

    box-shadow:
        0 2px 5px rgba(0,0,0,0.06);
}


.faculty-nav-item {
    border: 0;

    background: transparent;

    border-radius: 16px;

    padding: 16px 22px;

    font-size: 16px;

    color: #536074;

    display: flex;
    align-items: center;

    gap: 10px;

    cursor: pointer;
}


.faculty-nav-item.active {
    background: #191919;

    color: white;
}


/* GRADES PANEL */

.grades-panel {
    max-width: 1535px;

    margin: auto;

    padding: 30px;

    background: white;

    border-radius: 22px;

    box-shadow:
        0 2px 5px rgba(0,0,0,0.06);
}


/* STAT CARDS */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 15px;
}


.stat-card {
    min-height: 90px;

    border: 1px solid #dfe4eb;

    border-radius: 17px;

    padding: 18px;
}


.stat-title {
    color: #6d7788;

    font-size: 14px;
}


.stat-value {
    margin-top: 10px;

    font-size: 23px;
}


/* TOOLBAR */

.grades-toolbar {
    margin-top: 20px;

    display: flex;
    justify-content: space-between;
    align-items: center;
}


.grade-type-selector {
    display: inline-flex;

    border: 1px solid #dfe3e9;

    border-radius: 13px;

    padding: 3px;
}


.grade-type-button {
    border: 0;

    background: transparent;

    padding: 9px 15px;

    border-radius: 10px;

    cursor: pointer;

    font-size: 15px;
}


.grade-type-button.selected {
    background: #172033;

    color: white;
}


.semester-select {
    border: 0;

    background: #f1f1f3;

    border-radius: 13px;

    padding: 13px 45px 13px 17px;

    font-size: 15px;
}


.all-years-button {
    margin-top: 18px;

    background: transparent;

    border: 0;

    padding: 0;

    color: #2464e9;

    font-size: 15px;

    cursor: pointer;
}


/* TABLE */

.grades-table-wrapper {
    margin-top: 35px;

    border: 1px solid #dfe4eb;

    border-radius: 18px;

    overflow: hidden;
}


.grades-table {
    width: 100%;

    border-collapse: collapse;
}


.grades-table th {
    padding: 17px 15px;

    text-align: left;

    color: #536074;

    background: #fafbfc;

    font-size: 14px;

    font-weight: 600;
}


.grades-table td {
    padding: 15px;

    border-top: 1px solid #edf0f4;

    vertical-align: middle;
}


.grades-table th:nth-child(4),
.grades-table td:nth-child(4) {
    text-align: center;
}


.grades-table th:nth-child(5),
.grades-table td:nth-child(5) {
    text-align: center;
}


.semester-heading-row td {
    background: #f7f8fa;

    color: #687487;

    font-size: 12px;

    font-weight: bold;

    letter-spacing: 0.3px;
}


.subject-number {
    color: #8994a7;

    width: 40px;
}


.subject-name {
    font-weight: 600;

    font-size: 15px;
}


.subject-english {
    color: #79859a;

    margin-top: 4px;

    font-size: 13px;
}


.grade-circle {
    display: inline-flex;

    min-width: 32px;
    height: 32px;

    padding: 0 8px;

    align-items: center;
    justify-content: center;

    background: #f4f5f7;

    border: 1px solid #e0e4e9;

    border-radius: 20px;
}


.edit-subject-button {
    border: 0;

    background: #edf3ff;

    color: #245fe5;

    border-radius: 10px;

    padding: 8px 13px;

    cursor: pointer;
}


.edit-subject-button:hover {
    background: #dae6ff;
}


/* =========================================================
   EDIT MODAL
   ========================================================= */

.modal-overlay {
    position: fixed;

    inset: 0;

    background: rgba(10, 15, 25, 0.5);

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;

    z-index: 1000;
}


.modal-overlay.visible {
    display: flex;
}


.edit-modal {
    width: 100%;

    max-width: 500px;

    background: white;

    border-radius: 22px;

    padding: 25px;

    box-shadow:
        0 20px 60px rgba(0,0,0,0.3);
}


.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 20px;
}


.modal-header h2 {
    margin: 0;

    font-size: 21px;
}


.close-modal {
    width: 35px;
    height: 35px;

    border: 0;

    background: #f1f2f4;

    border-radius: 50%;

    font-size: 21px;

    cursor: pointer;
}


.edit-modal label {
    display: block;

    margin-top: 14px;
    margin-bottom: 7px;

    color: #596577;

    font-size: 13px;
}


.edit-modal input {
    width: 100%;

    padding: 12px;

    border: 1px solid #dce1e8;

    border-radius: 11px;

    font-size: 15px;
}


.modal-row {
    display: grid;

    grid-template-columns: 2fr 1fr;

    gap: 15px;
}


.modal-actions {
    display: flex;

    justify-content: flex-end;

    gap: 10px;

    margin-top: 25px;
}


.cancel-button,
.save-button {
    border: 0;

    padding: 11px 20px;

    border-radius: 11px;

    font-size: 14px;

    cursor: pointer;
}


.cancel-button {
    background: #eef0f3;

    color: #333;
}


.save-button {
    background: #2864e8;

    color: white;
}


/* =========================================================
   FACULTY MOBILE
   ========================================================= */

@media (max-width: 750px) {

    .faculty-topbar {
        height: 75px;

        padding: 0 12px;
    }


    .faculty-header-left {
        gap: 9px;
    }


    .back-button {
        width: 48px;
        height: 48px;

        border-radius: 14px;
    }


    .faculty-header-title {
        font-size: 17px;
    }


    .faculty-header-subtitle {
        font-size: 10px;
    }


    .faculty-header-right {
        gap: 9px;

        font-size: 12px;
    }


    .desktop-only {
        display: none;
    }


    .faculty-content {
        padding: 14px;
    }


    .faculty-nav {
        overflow-x: auto;

        border-radius: 17px;

        padding: 8px;

        gap: 5px;
    }


    .faculty-nav-item {
        flex-shrink: 0;

        padding: 12px 14px;

        font-size: 13px;
    }


    .grades-panel {
        padding: 15px;

        border-radius: 18px;
    }


    .stats-grid {
        grid-template-columns:
            repeat(2, 1fr);

        gap: 8px;
    }


    .stat-card {
        min-height: 82px;

        padding: 13px;

        border-radius: 13px;
    }


    .stat-title {
        font-size: 11px;
    }


    .stat-value {
        font-size: 20px;
    }


    .grades-toolbar {
        gap: 10px;

        align-items: stretch;
    }


    .grade-type-button {
        font-size: 12px;

        padding: 8px 10px;
    }


    .semester-select {
        max-width: 140px;

        padding: 10px;

        font-size: 12px;
    }


    .grades-table-wrapper {
        overflow-x: auto;

        margin-top: 25px;
    }


    .grades-table {
        min-width: 700px;
    }


    .grades-table th,
    .grades-table td {
        padding: 13px 10px;
    }


    .modal-row {
        grid-template-columns: 1fr;
    }

}


/* =========================================================
   FINAL / PROPOSED TOOLBAR
   ========================================================= */

.grades-toolbar {
    margin-top: 20px;

    display: flex;
    align-items: center;

    justify-content: flex-start;
}


.grade-type-selector {
    display: inline-flex;

    border: 1px solid #dfe3e9;

    border-radius: 13px;

    padding: 3px;

    background: white;
}


.grade-type-button {
    border: 0;

    background: transparent;

    padding: 9px 15px;

    border-radius: 10px;

    cursor: pointer;

    font-size: 15px;

    color: #364154;
}


.grade-type-button.selected {
    background: #172033;

    color: white;

    font-weight: 600;

    box-shadow:
        0 1px 4px rgba(0,0,0,0.18);
}



/* =========================================================
   GRADE BADGES
   ========================================================= */

.grade-badge {
    min-width: 30px;
    height: 28px;

    padding: 0 9px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    border-radius: 999px;

    font-size: 13px;

    line-height: 1;
}


.grade-passed {
    background: #e7f8ef;

    border: 1px solid #caf0db;

    color: #17884d;
}


.grade-failed {
    background: #fff0f0;

    border: 1px solid #ffd9d9;

    color: #d33b3b;
}


.grade-empty {
    background: #f3f4f6;

    border: 1px solid #e0e3e8;

    color: #737d8c;
}


.grade-absent {
    background: #fff7e5;

    border: 1px solid #f5cf69;

    color: #c66a00;

    min-width: 68px;

    font-weight: 500;
}


.grade-cell {
    text-align: center;
}


.credits-cell {
    text-align: center;
}


.exam-date {
    color: #667286;
}



/* =========================================================
   SEMESTER ROW
   ========================================================= */

.semester-heading-row td {
    background: #f7f8fa;

    color: #687487;

    font-size: 12px;

    font-weight: bold;

    letter-spacing: 0.3px;

    padding-top: 11px;
    padding-bottom: 11px;
}



/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 750px) {

    .grades-toolbar {
        margin-top: 15px;
    }


    .grade-type-button {
        padding: 8px 13px;

        font-size: 13px;
    }


    .grade-badge {
        font-size: 12px;

        min-width: 27px;
        height: 26px;
    }

}


/* =========================================================
   IMPROVED FACULTY MOBILE LAYOUT
   ========================================================= */

@media (max-width: 750px) {

    /* -----------------------------------------
       PAGE
       ----------------------------------------- */

    .faculty-content {
        padding: 10px;
    }

    .grades-panel {
        padding: 12px;
        border-radius: 18px;
    }


    /* -----------------------------------------
       TOP STATISTICS - 2 x 2
       ----------------------------------------- */

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-card {
        min-height: 92px;
        padding: 14px;
        border-radius: 15px;
    }

    .stat-title {
        font-size: 12px;
        line-height: 1.2;
    }

    .stat-value {
        margin-top: 10px;
        font-size: 24px;
    }


    /* -----------------------------------------
       FINAL / PROPOSED
       ----------------------------------------- */

    .grades-toolbar {
        margin-top: 14px;
        margin-bottom: 18px;
    }

    .grade-type-selector {
        padding: 3px;
        border-radius: 13px;
    }

    .grade-type-button {
        padding: 9px 14px;
        font-size: 14px;
        border-radius: 10px;
    }


    /* =====================================================
       REMOVE DESKTOP TABLE BEHAVIOUR
       ===================================================== */

    .grades-table-wrapper {
        width: 100%;
        margin-top: 0;

        overflow: hidden;

        border-radius: 17px;
    }

    .grades-table {
        width: 100%;

        min-width: 0 !important;

        display: block;
    }

    .grades-table thead {
        display: none;
    }

    .grades-table tbody {
        display: block;
        width: 100%;
    }


    /* =====================================================
       SEMESTER HEADER
       ===================================================== */

    .semester-heading-row {
        display: block !important;
        width: 100%;
    }

    .semester-heading-row td {
        display: block;

        width: 100%;

        padding: 13px 16px;

        font-size: 13px;

        background: #f7f8fa;

        color: #667184;

        font-weight: 700;

        border-top: 0;
    }


    /* =====================================================
       EACH SUBJECT BECOMES A MOBILE ROW
       ===================================================== */

    .grades-table tbody tr:not(.semester-heading-row) {

        display: grid;

        grid-template-columns:
            auto 1fr auto;

        grid-template-areas:
            "subject subject grade"
            "credits date grade";

        column-gap: 5px;
        row-gap: 5px;

        width: 100%;

        padding: 17px 16px;

        border-top: 1px solid #edf0f4;

        background: white;
    }


    /* -----------------------------------------
       Hide row number
       ----------------------------------------- */

    .grades-table tbody tr:not(.semester-heading-row)
    .subject-number {
        display: none;
    }


    /* -----------------------------------------
       Subject
       ----------------------------------------- */

    .grades-table tbody tr:not(.semester-heading-row)
    td:nth-child(2) {

        grid-area: subject;

        padding: 0;

        border: 0;

        min-width: 0;

        padding-right: 10px;
    }

    .subject-name {

        font-size: 16px;

        font-weight: 650;

        line-height: 1.25;

        color: #171c28;
    }

    .subject-english {

        margin-top: 3px;

        font-size: 13px;

        line-height: 1.3;

        color: #727d8e;
    }


    /* -----------------------------------------
       CREDITS
       ----------------------------------------- */

    .grades-table tbody tr:not(.semester-heading-row)
    .credits-cell {

        grid-area: credits;

        padding: 0;

        border: 0;

        text-align: left;

        font-size: 13px;

        color: #687486;

        white-space: nowrap;
    }

    .grades-table tbody tr:not(.semester-heading-row)
    .credits-cell::after {

        content: " credits ·";
    }


    /* -----------------------------------------
       DATE
       ----------------------------------------- */

    .grades-table tbody tr:not(.semester-heading-row)
    .exam-date {

        grid-area: date;

        padding: 0;

        border: 0;

        font-size: 13px;

        color: #687486;

        white-space: nowrap;
    }


    /* -----------------------------------------
       GRADE
       ----------------------------------------- */

    .grades-table tbody tr:not(.semester-heading-row)
    .grade-cell {

        grid-area: grade;

        align-self: center;

        padding: 0;

        border: 0;

        text-align: right;
    }


    .grade-badge {

        min-width: 36px;

        height: 30px;

        padding: 0 10px;

        font-size: 13px;

        border-radius: 999px;
    }


    .grade-absent {

        min-width: 62px;

        font-size: 11px;
    }

}