/* admin.css -- Stil für das Admin-Backend, abgestimmt aufs Schüler-Frontend */

/* --- Schild-Symbol auf der Login-Seite --- */
#adminLoginToggle {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 40px;
    height: 40px;
    padding: 6px;
    background: transparent;
    border: none;
    color: rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}
#adminLoginToggle:hover {
    color: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}
#adminLoginToggle:focus { outline: none; }

/* --- Admin-Login-Overlay (nutzt .popup aus popup.css) --- */
#adminLoginContainer .inputDiv { width: 100%; }
#adminLoginContainer .inputDiv span { width: 40%; }
#adminLoginContainer .inputDiv input { width: 60%; }

/* --- Admin-Hauptbereich --- */
#adminContainer {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    background: rgb(241, 241, 241);
}

/* Kopfzeile mit Titel, Navigation und Logout */
#adminHeader {
    /* überschreibt die globale header{position:fixed;height:50px}-Regel
       aus wahl.css, die sonst diesen Header verdecken würde */
    position: sticky;
    top: 0;
    left: auto;
    width: auto;
    min-width: 0;
    height: auto;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 28px;
    background: white;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
}
#adminHeaderTitle {
    font-size: 24px;
    margin: 0;
    white-space: nowrap;
}

/* Navigation */
#adminNav {
    display: flex;
    gap: 8px;
    flex: 1;
}
.adminNavItem {
    font-family: inherit;
    font-size: 16px;
    padding: 8px 18px;
    background: white;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.adminNavItem:hover { background: rgb(238, 238, 238); }
.adminNavItem.active {
    background: rgb(230, 240, 255);
    border-color: rgba(0, 80, 200, 0.5);
    font-weight: 600;
}
.adminNavItem:focus { outline: none; }

#adminLoggedInAs {
    margin: 0;
    font-size: 13px;
    text-align: right;
    line-height: 1.3;
    color: rgba(0, 0, 0, 0.7);
}
#adminLogOutButton { margin: 0; }

/* Inhaltsbereich */
#adminContent {
    padding: 28px;
    max-width: 1100px;
    margin: 0 auto;
}
.adminSection h2,
.adminPlaceholder h2 {
    font-size: 20px;
    margin: 0 0 18px 0;
}
.adminLoading,
.adminPlaceholder {
    padding: 40px;
    text-align: center;
    color: rgba(0, 0, 0, 0.55);
}

/* Wahlen-Tabelle */
.adminTable {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.06);
}
.adminTable th,
.adminTable td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    text-align: left;
}
.adminTable thead th {
    background: rgb(238, 238, 238);
    font-weight: 600;
    font-size: 14px;
}
.adminTable tbody tr:hover { background: rgb(248, 250, 252); }
.adminTable td.center,
.adminTable th.center { text-align: center; }
.adminTable tbody tr:last-child td { border-bottom: none; }

/* Aktions-Buttons je Wahl */
.actionCell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.actionCell .button,
.adminAction.button {
    margin: 0;
    display: inline-block;
    font-size: 13px;
    padding: 5px 10px;
}
/* Aktiv-Status als Link-Button */
.linkBtn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    color: rgb(0, 80, 200);
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}
.linkBtn:hover { color: rgb(0, 50, 150); }
.linkBtn:focus { outline: none; }

/* Neue Wahl */
.adminNewWahl {
    margin-top: 28px;
    padding: 18px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.06);
}
.adminNewWahl h3 { margin: 0 0 14px 0; font-size: 17px; }
.adminNewWahl label { margin-right: 16px; font-size: 15px; }
.adminNewWahl select,
.adminNewWahl input {
    font-family: inherit;
    font-size: 15px;
    padding: 4px 6px;
    border-radius: 5px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    margin-left: 4px;
}

/* --- Auswertung --- */
.auswertungHead {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.auswertungHead h2 { margin: 0; flex: 1; }
.auswertungHead .button { margin: 0; display: inline-block; }
.auswertung h3 {
    margin: 26px 0 10px 0;
    font-size: 17px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 4px;
}
.auswertung h4 { margin: 16px 0 8px 0; font-size: 15px; }
.tutorBlock {
    background: white;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 14px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.05);
}
.schuelerWahl {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 14px;
    line-height: 1.5;
}
.schuelerWahl:last-child { border-bottom: none; }
.muted { color: rgba(0, 0, 0, 0.45); }
.auswertung .adminTable { margin-bottom: 8px; max-width: 600px; }

/* --- Kursstärke: Kurse eines Fachs nebeneinander, Zelle dreizeilig --- */
.kursstaerkeTable td { vertical-align: top; text-align: center; }
.kursstaerkeTable .ksFach {
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    background: rgb(245, 245, 245);
}
.kursstaerkeTable .ksKurs { min-width: 70px; }
.ksBez { font-weight: 600; }
.ksLehrer { color: rgba(0, 0, 0, 0.6); font-size: 13px; }
.ksAnz { font-weight: 600; }

/* --- Übersicht: eine Zeile pro Schüler, Kurszellen dreizeilig --- */
.uebersichtTable td { vertical-align: top; font-size: 12px; text-align: center; }
.uebersichtTable .ueName {
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    background: rgb(245, 245, 245);
}
.uebersichtTable .ueKurs { min-width: 52px; }
.uebersichtTable .ueLk { background: rgb(230, 240, 255); }

/* --- Kursausgleich: linke Unternavigation + Inhalt --- */
.kaLayout { display: flex; gap: 24px; align-items: flex-start; }
.kaSubnav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 210px;
    flex-shrink: 0;
}
.kaSubnavItem {
    font-family: inherit;
    font-size: 15px;
    text-align: left;
    padding: 10px 14px;
    background: white;
    border: 2px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.kaSubnavItem:hover { background: rgb(240, 240, 240); }
.kaSubnavItem.active {
    background: rgb(230, 240, 255);
    border-color: rgba(0, 80, 200, 0.5);
    font-weight: 600;
}
.kaSubnavItem:focus { outline: none; }
.kaContent { flex: 1; }
.kaContent h3 { margin-top: 0; }
.kaContent h4 { margin: 22px 0 8px 0; font-size: 15px; }
.kaContent h4:first-of-type { margin-top: 16px; }

.spTwoCol { column-count: 2; column-gap: 24px; margin: 10px 0; }
.spCheckItem { break-inside: avoid; padding: 2px 0; }
.spTypBtn.active { font-weight: bold; text-decoration: underline; }

.untisTabs { display: flex; flex-direction: row; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }

/* --- Kursausgleich volle Breite --- */
.kaFull { max-width: none; }

/* --- Kurswechsel --- */
.kwFachwahl { margin-bottom: 16px; font-size: 15px; }
.kwFachwahl select { font-family: inherit; font-size: 15px; padding: 4px 8px; border-radius: 5px; border: 2px solid rgba(0,0,0,0.2); }
.kwGrid { display: flex; gap: 20px; align-items: flex-start; padding-right: 12px; }
.kwCol h4 { margin: 0 0 8px 0; }
.kwColQuelle, .kwColZiel { flex: 0 1 auto; min-width: 180px; max-width: 320px; }
.kwColSchueler { flex: 1 1 auto; min-width: 220px; }
.kwListe { display: flex; flex-direction: column; gap: 3px; }
.kwLkGruppe {
    display: flex; flex-direction: column; gap: 3px;
    padding-bottom: 8px; margin-bottom: 6px;
    border-bottom: 2px solid rgba(0,80,200,0.3);
}
.kwKursBtn, .kwSchuelerBtn {
    font-family: inherit; font-size: 14px; text-align: left;
    padding: 6px 10px; background: white;
    border: 2px solid rgba(0,0,0,0.12); border-radius: 5px; cursor: pointer;
    white-space: nowrap;
}
.kwLkGruppe .kwKursBtn { font-weight: 600; background: rgb(245,249,255); }
.kwKursBtn:hover, .kwSchuelerBtn:hover { background: rgb(240,240,240); }
.kwKursBtn.selected { background: rgb(230,240,255); border-color: rgba(0,80,200,0.6); font-weight: 600; }
/* Ampel nach Auslastung (Selektion überschreibt die Ampelfarbe). */
.kwAmpelGruen, .kwLkGruppe .kwKursBtn.kwAmpelGruen { background: rgb(224, 245, 224); border-color: rgba(40,140,40,0.4); }
.kwAmpelGelb,  .kwLkGruppe .kwKursBtn.kwAmpelGelb  { background: rgb(252, 246, 214); border-color: rgba(200,160,0,0.4); }
.kwAmpelRot,   .kwLkGruppe .kwKursBtn.kwAmpelRot   { background: rgb(250, 226, 226); border-color: rgba(200,60,60,0.4); }
/* Auswahl überschreibt jede Ampelfarbe (auch bei LK-Kursen). */
.kwListe .kwKursBtn.selected,
.kwLkGruppe .kwKursBtn.selected { background: rgb(210,230,255); border-color: rgba(0,80,200,0.7); font-weight: 600; }
.kwSchuelerBtn.selected { background: rgb(255,240,220); border-color: rgba(220,120,0,0.6); }
/* Schülerliste: ca. 15 Zeilen sichtbar, dann scrollen. */
.kwSchuelerListe {
    max-height: 495px;
    overflow-y: auto;
    padding-right: 6px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 6px;
    padding: 6px;
}
/* Verschieben-Button in eigener Spalte zwischen Schülern und Zielkurs. */
.kwColButton {
    flex: 0 0 auto;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kwVerschiebenBtn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    line-height: 1.2;
    padding: 12px 14px;
}
.kwVbPfeil { font-size: 20px; font-weight: bold; }
.kwVbZeile { white-space: nowrap; }
/* Belegungsanzeige unten: Name (zweizeilig) + Kurse nebeneinander. */
#kwWahlAnzeige { margin-top: 20px; }
.kwWahlZeile {
    display: flex; gap: 14px; align-items: baseline;
    padding: 5px 0; border-bottom: 1px solid rgba(0,0,0,0.06);
}
.kwWahlName { flex: 0 0 130px; font-weight: 600; font-size: 13px; line-height: 1.2; }
.kwWahlKurse { font-size: 13px; }

/* --- Belegung einzelner Schüler: Autocomplete --- */
.belSuche { position: relative; max-width: 360px; }
.belSuche input {
    width: 100%; font-family: inherit; font-size: 15px;
    padding: 8px 12px; border-radius: 6px;
    border: 2px solid rgba(0,0,0,0.2); box-sizing: border-box;
}
.belVorschlaege {
    display: flex; flex-direction: column;
    margin-top: 4px; border-radius: 6px; overflow: hidden;
}
.belVorschlag {
    font-family: inherit; font-size: 14px; text-align: left;
    padding: 8px 12px; background: white; border: none;
    border-bottom: 1px solid rgba(0,0,0,0.08); cursor: pointer;
}
.belVorschlag:hover { background: rgb(230,240,255); }
.belVorschlag.aktiv { background: rgb(210,230,255); font-weight: 600; }
.belLeer { padding: 8px 12px; color: rgba(0,0,0,0.5); font-size: 14px; }

/* --- Kollisionsprüfung --- */
#kollErgebnis { margin-top: 16px; }
.kollOk { color: rgb(30,130,30); font-weight: 600; }
.kollWarn { color: rgb(190,50,50); font-weight: 600; }
.kollBlock {
    padding: 8px 12px; margin-bottom: 8px;
    background: rgb(250,240,240); border-radius: 6px;
    border: 1px solid rgba(190,50,50,0.25);
}
.kollBlock ul { margin: 4px 0 0 0; padding-left: 20px; }
.kollBlock li { font-size: 14px; }

/* --- Kurslisten-Auswahl --- */
.klSchritt { margin-bottom: 18px; }
.klSchritt h4 { margin: 0 0 8px 0; }
.klSchritt label { margin-right: 16px; font-size: 14px; }
.klListe {
    display: flex; flex-direction: column; gap: 2px;
    max-height: 260px; overflow-y: auto;
    border: 1px solid rgba(0,0,0,0.1); border-radius: 6px; padding: 8px;
}
.klListe .klItem { margin-right: 0; padding: 2px 0; }
.klListe .klAlle {
    margin-right: 0; padding: 4px 0 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.12); margin-bottom: 4px;
}
#klPdf { margin-top: 4px; }

/* --- Belegbarkeit testen --- */
.belbWahl { margin-bottom: 16px; font-size: 15px; }
.belbWahl select {
    font-family: inherit; font-size: 15px; padding: 4px 8px;
    border-radius: 5px; border: 2px solid rgba(0,0,0,0.2); margin-right: 8px;
}
#belbErgebnis { margin-top: 16px; }
.belbWahlliste { font-size: 13px; color: rgba(0,0,0,0.6); }
.belbOffen { color: rgb(200,40,40); font-weight: 700; text-decoration: underline; }
