/* ==========================================================================
   Training Portal — dark theme
   ========================================================================== */

:root {
    --accent: #e21833;
    --accent-hover: #f02a45;
    --accent-press: #b8102a;
    --accent-soft: rgba(226, 24, 51, 0.14);
    --accent-ring: rgba(226, 24, 51, 0.45);

    --bg: #0d0d0f;
    --surface: #151518;
    --surface-2: #1c1c20;
    --surface-3: #26262b;
    --border: #2a2a30;
    --border-strong: #3a3a42;

    --text: #ededf0;
    --text-muted: #9b9ba6;
    --text-faint: #6b6b75;

    --green: #4ade80;
    --green-soft: rgba(74, 222, 128, 0.12);
    --blue: #60a5fa;
    --blue-soft: rgba(96, 165, 250, 0.12);
    --amber: #fbbf24;
    --amber-soft: rgba(251, 191, 36, 0.12);
    --red: #f87171;
    --red-soft: rgba(248, 113, 113, 0.12);

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.3);
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100vh;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }

p { margin: 0; }

a {
    color: var(--accent-hover);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

::selection {
    background: var(--accent);
    color: #fff;
}

/* ==========================================================================
   Navbar
   ========================================================================== */

.navbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 24px;
    height: 60px;
    padding: 0 24px;
    background: rgba(13, 13, 15, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.nav-links {
    display: flex;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
    display: none;
}

.nav-links a {
    position: relative;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}

.nav-links a:hover {
    color: var(--text);
    background: var(--surface-2);
    text-decoration: none;
}

.nav-links a.active {
    color: var(--text);
}

.nav-links a.active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -11px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}

.nav-logout {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.nav-logout:hover {
    color: var(--accent-hover);
    text-decoration: none;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

.container.narrow {
    max-width: 720px;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}

.subtitle {
    margin-top: 6px;
    color: var(--text-muted);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 14px;
}

.back-link:hover {
    color: var(--text);
    text-decoration: none;
}

.section {
    margin-top: 36px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.count {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.card + .card {
    margin-top: 20px;
}

.card h2 {
    margin-bottom: 16px;
}

.muted {
    color: var(--text-muted);
}

/* ==========================================================================
   Dashboard tiles / stats
   ========================================================================== */

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.tile {
    display: block;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

.tile:hover {
    border-color: var(--accent);
    background: var(--surface-2);
    transform: translateY(-2px);
    text-decoration: none;
}

.tile-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 14px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-hover);
    font-size: 18px;
}

.tile h2 {
    font-size: 16px;
    margin-bottom: 4px;
}

.tile p {
    color: var(--text-muted);
    font-size: 14px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 8px;
}

.stat {
    display: block;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
}

a.stat:hover {
    border-color: var(--border-strong);
    text-decoration: none;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
}

.stat-label {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 13px;
}

.stat.highlight .stat-value {
    color: var(--accent-hover);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

button,
.btn,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

button:hover,
.btn:hover,
input[type="submit"]:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    text-decoration: none;
}

button:active,
.btn:active {
    background: var(--accent-press);
}

.btn-secondary,
button.btn-secondary {
    background: var(--surface-2);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-secondary:hover,
button.btn-secondary:hover {
    background: var(--surface-3);
    border-color: var(--border-strong);
}

.btn-ghost,
button.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover,
button.btn-ghost:hover {
    background: var(--surface-2);
    border-color: transparent;
    color: var(--text);
}

.btn-sm,
button.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

button:focus-visible,
.btn:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ==========================================================================
   Forms
   ========================================================================== */

label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="tel"],
select,
textarea {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
    height: auto;
    min-height: 110px;
    padding: 10px 12px;
    resize: vertical;
}

select {
    appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%239b9ba6' stroke-width='1.5' d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-faint);
}

input:hover,
select:hover,
textarea:hover {
    border-color: #4a4a53;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

input:disabled {
    color: var(--text-faint);
    cursor: not-allowed;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
}

.field {
    min-width: 0;
}

.field.full {
    grid-column: 1 / -1;
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-field label {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.form-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.form-row input {
    flex: 1;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    padding: 11px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr,
.trainee-table tr {
    transition: background 0.1s;
}

tbody tr:hover td,
.trainee-table tr:hover td {
    background: var(--surface-2);
}

td.nowrap {
    white-space: nowrap;
}

td.num {
    font-variant-numeric: tabular-nums;
}

.actions {
    white-space: nowrap;
    text-align: right;
}

.actions a,
.trainee-table td a {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.actions a:hover,
.trainee-table td a:hover {
    background: var(--surface-3);
    color: var(--text);
    text-decoration: none;
}

.actions a.danger:hover,
.trainee-table td a[href^="/delete_trainee"]:hover {
    background: var(--accent-soft);
    color: var(--accent-hover);
}

.actions a.primary {
    color: var(--accent-hover);
}

.link-list a {
    display: block;
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.link-list + .link-list {
    margin-top: 10px;
}

.link-list-label {
    margin-bottom: 2px;
    color: var(--text-faint);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.empty {
    padding: 28px;
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    color: var(--text-faint);
    text-align: center;
    font-size: 14px;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    text-transform: capitalize;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-scheduled,
.badge-rescheduled,
.badge-approved {
    background: var(--blue-soft);
    color: var(--blue);
}

.badge-active {
    background: var(--amber-soft);
    color: var(--amber);
}

.badge-passed,
.badge-graduated,
.badge-completed {
    background: var(--green-soft);
    color: var(--green);
}

.badge-failed {
    background: var(--red-soft);
    color: var(--red);
}

.badge-classroom,
.badge-road-training,
.badge-mock-charter,
.badge-shadow {
    background: var(--accent-soft);
    color: var(--accent-hover);
}

.badge-cancelled,
.badge-dropped {
    color: var(--text-faint);
}

/* ==========================================================================
   Detail list (complete session)
   ========================================================================== */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px 24px;
    margin: 0;
}

.detail-grid dt {
    margin-bottom: 4px;
    color: var(--text-faint);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.detail-grid dd {
    margin: 0;
    font-weight: 500;
}

.form-embed {
    display: block;
    width: 100%;
    height: 800px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.form-embed + .form-embed {
    margin-top: 16px;
}

/* ==========================================================================
   Auth pages (login / create account)
   ========================================================================== */

.auth-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(ellipse 60% 50% at 50% 0%, rgba(226, 24, 51, 0.18), transparent 70%),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 36px 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.auth-card.wide {
    max-width: 520px;
}

.auth-card .brand {
    justify-content: center;
    margin-bottom: 28px;
    font-size: 17px;
}

.auth-card .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 15px;
}

.auth-card h1 {
    margin-bottom: 6px;
    font-size: 22px;
    text-align: center;
}

.auth-card .subtitle {
    margin-bottom: 26px;
    text-align: center;
}

.login-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-items > div:empty,
.login-items > p:empty {
    display: none;
}

.login-items button {
    width: 100%;
    height: 44px;
}

/* "Create Account" button injected by the server */
.login-items button[formaction] {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text);
}

.login-items button[formaction]:hover {
    background: var(--surface-2);
}

.alert {
    padding: 10px 14px;
    background: var(--accent-soft);
    border: 1px solid rgba(226, 24, 51, 0.35);
    border-radius: var(--radius-sm);
    color: #ff8a9a;
    font-size: 14px;
}

/* ==========================================================================
   Training board (home page)
   ========================================================================== */

.container.wide {
    max-width: 1440px;
}

.board-scroll {
    overflow-x: auto;
    padding-bottom: 8px;
}

.board {
    display: grid;
    grid-template-columns: 140px minmax(160px, 1fr) minmax(360px, 2.6fr) minmax(150px, 1fr) minmax(150px, 1fr);
    column-gap: 20px;
    row-gap: 20px;
    min-width: 1060px;
}

.pipeline {
    display: grid;
    grid-column: 2 / 6;
    grid-template-columns: subgrid;
    column-gap: 0;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    overflow: hidden;
}

.lane {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lane-approved,
.lane-completed {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
}

.pipeline .lane + .lane {
    border-left: 1px solid var(--border-strong);
}

.lane-completed {
    grid-column: 4 / 6;
    min-height: 140px;
}

.lane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.lane-header h2 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.lane-body {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 14px 10px;
    flex: 1;
    padding: 16px;
    min-height: 260px;
}

.lane-completed .lane-body {
    min-height: 0;
}

.lane-empty {
    margin: auto;
    color: var(--text-faint);
}

/* Trainee chip */

.chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 64px;
    color: var(--text);
    text-align: center;
}

.chip:hover {
    text-decoration: none;
}

.chip-dot {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    background: var(--surface-2);
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.chip:hover .chip-dot {
    background: var(--accent);
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.chip-name,
.chip-detail {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1.2;
}

.chip-name {
    color: var(--text-muted);
}

.chip-detail {
    color: var(--text-faint);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.lane-approved .chip-dot {
    border-color: var(--border-strong);
}

.lane-completed .chip-dot {
    border-color: var(--green);
    color: var(--green);
}

.lane-completed .chip:hover .chip-dot {
    background: var(--green);
    color: #0d0d0f;
    box-shadow: 0 0 0 4px var(--green-soft);
}

/* Road lane: horizontal position = progress */

.road-track {
    flex: 1;
    position: relative;
    margin: 0 16px;
}

.road-track .chip {
    position: absolute;
    z-index: 1;
}

.road-track .lane-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}

.road-tick {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 1px dashed var(--border);
}

.road-axis {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px 12px;
    border-top: 1px solid var(--border);
    color: var(--text-faint);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.board-footnote {
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ==========================================================================
   Shared bits added with quizzes
   ========================================================================== */

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

.header-actions form {
    margin: 0;
}

a.name-link,
.trainee-table td a.name-link {
    display: inline;
    padding: 0;
    color: var(--text);
    font-size: inherit;
    font-weight: 500;
}

a.name-link:hover,
.trainee-table td a.name-link:hover {
    background: none;
    color: var(--accent-hover);
    text-decoration: underline;
}

.cell-sub {
    display: block;
    margin-top: 2px;
    font-size: 12px;
}

.notes-cell {
    max-width: 260px;
    font-size: 13px;
}

.truncate {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alert-success {
    background: var(--green-soft);
    border-color: rgba(74, 222, 128, 0.35);
    color: var(--green);
}

.alert a {
    color: inherit;
    text-decoration: underline;
}

button:disabled,
button:disabled:hover {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-ghost.danger:hover,
button.btn-ghost.danger:hover {
    background: var(--accent-soft);
    color: var(--accent-hover);
}

.icon-btn,
button.icon-btn {
    width: 32px;
    padding: 0;
}

.form-kind-tag {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    vertical-align: 1px;
}

.score {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.score-pct {
    margin-left: 4px;
    font-weight: 500;
    opacity: 0.75;
}

.score-passed { color: var(--green); }
.score-active { color: var(--amber); }
.score-failed { color: var(--red); }

.score-large {
    font-size: 24px;
}

/* ==========================================================================
   Quiz builder
   ========================================================================== */

.qb-card {
    margin-top: 16px;
}

.card + .qb-card,
.qb-card + .qb-card {
    margin-top: 16px;
}

.qb-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.qb-head .qb-type {
    width: auto;
    height: 34px;
    font-size: 13px;
}

.qb-required {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
}

.qb-required input {
    width: 16px;
    height: 16px;
}

.qb-tools {
    display: flex;
    gap: 2px;
    margin-left: auto;
}

.q-prompt-input {
    min-height: 0;
    font-size: 15px;
    font-weight: 500;
}

.qb-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

.qb-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qb-option .opt-text {
    flex: 1;
    height: 38px;
}

.qb-option.is-correct .opt-text {
    border-color: rgba(74, 222, 128, 0.5);
    background: var(--green-soft);
}

.correct-toggle {
    position: relative;
    flex: none;
    margin: 0;
    cursor: pointer;
}

.correct-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.correct-toggle span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    color: transparent;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.15s;
}

.correct-toggle:hover span {
    border-color: var(--green);
    color: rgba(74, 222, 128, 0.5);
}

.correct-toggle input:checked + span {
    background: var(--green);
    border-color: var(--green);
    color: #0d0d0f;
}

.correct-toggle input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.qb-options-foot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.qb-hint {
    color: var(--text-faint);
    font-size: 12px;
}

.qb-text-preview {
    margin-top: 12px;
    padding: 14px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-faint);
    font-size: 13px;
}

.qb-add {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 16px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
}

.qb-add .muted {
    margin-right: auto;
    font-size: 13px;
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding-bottom: 16px;
    background: linear-gradient(to bottom, rgba(13, 13, 15, 0), var(--bg) 30%);
    border-top: none;
}

/* ==========================================================================
   Quiz taking & review
   ========================================================================== */

.quiz-questions {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.quiz-question {
    min-width: 0;
    margin: 0;
    padding: 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.quiz-question legend,
.review-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    float: left;
    width: 100%;
    margin-bottom: 14px;
    padding: 0;
    font-weight: 600;
}

.quiz-question legend + * {
    clear: both;
}

.review-head {
    float: none;
}

.review-head .badge {
    margin-left: auto;
}

.q-num {
    display: grid;
    place-items: center;
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent-hover);
    font-size: 12px;
    font-weight: 700;
}

.q-prompt {
    padding-top: 1px;
    white-space: pre-wrap;
}

.q-required {
    color: var(--accent-hover);
    padding-top: 1px;
}

.q-hint {
    clear: both;
    margin: -6px 0 10px 34px;
    color: var(--text-faint);
    font-size: 12px;
}

.q-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    clear: both;
}

.q-option {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 11px 14px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.q-option:hover {
    border-color: #4a4a53;
}

.q-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.q-option input {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
}

.quiz-question textarea {
    clear: both;
    background: var(--surface);
}

.quiz-question.is-right {
    border-color: rgba(74, 222, 128, 0.3);
}

.quiz-question.is-wrong {
    border-color: rgba(248, 113, 113, 0.3);
}

.review-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.review-options li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.review-mark {
    display: grid;
    place-items: center;
    flex: none;
    width: 20px;
    font-weight: 700;
}

.review-options li.is-correct {
    border-color: rgba(74, 222, 128, 0.4);
    color: var(--green);
}

.review-options li.is-wrong {
    border-color: rgba(248, 113, 113, 0.45);
    background: var(--red-soft);
    color: var(--red);
}

.review-options li.is-picked.is-correct {
    background: var(--green-soft);
}

.review-options li.is-picked:not(.is-correct):not(.is-wrong) {
    border-color: var(--border-strong);
    background: var(--surface-3);
}

.review-tag {
    margin-left: auto;
    color: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    opacity: 0.8;
    text-transform: uppercase;
}

.review-text {
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    font-size: 14px;
}

.quiz-page {
    align-items: start;
}

.quiz-card {
    max-width: 680px;
    margin: 24px 0;
}

.quiz-card h1,
.quiz-card .subtitle {
    text-align: left;
}

.quiz-card .brand {
    justify-content: flex-start;
}

/* ==========================================================================
   Complete session: form status rows
   ========================================================================== */

.form-status-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.form-status.card {
    padding: 16px 20px;
}

.form-status-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.form-status-side {
    display: flex;
    align-items: center;
    gap: 12px;
}

#trainer-forms > * + * {
    margin-top: 16px;
}

/* ==========================================================================
   Session type form: attach rows
   ========================================================================== */

.attach-row select {
    flex: 0 1 260px;
}

.attach-row .form-url {
    flex: 1;
}

.attach-row .form-url[hidden] {
    display: none;
}

.attach-row select:only-child,
.attach-row:has(.form-url[hidden]) select {
    flex: 1;
}

/* ==========================================================================
   Trainee profile
   ========================================================================== */

.profile-head {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-dot {
    width: 64px;
    height: 64px;
    font-size: 15px;
}

.profile-head .subtitle {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.stat-of {
    margin-left: 2px;
    color: var(--text-faint);
    font-size: 16px;
    font-weight: 600;
}

.pending-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.pending-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
}
