/* ===================================================================== */
/* Lausitz Admin — Steuerzentrale                                          */
/*                                                                         */
/* Farben, Schrift, Knoepfe und Formularelemente kommen aus              */
/* serboflix-controls.css (Sorbflix-Design der oeffentlichen Seite).      */
/* Layout: TopBar mit Suche + Tabs + Sidebar-Filter + Card-Grid.          */
/* ===================================================================== */

:root {
  /* Farb- und Schrift-Tokens: serboflix-controls.css (gemeinsam mit dem Studio) */
  --gutter: clamp(20px, 4vw, 40px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0; min-height: 100%; background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.eyebrow {
  margin: 0; color: var(--muted);
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
}

/* ================ RAHMEN ================ */
/* Kopf (header.topbar), untere Leiste (nav.bottom-bar) und Tokens kommen aus /styles.css (wie Sorbflix und Studio).
   Hier nur die Bereichslinks im Kopf und die Seitenabstaende. Der Admin ist nur deutsch: keine Sprachwahl. */
.admin-primary { background: none; border: 0; color: var(--text-2); font: inherit; font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.admin-primary:hover { color: var(--text-hi); }
.bottom-bar .bbtn { text-decoration: none; }

/* ================ WERKZEUGZEILE (unter dem Kopf) ================ */
.admin-tools {
  display: flex; align-items: center; gap: 18px;
  padding: 18px var(--gutter) 4px;
}
.admin-tools-title {
  margin: 0; flex: none;
  font-family: var(--display); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.01em;
  white-space: nowrap;
}
.topbar-search {
  flex: 1; max-width: 520px; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.topbar-search:focus-within { border-color: var(--accent); background: var(--tint-1); }
.topbar-search svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.topbar-search input {
  flex: 1; min-width: 0; min-height: 0; padding: 0; border: 0; background: transparent; outline: none;
  color: var(--text); font-size: 0.92rem;
}
.topbar-actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.topbar-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 999px;
  background: transparent; border: 1px solid var(--line-strong);
  color: var(--muted); text-decoration: none; font-size: 0.86rem;
  transition: color 0.14s ease, border-color 0.14s ease;
}
.topbar-link:hover { color: var(--text); border-color: var(--tint-5); }
/* .btn-primary, .btn-ghost, .btn-danger: serboflix-controls.css */

/* ================ TABS ================ */
/* Pillen wie die Reiter des Studios. Breite Fenster: umbrechen statt unsichtbar rechts ausserhalb;
   schmal (Touch): eine Zeile, seitlich wischen (der angeschnittene Reiter am Rand zeigt, dass es weitergeht). */
.admin-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 14px var(--gutter) 16px;
  border-bottom: 1px solid var(--line);
}
.admin-tabs::-webkit-scrollbar { display: none; }
/* Breit: Reiter bleiben unter dem Sorbflix-Kopf stehen (lange Listen), am Handy scrollen sie mit */
@media (min-width: 981px) {
  .admin-tabs { position: sticky; top: var(--header-h); z-index: 40; background: var(--bar-bg-strong); }
}
@media (max-width: 980px) {
  .admin-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
}
.admin-tabs button {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: transparent; border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--text);
  font-size: 14px; font-weight: 600; line-height: 1.3;
  white-space: nowrap;
  transition: color 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}
.admin-tabs button:hover { border-color: var(--tint-5); }
.admin-tabs button.active { background: var(--btn-solid-bg); color: var(--btn-solid-ink); border-color: var(--btn-solid-bg); font-weight: 700; }
.admin-tabs button .tab-count {
  display: inline-block;
  margin-left: 0; padding: 1px 8px;
  border-radius: 999px;
  background: var(--tint-2);
  color: var(--muted);
  font-size: 0.72rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.admin-tabs button.active .tab-count { background: color-mix(in srgb, currentColor 20%, transparent); color: inherit; }

/* ================ MAIN SHELL ================ */
.admin-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
}
.admin-sidebar {
  border-right: 1px solid var(--line);
  padding: 28px var(--gutter) 60px 24px;
  display: grid; gap: 22px;
  align-content: start;
  min-height: calc(100vh - 260px);
}
.admin-sidebar h4 {
  margin: 0; font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
  font-weight: 600;
}
.filter-group { display: grid; gap: 8px; }
/* Bug-Reports: die Gruppen tragen eigene Ueberschriften (Tags, Prioritaet); Zielgruppe und Status gibt es dort nicht. */
.admin-sidebar.is-bugs .filter-group > h4, .admin-sidebar.is-bugs .fg-audience, .admin-sidebar.is-bugs .fg-status { display: none; }
/* .filter-pill (Chip) kommt aus serboflix-controls.css; in der Seitenleiste als volle Zeile. */
.admin-sidebar .filter-pill {
  display: flex; width: 100%; justify-content: space-between;
  min-height: 36px; padding: 8px 12px;
  border-color: transparent; border-radius: 8px;
  font-size: 0.88rem; text-align: left;
}
.admin-sidebar .filter-pill:hover:not(:disabled, .active) { background: var(--tint-1); border-color: transparent; }
.admin-sidebar .filter-pill.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.filter-pill .count {
  font-variant-numeric: tabular-nums;
  color: var(--muted); font-size: 0.78rem;
}
.filter-reset {
  margin-top: 8px;
  padding: 8px 12px; border-radius: 10px;
  background: transparent; border: 1px solid var(--line);
  color: var(--muted); font-size: 0.84rem;
  width: 100%; text-align: center;
}
.filter-reset:hover { color: var(--text); border-color: var(--line-strong); }

/* ================ CONTENT AREA ================ */
.admin-content {
  padding: 28px var(--gutter) 80px;
}
.content-head {
  display: flex; justify-content: space-between; align-items: end;
  gap: 14px;
  margin-bottom: 22px;
}
.content-head h2 {
  margin: 0;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.5rem, 2.4vw, 2.2rem);
  letter-spacing: -0.02em;
}
.content-head .result-count { color: var(--muted); font-size: 0.86rem; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.card-grid.is-empty {
  display: block;
  padding: 80px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
}
.card-grid.is-empty p { margin: 0 0 6px; font-size: 0.95rem; }
.card-grid.is-empty .hint { font-size: 0.82rem; color: var(--muted); }

.item-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.item-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card);
}
.item-card .poster {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  overflow: hidden;
}
.item-card[data-kind="audio"] .poster { aspect-ratio: 1 / 1; }
.item-card[data-kind="ebook"] .poster { aspect-ratio: 9 / 12; }
.item-card .poster img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.item-card .poster-fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--display); font-size: 3rem; font-weight: 700;
  color: var(--tint-5);
}
.item-card .badges {
  position: absolute; top: 8px; left: 8px;
  display: flex; gap: 4px;
}
.item-card .badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.7); color: #fff;
  font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase;
}
.item-card .badge.tier-rental { background: rgba(245,158,11,0.85); color: #000; }
.item-card .badge.tier-plan { background: rgba(76,217,123,0.85); color: #000; }
.item-card .badge.tier-registered { background: rgba(77,119,214,0.85); color: #fff; }
.item-card .badge.tier-public { display: none; }
.item-card .badge.featured { background: var(--accent); color: var(--accent-ink); }
.item-card .badge.draft { background: rgba(120,126,140,0.85); color: #fff; }
.save-note { color: var(--ok); margin-left: 12px; }
.item-card .meta {
  padding: 12px 14px 14px;
  display: grid; gap: 4px;
}
.item-card .meta-row {
  display: flex; gap: 6px; align-items: center;
  font-size: 0.72rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.item-card .meta-row .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.5; }
.item-card .title {
  margin: 2px 0 0;
  font-family: var(--display); font-weight: 700;
  font-size: 1rem; line-height: 1.2;
  color: var(--text);
  overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.item-card .tagline {
  margin: 0; color: var(--muted);
  font-size: 0.82rem; line-height: 1.4;
  overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* ================ EDITOR DRAWER ================ */
.editor-backdrop {
  position: fixed; inset: 0; z-index: 120; /* ueber Kopf (50) und unterer Leiste (85) */
  display: grid; place-items: stretch end;
  background: var(--scrim-soft);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.editor-drawer {
  width: min(680px, 100%); height: 100%;
  overflow-y: auto;
  background: var(--bg);
  border-left: 1px solid var(--line);
  animation: slideIn 0.22s ease;
}
@keyframes slideIn { from { transform: translateX(40px); opacity: 0 } to { transform: none; opacity: 1 } }
.editor-topbar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 16px;
  padding: 16px 24px;
  background: var(--bar-bg-strong);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
.editor-topbar .eyebrow-stack { flex: 1; }
.editor-topbar h3 {
  margin: 2px 0 0;
  font-family: var(--display); font-weight: 700;
  font-size: 1.15rem;
}
.editor-topbar .draft-badge {
  padding: 3px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn);
  font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase;
}
.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 16px; height: 16px; }

.editor-form {
  padding: 24px;
  display: grid; gap: 16px;
}
/* Checkbox- und Auswahlzeilen sind ebenfalls label, aber kein Raster (sonst Kaestchen ueber Text). */
.editor-form label:not(.checkbox-row, .choice-card) {
  display: grid; gap: 6px;
  color: var(--muted);
  font-size: 0.8rem; letter-spacing: 0.02em;
}
.editor-form label:not(.checkbox-row, .choice-card) > span:first-child { font-weight: 600; }
/* Feldstil (Rahmen, Fokus, Pfeil): serboflix-controls.css */
.editor-form input:not([type="checkbox"], [type="radio"], [type="file"], [type="color"]),
.editor-form textarea,
.editor-form select { width: 100%; }
.editor-form textarea { min-height: 80px; }
.editor-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
/* .checkbox-row: serboflix-controls.css */
.editor-actions {
  position: sticky; bottom: 0;
  display: flex; gap: 10px;
  padding: 16px 24px;
  margin: 12px -24px -24px;
  background: var(--bar-bg-strong);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  /* Rechts Platz fuer den schwebenden Feedback-Knopf (debug-widget.js: 48px, 20px vom Rand) */
  padding-right: 84px;
}
.editor-actions .btn-primary { flex: 1; justify-content: center; }
.field-hint { margin: 0; font-size: 0.8rem; line-height: 1.45; color: var(--muted); }
/* Einleitende Hinweise ueber Filterleiste bzw. Baum: Abstand nach unten */
.admin-content section > .field-hint:first-child, .cat-tree-wrap > .field-hint { margin-bottom: 12px; }
/* Nur im Editor-Raster direkt unter das vorige Feld ziehen. */
.editor-form > .field-hint { margin-top: -8px; }
.field-hint.is-success { color: var(--ok); }
.field-hint.is-error { color: var(--danger); }

/* ================ ASSET DROPZONE ================ */
.asset-drop {
  display: grid; place-items: center;
  padding: 28px 20px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: var(--inset);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.asset-drop:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.asset-drop:hover, .asset-drop.is-drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.asset-drop.is-uploading { pointer-events: none; opacity: 0.7; }
.asset-drop.is-uploading::after {
  content: 'Lädt…'; margin-left: 8px; color: var(--accent); font-weight: 600;
}
.asset-drop-label { margin: 0; font-size: 0.88rem; color: var(--muted); text-align: center; }
.asset-list { display: grid; gap: 6px; margin-top: 10px; }
.asset-list:empty { display: none; }
.asset-row {
  display: grid; grid-template-columns: auto 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--inset);
  font-size: 0.85rem;
}
.asset-row .asset-kind {
  padding: 2px 8px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent);
}
.asset-row .asset-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-row .asset-size { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.75rem; }
/* .asset-unlink (Entfernen, Loeschen, Sperren): serboflix-controls.css */

/* ================ PLAN PICKER ================ */
.plan-picker > span { display: block; margin-bottom: 6px; }
.plan-picker-list {
  display: grid; gap: 2px;
  padding: 6px;
  border: 1px solid var(--line); border-radius: 8px;
  max-height: 180px; overflow-y: auto;
  background: var(--inset);
}
.plan-row {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 10px;
  padding: 8px 10px;
  cursor: pointer; border-radius: 6px;
}
.plan-row:hover { background: var(--tint-1); }
.plan-row-name { font-size: 0.92rem; color: var(--text); }
.plan-row-meta {
  font-size: 0.68rem; color: var(--muted);
  letter-spacing: 0.06em; text-transform: uppercase;
}

/* ================ RESPONSIVE ================ */
/* Tabs ohne Katalog-Filter (Live, Kategorien, Uebersetzungen ...): ganze Breite fuer den Inhalt. */
.admin-shell.no-sidebar { grid-template-columns: minmax(0, 1fr); }
.admin-shell.no-sidebar .admin-sidebar { display: none; }
.admin-content { min-width: 0; }
@media (max-width: 980px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-sidebar { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; padding: 18px var(--gutter); }
  .admin-tools { flex-wrap: wrap; }
  .topbar-search { max-width: none; }
}
@media (max-width: 640px) {
  .admin-tools { gap: 10px; padding: 14px 16px 2px; }
  .admin-tools-title { font-size: 1.1rem; }
  .topbar-search { order: 3; flex: 1 0 100%; }
  .topbar-actions .topbar-link { display: none; }
  /* Platz fuer die untere Leiste (Sorbflix-Rahmen) */
  .admin-content { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .editor-form { padding: 18px; }
  .editor-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   BUG-REPORTS TAB
   ============================================================ */
.bug-filters {
  display: flex; gap: 10px; align-items: center;
  padding-bottom: 14px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.bug-filters { flex-wrap: wrap; }
.bug-list {
  display: grid; gap: 4px;
  max-height: calc(100vh - 240px); overflow-y: auto;
}
.bug-row {
  display: grid;
  grid-template-columns: 120px 80px 80px 1fr auto 160px;
  align-items: center; gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left; cursor: pointer; font-family: inherit;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.bug-row:hover { background: var(--surface-2); border-color: var(--line-strong); }
.bug-cell { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bug-date { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.bug-snippet { color: var(--text); }
.bug-user { color: var(--muted); font-size: 12px; text-align: right; }
.bug-pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: #1a1d23;
}
.bug-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.bug-tag {
  display: inline-block; padding: 2px 8px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; font-size: 10px; font-weight: 600;
}
.bug-empty { padding: 32px 12px; text-align: center; color: var(--muted); font-size: 14px; }

.bug-detail {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(520px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--line-strong);
  box-shadow: var(--shadow-pop, 0 30px 60px -20px rgba(0,0,0,0.7));
  overflow-y: auto;
  z-index: 125;
  animation: bugSlide 0.18s ease;
}
@keyframes bugSlide { from { transform: translateX(20px); opacity: 0 } to { transform: none; opacity: 1 } }
.bug-detail-head {
  position: sticky; top: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.bug-detail-head h3 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.bug-detail-close {
  width: 32px; height: 32px;
  border: 0; background: transparent; color: var(--muted);
  font-size: 1.5rem; cursor: pointer; border-radius: 50%;
}
.bug-detail-close:hover { background: var(--surface-2); color: var(--text); }
.bug-detail-body { padding: 18px 20px 24px; }
.bug-detail-comment {
  margin: 0 0 14px;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 14px; line-height: 1.5;
  white-space: pre-wrap;
}
.bug-detail-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.bug-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 16px;
}
.bug-detail-grid label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.bug-detail-grid select { width: 100%; text-transform: none; letter-spacing: 0; font-weight: 400; }
.bug-detail-meta {
  display: grid; grid-template-columns: 100px 1fr; gap: 4px 12px;
  font-size: 12px; margin: 0 0 18px;
}
.bug-detail-meta dt { color: var(--muted); font-weight: 600; }
.bug-detail-meta dd { margin: 0; color: var(--text); word-break: break-word; }
.bug-detail-meta code { font-family: var(--mono, monospace); font-size: 11px; }
.bug-ua { display: block; max-height: 60px; overflow-y: auto; }
.bug-detail-section { margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.bug-detail-section summary { padding: 0 14px; font-size: 13px; }
.bug-detail-section[open] summary { border-bottom: 1px solid var(--line); }
.bug-console { width: 100%; font-family: var(--mono, monospace); font-size: 11px; border-collapse: collapse; }
.bug-console th, .bug-console td { padding: 6px 10px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.bug-console th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 10px; }
.bug-console-error td { color: var(--danger); }
.bug-console-warn td { color: var(--warn); }
.bug-snapshot { padding: 12px; font-family: var(--mono, monospace); font-size: 11px; overflow-x: auto; max-height: 320px; margin: 0; }
.bug-screenshot-link { display: block; padding: 12px; }
.bug-screenshot {
  width: 100%; height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: zoom-in;
  transition: opacity 0.14s ease;
}
.bug-screenshot:hover { opacity: 0.9; }

/* Bunny Stream: Upload-Box, Fortschritt, Badge */
.bunny-drop { display: grid; gap: 8px; margin-top: 4px; }
.bunny-drop[hidden] { display: none; }
.bunny-drop-title { font-size: 0.8rem; color: var(--muted); }
.bunny-drop.is-uploading #bunnyDropZone { pointer-events: none; opacity: 0.7; }
.drop-progress { display: grid; gap: 4px; }
.drop-progress[hidden] { display: none; }
.drop-progress-track { height: 6px; border-radius: 3px; background: var(--tint-3); overflow: hidden; }
.drop-progress-bar { height: 100%; width: 0; background: var(--red); transition: width 0.3s ease; }
.drop-progress-text { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.badge-bunny {
  display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.asset-row { grid-template-columns: auto 1fr auto auto; }
.asset-row .asset-actions { display: inline-flex; gap: 6px; align-items: center; }
.asset-row .asset-sync {
  padding: 4px 10px; border-radius: 6px;
  background: var(--accent-soft); border: 1px solid var(--line);
  color: var(--accent); font-size: 0.74rem; cursor: pointer;
}
.asset-row .asset-sync:disabled { opacity: 0.6; cursor: default; }
.asset-sync-note { margin-left: 8px; font-size: 0.75rem; color: var(--muted); }
.asset-sync-note.is-error { color: var(--danger); }
.item-card .badge.part { background: rgba(120,126,140,0.85); color: #fff; }

/* ================ TEILE (Editor) ================ */
.parts-section { display: grid; gap: 8px; }
.parts-section[hidden] { display: none; }
.parts-section h4 { margin: 0; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.parts-list { display: grid; gap: 4px; }
.part-row {
  display: grid; grid-template-columns: 36px 1fr auto auto; gap: 12px; align-items: center;
  padding: 8px 12px; text-align: left; font-family: inherit; font-size: 0.85rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: var(--inset); color: var(--text);
}
.part-row:hover { background: var(--surface-2); }
.part-seq { color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 700; }
.part-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part-dur { color: var(--muted); font-size: 0.75rem; }
.part-status { font-size: 0.72rem; color: var(--muted); }
.part-status.is-draft { color: var(--warn); }
#partAdd { justify-self: start; }
/* Beispielbilder (Editor): Vorschau mit echtem Seitenverhaeltnis, Bildzeile, Reihenfolge, Loeschen */
.shot-row { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--inset); }
.shot-row input { flex: 1; min-width: 0; }
#shotAdd { justify-self: start; }

/* ================ PODCASTS ================ */
.podcast-form { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 8px; }
.podcast-form-field { flex: 1; display: grid; gap: 4px; font-size: 0.85rem; }
.podcast-list { display: grid; gap: 6px; margin-top: 8px; }
.podcast-row {
  display: flex; gap: 12px; justify-content: space-between; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.podcast-main { display: grid; gap: 2px; min-width: 0; }
.podcast-feed, .podcast-meta { font-size: 0.78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podcast-error { font-size: 0.78rem; color: var(--danger); }
.podcast-actions { display: flex; gap: 6px; flex-shrink: 0; }
/* ================ PROFILE (Provider) ================ */
.provider-create { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.provider-create .podcast-form-field { flex: 1 1 160px; }
.provider-create input, .provider-create select { width: 100%; }
.provider-table-wrap { overflow-x: auto; margin-top: 8px; }
.provider-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.provider-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.provider-table tbody tr:hover td { background: var(--tint-1); }
.provider-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.provider-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; font-weight: 600; color: var(--muted); }
/* Profil-Drawer: Akzentfarbe und Bildergalerie */
.provider-accent { display: flex; flex-direction: column; gap: 6px; }
.provider-accent > span { font-size: 0.8rem; color: var(--muted); }
.provider-accent-row { display: flex; align-items: center; gap: 10px; }
.provider-accent-row input[type=color] { width: 56px; height: 42px; padding: 2px; cursor: pointer; }
.provider-accent-row input[type=color]:disabled { opacity: 0.4; cursor: not-allowed; }
.provider-gallery { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 0; display: grid; gap: 10px; }
.provider-gallery legend { padding: 0 6px; font-size: 0.8rem; color: var(--muted); }
.provider-gallery-list { display: grid; gap: 8px; }
.provider-gallery-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.provider-gallery-row img { width: 84px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.provider-gallery-fields { display: grid; gap: 6px; min-width: 0; }
.provider-gallery-actions { display: flex; flex-direction: column; gap: 6px; }
.provider-gallery-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.provider-gallery-add input[type=url] { flex: 1 1 200px; min-width: 0; }
.provider-name { font-weight: 600; }
.provider-slug { display: block; font-size: 0.75rem; color: var(--muted); }
.provider-status { padding: 2px 8px; border-radius: 999px; font-size: 0.74rem; background: var(--surface-2); }
.provider-status.is-active { color: var(--ok); }
.provider-status.is-pending { background: var(--accent-soft); color: var(--accent); }
.provider-status.is-suspended { color: var(--danger); }
.provider-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.provider-actions a.filter-pill { text-decoration: none; }
.admin-tabs button .tab-pending { color: var(--warn); font-weight: 600; }
.item-card .provider-line { margin: 0; color: var(--muted); font-size: 0.76rem; }
.field-hint.is-error { color: var(--danger); }
.field-hint.is-success { color: var(--ok); }
.asset-status { margin-right: 8px; font-size: 0.75rem; color: var(--muted); }
.asset-status.is-ready { color: var(--ok); }
.asset-status.is-failed { color: var(--danger); }
.field-hint[hidden] { display: none; }

/* ================ PLAENE ================ */
.plan-status-line.is-warn { color: var(--warn); }
.plan-status-line.is-ok { color: var(--ok); }
.plan-kind { padding: 2px 8px; border-radius: 999px; font-size: 0.74rem; background: var(--surface-2); }
.plan-inactive { opacity: 0.55; }
.plan-picker .field-hint { margin: 0 0 6px; }
.editor-form [hidden], .editor-form label[hidden] { display: none !important; }

/* Kennenlernen */
.dating-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 12px 0 16px; }
.dating-tile { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.dating-tile-value { font-size: 1.6rem; font-weight: 700; }
.dating-tile-label { font-size: 0.8rem; opacity: 0.75; }

/* LIVE: siehe live-console.css (gemeinsam mit dem Studio) */

/* ===================================================================== */
/* Tab "Übersetzungen" (translations.js)                                  */
/* ===================================================================== */
.i18n-filters { flex-wrap: wrap; align-items: center; gap: 10px; }
.i18n-filters input[type="search"] { flex: 1 1 240px; min-width: min(200px, 100%); }
/* Filter-Checkboxen als Umschalt-Chips (wie .chip/.chip.active); das Kaestchen bleibt fuer
   Tastatur und Screenreader im Baum, ist aber unsichtbar. */
.i18n-check {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 6px 14px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.i18n-check:hover { color: var(--text); border-color: var(--tint-5); }
.i18n-filters .i18n-check input {
  position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; border: 0;
  opacity: 0; pointer-events: none;
}
.i18n-check:has(input:checked) { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
.i18n-check:has(input:checked)::before { content: '\2713'; font-weight: 700; }
.i18n-check:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
.i18n-import { display: grid; gap: 8px; margin: 8px 0 12px; max-width: 900px; }
.i18n-import textarea { width: 100%; font-family: var(--mono); font-size: 0.8rem; }
.i18n-import .btn-primary { justify-self: start; }
/* Statuszeile haelt ihre Hoehe, sonst rutscht die Tabelle bei der ersten Meldung unter dem Cursor weg. */
#i18nNote { min-height: 1.45em; }
#i18nNote[data-kind="error"] { color: var(--danger); }
#i18nNote[data-kind="success"] { color: var(--success); }
.i18n-table { table-layout: fixed; min-width: 960px; }
.i18n-table th:first-child, .i18n-table td:first-child { width: 17%; }
.i18n-table th.i18n-key, .i18n-group th { white-space: normal; }
.i18n-table td, .i18n-table th.i18n-key { vertical-align: top; }
.i18n-key { text-align: left; font-weight: 400; }
.i18n-key code { font-size: 0.75rem; word-break: break-all; color: var(--text); }
.i18n-ph { margin-top: 4px; font-size: 0.72rem; color: var(--muted); word-break: break-word; }
.i18n-badge { display: inline-block; margin-top: 4px; padding: 1px 7px; border-radius: 999px; font-size: 0.68rem; border: 1px solid var(--line); color: var(--muted); }
.i18n-badge-niedrig { color: var(--warn); border-color: rgba(240,185,90,0.45); background: rgba(240,185,90,0.1); }
.i18n-group th { text-align: left; padding: 14px 10px 6px; font-size: 0.8rem; color: var(--text); border-bottom: 1px solid var(--line); }
.i18n-group th span { color: var(--muted); font-weight: 400; margin-left: 8px; }
.i18n-plural .i18n-key { padding-left: 22px; }
.i18n-cell textarea { width: 100%; min-height: 36px; padding: 6px 8px; font-size: 0.85rem; line-height: 1.35; }
/* Geaenderte Texte: heller Rahmen, leicht aufgehellte Flaeche und Markierung links */
.i18n-cell.is-override textarea { border-color: var(--accent-deep); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.i18n-cell textarea[aria-invalid="true"] { border-color: var(--danger); }
.i18n-cell-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; font-size: 0.72rem; color: var(--muted); }
.i18n-cell-tools:empty { display: none; }
.i18n-reviewed { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; color: var(--text); }
.i18n-reviewed input { width: 18px; height: 18px; }
.i18n-reset {
  min-height: 32px; padding: 4px 10px; border-radius: var(--radius-ctl);
  border: 1px solid var(--line); background: var(--tint-2); color: var(--text); font-size: 12px; font-weight: 600;
}
.i18n-reset:hover { background: var(--tint-3); border-color: var(--line-strong); }
.i18n-flag { padding: 0 6px; border-radius: 4px; background: var(--surface-2); }
.i18n-preview { margin-top: 4px; font-size: 0.76rem; color: var(--muted); word-break: break-word; }
.i18n-err { margin-top: 4px; font-size: 0.76rem; color: var(--danger); }
.i18n-empty { padding: 24px; text-align: center; color: var(--muted); }
/* ================ KATEGORIEN ================ */
.cat-admin { display: grid; grid-template-columns: minmax(340px, 480px) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .cat-admin { grid-template-columns: minmax(0, 1fr); } }
.cat-tree-wrap, .cat-detail { min-width: 0; }
.cat-tree { display: flex; flex-direction: column; gap: 14px; }
.cat-area { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.cat-subs { list-style: none; margin: 4px 0 0; padding: 0; }
.cat-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border-radius: 8px; padding: 2px 4px; }
.cat-row.selected { background: var(--accent-soft); }
.cat-row.is-hidden .cat-name { opacity: 0.55; }
.cat-name { flex: 1 1 140px; display: flex; align-items: center; gap: 8px; background: none; border: 0; text-align: left; padding: 6px 4px; color: var(--text); min-width: 0; }
.cat-name span:first-child, .cat-name strong { overflow-wrap: anywhere; }
.cat-count { margin-left: auto; color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.cat-badge { font-style: normal; font-size: 0.68rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.cat-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
/* Werkzeuge im Baum: kleine Chips (32px), Pfeile quadratisch */
.cat-tool, .cat-add {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 32px; min-width: 32px; padding: 4px 10px;
  background: transparent; border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--muted); font-size: 12px; font-weight: 500;
}
.cat-tool:hover:not(:disabled), .cat-add:hover { color: var(--text); border-color: var(--tint-5); }
.cat-tool:disabled { opacity: 0.35; cursor: not-allowed; }
.cat-add { margin: 6px 4px 2px; }
.cat-tool.cat-danger { color: var(--danger); border-color: var(--danger-line); }
.cat-form { flex: 1 1 100%; display: grid; gap: 8px; padding: 8px 4px 10px; }
.cat-form label { display: grid; gap: 4px; font-size: 0.8rem; color: var(--muted); }
.cat-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 10px; }
.cat-detail-head h3 { margin: 0; font-family: var(--display); font-size: 1.15rem; }
.cat-detail-head .result-count { color: var(--muted); font-size: 0.86rem; }
.cat-detail .field-hint { margin: 0; }
#catNote { margin: 8px 0; }
#categoriesView.is-busy .cat-tree { opacity: 0.6; pointer-events: none; }
#catNote.is-error { color: var(--danger); }
.cat-detail-head .btn-primary { margin-left: auto; }
.cat-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cat-bulk select { flex: 1 1 220px; min-width: 0; max-width: 380px; }
.cat-all { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
.cat-title-list { display: flex; flex-direction: column; }
.cat-title-row { display: flex; align-items: center; gap: 10px; padding: 6px 2px; border-bottom: 1px solid var(--line); }
.cat-title-row img, .cat-thumb-empty { width: 48px; height: 32px; object-fit: cover; border-radius: 4px; background: var(--surface-2); flex: none; }
.cat-title-name { background: none; border: 0; color: var(--text); text-align: left; padding: 4px 0; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.cat-title-name:hover { text-decoration: underline; }
.cat-title-meta { color: var(--muted); font-size: 0.76rem; white-space: nowrap; }
@media (max-width: 640px) {
  .cat-title-row { flex-wrap: wrap; }
  .cat-title-name { flex: 1 1 0; }
  .cat-title-meta { flex-basis: 100%; padding-left: 88px; white-space: normal; }
}
/* Kartentitel als Knopf (Tastatur); die ganze Karte bleibt ueber ::after klickbar. */
.item-card .title .item-open {
  all: unset; cursor: pointer;
}
.item-card .title .item-open::after { content: ''; position: absolute; inset: 0; border-radius: 12px; }
.item-card .title .item-open:focus-visible { outline: none; }
.item-card .title .item-open:focus-visible::after { outline: 2px solid var(--ring); outline-offset: -2px; }

/* ================ DIREKTLINK / DOWNLOAD (Titel-Editor) ================ */
.title-share { display: grid; gap: 8px; }
.title-share-label { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.04em; font-weight: 500; }
.title-share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.title-share-actions a.btn-ghost { text-decoration: none; }
.item-card .badge.unlisted { background: rgba(77,119,214,0.85); color: #fff; }

/* Anmeldesperre: ohne Admin-Sitzung nur die Karte, nicht die leere Oberflaeche. Der Sorbflix-Rahmen (Kopf und
   untere Leiste) bleibt sichtbar; vom Admin-Inhalt (Werkzeugzeile, Reiter, Shell, Dialoge) nichts. */
.admin-gate { display: none; }
body.admin-locked > :not(.admin-gate, .topbar, .bottom-bar) { display: none !important; }
body.admin-locked .admin-gate { display: grid; place-items: center; min-height: calc(100vh - var(--header-h, 72px) - 24px); padding: 24px 16px calc(24px + 62px); }
.admin-gate-card { width: 100%; max-width: 420px; padding: 32px 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: center; display: grid; gap: 14px; justify-items: center; }
.admin-gate-card h1 { margin: 0; font-size: 1.3rem; }
.admin-gate-card p { margin: 0; color: var(--muted); }
body.admin-checking .admin-gate-login { display: none; }

/* Highlights-Tab: geordnete Liste fuer das Billboard der Startseite */
.hl-add { position: relative; max-width: 520px; margin-bottom: 16px; }
.hl-add-field { display: flex; flex-direction: column; gap: 4px; }
.hl-results { list-style: none; margin: 4px 0 0; padding: 4px; max-height: 320px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; position: absolute; left: 0; right: 0; z-index: 5; }
.hl-results button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; color: inherit; padding: 6px 8px; border-radius: 8px; cursor: pointer; font: inherit; }
.hl-results button:hover, .hl-results button:focus-visible { background: var(--line); }
.hl-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hl-item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.hl-pos { min-width: 1.6em; text-align: right; font-variant-numeric: tabular-nums; opacity: .7; }
.hl-thumb { width: 72px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--line); flex: none; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.hl-main { flex: 1; min-width: 0; }
.hl-title { margin: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-meta { margin: 2px 0 0; font-size: 12px; opacity: .75; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.hl-warn { color: var(--warn); font-weight: 600; }
.hl-btns { display: flex; gap: 4px; flex: none; }
.hl-btns button { min-width: 36px; min-height: 36px; }
.hl-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hl-toggle { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ================ ABGRENZUNG GEGEN /styles.css (body.admin-page) ================ */
/* Die Web-App-Regeln aus /styles.css meinen mit .btn grosse Aktionsknoepfe (46 px, kein Umbruch, Hover-Hub) und
   mit a Links ohne Farbe und Unterstrich; in der Steuerzentrale sind es kleine Knoepfe und normale Textlinks. */
.admin-page .btn { height: auto; white-space: normal; }
.admin-page .btn:hover { transform: none; }
.admin-page .btn-primary, .admin-page .btn-ghost, .admin-page .btn-danger { white-space: normal; }
.admin-page :is(.field-hint, .hint, .note, td, li, p, label) a:not([class]) { color: var(--link, var(--accent)); text-decoration: underline; text-underline-offset: 2px; }

/* ================ HELLER MODUS ================ */
/* Tokens und gemeinsame Steuerelemente: serboflix-controls.css (Block :root[data-theme="light"] am Dateiende).
   Hier nur, was in dieser Datei fest dunkel gedacht war. */
:root[data-theme="light"] .item-card .poster-fallback { color: var(--muted-2); }
:root[data-theme="light"] .editor-backdrop { background: var(--scrim); }
:root[data-theme="light"] .bug-pill { color: #1a1d23; }
