.page-content:has(> #schuelerform) { grid-template-rows: auto minmax(0, 1fr); }
#schuelerform { min-height: 0; overflow: hidden; }
#schuelerform > .table-wrapper { height: 100%; }
#schuelerform > .table-wrapper[data-horizontal-scroll="false"] { overflow-x: hidden; }
.schuelerdaten-table[data-without-bildungsweg] { width: 993px; min-width: 993px; }
.page-content:has(> #schuelerform) > header .hinweis-box { max-width: 345px; }
@media screen {
    .page-content > .schuelerdaten-header { container-type: inline-size; }
    body[data-klasse] .page-content > .schuelerdaten-header .header-row {
        flex-wrap: nowrap;
        gap: 18px;
    }
    body[data-klasse] .page-content > .schuelerdaten-header .header-main {
        flex: 1 1 0;
    }
    .page-content > .schuelerdaten-header .hinweis-box {
        flex: 0 0 345px;
    }
    .schuelerdaten-save-controls,
    .schuelerdaten-leitungen {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
        max-width: 100%;
    }
    .schuelerdaten-save-controls .status { margin-left: 0; min-width: 0; }
    .schuelerdaten-format-hinweis { margin-top: 6px; }
    .schuelerdaten-format-hinweis span { white-space: nowrap; }
    @container (max-width: 760px) {
        body[data-klasse] .page-content > .schuelerdaten-header .header-row {
            flex-direction: column;
            gap: 12px;
        }
        .page-content > .schuelerdaten-header .hinweis-box {
            flex-basis: auto;
            max-width: 100%;
        }
    }
}
.schuelerdaten-table .col-aufnahmevertrag { width: 86px; }
.schuelerdaten-table .col-abmeldung-klasse { width: 86px; }
.schuelerdaten-table .col-bildungsweg { width: 108px; }
.schuelerdaten-table .col-daten { width: 108px; }
.abmeldung-klasse-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}
.abmeldung-klasse-controls input[type="checkbox"] { flex: 0 0 22px; width: 22px; height: 22px; margin: 0; }
.schuelerdaten-table .abmeldung-klasse-controls .field { width: 50px; min-width: 0; }
.schuelerdaten-table .sd-sticky-vorname,
.schuelerdaten-table .sd-sticky-nachname,
.schuelerdaten-table .sd-sticky-profil {
    position: sticky;
    background: #f0f0f0;
    z-index: 25;
}
.schuelerdaten-table .sd-sticky-vorname { left: 0; }
.schuelerdaten-table .sd-sticky-nachname { left: 180px; }
.schuelerdaten-table .sd-sticky-profil {
    left: 360px;
    box-shadow: 4px 0 6px rgba(0,0,0,.12);
}
.schuelerdaten-table thead .sd-sticky-vorname,
.schuelerdaten-table thead .sd-sticky-nachname,
.schuelerdaten-table thead .sd-sticky-profil { z-index: 40; }
.schuelerdaten-table > tbody > tr > td > .field:not(.profil-select) {
    width: 100%;
    min-width: 0;
}
.schuelerdaten-table .schueler-detail-cell { text-decoration: none; }
.schueler-detail-trigger { width: 100%; }
.schueler-detail-dialog {
    width: min(660px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid #bbb;
    border-radius: 10px;
    box-sizing: border-box;
    background: #fff;
    color: #000;
    text-align: left;
    box-shadow: 0 12px 40px rgba(0,0,0,.22);
}
.schueler-detail-dialog[open] { display: flex; flex-direction: column; }
.schueler-detail-dialog::backdrop { background: rgba(36,50,55,.4); }
.schueler-detail-header {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    background: #fffaf0;
    border-top: 3px solid var(--school-yellow, #F6BD32);
    border-bottom: 1px solid var(--school-yellow, #F6BD32);
}
.schueler-detail-header h2 {
    margin: 0;
    font-size: 20px;
    overflow-wrap: anywhere;
}
.schueler-detail-header h2:focus { outline: none; }
.schueler-detail-header p { margin: 6px 0 0; font-size: 14px; }
.schueler-detail-dialog .schueler-detail-close {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #000;
    font-size: 26px;
}
.schueler-detail-body { padding: 20px; min-height: 0; overflow: auto; }
.schueler-detail-section + .schueler-detail-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ccc;
}
.schueler-detail-section h3 { margin: 0 0 12px; font-size: 16px; }
.schueler-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
}
.schueler-detail-grid.single { grid-template-columns: minmax(0, 1fr); }
.schueler-detail-field { min-width: 0; }
.schueler-detail-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: bold;
}
.schueler-detail-field small { display: block; margin: -2px 0 6px; font-size: 11px; color: #555; }
.schueler-detail-dialog .field {
    width: 100%;
    min-width: 0;
    font-size: 14px;
    text-align: left;
}
.schueler-detail-dialog textarea.field { height: 76px; padding: 8px; }
.schueler-detail-dialog .app-date-control { width: 100% !important; }
.schueler-detail-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid #ccc;
}
.schueler-detail-footer span { font-size: 12px; color: #555; }
.schueler-detail-footer [data-detail-status].error { color: #c0392b; }
.schueler-detail-dialog .schueler-detail-done {
    flex-shrink: 0;
    border: 2px solid var(--av-green, #54955C);
    background: #fff;
    color: #000;
    font-size: 13px;
}
.schueler-detail-dialog button:hover,
.schueler-detail-dialog button:focus-visible {
    background: var(--av-green, #54955C);
    color: #000;
}
@media (max-width: 540px) {
    /* Auf schmalen Geräten bleibt Platz zum Erreichen der rechten Aktionen. */
    .schuelerdaten-table .sd-sticky-nachname,
    .schuelerdaten-table .sd-sticky-profil { position: static; box-shadow: none; }
    .schueler-detail-grid { grid-template-columns: minmax(0, 1fr); }
    .schueler-detail-field small[aria-hidden="true"] { display: none; }
    .schueler-detail-header, .schueler-detail-body { padding: 16px; }
    .schueler-detail-footer { padding: 12px 16px; }
}
