:root {
    --student-navy: #0b3b6d;
    --student-blue: #175ca6;
    --student-gold: #ffd100;
    --student-red: #d71920;
    --student-line: #d9e1ea;
    --student-muted: #64748b;
}

.student-admin-main,
.student-directory-main {
    min-height: 62vh;
    padding: 54px 20px 76px;
    background: #fff;
}

.student-login-card {
    width: min(430px, 100%);
    margin: 46px auto;
    padding: 28px;
    background: #fff;
    border: 1px solid var(--student-line);
    border-top: 4px solid var(--student-red);
    border-radius: 6px;
    box-shadow: 0 16px 42px rgba(8, 42, 77, .09);
}

.student-login-stage {
    width: min(920px, 100%);
    margin: 0 auto;
}

.student-login-stage .official-section-divider {
    width: 100%;
    margin-top: 0;
}

.student-login-stage .student-login-card {
    width: min(390px, 100%);
    margin: 28px auto 0;
    padding: 24px;
    border-top-color: var(--student-gold);
    box-shadow: 0 10px 28px rgba(8, 42, 77, .08);
}

.student-login-stage .student-login-card h1 {
    font-size: 1.2rem;
}

.student-login-stage .student-login-card > p {
    margin: 7px 0 18px;
}

.student-login-card h1,
.student-page-heading h1 {
    margin: 0;
    color: #102d51;
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    line-height: 1.16;
}

.student-login-card > p,
.student-page-heading p,
.student-upload-card p,
.student-list-heading p,
.student-privacy-note p {
    color: var(--student-muted);
    font-size: .74rem;
    line-height: 1.65;
}

.student-login-card label,
.student-file-field span {
    display: block;
    margin-bottom: 7px;
    color: #102d51;
    font-size: .68rem;
    font-weight: 700;
}

.student-inline-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.student-inline-form input,
.student-filter-form input,
.student-filter-form select,
.student-file-field {
    min-height: 43px;
    padding: 9px 11px;
    color: #102d51;
    background: #fff;
    border: 1px solid #b8c5d4;
    border-radius: 4px;
    font: inherit;
    font-size: .72rem;
}

.student-inline-form button,
.student-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    padding: 9px 17px;
    color: #fff;
    cursor: pointer;
    background: var(--student-blue);
    border: 0;
    border-radius: 4px;
    font: inherit;
    font-size: .68rem;
    font-weight: 700;
    text-decoration: none;
}

.student-button.secondary {
    color: var(--student-navy);
    background: #fff;
    border: 1px solid #aebdce;
}

.student-admin-shell,
.student-directory-shell {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.student-page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 25px;
    gap: 25px;
}

.student-page-heading p {
    margin: 8px 0 0;
}

.student-kicker {
    margin: 0 0 7px !important;
    color: var(--student-red) !important;
    font-size: .58rem !important;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.student-alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 4px;
    font-size: .68rem;
    font-weight: 600;
}

.student-alert.success {
    color: #075e42;
    background: #e9f8f1;
    border: 1px solid #a9dfc9;
}

.student-alert.error {
    color: #8c1820;
    background: #fff0f1;
    border: 1px solid #efb9bd;
}

.student-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
    gap: 12px;
}

.student-stat-grid article,
.student-panel,
.student-upload-card,
.student-admin-actions,
.student-privacy-note {
    background: #fff;
    border: 1px solid var(--student-line);
    border-radius: 6px;
}

.student-stat-grid article {
    padding: 18px;
    border-top: 3px solid var(--student-navy);
}

.student-stat-grid article:nth-child(2) { border-top-color: var(--student-blue); }
.student-stat-grid article:nth-child(3) { border-top-color: var(--student-gold); }
.student-stat-grid article:nth-child(4) { border-top-color: var(--student-red); }

.student-stat-grid span,
.student-stat-grid strong {
    display: block;
}

.student-stat-grid span {
    color: var(--student-muted);
    font-size: .62rem;
}

.student-stat-grid strong {
    margin-top: 7px;
    color: #102d51;
    font-size: 1.8rem;
}

.student-upload-card {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    align-items: center;
    padding: 24px;
    gap: 30px;
}

.student-upload-card h2,
.student-panel h2 {
    margin: 0;
    color: #102d51;
    font-size: 1rem;
}

.student-upload-card form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
}

.student-file-field {
    display: block;
}

.student-file-field input {
    width: 100%;
    font: inherit;
    font-size: .66rem;
}

.student-admin-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding: 18px 20px;
    gap: 20px;
}

.student-admin-actions strong,
.student-admin-actions span {
    display: block;
}

.student-admin-actions strong {
    color: #102d51;
    font-size: .72rem;
}

.student-admin-actions span {
    margin-top: 4px;
    color: var(--student-muted);
    font-size: .62rem;
}

.student-privacy-note {
    margin-top: 14px;
    padding: 17px 20px;
    border-left: 4px solid var(--student-gold);
}

.student-privacy-note strong {
    color: #102d51;
    font-size: .7rem;
}

.student-privacy-note p {
    margin: 4px 0 0;
}

.student-analysis-grid {
    display: grid;
    grid-template-columns: .7fr 1.3fr;
    margin-bottom: 16px;
    gap: 12px;
}

.student-panel {
    min-width: 0;
    padding: 22px;
}

.student-bars {
    display: grid;
    margin-top: 20px;
    gap: 13px;
}

.student-bars > div {
    display: grid;
    grid-template-columns: 135px minmax(0, 1fr) 38px;
    align-items: center;
    gap: 10px;
}

.student-bars span,
.student-bars strong {
    font-size: .6rem;
}

.student-bars i {
    height: 8px;
    overflow: hidden;
    background: #e8edf3;
    border-radius: 99px;
}

.student-bars b {
    display: block;
    height: 100%;
    background: var(--student-blue);
}

.student-class-chart {
    display: flex;
    align-items: end;
    height: 195px;
    margin-top: 18px;
    padding-bottom: 33px;
    overflow-x: auto;
    border-bottom: 1px solid var(--student-line);
    gap: 5px;
}

.student-class-chart > div {
    position: relative;
    display: flex;
    flex: 0 0 20px;
    align-items: center;
    justify-content: end;
    flex-direction: column;
    height: 100%;
}

.student-class-chart i {
    display: block;
    width: 14px;
    min-height: 5px;
    background: var(--student-blue);
}

.student-class-chart span {
    position: absolute;
    top: calc(100% + 7px);
    width: 50px;
    color: var(--student-muted);
    font-size: .42rem;
    text-align: center;
    transform: rotate(-35deg);
}

.student-class-chart strong {
    position: absolute;
    bottom: 4px;
    color: #102d51;
    font-size: .47rem;
}

.student-list-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 20px;
}

.student-list-heading p {
    margin: 5px 0 0;
}

.student-filter-form {
    display: grid;
    grid-template-columns: minmax(190px, 1.35fr) minmax(135px, .8fr) minmax(110px, .7fr) minmax(120px, .75fr) auto;
    gap: 7px;
}

.student-table-wrap {
    overflow-x: auto;
}

.student-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: .64rem;
}

.student-table-wrap th,
.student-table-wrap td {
    padding: 11px 9px;
    text-align: left;
    border-bottom: 1px solid #e4e9ef;
}

.student-table-wrap th {
    color: #51657b;
    background: #f5f7fa;
    font-size: .56rem;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.student-table-wrap td {
    color: #42556b;
}

.student-table-wrap td strong {
    color: #102d51;
}

.student-table-wrap td a,
.student-detail-heading a,
.student-pagination a {
    color: var(--student-blue);
    font-weight: 700;
    text-decoration: none;
}

.student-row-actions,
.student-detail-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.student-row-actions {
    min-width: 145px;
}

.student-whatsapp-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    color: #fff !important;
    background: #128c53;
    border-radius: 4px;
    font-size: .61rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
}

.student-whatsapp-link:hover,
.student-whatsapp-link:focus-visible {
    background: #087742;
}

.student-whatsapp-link.compact {
    min-height: 30px;
    padding: 6px 8px;
    font-size: .55rem;
    gap: 5px;
}

.student-whatsapp-link.compact svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.student-phone-link {
    color: #087742;
    font-weight: 800;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.student-empty {
    padding: 34px !important;
    color: var(--student-muted) !important;
    text-align: center !important;
}

.student-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 16px;
    color: var(--student-muted);
    font-size: .62rem;
    gap: 14px;
}

.student-detail {
    margin-top: 16px;
    border-top: 4px solid var(--student-red);
}

.student-detail-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 20px;
}

.student-detail-heading h2 {
    font-size: 1.35rem;
}

.student-detail-actions {
    justify-content: flex-end;
}

.student-detail-group {
    margin-top: 22px;
}

.student-detail-group h3 {
    margin: 0 0 10px;
    color: var(--student-blue);
    font-size: .7rem;
    text-transform: uppercase;
}

.student-detail-group dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    gap: 1px;
    background: var(--student-line);
    border: 1px solid var(--student-line);
}

.student-detail-group dl div {
    min-width: 0;
    padding: 11px;
    background: #fff;
}

.student-detail-group dt {
    color: var(--student-muted);
    font-size: .52rem;
    font-weight: 700;
}

.student-detail-group dd {
    margin: 5px 0 0;
    overflow-wrap: anywhere;
    color: #102d51;
    font-size: .64rem;
    font-weight: 600;
}

@media (max-width: 900px) {
    .student-analysis-grid,
    .student-upload-card {
        grid-template-columns: 1fr;
    }

    .student-filter-form {
        grid-template-columns: 1fr 1fr;
    }

    .student-list-heading {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 650px) {
    .student-admin-main,
    .student-directory-main {
        padding-inline: 14px;
    }

    .student-page-heading,
    .student-list-heading,
    .student-admin-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .student-stat-grid {
        grid-template-columns: 1fr 1fr;
    }

    .student-upload-card form,
    .student-filter-form,
    .student-inline-form {
        grid-template-columns: 1fr;
    }

    .student-detail-group dl {
        grid-template-columns: 1fr;
    }

    .student-detail-heading,
    .student-detail-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .student-detail-actions .student-whatsapp-link {
        width: 100%;
    }
}
