* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: #172033;
    background: #f7f8fc;
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.portal-container {
    width: min(1180px, calc(100% - 40px));
    margin-inline: auto;
}

/* Header */

.portal-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #e7e9f2;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(14px);
}

.portal-navbar {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-brand img {
    width: 52px;
    height: 52px;
    padding: 4px;
    border-radius: 14px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e4e7f0;
}

.portal-brand strong,
.portal-brand span {
    display: block;
}

.portal-brand strong {
    font-size: 16px;
    color: #17194f;
}

.portal-brand span {
    margin-top: 3px;
    color: #777f90;
    font-size: 11px;
}

.portal-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    font-weight: 700;
}

.portal-nav form {
    margin: 0;
}

.portal-button,
.logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: #4f46e5;
    font-weight: 800;
    cursor: pointer;
}

.logout-button {
    background: #111827;
}

/* Alerts */

.alert {
    margin-top: 20px;
    padding: 15px 18px;
    border-radius: 12px;
    font-size: 14px;
}

.alert-success {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}

.alert-error {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.error-list {
    margin: 0;
    padding-left: 20px;
}

/* Authentication */

.auth-section {
    min-height: calc(100vh - 155px);
    padding: 70px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 15% 20%,
            rgba(79, 70, 229, .13),
            transparent 30%),
        radial-gradient(circle at 88% 70%,
            rgba(249, 115, 22, .12),
            transparent 30%);
}

.auth-card {
    width: min(470px, 100%);
    padding: 38px;
    border: 1px solid #e4e7f0;
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 25px 60px rgba(27, 31, 72, .11);
}

.auth-card-wide {
    width: min(760px, 100%);
}

.auth-heading {
    margin-bottom: 26px;
    text-align: center;
}

.auth-label,
.dashboard-label {
    display: inline-block;
    color: #4f46e5;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.admin-label {
    color: #c2410c;
}

.auth-heading h1 {
    margin: 10px 0;
    color: #11143f;
    font-size: 34px;
}

.auth-heading p {
    margin: 0;
    color: #70798c;
    font-size: 14px;
    line-height: 1.7;
}

.auth-form {
    display: grid;
    gap: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-full {
    grid-column: 1 / -1;
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-group label {
    color: #333a4d;
    font-size: 13px;
    font-weight: 800;
}

.form-group input,
.form-group select {
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border: 1px solid #dfe3ec;
    border-radius: 12px;
    outline: none;
    color: #111827;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .10);
}

.remember-row {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #5d6576;
    font-size: 13px;
}

.auth-submit {
    min-height: 52px;
    border: 0;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #3730a3);
    box-shadow: 0 12px 24px rgba(79, 70, 229, .22);
    font-weight: 900;
    cursor: pointer;
}

.admin-submit {
    background: linear-gradient(135deg, #ea580c, #9a3412);
}

.auth-footer-text {
    margin-top: 22px;
    color: #70798c;
    text-align: center;
    font-size: 14px;
}

.auth-footer-text a {
    color: #4f46e5;
    font-weight: 900;
}

/* Dashboards */

.dashboard-section,
.resource-detail-section {
    min-height: calc(100vh - 155px);
    padding: 65px 0 90px;
}

.dashboard-welcome {
    padding: 38px;
    border-radius: 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 20%,
            rgba(255, 255, 255, .18),
            transparent 27%),
        linear-gradient(135deg, #4f46e5, #312e81);
    box-shadow: 0 24px 55px rgba(49, 46, 129, .20);
}

.dashboard-welcome h1,
.page-heading h1 {
    margin: 10px 0;
    font-size: clamp(32px, 5vw, 48px);
}

.dashboard-welcome p {
    max-width: 650px;
    margin: 0;
    color: #e0e7ff;
    line-height: 1.7;
}

.dashboard-welcome .dashboard-label {
    color: #c7d2fe;
}

.student-profile-card {
    min-width: 240px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 18px;
    background: rgba(255, 255, 255, .12);
}

.student-profile-card strong,
.student-profile-card span,
.student-profile-card small {
    display: block;
}

.student-profile-card strong {
    font-size: 22px;
}

.student-profile-card span {
    margin-top: 7px;
    color: #e0e7ff;
}

.student-profile-card small {
    max-width: 220px;
    margin-top: 12px;
    color: #c7d2fe;
    font-size: 9px;
    overflow-wrap: anywhere;
}

.page-heading {
    max-width: 800px;
    margin-bottom: 42px;
}

.page-heading h1 {
    color: #11143f;
}

.page-heading p {
    margin: 0;
    color: #70798c;
    line-height: 1.75;
}

.resource-heading-row {
    margin: 55px 0 25px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 25px;
}

.resource-heading-row h2 {
    margin: 8px 0 0;
    font-size: 30px;
}

/* Resource cards */

.portal-resource-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.portal-resource-card {
    padding: 26px;
    border: 1px solid #e3e7ef;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(24, 29, 67, .06);
    transition: .25s ease;
}

.portal-resource-card:hover {
    transform: translateY(-5px);
    border-color: rgba(79, 70, 229, .4);
    box-shadow: 0 20px 42px rgba(79, 70, 229, .11);
}

.portal-resource-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 20px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #eef2ff;
    font-size: 26px;
}

.portal-resource-card h2,
.portal-resource-card h3 {
    margin: 0 0 10px;
    color: #17194f;
}

.portal-resource-card p {
    min-height: 70px;
    margin: 0 0 18px;
    color: #71798b;
    font-size: 14px;
    line-height: 1.7;
}

.portal-resource-card a {
    color: #4f46e5;
    font-size: 14px;
    font-weight: 900;
}

/* Resource detail */

.back-link {
    display: inline-block;
    margin-bottom: 22px;
    color: #4f46e5;
    font-weight: 800;
}

.resource-detail-card {
    padding: 42px;
    border: 1px solid #e3e7ef;
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 22px 55px rgba(24, 29, 67, .08);
}

.resource-detail-heading {
    padding-bottom: 30px;
    border-bottom: 1px solid #e8eaf1;
    display: flex;
    align-items: center;
    gap: 22px;
}

.resource-large-icon {
    width: 84px;
    height: 84px;
    min-width: 84px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    background: #eef2ff;
    font-size: 40px;
}

.resource-detail-heading h1 {
    margin: 8px 0;
    color: #11143f;
    font-size: 40px;
}

.resource-detail-heading p {
    margin: 0;
    color: #70798c;
    line-height: 1.7;
}

.resource-content {
    max-width: 850px;
    padding: 35px 0;
    color: #444c5e;
    line-height: 1.85;
}

.resource-content h2,
.resource-content h3 {
    color: #17194f;
}

.resource-content li {
    margin-bottom: 8px;
}

.resource-help-box {
    padding: 22px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    background: #eef2ff;
}

.resource-help-box strong {
    color: #312e81;
}

.resource-help-box p {
    margin: 5px 0 0;
    color: #626b7d;
    font-size: 14px;
}

.resource-help-box a {
    min-width: 130px;
    padding: 13px 18px;
    border-radius: 11px;
    color: #fff;
    background: #4f46e5;
    text-align: center;
    font-weight: 800;
}

/* Admin */

.stat-grid {
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.dashboard-stat-card {
    padding: 24px;
    border: 1px solid #e3e7ef;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(24, 29, 67, .05);
}

.dashboard-stat-card span,
.dashboard-stat-card strong {
    display: block;
}

.dashboard-stat-card span {
    color: #747c8e;
    font-size: 13px;
    font-weight: 700;
}

.dashboard-stat-card strong {
    margin-top: 12px;
    color: #17194f;
    font-size: 35px;
}

.admin-table-card {
    overflow: hidden;
    border: 1px solid #e3e7ef;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 12px 35px rgba(24, 29, 67, .06);
}

.admin-table-heading {
    padding: 24px;
    border-bottom: 1px solid #e8eaf1;
}

.admin-table-heading h2 {
    margin: 7px 0 0;
}

.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 17px 20px;
    border-bottom: 1px solid #edf0f5;
    text-align: left;
    font-size: 13px;
}

.admin-table th {
    color: #656d7d;
    background: #fafbfe;
}

.admin-table td strong,
.admin-table td small {
    display: block;
}

.admin-table td small {
    margin-top: 5px;
    color: #8a91a1;
}

.status-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.status-active {
    color: #166534;
    background: #dcfce7;
}

.status-inactive {
    color: #991b1b;
    background: #fee2e2;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 40px;
    border-radius: 18px;
    color: #70798c;
    background: #fff;
    text-align: center;
}

/* Footer */

.portal-footer {
    padding: 24px 0;
    border-top: 1px solid #e5e7ef;
    color: #747c8e;
    background: #fff;
    text-align: center;
    font-size: 13px;
}

/* Responsive */

@media(max-width:950px) {

    .portal-resource-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-welcome {
        align-items: flex-start;
        flex-direction: column;
    }

}

@media(max-width:700px) {

    .portal-container {
        width: min(100% - 24px, 1180px);
    }

    .portal-navbar {
        padding: 12px 0;
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-nav {
        width: 100%;
        padding-top: 12px;
        border-top: 1px solid #e8eaf1;
        flex-wrap: wrap;
    }

    .auth-section {
        padding: 40px 12px;
    }

    .auth-card {
        padding: 27px 20px;
    }

    .form-grid,
    .portal-resource-grid,
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .form-full {
        grid-column: auto;
    }

    .dashboard-section,
    .resource-detail-section {
        padding: 40px 0 65px;
    }

    .dashboard-welcome {
        padding: 28px 22px;
    }

    .student-profile-card {
        width: 100%;
        min-width: 0;
    }

    .resource-heading-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .resource-detail-card {
        padding: 25px 20px;
    }

    .resource-detail-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .resource-detail-heading h1 {
        font-size: 31px;
    }

    .resource-help-box {
        align-items: flex-start;
        flex-direction: column;
    }

    .resource-help-box a {
        width: 100%;
    }

}

.admin-form-card {
    max-width: 850px;
    padding: 32px;
    border: 1px solid #e3e7ef;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 15px 40px rgba(24, 29, 67, .07);
}

.resource-page-header {
    margin-bottom: 30px;
    padding: 32px;
    border: 1px solid #e3e7ef;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 22px;
    background: #fff;
}

.resource-page-header h1 {
    margin: 8px 0;
    color: #11143f;
    font-size: 40px;
}

.resource-page-header p {
    margin: 0;
    color: #70798c;
    line-height: 1.7;
}

.resource-filter-form {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #e3e7ef;
    border-radius: 18px;
    display: flex;
    align-items: end;
    gap: 15px;
    background: #fff;
}

.resource-filter-form .form-group {
    min-width: 210px;
}

.clear-filter-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    color: #dc2626;
    font-weight: 800;
}

.pdf-list {
    display: grid;
    gap: 18px;
}

.pdf-card {
    padding: 22px;
    border: 1px solid #e3e7ef;
    border-radius: 20px;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(24, 29, 67, .05);
    transition: .25s ease;
}

.pdf-card:hover {
    transform: translateY(-3px);
    border-color: rgba(79, 70, 229, .35);
    box-shadow: 0 18px 40px rgba(79, 70, 229, .10);
}

.pdf-icon {
    width: 60px;
    height: 70px;
    min-width: 60px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #dc2626;
    font-size: 14px;
    font-weight: 900;
}

.pdf-card-content {
    width: 100%;
}

.pdf-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.pdf-card h2 {
    margin: 0 0 10px;
    color: #17194f;
    font-size: 20px;
}

.pdf-card time {
    min-width: max-content;
    padding: 7px 11px;
    border-radius: 999px;
    color: #4f46e5;
    background: #eef2ff;
    font-size: 12px;
    font-weight: 800;
}

.pdf-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pdf-meta span {
    padding: 5px 9px;
    border-radius: 999px;
    color: #596174;
    background: #f3f4f6;
    font-size: 11px;
    font-weight: 700;
}

.pdf-actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
}

.pdf-view-button,
.pdf-download-button {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
}

.pdf-view-button {
    color: #fff;
    background: #4f46e5;
}

.pdf-download-button {
    color: #3730a3;
    background: #eef2ff;
}

.admin-action-cell {
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-action-cell form {
    margin: 0;
}

.delete-link {
    padding: 0;
    border: 0;
    color: #dc2626;
    background: none;
    font-weight: 800;
    cursor: pointer;
}

.pagination-wrapper {
    margin-top: 30px;
}

@media(max-width:700px) {

    .resource-page-header {
        padding: 24px 20px;
        align-items: flex-start;
        flex-direction: column;
    }

    .resource-page-header h1 {
        font-size: 31px;
    }

    .resource-filter-form {
        align-items: stretch;
        flex-direction: column;
    }

    .resource-filter-form .form-group {
        min-width: 0;
    }

    .pdf-card {
        flex-direction: column;
    }

    .pdf-card-top {
        flex-direction: column;
    }

    .pdf-actions {
        flex-direction: column;
    }

    .pdf-view-button,
    .pdf-download-button {
        width: 100%;
    }
}

.admin-dashboard-header {
    margin-bottom: 35px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
}

.admin-dashboard-header .page-heading {
    margin-bottom: 0;
}

.admin-dashboard-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.upload-pdf-button {
    background: #ea580c;
}

@media(max-width:700px) {

    .admin-dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-dashboard-actions {
        width: 100%;
        flex-direction: column;
    }

    .admin-dashboard-actions .portal-button {
        width: 100%;
    }

}

.student-search-form {
    margin: 25px 0;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border: 1px solid #e3e7ef;
    border-radius: 18px;
    background: #fff;
}

.student-search-form input,
.student-search-form select {
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid #dfe3ec;
    border-radius: 11px;
    background: #fff;
}

.student-search-form input {
    flex: 1;
    min-width: 240px;
}

.table-action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.table-action-buttons form {
    margin: 0;
}

.action-view,
.action-status,
.action-delete {
    padding: 7px 10px;
    border: 0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.action-view {
    color: #3730a3;
    background: #eef2ff;
}

.action-status {
    color: #92400e;
    background: #fef3c7;
}

.action-delete {
    color: #b91c1c;
    background: #fee2e2;
}

.student-profile-header {
    margin-bottom: 28px;
    padding: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    border: 1px solid #e3e7ef;
    border-radius: 24px;
    background: #fff;
}

.student-profile-header h1 {
    margin: 10px 0 6px;
    color: #151744;
    font-size: 36px;
}

.student-profile-header p {
    margin: 0;
    color: #687083;
}

.profile-section-card {
    margin-bottom: 25px;
    padding: 28px;
    border: 1px solid #e3e7ef;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 12px 35px rgba(24, 29, 67, .06);
}

.profile-section-card h2 {
    margin-top: 0;
    color: #17194f;
}

.profile-section-card h3 {
    color: #17194f;
}

.section-row {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.section-row h2 {
    margin: 7px 0 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-full {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group label {
    color: #333751;
    font-size: 13px;
    font-weight: 800;
}

.form-group input,
.form-group select,
.form-group textarea,
.message-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dce1eb;
    border-radius: 11px;
    background: #fff;
    font: inherit;
}

.form-group input,
.form-group select {
    min-height: 46px;
}

.daily-record-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.daily-record-card {
    min-height: 135px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    border: 2px solid transparent;
    border-radius: 15px;
    background: #f8fafc;
}

.daily-record-card strong {
    color: #151744;
    font-size: 17px;
}

.daily-record-card span,
.daily-record-card small {
    color: #5e6678;
    font-size: 12px;
}

.homework-done {
    border-color: #22c55e;
    background: #f0fdf4;
}

.homework-not_done {
    border-color: #ef4444;
    background: #fef2f2;
}

.homework-pending {
    border-color: #f59e0b;
    background: #fffbeb;
}

.homework-not_given {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.record-legend {
    margin-bottom: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.record-legend span {
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.legend-done {
    color: #166534;
    background: #dcfce7;
}

.legend-not-done {
    color: #991b1b;
    background: #fee2e2;
}

.legend-pending {
    color: #92400e;
    background: #fef3c7;
}

.section-divider {
    margin: 30px 0;
    border: 0;
    border-top: 1px solid #e5e7eb;
}

.result-table-wrapper {
    margin-top: 30px;
}

.student-info-grid {
    margin-bottom: 25px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.student-info-card {
    padding: 22px;
    border: 1px solid #e3e7ef;
    border-radius: 18px;
    background: #fff;
}

.student-info-card span {
    display: block;
    margin-bottom: 8px;
    color: #747b8c;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.student-info-card strong {
    color: #17194f;
    font-size: 18px;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.report-card {
    padding: 22px;
    border: 1px solid #e3e7ef;
    border-radius: 18px;
    background: #fafbff;
}

.report-card h3 {
    margin-top: 0;
}

.rating-row {
    padding: 9px 0;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 1px solid #e9ebf2;
}

.admin-report-comment {
    margin-top: 15px;
    padding: 12px;
    border-radius: 12px;
    color: #3730a3;
    background: #eef2ff;
}

.message-list {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-card {
    max-width: 75%;
    padding: 14px 16px;
    border-radius: 16px;
}

.message-card p {
    margin: 7px 0;
    line-height: 1.6;
}

.message-card small {
    font-size: 11px;
    opacity: .75;
}

.message-admin {
    align-self: flex-start;
    color: #252966;
    background: #eef2ff;
}

.message-student {
    align-self: flex-end;
    color: #14532d;
    background: #dcfce7;
}

.message-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.message-form textarea {
    flex: 1;
}

.status-active {
    color: #166534;
    background: #dcfce7;
}

.status-inactive {
    color: #991b1b;
    background: #fee2e2;
}

.alert {
    margin-bottom: 20px;
    padding: 14px 17px;
    border-radius: 12px;
}

.alert-success {
    color: #166534;
    background: #dcfce7;
}

.alert-error {
    color: #991b1b;
    background: #fee2e2;
}

@media(max-width:1000px) {

    .daily-record-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

}

@media(max-width:700px) {

    .student-profile-header,
    .section-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-grid,
    .student-info-grid,
    .report-grid {
        grid-template-columns: 1fr;
    }

    .form-full {
        grid-column: auto;
    }

    .daily-record-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .message-card {
        max-width: 92%;
    }

    .message-form {
        align-items: stretch;
        flex-direction: column;
    }

    .student-search-form {
        align-items: stretch;
        flex-direction: column;
    }

    .student-search-form input {
        min-width: 0;
    }

}

/* =========================================================
   ADMIN STUDENT PROFILE DRAWERS
========================================================= */

.profile-drawer {
    display: block;
    width: 100%;
    margin-bottom: 18px;
    padding: 0;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}

.profile-drawer-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    padding: 20px 24px;
    cursor: pointer;
    list-style: none;
    background: #ffffff;
    transition:
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.profile-drawer-summary::-webkit-details-marker {
    display: none;
}

.profile-drawer-summary::marker {
    display: none;
    content: "";
}

.profile-drawer-summary:hover {
    background: #f8fafc;
}

.profile-drawer[open] .profile-drawer-summary {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.drawer-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.drawer-heading>div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.drawer-heading strong {
    display: block;
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.drawer-heading small {
    display: block;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.drawer-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    font-size: 21px;
}

.drawer-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    color: #1d4ed8;
    background: #eff6ff;
    border-radius: 50%;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    transition:
        transform 0.25s ease,
        background-color 0.2s ease;
}

.profile-drawer-summary:hover .drawer-arrow {
    background: #dbeafe;
}

.profile-drawer[open] .drawer-arrow {
    transform: rotate(180deg);
}

.profile-drawer-content {
    padding: 24px;
    animation: drawerOpen 0.2s ease;
}

.profile-drawer-content>h2:first-child {
    margin-top: 0;
}

.profile-drawer-content form:last-child {
    margin-bottom: 0;
}

@keyframes drawerOpen {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================
   DRAWER FORM SPACING
========================================================= */

.profile-drawer-content .form-grid {
    margin-top: 18px;
}

.profile-drawer-content .portal-button {
    margin-top: 8px;
}

.profile-drawer-content .section-row {
    margin-bottom: 18px;
}

.profile-drawer-content .section-divider {
    margin: 26px 0;
}

.profile-drawer-content .result-table-wrapper {
    margin-top: 28px;
}

.profile-drawer-content .message-list {
    margin-top: 18px;
    margin-bottom: 22px;
}

.profile-drawer-content .message-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-drawer-content .message-form textarea {
    width: 100%;
}


/* =========================================================
   CLOSED DRAWER COMPACT LOOK
========================================================= */

.profile-drawer:not([open]) {
    min-height: auto;
}

.profile-drawer:not([open]) .profile-drawer-summary {
    border-bottom: none;
}


/* =========================================================
   TABLE INSIDE DRAWER
========================================================= */

.profile-drawer .table-responsive {
    width: 100%;
    overflow-x: auto;
}

.profile-drawer .admin-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}


/* =========================================================
   MOBILE RESPONSIVE DRAWERS
========================================================= */

@media (max-width: 768px) {

    .profile-drawer {
        margin-bottom: 14px;
        border-radius: 13px;
    }

    .profile-drawer-summary {
        gap: 12px;
        padding: 16px;
    }

    .drawer-heading {
        gap: 11px;
    }

    .drawer-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        font-size: 18px;
    }

    .drawer-heading strong {
        font-size: 16px;
    }

    .drawer-heading small {
        font-size: 12px;
    }

    .drawer-arrow {
        width: 30px;
        height: 30px;
        font-size: 19px;
    }

    .profile-drawer-content {
        padding: 18px 16px;
    }

    .profile-drawer-content .section-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .profile-drawer-content .section-row form,
    .profile-drawer-content .section-row input[type="month"] {
        width: 100%;
    }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 480px) {

    .profile-drawer-summary {
        padding: 14px;
    }

    .drawer-heading small {
        display: none;
    }

    .drawer-heading strong {
        font-size: 15px;
    }

    .drawer-icon {
        width: 35px;
        height: 35px;
        font-size: 17px;
    }

    .profile-drawer-content {
        padding: 16px 14px;
    }
}

/* =====================================================
   STUDENT DASHBOARD RECORD SECTIONS
===================================================== */

.student-overview-section {
    margin-top: 34px;
}

.student-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.student-info-card {
    padding: 22px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.06);
}

.student-card-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.student-card-heading h3 {
    margin: 0;
    color: #111827;
    font-size: 18px;
}

.student-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: #eef2ff;
    border-radius: 12px;
    font-size: 20px;
}

.student-card-content p {
    margin: 8px 0;
    color: #475569;
}

.student-card-content strong {
    color: #111827;
}

.student-card-content small {
    color: #64748b;
}

.student-dashboard-drawer {
    margin-bottom: 16px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
}

.student-dashboard-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    cursor: pointer;
    list-style: none;
}

.student-dashboard-summary::-webkit-details-marker {
    display: none;
}

.student-dashboard-summary::marker {
    content: "";
}

.student-dashboard-summary > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.student-dashboard-summary strong {
    color: #111827;
    font-size: 17px;
}

.student-dashboard-summary small {
    color: #64748b;
    font-size: 13px;
}

.student-dashboard-summary > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #4f46e5;
    background: #eef2ff;
    border-radius: 50%;
    font-size: 21px;
    transition: transform 0.2s ease;
}

.student-dashboard-drawer[open] .student-dashboard-summary {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.student-dashboard-drawer[open]
.student-dashboard-summary > span {
    transform: rotate(180deg);
}

.student-dashboard-drawer-content {
    padding: 22px;
}

.student-record-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.student-record-card {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #94a3b8;
    border-radius: 12px;
}

.student-record-card.homework-done {
    border-left-color: #22c55e;
}

.student-record-card.homework-pending {
    border-left-color: #f59e0b;
}

.student-record-card.homework-not_done {
    border-left-color: #ef4444;
}

.student-record-card p {
    margin: 0;
    color: #475569;
}

.student-record-card small {
    color: #64748b;
}

.student-report-grid {
    display: grid;
    gap: 16px;
}

.student-report-card {
    padding: 20px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

.student-report-card h3 {
    margin-top: 0;
    color: #111827;
}

.student-rating-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.student-rating-grid span {
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    color: #475569;
}

.student-result-table {
    min-width: 700px;
}

@media (max-width: 900px) {
    .student-overview-grid,
    .student-record-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .student-rating-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .student-overview-grid,
    .student-record-grid,
    .student-rating-grid {
        grid-template-columns: 1fr;
    }

    .student-dashboard-summary {
        padding: 17px;
    }

    .student-dashboard-drawer-content {
        padding: 16px;
    }
}


/* =====================================================
   STUDENT DASHBOARD
===================================================== */

.student-dashboard-page {
    width: 100%;
    padding: 24px;
    background: #f5f7fb;
    min-height: calc(100vh - 80px);
    box-sizing: border-box;
}

/* Welcome Card */

.student-welcome-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 30px;
    margin-bottom: 24px;
    border: 1px solid #e4e9f2;
    border-radius: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f6f8ff 100%);
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.06);
}

.student-welcome-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.student-avatar {
    width: 68px;
    height: 68px;
    min-width: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: linear-gradient(135deg, #172554, #4f46e5);
    color: #ffffff;
    font-size: 28px;
    font-weight: 800;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.25);
}

.student-welcome-details .welcome-label {
    display: block;
    margin-bottom: 3px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.student-welcome-details h1 {
    margin: 0;
    color: #111827;
    font-size: 27px;
    font-weight: 800;
    line-height: 1.25;
}

.student-meta-list {
    display: flex;
    flex-wrap: wrap;
    gap: 9px 22px;
    margin-top: 9px;
    color: #475569;
    font-size: 14px;
}

.student-meta-list strong {
    color: #1e293b;
}

.student-welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    background: #f0fdf4;
    color: #15803d;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.13);
}

/* Summary Cards */

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.summary-card {
    position: relative;
    overflow: hidden;
    padding: 24px;
    border: 1px solid #e5eaf2;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.055);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.09);
}

.summary-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.tuition-summary-card::before {
    background: #2563eb;
}

.attendance-summary-card::before {
    background: #16a34a;
}

.homework-summary-card::before {
    background: #7c3aed;
}

.summary-card-header {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 22px;
}

.summary-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    font-size: 21px;
    font-weight: 800;
}

.summary-icon-blue {
    background: #eff6ff;
    color: #2563eb;
}

.summary-icon-green {
    background: #ecfdf5;
    color: #16a34a;
}

.summary-icon-purple {
    background: #f5f3ff;
    color: #7c3aed;
}

.summary-label {
    display: block;
    margin-bottom: 2px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.summary-card h2 {
    margin: 0;
    color: #111827;
    font-size: 18px;
    font-weight: 800;
}

.summary-data-list {
    display: flex;
    flex-direction: column;
}

.summary-data-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #eef2f7;
}

.summary-data-row:last-child {
    border-bottom: 0;
}

.summary-data-row span {
    color: #64748b;
    font-size: 13px;
}

.summary-data-row strong {
    color: #1e293b;
    font-size: 13px;
    text-align: right;
}

.mini-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.mini-stat-item {
    min-width: 0;
    padding: 15px 8px;
    border: 1px solid #edf0f5;
    border-radius: 13px;
    background: #f8fafc;
    text-align: center;
}

.mini-stat-item span {
    display: block;
    overflow: hidden;
    margin-bottom: 7px;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-stat-item strong {
    display: block;
    color: #111827;
    font-size: 23px;
    font-weight: 800;
}

.status-present {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.status-absent {
    background: #fff1f2;
    border-color: #fecdd3;
}

.status-leave {
    background: #fffbeb;
    border-color: #fde68a;
}

.status-done {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.status-pending {
    background: #fffbeb;
    border-color: #fde68a;
}

.status-not-done {
    background: #fff1f2;
    border-color: #fecdd3;
}

/* Collapsible Panels */

.dashboard-panel {
    overflow: hidden;
    margin-bottom: 18px;
    border: 1px solid #e4e9f1;
    border-radius: 17px;
    background: #ffffff;
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.045);
}

.dashboard-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    cursor: pointer;
    list-style: none;
    transition: background 0.2s ease;
}

.dashboard-panel-header::-webkit-details-marker {
    display: none;
}

.dashboard-panel-header:hover {
    background: #f8fafc;
}

.panel-heading-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.panel-icon {
    width: 43px;
    height: 43px;
    min-width: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #eef2ff;
    font-size: 19px;
}

.panel-heading-content h2 {
    margin: 0 0 3px;
    color: #111827;
    font-size: 17px;
    font-weight: 800;
}

.panel-heading-content p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.panel-arrow {
    width: 34px;
    height: 34px;
    min-width: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 20px;
    font-weight: 700;
    transition: transform 0.2s ease;
}

.dashboard-panel[open] .panel-arrow {
    transform: rotate(180deg);
}

.dashboard-panel-body {
    padding: 0 24px 24px;
    border-top: 1px solid #edf0f5;
}

/* Tables */

.responsive-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
    border: 1px solid #e6eaf0;
    border-radius: 14px;
}

.student-dashboard-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    background: #ffffff;
}

.student-dashboard-table th {
    padding: 14px 16px;
    border-bottom: 1px solid #dfe5ec;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.045em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.student-dashboard-table td {
    padding: 15px 16px;
    border-bottom: 1px solid #edf0f4;
    color: #475569;
    font-size: 13px;
    line-height: 1.55;
    vertical-align: middle;
}

.student-dashboard-table tbody tr:last-child td {
    border-bottom: 0;
}

.student-dashboard-table tbody tr:hover {
    background: #fafbff;
}

.student-dashboard-table td strong {
    color: #1e293b;
}

.table-status,
.percentage-badge,
.grade-badge,
.rating-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.table-status.status-present,
.table-status.homework-done {
    background: #dcfce7;
    color: #15803d;
}

.table-status.status-absent,
.table-status.homework-not_done {
    background: #ffe4e6;
    color: #be123c;
}

.table-status.status-leave,
.table-status.homework-pending {
    background: #fef3c7;
    color: #b45309;
}

.percentage-badge {
    background: #dbeafe;
    color: #1d4ed8;
}

.grade-badge {
    min-width: 28px;
    background: #ede9fe;
    color: #6d28d9;
}

.rating-badge {
    min-width: 42px;
    background: #ecfdf5;
    color: #047857;
}

.progress-report-table {
    min-width: 1350px;
}

.exam-result-table {
    min-width: 900px;
}

.empty-table-state {
    padding: 35px !important;
    color: #94a3b8 !important;
    text-align: center;
}

/* Messages */

.message-list {
    display: flex;
    flex-direction: column;
    gap: 13px;
    margin-top: 20px;
}

.message-card {
    max-width: 76%;
    padding: 15px 17px;
    border: 1px solid #e4e8ef;
    border-radius: 15px;
}

.message-admin {
    align-self: flex-start;
    background: #f8fafc;
}

.message-student {
    align-self: flex-end;
    border-color: #c7d2fe;
    background: #eef2ff;
}

.message-card-header {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 7px;
}

.message-card-header strong {
    color: #1e293b;
    font-size: 13px;
}

.message-card-header small {
    color: #94a3b8;
    font-size: 10px;
}

.message-card p {
    margin: 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.6;
}

.student-message-form {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    margin-top: 22px;
}

.student-message-form textarea {
    width: 100%;
    min-height: 105px;
    padding: 14px 16px;
    border: 1px solid #d8dee8;
    border-radius: 13px;
    outline: none;
    background: #ffffff;
    color: #1f2937;
    font: inherit;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.student-message-form textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.student-send-button {
    padding: 11px 20px;
    border: 0;
    border-radius: 11px;
    background: #111827;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.student-send-button:hover {
    background: #312e81;
    transform: translateY(-1px);
}

/* Tablet */

@media (max-width: 1100px) {
    .dashboard-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tuition-summary-card {
        grid-column: span 2;
    }
}

/* Mobile */

@media (max-width: 700px) {
    .student-dashboard-page {
        padding: 14px;
    }

    .student-welcome-card {
        align-items: flex-start;
        flex-direction: column;
        padding: 20px;
        border-radius: 16px;
    }

    .student-welcome-left {
        align-items: flex-start;
    }

    .student-avatar {
        width: 54px;
        height: 54px;
        min-width: 54px;
        border-radius: 14px;
        font-size: 22px;
    }

    .student-welcome-details h1 {
        font-size: 21px;
    }

    .student-meta-list {
        flex-direction: column;
        gap: 5px;
    }

    .dashboard-summary-grid {
        grid-template-columns: 1fr;
    }

    .tuition-summary-card {
        grid-column: auto;
    }

    .summary-card {
        padding: 19px;
    }

    .dashboard-panel-header {
        padding: 17px;
    }

    .dashboard-panel-body {
        padding: 0 15px 17px;
    }

    .panel-heading-content {
        align-items: flex-start;
    }

    .panel-heading-content h2 {
        font-size: 15px;
    }

    .panel-heading-content p {
        font-size: 11px;
    }

    .panel-icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }

    .message-card {
        max-width: 92%;
    }
}

/* Very Small Mobile */

@media (max-width: 420px) {
    .mini-stat-grid {
        gap: 6px;
    }

    .mini-stat-item {
        padding: 12px 4px;
    }

    .mini-stat-item span {
        font-size: 9px;
    }

    .mini-stat-item strong {
        font-size: 19px;
    }
}