* {
    box-sizing: border-box;
}

body {
    background: #f4f7fb;
    color: #182230;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
    margin: 0;
}

a {
    color: #155eef;
    text-decoration: none;
}

.topbar {
    align-items: center;
    background: #101828;
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: space-between;
    padding: 14px 24px;
}

.brand,
.topbar a {
    color: #fff;
    font-weight: 700;
}

.brand {
    align-items: center;
    display: inline-flex;
    gap: 10px;
}

.brand img {
    background: #fff;
    border-radius: 50%;
    height: 38px;
    object-fit: contain;
    padding: 4px;
    width: 38px;
}

.topbar nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.topbar nav span {
    color: #d0d5dd;
    font-weight: 700;
}

.container {
    margin: 0 auto;
    max-width: 1180px;
    padding: 24px;
}

.guest-shell .container {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 92px);
}

.guest-shell .container > .panel {
    margin-left: auto;
    margin-right: auto;
    max-width: 430px;
    width: 100%;
}

.guest-shell .container > .panel.wide-panel {
    max-width: 760px;
}

.app-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: calc(100vh - 70px);
}

.app-content {
    margin: 0;
    max-width: none;
}

.sidebar {
    background: #fff;
    border-right: 1px solid #d7deea;
    padding: 16px;
}

.sidebar-profile {
    border-bottom: 1px solid #d7deea;
    display: grid;
    gap: 6px;
    justify-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    text-align: center;
}

.sidebar-profile img {
    height: 74px;
    object-fit: contain;
    width: 74px;
}

.sidebar-profile span {
    color: #667085;
    font-size: 13px;
    font-weight: 700;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.sidebar-nav a {
    background: #f8fafc;
    border: 1px solid #e4e7ec;
    border-radius: 6px;
    color: #344054;
    font-weight: 800;
    padding: 10px 12px;
}

.sidebar-nav a:hover {
    background: #eef4ff;
    border-color: #b2ccff;
    color: #1849a9;
}

.panel,
.stat,
.card {
    background: #fff;
    border: 1px solid #d7deea;
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 18px;
}

.login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.login-logo {
    display: block;
    height: 96px;
    max-width: 120px;
    object-fit: contain;
    width: 100%;
}

.hero {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat strong {
    display: block;
    font-size: 28px;
}

.muted {
    color: #667085;
}

label {
    display: block;
    font-weight: 700;
    margin: 10px 0 6px;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    border: 1px solid #b8c2d1;
    border-radius: 6px;
    padding: 10px;
    width: 100%;
}

textarea {
    min-height: 110px;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
}

button,
.button {
    background: #155eef;
    border: 0;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-block;
    padding: 10px 14px;
}

.button.secondary,
button.secondary {
    background: #475467;
}

.button.danger,
button.danger {
    background: #b42318;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.actions.compact {
    gap: 6px;
    margin-top: 0;
}

.actions.compact .button,
.actions.compact button {
    padding: 7px 9px;
}

.form-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.full {
    grid-column: 1 / -1;
}

.responsive-table {
    overflow-x: auto;
}

.table-search-row {
    margin-bottom: 12px;
}

.filter-strip {
    background: #f8fafc;
    border: 1px solid #d7deea;
    border-radius: 8px;
    margin: 12px 0;
    padding: 12px;
}

.filter-strip > strong {
    display: block;
    margin-bottom: 8px;
}

.system-check {
    background: #f8fafc;
    border: 1px solid #d7deea;
    border-radius: 8px;
    margin: 14px 0;
    padding: 14px;
}

.system-check[data-passed="1"] {
    background: #ecfdf3;
    border-color: #abefc6;
}

.system-check[data-failed="1"] {
    background: #fef3f2;
    border-color: #fecdca;
}

.system-check h3 {
    margin: 0 0 10px;
}

.system-check-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.system-check-grid div {
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 6px;
    padding: 10px;
}

.system-check-grid strong,
.system-check-grid span {
    display: block;
}

.system-check-grid span {
    color: #475467;
}

.access-modal {
    align-items: center;
    background: rgba(16, 24, 40, 0.72);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: fixed;
    z-index: 1200;
}

.access-modal[hidden] {
    display: none;
}

.access-modal-card {
    background: #fff;
    border-radius: 8px;
    max-width: 430px;
    padding: 18px;
    position: relative;
    width: min(100%, 430px);
}

.access-modal-close {
    align-items: center;
    background: #f2f4f7;
    border-radius: 50%;
    color: #344054;
    display: inline-flex;
    font-size: 22px;
    height: 34px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 12px;
    top: 12px;
    width: 34px;
}

.settings-logo-preview {
    background: #fff;
    border: 1px solid #d7deea;
    border-radius: 6px;
    display: block;
    height: 80px;
    margin-top: 10px;
    max-width: 180px;
    object-fit: contain;
    padding: 8px;
}

.settings-favicon-preview {
    background: #fff;
    border: 1px solid #d7deea;
    border-radius: 6px;
    display: block;
    height: 42px;
    margin-top: 10px;
    object-fit: contain;
    padding: 6px;
    width: 42px;
}

table {
    background: #fff;
    border-collapse: collapse;
    width: 100%;
}

td,
th {
    border-bottom: 1px solid #d7deea;
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f1f5f9;
}

.alert {
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 12px 14px;
}

.alert.success {
    background: #ecfdf3;
    border: 1px solid #abefc6;
    color: #067647;
}

.alert.error {
    background: #fef3f2;
    border: 1px solid #fecdca;
    color: #b42318;
}

.badge {
    background: #eef4ff;
    border: 1px solid #b2ccff;
    border-radius: 999px;
    color: #1849a9;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 9px;
}

.cbt-question {
    border: 1px solid #d7deea;
    border-radius: 8px;
    margin: 16px 0;
    padding: 14px;
}

.cbt-question label {
    align-items: flex-start;
    display: flex;
    gap: 8px;
}

.cbt-question[hidden] {
    display: none;
}

.cbt-question-image {
    border: 1px solid #d7deea;
    border-radius: 6px;
    display: block;
    height: auto;
    margin: 12px 0;
    max-height: 520px;
    max-width: 100%;
    object-fit: contain;
}

.cbt-question-nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
}

.cbt-question-progress {
    color: #475467;
    font-weight: 700;
}

.cbt-lock-overlay {
    align-items: center;
    background: rgba(16, 24, 40, 0.96);
    color: #fff;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 24px;
    position: fixed;
    z-index: 1000;
}

.cbt-lock-card {
    max-width: 540px;
    text-align: center;
}

.cbt-lock-card h2 {
    color: #fff;
    margin-top: 0;
}

.cbt-lock-card p {
    color: #d0d5dd;
}

.cbt-lock-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.cbt-lock-actions button {
    min-width: 140px;
}

.question-bank-image {
    border: 1px solid #d7deea;
    border-radius: 6px;
    display: block;
    height: auto;
    margin-top: 10px;
    max-height: 260px;
    max-width: 360px;
    object-fit: contain;
    width: auto;
}

.exam-bar {
    align-items: center;
    background: #101828;
    border-radius: 8px;
    color: #fff;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 14px 18px;
    position: sticky;
    top: 0;
}

.timer {
    background: #fff;
    border-radius: 6px;
    color: #101828;
    padding: 8px 12px;
    white-space: nowrap;
}

.site-footer {
    color: #667085;
    font-size: 13px;
    padding: 0 24px 24px;
    text-align: center;
}

@media (max-width: 680px) {
    .hero,
    .exam-bar {
        align-items: stretch;
        display: grid;
    }

    .container {
        padding: 14px;
    }

    .topbar {
        padding: 12px 14px;
    }

    .topbar nav {
        width: 100%;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        border-bottom: 1px solid #d7deea;
        border-right: 0;
    }

    .sidebar-profile {
        align-items: center;
        display: flex;
        justify-content: flex-start;
        text-align: left;
    }

    .sidebar-profile img {
        height: 48px;
        width: 48px;
    }

    .sidebar-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .guest-shell .container {
        min-height: calc(100vh - 120px);
    }
}
