* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --background: #f5f7fb;
    --white: #ffffff;
    --danger: #dc2626;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
}


/* ==============================
   AUTH PAGE
============================== */

.auth-page {
    min-height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 30px 20px;
}


.auth-container {
    width: 100%;
    max-width: 460px;
}


/* ==============================
   BRAND
============================== */

.brand {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 28px;
}


.brand-icon {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--primary);
    color: white;

    border-radius: 12px;

    font-size: 22px;
    font-weight: bold;
}


.brand h1 {
    font-size: 22px;
    margin-bottom: 3px;
}


.brand p {
    font-size: 13px;
    color: var(--muted);
}


/* ==============================
   AUTH CARD
============================== */

.auth-card {
    background: var(--white);

    border: 1px solid var(--border);

    border-radius: 16px;

    padding: 32px;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.05);
}


.auth-heading {
    margin-bottom: 28px;
}


.auth-heading h2 {
    font-size: 26px;
    margin-bottom: 8px;
}


.auth-heading p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}


/* ==============================
   FORM
============================== */

.form-group {
    margin-bottom: 20px;
}


.form-group label {
    display: block;

    font-size: 14px;
    font-weight: 600;

    margin-bottom: 8px;
}


.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.label-row a {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
}


input {
    width: 100%;

    height: 48px;

    padding: 0 14px;

    border: 1px solid var(--border);

    border-radius: 9px;

    font-size: 14px;

    outline: none;

    transition: 0.2s;
}


input:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.1);
}


input::placeholder {
    color: #9ca3af;
}


/* ==============================
   BUTTON
============================== */

.primary-btn {
    width: 100%;

    height: 48px;

    border: none;

    border-radius: 9px;

    background: var(--primary);

    color: white;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    transition: 0.2s;
}


.primary-btn:hover {
    background: var(--primary-dark);
}


.primary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}


/* ==============================
   MESSAGE
============================== */

.message {
    display: none;

    margin-bottom: 16px;

    padding: 12px;

    border-radius: 8px;

    font-size: 13px;
}


.message.error {
    display: block;

    color: var(--danger);

    background: #fef2f2;

    border: 1px solid #fecaca;
}


.message.success {
    display: block;

    color: #166534;

    background: #f0fdf4;

    border: 1px solid #bbf7d0;
}


/* ==============================
   FOOTER
============================== */

.auth-footer {
    text-align: center;

    margin-top: 24px;
}


.auth-footer p {
    font-size: 14px;
    color: var(--muted);
}


.auth-footer a {
    color: var(--primary);

    font-weight: 600;

    text-decoration: none;
}


.auth-bottom {
    text-align: center;

    margin-top: 24px;
}


.auth-bottom p {
    color: #9ca3af;
    font-size: 12px;
}


/* ==============================
   MOBILE
============================== */

@media (max-width: 500px) {

    .auth-card {
        padding: 24px;
    }

    .auth-heading h2 {
        font-size: 23px;
    }

}


/* =========================================
   DASHBOARD
========================================= */

.dashboard-layout {
    min-height: 100vh;
    display: flex;
    background: #f5f7fb;
}


/* SIDEBAR */

.sidebar {
    width: 250px;
    min-height: 100vh;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
}

.sidebar-brand {
    height: 80px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 18px;
}

.sidebar-brand h2 {
    font-size: 17px;
    margin-bottom: 2px;
}

.sidebar-brand span {
    font-size: 11px;
    color: #9ca3af;
}

.sidebar-nav {
    padding: 24px 14px;
    flex: 1;
}

.nav-label {
    font-size: 10px;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.8px;
    padding: 0 12px;
    margin: 12px 0 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 44px;
    padding: 0 12px;
    margin-bottom: 5px;
    border-radius: 9px;
    text-decoration: none;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s;
}

.nav-item span {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-item:hover {
    background: #f3f4f6;
    color: #111827;
}

.nav-item.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

.sidebar-bottom {
    padding: 18px 14px;
    border-top: 1px solid #f0f0f0;
}

.logout-btn {
    width: 100%;
    height: 42px;
    border: none;
    background: transparent;
    color: #dc2626;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    padding: 0 12px;
    font-size: 14px;
}

.logout-btn:hover {
    background: #fef2f2;
}


/* MAIN */

.main-content {
    width: calc(100% - 250px);
    margin-left: 250px;
}


/* TOPBAR */

.topbar {
    height: 80px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.mobile-brand {
    display: none;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 24px;
}

.notification {
    width: 40px;
    height: 40px;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    background: #2563eb;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.profile-info strong {
    font-size: 13px;
}

.profile-info span {
    color: #9ca3af;
    font-size: 11px;
}


/* DASHBOARD CONTENT */

.dashboard-content {
    padding: 32px;
    max-width: 1600px;
    margin: 0 auto;
}

.welcome-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.welcome-small {
    color: #2563eb;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
}

.welcome-section h1 {
    font-size: 27px;
    margin-bottom: 6px;
}

.welcome-section p {
    color: #6b7280;
    font-size: 14px;
}

.primary-action {
    height: 44px;
    padding: 0 18px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.primary-action:hover {
    background: #1d4ed8;
}


/* STAT CARDS */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}

.students-icon {
    background: #eff6ff;
}

.assessment-icon {
    background: #f5f3ff;
}

.published-icon {
    background: #f0fdf4;
}

.result-icon {
    background: #fff7ed;
}

.stat-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-details span {
    color: #6b7280;
    font-size: 12px;
}

.stat-details strong {
    font-size: 23px;
}


/* LOWER GRID */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 24px;
}

.dashboard-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.card-header h2 {
    font-size: 16px;
    margin-bottom: 5px;
}

.card-header p {
    color: #9ca3af;
    font-size: 12px;
}

.card-header a {
    color: #2563eb;
    font-size: 12px;
    text-decoration: none;
}


/* ASSESSMENT TABLE */

.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 0.7fr;
    padding: 12px 20px;
    background: #fafafa;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 600;
}

.empty-state {
    padding: 55px 20px;
    text-align: center;
}

.empty-icon {
    width: 55px;
    height: 55px;
    margin: 0 auto 15px;
    border-radius: 12px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.empty-state h3 {
    font-size: 15px;
    margin-bottom: 7px;
}

.empty-state p {
    color: #9ca3af;
    font-size: 12px;
    margin-bottom: 18px;
}

.secondary-btn {
    height: 38px;
    padding: 0 15px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: white;
    color: #374151;
    font-size: 12px;
    cursor: pointer;
}


/* QUICK ACTIONS */

.quick-actions {
    padding: 8px 20px 20px;
}

.quick-action {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 0;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.quick-action:last-child {
    border-bottom: none;
}

.quick-action > span {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-action div {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.quick-action strong {
    font-size: 13px;
}

.quick-action small {
    color: #9ca3af;
    font-size: 11px;
}

.quick-action b {
    color: #9ca3af;
}


/* SYSTEM STATUS */

.system-status {
    margin-top: 24px;
    padding: 15px 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-indicator {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
}

.system-status strong {
    font-size: 12px;
}

.system-status p {
    margin-top: 3px;
    color: #9ca3af;
    font-size: 11px;
}


/* RESPONSIVE */

@media (max-width: 1100px) {

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 750px) {

    .sidebar {
        display: none;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .topbar {
        padding: 0 18px;
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
    }

    .mobile-brand .brand-icon {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }

    .profile-info {
        display: none;
    }

    .dashboard-content {
        padding: 22px 18px;
    }

    .welcome-section {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }

    .primary-action {
        width: 100%;
    }
}


@media (max-width: 500px) {

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        height: 68px;
    }

    .dashboard-content {
        padding: 20px 14px;
    }

    .welcome-section h1 {
        font-size: 23px;
    }

    .dashboard-grid {
        gap: 16px;
    }

    .table-header {
        display: none;
    }
}


/* =========================================
   RECENT ASSESSMENTS
========================================= */

.assessment-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 0.7fr;
    align-items: center;
    min-height: 68px;
    padding: 10px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.assessment-row:last-child {
    border-bottom: none;
}

.assessment-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.assessment-title strong {
    font-size: 13px;
}

.assessment-title small {
    color: #9ca3af;
    font-size: 11px;
}

.assessment-duration {
    color: #6b7280;
    font-size: 12px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
}

.status-published {
    color: #166534;
    background: #dcfce7;
}

.status-draft {
    color: #92400e;
    background: #fef3c7;
}

.status-closed {
    color: #991b1b;
    background: #fee2e2;
}

.view-test-btn {
    border: none;
    background: transparent;
    color: #2563eb;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.view-test-btn:hover {
    text-decoration: underline;
}


@media (max-width: 700px) {

    .assessment-row {
        grid-template-columns: 1fr auto;
        gap: 8px;
        padding: 14px 16px;
    }

    .assessment-row > div:nth-child(3) {
        display: none;
    }

    .assessment-row > div:nth-child(2) {
        justify-self: end;
    }

}


/* =========================================
   STUDENTS PAGE
========================================= */

.page-content {
    padding: 30px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.page-header h2 {
    margin: 0 0 6px;
    font-size: 24px;
}

.page-header p {
    margin: 0;
    color: #777;
}


/* =========================================
   STUDENTS TOOLBAR
========================================= */

.students-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.search-box {
    width: 100%;
    max-width: 520px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0 15px;
}

.search-box input {
    width: 100%;
    height: 48px;
    border: none;
    outline: none;
    font-size: 14px;
}

.student-count {
    color: #777;
    white-space: nowrap;
}

.student-count strong {
    color: #111827;
    margin-right: 5px;
}


/* =========================================
   STUDENTS CARD
========================================= */

.students-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.students-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.students-table th {
    text-align: left;
    padding: 16px 18px;
    background: #f8f9fa;
    color: #555;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
}

.students-table td {
    padding: 16px 18px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #555;
}

.students-table tbody tr:hover {
    background: #fafafa;
}

.student-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.student-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #eef5f0;
    color: #1f5f3b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.table-action {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 22px;
    color: #777;
}


/* =========================================
   EMPTY / LOADING STATES
========================================= */

.loading-state,
.error-state,
.empty-table-icon {
    text-align: center;
}

.loading-state,
.error-state {
    padding: 50px !important;
}

.empty-state-table {
    padding: 60px 20px !important;
    text-align: center;
}

.empty-table-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.empty-state-table h3 {
    margin: 0 0 5px;
}

.empty-state-table p {
    margin: 0;
    color: #888;
}


/* =========================================
   MODAL
========================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;

    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    padding: 25px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0 0 5px;
}

.modal-header p {
    margin: 0;
    color: #888;
    font-size: 14px;
}

.close-modal {
    border: none;
    background: transparent;
    font-size: 28px;
    cursor: pointer;
    color: #777;
}

#studentForm {
    padding: 25px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
}

.form-group input,
.form-group select {
    height: 46px;
    padding: 0 12px;

    border: 1px solid #ddd;
    border-radius: 8px;

    outline: none;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #1f5f3b;
}

.form-message {
    margin-top: 18px;
    font-size: 14px;
}

.form-message.success {
    color: #198754;
}

.form-message.error {
    color: #dc3545;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 25px;
    padding-top: 20px;

    border-top: 1px solid #eee;
}


/* =========================================
   BUTTONS
========================================= */

.primary-btn,
.secondary-btn {
    border: none;
    border-radius: 8px;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.primary-btn {
    background: #1f5f3b;
    color: #fff;
}

.primary-btn:hover {
    opacity: 0.92;
}

.secondary-btn {
    background: #f1f3f5;
    color: #444;
}


/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 768px) {

    .page-content {
        padding: 20px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .students-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .search-box {
        max-width: none;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

}




/* =========================================
   ASSESSMENTS
========================================= */

.assessment-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.assessment-toolbar select {
    height: 48px;
    padding: 0 14px;
    border: 1px solid #e1e5e9;
    border-radius: 9px;
    background: #fff;
    outline: none;
    font-size: 14px;
    color: #444;
}


/* =========================================
   ASSESSMENT GRID
========================================= */

.assessment-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fill,
        minmax(290px, 1fr)
    );
    gap: 20px;
}

.assessment-card {
    background: #fff;
    border: 1px solid #e8ebed;
    border-radius: 15px;
    padding: 22px;
    transition: 0.2s ease;
}

.assessment-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.06);
}

.assessment-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.assessment-status {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.assessment-status-draft {
    background: #f1f3f5;
    color: #666;
}

.assessment-status-published {
    background: #e7f6ec;
    color: #1f7a42;
}

.assessment-status-closed {
    background: #fdecec;
    color: #b42318;
}

.assessment-menu {
    border: none;
    background: transparent;
    font-size: 22px;
    color: #777;
    cursor: pointer;
}

.assessment-card h3 {
    margin: 18px 0 8px;
    font-size: 18px;
    color: #222;
}

.assessment-description {
    min-height: 42px;
    margin: 0;
    color: #777;
    font-size: 13px;
    line-height: 1.6;
}

.assessment-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 22px 0;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.assessment-meta div {
    font-size: 11px;
    color: #777;
}

.assessment-meta span {
    margin-right: 3px;
}

.assessment-meta strong {
    color: #333;
}

.assessment-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.assessment-card-footer small {
    color: #999;
    font-size: 11px;
}

.manage-assessment-btn {
    border: none;
    background: transparent;
    color: #1f5f3b;
    font-weight: 600;
    cursor: pointer;
}


/* =========================================
   EMPTY / ERROR
========================================= */

.assessment-empty,
.assessment-error,
.assessment-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 70px 20px;
    color: #777;
}

.empty-assessment-icon {
    font-size: 42px;
    margin-bottom: 12px;
}

.assessment-empty h3,
.assessment-error h3 {
    color: #333;
    margin-bottom: 5px;
}


/* =========================================
   TEXTAREA
========================================= */

.form-full {
    grid-column: 1 / -1;
}

.form-group textarea {
    min-height: 90px;
    padding: 12px;
    resize: vertical;

    border: 1px solid #ddd;
    border-radius: 8px;

    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.form-group textarea:focus {
    border-color: #1f5f3b;
}


/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 768px) {

    .assessment-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .assessment-toolbar .search-box {
        max-width: none;
    }

    .assessment-meta {
        grid-template-columns: 1fr;
        gap: 10px;
    }

}







/* =========================================
   QUESTION MANAGER
========================================= */

.question-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 25px;
}

.back-link {
    display: inline-block;
    margin-bottom: 12px;
    color: #1f5f3b;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.question-page-header h2 {
    margin: 0 0 7px;
    font-size: 25px;
}

.question-page-header p {
    margin: 0;
    color: #777;
}


/* =========================================
   TEST SUMMARY
========================================= */

.test-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.test-summary > div {
    background: #fff;
    border: 1px solid #e8ebed;
    border-radius: 12px;
    padding: 18px 20px;
}

.test-summary span {
    display: block;
    color: #888;
    font-size: 12px;
    margin-bottom: 7px;
}

.test-summary strong {
    font-size: 20px;
    color: #222;
}

.test-summary .test-status {
    font-size: 14px;
}

.test-draft {
    color: #777 !important;
}

.test-published {
    color: #1f7a42 !important;
}

.test-closed {
    color: #b42318 !important;
}


/* =========================================
   QUESTIONS
========================================= */

.questions-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.question-card {
    background: #fff;
    border: 1px solid #e7e9eb;
    border-radius: 14px;
    padding: 22px;
}

.question-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.question-number {
    color: #1f5f3b;
    font-weight: 700;
    font-size: 13px;
}

.question-card-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.question-mark {
    background: #f1f5f2;
    color: #1f5f3b;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.delete-question-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
}

.question-text {
    font-size: 16px;
    line-height: 1.6;
    font-weight: 600;
    color: #222;
    margin-bottom: 8px;
}

.question-type-label {
    color: #999;
    font-size: 11px;
    margin-bottom: 16px;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.question-option {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #e5e7e9;
    border-radius: 9px;
    padding: 11px 13px;
    font-size: 14px;
}

.question-option.correct-option {
    border-color: #a9d5b8;
    background: #f1faf4;
}

.option-letter {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #f2f3f4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.correct-option .option-letter {
    background: #1f5f3b;
    color: #fff;
}

.correct-label {
    margin-left: auto;
    font-size: 11px;
    color: #1f7a42;
    font-weight: 700;
}


/* =========================================
   EMPTY / LOADING
========================================= */

.question-empty,
.question-error,
.question-loading {
    background: #fff;
    border: 1px solid #e8ebed;
    border-radius: 14px;
    text-align: center;
    padding: 70px 20px;
}

.question-empty-icon {
    font-size: 45px;
    margin-bottom: 12px;
}

.question-empty h3 {
    margin-bottom: 5px;
}

.question-empty p {
    color: #888;
    margin-bottom: 20px;
}


/* =========================================
   QUESTION MODAL
========================================= */

.question-modal {
    max-width: 760px;
}

.question-form-row {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 18px;
    margin-top: 18px;
}

.options-section {
    margin-top: 25px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.options-header h3 {
    margin: 0 0 4px;
    font-size: 15px;
}

.options-header p {
    margin: 0;
    color: #888;
    font-size: 12px;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-input-row {
    display: grid;
    grid-template-columns: 22px 30px 1fr 30px;
    align-items: center;
    gap: 8px;
}

.option-input-row input[type="radio"] {
    width: 16px;
    height: 16px;
}

.option-input-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f1f3f4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.option-text-input {
    height: 42px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 7px;
    outline: none;
}

.option-text-input:focus {
    border-color: #1f5f3b;
}

.remove-option-btn {
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    font-size: 20px;
}

.remove-option-btn:hover {
    color: #c0392b;
}


/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 768px) {

    .question-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .test-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .question-form-row {
        grid-template-columns: 1fr;
    }

    .options-header {
        align-items: flex-start;
        flex-direction: column;
    }

}

@media (max-width: 480px) {

    .test-summary {
        grid-template-columns: 1fr;
    }

}








/* Assessment Actions */

.assessment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.secondary-primary-btn {
    background: #ffffff;
    color: #1f5f3b;
    border: 1px solid #1f5f3b;
    padding: 11px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.secondary-primary-btn:hover {
    background: #1f5f3b;
    color: #ffffff;
}

.danger-btn {
    background: #ffffff;
    color: #c0392b;
    border: 1px solid #c0392b;
    padding: 11px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.danger-btn:hover {
    background: #c0392b;
    color: #ffffff;
}

.assessment-actions .primary-btn {
    background: #1f5f3b;
    color: #ffffff;
    border: none;
    padding: 11px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.assessment-actions .primary-btn:hover {
    opacity: 0.9;
}








/* =========================
   ASSESSMENT ACTIONS
========================= */

.assessment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.assessment-actions .primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1f5f3b;
    color: #ffffff;
    border: none;
    padding: 11px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.assessment-actions .primary-btn:hover {
    opacity: 0.9;
}

.secondary-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #1f5f3b;
    border: 1px solid #1f5f3b;
    padding: 11px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.secondary-primary-btn:hover {
    background: #1f5f3b;
    color: #ffffff;
}

.danger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #c0392b;
    border: 1px solid #c0392b;
    padding: 11px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.danger-btn:hover {
    background: #c0392b;
    color: #ffffff;
}


.form-message {
    margin-top: 12px;
    font-size: 14px;
    min-height: 20px;
}

.success-message {
    color: #1f5f3b;
}

.error-message {
    color: #c0392b;
}

.auth-submit {
    width: 100%;
    margin-top: 10px;
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
}

.auth-footer p {
    color: #6b7280;
    font-size: 14px;
}

.auth-footer a {
    color: #1f5f3b;
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f7f6;
}

.auth-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    box-sizing: border-box;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 16px;
    padding: 36px;
    box-sizing: border-box;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 35px;
}

.auth-brand h1 {
    margin: 0;
    font-size: 22px;
    color: #1f5f3b;
}

.auth-brand p {
    margin: 3px 0 0;
    font-size: 13px;
    color: #6b7280;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1f5f3b;
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
}

.auth-heading {
    margin-bottom: 25px;
}

.auth-heading h2 {
    margin: 0 0 8px;
    font-size: 28px;
    color: #111827;
}

.auth-heading p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus {
    border-color: #1f5f3b;
    box-shadow: 0 0 0 3px rgba(31, 95, 59, 0.10);
}

.auth-submit {
    width: 100%;
    margin-top: 10px;
}

@media (max-width: 600px) {
    .auth-container {
        padding: 20px 15px;
    }

    .auth-card {
        padding: 28px 22px;
    }

    .auth-heading h2 {
        font-size: 24px;
    }
}







.student-welcome {
    margin-bottom: 25px;
    padding: 28px 30px;
    border-radius: 16px;
    background: #1f5f3b;
    color: #ffffff;
}

.student-welcome .welcome-label {
    margin: 0 0 6px;
    font-size: 13px;
    opacity: 0.85;
}

.student-welcome h2 {
    margin: 0 0 8px;
    font-size: 28px;
}

.student-welcome p {
    margin: 0;
    max-width: 650px;
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.9;
}

.student-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 30px;
}

.student-stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 22px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

.student-stat-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef6f1;
    border-radius: 12px;
    font-size: 21px;
}

.student-stat-card span:not(.student-stat-icon) {
    display: block;
    margin-bottom: 5px;
    color: #6b7280;
    font-size: 13px;
}

.student-stat-card strong {
    display: block;
    color: #111827;
    font-size: 24px;
}

.student-assessment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.student-assessment-card {
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.student-assessment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
}

.student-assessment-card h3 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 18px;
}

.student-assessment-card p {
    margin: 0 0 18px;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.assessment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.assessment-meta span {
    padding: 6px 10px;
    background: #f3f4f6;
    border-radius: 6px;
    color: #4b5563;
    font-size: 12px;
}

.start-test-btn {
    width: 100%;
    padding: 11px 16px;
    border: none;
    border-radius: 8px;
    background: #1f5f3b;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.start-test-btn:hover {
    opacity: 0.9;
}

.student-results-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
}

.student-empty-state {
    padding: 45px 20px;
    text-align: center;
}

.student-empty-state .empty-icon {
    margin-bottom: 12px;
    font-size: 35px;
}

.student-empty-state h3 {
    margin: 0 0 7px;
    color: #111827;
}

.student-empty-state p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

@media (max-width: 900px) {

    .student-stat-grid {
        grid-template-columns: 1fr;
    }

    .student-assessment-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {

    .student-welcome {
        padding: 22px;
    }

    .student-welcome h2 {
        font-size: 23px;
    }
}


/* ==========================================
   STUDENT DASHBOARD - COMPLETE LAYOUT FIX
   ========================================== */

.dashboard-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #f5f7f6;
    overflow-x: hidden;
}


/* ==========================================
   MAIN DASHBOARD WRAPPER
   ========================================== */

.dashboard-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
}


/* ==========================================
   STUDENT SIDEBAR
   ========================================== */

.dashboard-layout .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;

    width: 250px;
    height: 100vh;

    flex-shrink: 0;

    z-index: 1000;

    box-sizing: border-box;
}


/* ==========================================
   MAIN CONTENT
   ========================================== */

.dashboard-layout .dashboard-main {
    width: calc(100% - 250px);
    min-width: 0;

    margin-left: 250px;

    min-height: 100vh;

    padding: 30px 35px;

    box-sizing: border-box;
}


/* ==========================================
   TOP BAR
   ========================================== */

.dashboard-layout .dashboard-topbar {
    width: 100%;
    margin-bottom: 28px;
}


/* ==========================================
   WELCOME SECTION
   ========================================== */

.student-welcome {
    width: 100%;
    box-sizing: border-box;
}


/* ==========================================
   STATISTICS
   ========================================== */

.student-stat-grid {
    width: 100%;
    box-sizing: border-box;
}


/* ==========================================
   ASSESSMENTS
   ========================================== */

.student-assessment-grid {
    width: 100%;
    box-sizing: border-box;
}


/* ==========================================
   RESULTS
   ========================================== */

.student-results-container {
    width: 100%;
    box-sizing: border-box;
}


/* ==========================================
   TABLET
   ========================================== */

@media (max-width: 900px) {

    .dashboard-layout .sidebar {
        width: 220px;
    }

    .dashboard-layout .dashboard-main {
        width: calc(100% - 220px);
        margin-left: 220px;
        padding: 25px;
    }
}


/* ==========================================
   MOBILE
   ========================================== */

@media (max-width: 700px) {

    .dashboard-layout {
        display: block;
    }

    .dashboard-layout .sidebar {
        position: relative;

        width: 100%;
        height: auto;
        min-height: auto;

        left: auto;
        top: auto;
        bottom: auto;
    }

    .dashboard-layout .dashboard-main {
        width: 100%;
        margin-left: 0;

        padding: 20px 15px;
    }
}











/* Fix the facilitator login layout */
.auth-page > .auth-container {
    display: block;
    width: 100%;
    max-width: 460px;
    min-height: auto;
    padding: 0;
}

.auth-page .auth-card {
    width: 100%;
    max-width: none;
}

.auth-page .brand {
    justify-content: center;
}

.auth-page .brand-icon {
    flex-shrink: 0;
}

.auth-page .label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.auth-page .auth-bottom {
    margin-top: 24px;
    text-align: center;
}










/* Registration submit button */
#registerButton {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    background: #1f5f3b;
    color: #ffffff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#registerButton:hover {
    background: #17482d;
}

#registerButton:focus-visible {
    outline: 3px solid #86b99b;
    outline-offset: 3px;
}

#registerButton:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}






/* Mobile sidebar navigation */
.mobile-menu-toggle,
.mobile-menu-backdrop {
    display: none;
}

@media (max-width: 750px) {
    .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 16px;
        left: 12px;
        z-index: 1202;
        min-height: 44px;
        padding: 10px 14px;
        border: 0;
        border-radius: 8px;
        background: #1f5f3b;
        color: white;
        font: inherit;
        font-weight: 600;
        cursor: pointer;
    }

    /* Reserve room for the menu button */
    .dashboard-layout .topbar {
        padding-left: 112px;
    }

    .dashboard-layout .sidebar {
        display: flex;
        position: fixed;
        inset: 0 auto 0 0;
        width: min(280px, 85vw);
        height: 100dvh;
        min-height: 0;
        padding-top: 76px;
        box-sizing: border-box;
        overflow-y: auto;
        z-index: 1201;
        visibility: hidden;
        transform: translateX(-100%);
    }

    body.mobile-menu-open .sidebar {
        visibility: visible;
        transform: translateX(0);
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    body.mobile-menu-open .mobile-menu-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1200;
        background: rgba(0, 0, 0, 0.45);
    }
}







/* Give mobile page headings enough room */
@media (max-width: 750px) {
    .dashboard-layout .topbar {
        height: auto;
        min-height: 80px;
        padding: 80px 20px 24px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 18px;
    }

    .dashboard-layout .topbar > div {
        min-width: 0;
        max-width: 100%;
    }

    .dashboard-layout .topbar h1 {
        margin: 0 0 8px;
        font-size: 26px;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .dashboard-layout .topbar p {
        margin: 0;
        font-size: 14px;
        line-height: 1.6;
    }

    .dashboard-layout .profile-area {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .dashboard-layout .profile-area small {
        display: block;
        margin-top: 4px;
    }

    .dashboard-layout .page-content {
        padding: 24px 20px;
    }

    .dashboard-layout .page-header h2 {
        line-height: 1.3;
    }

    .dashboard-layout .page-header p {
        line-height: 1.6;
    }
}
