/* Admin-Bereich: ergänzt app.css */
.admin-main { padding-top: 1.5rem; padding-bottom: 4rem; }
.admin-nav { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.admin-nav a, .link-knopf {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .7rem; border-radius: 8px;
  color: var(--text); text-decoration: none; font: inherit; font-size: .95rem; background: none; border: 0; cursor: pointer;
}
.admin-nav a:hover, .link-knopf:hover { background: var(--flaeche); }
.admin-nav a[aria-current="page"] { background: var(--akzent-flaeche); font-weight: 600; }
.admin-nav form { margin: 0; }
.admin .kopf .wrap { flex-wrap: wrap; padding-top: .25rem; padding-bottom: .25rem; }
.admin .kopf .theme-knopf { display: none; }

.kopfzeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.kopfzeile h1 { margin: 0; font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem); }
.knopfreihe { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.knopf.gefahr { background: #A3362A; border-color: #A3362A; color: #fff; }
.leise { color: var(--leise); }
a.gefahr, .gefahr { color: #A3362A; }
:root[data-theme="dark"] a.gefahr, :root[data-theme="dark"] .icon-knopf.gefahr { color: #F0A090; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) a.gefahr, :root:not([data-theme="light"]) .icon-knopf.gefahr { color: #F0A090; } }

.meldung { padding: .8rem 1rem; border-radius: 10px; border: 1px solid var(--akzent); background: var(--akzent-flaeche); margin: 0 0 1.25rem; }
.meldung.fehler { border-color: #A3362A; background: color-mix(in srgb, #A3362A 12%, var(--karte)); }
.hinweis-box { padding: 1rem; border: 1px dashed var(--rahmen-stark); border-radius: 10px; color: var(--leise); }

/* Formulare */
.formular { display: grid; gap: 1.25rem; max-width: 60rem; }
.feld { display: grid; gap: .35rem; margin: 0; min-width: 0; }
fieldset.feld { border: 0; padding: 0; }
.feld > label, .feld legend { font-weight: 600; padding: 0; }
.feld-reihe { display: grid; gap: 1.25rem; }
@media (min-width: 45rem) { .feld-reihe { grid-template-columns: 1fr 1fr; } }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
  width: 100%; min-height: 44px; padding: .55rem .75rem; font: inherit; color: var(--text);
  background: var(--karte); border: 1px solid var(--rahmen-stark); border-radius: 8px;
}
textarea { resize: vertical; line-height: 1.5; }
[aria-invalid="true"] { border-color: #A3362A !important; border-width: 2px !important; }
.feld-fehler { color: #A3362A; font-weight: 600; margin: 0; font-size: .92rem; }
:root[data-theme="dark"] .feld-fehler { color: #F0A090; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .feld-fehler { color: #F0A090; } }
.hilfe { font-size: .88rem; color: var(--leise); margin: 0; }
.zaehler-text.knapp { color: #A3362A; font-weight: 600; }
.praefix { display: flex; align-items: center; border: 1px solid var(--rahmen-stark); border-radius: 8px; background: var(--karte); overflow: hidden; }
.praefix span { padding: 0 .1rem 0 .75rem; color: var(--leise); white-space: nowrap; }
.praefix input { border: 0 !important; padding-left: .1rem !important; }
.praefix:focus-within { outline: 3px solid var(--fokus); outline-offset: 2px; }
.praefix input:focus-visible { outline: none; }
.optionen { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.option { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; cursor: pointer; }
.option input, .schalter input { width: 1.25rem; height: 1.25rem; accent-color: var(--akzent); }

.schalter { display: inline-flex; align-items: center; gap: .75rem; min-height: 44px; cursor: pointer; font-weight: 600; }
.schalter input { position: absolute; opacity: 0; }
.schalter-bahn { width: 3rem; height: 1.7rem; border-radius: 999px; background: var(--rahmen-stark); position: relative; flex: none; transition: background .15s; }
.schalter-bahn::after { content: ''; position: absolute; top: .2rem; left: .2rem; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgb(0 0 0 / .3); }
.schalter input:checked + .schalter-bahn { background: var(--akzent); }
.schalter input:checked + .schalter-bahn::after { transform: translateX(1.3rem); }
.schalter input:focus-visible + .schalter-bahn { outline: 3px solid var(--fokus); outline-offset: 2px; }

.editor { display: grid; gap: 1rem; }
@media (min-width: 60rem) { .editor { grid-template-columns: 1fr 1fr; } }
.editor-vorschau { border: 1px solid var(--rahmen); border-radius: 8px; padding: .75rem 1rem; background: var(--grund); min-height: 10rem; overflow: auto; max-height: 32rem; }

/* Werkzeugleiste und Tabelle */
.werkzeuge { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.werkzeuge input { flex: 1 1 16rem; width: auto; }
.werkzeuge select { width: auto; }
.tabelle { width: 100%; border-collapse: collapse; background: var(--karte); border: 1px solid var(--rahmen); border-radius: 12px; overflow: hidden; }
.tabelle th, .tabelle td { padding: .75rem; text-align: left; border-bottom: 1px solid var(--rahmen); vertical-align: top; }
.tabelle thead th { font-size: .85rem; color: var(--leise); font-weight: 600; background: var(--flaeche); }
.tabelle tbody th { font-weight: 600; }
.tabelle .slug { display: block; font-weight: 400; font-size: .82rem; color: var(--leise); }
.tabelle .aktionen { white-space: nowrap; }
.tabelle .aktionen a { display: inline-flex; min-height: 44px; align-items: center; padding: 0 .35rem; }
.status { font-size: .82rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; }
.status.an { background: var(--akzent-flaeche); color: var(--akzent); }
.status.aus { background: var(--flaeche); color: var(--leise); border: 1px dashed var(--rahmen-stark); }
@media (max-width: 50rem) {
  .tabelle thead { display: none; }
  .tabelle, .tabelle tbody, .tabelle tr, .tabelle th, .tabelle td { display: block; }
  .tabelle tr { border-bottom: 1px solid var(--rahmen); padding: .5rem 0; }
  .tabelle th, .tabelle td { border: 0; padding: .2rem .9rem; }
}

/* Abschnitte für Videos und Material */
.admin-abschnitt { max-width: 60rem; margin-top: 2rem; }
.inline-form { display: grid; gap: .35rem; margin-bottom: 1rem; }
.inline-form > label { font-weight: 600; }
.zeile { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.zeile > input { flex: 1 1 12rem; width: auto; }
.zeile.klein { font-size: .9rem; gap: .4rem .75rem; }
.zeile.klein input.kurz { flex: 0 0 6.5rem; min-height: 36px; padding: .3rem .5rem; }
input.klein { min-height: 36px !important; padding: .3rem .6rem !important; font-size: .92rem !important; }

.sortier-liste { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.sortier-liste:empty::before { content: 'Noch nichts hinzugefügt.'; color: var(--leise); font-size: .95rem; }
.sortier-liste li {
  display: flex; align-items: center; gap: .6rem; padding: .6rem; border: 1px solid var(--rahmen);
  border-radius: 10px; background: var(--karte);
}
.sortier-liste li.zieht { opacity: .45; }
.sortier-liste li.ziel { border-color: var(--akzent); border-style: dashed; }
.sortier-liste li.neu-hervor { border-color: var(--akzent); box-shadow: 0 0 0 2px var(--akzent-flaeche); }
.griff { cursor: grab; color: var(--leise); user-select: none; letter-spacing: -.2em; padding: 0 .2rem; }
.sortier-liste img { width: 96px; height: 54px; object-fit: cover; border-radius: 6px; flex: none; }
.kein-bild { width: 54px; height: 54px; display: grid; place-items: center; flex: none; color: var(--akzent); background: var(--flaeche); border-radius: 6px; }
.felder { flex: 1; min-width: 0; display: grid; gap: .35rem; }
.felder .hilfe { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sortier-knoepfe { display: flex; flex-direction: column; gap: .2rem; }
.icon-knopf {
  min-width: 40px; min-height: 40px; display: inline-grid; place-items: center; border-radius: 8px;
  border: 1px solid var(--rahmen); background: var(--karte); color: var(--text); font: inherit; cursor: pointer;
}
.icon-knopf:hover:not(:disabled) { border-color: var(--rahmen-stark); background: var(--flaeche); }
.icon-knopf:disabled { opacity: .4; cursor: not-allowed; }
.sortier-knoepfe .icon-knopf { min-height: 30px; }
@media (max-width: 40rem) {
  .griff, .sortier-liste img { display: none; }
  .sortier-liste li { align-items: flex-start; }
}

.dropzone {
  border: 2px dashed var(--rahmen-stark); border-radius: 12px; padding: 1.25rem; text-align: center; margin-bottom: 1rem;
  display: grid; justify-items: center; gap: .5rem;
}
.dropzone p { margin: 0; }
.dropzone.aktiv { border-color: var(--akzent); background: var(--akzent-flaeche); }
.dropzone label.knopf { cursor: pointer; }
.dropzone label.knopf:focus-within { outline: 3px solid var(--fokus); outline-offset: 2px; }

/* Kategorien */
.kat-liste { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: .75rem; }
.kat-liste li { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; padding: 1rem; border: 1px solid var(--rahmen); border-radius: 12px; background: var(--karte); }
.kat-vorschau { width: 3.5rem; height: 3.5rem; border-radius: 10px; display: grid; place-items: center; background: var(--k-bg); color: var(--k-fg); flex: none; }
.kat-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; flex: 1 1 30rem; }
.kat-form .feld { flex: 1 1 10rem; }
.kat-form .feld label { font-size: .85rem; }
.kat-liste li.ausgeblendet { border-style: dashed; background: transparent; }
.kat-liste li.ausgeblendet .kat-vorschau { opacity: .45; }
.kat-form .schalter { font-weight: 500; font-size: .92rem; }
.einstellung-form { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.kat-aktionen { display: flex; align-items: center; gap: .4rem; }
.kat-aktionen form { margin: 0; }
.kat-aktionen .leise { font-size: .88rem; margin-right: .5rem; }

.einfach-liste { list-style: none; padding: 0; display: grid; gap: .5rem; }
.einfach-liste li { display: flex; flex-wrap: wrap; gap: .25rem 1rem; padding: .9rem 1rem; border: 1px solid var(--rahmen); border-radius: 10px; background: var(--karte); }

.login { max-width: 24rem; margin: 3rem auto; }
.live { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 20; }
.live:not(:empty) { background: var(--text); color: var(--grund); padding: .65rem 1.1rem; border-radius: 10px; box-shadow: 0 4px 16px rgb(0 0 0 / .2); max-width: calc(100vw - 2rem); }
