/* Grades, transfers, people, management – module styles (Cloodle). */

/* ── Summary chips (gradebook, transfers) ───────────────────────────── */
.grade-summary {
    display: flex; flex-wrap: wrap; gap: .5rem;
    list-style: none; margin: 0; padding: 0;
}
.grade-summary > li {
    display: flex; align-items: baseline; gap: .4rem;
    background: var(--cl-surface); border: 1px solid var(--cl-border);
    border-radius: var(--cl-radius); padding: .45rem .8rem;
}
.grade-summary .value { font-size: 1.25rem; font-weight: 750; line-height: 1.1; }
.grade-summary .label { color: var(--cl-muted); font-size: .88rem; }
.grade-summary > li.is-error { border-color: var(--cl-danger); }
.grade-summary > li.is-error .value,
.grade-summary > li.is-error .label { color: var(--cl-danger); }

/* ── Gradebook table ─────────────────────────────────────────────────── */
.gradebook { font-size: .95rem; }
.gradebook thead th { white-space: nowrap; font-size: .85rem; color: var(--cl-muted); font-weight: 600; }
.gradebook th.student { font-weight: 600; min-width: 11rem; }
.gradebook .col-select { width: 2.5rem; text-align: center; }
.gradebook .col-select .form-check-input { width: 1.2rem; height: 1.2rem; margin: 0; }
.gradebook .evidence { font-variant-numeric: tabular-nums; }
.gradebook td, .gradebook th.student { white-space: nowrap; }
.gradebook td.status-cell { white-space: normal; min-width: 11rem; max-width: 17rem; }
.gradebook tbody tr.row-error > * { background: color-mix(in srgb, var(--cl-danger) 7%, transparent); }
.gradebook tbody tr.row-error th.student { box-shadow: inset 4px 0 0 var(--cl-danger); }

/* Keep the student name visible while scrolling sideways on narrow screens. */
@media (max-width: 991.98px) {
    .gradebook th.student {
        position: sticky; left: 0; z-index: 1;
        background: var(--cl-surface);
        box-shadow: 1px 0 0 var(--cl-border);
    }
    .gradebook tbody tr.row-error th.student {
        background: color-mix(in srgb, var(--cl-danger) 7%, var(--cl-surface));
        box-shadow: inset 4px 0 0 var(--cl-danger), 1px 0 0 var(--cl-border);
    }
}

.final-grade {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 2.2rem; height: 2.2rem; padding: 0 .45rem;
    border-radius: 50rem; font-weight: 750; font-variant-numeric: tabular-nums;
    background: var(--cl-primary-soft); color: var(--cl-primary-dark);
    border: 1px solid color-mix(in srgb, var(--cl-primary) 35%, transparent);
}
.final-grade-lg { min-width: 4rem; height: 4rem; font-size: 1.6rem; }
.final-grade-display { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

.gradebook-actions {
    display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
    margin-top: .75rem;
}
@media (max-width: 575.98px) {
    .gradebook-actions { position: sticky; bottom: 0; z-index: 2; background: var(--cl-surface-2); padding: .6rem 0; }
    .gradebook-actions .btn { width: 100%; }
}

/* ── Grade edit form ─────────────────────────────────────────────────── */
.grade-choices { display: flex; flex-wrap: wrap; gap: .4rem; }
.grade-choices .btn { min-width: 6.5rem; }
.required::after { content: " *"; color: var(--cl-danger); }

.history-list { list-style: none; margin: 0; padding: 0; }
.history-list > li { padding: .55rem 0 .55rem .9rem; border-left: 3px solid var(--cl-border); margin-left: .25rem; }
.history-list > li + li { margin-top: .1rem; }
.history-list .when { font-size: .85rem; color: var(--cl-muted); }
.history-list .reason { font-style: italic; margin-top: .15rem; }

/* ── Student's own view ──────────────────────────────────────────────── */
.result-list { list-style: none; margin: 0; padding: 0; }
.result-list > li { padding: .6rem 0; border-bottom: 1px solid var(--cl-border); }
.result-list > li:first-child { padding-top: 0; }
.result-list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.result-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; font-weight: 600; }
.result-value { font-variant-numeric: tabular-nums; }
.feedback {
    margin-top: .5rem; padding: .55rem .8rem;
    background: var(--cl-surface-2); border-left: 3px solid var(--cl-primary);
    border-radius: 0 var(--cl-radius) var(--cl-radius) 0;
}
.feedback-label { font-size: .85rem; font-weight: 600; color: var(--cl-muted); margin-bottom: .2rem; }
.feedback-text { white-space: pre-line; }

/* ── Transfers ───────────────────────────────────────────────────────── */
.transfer-group-head {
    display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem;
    padding: .7rem 1rem; border-bottom: 1px solid var(--cl-border);
    background: var(--cl-surface-2); border-radius: var(--cl-radius) var(--cl-radius) 0 0;
}
.transfer-group-head .form-check-input { width: 1.2rem; height: 1.2rem; margin: 0; }
.transfer-group-head .meta { margin-left: auto; }
.transfer-table .col-select { width: 2.5rem; text-align: center; }
.transfer-table .col-select .form-check-input { width: 1.2rem; height: 1.2rem; margin: 0; }
.transfer-table tbody tr.row-error > *,
.table tbody tr.row-error > * { background: color-mix(in srgb, var(--cl-danger) 7%, transparent); }
.transfer-steps { padding-left: 1.2rem; }
.transfer-steps li { margin-bottom: .35rem; }

/* ── People ──────────────────────────────────────────────────────────── */
.table tbody tr.is-inactive > * { color: var(--cl-muted); }
.extra-time-input { max-width: 9rem; }
.csv-sample {
    background: var(--cl-surface-2); border: 1px solid var(--cl-border); border-radius: var(--cl-radius);
    padding: .6rem .8rem; font-size: .85rem; white-space: pre; overflow-x: auto;
}
.csv-sample code { color: var(--cl-ink); }
.import-errors { max-height: 20rem; overflow-y: auto; padding-left: 1.2rem; font-size: .9rem; }
.import-result:focus { outline: none; }

/* ── Management ──────────────────────────────────────────────────────── */
.cidr-list { list-style: none; margin: 0; padding: 0; }
.cidr-list code { white-space: nowrap; }
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list > li { padding: .45rem 0; border-bottom: 1px solid var(--cl-border); }
.recent-list > li:first-child { padding-top: 0; }
.recent-list > li:last-child { border-bottom: 0; }
.audit-table td { font-size: .88rem; }
.audit-table code { font-size: .82rem; }
.demo-reset { border-color: var(--cl-danger) !important; }
.settings-form { max-width: 48rem; }
