:root {
    --itu-blue: #0f2a4f;
    --itu-light: #55739d;
    --btn-blue: #a9c4e3;
    --border-gray: #777;
}

* {
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    margin: 0;
    background: #ffffff;
    padding-bottom: 40px;
}

body.ui-busy {
    pointer-events: none;
}

a,
a:visited,
a:active,
a:focus {
    color: #0076ca;
    font-weight: 600;
}
a:hover {
    color: #0095ff;
}

/* HEADER */
.header {
    position: relative;
    background: var(--itu-blue);
    color: #fff;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
}

.header img {
    height: clamp(64px, 7vw, 80px);
    width: auto;
    flex-shrink: 0;
}

.header-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;

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

    max-width: calc(100% - 220px); /* avoids overlap with logo + lang */
    pointer-events: none;          /* prevents accidental clicks */
}

.header-title-main {
    font-size: clamp(16px, 2.2vw, 20px);
    font-weight: 700;
    margin-bottom: 15px;
}

.header-title-sub {
    font-size: clamp(13px, 1.8vw, 18px);
    font-weight: 600;
}

.header-title-main,
.header-title-sub {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================
   Mobile header layout
   ========================= */
@media (max-width: 768px) {

    .header {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 12px 10px;
    }

    .header img {
        height: 64px;
        position: static;
        left: auto;
        margin-bottom: 18px;
    }

    .header-title {
        position: static;
        transform: none;
        max-width: 100%;
        pointer-events: auto;
    }

    .header-title-main {
        font-size: 16px;
        font-weight: 700;
    }

    .header-title-sub {
        font-size: 13px;
        font-weight: 500;
        opacity: 0.9;
        margin-bottom: 8px;
    }

}





/* MAIN */
.main {
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 70px;
}

.login-box {
    text-align: center;
    margin-bottom: 70px;
}

.login-box label {
    display: block;              /* stack above input */
    width: 260px;                /* match input width */
    margin: 0 auto 6px;          /* center + spacing */
    text-align: left;            /* left aligned text */
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.login-box input {
    width: 260px;
    padding: 10px;
    font-size: 15px;
    border: 1px solid var(--border-gray);
    outline: none;
    margin-bottom: 20px;
    scroll-margin-bottom: 120px;
}

.login-box input::placeholder {
    color: #aaa;
}

.login-box button {
    width: 260px;
    padding: 10px;
    font-size: 14px;
    font-weight: bold;
    background: var(--itu-blue);
    border: 1px solid var(--itu-blue);
    cursor: pointer;
    color: white;
}

.login-box button:hover:not(:disabled) {
    background: var(--itu-light);
}

.login-box button:disabled:hover {
    background: var(--itu-blue);
}

.login-box button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.error {
    color: #b00020;
    font-size: 14px;
    margin-bottom: 10px;
}

.login-error {
    min-height: 28px;
    margin-bottom: 12px;
    color: #b00020;
    font-size: 14px;
    font-weight: 500;
    text-align: center;

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.login-error.visible {
    opacity: 1;
    visibility: visible;
}


@media (max-width: 768px) {
    .main {
        height: 100%;
        width: auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .login-box {
        width: 100%;
        padding: 16px;
    }
}

.lang-switch {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 14px;
    font-weight: 500;
    user-select: none;
}

.lang-switch a {
    color: #fff;             
    text-decoration: none;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-switch a:hover {
    background-color: #fff;
    color: var(--itu-blue);
}

.lang-switch a:focus {
    outline: none;
    background-color: #d8e1ee;
}

.lang-switch a.active {
    font-weight: 700;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .lang-switch {
        top: 16px;
        right: 18px;
        font-size: 14px;
    }
}


/* Main page layout: sidebar+content */ 
.page {
    display: flex;
    align-items: flex-start; /* top align */
    padding: 0px 0px;
    gap: 15px;
    overflow-x: hidden;
    margin-top: 10px;
}

/* Main content area */
.content {
    flex: 1;
    padding: 10px 0px;
    min-width: 0;
}




/* =========================
   Student Info Bar
   ========================= */

.student-info {
    background-color: #cbd7e6;
    border-top: 1px solid var(--itu-blue);
    border-bottom: 1px solid var(--itu-blue);
    padding: 10px 10px;
    padding-left: 15px;
    font-size: 16px;
    font-weight: 500;
    color: #1f2d3d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.student-info-left {
    display: flex;
    flex-direction: row;      /* desktop: horizontal */
    align-items: center;
    gap: 30px;
}

.student-info-right {
    margin-left: auto;   /* pushes it to the right in flex */
    display: flex;
    align-items: center;
}


.student-info-left > div {
    white-space: nowrap;
}

/* Optional: subtle separators instead of pipes */
.student-info::before,
.student-info::after {
    content: '';
    display: none;
}

.student-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    max-width: 100%;
}

/* =========================
   Mobile student info
   ========================= */
@media (max-width: 768px) {

    .student-info {
        flex-direction: row;
        gap: 4px;
        font-size: 17px;
        text-align: left;
        padding: 8px 10px;
        padding-left: 2px;
    }

    .student-info-left {
        display: flex;
        flex-direction: column;
        align-items:flex-start;
        gap: 4px;
        padding-left: 10px;
    }

    .student-info-right {
        align-self: center;
    }

}



/* Sidebar container */
.sidebar {
    padding: 10px 10px;
    width: 180px;
}

/* Base button style */
.sidebar a {
    display: block;
    position: relative;
    margin-bottom: 10px;
    padding: 0px 20px;
    text-align: center;

    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.5px;
    text-decoration: none;
    color: #000;

    background: #cbd7e6;
    border: 1px solid #94a1b0;
    border-radius: 2px;

    transition: all 0.2s ease;

    align-content: center;
    height: 50px;
}

@media (max-width: 768px) {

    .sidebar a {
        min-height: 0px;
    }
}

/* Hover effect (inactive only) */
.sidebar a:not(.active):hover {
    background: #94a1b0;
    color: white;
}

/* Active button */
.sidebar a.active {
    background: #536682;
    border-color: #536682;
    color: white;
}


.inner_headers {
    padding: 10px 10px;
    background: #e6e6e6;
    border-left: 3px solid #444;
    border-bottom: 1px solid #bfbfbf;
    border-top: 1px solid #bfbfbf;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}





/* ===== General Status ===== */

.general-status-table-wrap {
    overflow-x: auto;
    margin-bottom: 24px;
    padding-left: 15px;
    padding-right: 15px;
}

.general-status-table {
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 6px;
}

.general-status-table th,
.general-status-table td {
    border: 1px solid #000;
    padding: 6px 10px;
    text-align: center;
    vertical-align: middle;
    background-color: #ffffff;
}

.general-status-table th {
    background-color: #eef5e7;
    font-weight: 600;
}

.general-status-table .row-label {
    font-weight: 600;
    background-color: #f6f6f6;
    text-align: left;
    white-space: nowrap;
}

/* Eligibility indicators */
.general-status-table td.ok {
    color: #2e7d32;          /* dark green */
    font-weight: 700;
}

.general-status-table td.not-ok {
    color: #c62828;          /* dark red */
    font-weight: 700;
}








/* ===== Exam Tables ===== */

.exam-table-block-inner {
    overflow-x: auto; 
    margin-bottom: 20px;
    padding-left: 15px;
    padding-right: 15px;
    padding-bottom: 10px;
    padding-top: 6px;
}

.exam-table {
    border-collapse: collapse;
    font-size: 14px;
}

.exam-table th {
    border: 1px solid #000;
    padding: 4px 8px;
    text-align: center;
    vertical-align: middle;
    background-color: #eef5e7;
    font-weight: 600;
}

.exam-table td {
    border: 1px solid #000;
    padding: 14px 8px;
    text-align: center;
    vertical-align: middle;
    background-color: #ffffff;
}

.exam-table td:nth-child(1) { min-width: 90px; }
.exam-table td:nth-child(2) { min-width: 90px; }
.exam-table td:nth-child(3) { min-width: 90px; }
.exam-table td:nth-child(4) { min-width: 90px; }
.exam-table td:nth-child(5) { min-width: 220px; }
.exam-table td:nth-child(6) { min-width: 70px; }
.exam-table td:nth-child(7) { min-width: 70px; }

.exam-table-block .exam-table:nth-of-type(1) thead th {
    background-color: #e6f1dc;
}

.exam-table-block .exam-table:nth-of-type(2) thead th {
    background-color: #f3ccd0;
}



/* =========================
   Exam Guidelines Box
   ========================= */

.exam-guidelines {
    margin-bottom: 20px;
}

.exam-guidelines ul {
    margin: 0;
    padding-left: 20px;
    padding-right: 10px;
}

.exam-guidelines li {
    margin-bottom: 4px;
    line-height: 1.3;
    font-size: 14px;
}

.building-list {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 30px;
    font-size: 14px;
}




/* =========================
   Exam table responsive split
   ========================= */

/* Mobile table hidden by default */
.exam-table-mobile {
    display: none;
}

/* Desktop: show original table only */
@media (min-width: 769px) {
    .exam-table-block-inner {
        display: block;
    }
}

/* Mobile: hide desktop table, show mobile tables */
@media (max-width: 768px) {

    .exam-table-block-inner {
        display: none;
    }

    .exam-table-mobile {
        display: block;
        padding-left: 10px;
        padding-right: 10px;
        margin-bottom: 24px;
    }

    .exam-table-mobile table {
        width: 100%;
        margin-bottom: 12px;
        font-size: 15px;
        font-weight: 400;
    }

    .exam-table-mobile > table:nth-of-type(2) thead th {
        padding-top: 12px;
        padding-bottom: 12px;
    }

}

.no-exam-info{
  margin: 18px 0 30px;
  padding-left: 10px;
  font-size: 15px;
}



/* Container */

.exam-result-table-block {
    overflow-x: auto;
    margin-bottom: 20px;
    padding-left: 15px;
    padding-right: 15px;
    padding-bottom: 10px;
    padding-top: 6px;
}

/* Table base */
.exam-result-table {
    border-collapse: collapse;
    font-size: 15px;
}

/* Header + cells */
.exam-result-table th,
.exam-result-table td {
    border: 1px solid #000000;
    padding: 8px 6px;
    text-align: center;
    vertical-align: middle;
    min-width: 35px;
}

/* Header styling */
.exam-result-table thead th {
    font-weight: 700;
    background-color: #dbdbdb;
}

/* First column (labels) */
.exam-result-table th:first-child,
.exam-result-table td:first-child {
    text-align: left;
    font-weight: 700;
    padding-left: 10px;
    background-color: #dbdbdb;
    min-width: 150px;
}

/* Answer cells text */
.exam-result-table td {
    font-weight: 500;
    transition: background-color 0.15s ease-in-out;
}

.exam-result-table tbody tr:last-child td {
    background-color: #fff;
    border: 0;
}

.optical-report-button {
    text-align: right;
    padding-top: 5px;
    padding-right: 5px;
    font-size: 14px;
    font-weight: 500;
}


.exam-result-summary {
    width: 850px;
    padding: 6px 6px;
    padding-left: 14px;
    margin-bottom: 5px;
    background: #f1f1f1;
    border: 1px solid #000000;
    font-size: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 35px;
    align-items: center;
}

.exam-result-summary span {
    white-space: nowrap;
}


.exam-result-summary .optical-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 160px;           /* stabilizes width */
    text-align: center;

    font-size: 14px;
    text-decoration: none;
    padding: 6px 10px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #fff;
    margin-left: auto;
    letter-spacing: 0.2px;
    font-weight: 600;
}


.exam-result-summary .optical-link.loading {
    opacity: 0.7;
    pointer-events: none;
}

.exam-result-summary .optical-link.loading .optical-link-text {
    visibility: hidden;
}

/* Spinner */
.exam-result-summary .optical-link.loading::after {
    content: '';
    position: absolute;

    width: 12px;
    height: 12px;

    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;

    animation: spin 0.8s linear infinite;
}

.vf-warning {
    max-width: 720px;
    margin-bottom: 20px;
    margin-left: 15px;
    margin-right: 15px;
    margin-bottom: 10px;
    padding: 16px 10px;
    background: #ff8080;
    font-weight: 500;
    text-align: center;
}


.summary-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-box {
    width: 14px;
    height: 14px;
    border: 1px solid #999;
    flex-shrink: 0;
}

.legend-correct {
    background-color: #c8e6c9;
}

.legend-wrong {
    background-color: #fab5bc;
}

.legend-empty {
    background-color: #fff9c4;
}




/* =========================
   Attendance legend
   ========================= */

.attendance-legend {
    display: inline-grid;
    grid-template-columns: repeat(5, auto);
    gap: 12px 40px;
    align-items: center;
    font-size: 15px;
    padding: 5px;
    padding-left: 10px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .attendance-legend {
        grid-template-columns: repeat(2, auto);
    }
}

.attendance-legend-text{
    display: flex;
    flex-direction: column;
    align-items: left;
    gap: 5px;
    font-size: 15px;
    padding: 5px;
    padding-left: 10px;
    margin-bottom: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.legend-box {
    width: 18px;
    height: 18px;
    border: 1px solid #666;
    display: inline-block;
}

.report-attendance-quiz-mistake-button {
    text-align: center;
    padding-top: 5px;
    padding-right: 0px;
    font-size: 14px;
    font-weight: 500;
}

.attendance-result-table tbody tr:last-child td {
    background-color: #fff;
    border: 0;
}


/* ================================
   Attendance table (Exam-style)
   ================================ */

.attendance-result-block-table {
    overflow-x: auto; 
    margin-bottom: 20px;
    padding-left: 15px;
    padding-right: 15px;
    padding-bottom: 10px;
    padding-top: 6px;
}

.attendance-result-table {
    border-collapse: collapse;
    font-size: 15px;
}

.attendance-result-table th,
.attendance-result-table td {
    border: 1px solid #444;
    padding: 8px 6px;
    text-align: center;
    vertical-align: middle;
    min-width: 35px;
}

.attendance-result-table thead th {
    font-weight: 700;
    background-color: #d4e1e9;
}

.attendance-result-table th:first-child,
.attendance-result-table td:first-child {
    text-align: left;
    font-weight: 600;
    padding-left: 10px;
    padding-right: 15px;
    background-color: #fafafa;
    white-space: nowrap;
}

.attendance-result-table .row-spacer th {
    height: 8px;
    padding: 0;
    border: none;
    background: transparent;
}



.attendance-present {
    background-color: #aee3b0; 
}

.attendance-absent {
    background-color: #ff949f;
}

.attendance-exempt {
    background-color: #e7ffa9;
}

.attendance-notconsidered {
    background-color: #444;
}

.attendance-nodata {
    background-color: #cfcfcf;
}

.quiz-no {
    background-color: #efefef;
    font-weight: 700;
}

.quiz-grade {
    padding: 0 !important;
    line-height: 1;
    text-align: center;
    vertical-align: middle;
    font-weight: 500;
    font-size: 14px;
}


.quiz-valid {
    color: #000; 
}

.quiz-invalid {
    background-color: #ff949f;
}

.quiz-nodata {
    background-color: #cfcfcf;
}

.quiz-notgiven {
    background-color: #444;
}

.quiz-nottaken {
    background-color: #ff949f;
}

.quiz-invalid-legend {
    background-color: #ff949f;
    text-align: center;
    align-content: center;
    vertical-align: middle;
    font-weight: 500;
    font-size: 12px;
}

.quiz-star {
    color: #000000;
    font-size: 0.85em;
    vertical-align: super;
    margin-left: 2px;
}

.quiz-note {
    margin-top: 8px;
    font-size: 13px;
    color: #555;
}







/* ===== Report Tables ===== */

.report-table-inner {
    overflow-x: auto; 
    margin-bottom: 20px;
    padding-left: 15px;
    padding-right: 15px;
    padding-bottom: 10px;
    padding-top: 6px;
}

.report-table {
    border-collapse: collapse;
    font-size: 14px;
    width: max-content;
    max-width: 100%;
}

.report-table th {
    border: 1px solid #000;
    padding: 10px 8px;
    text-align: center;
    vertical-align: middle;
    background-color: #eef5e7;
    font-weight: 600;
}

.report-table td {
    border: 1px solid #000;
    padding: 10px 8px;
    text-align: center;
    vertical-align: middle;
    background-color: #ffffff;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

.report-table td:nth-child(1) { min-width: 80px; max-width: 80px; }
.report-table td:nth-child(2) { min-width: 65px; max-width: 65px; }
.report-table td:nth-child(3) { min-width: 100px; max-width: 100px; }
.report-table td:nth-child(4) { min-width: 240px; max-width: 240px; text-align: left; }
.report-table td:nth-child(5) { min-width: 120px; max-width: 120px; }
.report-table td:nth-child(6) { min-width: 200px; max-width: 200px; text-align: left; }

.optical-report .report-table td:nth-child(1) { min-width: 80px; max-width: 80px; }
.optical-report .report-table td:nth-child(2) { min-width: 65px; max-width: 65px; }
.optical-report .report-table td:nth-child(3) { min-width: 80px; max-width: 80px; }
.optical-report .report-table td:nth-child(4) { min-width: 130px; max-width: 130px; text-align: center; }
.optical-report .report-table td:nth-child(5) { min-width: 140px; max-width: 140px; }
.optical-report .report-table td:nth-child(6) { min-width: 110px; max-width: 110px; text-align: center;}
.optical-report .report-table td:nth-child(7) { min-width: 200px; max-width: 200px; text-align: left; }








/* ===============================
   Attendance / Quiz report modal
   =============================== */

/* Backdrop */
.aq-report-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: opacity .2s ease, visibility .2s ease;
    z-index: 1499;
}

.aq-report-backdrop.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Modal container */
.aq-report-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(.95);

    width: min(92vw, 420px);
    max-height: 90vh;

    background: #fff;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);

    opacity: 0;
    visibility: hidden;

    transition: all .2s ease;
    z-index: 1500;

    display: flex;
    flex-direction: column;
}

.aq-report-modal.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Header */
.aq-report-header {
    padding: 0 16px;
    background: #eaeaea;

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

    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.aq-report-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.aq-report-close {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
}

/* Body */
.aq-report-body {
    padding: 16px;
    padding-bottom: 8px;
    overflow-y: auto;
}

/* Sections */
.aq-section {
    margin-bottom: 16px;
    border: 1px solid #ddd;
    padding: 10px;
    font-size: 15px;
}

.aq-section legend {
    font-weight: bold;
    padding: 0 6px;
}

.aq-help {
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
}

/* Grid */
.aq-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
}

/* Individual box */
.aq-box {
    padding: 6px 8px;
    font-weight: 600;

    background: #f6f6f6;
    border: 1px solid #d4d4d4;

    display: flex;
    align-items: center;
    justify-content: left;
    gap: 6px;

    cursor: pointer;
}

/* Checked state */
.aq-box input[type="checkbox"]:checked + span,
.aq-box:has(input[type="checkbox"]:checked) {
    background: #ebebeb;
    border-color: #d4d4d4;
}


/* Footer */
.aq-report-footer {
    padding-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.aq-report-footer button {
    min-width: 120px;
    padding: 8px 6px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease,
                border-color 0.2s ease,
                box-shadow 0.2s ease;
}

@media (max-width: 768px) {

    .aq-report-modal {
        width: min(96vw, 420px);
    }

}

/* Text area wrapper */
.aq-textarea {
    margin-top: 10px;
}

/* Textarea itself */
.aq-textarea textarea {
    width: 100%;
    box-sizing: border-box;

    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.4;

    border: 1px solid #cfd6df;
    border-radius: 6px;
    background-color: #fafbfc;
    color: #333;

    resize: none;           /* prevent ugly resizing */
    outline: none;
}

/* Focus state */
.aq-textarea textarea:focus {
    border-color: #3b82f6;  /* consistent with primary theme */
    background-color: #fff;
}

/* Placeholder style */
.aq-textarea textarea::placeholder {
    color: #8a94a6;
    font-size: 13px;
}


/* =========================
   Hamburger overlay menu
   ========================= */

/* Hamburger button */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: #fff;
    position: absolute;
    right: 14px;
    top: 14px;
    z-index: 1200;
    -webkit-tap-highlight-color: transparent;
}

/* When menu is open, change icon */
.hamburger-btn[aria-expanded="true"]::before {
    content: "✕";
}

.hamburger-btn[aria-expanded="true"] {
    font-size: 26px;
}

.hamburger-btn::before {
    content: "☰";
}

.hamburger-btn:focus,
.hamburger-btn:active {
    outline: none;
    background-color: transparent;
}



/* Mobile behavior */
@media (max-width: 768px) {

    .hamburger-btn {
        display: block;
    }

    /* Overlay sidebar base state (closed) */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;

        width: 100%;
        min-width: 0;

        background: var(--itu-blue);
        z-index: 1100;

        padding: 10px 20px 10px; /* below header */

        /* animation-friendly hidden state */
        transform: translateY(-12px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transition: transform 0.22s ease, opacity 0.22s ease, visibility 0.22s ease;
    }

    /* Open state */
    .sidebar.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Menu link styling for dark background */
    .sidebar a {
        display: block;
        width: 100%;
        padding: 12px 0;
        font-size: 18px;
    }

}

.menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 1050;

    /* animation-friendly hidden state */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.menu-backdrop.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.menu-open {
    overflow: hidden;
    touch-action: none;
}


/* =========================
   Mobile menu logo
   ========================= */

.mobile-menu-header {
    display: none;
}

@media (max-width: 768px) {

    .mobile-menu-header {
        display: flex;
        justify-content: left;
        align-items: center;
        margin-bottom: 16px;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(255,255,255,0.25);
    }

    .mobile-menu-header span {
        text-align: left;
        font-weight: 600;
        color: white;
        font-size: 14px;
        padding-left: 6px;
        margin-right: 40px;
    }

    .mobile-menu-header img {
        height: 45px;
        width: auto;
        border-right: 1px solid white;
    }

}


body.modal-open {
    overflow: hidden;
    touch-action: none;
}

input[type="radio"] {
    margin: 0;
    transform: translateY(-0.25px);
}

input[type="checkbox"] {
    margin: 0;
    transform: translateY(-0.25px);
}

/* Optical error modal */
.info-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.info-modal.open {
    display: flex;
}

.info-modal-content {
    background: #fff;
    padding: 20px 24px;
    max-width: 360px;
    width: calc(100% - 40px);
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.info-modal-content p {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.4;
}

.info-modal-content button {
    padding: 8px 18px;
    border: none;
    border-radius: 4px;
    background: #b71c1c;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}



/* Backdrop */
.optical-report-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease;
    z-index: 1499;
}

.optical-report-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* Modal */
.optical-report-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(.95);
    width: min(92vw, 400px);
    max-height: 90vh;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    opacity: 0;
    visibility: hidden;
    transition: all .2s ease;
    z-index: 1500;
    display: flex;
    flex-direction: column;
}

.optical-report-modal.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Header */
.optical-report-header {
    padding: 0px 16px;
    background: #eaeaea;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.optical-report-close {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
}

/* Body */
.optical-report-body {
    padding: 16px;
    padding-bottom: 8px;
    overflow-y: auto;
}

.optical-section {
    margin-bottom: 16px;
    border: 1px solid #ddd;
    padding: 10px;
    font-size: 15px;
}

.optical-section legend {
    font-weight: bold;
    padding: 0 6px;
}

.optical-section label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

/* Booklet row */
.booklet-select-row {
    margin-top: 8px;
    display: none;
    gap: 10px;
    justify-content: left;
}

.booklet-select-row.open {
    display: flex;
    flex-direction: column;
    padding-top: 10px;
    padding-left: 23px;
    border-top: 1px solid #dbdbdb;
}

.correct-booklet-radios {
    display: flex;
    align-items: center;
    gap: 4px;
}

.correct-booklet-radios label {
    display: flex;
    justify-content: left;
    align-items: center;

    padding: 4px 6px;
    padding-right: 10px;
    margin: 0;
    
    gap: 5px;
    font-weight: 600;

    background: #f6f6f6;
    border: 1px solid #d4d4d4;
}

.correct-booklet-radios span {
    margin-right: 6px;
    align-items: center;
}

.correct-booklet-radios input[type="radio"]:checked + span,
.correct-booklet-radios label:has(input[type="radio"]:checked) {
    background: #ebebeb;
    border-color: #d4d4d4;
}

.question-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
}

.question-grid label {
    padding-top: 6px;
    padding-bottom: 6px;
    padding-left: 8px;
    margin: 0;
    font-weight: 600;
    background: #f6f6f6;
    display: flex;
    justify-content: left;
    align-items: center;
    gap: 6px;
    border: 1px solid #d4d4d4;
}

.question-grid input[type="checkbox"]:checked + span,
.question-grid label:has(input[type="checkbox"]:checked) {
    background: #ebebeb;
    border-color: #d4d4d4;
}

.question-grid-wrapper {
    flex-direction: column;
    margin-top: 8px;
    display: none;
    gap: 10px;
    align-items: left;
    padding-left: 23px;
    padding-top: 10px;
    border-top: 1px solid #dbdbdb;
}

.question-grid-wrapper.open {
    display: flex;
}



/* Footer */
.optical-report-footer {
    padding-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.optical-report-footer button {
    min-width: 120px;
    padding: 8px 6px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease,
                border-color 0.2s ease,
                box-shadow 0.2s ease;
}

.btn-primary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--itu-blue);
    color: #fff;
    border: 1px solid var(--itu-blue);
}



.btn-primary:active {
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.25);
}

.btn-primary:disabled {
    background-color: #bdbdbd;
    border-color: #afafaf;
    color: #ffffff;
    cursor: not-allowed;
    opacity: 0.7;
    pointer-events: none;
}

.btn-primary:disabled:hover {
    background-color: #bdbdbd;
}

.btn-primary.loading {
    opacity: 0.9;
    pointer-events: none;
    cursor: default;
}

/* Disable hover effect when loading */
.btn-primary.loading:hover {
    background-color: var(--itu-blue);   /* same as normal */
    border-color: var(--itu-blue);
    box-shadow: none;
}

.btn-primary.loading .btn-text {
    visibility: hidden;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    margin-left: 8px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

body.ui-busy .btn-primary.loading {
    pointer-events: auto;
}

.btn-secondary {
    background-color: #f4f4f4;
    color: #333;
    border: 1px solid #bbb;
}

.btn-secondary:active {
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}







/* Logout button reset */
.logout-form {
    margin: 0;
    padding: 0;
}

.logout-icon {
    background: transparent;          /* match parent background */
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Icon sizing */
.logout-icon img {
    width: 22px;
    height: 22px;
}

/* Optional hover effect (subtle, professional) */
.logout-icon:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}



/* ===============================
   Logout modal
   =============================== */

.logout-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);

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

    z-index: 10000;
}

.logout-modal-overlay.open {
    display: flex;
}

.logout-modal {
    background: #fff;
    border-radius: 10px;
    max-width: 360px;
    width: 90%;
    padding: 0px;
    text-align: center;
}

.logout-modal-header {
    padding: 0px 16px;
    background: #eaeaea;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.logout-modal h3 {
    font-size: 18px;
}

.logout-modal p {
    padding-top: 15px;
    font-size: 14px;
    line-height: 1.4;
}


.logout-modal-footer {
    padding: 20px;
    display: flex;
    justify-content: space-between;
}

.logout-modal-footer button {
    min-width: 120px;
    padding: 8px 6px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease,
                border-color 0.2s ease,
                box-shadow 0.2s ease;
}

body.logout-modal-open {
    overflow: hidden;
}


@media (hover: hover) and (pointer: fine) {
    .btn-primary:hover {
        background-color: var(--itu-light);
        border-color: var(--itu-light);
    }

    .btn-secondary:hover {
        background-color: #e6e6e6;
    }

    .exam-result-summary .optical-link:hover {
        background: #498dbd;
        color: white;
    }
}