/* Eigene Regeln der Anwendung; die Komponenten bringen ihr Aussehen selbst mit (Fluent UI) */
html, body, #app {
    margin: 0;
    height: 100%;
    font-family: var(--fontFamilyBase, "Segoe UI", sans-serif);
}

/* Mit Klasse davor: die Regeln von Fluent UI für Überschriften sind sonst stärker */
.content h1, .sign-in h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

.app-header {
    padding: 0 1rem;
    background: var(--colorBrandBackground, #0f6cbd);
    color: var(--colorNeutralForegroundOnBrand, white);
}

.app-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
}

.app-footer {
    padding: 0.25rem 1rem;
    font-size: 0.85rem;
    background: var(--colorNeutralBackground3, #f5f5f5);
}

.organisation {
    font: inherit;
    padding: 0.2rem 0.4rem;
}

.content {
    padding: 1rem 1.5rem;
}

.message {
    margin-bottom: 0.75rem;
}

.narrow {
    max-width: 24rem;
}

.hint {
    font-size: 0.85rem;
    color: var(--colorNeutralForeground3, #616161);
}

/* Bereiche (EditorPage): Felder in Spalten, Schaltflächen, Suche, Liste */
.fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 0.25rem 1.25rem;
    align-items: start;
    margin-bottom: 1rem;
}

/* Felder ohne Fluent-Komponente (Zahl, Uhrzeit, Auswahl, Häkchen): gleiche Anordnung wie die Fluent-Felder */
.field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0.5rem;
    font-size: var(--fontSizeBase300, 0.875rem);
}

    .field input:not([type=checkbox]), .field select {
        font: inherit;
        height: 2rem;
        padding: 0 0.5rem;
        box-sizing: border-box;
        border: 1px solid var(--colorNeutralStroke1, #d1d1d1);
        border-bottom-color: var(--colorNeutralStrokeAccessible, #616161);
        border-radius: var(--borderRadiusMedium, 4px);
        background: var(--colorNeutralBackground1, white);
        color: inherit;
    }

    /* Häkchen auf Höhe der Eingabefelder daneben (unter der Zeile der Beschriftungen) */
    .field.check {
        flex-direction: row;
        align-items: center;
        height: 2rem;
        margin-top: 1.4rem;
    }

.buttons, .search, .confirm {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.confirm {
    padding: 0.5rem 0.75rem;
    border-radius: var(--borderRadiusMedium, 4px);
    background: var(--colorStatusWarningBackground1, #fff9f5);
    border: 1px solid var(--colorStatusWarningBorder1, #fdcfb4);
}

.page {
    padding: 0 0.25rem;
}

.list tr.selected td {
    background: var(--colorBrandBackground2, #ebf3fc);
}

.list td {
    cursor: pointer;
}

/* Fehlermeldung unter einem Feld ohne Fluent-Komponente (wie die Message der Fluent-Felder) */
.field-error {
    color: var(--colorPaletteRedForeground1, #bc2f32);
    font-size: var(--fontSizeBase200, 0.75rem);
}

/* Mehrzeiliges Feld über die ganze Breite */
.field.wide {
    grid-column: 1 / -1;
}

.field textarea {
    font: inherit;
    padding: 0.35rem 0.5rem;
    box-sizing: border-box;
    border: 1px solid var(--colorNeutralStroke1, #d1d1d1);
    border-bottom-color: var(--colorNeutralStrokeAccessible, #616161);
    border-radius: var(--borderRadiusMedium, 4px);
    resize: vertical;
}

/* Liste, daneben optional der Detailbereich (unter der Liste, wenn es eng wird) */
.list-area.with-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 26rem);
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 70rem) {
    .list-area.with-detail {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Die Liste (FluentDataGrid) teilt die Breite sonst gleichmäßig auf alle Spalten auf und kürzt bei vielen Spalten jeden
   Text ab. Als gewöhnliche Tabelle richtet sich jede Spalte nach ihrem Inhalt; ist die Liste breiter als der Platz,
   scrollt sie waagerecht. */
.list-wrap {
    min-width: 0;
    overflow-x: auto;
}

.list-area .list {
    display: table !important;
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

    .list-area .list thead {
        display: table-header-group !important;
    }

    .list-area .list tbody {
        display: table-row-group !important;
    }

    .list-area .list tr {
        display: table-row !important;
    }

    .list-area .list th, .list-area .list td {
        display: table-cell !important;
        white-space: nowrap;
        padding: 0 0.75rem;
        vertical-align: middle;
    }

.content h2, .modal h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

/* Einfache Tabellen (Detailbereich, Fenster) */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fontSizeBase300, 0.875rem);
}

    .table th, .table td {
        text-align: left;
        padding: 0.35rem 0.6rem;
        border-bottom: 1px solid var(--colorNeutralStroke2, #e0e0e0);
        white-space: nowrap;
    }

    .table.selectable tbody tr {
        cursor: pointer;
    }

    .table tr.selected td {
        background: var(--colorBrandBackground2, #ebf3fc);
    }

    /* Meldungen eines Imports: lange Texte umbrechen */
    .table.import-messages td:last-child {
        white-space: normal;
    }

/* Fenster über der Seite (Modal) */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
}

.modal {
    display: flex;
    flex-direction: column;
    width: min(44rem, calc(100vw - 2rem));
    max-height: calc(100vh - 4rem);
    background: var(--colorNeutralBackground1, white);
    border-radius: var(--borderRadiusLarge, 8px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

    .modal.wide {
        width: min(84rem, calc(100vw - 2rem));
    }

    .modal header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--colorNeutralStroke2, #e0e0e0);
    }

        .modal header h2 {
            margin: 0;
        }

.modal-body {
    padding: 1rem;
    overflow: auto;
}

/* Auswahl über den Feldern eines Bereichs (z. B. Kurstyp) */
.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.5rem 1.25rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--colorNeutralStroke2, #e0e0e0);
}

    .filters .field {
        min-width: 14rem;
    }

    .filters .hint {
        padding-bottom: 0.4rem;
    }

/* Beendete Einschreibungen (abgemeldet, abgelehnt, abgelaufen) grau */
.table tr.ended td {
    color: var(--colorNeutralForeground3, #616161);
}

/* Anwesenheitsliste: Eingabefelder in der Tabelle, Termine als anklickbare Felder */
.table.attendance input:not([type=checkbox]) {
    font: inherit;
    height: 1.75rem;
    padding: 0 0.35rem;
    box-sizing: border-box;
    border: 1px solid var(--colorNeutralStroke1, #d1d1d1);
    border-radius: var(--borderRadiusMedium, 4px);
}

.table.attendance input.amount {
    width: 5rem;
}

.table.attendance input.comment {
    width: 14rem;
}

.table .session {
    text-align: center;
}

.table td.presence {
    cursor: pointer;
    min-width: 3rem;
    border-left: 1px solid var(--colorNeutralStroke2, #e0e0e0);
}

    .table td.presence.present {
        background: #d4f4d4;
    }

    .table td.presence.absent {
        background: #ffd9cc;
    }

/* Drucken (PrintService): auf dem Bildschirm unsichtbar; im Druck nur dieser Inhalt, alles andere ausgeblendet */
.print-host {
    display: none;
}

@media print {
    #app > :not(.print-host) {
        display: none !important;
    }

    .print-host {
        display: block;
    }

    @page {
        size: A4 landscape;
        margin: 12mm;
    }
}

.print-list {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 10pt;
}

    .print-list h1 {
        font-size: 14pt;
        margin: 0 0 4pt 0;
    }

    .print-list p {
        margin: 0 0 4pt 0;
    }

    .print-list table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 6pt;
    }

    .print-list th, .print-list td {
        text-align: left;
        padding: 3pt 5pt;
        border: 0.5pt solid #808080;
    }

    .print-list thead {
        display: table-header-group;
    }

    .print-list tbody tr:nth-child(even) td {
        background: #eeeeee;
    }

    .print-list .print-footer {
        margin-top: 6pt;
        font-size: 8pt;
    }

/* Anmeldung: Karte in der Mitte */
.sign-in {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--colorNeutralBackground3, #f5f5f5);
}

.sign-in-card {
    width: min(26rem, calc(100vw - 2rem));
    padding: 1.5rem;
    box-sizing: border-box;
}

.sign-in-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--colorBrandForeground1, #0f6cbd);
    margin-bottom: 0.5rem;
}

.sign-in-version {
    font-size: 0.8rem;
    color: var(--colorNeutralForeground3, #616161);
}

/* Hinweise außerhalb von Blazor (index.html, app.js): neue Version, keine Verbindung */
#update-ui, #offline-ui {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    padding: 0.5rem 1rem;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    font-size: 0.9rem;
}

#update-ui {
    top: 0;
    background: #fff4ce;
}

    #update-ui button {
        font: inherit;
        margin-left: 0.75rem;
        padding: 0.15rem 0.6rem;
        cursor: pointer;
    }

#offline-ui {
    top: 0;
    background: #fde7e9;
}

@media print {
    #update-ui, #offline-ui {
        display: none !important;
    }
}

/* Aus der Blazor-Vorlage: Ladeanzeige und Fehlerleiste */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0O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g2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "Ein Fehler ist aufgetreten."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Lädt");
    }

