body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a3a4a 0%, #28454d 60%, #1e5f74 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    z-index: 999;
}

.login-backdrop {
    background: #00000045;
    height: 100%;
    width: 100%;
    position: fixed;
    z-index: 0;
}

.login-header {
    background: rgb(255 255 255);
    border-bottom: 1px solid rgb(232 232 232 / 53%);
    padding: 2rem 0 1rem;
    text-align: center;
}

.login-header .portal-icon {
    width: 150px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-body {
    background: #FFF;
    padding: 2rem;
}

.form-label {
    color: #8d8d8d;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.form-control {
    border-radius: 8px;
    color: #474747;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
background: rgb(255 255 255);
    border-color: #4db8d4;
    box-shadow: 0 0 0 3px rgba(77, 184, 212, 0.2);
    color: #000000;
    outline: none;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.btn-login {
    background: #0a5ab1;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.7rem;
    letter-spacing: 0.03em;
    transition: background 0.2s, transform 0.1s;
    width: 100%;
}

.btn-login:hover:not(:disabled) {
    background: #256e86;
}

.btn-login:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.error-msg {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.4);
    border-radius: 8px;
    color: #f08080;
    font-size: 0.875rem;
    padding: 0.6rem 0.9rem;
    display: none;
}

.login-footer {
    background: #75bc2a;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding: 1rem 2rem;
    text-align: center;
    color: rgb(255 255 255);
    font-size: 0.78rem;
    text-shadow: -1px 2px 3px black;
}

.header-logo{
    position: relative;
    width: 20% !important;
    overflow: hidden;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Eye toggle */
.input-group .form-control {
    border-right: none;
}

.input-group .btn-eye {
    background: rgb(232 240 254);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-left: none;
    border-radius: 0 8px 8px 0;
    color: rgb(20 20 20 / 40%);
    padding: 0 0.75rem;
    cursor: pointer;
    transition: color 0.2s;
}

.input-group .btn-eye:hover {
    color: #616161;
}

.input-group .form-control:focus + .btn-eye {
    border-color: #4db8d4;
}

/* ═══════════════════════════════════════════════════════════════
   Admin / App Layout
   ═══════════════════════════════════════════════════════════════ */

body.app-layout {
    background: #f0f2f5;
    display: block;
    align-items: unset;
    justify-content: unset;
    min-height: 100vh;
}

/* ── Hamburger button ──────────────────────────────────────── */
.btn-hamburger {
    background: rgb(64 131 195);
    border: none;
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
.btn-hamburger:hover {
    background: rgb(64 131 195);
}

/* ── Top Navbar ────────────────────────────────────────────── */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #dffbf8;
    z-index: 1040;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    gap: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.navbar-brand-text {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
    text-decoration: none;
}
.navbar-brand-text:hover {
    color: #cce9f2;
    text-decoration: none;
}

.nav-user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
}

.nav-user-avatar {
    width: 34px;
    height: 34px;
    background: rgb(139 5 156);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.nav-user-name {
    color: #8a029b;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
}

.nav-user-role {
    color: rgb(0 0 0 / 55%);
    font-size: 0.72rem;
    line-height: 1.2;
}

.btn-nav-logout {
    background: rgb(255 0 0 / 49%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.btn-nav-logout:hover {
    background: rgb(255 0 0 / 75%);
    color: #fff;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.app-sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 230px;
    background: #fff;
    border-right: 1px solid #e4e7eb;
    overflow-y: auto;
    z-index: 1030;
    display: flex;
    flex-direction: column;
}

.sidebar-section-label {
    padding: 1rem 1rem 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #9aabb5;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.62rem 1rem;
    color: #414141;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    margin-bottom: 5px;
}
.sidebar-nav-link:hover {
    background: #f0f7fa;
    color: #1e5f74;
    text-decoration: none;
}
.sidebar-nav-link.active {
    background: #e8f4f8;
    color: #1e5f74;
    border-left-color: #1e5f74;
    font-weight: 600;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.65;
}
.sidebar-nav-link.active .nav-icon,
.sidebar-nav-link:hover .nav-icon {
    opacity: 1;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid #e4e7eb;
    font-size: 0.71rem;
    color: #b0bec5;
    text-align: center;
}

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
    margin-left: 230px;
    margin-top: 60px;
    padding: 1.75rem;
    background: #f0f2f5;
    min-height: calc(100vh - 60px);
}

/* ── Page header ───────────────────────────────────────────── */
.page-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a3a4a;
    margin-bottom: 0.2rem;
}
.page-subtitle {
    font-size: 0.83rem;
    color: #6b7f8a;
    margin-bottom: 0;
}

/* ── Stat cards ────────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem 1.4rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    border: 1px solid #e8edf0;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-card-icon svg {
    width: 22px;
    height: 22px;
}

.stat-icon-blue   { background: #e8f0fe; }
.stat-icon-green  { background: #e6f4ea; }
.stat-icon-orange { background: #fef3e2; }
.stat-icon-purple { background: #f0e8fe; }
.stat-icon-teal   { background: #e0f4f8; }

.stat-icon-blue   svg { fill: #1967d2; }
.stat-icon-green  svg { fill: #1e8e3e; }
.stat-icon-orange svg { fill: #e37400; }
.stat-icon-purple svg { fill: #6a30c3; }
.stat-icon-teal   svg { fill: #1e5f74; }

.stat-card-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a3a4a;
    line-height: 1;
}
.stat-card-label {
    font-size: 1.2rem;
    color: #003a7e;
    margin-top: 0.25rem;
}

/* ── Content card ──────────────────────────────────────────── */
.content-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    border: 1px solid #e8edf0;
    overflow: hidden;
}
.content-card-header {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid #e8edf0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.content-card-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1a3a4a;
    margin: 0;
}

/* ── Toast container ───────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 340px;
}

.app-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    font-size: 0.875rem;
    font-weight: 500;
    background: #fff;
    border: 1px solid #e0e0e0;
    animation: toastIn 0.22s ease;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.toast-icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.toast-icon svg { width: 100%; height: 100%; }
.toast-body  { flex: 1; color: #2d3a40; }
.toast-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #9aa5b1;
    cursor: pointer;
    padding: 0 0 0 0.25rem;
    line-height: 1;
}
.toast-close:hover { color: #4a5568; }

.toast-success { border-left: 4px solid #1e8e3e; }
.toast-success .toast-icon svg { fill: #1e8e3e; }
.toast-error   { border-left: 4px solid #d93025; }
.toast-error   .toast-icon svg { fill: #d93025; }
.toast-warning { border-left: 4px solid #e37400; }
.toast-warning .toast-icon svg { fill: #e37400; }
.toast-info    { border-left: 4px solid #1e5f74; }
.toast-info    .toast-icon svg { fill: #1e5f74; }

/* ── Page loader ───────────────────────────────────────────── */
#page-loader {
    position: fixed;
    inset: 0;
    background: rgba(240, 242, 245, 0.85);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
}
.portal-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #dce3e8;
    border-top-color: #1e5f74;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Sidebar backdrop (mobile) ─────────────────────────────── */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1029;
}
.sidebar-backdrop.show { display: block; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }
    .app-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }
    .main-content {
        margin-left: 0;
    }
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn-teal {
    background: #1e5f74;
    color: #fff;
    border: none;
}
.btn-teal:hover,
.btn-teal:focus {
    background: #256e86;
    color: #fff;
}
.btn-xs {
    font-size: 0.75rem;
    padding: 0.22rem 0.65rem;
}
.btn-action-sm {
    font-size: 0.78rem;
    padding: 0.25rem 0.65rem;
}
.history-filter-select {
    min-width: 150px;
    max-width: 220px;
    font-size: 0.85rem;
}

/* ── Search / count ─────────────────────────────────────────────── */
.search-wrap  { max-width: 300px; }
.item-count   { font-size: 0.8rem; color: #9aabb5; }

/* ── Table utilities ─────────────────────────────────────────────── */
.col-th {
    font-size: 0.72rem;
    font-weight: 700;
    color: #9aabb5;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.col-th-narrow  { width: 48px; }
.table-serial   { font-size: 0.8rem;   color: #c0ccd4; }
.cell-name      { font-size: 0.875rem; font-weight: 600; color: #1a3a4a; }
.cell-username  { font-size: 0.85rem;  color: #4a5568; }
.cell-secondary { font-size: 0.82rem;  color: #6b7f8a; }
.cell-dim       { font-size: 0.8rem;   color: #9aabb5; }
.cell-sub       { font-size: 0.76rem;  color: #9aabb5; }
.cell-actions   { white-space: nowrap; }
.table-state-cell { color: #9aabb5; font-size: 0.875rem; }

/* ── Role pills ──────────────────────────────────────────────────── */
.role-pill {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    display: inline-block;
    text-transform: capitalize;
}
.role-pill-admin   { background: #e8f0fe; color: #1967d2; }
.role-pill-user    { background: #f0f2f5; color: #4a5568; }
.role-pill-faculty { background: #e0f4f8; color: #1e5f74; }

/* ── Status pills ────────────────────────────────────────────────── */
.status-pill {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    display: inline-block;
}
.status-active   { background: #e6f4ea; color: #1e8e3e; }
.status-inactive { background: #fce8e6; color: #c0392b; }

/* ── Misc ────────────────────────────────────────────────────────── */
.badge-teal     { background: #e8f4f8; color: #1e5f74; font-size: 0.75rem; }
.spinner-teal   { color: #1e5f74; }
.section-icon   { vertical-align: -2px; margin-right: 0.4rem; }
.pagination-info { font-size: 0.8rem; color: #9aabb5; }

/* ── Modal overrides (admin layout) ─────────────────────────────── */
body.app-layout .modal-content {
    border-radius: 12px;
    border: 1px solid #e8edf0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
body.app-layout .modal-header {
    border-color: #e8edf0;
    padding: 1rem 1.25rem;
}
body.app-layout .modal-footer {
    border-color: #e8edf0;
    padding: 0.85rem 1.25rem;
}
body.app-layout .modal-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a3a4a;
}
body.app-layout .modal-body {
    padding: 1.25rem;
}

/* ── Form field label ────────────────────────────────────────────── */
.form-field-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #9aabb5;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
    display: block;
}
.form-field-label .note {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.75rem;
    font-weight: 400;
}

/* ── Modal inline error ──────────────────────────────────────────── */
.modal-error {
    background: #fff2f2;
    border: 1px solid #f5c0c0;
    border-radius: 6px;
    color: #c0392b;
    font-size: 0.83rem;
    padding: 0.5rem 0.75rem;
}

/* ── Admin form overrides (reset login-page dark-input styles) ── */
body.app-layout .form-control,
body.app-layout .form-select {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #212529;
    transition: border-color 0.15s, box-shadow 0.15s;
}
body.app-layout .form-control:focus,
body.app-layout .form-select:focus {
    background-color: #fff;
    border-color: #4db8d4;
    box-shadow: 0 0 0 3px rgba(77, 184, 212, 0.15);
    color: #212529;
    outline: none;
}
body.app-layout .form-control::placeholder {
    color: #adb5bd;
}
body.app-layout .input-group-text {
    background-color: #fff;
    border-color: #dee2e6;
    color: #6b7f8a;
}
body.app-layout .input-group .form-control.border-end-0 {
    border-right: none;
}
body.app-layout .input-group .input-group-text.border-end-0 {
    border-right: none;
}

/* ── Outline teal button ─────────────────────────────────────────── */
.btn-outline-teal {
    border: 1px solid #1e5f74;
    color: #1e5f74;
    background: transparent;
}
.btn-outline-teal:hover,
.btn-outline-teal:focus {
    background: #1e5f74;
    color: #fff;
    border-color: #1e5f74;
}

/* ── Test Questions page ─────────────────────────────────────────── */
.tq-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    color: #6b7f8a;
    text-decoration: none;
    transition: color 0.15s;
}
.tq-back-link:hover { color: #1e5f74; text-decoration: none; }
.tq-back-link svg   { flex-shrink: 0; fill: currentColor; }

.tq-page-header { }

/* ── Tabs ──────────────────────────────────────────────────────── */
.tq-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e8edf0;
    padding: 0 1.25rem;
}
.tq-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #6b7f8a;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: -1px;
    padding: 0.75rem 1rem 0.65rem;
    transition: color 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.tq-tab:hover  { color: #1e5f74; }
.tq-tab.active { color: #1e5f74; border-bottom-color: #1e5f74; font-weight: 600; }

.tq-tab-badge {
    background: #e8f4f8;
    color: #1e5f74;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 20px;
    min-width: 1.4rem;
    text-align: center;
}
.tq-tab-panel { }

/* ── Question type cards (modal) ───────────────────────────────── */
.qtype-cards {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.qtype-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    border: 1.5px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.83rem;
    font-weight: 500;
    color: #4a5568;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    user-select: none;
    flex: 1;
    min-width: 130px;
    justify-content: center;
}
.qtype-card svg { fill: #9aabb5; flex-shrink: 0; transition: fill 0.15s; }
.qtype-card:hover {
    border-color: #1e5f74;
    color: #1e5f74;
}
.qtype-card:hover svg { fill: #1e5f74; }
.qtype-card.active {
    border-color: #1e5f74;
    background: #e8f4f8;
    color: #1e5f74;
    font-weight: 600;
}
.qtype-card.active svg { fill: #1e5f74; }

/* ── MCQ options ────────────────────────────────────────────────── */
.mcq-options { display: flex; flex-direction: column; gap: 0.5rem; }
.mcq-option-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.mcq-option-letter {
    width: 24px;
    height: 24px;
    background: #e8f4f8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #1e5f74;
    flex-shrink: 0;
}
.mcq-correct-radio {
    width: 18px;
    height: 18px;
    accent-color: #1e5f74;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Match subsection label ─────────────────────────────────────── */
.match-subsection-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b7f8a;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

/* ── Match pairs ────────────────────────────────────────────────── */
.match-pairs-header {
    display: flex;
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #9aabb5;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0 0.1rem;
    justify-items: start;
    align-items: center;
    flex-direction: row;
    justify-content: space-around;
}
.match-pair-row {
    display: grid;
    grid-template-columns: 22px 1fr 22px 1fr 32px;
    gap: 0.4rem;
    align-items: center;
    margin-bottom: 0.4rem;
}
.match-pair-letter {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1e5f74;
    text-align: center;
}
.match-pair-num {
    font-size: 0.78rem;
    font-weight: 700;
    color: #6b7f8a;
    text-align: center;
}
.btn-remove-pair {
    width: 28px;
    height: 28px;
    background: #fce8e6;
    border: none;
    border-radius: 6px;
    color: #c0392b;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
    padding: 0;
}
.btn-remove-pair:hover { background: #f5c0c0; }

/* ── Question type pills (table) ───────────────────────────────── */
.qtype-pill {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    display: inline-block;
    white-space: nowrap;
}
.qtype-mcq        { background: #e8f0fe; color: #1967d2; }

/* ═══════════════════════════════════════════════════════════════
   User Features — Test Taking, Results, Test List
   ═══════════════════════════════════════════════════════════════ */

/* ── Test tabs ──────────────────────────────────────────────── */
.content-tabs .nav-link {
    color: #546e7a;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0;
    border-bottom: 2px solid transparent;
}
.content-tabs .nav-link.active {
    color: #1e5f74;
    border-bottom: 2px solid #1e5f74;
    background: none;
}
.content-tabs .nav-link:hover { color: #1e5f74; }

/* ── Timer display ──────────────────────────────────────────── */
.test-timer {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 700;
    font-size: 1.5rem;
    padding: 0.5rem 1.2rem;
    border-radius: 10px;
    letter-spacing: 0.06em;
    border: 2px solid #a5d6a7;
    box-shadow: 0 2px 6px rgba(46,125,50,0.12);
    min-width: 110px;
    justify-content: center;
}
.test-timer.timer-urgent {
    background: #ffebee;
    color: #c62828;
    border-color: #ef9a9a;
    box-shadow: 0 2px 8px rgba(198,40,40,0.2);
    animation: pulse-timer 0.8s ease-in-out infinite;
}
.test-timer.timer-urgent::before {
    content: '⚠';
    font-size: 1.1rem;
    animation: blink-icon 0.8s step-start infinite;
}
@keyframes pulse-timer {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%       { transform: scale(1.05); opacity: 0.75; }
}
@keyframes blink-icon {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ── Progress label ─────────────────────────────────────────── */
.test-progress-label {
    font-size: 0.85rem;
    color: #546e7a;
    font-weight: 500;
}

/* ── Question navigation grid ───────────────────────────────── */
.question-nav-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.q-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1.5px solid #cfd8dc;
    background: #f5f7f8;
    color: #37474f;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.q-nav-btn:hover  { background: #e0f2f1; border-color: #1e5f74; color: #1e5f74; }
.q-nav-btn.active { background: #1e5f74; border-color: #1e5f74; color: #fff; }
.q-nav-btn.answered { background: #e8f5e9; border-color: #43a047; color: #2e7d32; }
.q-nav-btn.answered.active { background: #43a047; border-color: #43a047; color: #fff; }

/* ── Question text ──────────────────────────────────────────── */
.question-text {
    font-size: 1.05rem;
    color: #263238;
    line-height: 1.6;
}

/* ── MCQ option cards ───────────────────────────────────────── */
.mcq-option {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border: 1.5px solid #dde3e8;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.6rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    user-select: none;
    background: #fff;
}
.mcq-option:hover {
    border-color: #90cad8;
    background: #f5fbfd;
    box-shadow: 0 1px 4px rgba(30,95,116,0.08);
}
.mcq-option.mcq-selected {
    border-color: #1e5f74;
    background: #e6f4f8;
    box-shadow: 0 0 0 3px rgba(30,95,116,0.12);
}
.mcq-option input[type="radio"] { display: none; }
.mcq-option-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #b0bec5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #546e7a;
    flex-shrink: 0;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    background: #fff;
}
.mcq-option:hover .mcq-option-letter {
    border-color: #1e5f74;
    color: #1e5f74;
}
.mcq-option.mcq-selected .mcq-option-letter {
    background: #1e5f74;
    border-color: #1e5f74;
    color: #fff;
}
.mcq-option-text {
    font-size: 0.97rem;
    color: #263238;
    line-height: 1.5;
    flex: 1;
}
.mcq-option.mcq-selected .mcq-option-text {
    color: #1e5f74;
    font-weight: 500;
}

/* ── Fill blank input ───────────────────────────────────────── */
.fill-blank-input { max-width: 480px; }

/* ── Match the following — reference table ──────────────────── */
.match-ref-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}
.match-ref-table thead tr { background: #e8edf1; }
.match-ref-table th {
    padding: 0.5rem 1rem;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #37474f;
    border-bottom: 2px solid #cfd8dc;
}
.match-ref-col1 { width: 50%; border-right: 1px solid #dee2e6; }
.match-ref-col2 { width: 50%; }
.match-ref-left {
    padding: 0.45rem 1rem;
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #f0f0f0;
    color: #1e5f74;
    font-weight: 500;
}
.match-ref-right {
    padding: 0.45rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    color: #37474f;
}
.match-ref-table tbody tr:last-child .match-ref-left,
.match-ref-table tbody tr:last-child .match-ref-right { border-bottom: none; }

/* ── Match the following — option rows ──────────────────────── */
.match-opts-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.2rem 1rem 0.4rem;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 0.5rem;
}
.match-opts-label-spacer { width: 32px; flex-shrink: 0; }
.match-opts-col-hdr {
    flex: 1;
    font-size: 0.75rem;
    font-weight: 700;
    color: #546e7a;
    text-align: center;
    min-width: 36px;
    letter-spacing: 0.04em;
}
.match-radio-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1.5px solid #dde3e8;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    user-select: none;
    background: #fff;
}
.match-radio-row:hover {
    border-color: #90cad8;
    background: #f5fbfd;
    box-shadow: 0 1px 4px rgba(30,95,116,0.08);
}
.match-radio-row.match-opt-selected {
    border-color: #1e5f74;
    background: #e6f4f8;
    box-shadow: 0 0 0 3px rgba(30,95,116,0.12);
}
.match-radio-row input[type="radio"] { display: none; }
.match-opts-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #b0bec5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #546e7a;
    flex-shrink: 0;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    background: #fff;
}
.match-radio-row:hover .match-opts-letter {
    border-color: #1e5f74;
    color: #1e5f74;
}
.match-radio-row.match-opt-selected .match-opts-letter {
    background: #1e5f74;
    border-color: #1e5f74;
    color: #fff;
}
.match-opts-cols {
    display: flex;
    flex: 1;
}
.match-opts-num {
    flex: 1;
    text-align: center;
    font-size: 0.92rem;
    color: #37474f;
    min-width: 36px;
    font-weight: 500;
}
.match-radio-row.match-opt-selected .match-opts-num {
    color: #1e5f74;
    font-weight: 600;
}

/* ── Result summary cards ───────────────────────────────────── */
.badge-wrong { background: #ffebee; color: #c62828; }
.badge-green     { background: #e8f5e9; color: #2e7d32; }
.badge-orange    { background: #ff890521; color: #FFAC1C; }
.badge-blue      { background: #e3f2fd; color: #1565c0; }
.badge-secondary { background: #f0f0f0; color: #666; }

/* ── Answer review cards ────────────────────────────────────── */
.answer-review-card {
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}
.answer-review-card.answer-correct { border-left: 4px solid #43a047; }
.answer-review-card.answer-wrong   { border-left: 4px solid #e53935; }
.answer-review-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #f8fafb;
    border-bottom: 1px solid #e0e0e0;
}
.answer-q-num {
    font-size: 0.75rem;
    font-weight: 700;
    color: #546e7a;
    background: #eceff1;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}
.answer-q-type {
    font-size: 0.75rem;
    color: #78909c;
}
.answer-q-text {
    padding: 0.75rem 1rem 0.4rem;
    font-size: 0.95rem;
    color: #263238;
    font-weight: 500;
}
.answer-details { padding: 0.4rem 1rem 0.8rem; }
.result-answer-row {
    font-size: 0.875rem;
    color: #546e7a;
    margin-bottom: 0.25rem;
}
.result-label {
    font-weight: 600;
    color: #37474f;
    margin-right: 0.3rem;
}
.result-correct-row {
    color: #2e7d32;
    font-weight: 500;
}
.result-correct-row .result-label { color: #1b5e20; }

/* ── Match result display ───────────────────────────────────── */
.match-result-table { display: flex; flex-direction: column; gap: 0.4rem; }
.match-result-header {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #cfd8dc;
    padding-bottom: 0.25rem;
    margin-bottom: 0.15rem;
}
.match-result-col-header {
    font-size: 0.78rem;
    font-weight: 700;
    color: #546e7a;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.match-result-option-row {
    display: flex;
    gap: 0;
    border-radius: 6px;
    padding: 0.25rem 0.4rem;
}
.match-result-user    { background: #fff8e1; }
.match-result-correct { background: #e8f5e9; }
.match-result-col {
    flex: 1;
    font-size: 0.875rem;
    color: #37474f;
    padding: 0.1rem 0.2rem;
}

/* ── Result review pagination ───────────────────────────────── */
.result-pagination { border-top: 1px solid #eceff1; padding-top: 0.75rem; }
.qtype-fill_blank { background: #e6f4ea; color: #1e8e3e; }
.qtype-match      { background: #fef3e2; color: #e37400; }

/* ── Match answer-set rows ──────────────────────────────────────── */
.match-option-col-headers {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.3rem;
    padding: 0 0.1rem;
}
.match-opt-set-label {
    width: 32px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #9aabb5;
    flex-shrink: 0;
    text-align: center;
}
.match-opt-col-hdr { 
    width: 50px;
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.05em;
    text-align: center;
}
.match-option-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
}
.match-option-row .match-opt-set-label {
    font-size: 0.8rem;
    font-weight: normal;
    color: #1e5f74;
}

.match-option-row input[type=number]::-webkit-inner-spin-button, 
.match-option-row input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin: 0; 
}

.match-option-row .match-opt-val {
    /* flex: 1; */
    width: 50px;
    text-align: center;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}
.match-opt-radio-wrap {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
    padding: 0 0.25rem;
}
.match-opt-radio {
    width: 16px;
    height: 16px;
    accent-color: #1e5f74;
    cursor: pointer;
    flex-shrink: 0;
}
.match-opt-radio-label {
    font-size: 0.78rem;
    color: #6b7f8a;
    white-space: nowrap;
}

/* ── User assignment status pills ──────────────────────────────── */
.status-pending     { background: #fef3e2; color: #e37400; }
.status-in-progress { background: #e0f4f8; color: #1e5f74; }
/* ── Add Existing Questions modal ──────────────────────────────── */
#aeResultsWrap {
    max-height: 380px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}
.ae-group-header { border-bottom: 1px solid #eee; }
.ae-question-row { border-bottom: 1px solid #f0f0f0; }
