/* Administrative pages and the display at the classroom door. */

.admin-workspace,
.profile-grid {
    display: grid;
    gap: var(--space-4);
    min-width: 0;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}

.admin-actions :is(a, button) {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.admin-form {
    min-width: 0;
}

.admin-form .fields {
    grid-template-columns: 1fr;
}

.admin-form .fields > *,
.admin-inline-form > *,
.admin-form :is(input, select, textarea),
.admin-form fieldset {
    min-width: 0;
}

.admin-form :is(input, select, textarea):not([type="checkbox"], [type="radio"], [type="hidden"]) {
    min-height: 44px;
    width: 100%;
    max-width: 100%;
    font-size: var(--text-base);
}

.admin-form :is(select, textarea):focus-visible {
    outline: 3px solid var(--gold-text);
    outline-offset: 3px;
}

.admin-form :is(input[type="checkbox"], input[type="radio"]),
.column-manager input[type="checkbox"] {
    width: 24px;
    height: 24px;
    flex: none;
    margin: 0;
    accent-color: var(--emerald);
}

.admin-form .check,
.column-manager .check {
    min-height: 44px;
    gap: var(--space-2);
}

.admin-form fieldset {
    margin: 0;
    border: 1px solid var(--hairline);
    border-radius: 12px;
    padding: var(--space-3);
}

.admin-form fieldset > .row:last-child {
    margin-bottom: 0;
}

.admin-form legend {
    font-weight: 700;
    padding-inline: var(--space-1);
}

.admin-form small {
    color: var(--muted);
}

.admin-inline-form {
    display: grid;
    align-items: end;
    gap: var(--space-3);
}

.admin-danger {
    background: #fff8f8;
    border-color: #dbb9be;
}

button.admin-danger-button {
    background: #fbecef;
    color: #852837;
    border-color: #b55866;
}

button.admin-danger-button:hover {
    background: #f5dbe1;
}

.admin-confirmation {
    padding: var(--space-2);
    border-radius: 10px;
    background: var(--soft);
}

.catalog-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: 0;
}

.catalog-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    background: white;
    padding: var(--space-2) var(--space-3);
    color: var(--emerald);
    font-weight: 650;
    text-decoration: none;
}

.catalog-tabs a[aria-current="page"] {
    background: var(--emerald);
    border-color: var(--emerald);
    box-shadow: inset 0 -3px var(--gold);
    color: #fff;
}

.catalog-records {
    min-width: 0;
}

.admin-empty,
.course-group h3 {
    background: var(--alabaster);
    border-radius: 8px;
    padding: var(--space-2) var(--space-3);
}

.admin-empty {
    color: var(--muted);
}

.course-group + .course-group {
    margin-top: var(--space-4);
}

.course-group h3 {
    margin-block: var(--space-3) var(--space-2);
    font-size: var(--text-sm);
}

.course-group .course-shared {
    color: #1d6a50;
    background: #eaf5f0;
    display: inline-block;
    margin-inline-start: .25em;
}

.admin-table-wrap {
    max-width: 100%;
}

.admin-sheet :is(th, td) {
    overflow-wrap: anywhere;
}

.catalog-result-count {
    display: inline-block;
    margin-block: var(--space-2);
    color: var(--emerald);
    font-weight: 650;
}

.column-manager {
    margin-block: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    background: var(--alabaster);
}

.column-manager summary {
    align-content: center;
    min-height: 44px;
    color: var(--emerald);
    cursor: pointer;
    font-weight: 700;
}

.column-manager .column-list li,
.roster-person {
    border: 1px solid var(--hairline);
    border-radius: 10px;
    padding: var(--space-2);
    background: var(--alabaster);
}

.column-manager .column-list li {
    background: white;
}

.column-manager .column-list button {
    padding: var(--space-2);
}

.roster-heading .admin-actions,
.profile-heading .admin-actions {
    margin-top: var(--space-3);
}

.roster-person {
    align-items: center;
    overflow-wrap: anywhere;
}

.roster-person small {
    color: #1d6a50;
}

.roster-person:has(input:checked) {
    background: #eaf5f0;
    border-color: #bcdacc;
}

.profile-values {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: var(--space-2) var(--space-3);
    padding: var(--space-3);
    border-radius: 10px;
    background: var(--alabaster);
}

.profile-values dt {
    color: var(--muted);
    font-weight: 650;
}

.profile-values dd {
    margin: 0;
}

:is(.profile-heading, .profile-values, .message-card, .broadcast-card) {
    overflow-wrap: anywhere;
}

.student-profile .profile-section {
    margin: 0;
}

.admin-workspace .rule-cards p {
    background: var(--alabaster);
    border-inline-start: 3px solid var(--gold);
    margin: 0;
}

.broadcast-meta {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    align-items: center;
    color: var(--muted);
}

.broadcast-meta + p {
    margin-top: var(--space-3);
}

.broadcast-card .button {
    margin-top: var(--space-3);
}

.badge:is(.active, .sent, .local) {
    --status: #1d6a50;
    --tint: #eaf5f0;
}

.badge:is(.disabled, .delivery_failed) {
    --status: #9e2a3b;
    --tint: #fbecef;
}

.badge:is(.queued, .delivery_unknown) {
    --status: #8b570f;
    --tint: #fdf5e6;
}

.account-password,
.message-card {
    max-width: 38rem;
}

.message-card > .button {
    justify-self: start;
}

.message-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--soft);
    color: var(--gold-text);
}

.message-icon .icon {
    width: 24px;
    height: 24px;
}

.application.door-screen {
    display: block;
    background: var(--emerald);
    color: #fcfaf2;
}

.door-screen .rail,
.door-screen .desktop-title {
    display: none;
}

.door-screen :is(.mobile-menu, .mobile-brand) {
    display: flex;
}

.door-screen .content {
    max-width: 1200px;
}

.door-screen .page-heading h1,
.door-screen .door-schedule h2 {
    color: #fcfaf2;
}

.door {
    display: grid;
    gap: var(--space-4);
}

.door-instructions {
    color: #e9eee8;
    font-size: clamp(1rem, 2vw, 1.35rem);
}

.door-clock {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2) var(--space-4);
}

.door-clock time:first-child {
    color: #f0dab1;
    font-size: clamp(1.1rem, 3vw, 1.65rem);
}

.door-clock time + time {
    margin: 0;
    color: white;
    font-size: clamp(2rem, 6vw, 4rem);
    line-height: 1.15;
}

.door-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
    align-items: start;
}

.door-code {
    color: var(--emerald);
    background: #faf5e8;
    padding: clamp(10px, 2vw, 20px);
    border: 1px solid var(--gold);
    border-radius: var(--radius);
}

.door-code img {
    margin: 0 auto var(--space-2);
    width: min(100%, 340px);
    height: auto;
    border-radius: 8px;
}

.door-code output {
    font-family: var(--serif);
    font-feature-settings: "tnum", "lnum";
    font-size: clamp(2rem, 6vw, 3.85rem);
    letter-spacing: .1em;
}

.door-code progress {
    width: 100%;
    height: 10px;
    accent-color: var(--emerald);
}

.door-screen .door-schedule {
    background: #1a3b32;
    border-color: #658477;
    padding: var(--space-4);
    border-radius: var(--radius);
}

.door-screen .door-schedule li {
    border-color: #658477;
}

.door-link {
    overflow-wrap: anywhere;
}

.door-link a {
    color: #f0dab1;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    text-decoration: underline;
    text-underline-offset: .2em;
}

.door [data-error-display]:empty {
    display: none;
}

@media (min-width: 620px) {
    .admin-form .fields,
    .admin-inline-form {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    }

    .admin-form .fields > fieldset {
        grid-column: 1 / -1;
    }

    .profile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}

@media (min-width: 800px) and (max-width: 1099px) {
    /* Keep the list readable when the desktop sidebar narrows the workspace. */
    .admin-sheet thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .admin-sheet tbody {
        display: grid;
        gap: var(--space-2);
    }

    .admin-sheet tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-1) var(--space-3);
        border: 1px solid var(--hairline);
        border-radius: 12px;
        background: var(--alabaster);
        padding: var(--space-2);
    }

    .admin-sheet td {
        border: 0;
        padding: 0;
    }

    .admin-sheet td[data-label]::before {
        display: block;
    }
}

@media (min-width: 800px) {
    .door-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .door-screen .door-schedule li {
        font-size: clamp(1rem, 2vw, 1.25rem);
    }
}

@media (min-width: 1100px) {
    .admin-sheet {
        table-layout: fixed;
    }

    .admin-table-wrap {
        overflow-x: auto;
    }

    .student-directory {
        table-layout: auto;
    }

    .student-directory :is(th, td)[data-column] {
        min-width: 7rem;
    }

    .student-directory td:last-child {
        min-width: 9rem;
    }

    .admin-timetable th:last-child {
        width: 17%;
    }
}

@media print {
    @page {
        margin: 14mm;
    }

    .student-profile .profile-actions {
        display: none;
    }

    .student-profile .profile-grid {
        display: block;
    }

    .student-profile :is(.profile-heading, .profile-section, .profile-values) {
        background: white;
        box-shadow: none;
    }

    .student-profile .profile-section {
        margin-block-start: 10pt;
    }

    .student-profile :is(h2, h3) {
        color: #122b24;
    }

    .student-profile h3 {
        border-bottom: 1px solid #c49a4b;
    }
}
