/* ================================================================
   BandoV-Website – Adminbereich
   Baut auf basis.css und panel.css auf (Karten, Listen, Knöpfe, Felder, Blasen).
   Hier nur, was der Adminbereich zusätzlich braucht: Seitenleiste mit Gruppen,
   Dialog, Auftragsleiste, Reiter, Werkzeugleisten, Verlaufskurve.
   Größen in rem (Grundschrift wächst mit der Fensterbreite): Handy bis 4K.
   ================================================================ */

.admin { width: min(96vw, 96rem); grid-template-columns: 15.5rem minmax(0, 1fr); }

/* ---------- Leiste: Serverstand ---------- */
.leiste__mitte { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: center; min-width: 0; }
.stand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text-2); font-size: 0.92rem; font-weight: 600; white-space: nowrap; }

/* ---------- Seitenleiste mit Gruppen ---------- */
.admin-nav { gap: 0.15rem; max-height: calc(100vh - 7rem); overflow-y: auto; scrollbar-width: thin; }
.admin-nav__gruppe {
    margin: 0.7rem 0.9rem 0.25rem; color: var(--grau);
    font-size: 0.74rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
}
.admin-nav__gruppe:first-child { margin-top: 0.3rem; }
.admin-nav .reiter__eintrag { min-height: 2.55rem; }

/* ---------- Werkzeugleiste über Listen ---------- */
.werkzeuge { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.werkzeuge .feld { flex: 1 1 16rem; min-width: 0; }
.suche { position: relative; flex: 1 1 18rem; min-width: 0; }
.suche .sym { position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); color: var(--grau); pointer-events: none; }
.suche input {
    width: 100%; height: 2.75rem; padding: 0 1rem 0 2.7rem;
    border: 0.07rem solid var(--linie); border-radius: var(--pille);
    background: rgba(255, 255, 255, 0.05); color: var(--weiss); font-size: 1.02rem;
}
.suche input:focus { outline: none; border-color: rgba(var(--akzent-rgb), 0.7); box-shadow: 0 0 0 0.2rem rgba(var(--akzent-rgb), 0.18); }

/* Umschalter (Online/Offline, Kanäle, Reiter im Profil) */
.wahl { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.25rem; border-radius: var(--pille); background: var(--flaeche-2); }
.wahl button {
    min-height: 2.25rem; padding: 0 0.95rem; border: 0; border-radius: var(--pille);
    background: transparent; color: var(--text-2); font-weight: 600; letter-spacing: 0.03em; cursor: pointer;
    display: inline-flex; align-items: center; gap: 0.45rem;
}
.wahl button:hover { color: var(--weiss); background: var(--flaeche-2); }
.wahl button[aria-pressed="true"] { background: var(--akzent); color: #04121F; box-shadow: 0 0.3rem 1.2rem rgba(var(--akzent-rgb), 0.3); }
.wahl em { font-style: normal; font-size: 0.8rem; opacity: 0.8; }

/* ---------- Aktionen ---------- */
.aktionen { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; align-content: flex-start; }
.aktionen__gruppe { display: grid; gap: 0.5rem; align-content: start; }
.aktionen__titel { color: var(--grau); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
.knopf[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.knopf--leise { background: transparent; }

.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 0.8rem; }
.kachel {
    display: grid; gap: 0.5rem; align-content: start;
    padding: 1.1rem 1.15rem; border-radius: var(--rund); background: var(--flaeche-2);
    border: 0; text-align: left; color: inherit;
}
button.kachel { cursor: pointer; transition: background 0.18s, box-shadow 0.18s; }
button.kachel:hover { background: var(--flaeche-3); box-shadow: inset 0 0 0 0.07rem rgba(var(--akzent-rgb), 0.3); }
.kachel b { color: var(--weiss); font-size: 1.12rem; display: flex; align-items: center; gap: 0.55rem; }
.kachel b .sym { color: var(--akzent); }
.kachel span { color: var(--text-2); font-size: 0.93rem; }
.kachel--gefahr b .sym { color: var(--rot); }

/* ---------- Profil ---------- */
.profil__kopf { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.profil__kopf .charakter__zeichen { width: 3.8rem; height: 3.8rem; font-size: 1.5rem; }
.profil__name h2 { font-size: 1.8rem; font-weight: 800; }
.profil__name .plaketten { margin-top: 0.35rem; }
.profil__ids { color: var(--grau); font-size: 0.92rem; margin-top: 0.2rem; overflow-wrap: anywhere; }

/* ---------- Tabellenartige Liste (Ressourcen, Logs) ---------- */
.zeilen { display: grid; gap: 0.35rem; }
.zeile {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.8rem; align-items: center;
    padding: 0.7rem 1rem; border-radius: var(--rund-klein); background: var(--flaeche-2);
}
.zeile b { color: var(--weiss); font-weight: 700; overflow-wrap: anywhere; }
.zeile small { display: block; color: var(--text-2); font-size: 0.88rem; overflow-wrap: anywhere; }
.zeile__rechts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.4rem; align-items: center; }
.zeile details { grid-column: 1 / -1; }
.zeile summary { cursor: pointer; color: var(--grau); font-size: 0.85rem; }
.zeile pre {
    margin: 0.4rem 0 0; padding: 0.7rem 0.85rem; border-radius: var(--rund-klein); background: rgba(0, 0, 0, 0.3);
    color: var(--text-2); font-size: 0.82rem; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 16rem; overflow: auto;
}

/* ---------- Prüfaufgaben ---------- */
.aufgabe { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.8rem; align-items: start; padding: 0.75rem 0.95rem; border-radius: var(--rund-klein); background: var(--flaeche-2); }
.aufgabe > .sym { width: 1.4rem; height: 1.4rem; margin-top: 0.1rem; color: var(--grau); }
.aufgabe--ok > .sym { color: var(--gruen); }
.aufgabe--bug > .sym { color: var(--rot); }
.aufgabe b { display: block; color: var(--weiss); font-weight: 600; }
.aufgabe small { display: block; color: var(--text-2); font-size: 0.88rem; }

/* ---------- Teamchat ---------- */
.chat .verlauf { max-height: min(58vh, 44rem); min-height: 16rem; }
.blase--eigen { justify-self: end; background: rgba(var(--akzent-rgb), 0.16); border-bottom-right-radius: 0.35rem; box-shadow: inset 0 0 0 0.07rem rgba(var(--akzent-rgb), 0.25); }
.chat__eingabe { display: flex; gap: 0.6rem; margin-top: 1rem; }
.chat__eingabe input {
    flex: 1; min-width: 0; height: 2.9rem; padding: 0 1.1rem; border: 0.07rem solid var(--linie); border-radius: var(--pille);
    background: rgba(255, 255, 255, 0.05); color: var(--weiss); font-size: 1.02rem;
}
.chat__eingabe input:focus { outline: none; border-color: rgba(var(--akzent-rgb), 0.7); }

/* ---------- Kurve (Statistik) ---------- */
.kurve { width: 100%; height: clamp(12rem, 26vh, 26rem); display: block; }
.kurve .gitter { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; }
.kurve .linie { fill: none; stroke-width: 2.4; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.kurve .linie--online { stroke: var(--akzent); }
.kurve .linie--team { stroke: var(--hell); }
.kurve .linie--tickets { stroke: var(--rot); }
.kurve .flaeche { fill: rgba(var(--akzent-rgb), 0.12); }
.legende { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--text-2); font-size: 0.9rem; margin-top: 0.6rem; }
.legende i { display: inline-block; width: 1.1rem; height: 0.25rem; border-radius: 1rem; vertical-align: middle; margin-right: 0.4rem; }
.legende .l-online { background: var(--akzent); }
.legende .l-team { background: var(--hell); }
.legende .l-tickets { background: var(--rot); }

/* ---------- Dialog ---------- */
.dialog {
    width: min(92vw, 36rem); max-height: min(90vh, 52rem); padding: 0; border: 0;
    border-radius: calc(var(--rund-gross) * 1.1);
    background: linear-gradient(160deg, #1B1B1E, #111113); color: var(--hell);
    box-shadow: inset 0 0 0 0.07rem var(--linie), var(--schatten), 0 0 4rem rgba(var(--akzent-rgb), 0.08);
}
.dialog::backdrop { background: rgba(6, 6, 8, 0.72); }
.dialog--gefahr { box-shadow: inset 0 0 0 0.07rem rgba(var(--rot-rgb), 0.45), var(--schatten); }
.dialog__form { display: grid; gap: 1rem; padding: 1.5rem 1.6rem; max-height: inherit; overflow-y: auto; }
.dialog__kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.dialog__kopf h2 { font-size: 1.55rem; font-weight: 800; margin-top: 0.2rem; }
.dialog__text { color: var(--text-2); }
.dialog__felder { display: grid; gap: 0.9rem; }
.dialog__fuss { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.6rem; }
.dialog--gefahr #dialogOk { background: var(--rot); color: var(--weiss); box-shadow: 0 0.4rem 1.6rem rgba(var(--rot-rgb), 0.35); }
.feld--schalter { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 1rem; border-radius: var(--rund-klein); background: var(--flaeche-2); }
.feld--schalter label { letter-spacing: 0.04em; text-transform: none; font-size: 1rem; color: var(--hell); }
.feld--schalter input { width: 1.4rem; height: 1.4rem; min-height: 0; accent-color: var(--akzent); }
.feld__hilfe { color: var(--grau); font-size: 0.86rem; }
.treffer { display: grid; gap: 0.35rem; max-height: 14rem; overflow-y: auto; }
.treffer button { text-align: left; }
.treffer .eintrag { padding: 0.6rem 0.85rem; }
.treffer .eintrag[aria-pressed="true"] { box-shadow: inset 0 0 0 0.1rem var(--akzent); background: rgba(var(--akzent-rgb), 0.12); }

/* ---------- Auftragsleiste ---------- */
.auftragsleiste {
    position: fixed; right: max(1rem, 2vw); bottom: max(1rem, 2vh); z-index: 70;
    display: grid; gap: 0.5rem; width: min(92vw, 25rem); pointer-events: none;
}
.auftrag {
    pointer-events: auto;
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.75rem; align-items: center;
    padding: 0.8rem 1rem; border-radius: var(--rund);
    background: #1C1C1F; box-shadow: inset 0 0 0 0.07rem var(--linie), var(--schatten);
    animation: hereinkommen 0.22s ease-out;
}
.auftrag b { display: block; color: var(--weiss); font-weight: 700; }
.auftrag span { display: block; color: var(--text-2); font-size: 0.9rem; overflow-wrap: anywhere; }
.auftrag > .sym { width: 1.5rem; height: 1.5rem; color: var(--grau); }
.auftrag--laeuft > .sym { color: var(--akzent); animation: drehen 1.2s linear infinite; }
.auftrag--erledigt { box-shadow: inset 0 0 0 0.07rem rgba(var(--akzent-rgb), 0.5), var(--schatten), var(--leuchten); }
.auftrag--erledigt > .sym { color: var(--akzent); }
.auftrag--fehler { box-shadow: inset 0 0 0 0.07rem rgba(var(--rot-rgb), 0.6), var(--schatten); }
.auftrag--fehler > .sym { color: var(--rot); }
.auftrag button { width: 2rem; min-height: 2rem; }
@keyframes hereinkommen { from { opacity: 0; transform: translateY(0.6rem); } }

/* ---------- Kleinere Bildschirme ---------- */
@media (max-width: 1200px) {
    .leiste__mitte { display: none; }
}
@media (max-width: 960px) {
    .admin { grid-template-columns: minmax(0, 1fr); }
    .admin-nav { max-height: none; overflow-y: hidden; scrollbar-width: none; }
    .admin-nav__gruppe { display: none; }
}
@media (max-width: 440px) {
    .leiste .nutzer__name { display: none; }
}
@media (max-width: 600px) {
    #zumPanel span { display: none; }
    #zumPanel { width: 2.2rem; padding: 0; }
    .nutzer__name small { display: none; }
    .leiste .nutzer__name { max-width: 9rem; }
    .zeile { grid-template-columns: 1fr; }
    .zeile__rechts { justify-content: flex-start; }
    .aufgabe { grid-template-columns: auto minmax(0, 1fr); }
    .aufgabe .aktionen { grid-column: 1 / -1; }
    .dialog__form { padding: 1.2rem 1.05rem; }
    .auftragsleiste { left: 1rem; right: 1rem; width: auto; }
}

/* ---------- Kleinteile ---------- */
.liste-punkte { margin: 0.6rem 0 0; padding-left: 1.2rem; display: grid; gap: 0.3rem; color: var(--text-2); }
.karte--innen { padding: 1rem 1.15rem; background: var(--flaeche-1); box-shadow: inset 0 0 0 0.07rem var(--linie); }
.karte--innen > summary { cursor: pointer; list-style: none; margin-bottom: 0; }
.karte--innen > summary::-webkit-details-marker { display: none; }
.karte--innen[open] > summary { margin-bottom: 0.8rem; }
.karte--innen h2 { font-size: 1.15rem; }
a.kachel { text-decoration: none; transition: background 0.18s, box-shadow 0.18s; }
a.kachel:hover { background: var(--flaeche-3); box-shadow: inset 0 0 0 0.07rem rgba(var(--akzent-rgb), 0.3); }
.eintrag .balken { margin-top: 0.4rem; max-width: 28rem; }

/* Listen mit vielen Plaketten: rechts umbrechen statt den Text zu quetschen */
.admin .eintrag__rechts { flex-wrap: wrap; justify-content: flex-end; max-width: min(28rem, 55%); }
@media (max-width: 700px) {
    .admin .eintrag { grid-template-columns: minmax(0, 1fr); }
    .admin .eintrag > .sym { display: none; }
    .admin .eintrag__rechts { justify-self: start; justify-content: flex-start; max-width: none; }
    .admin .eintrag__rechts > .sym { display: none; }
}
