:root {
    --blue: #1d4ed8;
    --blue-dark: #1e3a8a;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --ok: #15803d;
    --bad: #b91c1c;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", system-ui, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}
.topbar {
    background: var(--blue-dark);
    color: #fff;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 600; }
.topbar nav a { color: #cbd5e1; text-decoration: none; margin-left: 18px; font-size: 14px; }
.topbar nav a:hover, .topbar nav a.active { color: #fff; }
.wrap { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.center-page { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 16px; }
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.card.narrow { width: 100%; max-width: 420px; }
.card h2 { margin-top: 0; }
label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 5px; }
input[type=text], input[type=email], input[type=password], input[type=tel] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 15px;
}
input:focus, textarea:focus { outline: 2px solid #93c5fd; border-color: var(--blue); }
.btn {
    display: inline-block;
    background: var(--blue);
    color: #fff;
    border: 0;
    padding: 11px 22px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: var(--blue-dark); }
.btn.full { width: 100%; margin-top: 20px; }
.btn.green { background: var(--ok); }
.btn.green:hover { background: #166534; }
.btn.red { background: var(--bad); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.gray { background: #475569; }
.alert { padding: 10px 14px; border-radius: 6px; margin: 12px 0; font-size: 14px; }
.alert.error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.muted { color: var(--muted); font-size: 13px; }
.admin-link { margin-top: 18px; font-size: 11px; }
.admin-link a { color: #94a3b8; text-decoration: none; }
.admin-link a:hover { color: var(--blue); text-decoration: underline; }

/* start page */
.info-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.info-row span:first-child { color: var(--muted); }
.durations { display: flex; gap: 10px; margin-top: 8px; }
.durations label { flex: 1; margin: 0; font-weight: 500; }
.durations input { display: none; }
.durations span {
    display: block; text-align: center; padding: 12px 6px;
    border: 2px solid #cbd5e1; border-radius: 8px; cursor: pointer; font-weight: 600;
}
.durations input:checked + span { border-color: var(--blue); background: #dbeafe; color: var(--blue-dark); }

/* test page */
.test-head { position: sticky; top: 0; z-index: 5; background: var(--blue-dark); color: #fff; padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.timer { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; background: #fff; color: var(--blue-dark); padding: 2px 16px; border-radius: 8px; }
.timer.low { background: #fee2e2; color: var(--bad); }
.para-box {
    background: #fff; border: 1px solid var(--line); border-radius: 8px;
    height: 230px; overflow-y: auto; padding: 16px 18px;
    font-size: 20px; line-height: 1.9; font-family: Georgia, "Times New Roman", serif;
    user-select: none; -webkit-user-select: none;
}
.para-box span.w { padding: 1px 2px; border-radius: 3px; }
.para-box span.cur { background: #fde68a; }
.para-box span.ok { color: var(--ok); }
.para-box span.bad { color: var(--bad); background: #fee2e2; }
textarea#typing {
    width: 100%; height: 170px; margin-top: 14px; padding: 14px; font-size: 19px;
    font-family: Georgia, "Times New Roman", serif; border: 2px solid #cbd5e1; border-radius: 8px; resize: none;
}
.stat-bar { display: flex; gap: 20px; margin-top: 10px; font-size: 14px; color: var(--muted); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
th, td { padding: 9px 11px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: #f8fafc; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge.pending { background: #e2e8f0; color: #334155; }
.badge.prog { background: #fef3c7; color: #92400e; }
.badge.done { background: #dcfce7; color: #166534; }
.grid2 { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.stat b { display: block; font-size: 24px; }
.stat small { color: var(--muted); }
.typed-view { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px; line-height: 2; font-family: Georgia, serif; font-size: 17px; }
.typed-view .ok { color: var(--ok); }
.typed-view .bad { color: var(--bad); background: #fee2e2; }
.thanks { text-align: center; }
.thanks .tick { font-size: 56px; color: var(--ok); }
