/*
 * pw-admin.css – gemeinsame Oberfläche der Plugin-Seiten im Admin (Team, Blog).
 * Ergänzt das Stylesheet der Website: Knöpfe, Container und Hinweise kommen von
 * dort (btn, container, legal__hint), damit alles in den Farben des Kunden
 * erscheint. Eigene Farben nur als Rückfall über die Variablen des Templates.
 */

.pw-admin { max-width: 1100px; }
.pw-admin h1 { margin-top: 0; }
.pw-einleitung { max-width: 62ch; }
.pw-hilfe { margin: .35rem 0 0; font-size: .88rem; color: var(--color-muted, #64748b); }
.pw-meldung { margin: 0 0 1.25rem; }
.pw-meldung--fehler { border-color: #dc2626; }
.pw-zurueck { margin: 0 0 .75rem; font-size: .95rem; }
.pw-stand { color: var(--color-muted, #64748b); font-size: .95rem; }
.pw-pflicht { color: #dc2626; }
.pw-marke {
  display: inline-block;
  margin-top: .2rem;
  padding: .1rem .5rem;
  border-radius: 999px;
  background: var(--color-surface-2, #e2e8f0);
  color: var(--color-text, #334155);
  font-size: .75rem;
  font-weight: 600;
}
.pw-marke--gruen { background: #dcfce7; color: #166534; }
.pw-marke--blau { background: #dbeafe; color: #1e40af; }
.pw-marke--grau { background: #f1f5f9; color: #475569; }

.pw-kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 1rem;
}
.pw-kopf__knoepfe,
.pw-knoepfe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
}
.pw-knoepfe { margin-top: 1.5rem; }
.pw-knoepfe form { margin: 0; }

/* Karten (Team) */
.pw-karten {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: .9rem;
  margin: 1.25rem 0 2rem;
  padding: 0;
  list-style: none;
}
.pw-karten > li::before { content: none; }
.pw-karte {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: .9rem;
  align-items: start;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 12px;
  background: var(--color-bg, #fff);
}
.pw-karte--aus { opacity: .6; background: var(--color-surface, #f8fafc); }
.pw-karte__text .pw-marke { align-self: flex-start; }

/* „Website pflegen“: Leiste mit Kategorien als Aufklappmenü, Kacheln der Übersicht */
.pw-unternav {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin: 0 0 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}
.pw-unternav > a,
.pw-kat > summary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 42px;
  padding: .45rem 1rem;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
  background: var(--color-bg, #fff);
  color: var(--color-text, #0f172a);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.pw-kat > summary { list-style: none; }
.pw-kat > summary::-webkit-details-marker { display: none; }
.pw-kat > summary::after {   /* Pfeil */
  content: "";
  width: .42rem;
  height: .42rem;
  margin-left: .1rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: .65;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .15s ease;
}
.pw-kat[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.pw-unternav > a:hover, .pw-kat > summary:hover { border-color: var(--color-primary, #2563eb); }
.pw-unternav > a:focus-visible, .pw-kat > summary:focus-visible { outline: 3px solid var(--color-primary, #2563eb); outline-offset: 2px; }
.pw-unternav > a[aria-current],
.pw-kat--aktiv > summary { background: var(--color-primary, #2563eb); border-color: var(--color-primary, #2563eb); color: #fff; }
.pw-kat__jetzt { font-weight: 400; }
.pw-kat__jetzt::before { content: "›"; margin-right: .45rem; opacity: .7; }
.pw-kat { position: relative; }
.pw-kat__menue {
  position: absolute;
  z-index: 40;
  top: calc(100% + .4rem);
  left: 0;
  width: 340px;
  padding: .4rem;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 12px;
  background: var(--color-bg, #fff);
  box-shadow: 0 18px 44px rgba(15, 23, 42, .16);
}
.pw-kat:last-of-type .pw-kat__menue { left: auto; right: 0; }
.pw-kat__menue a {
  display: block;
  padding: .6rem .75rem;
  border-radius: 8px;
  color: var(--color-text, #0f172a);
  text-decoration: none;
}
.pw-kat__menue a + a { margin-top: .1rem; }
.pw-kat__menue a:hover, .pw-kat__menue a:focus-visible { background: var(--color-surface, #f1f5f9); outline: none; }
.pw-kat__menue a[aria-current] { background: var(--color-surface, #f1f5f9); box-shadow: inset 3px 0 0 var(--color-primary, #2563eb); }
.pw-kat__menue strong { display: block; font-size: .96rem; }
.pw-kat__menue span { display: block; margin-top: .1rem; color: var(--color-muted, #64748b); font-size: .86rem; line-height: 1.4; }
/* Nur eine Kategorie sichtbar (eingeschränkter Zugang): Punkte direkt in der Leiste */
.pw-unternav--flach > a { font-weight: 500; }
.pw-unternav__start { font-weight: 500; }
.pw-angemeldet { margin: 0 0 .75rem; color: var(--color-muted, #64748b); font-size: .9rem; text-align: right; }
/* Zugänge: Rechte */
.pw-rechte { border: 0; padding: 0; margin-left: 0; margin-right: 0; }
.pw-rechte__einzeln { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .1rem 1rem; margin-top: .5rem; }
.pw-rechte:has(input[name="alles"]:checked) .pw-rechte__einzeln { opacity: .45; pointer-events: none; }
/* Filter (Protokoll) */
.pw-filter { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 1rem; }
.pw-filter a { padding: .3rem .7rem; border-radius: 999px; background: var(--color-surface, #f1f5f9); color: var(--color-text, #0f172a); font-size: .9rem; text-decoration: none; }
.pw-filter a[aria-current] { background: var(--color-heading, #0f172a); color: #fff; }
.pw-kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
  padding: 0;
  list-style: none;
}
.pw-kacheln > li::before { content: none; }
.pw-kachel {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  height: 100%;
  padding: 1.25rem;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 12px;
  background: var(--color-bg, #fff);
  color: var(--color-text, #0f172a);
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pw-kachel:hover, .pw-kachel:focus-visible { border-color: var(--color-primary, #2563eb); box-shadow: 0 6px 20px rgba(15, 23, 42, .08); }
.pw-kachel strong { font-size: 1.1rem; }
.pw-kachel span { color: var(--color-muted, #64748b); font-size: .93rem; }
.pw-kachel .pw-kachel__status { margin-top: auto; padding-top: .5rem; color: var(--color-primary, #2563eb); font-weight: 600; }
/* Übersicht: Kacheln je Kategorie */
.pw-gruppe { margin-top: 2rem; }
.pw-gruppe__kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--color-border, #e2e8f0); }
.pw-gruppe__kopf h2 { margin: 0; font-size: 1.3rem; }
.pw-gruppe__kopf p { margin: 0; color: var(--color-muted, #64748b); font-size: .93rem; }
.pw-gruppe .pw-kacheln { margin-top: 1rem; }

/* Listen mit Text statt Foto (FAQ, Downloads …): eine Spalte, volle Breite */
.pw-karten--breit { grid-template-columns: 1fr; }
.pw-karte--ohne-bild { grid-template-columns: minmax(0, 1fr); }
.pw-karte__bild {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}
.pw-karte__bild--leer,
.pw-foto__leer {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-2, #e2e8f0);
  color: var(--color-heading, #0f172a);
  font-weight: 700;
}
.pw-karte__text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.pw-karte__text strong { overflow-wrap: anywhere; }
.pw-karte__text span { color: var(--color-muted, #64748b); font-size: .92rem; }
.pw-karte__knoepfe {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
}
.pw-karte__knoepfe form { display: contents; }
.pw-pfeil { min-width: 2.4rem; }
.pw-entfernen { margin-left: auto; font-size: .9rem; color: #b91c1c; }

/* Formulare */
.pw-formular { max-width: 720px; }
.pw-feld { margin: 0 0 1.25rem; }
.pw-feld__label { display: block; margin-bottom: .35rem; font-weight: 600; }
.pw-formular input[type="text"],
.pw-formular input[type="date"],
.pw-formular input[type="time"],
.pw-formular input[type="url"],
.pw-formular input[type="email"],
.pw-formular input[type="tel"],
.pw-formular input[type="number"],
.pw-formular input[type="password"],
.pw-formular textarea,
.pw-formular select {
  box-sizing: border-box;
  width: 100%;
  padding: .65rem .8rem;
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 8px;
  background: #fff;
  color: var(--color-text, #0f172a);
  font: inherit;
}
.pw-formular textarea { resize: vertical; }
.pw-formular input:focus,
.pw-formular textarea:focus,
.pw-formular select:focus { outline: 2px solid var(--color-primary, #2563eb); outline-offset: 1px; }
.pw-haken { display: flex; align-items: flex-start; gap: .5rem; margin-top: .5rem; cursor: pointer; }
.pw-haken input { margin-top: .25rem; }
.pw-foto { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.pw-foto__bild,
.pw-foto__leer { width: 120px; height: 120px; border-radius: 12px; object-fit: cover; font-size: 1.6rem; }
.pw-foto > div { flex: 1 1 240px; }
.pw-foto > .pw-foto__leer { flex: 0 0 120px; }

.pw-mehr {
  margin: 1rem 0 0;
  padding: .9rem 1.1rem;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
}
.pw-mehr summary { cursor: pointer; font-weight: 600; }
.pw-staende { margin: .75rem 0; padding: 0; list-style: none; }
.pw-staende li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}
.pw-staende li::before { content: none; }
.pw-staende form { margin: 0; }

/* Tabellen (Blog) */
.pw-tabelle-rahmen { overflow-x: auto; }
.pw-tabelle { width: 100%; border-collapse: collapse; font-size: .95rem; }
.pw-tabelle th,
.pw-tabelle td {
  padding: .7rem .75rem;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  text-align: left;
  vertical-align: middle;
}
.pw-tabelle th { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: var(--color-muted, #64748b); }
.pw-tabelle td:last-child { text-align: right; white-space: nowrap; }
.pw-tabelle img { display: block; width: 88px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--color-surface-2, #e2e8f0); }
.pw-kasten {
  margin: 0 0 1.5rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 14px;
  background: var(--color-surface, #f8fafc);
}
.pw-kasten h2 { margin-top: 0; font-size: 1.2rem; }
.pw-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 1.5rem; }
.pw-wahl { display: grid; gap: .5rem; }
.pw-wahl label {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .7rem .8rem;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.pw-wahl label:has(input:checked) { border-color: var(--color-primary, #2563eb); box-shadow: 0 0 0 1px var(--color-primary, #2563eb); }
.pw-wahl input { margin-top: .25rem; }
.pw-wahl small { display: block; color: var(--color-muted, #64748b); }
.pw-zaehler { float: right; font-size: .8rem; font-weight: 400; color: var(--color-muted, #64748b); }

.pw-admin .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 760px) {
  /* Menü unter der ganzen Leiste, volle Breite */
  .pw-kat { position: static; }
  .pw-kat__menue, .pw-kat:last-of-type .pw-kat__menue { left: 0; right: 0; width: auto; }
  .pw-kat__jetzt { display: none; }
  .pw-unternav > a, .pw-kat > summary { padding-inline: .8rem; }
  .pw-karten { grid-template-columns: 1fr; }
  .pw-tabelle thead { display: none; }
  .pw-tabelle tr { display: block; padding: .5rem 0; border-bottom: 1px solid var(--color-border, #e2e8f0); }
  .pw-tabelle td { display: block; padding: .25rem 0; border: 0; }
  .pw-tabelle td:last-child { text-align: left; }
}
