:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #172033;
    background: #eef4f8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(14, 165, 163, 0.12), transparent 34%),
        linear-gradient(160deg, #eef6fb 0%, #f8fafc 52%, #eef7f0 100%);
}

a {
    color: #2358d8;
    font-weight: 700;
}

.app-shell {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0;
}

.hero-card,
.card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(204, 216, 229, 0.95);
    border-radius: 18px;
    box-shadow: 0 18px 46px rgba(23, 32, 51, 0.1);
    backdrop-filter: blur(10px);
}

.hero-card {
    padding: 40px;
    margin: 8vh auto;
}

.narrow-card {
    max-width: 560px;
}

.eyebrow,
.label {
    margin: 0 0 8px;
    color: #59708f;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    font-size: clamp(32px, 6vw, 58px);
    line-height: 0.96;
}

h2 {
    font-size: clamp(22px, 3vw, 34px);
}

.muted {
    color: #64748b;
    line-height: 1.7;
}

.stack-form {
    display: grid;
    gap: 12px;
    margin-top: 28px;
}

label {
    font-weight: 800;
}

input,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    padding: 16px 18px;
    font-size: 16px;
    outline: none;
}

textarea {
    min-height: 160px;
    resize: vertical;
    line-height: 1.5;
}

input:focus,
textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

button {
    border: 0;
    cursor: pointer;
    font-weight: 900;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.primary-button,
.secondary-button,
.danger-button {
    border-radius: 12px;
    padding: 14px 20px;
}

.primary-button {
    color: white;
    background: linear-gradient(135deg, #2563eb, #0f3ea8);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
}

.secondary-button {
    color: #1e3a8a;
    background: #dbeafe;
}

.danger-button {
    color: #991b1b;
    background: #fee2e2;
}

.footer-note {
    margin-top: 22px;
    color: #64748b;
}

.alert,
.answer-message {
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 18px;
    font-weight: 800;
}

.error {
    color: #991b1b;
    background: #fee2e2;
}

.success {
    color: #166534;
    background: #dcfce7;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
}

.dashboard-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 26px;
    color: white;
    background: linear-gradient(135deg, #15324a 0%, #2563eb 58%, #0f766e 100%);
    border-radius: 20px;
    box-shadow: 0 22px 48px rgba(21, 50, 74, 0.22);
}

.dashboard-header .eyebrow,
.dashboard-header .muted,
.dashboard-header a {
    color: rgba(255, 255, 255, 0.82);
}

.dashboard-header a {
    text-decoration-color: rgba(255, 255, 255, 0.42);
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.card {
    padding: 24px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
    border-color: rgba(37, 99, 235, 0.25);
    box-shadow: 0 24px 58px rgba(23, 32, 51, 0.13);
    transform: translateY(-1px);
}

.status-card {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.status-card > div {
    padding: 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fafc, #eef6ff);
    border: 1px solid #dbe7f4;
}

.section-title-row,
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.form-row > div {
    flex: 1;
}

.check-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid #dce6f2;
    border-radius: 12px;
    background: #f8fafc;
    white-space: nowrap;
}

.check-row input {
    width: auto;
}

.import-form {
    margin-top: 22px;
}

.import-sample {
    margin: 0;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 8px 14px;
    color: #1e3a8a;
    background: #dbeafe;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.big-number {
    display: block;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1;
}

.question-card,
.top-three-card,
.participants-card,
.overall-card {
    min-height: 250px;
}

.question-card {
    border-top: 4px solid #2563eb;
}

.top-three-card {
    border-top: 4px solid #d97706;
}

.participants-card {
    border-top: 4px solid #0f766e;
}

.overall-card {
    border-top: 4px solid #7c3aed;
}

.option-list,
.answer-grid {
    display: grid;
    gap: 10px;
    margin-top: 22px;
}

.option-row,
.answer-button {
    border-radius: 14px;
    padding: 16px 18px;
    background: #f8fafc;
    border: 1px solid #dce6f2;
    text-align: left;
    font-size: 16px;
}

.answer-button.selected {
    border-color: #2563eb;
    background: #dbeafe;
}

.podium {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    align-items: end;
    gap: 12px;
    margin-top: 22px;
}

.podium-box {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    border-radius: 16px;
    padding: 18px;
    background: #f8fafc;
    border: 1px solid #dce6f2;
}

.podium-box.first {
    min-height: 205px;
    color: #78350f;
    background: linear-gradient(135deg, #fde68a, #fef3c7);
    transform: translateY(-10px);
}

.podium-box.second {
    color: #334155;
    background: linear-gradient(135deg, #e2e8f0, #f8fafc);
}

.podium-box.third {
    color: #7c2d12;
    background: linear-gradient(135deg, #fed7aa, #ffedd5);
}

.podium-box span {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.podium-box strong {
    font-size: 22px;
}

.podium-box small {
    color: inherit;
    opacity: 0.78;
    font-weight: 800;
}

.flash {
    animation: pop 0.45s ease;
}

@keyframes pop {
    0% { transform: scale(0.95); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

.participant-list,
.overall-list {
    list-style: none;
    padding: 0;
    margin: 18px 0 0;
    display: grid;
    gap: 10px;
}

.participant-item,
.overall-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.participant-index {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: #2563eb;
    font-weight: 900;
}

.empty-state {
    color: #64748b;
}

.player-wrap {
    display: grid;
    gap: 18px;
    max-width: 900px;
    margin: 0 auto;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.question-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

#playerTimer {
    font-size: 30px;
    font-weight: 950;
    color: #1e3a8a;
}

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

.answer-button {
    min-height: 78px;
}

.create-icon-button,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    font-size: 28px;
    line-height: 1;
}

.create-icon-button {
    z-index: 30;
    color: white;
    flex: 0 0 auto;
    background: linear-gradient(135deg, #f59e0b, #14b8a6);
    box-shadow: 0 16px 32px rgba(17, 24, 39, 0.24);
}

.icon-button {
    color: #475569;
    background: #eef2f7;
}

.floating-alert {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 35;
    max-width: min(360px, calc(100% - 92px));
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 18px 42px rgba(23, 32, 51, 0.16);
    font-weight: 900;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 72px 18px 28px;
    background: rgba(15, 23, 42, 0.48);
}

.modal-backdrop.is-open {
    display: flex;
}

.modal-panel {
    width: min(760px, 100%);
    max-height: calc(100vh - 100px);
    overflow: auto;
    border-radius: 18px;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #d8e2ee;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
}

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

.login-shell {
    min-height: calc(100vh - 56px);
    display: grid;
    place-items: center;
}

.admin-login-card {
    margin: 0 auto;
}

.premium-dashboard {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.premium-sidebar {
    position: sticky;
    top: 20px;
    min-height: calc(100vh - 56px);
    border-radius: 20px;
    padding: 20px;
    color: #f8fafc;
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.18), transparent 38%),
        linear-gradient(165deg, #101828 0%, #152238 54%, #0f3f3c 100%);
    box-shadow: 0 24px 70px rgba(16, 24, 40, 0.28);
}

.premium-sidebar .eyebrow {
    color: rgba(255, 255, 255, 0.68);
}

.sidebar-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.test-list {
    display: grid;
    gap: 12px;
}

.test-item {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.test-item.is-selected {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.36);
}

.test-link {
    display: grid;
    gap: 5px;
    color: white;
    text-decoration: none;
}

.test-link small {
    color: rgba(255, 255, 255, 0.68);
    font-weight: 700;
}

.test-type {
    color: #fbbf24;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.toggle-button {
    width: 100%;
    border-radius: 12px;
    padding: 10px 12px;
    color: #064e3b;
    background: #a7f3d0;
}

.toggle-button.is-off {
    color: #7f1d1d;
    background: #fecaca;
}

.dashboard-main {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
}

.dashboard-main .dashboard-header,
.dashboard-main .status-card {
    grid-column: 1 / -1;
}

.premium-hero {
    min-height: 190px;
    align-items: flex-end;
}

.dashboard-hero-copy {
    min-width: 0;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.brand-logo {
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    object-fit: contain;
    border-radius: 12px;
    padding: 4px;
    background: white;
    border: 1px solid #efdcda;
    box-shadow: 0 8px 18px rgba(77, 31, 26, 0.08);
}

.brand-lockup strong,
.brand-lockup small {
    display: block;
}

.brand-lockup strong {
    font-size: 17px;
    line-height: 1.2;
}

.brand-lockup small {
    margin-top: 3px;
    color: #7b4a45;
    font-weight: 800;
}

.template-link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    border-radius: 999px;
    padding: 0 14px;
    color: #0f3f3c;
    background: #ccfbf1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 900;
}

.test-choice-list {
    display: grid;
    gap: 10px;
    margin-top: 22px;
}

.test-choice {
    display: grid;
    gap: 5px;
    border: 1px solid #dbe7f4;
    border-radius: 14px;
    padding: 14px 16px;
    color: #172033;
    background: #f8fafc;
    text-decoration: none;
}

.test-choice.is-selected {
    border-color: #2563eb;
    background: #eff6ff;
}

.test-choice span {
    color: #0f766e;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.test-choice small {
    color: #64748b;
}

@media (max-width: 860px) {
    .premium-dashboard,
    .dashboard-main {
        grid-template-columns: 1fr;
    }

    .premium-sidebar {
        position: static;
        min-height: auto;
    }

    .dashboard-grid,
    .status-card,
    .answer-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header,
    .player-header,
    .section-title-row,
    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-actions,
    .inline-form {
        width: 100%;
    }

    .admin-actions button,
    .inline-form button {
        flex: 1;
        width: 100%;
    }

    .form-row > div,
    .check-row {
        width: 100%;
    }

    .podium {
        grid-template-columns: 1fr;
    }

    .podium-box.first {
        transform: none;
        order: -1;
    }

    .hero-card,
    .card {
        border-radius: 16px;
        padding: 22px;
    }

    .modal-panel {
        max-height: calc(100vh - 84px);
        padding: 20px;
    }

    .create-icon-button {
        width: 42px;
        height: 42px;
    }
}

/* Screenshot-style quiz builder */
body:has(.quiz-builder-shell) {
    background: #fff9f8;
}

.app-shell:has(.quiz-builder-shell) {
    width: min(1490px, calc(100% - 44px));
}

.quiz-builder-shell {
    display: grid;
    grid-template-columns: 350px minmax(0, 1fr);
    gap: 30px;
    align-items: start;
}

.quiz-builder-shell input,
.quiz-builder-shell textarea {
    border-color: #f0dedd;
    border-radius: 14px;
    color: #402422;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 2px 8px rgba(77, 31, 26, 0.08);
}

.quiz-builder-shell input:focus,
.quiz-builder-shell textarea:focus {
    border-color: #ff2d2d;
    box-shadow: 0 0 0 4px rgba(255, 45, 45, 0.12);
}

.builder-card {
    border: 1px solid #efdcda;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 2px 8px rgba(77, 31, 26, 0.08);
}

.quiz-builder-sidebar {
    display: grid;
    gap: 20px;
}

.new-quiz-card {
    display: grid;
    gap: 11px;
    padding: 20px;
}

.new-quiz-card h2,
.builder-section-title h1,
.bulk-import-panel h2,
.questions-table-section h2 {
    font-size: 20px;
    line-height: 1.15;
}

.new-quiz-card textarea {
    min-height: 74px;
}

.builder-primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 45px;
    border-radius: 15px;
    padding: 0 24px;
    color: white;
    background: linear-gradient(135deg, #ef1f28, #ff512f);
    box-shadow: 0 8px 18px rgba(239, 31, 40, 0.22);
    font-size: 16px;
    font-weight: 900;
}

.builder-primary-button span {
    font-size: 25px;
    line-height: 1;
    font-weight: 400;
}

.builder-quiz-list {
    display: grid;
    gap: 12px;
}

.builder-quiz-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 82px;
    padding: 16px;
    border: 1px solid #efdcda;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.48);
}

.builder-quiz-item.is-selected {
    border-color: #ff2330;
    background: rgba(255, 239, 237, 0.7);
}

.builder-quiz-item a {
    display: grid;
    gap: 6px;
    color: #080606;
    text-decoration: none;
}

.builder-quiz-item strong {
    font-size: 20px;
}

.builder-quiz-item span {
    color: #5b2b28;
    font-weight: 500;
}

.builder-quiz-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mini-action-button {
    min-width: 66px;
    border-radius: 6px;
    padding: 8px 12px;
    color: #4a1715;
    background: #fff0ef;
    font-weight: 500;
}

.delete-icon-button {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    color: #ef1f28;
    background: transparent;
    font-size: 16px;
}

.quiz-builder-main {
    display: grid;
    gap: 20px;
}

.add-question-card {
    min-height: 462px;
    padding: 34px 30px 28px;
    background: rgba(255, 247, 246, 0.72);
}

.builder-section-title {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.builder-section-title p {
    margin: 6px 0 0;
    color: #6f3c38;
}

.builder-link-pill {
    align-self: flex-start;
    border-radius: 999px;
    padding: 9px 13px;
    color: #ef1f28;
    background: #fff0ef;
    text-decoration: none;
    font-size: 13px;
}

.question-builder-form {
    display: grid;
    gap: 14px;
}

.question-builder-form > textarea {
    min-height: 74px;
}

.answer-option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.answer-option-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.answer-option-row > input[type="radio"] {
    display: none;
}

.answer-option-row > span {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #efdcda;
    border-radius: 999px;
    color: #111;
    background: white;
}

.answer-option-row > input[type="radio"]:checked + span {
    color: white;
    border-color: #ef1f28;
    background: #ef1f28;
}

.answer-option-row > input[type="text"],
.answer-option-row > input:not([type]) {
    min-height: 46px;
}

.question-form-footer {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: end;
    gap: 18px;
    margin-top: 10px;
}

.question-form-footer label {
    display: block;
    margin-bottom: 8px;
    color: #080606;
    font-size: 14px;
}

.question-form-footer p {
    justify-self: end;
    color: #663b37;
}

.add-question-button {
    justify-self: start;
    min-width: 185px;
}

.bulk-import-panel {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 14px;
    padding: 26px;
    border: 1px dashed #dfcac8;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.68);
    box-shadow: 0 2px 8px rgba(77, 31, 26, 0.06);
}

.bulk-import-icon {
    width: 50px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    color: white;
    background: linear-gradient(135deg, #ef1f28, #ff512f);
    font-weight: 900;
}

.bulk-import-panel h2 {
    margin-bottom: 4px;
}

.bulk-import-panel p {
    margin: 0;
    color: #59322e;
}

.bulk-alert,
.bulk-import-actions,
.bulk-columns {
    grid-column: 1 / -1;
}

.bulk-import-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.template-download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    border-radius: 13px;
    padding: 0 18px;
    color: #111;
    background: white;
    border: 1px solid #efdcda;
    box-shadow: 0 2px 8px rgba(77, 31, 26, 0.08);
    text-decoration: none;
}

.upload-button {
    cursor: pointer;
}

.upload-button input {
    display: none;
}

.bulk-columns {
    margin-top: 8px;
    font-size: 14px;
}

.questions-table-section {
    padding-bottom: 20px;
}

.questions-table-section h2 {
    margin-bottom: 12px;
}

.questions-table {
    display: grid;
    gap: 10px;
}

.question-row-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #efdcda;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.62);
}

.question-row-card > span {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: white;
    background: #ef1f28;
    font-weight: 900;
}

.question-row-card div {
    display: grid;
    gap: 5px;
}

.question-row-card small {
    color: #6b3a36;
}

@media (max-width: 980px) {
    .quiz-builder-shell,
    .answer-option-grid {
        grid-template-columns: 1fr;
    }

    .question-form-footer {
        grid-template-columns: 1fr;
    }

    .question-form-footer p {
        justify-self: start;
    }
}

/* Red/cream dashboard theme with screenshot-style import builder */
body:has(.dashboard-red-theme) {
    background: #fff9f8;
}

.app-shell:has(.dashboard-red-theme) {
    width: min(1490px, calc(100% - 44px));
}

.dashboard-red-theme .premium-sidebar {
    color: #130b0a;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid #efdcda;
    box-shadow: 0 2px 10px rgba(77, 31, 26, 0.08);
}

.dashboard-red-theme .premium-sidebar .eyebrow,
.dashboard-red-theme .test-link small {
    color: #7b4a45;
}

.dashboard-red-theme .test-link {
    color: #130b0a;
}

.dashboard-red-theme .test-type {
    color: #ef1f28;
}

.dashboard-red-theme .test-item {
    background: rgba(255, 255, 255, 0.56);
    border-color: #efdcda;
}

.dashboard-red-theme .test-item.is-selected {
    background: rgba(255, 239, 237, 0.78);
    border-color: #ff2330;
}

.dashboard-red-theme .dashboard-header {
    color: #1d0e0d;
    background: rgba(255, 247, 246, 0.82);
    border: 1px solid #efdcda;
    box-shadow: 0 2px 10px rgba(77, 31, 26, 0.08);
}

.dashboard-red-theme .dashboard-header .eyebrow,
.dashboard-red-theme .dashboard-header .muted,
.dashboard-red-theme .dashboard-header a {
    color: #6f3c38;
}

.dashboard-red-theme .card {
    border-color: #efdcda;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 2px 10px rgba(77, 31, 26, 0.07);
}

.dashboard-red-theme .status-card > div {
    background: rgba(255, 247, 246, 0.74);
    border-color: #efdcda;
}

.dashboard-red-theme .primary-button,
.dashboard-red-theme .create-icon-button,
.dashboard-red-theme .toggle-button {
    color: white;
    background: linear-gradient(135deg, #ef1f28, #ff512f);
    box-shadow: 0 8px 18px rgba(239, 31, 40, 0.22);
}

.dashboard-red-theme .secondary-button {
    color: #4a1715;
    background: #fff0ef;
}

.dashboard-red-theme .danger-button,
.dashboard-red-theme .toggle-button.is-off {
    color: #ef1f28;
    background: #fff0ef;
}

.dashboard-red-theme .pill,
.dashboard-red-theme .participant-index {
    color: white;
    background: #ef1f28;
}

.dashboard-red-theme .question-card,
.dashboard-red-theme .top-three-card,
.dashboard-red-theme .participants-card,
.dashboard-red-theme .overall-card {
    border-top-color: #ef1f28;
}

.admin-notice-card {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border: 1px solid #ffc7c2;
    border-radius: 18px;
    color: #4a1715;
    background: #fff0ef;
    box-shadow: 0 2px 10px rgba(77, 31, 26, 0.07);
}

.admin-notice-card p {
    margin: 5px 0 0;
    color: #7b4a45;
}

.admin-notice-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dashboard-red-theme button:disabled {
    color: #9b7773;
    background: #fff4f3;
    box-shadow: none;
}

.import-builder-panel {
    width: min(1380px, calc(100% - 28px));
    max-height: calc(100vh - 54px);
    padding: 28px;
    background: #fff9f8;
}

.import-builder-backdrop {
    padding: 26px 14px;
}

.import-builder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.import-builder-shell {
    display: grid;
    grid-template-columns: 350px minmax(0, 1fr);
    gap: 30px;
    align-items: start;
}

.import-builder-shell input,
.import-builder-shell textarea,
.builder-modal-panel input,
.builder-modal-panel textarea {
    border-color: #f0dedd;
    border-radius: 14px;
    color: #402422;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 2px 8px rgba(77, 31, 26, 0.08);
}

.import-builder-shell input:focus,
.import-builder-shell textarea:focus,
.builder-modal-panel input:focus,
.builder-modal-panel textarea:focus {
    border-color: #ff2d2d;
    box-shadow: 0 0 0 4px rgba(255, 45, 45, 0.12);
}

.modal-new-quiz-form {
    margin-top: 18px;
}

@media (max-width: 980px) {
    .import-builder-shell {
        grid-template-columns: 1fr;
    }
}

/* Result report */
.report-dashboard {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 20px;
}

.report-dashboard .report-hero,
.report-dashboard .report-filter-card,
.report-dashboard .report-status-card,
.report-dashboard .report-question-card {
    grid-column: 1 / -1;
}

.report-filter-card {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
}

.report-filter-form {
    display: grid;
    grid-template-columns: minmax(260px, 430px) auto;
    align-items: end;
    gap: 12px;
}

.report-filter-form label {
    grid-column: 1 / -1;
    color: #667085;
    font-size: 13px;
    font-weight: 900;
}

.report-filter-form select {
    min-height: 48px;
    border: 1px solid #d9e0e8;
    border-radius: 10px;
    padding: 0 14px;
    color: #101828;
    background: white;
    font-size: 15px;
    font-weight: 800;
    outline: none;
}

.report-filter-form select:focus {
    border-color: #e50914;
    box-shadow: 0 0 0 4px rgba(229, 9, 20, 0.1);
}

.report-podium-card,
.report-overall-card,
.report-participants-card {
    min-height: 320px;
}

.report-question-list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.report-question-item {
    padding: 16px;
    border: 1px solid #efdcda;
    border-radius: 16px;
    background: rgba(255, 247, 246, 0.6);
}

.report-question-heading {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.report-question-heading > span {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: white;
    background: #ef1f28;
    font-weight: 900;
}

.report-question-heading strong {
    display: block;
    font-size: 18px;
    line-height: 1.25;
}

.report-question-heading small {
    display: block;
    margin-top: 5px;
    color: #6f3c38;
    font-weight: 700;
}

.report-list li > span {
    display: grid;
    gap: 3px;
}

.report-list li small {
    color: #667085;
    font-size: 12px;
    font-weight: 800;
}

.report-score-stack {
    display: grid;
    gap: 4px;
    justify-items: end;
    margin-left: auto;
}

.report-score-stack strong {
    color: #101828;
}

.report-score-stack em {
    border-radius: 999px;
    padding: 6px 9px;
    color: #e50914;
    background: #fff1f2;
    font-style: normal;
    font-size: 12px;
    font-weight: 950;
}

.report-option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.report-option {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #efdcda;
    border-radius: 12px;
    background: white;
}

.report-option strong {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #4a1715;
    background: #fff0ef;
}

.report-option.is-correct {
    border-color: #ef1f28;
    background: #fff0ef;
}

.report-option em {
    font-style: normal;
    font-weight: 900;
}

.fastest-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.fastest-list .label {
    flex-basis: 100%;
    margin-bottom: 0;
}

.fastest-list span {
    border-radius: 999px;
    padding: 8px 10px;
    color: #4a1715;
    background: white;
    border: 1px solid #efdcda;
    font-size: 13px;
    font-weight: 800;
}

@media (max-width: 860px) {
    .report-dashboard,
    .report-option-grid,
    .report-filter-form {
        grid-template-columns: 1fr;
    }

    .report-filter-card {
        align-items: stretch;
        flex-direction: column;
    }

    .brand-logo {
        width: 50px;
        height: 50px;
    }
}

/* Refined admin dashboard theme */
body:has(.dashboard-red-theme) {
    background:
        linear-gradient(135deg, rgba(229, 9, 20, 0.04), transparent 34%),
        linear-gradient(160deg, #f8fafc 0%, #ffffff 44%, #f3f6fa 100%);
}

.app-shell:has(.dashboard-red-theme) {
    width: min(1540px, calc(100% - 28px));
    padding: 18px 0;
}

.dashboard-red-theme {
    --dash-red: #e50914;
    --dash-red-dark: #b80f1a;
    --dash-ink: #101828;
    --dash-muted: #667085;
    --dash-line: #e7ebf0;
    --dash-soft: #fff5f5;
    --dash-surface: rgba(255, 255, 255, 0.92);
}

.dashboard-red-theme.premium-dashboard {
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 20px;
}

.dashboard-red-theme .premium-sidebar {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 36px);
    padding: 22px;
    color: var(--dash-ink);
    background: var(--dash-surface);
    border: 1px solid var(--dash-line);
    border-radius: 14px;
    box-shadow: 0 16px 42px rgba(16, 24, 40, 0.08);
}

.dashboard-brand-card {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    padding: 14px;
    border: 1px solid #ffd6d8;
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(229, 9, 20, 0.09), rgba(255, 255, 255, 0.96) 48%),
        #ffffff;
    box-shadow: 0 14px 30px rgba(229, 9, 20, 0.08);
}

.dashboard-brand-card img {
    width: 62px;
    height: 62px;
    object-fit: contain;
    border-radius: 12px;
    background: white;
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
}

.dashboard-brand-card strong,
.dashboard-brand-card small {
    display: block;
}

.dashboard-brand-card strong {
    color: var(--dash-ink);
    font-size: 18px;
    line-height: 1.1;
}

.dashboard-brand-card small {
    margin-top: 4px;
    color: var(--dash-red);
    font-size: 13px;
    font-weight: 900;
}

.dashboard-red-theme .sidebar-top {
    gap: 16px;
    margin-bottom: 34px;
}

.dashboard-red-theme .create-icon-button {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    color: white;
    background: linear-gradient(145deg, var(--dash-red), #ff3b45);
    box-shadow: 0 12px 24px rgba(229, 9, 20, 0.28);
}

.dashboard-red-theme .premium-sidebar .eyebrow,
.dashboard-red-theme .test-type,
.dashboard-red-theme .label {
    color: var(--dash-red);
    letter-spacing: 0.1em;
}

.dashboard-red-theme .premium-sidebar h2 {
    font-size: 32px;
    line-height: 1;
}

.sidebar-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    color: var(--dash-red);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.sidebar-menu-icon {
    color: var(--dash-ink);
    font-size: 18px;
}

.dashboard-red-theme .test-list {
    gap: 12px;
}

.dashboard-red-theme .test-item {
    gap: 14px;
    padding: 16px 16px 14px;
    background: white;
    border: 1px solid var(--dash-line);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(16, 24, 40, 0.035);
}

.dashboard-red-theme .test-item.is-selected {
    background: linear-gradient(145deg, #ffffff, #fff6f6);
    border-color: var(--dash-red);
    box-shadow: 0 12px 28px rgba(229, 9, 20, 0.08);
}

.dashboard-red-theme .test-link {
    color: var(--dash-ink);
}

.dashboard-red-theme .test-link small {
    color: var(--dash-muted);
}

.dashboard-red-theme .toggle-button {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-height: 38px;
    padding: 0 14px;
    color: var(--dash-red);
    background: #fff1f2;
    border-radius: 999px;
    box-shadow: none;
}

.dashboard-red-theme .toggle-button.is-off {
    color: var(--dash-red);
    background: #fff1f2;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--dash-red);
    box-shadow: 0 0 0 6px rgba(229, 9, 20, 0.1);
}

.sidebar-nav {
    display: grid;
    gap: 6px;
    margin-top: auto;
    padding-top: 22px;
    border-top: 1px solid var(--dash-line);
}

.sidebar-nav-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0 12px;
    color: #344054;
    background: transparent;
    text-align: left;
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
}

.sidebar-nav-link:hover,
.sidebar-nav-link.is-active {
    color: var(--dash-red);
    background: #fff5f5;
    border-color: #ffd8d8;
}

.nav-icon {
    width: 22px;
    text-align: center;
    font-size: 18px;
}

.sidebar-user-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--dash-line);
}

.admin-avatar,
.participant-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #475467;
    background: #eef2f6;
    border: 1px solid #d0d5dd;
    font-weight: 900;
}

.admin-avatar {
    width: 44px;
    height: 44px;
}

.sidebar-user-card strong,
.sidebar-user-card small {
    display: block;
}

.sidebar-user-card small {
    margin-top: 2px;
    color: var(--dash-muted);
    font-size: 12px;
}

.dashboard-red-theme .dashboard-main {
    gap: 20px;
}

.dashboard-red-theme .dashboard-header {
    min-height: 220px;
    align-items: center;
    color: var(--dash-ink);
    background:
        radial-gradient(circle at 10% 10%, rgba(229, 9, 20, 0.08), transparent 26%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 247, 0.88));
    border: 1px solid var(--dash-line);
    border-radius: 14px;
    box-shadow: 0 16px 42px rgba(16, 24, 40, 0.08);
}

.hero-brand-strip {
    display: inline-grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 8px 12px 8px 8px;
    border: 1px solid #ffd6d8;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 10px 22px rgba(229, 9, 20, 0.07);
}

.hero-brand-strip img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 999px;
}

.hero-brand-strip strong,
.hero-brand-strip span {
    display: block;
}

.hero-brand-strip strong {
    color: var(--dash-ink);
    font-size: 14px;
    line-height: 1.1;
}

.hero-brand-strip span {
    margin-top: 2px;
    color: var(--dash-muted);
    font-size: 12px;
    font-weight: 800;
}

.dashboard-red-theme .dashboard-header h1 {
    max-width: 640px;
    font-size: clamp(40px, 4.1vw, 58px);
    line-height: 1.03;
}

.dashboard-red-theme .dashboard-header .muted,
.dashboard-red-theme .dashboard-header a {
    color: #475467;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 14px;
    min-width: min(610px, 100%);
}

.action-button,
.dashboard-red-theme .secondary-button.action-button,
.dashboard-red-theme .danger-button.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    border-radius: 8px;
    padding: 0 16px;
    color: var(--dash-ink);
    background: white;
    border: 1px solid #dde3ea;
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.035);
    text-decoration: none;
}

.button-icon {
    color: var(--dash-red);
    font-size: 22px;
    line-height: 1;
}

.dashboard-red-theme .primary-button.start-action {
    color: white;
    background: linear-gradient(145deg, var(--dash-red), #ff1f2b);
    border-color: var(--dash-red);
    box-shadow: 0 14px 28px rgba(229, 9, 20, 0.2);
}

.dashboard-red-theme .primary-button.start-action .button-icon {
    color: white;
}

.dashboard-red-theme .danger-button.action-button {
    color: var(--dash-red);
}

.dashboard-red-theme button:disabled,
.dashboard-red-theme .action-button:disabled {
    color: #b7b9c0;
    background: #fafafa;
    border-color: #edf0f3;
    box-shadow: none;
}

.dashboard-red-theme button:disabled .button-icon {
    color: #b7b9c0;
}

.admin-notice-card {
    min-height: 96px;
    padding: 22px 28px;
    color: var(--dash-ink);
    background: linear-gradient(145deg, #fffafa, #fff1f2);
    border: 1px solid #ffc9c9;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(229, 9, 20, 0.06);
}

.notice-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: white;
    background: var(--dash-red);
    font-weight: 950;
}

.admin-notice-card p {
    color: #5b6472;
}

.dashboard-red-theme .card {
    background: var(--dash-surface);
    border: 1px solid var(--dash-line);
    border-radius: 14px;
    box-shadow: 0 14px 32px rgba(16, 24, 40, 0.06);
}

.dashboard-red-theme .card:hover {
    transform: none;
    border-color: #dbe2ea;
    box-shadow: 0 16px 36px rgba(16, 24, 40, 0.08);
}

.dashboard-red-theme .status-card {
    gap: 20px;
}

.dashboard-red-theme .status-card > div {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 92px;
    padding: 16px 18px;
    background: white;
    border: 1px solid var(--dash-line);
    border-radius: 12px;
    box-shadow: 0 10px 22px rgba(16, 24, 40, 0.045);
}

.status-card-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--dash-red);
    background: #fff1f2;
    border: 2px solid #ffd1d1;
    font-size: 22px;
}

.status-card-icon.muted-icon {
    color: var(--dash-ink);
    background: white;
    border-color: #d0d5dd;
}

.dashboard-red-theme .big-number {
    font-size: 36px;
    color: var(--dash-ink);
}

.dashboard-red-theme .pill {
    color: white;
    background: var(--dash-red);
}

.dashboard-red-theme .question-card,
.dashboard-red-theme .top-three-card,
.dashboard-red-theme .participants-card,
.dashboard-red-theme .overall-card {
    border-top: 1px solid var(--dash-line);
}

.dashboard-red-theme .question-card > .label,
.dashboard-red-theme .top-three-card .label,
.dashboard-red-theme .participants-card .label,
.dashboard-red-theme .overall-card .label {
    position: relative;
    padding-bottom: 10px;
}

.dashboard-red-theme .question-card > .label::after,
.dashboard-red-theme .top-three-card .label::after,
.dashboard-red-theme .participants-card .label::after,
.dashboard-red-theme .overall-card .label::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 42px;
    height: 3px;
    border-radius: 999px;
    background: var(--dash-red);
}

.question-card.is-finished {
    display: grid;
    align-content: start;
}

.question-card.is-finished #questionTitle {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    line-height: 1.25;
}

.finished-mark {
    width: 70px;
    height: 70px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--dash-red);
    background: #fff1f2;
    border: 1px solid #ffd1d1;
    font-size: 40px;
    font-weight: 800;
}

#questionTitle small {
    display: block;
    color: var(--dash-ink);
    font-size: 24px;
    font-weight: 900;
}

.dashboard-red-theme .podium {
    align-items: stretch;
    gap: 14px;
}

.dashboard-red-theme .podium-box {
    min-height: 132px;
    padding: 18px 14px;
    border-radius: 10px;
    background: #f8fafc;
}

.dashboard-red-theme .podium-box.first {
    min-height: 168px;
    color: #7a3d00;
    background: linear-gradient(145deg, #fffef8, #fff7d6);
    border-color: #f6c344;
    transform: none;
}

.dashboard-red-theme .podium-box.second {
    color: #344054;
    background: linear-gradient(145deg, #ffffff, #f2f4f7);
}

.dashboard-red-theme .podium-box.third {
    color: #9a3412;
    background: linear-gradient(145deg, #ffffff, #fff1ed);
    border-color: #fed7c7;
}

.podium-medal {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: white;
    background: #98a2b3;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.podium-box.first .podium-medal {
    width: 54px;
    height: 54px;
    background: linear-gradient(145deg, #f59e0b, #facc15);
    font-size: 20px;
}

.podium-box.third .podium-medal {
    background: linear-gradient(145deg, #c2410c, #f97316);
}

.dashboard-red-theme .podium-box strong {
    color: var(--dash-ink);
    font-size: 18px;
}

.dashboard-red-theme .podium-box small,
.score-pill {
    color: var(--dash-red);
    font-weight: 950;
}

.participant-list,
.overall-list {
    gap: 12px;
}

.participant-item,
.overall-list li {
    min-height: 54px;
    padding: 10px 12px;
    background: white;
    border-color: var(--dash-line);
    border-radius: 10px;
}

.participant-item {
    justify-content: flex-start;
}

.participant-item > span:nth-child(3) {
    flex: 1;
}

.participant-index {
    width: 30px;
    height: 30px;
    background: var(--dash-red);
}

.participant-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
}

.score-pill {
    margin-left: auto;
    border-radius: 7px;
    padding: 9px 12px;
    background: #fff1f2;
    font-size: 13px;
}

@media (max-width: 1180px) {
    .action-grid {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 860px) {
    .dashboard-red-theme.premium-dashboard,
    .dashboard-red-theme .dashboard-main {
        grid-template-columns: 1fr;
    }

    .dashboard-red-theme .premium-sidebar {
        position: static;
        min-height: auto;
    }

    .dashboard-red-theme .dashboard-header {
        min-height: auto;
    }

    .hero-brand-strip {
        border-radius: 14px;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-red-theme .status-card {
        grid-template-columns: 1fr;
    }
}
