:root {
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #142436;
    background: #f4f7fa;
    font-size: 15px;
    --navy: #10283e;
    --primary: #0c6155;
    --muted: #526376;
    --line: #dfe7ed;
    --surface: #fff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, input:focus-visible, select:focus-visible, .table-scroll:focus-visible {
    outline: 2px solid #198371;
    outline-offset: 2px;
}

.welcome {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    background: radial-gradient(ellipse at top right, #205754, transparent 62%), var(--navy);
}
.login-card { width: min(100%, 428px); border-radius: 14px; background: var(--surface); padding: 36px; box-shadow: 0 22px 70px #06162060; }
.login-card h1 { margin: 24px 0 10px; font-size: 28px; }
.login-card form { display: grid; gap: 18px; margin-top: 24px; }
.quiz-challenge { display: grid; gap: 18px; }
.verification-challenge { display: grid; align-items: end; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 750; font-size: 23px; }
.brand strong { display: block; font-size: 19px; line-height: 1.15; letter-spacing: .02em; }
.brand small, .account small { display: block; margin-top: 4px; font-size: 12px; color: #b4c8d6; }

.workspace { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { background: var(--navy); color: #fff; display: flex; flex-direction: column; gap: 34px; padding: 26px 18px; min-height: 100vh; }
.sidebar .brand { padding: 0 8px; }
.sidebar nav { display: grid; gap: 7px; }
.sidebar nav button { background: transparent; border: 0; color: #c0d2de; text-align: left; border-radius: 7px; padding: 12px 14px; font-weight: 600; white-space: nowrap; }
.sidebar nav button:hover { background: #244058; color: #fff; }
.sidebar nav button[aria-current="page"] { background: #19534f; color: #fff; }
.account { margin-top: auto; border-top: 1px solid #375064; padding: 17px 8px 0; min-width: 0; }
.account-info strong, .account-info small { overflow-wrap: anywhere; }
.logout { color: #d7e5ed; background: transparent; border: 0; padding: 9px 0 0; text-decoration: underline; text-underline-offset: 3px; }

.content { width: min(100%, 1500px); padding: 28px clamp(18px, 4vw, 52px) 50px; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 23px; }
.page-header h1 { margin: 0; font-size: clamp(23px, 2.5vw, 32px); line-height: 1.3; }
.filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px; }
label { display: grid; gap: 7px; color: #384a5b; font-size: 13px; font-weight: 650; }
input, select { min-width: 0; height: 40px; color: #142436; background: var(--surface); padding: 0 10px; border: 1px solid #bfceda; border-radius: 7px; font-weight: 400; }
.filters input[type="date"] { width: 153px; }
.filters .check { display: flex; align-items: center; min-height: 40px; gap: 7px; }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.button { border-radius: 7px; min-height: 40px; padding: 7px 15px; font-weight: 650; white-space: nowrap; }
.primary { background: var(--primary); border: 1px solid var(--primary); color: #fff; }
.primary:hover:enabled { background: #074c42; }
.secondary { border: 1px solid #aabecb; background: var(--surface); color: #223e53; }
.secondary:hover:enabled { background: #eaf1f5; }
.login-submit { width: 100%; margin-top: 2px; }

.muted, .view-note { color: var(--muted); }
.view-note, .loading { margin: 13px 0; font-size: 13px; line-height: 1.5; }
.error { margin: 12px 0; color: #a32b21; font-size: 13px; line-height: 1.5; }
.login-card .error, #verification-state { margin: 0; font-size: 13px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-top: 16px; }
.metric, .records { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.metric { min-width: 0; padding: 16px 15px 13px; }
.metric h2, .records h2 { font-size: 15px; margin: 0; }
.metric strong { display: block; overflow-wrap: anywhere; color: #122c3e; font-size: clamp(21px, 2.3vw, 31px); line-height: 1.25; margin: 7px 0; font-variant-numeric: tabular-nums; }
.metric canvas { width: 100%; height: 132px; display: block; }
.records { margin-top: 21px; min-width: 0; }
.records-header { padding: 15px 17px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.records-header span { font-size: 12px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
thead { background: #f5f8fa; }
th, td { padding: 11px 14px; border-top: 1px solid var(--line); white-space: nowrap; }
th { color: #455769; font-size: 12px; font-weight: 650; }
td { font-size: 14px; }
td.number, th.number { text-align: right; }
td.empty { text-align: center; color: var(--muted); padding: 32px 14px; }
tbody tr:hover { background: #f7fafb; }
.detail-link { padding: 0; border: 0; background: transparent; color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.status { display: inline-block; border-radius: 5px; background: #eef2f5; color: #364c5c; padding: 3px 7px; }
.status.complete { background: #e2f3ea; color: #11614c; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pager .button { min-height: 35px; }

@media (max-width: 1000px) {
    .workspace { grid-template-columns: 184px minmax(0, 1fr); }
    .content { padding-inline: 20px; }
    .metrics { gap: 8px; }
    .metric { padding-inline: 10px; }
}
@media (max-width: 760px) {
    .workspace { display: block; }
    .sidebar { min-height: auto; gap: 12px; padding: 13px 14px; }
    .sidebar .brand { padding: 0; }
    .sidebar nav { display: flex; overflow-x: auto; }
    .sidebar nav button { padding: 9px 11px; }
    .account { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0 0; margin: 0; }
    .logout { flex: none; padding: 4px 0; }
    .content { padding: 19px 13px 30px; }
    .page-header { margin-bottom: 16px; }
}
@media (max-width: 540px) {
    .metrics { grid-template-columns: 1fr; }
    .metric { padding: 12px; }
    .filters { gap: 10px; }
    .filters input[type="date"] { width: 142px; }
    .login-card { padding: 28px; }
}
