:root {
    --app-bg: #f5f7fb;
    --app-border: #d9e1ec;
    --app-text: #162033;
}

body {
    min-height: 100vh;
    background: var(--app-bg);
    color: var(--app-text);
}

.app-shell,
.auth-card {
    max-width: 760px;
    padding: 32px;
    background: #ffffff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(22, 32, 51, 0.08);
}

.auth-page {
    display: flex;
    align-items: center;
}

.auth-card {
    max-width: 480px;
}

.form-control,
.form-select,
.btn {
    min-height: 44px;
}

.stat-card,
.empty-state,
.table-panel {
    background: #ffffff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 24px;
}

.stat-card span {
    display: block;
    color: #667085;
    font-size: 0.92rem;
    margin-bottom: 8px;
}

.stat-card strong {
    display: block;
    font-size: 2rem;
    line-height: 1;
}

.empty-state {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.table-panel {
    padding: 0;
    overflow: hidden;
}

.table-panel .table > :not(caption) > * > * {
    padding: 16px;
}

.table-panel thead th {
    color: #667085;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    background: #f8fafc;
}

.empty-table {
    padding: 48px 24px;
    text-align: center;
    border-top: 1px solid var(--app-border);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.status-draft {
    color: #344054;
    background: #eef2f6;
}

.status-published {
    color: #05603a;
    background: #d1fadf;
}

.status-active {
    color: #05603a;
    background: #d1fadf;
}

.status-inactive {
    color: #344054;
    background: #eef2f6;
}

.status-archived {
    color: #854a0e;
    background: #fef0c7;
}

.status-in_progress {
    color: #175cd3;
    background: #d1e9ff;
}

.status-submitted {
    color: #05603a;
    background: #d1fadf;
}

.status-expired,
.status-abandoned {
    color: #b42318;
    background: #fee4e2;
}

.status-success {
    color: #05603a;
    background: #d1fadf;
}

.status-failed {
    color: #b42318;
    background: #fee4e2;
}

.status-log {
    color: #175cd3;
    background: #d1e9ff;
}

.filter-panel {
    background: #ffffff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 20px;
}

.section-heading {
    padding: 16px;
    border-bottom: 1px solid var(--app-border);
    background: #ffffff;
}

.bulk-upload-panel {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid var(--app-border);
    border-radius: 8px;
}

.question-preview {
    max-width: 680px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.quiz-card,
.question-card,
.quiz-header,
.submit-bar {
    background: #ffffff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 24px;
}

.quiz-card {
    display: flex;
    min-height: 250px;
    flex-direction: column;
    justify-content: space-between;
}

.quiz-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quiz-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    background: #f8fafc;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    color: #475467;
    font-size: 0.86rem;
    font-weight: 600;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.quiz-timer {
    display: inline-flex;
    align-items: center;
    min-width: 82px;
    justify-content: center;
    min-height: 38px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #05603a;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.quiz-timer.is-danger {
    background: #fee4e2;
    color: #b42318;
}

.quiz-question-list {
    display: grid;
    gap: 16px;
}

.question-card h2 {
    line-height: 1.45;
}

.answer-options {
    display: grid;
    gap: 10px;
}

.answer-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
}

.answer-option input {
    margin-top: 5px;
}

.answer-option:hover {
    border-color: #84adff;
    background: #f5f8ff;
}

.answer-option.is-correct-option {
    border-color: #12b76a;
    background: #ecfdf3;
}

.answer-option.is-selected-wrong {
    border-color: #f04438;
    background: #fff1f3;
}

.ai-loading {
    min-height: 48px;
    display: flex;
    align-items: center;
    color: #475467;
}

.result-card.is-correct {
    border-left: 4px solid #12b76a;
}

.result-card.is-wrong {
    border-left: 4px solid #f04438;
}

.submit-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    box-shadow: 0 -10px 30px rgba(22, 32, 51, 0.08);
}

@media (max-width: 576px) {
    .app-shell,
    .auth-card {
        padding: 24px;
    }

    .table-panel .btn-group {
        display: grid;
        gap: 6px;
    }

    .quiz-header,
    .submit-bar,
    .bulk-upload-panel {
        flex-direction: column;
        align-items: stretch;
    }
}
