:root {
    --navy: #0b3157;
    --navy2: #071b31;
    --orange: #f97316;
    --bg: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --green: #047857;
    --red: #b91c1c;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    font: 16px Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg);
}

#app {
    flex: 1 0 auto;
}

button,
input,
textarea,
select {
    font: inherit;
}

.login-shell {
    min-height: calc(100vh - 56px);
    display: grid;
    place-items: center;
    padding: 22px;
    background: linear-gradient(
        135deg,
        var(--navy2),
        #123b63 60%,
        #1d537f
    );
}

.login-wrap {
    width: min(440px, 100%);
}

.brand {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 22px;
    color: #fff;
    text-align: center;
}

.brand-logo {
    display: block;
    width: auto;
    height: 48px;
    max-width: 160px;
    object-fit: contain;
}

.brand .small {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 1px 2px #0f172a0a;
}

.login-card {
    padding: 28px;
    box-shadow: 0 22px 50px #0004;
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: 25px;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 13px;
}

.field {
    display: block;
    margin: 16px 0;
    font-size: 14px;
    font-weight: 600;
}

.field input,
.field textarea,
.field select,
input,
textarea,
select {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
}

textarea {
    min-height: 130px;
    line-height: 1.55;
    resize: vertical;
}

.btn {
    padding: 10px 15px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    background: var(--navy);
    border: 0;
    border-radius: 7px;
}

.btn.orange {
    background: var(--orange);
}

.btn.light {
    color: var(--navy);
    background: #fff;
    border: 1px solid #cbd5e1;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.full {
    width: 100%;
}

.error {
    padding: 11px;
    color: var(--red);
    background: #fef2f2;
    border-radius: 7px;
}

.success {
    color: var(--green);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    max-width: 1180px;
    margin: auto;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.grow {
    flex: 1;
}

.timer {
    padding: 9px 13px;
    color: var(--navy);
    font: 700 18px Consolas, monospace;
    background: #eff6ff;
    border-radius: 8px;
}

.timer.urgent {
    color: var(--red);
    background: #fef2f2;
}

.layout {
    max-width: 1180px;
    margin: auto;
    padding: 24px 18px;
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 24px;
}

.sidebar {
    position: sticky;
    top: 85px;
    height: max-content;
    padding: 14px;
}

.progress-track {
    height: 8px;
    overflow: hidden;
    background: #e2e8f0;
    border-radius: 99px;
}

.progress-fill {
    height: 100%;
    background: var(--orange);
}

.navbtn {
    display: block;
    width: 100%;
    margin-top: 3px;
    padding: 10px;
    color: #334155;
    text-align: left;
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: 7px;
}

.navbtn.active {
    color: #fff;
    background: var(--navy);
}

.question {
    margin: 14px 0;
    padding: 22px;
}

.question h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.question p {
    color: #334155;
    line-height: 1.6;
}

.section-title small {
    color: var(--orange);
    font-weight: 700;
}

.section-title h1 {
    margin: 5px 0;
}

.actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.check {
    display: flex;
    gap: 10px;
    margin: 9px 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.check input {
    width: auto;
    margin: 2px 0;
}

.admin-head {
    color: #fff;
    background: var(--navy);
}

.admin-head .topbar-inner {
    background: var(--navy);
}

.container {
    max-width: 1280px;
    margin: auto;
    padding: 24px 18px;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.metric {
    padding: 20px;
}

.metric strong {
    display: block;
    font-size: 28px;
}

.invite-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    margin: 20px 0;
    padding: 20px;
}

.table-wrap {
    overflow: auto;
}

.table-card {
    padding: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.code {
    padding: 5px 7px;
    font: 13px Consolas, monospace;
    background: #f1f5f9;
    border: 0;
    border-radius: 5px;
}

.badge {
    padding: 5px 8px;
    font-size: 12px;
    background: #f1f5f9;
    border-radius: 99px;
}

.badge.submitted {
    color: var(--green);
    background: #ecfdf5;
}

.review-grid {
    display: grid;
    grid-template-columns: 1fr 330px;
    gap: 22px;
}

.score-card {
    position: sticky;
    top: 20px;
    height: max-content;
    padding: 20px;
}

.answer {
    padding: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    background: #f8fafc;
    border-radius: 7px;
}

.score {
    color: var(--navy);
    font-size: 38px;
    font-weight: 700;
}

.link {
    color: inherit;
    text-decoration: none;
}

.text-link {
    color: var(--navy);
}

.site-footer {
    flex: 0 0 auto;
    width: 100%;
    padding: 18px;
    color: #fff;
    font-size: 13px;
    text-align: center;
    background: var(--navy);
    border-top: 1px solid var(--navy2);
}

.site-footer a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.site-footer a:hover {
    color: #fff;
    opacity: 0.85;
}

body:has(#start) .site-footer,
body:has(#adminLogin) .site-footer {
    color: var(--muted);
    background: #fff;
    border-top: 1px solid var(--border);
}

body:has(#start) .site-footer a,
body:has(#adminLogin) .site-footer a {
    color: var(--navy);
}

body:has(#start) .site-footer a:hover,
body:has(#adminLogin) .site-footer a:hover {
    color: var(--orange);
    opacity: 1;
}

@media (max-width: 800px) {
    .layout,
    .review-grid {
        grid-template-columns: 1fr;
    }

    .sidebar,
    .score-card {
        position: static;
    }

    .metrics {
        grid-template-columns: 1fr;
    }

    .invite-form {
        grid-template-columns: 1fr;
    }

    .timer {
        font-size: 15px;
    }

    .navbtn {
        display: inline-block;
        width: auto;
    }

    .sidebar {
        overflow: auto;
        white-space: nowrap;
    }
}