/* ==========================================================================
   Admin – Variablen & Basis
   ========================================================================== */
:root {
  --admin-primary: #0a6ebd;
  --admin-primary-dark: #085a9a;
  --admin-primary-light: #eaf3fb;
  --admin-bg: #f4f6f8;
  --admin-surface: #ffffff;
  --admin-border: #e4e8ec;
  --admin-text: #1a1f2a;
  --admin-text-muted: #6b7380;
  --admin-danger: #c0392b;
  --admin-danger-light: #fdecea;
  --admin-success: #1e7d3a;
  --admin-success-light: #e6f4ea;
  --admin-accent: #ff9a3c;
  --admin-sidebar: #141b2d;
  --admin-sidebar-hover: #1f2940;
  --admin-sidebar-active: #0a6ebd;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --radius: 8px;
  --radius-sm: 4px;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: var(--admin-bg);
  color: var(--admin-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--admin-primary); }

/* ==========================================================================
   Login
   ========================================================================== */
body.login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
body.login form {
  background: var(--admin-surface);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 340px;
}
body.login h1 { margin: 0 0 1.2rem; color: var(--admin-primary); }
body.login input {
  display: block;
  width: 100%;
  padding: .7rem .9rem;
  margin: .5rem 0;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}
body.login input:focus {
  outline: 2px solid var(--admin-primary);
  outline-offset: -1px;
  border-color: var(--admin-primary);
}
body.login button {
  width: 100%;
  padding: .8rem;
  background: var(--admin-primary);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  margin-top: .5rem;
  transition: background .15s;
}
body.login button:hover { background: var(--admin-primary-dark); }

/* ==========================================================================
   Sidebar & Layout
   ========================================================================== */
.admin-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100vh;
}
.admin-sidebar {
  background: var(--admin-sidebar);
  color: #e5e9f0;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  padding: 1.5rem 1.5rem 1rem;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: .5px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .7rem 1.5rem;
  color: #a8b0c0;
  text-decoration: none;
  font-size: .95rem;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.sidebar-nav a:hover {
  background: var(--admin-sidebar-hover);
  color: #fff;
}
.sidebar-nav a.is-active {
  background: var(--admin-sidebar-hover);
  color: #fff;
  border-left-color: var(--admin-primary);
  font-weight: 600;
}
.nav-icon {
  font-size: 1.1rem;
  opacity: .85;
  width: 20px;
  text-align: center;
}
.nav-badge {
  margin-left: auto;
  background: #dc2626;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}
.sidebar-nav a.is-active .nav-badge { background: rgba(255,255,255,.25); }
body.sidebar-collapsed .nav-badge {
  position: absolute; top: 6px; right: 6px;
  margin: 0; font-size: .6rem; padding: 0 .3rem;
  min-width: 14px;
}
.sidebar-footer {
  padding: 1rem 0;
  border-top: 1px solid rgba(255,255,255,.08);
}
.nav-logout {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .7rem 1.5rem;
  color: #a8b0c0;
  text-decoration: none;
  font-size: .95rem;
}
.nav-logout:hover { color: #fff; }

.admin-main {
  padding: 2rem 2.5rem;
  max-width: 1400px;
  width: 100%;
}
.admin-main h1 {
  margin: 0 0 .3rem;
  color: var(--admin-text);
  font-size: 1.6rem;
}

/* ==========================================================================
   Page Header
   ========================================================================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.8rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-header h1 { margin: 0; }
.page-header .muted { margin: .3rem 0 0; }
.muted { color: var(--admin-text-muted); margin: 0; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-primary, .btn-secondary, .btn-sm, .btn-danger-sm {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.2rem;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .92rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, transform .05s;
  line-height: 1.2;
}
.btn-primary:active, .btn-secondary:active { transform: translateY(1px); }

.btn-primary {
  background: var(--admin-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--admin-primary-dark); color: #fff; }

.btn-secondary {
  background: #fff;
  color: var(--admin-text);
  border: 1px solid var(--admin-border);
}
.btn-secondary:hover { background: #f8fafc; }

.btn-sm {
  padding: .4rem .8rem;
  font-size: .85rem;
  background: #f1f5f9;
  color: var(--admin-text);
}
.btn-sm:hover { background: #e2e8f0; }

.btn-danger-sm {
  padding: .4rem .8rem;
  font-size: .85rem;
  background: var(--admin-danger-light);
  color: var(--admin-danger);
}
.btn-danger-sm:hover { background: #f5c6c2; }

.btn-block { width: 100%; justify-content: center; }

/* ==========================================================================
   Alerts
   ========================================================================== */
.alert {
  padding: .9rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.2rem;
  border: 1px solid transparent;
  font-size: .95rem;
}
.alert ul { margin: .3rem 0 0 1.2rem; padding: 0; }
.alert-success {
  background: var(--admin-success-light);
  color: var(--admin-success);
  border-color: #a6d9b7;
}
.alert-error {
  background: var(--admin-danger-light);
  color: var(--admin-danger);
  border-color: #f5a7a0;
}
.alert-info {
  background: var(--admin-primary-light);
  color: var(--admin-primary);
  border-color: #c5dbee;
}

/* ==========================================================================
   Forms
   ========================================================================== */
form label {
  display: block;
  margin: 1.1rem 0 .3rem;
  font-weight: 600;
  font-size: .92rem;
  color: var(--admin-text);
}
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number],
textarea, select {
  width: 100%;
  padding: .65rem .85rem;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .95rem;
  background: #fff;
  color: var(--admin-text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px var(--admin-primary-light);
}
/* WCAG 2.4.7 Focus Visible: Tastatur-Fokus muss klar erkennbar sein.
 * Der hellblaue box-shadow allein ist auf weißem Untergrund zu schwach
 * (Kontrast ~1.2:1) — zusätzlicher dunkler Outline-Ring für :focus-visible. */
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--admin-primary);
  outline-offset: 1px;
}
.form-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.form-hint {
  color: var(--admin-text-muted);
  font-size: .85rem;
  margin: .3rem 0 0;
  font-weight: normal;
}
.err {
  display: block;
  color: var(--admin-danger);
  font-size: .85rem;
  margin-top: .3rem;
}

/* ==========================================================================
   Stats Dashboard
   ========================================================================== */
.dashboard-header { margin-bottom: 2rem; }
.dashboard-header h1 { margin: 0 0 .3rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--admin-surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform .1s, box-shadow .15s;
  border: 1px solid transparent;
}
a.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--admin-primary-light);
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--admin-primary);
  line-height: 1;
}
.stat-label {
  margin-top: .5rem;
  color: var(--admin-text-muted);
  font-size: .9rem;
}
.stat-highlight {
  display: inline-block;
  background: var(--admin-accent);
  color: #fff;
  font-size: .7rem;
  padding: .1rem .5rem;
  border-radius: 999px;
  margin-left: .3rem;
  font-weight: 600;
}
.dashboard-section {
  background: var(--admin-surface);
  padding: 1.5rem 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.dashboard-section h2 { margin-top: 0; color: var(--admin-primary); }
.quick-actions { display: flex; gap: .7rem; flex-wrap: wrap; }

/* ==========================================================================
   Data Table (Seitenliste etc.)
   ========================================================================== */
.data-table {
  width: 100%;
  background: var(--admin-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border-collapse: collapse;
  margin-top: 1rem;
}
.data-table th, .data-table td {
  padding: .85rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--admin-border);
}
.data-table th {
  background: #f8fafc;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--admin-text-muted);
  font-weight: 600;
}
.data-table tbody tr:hover { background: #fafbfc; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table code {
  background: #f1f5f9;
  padding: .15rem .45rem;
  border-radius: 3px;
  font-size: .8rem;
  font-family: "SF Mono", Monaco, Consolas, monospace;
}
.data-table .actions { display: flex; gap: .3rem; flex-wrap: wrap; }

/* Tags */
.tag {
  display: inline-block;
  padding: .15rem .55rem;
  font-size: .72rem;
  border-radius: 3px;
  font-weight: 600;
  margin-left: .3rem;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.tag-success { background: var(--admin-success-light); color: var(--admin-success); }
.tag-muted   { background: #eef2f7; color: var(--admin-text-muted); }
.tag-primary { background: var(--admin-primary-light); color: var(--admin-primary); }

/* ==========================================================================
   Settings – Tabs
   ========================================================================== */
.settings-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 1.5rem;
}
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
}

.settings-tabs {
  background: var(--admin-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: .5rem;
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 1rem;
}
.settings-tab {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .75rem 1rem;
  text-decoration: none;
  color: var(--admin-text);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.settings-tab:hover {
  background: #f8fafc;
}
.settings-tab.is-active {
  background: var(--admin-primary-light);
  color: var(--admin-primary);
  font-weight: 600;
  border-left-color: var(--admin-primary);
}
/* Icon-Spalte: alle Icons gleich breit, damit die Labels exakt untereinander stehen.
   inline-flex + fixe Breite + flex-shrink:0 — egal wie breit das jeweilige Emoji
   intrinsisch ist, der Slot bleibt konstant. */
.tab-icon {
  font-size: 1.05rem;
  width: 1.5em;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.tab-label { min-width: 0; }

.settings-content {
  min-width: 0;
}

/* Settings Sections */
.settings-section {
  background: var(--admin-surface);
  padding: 1.5rem 1.8rem;
  margin-bottom: 1.2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.settings-section h2 {
  margin: 0 0 .3rem;
  font-size: 1.15rem;
  color: var(--admin-text);
}
.section-head {
  margin-bottom: 1rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--admin-border);
}
.section-subtitle {
  color: var(--admin-text-muted);
  margin: 0;
  font-size: .9rem;
}

/* Image Upload Field */
.image-upload-field {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.image-preview {
  background: #f8fafc;
  border: 2px dashed var(--admin-border);
  border-radius: var(--radius-sm);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.image-preview img { max-width: 100%; max-height: 150px; display: block; }
.image-preview-small { min-height: 64px; width: 64px; height: 64px; }
.image-preview-small img { max-width: 64px; max-height: 64px; }
.image-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  align-items: flex-start;
}

/* ==========================================================================
   Theme-Auswahl – Neu und schick
   ========================================================================== */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.theme-card {
  display: block;
  position: relative;
  cursor: pointer;
  background: #fff;
  border: 2px solid var(--admin-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s, transform .1s, box-shadow .15s;
}
.theme-card:hover {
  border-color: var(--admin-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.theme-card.is-selected {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px var(--admin-primary-light);
}
.theme-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Farbvorschau oben */
.theme-card-visual {
  height: 80px;
  position: relative;
  overflow: hidden;
}
.theme-swatches {
  display: flex;
  height: 100%;
}
.theme-swatch {
  flex: 1;
  display: block;
}
.theme-check {
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  color: var(--admin-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  opacity: 0;
  transform: scale(.7);
  transition: opacity .15s, transform .15s;
}
.theme-card.is-selected .theme-check {
  opacity: 1;
  transform: scale(1);
}

.theme-card-body {
  padding: 1rem 1.1rem 1.1rem;
}
.theme-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
  margin-bottom: .3rem;
}
.theme-card-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.theme-category {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--admin-text-muted);
  background: #f1f5f9;
  padding: .1rem .45rem;
  border-radius: 3px;
  font-weight: 600;
  white-space: nowrap;
}
.theme-card-body p {
  margin: 0 0 .7rem;
  color: var(--admin-text-muted);
  font-size: .88rem;
  line-height: 1.5;
}
.theme-slug {
  font-size: .72rem;
  background: #f1f5f9;
  color: var(--admin-text-muted);
  padding: .15rem .4rem;
  border-radius: 3px;
  font-family: "SF Mono", Monaco, Consolas, monospace;
}

/* ==========================================================================
   Farben & Live-Vorschau
   ========================================================================== */
.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.color-field label {
  margin: 0 0 .4rem;
  display: block;
}
.color-input-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: #f8fafc;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  padding: .3rem;
}
.color-picker {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
}
.color-hex {
  font-family: "SF Mono", Monaco, Consolas, monospace;
  font-size: .85rem;
  color: var(--admin-text-muted);
  letter-spacing: .5px;
}
.color-hex-input {
  font-family: "SF Mono", Monaco, Consolas, monospace;
  font-size: .85rem;
  letter-spacing: .5px;
  width: 88px;
  padding: .35rem .45rem;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--admin-text);
  text-transform: uppercase;
  outline: none;
  transition: border-color .15s, background .15s;
}
.color-hex-input:focus {
  border-color: var(--color-primary, #0a6ebd);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary, #0a6ebd) 18%, transparent);
}
.color-hex-input.is-invalid {
  border-color: #dc2626;
  background: #fef2f2;
  color: #991b1b;
}

/* === Professional-Modus (erweiterte Farben) === */
.pro-section .section-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.pro-toggle {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  cursor: pointer;
  user-select: none;
  font-size: .92rem;
}
.pro-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.pro-toggle-track {
  position: relative;
  width: 42px;
  height: 22px;
  background: #d1d5db;
  border-radius: 999px;
  transition: background .2s ease;
  flex-shrink: 0;
}
.pro-toggle-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .2s ease;
}
.pro-toggle input:checked ~ .pro-toggle-track {
  background: var(--color-primary, #0a6ebd);
}
.pro-toggle input:checked ~ .pro-toggle-track .pro-toggle-knob {
  transform: translateX(20px);
}
.pro-toggle input:focus-visible ~ .pro-toggle-track {
  outline: 2px solid var(--color-primary, #0a6ebd);
  outline-offset: 2px;
}
.pro-toggle-label {
  color: var(--admin-text);
  font-weight: 500;
}
.pro-groups {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-top: 1rem;
}
.pro-groups[hidden] { display: none; }
.pro-group {
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  overflow: hidden;
}
.pro-group > summary {
  list-style: none;
  cursor: pointer;
  padding: .75rem 1rem;
  display: flex;
  align-items: baseline;
  gap: .75rem;
  background: #fff;
  border-bottom: 1px solid transparent;
  transition: background .15s;
}
.pro-group > summary::-webkit-details-marker { display: none; }
.pro-group > summary::after {
  content: '▾';
  margin-left: auto;
  color: var(--admin-text-muted);
  transition: transform .2s ease;
}
.pro-group[open] > summary {
  border-bottom-color: var(--admin-border);
  background: #f8fafc;
}
.pro-group[open] > summary::after { transform: rotate(180deg); }
.pro-group > summary:hover { background: #f1f5f9; }
.pro-group > summary strong { font-size: .95rem; }
.pro-group > summary small { color: var(--admin-text-muted); }
.pro-group .color-grid {
  padding: 1rem;
  margin-bottom: 0;
}

.color-preview {
  margin-top: 1rem;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  overflow: hidden;
  --color-primary: #0a6ebd;
  --color-secondary: #f5f9fc;
  --color-accent: #ff9a3c;
  --color-text: #1a1a1a;
}
.cp-header {
  background: var(--color-secondary);
  color: var(--color-primary);
  padding: 1rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}
.cp-header nav a {
  margin-left: 1rem;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  font-size: .9rem;
}
.cp-body {
  padding: 1.5rem 1.2rem;
  color: var(--color-text);
  background: #fff;
}
.cp-body h4 { margin: 0 0 .5rem; color: var(--color-primary); }
.cp-body a  { color: var(--color-primary); }
.cp-btn {
  background: var(--color-accent);
  color: #fff;
  border: 0;
  padding: .6rem 1.2rem;
  border-radius: var(--radius-sm);
  margin-top: .8rem;
  cursor: pointer;
  font-weight: 600;
}

/* ==========================================================================
   Radio Options (Mail Mode)
   ========================================================================== */
.radio-option {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .9rem 1.1rem;
  margin: .4rem 0;
  background: #f8fafc;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.radio-option:hover { background: #eef2f7; }
.radio-option input { margin-top: .2rem; }
.radio-option strong { display: block; margin-bottom: .1rem; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.code-input {
  font-family: "SF Mono", Monaco, Consolas, monospace !important;
  font-size: .85rem !important;
  background: #1f2937 !important;
  color: #e5e7eb !important;
  border-color: #374151 !important;
}

/* ==========================================================================
   Form Grid (Seiten-Editor)
   ========================================================================== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
}
@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr; } }

.sidebar-box {
  background: var(--admin-surface);
  padding: 1.1rem 1.3rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.sidebar-box h3 {
  margin: 0 0 .8rem;
  font-size: .92rem;
  color: var(--admin-text);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: .5rem;
}
.checkbox {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .6rem 0;
  font-weight: normal;
}

.slug-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.slug-wrap:focus-within {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px var(--admin-primary-light);
}
.slug-prefix {
  background: #f1f5f9;
  padding: .65rem .8rem;
  color: var(--admin-text-muted);
  border-right: 1px solid var(--admin-border);
}
.slug-wrap input {
  border: 0 !important;
  flex: 1;
  box-shadow: none !important;
}

.editor-toolbar {
  display: flex;
  gap: .25rem;
  margin-top: .4rem;
  flex-wrap: wrap;
}
.editor-toolbar button {
  padding: .35rem .75rem;
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .85rem;
}
.editor-toolbar button:hover { background: #f1f5f9; }

.featured-preview {
  background: #f8fafc;
  border: 2px dashed var(--admin-border);
  border-radius: var(--radius-sm);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .5rem;
  overflow: hidden;
}
.featured-preview img { max-width: 100%; display: block; }

/* ==========================================================================
   Medien
   ========================================================================== */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.media-item {
  background: var(--admin-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .15s, transform .1s;
}
.media-item:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.media-thumb {
  background: #f1f5f9;
  aspect-ratio: 4/3;
  overflow: hidden;
}
.media-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.media-meta { padding: .7rem .8rem; }
.media-name {
  font-size: .85rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.media-info { font-size: .72rem; color: var(--admin-text-muted); margin: .2rem 0 .5rem; }
.media-url {
  width: 100%;
  font-size: .72rem;
  padding: .2rem .4rem;
  border: 1px solid var(--admin-border);
  border-radius: 3px;
  font-family: "SF Mono", Monaco, Consolas, monospace;
  margin-bottom: .3rem;
}
.media-actions { display: flex; gap: .3rem; align-items: center; }
.picker-grid .media-item { cursor: pointer; }
.picker-grid .media-item:hover .media-thumb {
  outline: 3px solid var(--admin-primary);
  outline-offset: -3px;
}

/* Media Picker Modal */
.media-picker[hidden] { display: none; }
.media-picker {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.media-picker-backdrop {
  position: absolute; inset: 0;
  background: rgba(20, 27, 45, 0.6);
  backdrop-filter: blur(2px);
}
.media-picker-dialog {
  position: relative;
  background: #fff;
  width: 90%; max-width: 900px; max-height: 85vh;
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.media-picker-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--admin-border);
  display: flex; justify-content: space-between; align-items: center;
}
.media-picker-header h2 { margin: 0; font-size: 1.1rem; }
.close-btn {
  background: none; border: 0; font-size: 1.6rem;
  cursor: pointer; color: var(--admin-text-muted); line-height: 1;
  width: 32px; height: 32px; border-radius: 50%;
}
.close-btn:hover { background: #f1f5f9; }
.media-picker-body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.media-picker-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--admin-border);
  display: flex; justify-content: space-between; gap: .5rem;
}

/* ==========================================================================
   Module
   ========================================================================== */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}
.module-card {
  background: var(--admin-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.3rem;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 1rem;
  align-items: start;
  border-left: 4px solid transparent;
  transition: border-color .15s;
}
.module-card.is-active { border-left-color: var(--admin-success); }
.module-icon {
  font-size: 1.6rem;
  width: 48px; height: 48px;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.module-card.is-active .module-icon {
  background: var(--admin-success-light);
}
.module-body h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.module-body p { margin: 0 0 .5rem; color: var(--admin-text-muted); font-size: .88rem; line-height: 1.5; }
.module-meta { font-size: .75rem; color: var(--admin-text-muted); }

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 46px; height: 26px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #ccd4dc;
  transition: .2s;
  border-radius: 26px;
}
.slider:before {
  position: absolute; content: "";
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background: white;
  transition: .2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--admin-success); }
.switch input:checked + .slider:before { transform: translateX(20px); }

/* ==========================================================================
   Nachrichten
   ========================================================================== */
.badge {
  display: inline-block;
  background: var(--admin-primary);
  color: #fff;
  font-size: .75rem;
  padding: .1rem .6rem;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: .4rem;
  font-weight: 600;
}
.messages-list { display: flex; flex-direction: column; gap: 1rem; }
.message-card {
  background: var(--admin-surface);
  padding: 1.2rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--admin-primary);
}
.message-header {
  display: flex; justify-content: space-between; align-items: baseline;
  color: var(--admin-text-muted); font-size: .9rem;
  margin-bottom: .5rem;
}
.message-header time { white-space: nowrap; }
.message-card h3 { margin: .3rem 0 .7rem; font-size: 1.05rem; }
.message-body {
  background: #f8fafc;
  padding: .9rem 1rem;
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  font-family: inherit;
  font-size: .92rem;
  margin: 0 0 1rem;
}
.message-actions { display: flex; gap: .5rem; }

/* ==========================================================================
   Empty State
   ========================================================================== */
.empty-state {
  background: var(--admin-surface);
  padding: 3rem 2rem;
  text-align: center;
  color: var(--admin-text-muted);
  border-radius: var(--radius);
  border: 2px dashed var(--admin-border);
}
.empty-state .btn-primary { margin-top: 1rem; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
table td, table th {
  padding: .8rem 1rem;
  border-bottom: 1px solid #eee;
  text-align: left;
}
table th {
  background: #f8fafc;
  font-weight: 600;
}

form label {
  display: block;
  margin: 1rem 0 .3rem;
  font-weight: 600;
}
form input[type=text],
form input[type=email],
form input[type=password],
form textarea {
  width: 100%;
  padding: .6rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
}

.err {
  color: #c0392b;
  background: #fdecea;
  padding: .5rem .7rem;
  border-radius: 4px;
  margin: .5rem 0;
}

/* Settings-Form */
.settings-form {
  max-width: 720px;
}
.settings-section {
  background: #fff;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.settings-section h2 {
  margin-top: 0;
  font-size: 1.1rem;
  color: #0a6ebd;
  border-bottom: 1px solid #eee;
  padding-bottom: .5rem;
}
.color-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.color-grid input[type=color] {
  width: 100%;
  height: 44px;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
}
.form-actions {
  margin-top: 1rem;
}
.btn-primary {
  background: #0a6ebd;
  color: #fff;
  padding: .7rem 1.5rem;
  font-size: 1rem;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.btn-primary:hover { background: #085a9a; }

.alert {
  padding: .8rem 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}
.alert-success { background: #e6f4ea; color: #1e7d3a; border: 1px solid #a6d9b7; }
.alert-error   { background: #fdecea; color: #c0392b; border: 1px solid #f5a7a0; }
.alert ul { margin: .3rem 0 0 1.2rem; padding: 0; }

/* Messages */
.badge {
  display: inline-block;
  background: #0a6ebd;
  color: #fff;
  font-size: .8rem;
  padding: .1rem .6rem;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: .3rem;
}
.messages-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.message-card {
  background: #fff;
  padding: 1.2rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  border-left: 4px solid #0a6ebd;
}
.message-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: #666;
  font-size: .9rem;
  margin-bottom: .5rem;
}
.message-header time { white-space: nowrap; }
.message-card h3 {
  margin: .3rem 0 .7rem;
  font-size: 1.05rem;
}
.message-body {
  background: #f8fafc;
  padding: .8rem 1rem;
  border-radius: 4px;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: .95rem;
  margin: 0 0 1rem;
}
.message-actions { display: flex; gap: .5rem; }
.btn-danger, .btn-secondary {
  padding: .4rem .9rem;
  border-radius: 4px;
  border: 0;
  cursor: pointer;
  font-size: .9rem;
  text-decoration: none;
  display: inline-block;
}
.btn-danger { background: #fdecea; color: #c0392b; }
.btn-danger:hover { background: #f5c6c2; }
.btn-secondary { background: #eef2f7; color: #1a1a1a; }
.btn-secondary:hover { background: #dde4ed; }

.empty-state {
  background: #fff;
  padding: 3rem;
  text-align: center;
  color: #888;
  border-radius: 8px;
  border: 2px dashed #ddd;
}

/* Dashboard */
.dashboard-header { margin-bottom: 2rem; }
.dashboard-header h1 { margin: 0 0 .3rem; }
.muted { color: #666; margin: 0; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  text-decoration: none;
  color: inherit;
  transition: transform .1s, box-shadow .1s;
}
a.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #0a6ebd;
  line-height: 1;
}
.stat-label {
  margin-top: .5rem;
  color: #666;
  font-size: .9rem;
}
.stat-highlight {
  display: inline-block;
  background: #ff9a3c;
  color: #fff;
  font-size: .7rem;
  padding: .1rem .5rem;
  border-radius: 999px;
  margin-left: .3rem;
  font-weight: 600;
}

.dashboard-section {
  background: #fff;
  padding: 1.5rem 2rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.dashboard-section h2 { margin-top: 0; color: #0a6ebd; }
.quick-actions {
  display: flex;
  gap: .7rem;
  flex-wrap: wrap;
}

/* Page-Header mit Aktionen */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-header h1 { margin: 0; }

/* Data-Table */
.data-table { width: 100%; }
.data-table code {
  background: #f1f5f9;
  padding: .1rem .4rem;
  border-radius: 3px;
  font-size: .85rem;
}
.data-table .actions {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
}

.btn-sm {
  padding: .3rem .7rem;
  font-size: .85rem;
  background: #eef2f7;
  color: #1a1a1a;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn-sm:hover { background: #dde4ed; }
.btn-danger-sm {
  background: #fdecea !important;
  color: #c0392b !important;
}
.btn-danger-sm:hover { background: #f5c6c2 !important; }
.btn-block { width: 100%; }

/* Tags */
.tag {
  display: inline-block;
  padding: .1rem .5rem;
  font-size: .75rem;
  border-radius: 3px;
  font-weight: 600;
  margin-left: .3rem;
}
.tag-success { background: #e6f4ea; color: #1e7d3a; }
.tag-muted   { background: #eef2f7; color: #666; }
.tag-primary { background: #e0eefc; color: #0a6ebd; }

/* Form Grid für Seiten-Editor */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
}
@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
}
.form-main .sidebar-box, .form-sidebar .sidebar-box {
  background: #fff;
  padding: 1rem 1.3rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.sidebar-box h3 {
  margin: 0 0 .8rem;
  font-size: .95rem;
  color: #0a6ebd;
  border-bottom: 1px solid #eee;
  padding-bottom: .4rem;
}

/* ==========================================================================
   Klappbare Sidebar-Boxen (<details>/<summary> in /admin/pages Editor)
   ========================================================================== */
.form-sidebar details.sidebar-box {
  padding: 0; /* Padding wandert auf summary + Body, damit Klickfläche maximal */
  overflow: hidden;
}
.form-sidebar details.sidebar-box > summary {
  list-style: none;          /* Standard-Pfeil unterdrücken */
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1.3rem;
  margin: 0;
  background: transparent;
  border-radius: 8px 8px 0 0;
  transition: background .15s ease;
}
.form-sidebar details.sidebar-box > summary::-webkit-details-marker { display: none; }
.form-sidebar details.sidebar-box > summary:hover {
  background: #f5f9fc;
}
.form-sidebar details.sidebar-box > summary::before {
  content: '';
  width: 8px; height: 8px;
  border: solid #0a6ebd;
  border-width: 0 2px 2px 0;
  transform: rotate(-45deg);   /* zeigt nach oben (geschlossen) → ▶ */
  transform-origin: center;
  margin-right: .15rem;
  transition: transform .2s ease;
  flex-shrink: 0;
}
.form-sidebar details.sidebar-box[open] > summary::before {
  transform: rotate(45deg);    /* zeigt nach unten (offen) → ▼ */
}
.form-sidebar details.sidebar-box > summary > h3 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: .95rem;
  color: #0a6ebd;
  flex: 1;
}
/* Inhalt unterhalb summary mit eigenem Padding */
.form-sidebar details.sidebar-box[open] > *:not(summary) {
  margin-left: 1.3rem;
  margin-right: 1.3rem;
}
.form-sidebar details.sidebar-box[open] > *:not(summary):last-child {
  margin-bottom: 1rem;
}
.form-sidebar details.sidebar-box[open] > summary {
  border-bottom: 1px solid #eee;
  margin-bottom: .8rem;
}
.form-main > label {
  display: block;
  margin-bottom: 1rem;
}
.form-main textarea {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: .9rem;
  line-height: 1.5;
}
.checkbox {
  display: block;
  margin: .5rem 0;
  font-weight: normal;
}
.checkbox input { margin-right: .4rem; }

/* Slug Input */
.slug-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}
.slug-prefix {
  background: #f1f5f9;
  padding: .6rem .7rem;
  color: #666;
  border-right: 1px solid #ddd;
}
.slug-wrap input {
  border: 0 !important;
  flex: 1;
}

/* Editor Toolbar */
.editor-toolbar {
  display: flex;
  gap: .3rem;
  margin-top: .3rem;
  flex-wrap: wrap;
}
.editor-toolbar button {
  padding: .3rem .7rem;
  background: #eef2f7;
  border: 1px solid #ddd;
  border-radius: 3px;
  cursor: pointer;
  font-size: .85rem;
}
.editor-toolbar button:hover { background: #dde4ed; }

/* Featured Image */
.featured-preview {
  background: #f8fafc;
  border: 2px dashed #ddd;
  border-radius: 4px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .5rem;
  overflow: hidden;
}
.featured-preview img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Media Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.media-item {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  overflow: hidden;
  transition: box-shadow .15s;
}
.media-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.media-thumb {
  background: #f1f5f9;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.media-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  width: 100%;
  height: 100%;
}
.media-meta { padding: .7rem; }
.media-name {
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-info {
  font-size: .75rem;
  color: #888;
  margin: .2rem 0 .5rem;
}
.media-url {
  width: 100%;
  font-size: .75rem;
  padding: .2rem .3rem;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-family: monospace;
  margin-bottom: .3rem;
}
.media-actions {
  display: flex;
  gap: .3rem;
  align-items: center;
}

/* Picker Grid selektierbar */
.picker-grid .media-item { cursor: pointer; }
.picker-grid .media-item:hover .media-thumb {
  outline: 3px solid #0a6ebd;
  outline-offset: -3px;
}

/* Video-Thumbnails (Library + Picker) */
.media-video-thumb {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f2937, #374151);
  color: #fff;
}
.media-video-thumb svg {
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.4));
}
.media-video-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 2px 6px;
  border-radius: 3px;
}
.media-item.is-video .media-thumb {
  background: #1f2937;
}

/* Media-Picker Modal */
.media-picker[hidden] { display: none; }
.media-picker {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
}
.media-picker-dialog {
  position: relative;
  background: #fff;
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.media-picker-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.media-picker-header h2 { margin: 0; font-size: 1.1rem; }
.close-btn {
  background: none;
  border: 0;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  line-height: 1;
}
.media-picker-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}
.media-picker-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  gap: .5rem;
}

/* Empty State */
.empty-state {
  background: #fff;
  padding: 3rem;
  text-align: center;
  color: #888;
  border-radius: 8px;
  border: 2px dashed #ddd;
}
.empty-state .btn-primary { margin-top: 1rem; }

/* Module Grid */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}
.module-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  padding: 1.3rem;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 1rem;
  align-items: start;
  border-left: 4px solid transparent;
  transition: border-color .15s;
}
.module-card.is-active {
  border-left-color: #1e7d3a;
}
.module-icon {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  background: #f1f5f9;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.module-card.is-active .module-icon {
  background: #e6f4ea;
}
.module-body h3 {
  margin: 0 0 .3rem;
  font-size: 1.05rem;
}
.module-body p {
  margin: 0 0 .5rem;
  color: #666;
  font-size: .9rem;
  line-height: 1.5;
}
.module-meta {
  font-size: .75rem;
  color: #999;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  transition: .2s;
  border-radius: 26px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  transition: .2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .slider {
  background: #1e7d3a;
}
.switch input:checked + .slider:before {
  transform: translateX(20px);
}

/* Settings Layout mit Tabs */
.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
}
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
}
.settings-tabs {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  padding: .5rem 0;
  height: fit-content;
}
.settings-tabs a {
  display: block;
  padding: .7rem 1.2rem;
  text-decoration: none;
  color: #1a1a1a;
  border-left: 3px solid transparent;
}
.settings-tabs a:hover { background: #f8fafc; }
.settings-tabs a.active {
  background: #eaf3fb;
  color: #0a6ebd;
  border-left-color: #0a6ebd;
  font-weight: 600;
}
.settings-content {
  min-width: 0;
}

/* Image Upload Field */
.image-upload-field {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.image-preview {
  background: #f8fafc;
  border: 2px dashed #ddd;
  border-radius: 6px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.image-preview img {
  max-width: 100%;
  max-height: 150px;
  display: block;
}
.image-preview-small {
  min-height: 64px;
  width: 64px;
  height: 64px;
}
.image-preview-small img {
  max-width: 64px;
  max-height: 64px;
}
.image-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  align-items: flex-start;
}
.form-hint {
  color: #888;
  font-size: .85rem;
  margin: .3rem 0 0;
  font-weight: normal;
}

/* Theme Grid */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: .5rem;
}
.theme-card {
  display: block;
  cursor: pointer;
  background: #fff;
  border: 2px solid #eee;
  border-radius: 8px;
  padding: 0;
  transition: border-color .15s;
  position: relative;
}
.theme-card:hover { border-color: #0a6ebd; }
.theme-card.selected { border-color: #0a6ebd; background: #eaf3fb; }
.theme-card input { position: absolute; opacity: 0; }
.theme-card-inner {
  padding: 1rem;
}
.theme-card-inner h3 { margin: 0 0 .3rem; font-size: 1rem; }
.theme-card-inner p  { margin: 0 0 .5rem; color: #666; font-size: .85rem; }
.theme-card-inner code {
  font-size: .75rem;
  background: #f1f5f9;
  padding: .1rem .4rem;
  border-radius: 3px;
}

/* Color Preview */
.color-preview {
  margin-top: 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  --color-primary: #0a6ebd;
  --color-secondary: #f5f9fc;
  --color-accent: #ff9a3c;
  --color-text: #1a1a1a;
}
.cp-header {
  background: var(--color-secondary);
  color: var(--color-primary);
  padding: .8rem 1rem;
  font-weight: 700;
}
.cp-body {
  padding: 1rem;
  color: var(--color-text);
  background: #fff;
}
.cp-body h4 { margin: 0 0 .3rem; color: var(--color-primary); }
.cp-body a  { color: var(--color-primary); }
.cp-btn {
  background: var(--color-accent);
  color: #fff;
  border: 0;
  padding: .5rem 1rem;
  border-radius: 4px;
  margin-top: .5rem;
  cursor: pointer;
}

/* Radio & Code Input */
.radio-option {
  display: block;
  padding: .7rem 1rem;
  margin: .3rem 0;
  background: #f8fafc;
  border-radius: 4px;
  cursor: pointer;
}
.radio-option input { margin-right: .6rem; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.code-input {
  font-family: 'Consolas', 'Monaco', monospace !important;
  font-size: .85rem !important;
  background: #1f2937 !important;
  color: #e5e7eb !important;
}
.alert-info {
  background: #eaf3fb;
  color: #0a6ebd;
  border: 1px solid #c5dbee;
  padding: .7rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

/* Section Head mit Aktion rechts */
.section-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.section-head-row > div:first-child {
  flex: 1;
  min-width: 0;
}

/* ==========================================================================
   Quill WYSIWYG-Editor
   ========================================================================== */
#quill-editor-wrap {
  background: #fff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--admin-border);
  position: relative;
}
#quill-editor-wrap:focus-within {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px var(--admin-primary-light);
}
#quill-editor-wrap .ql-toolbar.ql-snow {
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
  /* Mit dem Text mitscrollen — Toolbar klebt an der Viewport-Oberkante (unter
     der Admin-Topbar, die auf top:0 sitzt mit min-height 56px). z-index liegt
     unter Bild-Toolbar (500) und Pickern (200), aber über normalem Inhalt. */
  position: sticky;
  top: 56px;
  z-index: 40;
  background: #fff;
}
/* Dark-Mode: Toolbar-Hintergrund passt sich an */
.admin-scheme-dark #quill-editor-wrap .ql-toolbar.ql-snow {
  background: var(--surface, #1e2127);
}
@media (prefers-color-scheme: dark) {
  .admin-scheme-auto #quill-editor-wrap .ql-toolbar.ql-snow {
    background: var(--surface, #1e2127);
  }
}
/* Mobile: Topbar wird kleiner / verschwindet — Toolbar an Viewport-Oberkante */
@media (max-width: 900px) {
  #quill-editor-wrap .ql-toolbar.ql-snow { top: 0; }
}
#quill-editor-wrap .ql-container.ql-snow {
  border-bottom-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
  /* `overflow: visible` (vorher `hidden`) — sonst wird das Link-Tooltip
     ("Visit URL: …") abgeschnitten, sobald es unter dem Editor-Rand erscheint.
     Editor-Inhalt bleibt durch den umschließenden #quill-editor-wrap mit
     Border-Radius optisch begrenzt; einzige sichtbare Auswirkung: Tooltips
     dürfen rauslappen, was wir hier explizit wollen. */
  overflow: visible;
}

/* ============================================================
   Link-/Video-Tooltip ("Visit URL:" Popup) — eigene Optik,
   z-index über sticky Toolbar (40), unter Pickern (200).
   ============================================================ */
#quill-editor-wrap .ql-snow .ql-tooltip {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 22px rgba(15,23,42,.12);
  color: var(--admin-text);
  padding: .5rem .85rem;
  font-size: .88rem;
  z-index: 60;
  white-space: nowrap;
  max-width: calc(100% - 1rem);
}
#quill-editor-wrap .ql-snow .ql-tooltip input[type="text"] {
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  padding: .35rem .55rem;
  font-size: .9rem;
  height: auto;
  width: 16rem;
  max-width: 50vw;
  color: var(--admin-text);
  background: #fff;
}
#quill-editor-wrap .ql-snow .ql-tooltip input[type="text"]:focus {
  outline: 0;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 2px var(--admin-primary-light);
}
#quill-editor-wrap .ql-snow .ql-tooltip a {
  color: var(--admin-primary);
  font-weight: 500;
}
#quill-editor-wrap .ql-snow .ql-tooltip a.ql-preview {
  max-width: 22rem;
}
#quill-editor-wrap .ql-snow .ql-tooltip::before {
  color: var(--admin-text-muted);
  font-weight: 500;
}
/* Wenn das Tooltip unter dem Cursor nicht passt, nutzt Quill .ql-flip
   automatisch (transform:translateY(-10px)) — eigenes Styling unverändert */

/* Dark-Mode-Variante */
.admin-scheme-dark #quill-editor-wrap .ql-snow .ql-tooltip,
.admin-scheme-dark #quill-editor-wrap .ql-snow .ql-tooltip input[type="text"] {
  background: var(--surface, #1e2127);
  border-color: var(--border, #2e323a);
  color: var(--text, #e6e8eb);
}
.admin-scheme-dark #quill-editor-wrap .ql-snow .ql-tooltip::before {
  color: var(--text-muted, #a0a4ad);
}
@media (prefers-color-scheme: dark) {
  .admin-scheme-auto #quill-editor-wrap .ql-snow .ql-tooltip,
  .admin-scheme-auto #quill-editor-wrap .ql-snow .ql-tooltip input[type="text"] {
    background: var(--surface, #1e2127);
    border-color: var(--border, #2e323a);
    color: var(--text, #e6e8eb);
  }
}
/* Picker-Dropdowns über Geschwister hinweg sichtbar machen */
#quill-editor-wrap .ql-snow .ql-picker.ql-expanded .ql-picker-options {
  z-index: 50;
}

/*
 * Native <select>-Elemente in der Toolbar zwingend verstecken.
 * Quill sollte das selbst per JS machen, schlägt aber gelegentlich fehl —
 * dann sieht man das Browser-Select statt Quill's Custom-Picker und das
 * Heading-Dropdown lässt sich nur "mit gedrückter Maustaste" benutzen.
 */
#quill-editor-wrap .ql-toolbar select,
.ql-toolbar.ql-snow select {
  display: none !important;
}

/* Sicherstellen, dass die Custom-Picker wirklich klickbar/sichtbar sind */
#quill-editor-wrap .ql-toolbar .ql-picker {
  position: relative;
  z-index: 2;
}
#quill-editor-wrap .ql-toolbar .ql-picker-label {
  cursor: pointer;
  pointer-events: auto;
}
#quill-editor-wrap .ql-toolbar .ql-picker-options {
  pointer-events: auto;
}

/* Header-Custom-Popover (statt Quill's nativem Picker — bleibt offen bis Außenklick) */
.fw-header-popover {
  position: absolute;
  /* Über dem Text+-Block-Dialog (.be-textdialog, 900) — siehe .fw-fontsize-popover. */
  z-index: 1100;
  width: 220px;
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgba(0,0,0,.14);
  padding: 8px;
  font-family: inherit;
}
.fw-header-popover[hidden] { display: none; }
.fw-header-popover .fw-hd-title {
  font-size: .72rem;
  font-weight: 600;
  color: var(--admin-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .25rem .55rem .4rem;
}
.fw-header-popover .fw-hd-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  width: 100%;
  background: transparent;
  border: 0;
  padding: .55rem .65rem;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  color: var(--admin-text);
  font-family: inherit;
  transition: background .12s, color .12s;
}
.fw-header-popover .fw-hd-item:hover {
  background: var(--admin-primary-light, #eef4fb);
}
.fw-header-popover .fw-hd-item.is-active {
  background: var(--admin-primary-light, #eef4fb);
  color: var(--admin-primary);
  font-weight: 600;
}
.fw-header-popover .fw-hd-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  color: var(--admin-primary);
  line-height: 1;
}
.fw-header-popover .fw-hd-label {
  flex: 1;
  font-size: .9rem;
}
.fw-header-popover .fw-hd-sep {
  border: 0;
  border-top: 1px solid var(--admin-border);
  margin: .35rem .25rem;
}

/* Heading-Picker — alte Quill-Native-Picker-Regeln (nicht mehr verwendet,
   bleiben als toter Code erhalten, falls jemand zurückwechselt) */
#quill-editor-wrap .ql-toolbar .ql-picker.ql-header {
  width: 150px;
  height: 26px;
  font-family: inherit;
}
#quill-editor-wrap .ql-toolbar .ql-picker.ql-header .ql-picker-label {
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding-left: 10px;
  padding-right: 22px;
  line-height: 24px;
  font-size: .9rem;
}
#quill-editor-wrap .ql-toolbar .ql-picker.ql-header .ql-picker-label::before {
  line-height: 24px;
}
#quill-editor-wrap .ql-toolbar .ql-picker.ql-header.ql-expanded .ql-picker-label {
  border-color: var(--admin-primary);
  color: var(--admin-primary);
  background: #fff;
}
#quill-editor-wrap .ql-toolbar .ql-picker.ql-header .ql-picker-options {
  min-width: 150px;
  padding: 4px 0;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 18px rgba(0,0,0,.10);
  background: #fff;
}
#quill-editor-wrap .ql-toolbar .ql-picker.ql-header .ql-picker-item {
  padding: 6px 12px;
  font-size: .95rem;
  line-height: 1.3;
}
#quill-editor-wrap .ql-toolbar .ql-picker.ql-header .ql-picker-item:hover {
  background: var(--admin-primary-light, #eef2ff);
}
#quill-editor-wrap .ql-toolbar .ql-picker.ql-header .ql-picker-item.ql-selected {
  color: var(--admin-primary);
  font-weight: 600;
}
#quill-editor-wrap .ql-toolbar .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--admin-primary);
}
#quill-editor-wrap .ql-toolbar .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--admin-primary);
}
#quill-editor-wrap .ql-toolbar .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--admin-primary);
}
#quill-editor-wrap .ql-toolbar .ql-picker.ql-header .ql-picker-item[data-value="4"]::before {
  font-size: .95rem;
  font-weight: 600;
  color: var(--admin-primary);
}
#quill-editor-wrap .ql-toolbar .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before,
#quill-editor-wrap .ql-toolbar .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before {
  content: attr(data-label);
}

/* ============================================================
   Überschriften im Editor (Live-Preview):
   Primärfarbe + größer + spürbarer Abstand. Stimmt strukturell
   mit den meisten Themes überein, das Frontend kann finetunen.
   ============================================================ */
.ql-editor h1,
.ql-editor h2,
.ql-editor h3,
.ql-editor h4 {
  color: var(--admin-primary, #0a6ebd);
  line-height: 1.25;
  letter-spacing: -.01em;
}
.ql-editor h1 { font-size: 2.1rem;  font-weight: 800; margin: 1.5rem 0 .85rem; }
.ql-editor h2 { font-size: 1.65rem; font-weight: 700; margin: 1.3rem 0 .7rem; }
.ql-editor h3 { font-size: 1.3rem;  font-weight: 700; margin: 1.1rem 0 .6rem; }
.ql-editor h4 { font-size: 1.08rem; font-weight: 600; margin: 1rem 0 .5rem; color: var(--admin-text); }

/* ============================================================
   Schriftgrößen-Popover (variable px-Werte)
   ============================================================ */
.fw-fontsize-popover {
  position: absolute;
  /* Muss ÜBER dem Text+-Block-Dialog (.be-textdialog, z-index 900) und dem
     Medien-Picker (1000) liegen — der Popover wird an <body> gehängt, ist also
     Geschwister des Dialogs und würde mit einem niedrigeren Wert dahinter
     verschwinden (Schriftart-/Größe-/Farb-Dropdown „hinter dem Pop-up"). */
  z-index: 1100;
  width: 240px;
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgba(0,0,0,.14);
  padding: 12px;
  font-family: inherit;
}
.fw-fontsize-popover[hidden] { display: none; }
.fw-fontsize-popover .fw-fs-title {
  font-size: .8rem;
  font-weight: 600;
  color: var(--admin-text-muted, #6b7280);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.fw-fontsize-popover .fw-fs-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.fw-fontsize-popover .fw-fs-step {
  width: 28px;
  height: 32px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  color: #333;
}
.fw-fontsize-popover .fw-fs-step:hover {
  background: var(--admin-primary-light);
  border-color: var(--admin-primary);
  color: var(--admin-primary);
}
.fw-fontsize-popover .fw-fs-input {
  flex: 1;
  height: 32px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  font: inherit;
  font-size: .95rem;
  text-align: center;
  -moz-appearance: textfield;
}
.fw-fontsize-popover .fw-fs-input::-webkit-outer-spin-button,
.fw-fontsize-popover .fw-fs-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.fw-fontsize-popover .fw-fs-input:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px var(--admin-primary-light);
}
.fw-fontsize-popover .fw-fs-unit {
  font-size: .85rem;
  color: var(--admin-text-muted, #6b7280);
}
.fw-fontsize-popover .fw-fs-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}
.fw-fontsize-popover .fw-fs-preset {
  flex: 1 0 auto;
  min-width: 36px;
  padding: 4px 8px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
  color: #333;
}
.fw-fontsize-popover .fw-fs-preset:hover {
  background: var(--admin-primary-light);
  border-color: var(--admin-primary);
  color: var(--admin-primary);
}
.fw-fontsize-popover .fw-fs-actions {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.fw-fontsize-popover .fw-fs-actions button {
  flex: 1;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
  border: 1px solid var(--admin-border);
}
.fw-fontsize-popover .fw-fs-reset {
  background: #fff;
  color: #333;
}
.fw-fontsize-popover .fw-fs-reset:hover {
  background: #f1f5f9;
}
.fw-fontsize-popover .fw-fs-apply {
  background: var(--admin-primary);
  color: #fff;
  border-color: var(--admin-primary);
}
.fw-fontsize-popover .fw-fs-apply:hover {
  filter: brightness(.95);
}

/* Textfarben-Popover: erbt Grundlayout, eigene Color-Row + Preset-Swatches */
.fw-textcolor-popover .fw-tc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.fw-textcolor-popover .fw-tc-input {
  width: 44px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
}
.fw-textcolor-popover .fw-tc-input::-webkit-color-swatch-wrapper { padding: 2px; }
.fw-textcolor-popover .fw-tc-input::-webkit-color-swatch {
  border: 0;
  border-radius: 3px;
}
.fw-textcolor-popover .fw-tc-hex {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .85rem;
  color: var(--admin-text-muted, #6b7280);
  letter-spacing: .04em;
}
.fw-textcolor-popover .fw-tc-presets {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.fw-textcolor-popover .fw-tc-preset {
  width: 100%;
  height: 24px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
}
.fw-textcolor-popover .fw-tc-preset:hover {
  outline: 2px solid var(--admin-primary);
  outline-offset: 1px;
}

/* Schriftart-Popover — jeder Eintrag wird in seiner eigenen Familie gerendert,
   damit der User sieht was er bekommt. */
.fw-fontfamily-popover {
  width: 280px;
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.fw-fontfamily-popover .fw-ff-list {
  flex: 1 1 auto;
  overflow-y: auto;
  margin-bottom: 8px;
  padding-right: 2px;
}
.fw-fontfamily-popover .fw-ff-group-label {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--admin-text-muted, #6b7280);
  margin: 8px 4px 4px;
}
.fw-fontfamily-popover .fw-ff-group-label:first-child { margin-top: 0; }
.fw-fontfamily-popover .fw-ff-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  margin-bottom: 4px;
  color: #1a1a1a;
  transition: border-color .15s, background .15s;
}
.fw-fontfamily-popover .fw-ff-item:hover {
  border-color: var(--admin-primary);
  background: var(--admin-primary-light);
}
.fw-fontfamily-popover .fw-ff-item.is-active {
  border-color: var(--admin-primary);
  background: var(--admin-primary-light);
  font-weight: 600;
}

/* Quill-Toolbar: einheitliches Aussehen mit restlichem Admin */
.ql-toolbar.ql-snow {
  border: 0 !important;
  border-bottom: 1px solid var(--admin-border) !important;
  background: #f8fafc;
  padding: .6rem .7rem !important;
}
.ql-container.ql-snow {
  border: 0 !important;
  font-family: inherit;
  font-size: 1rem;
  min-height: 320px;
}
.ql-editor {
  min-height: 320px;
  padding: 1rem 1.2rem !important;
  line-height: 1.7;
}
.ql-editor.ql-blank::before {
  color: #a0a8b4 !important;
  font-style: normal !important;
  font-size: .95rem;
  left: 1.2rem !important;
}
.ql-editor h2 { font-size: 1.4rem; margin: 1.2rem 0 .5rem; }
.ql-editor h3 { font-size: 1.15rem; margin: 1rem 0 .4rem; }
.ql-editor h4 { font-size: 1rem; margin: 1rem 0 .3rem; }
.ql-editor p  { margin: 0 0 .8rem; }
.ql-editor img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem 0;
  border-radius: var(--radius-sm);
}
.ql-editor blockquote {
  border-left: 4px solid var(--admin-primary);
  padding: .4rem 1rem;
  color: var(--admin-text-muted);
  background: #f8fafc;
  margin: 1rem 0;
}
.ql-editor pre.ql-syntax,
.ql-editor code {
  background: #1f2937;
  color: #e5e7eb;
  font-family: "SF Mono", Monaco, Consolas, monospace;
  padding: .1rem .4rem;
  border-radius: 3px;
  font-size: .9rem;
}
.ql-editor pre.ql-syntax {
  padding: .8rem 1rem;
  margin: 1rem 0;
  overflow-x: auto;
}
.ql-editor a { color: var(--admin-primary); }

/* Quill Icons dezenter */
.ql-snow .ql-stroke { stroke: #4b5563; }
.ql-snow .ql-fill { fill: #4b5563; }
.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke,
.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke {
  stroke: var(--admin-primary) !important;
}
.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill {
  fill: var(--admin-primary) !important;
}
.ql-snow.ql-toolbar button:hover,
.ql-snow.ql-toolbar button.ql-active {
  color: var(--admin-primary) !important;
}
.ql-snow .ql-picker-label:hover,
.ql-snow .ql-picker-label.ql-active {
  color: var(--admin-primary) !important;
}

.editor-hint {
  color: var(--admin-text-muted);
  font-size: .82rem;
  margin-top: .4rem;
  font-weight: normal;
}

/* ==========================================================================
   Scroll-Menü Editor (Sprungmarken-Liste pro Seite)
   ========================================================================== */
.scroll-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.scroll-menu-item {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .8rem 1rem;
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  margin-bottom: .5rem;
  cursor: default;
}
.scroll-menu-item.is-dragging {
  opacity: .5;
  background: #f1f5f9;
}
.scroll-menu-item .drag-handle {
  cursor: grab;
  color: #94a3b8;
  user-select: none;
  font-weight: bold;
  letter-spacing: -2px;
  padding: 0 .4rem;
}
.scroll-menu-item .drag-handle:active { cursor: grabbing; }
.scroll-menu-item .scroll-tag {
  text-transform: uppercase;
  font-size: .7rem;
  letter-spacing: .05em;
}
.scroll-menu-item .scroll-anchor-code {
  font-size: .8rem;
  color: var(--admin-text-muted);
  background: #f1f5f9;
  padding: .15rem .5rem;
  border-radius: 3px;
  white-space: nowrap;
}
.scroll-menu-item .scroll-label-input {
  flex: 1;
  min-width: 0;
  padding: .4rem .6rem;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
}
.scroll-menu-item .scroll-label-input:focus {
  border-color: var(--admin-primary);
  outline: none;
}

/* iOS-style toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 22px;
  transition: background .15s;
  cursor: pointer;
}
.switch-slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .switch-slider { background: var(--admin-primary); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

/* ==========================================================================
   Editor: fw-anchor (Sprungmarke als Pille mit 📍 + Label)
   ========================================================================== */
.ql-editor .fw-anchor {
  display: inline-block;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  color: #78350f;
  border-radius: 999px;
  padding: 1px 10px;
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.5;
  margin: 0 2px;
  user-select: none;
  cursor: default;
  white-space: nowrap;
  vertical-align: baseline;
}
.ql-editor .fw-anchor::selection { background: #fde68a; }

/* ==========================================================================
   Editor: fw-image (Figur mit Ausrichtung/Größe)
   ========================================================================== */
.ql-editor .fw-image {
  margin: 1rem 0;
  display: block;
  position: relative;
  cursor: pointer;
  transition: outline-color .15s;
  outline: 2px solid transparent;
  outline-offset: 2px;
}
.ql-editor .fw-image:hover {
  outline-color: var(--admin-primary-light);
}
.ql-editor .fw-image img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}
.ql-editor .fw-image figcaption {
  font-size: .88rem;
  color: #666;
  font-style: italic;
  text-align: center;
  padding: .5rem .3rem 0;
  min-height: 1.4em;
}
.ql-editor .fw-image figcaption.is-empty::before {
  content: attr(data-placeholder);
  color: #bbb;
  font-style: italic;
}
.ql-editor .fw-image figcaption:focus {
  outline: 1px dashed var(--admin-primary);
  outline-offset: 2px;
  background: #f8fafc;
}

/* === Ausrichtungen === */
.ql-editor .fw-image.align-left  { float: left;  margin: .3rem 1.5rem 1rem 0; }
.ql-editor .fw-image.align-right { float: right; margin: .3rem 0 1rem 1.5rem; }
.ql-editor .fw-image.align-center { float: none; margin-left: auto; margin-right: auto; }

/* === Größen === */
.ql-editor .fw-image.size-small  { width: 25%; }
.ql-editor .fw-image.size-medium { width: 50%; }
.ql-editor .fw-image.size-large  { width: 75%; }
.ql-editor .fw-image.size-full   { width: 100%; float: none; margin-left: 0; margin-right: 0; }

/* Fix: align-center + size-full = zentriert, nicht ganz links */
.ql-editor .fw-image.size-full.align-center { margin-left: auto; margin-right: auto; }

/* ==========================================================================
   Editor: fw-video (Figur mit Video-Player + Caption)
   Strukturell identisch zu fw-image: Align/Size-Klassen, Caption-Slot.
   ========================================================================== */
.ql-editor .fw-video {
  margin: 1rem 0;
  display: block;
  position: relative;
  cursor: pointer;
  transition: outline-color .15s;
  outline: 2px solid transparent;
  outline-offset: 2px;
}
.ql-editor .fw-video:hover { outline-color: var(--admin-primary-light); }
.ql-editor .fw-video.is-selected { outline-color: var(--admin-primary); }
.ql-editor .fw-video video {
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
  background: #000;
  border-radius: 4px;
}
.ql-editor .fw-video figcaption {
  font-size: .88rem;
  color: #666;
  font-style: italic;
  text-align: center;
  padding: .5rem .3rem 0;
  min-height: 1.4em;
}
.ql-editor .fw-video figcaption.is-empty::before {
  content: attr(data-placeholder);
  color: #bbb;
  font-style: italic;
}
.ql-editor .fw-video figcaption:focus {
  outline: 1px dashed var(--admin-primary);
  outline-offset: 2px;
  background: #f8fafc;
}

.ql-editor .fw-video.align-left   { float: left;  margin: .3rem 1.5rem 1rem 0; }
.ql-editor .fw-video.align-right  { float: right; margin: .3rem 0 1rem 1.5rem; }
.ql-editor .fw-video.align-center { float: none; margin-left: auto; margin-right: auto; }

.ql-editor .fw-video.size-small  { width: 35%; }
.ql-editor .fw-video.size-medium { width: 60%; }
.ql-editor .fw-video.size-large  { width: 80%; }
.ql-editor .fw-video.size-full   { width: 100%; float: none; margin-left: 0; margin-right: 0; }
.ql-editor .fw-video.size-full.align-center { margin-left: auto; margin-right: auto; }

/* Clearfix nach Absätzen mit Floats */
.ql-editor p::after { content: ""; display: table; clear: both; }

/* === Side-Text-Box: Bild + Text-Spalte nebeneinander === */
.ql-editor .fw-image.has-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  grid-template-areas: "img side" "cap side";
  gap: 0 1.25rem;
  width: 100% !important;
  float: none !important;
  margin: 1rem 0;
}
.ql-editor .fw-image.has-side > img        { grid-area: img; max-width: 100%; height: auto; }
.ql-editor .fw-image.has-side > figcaption { grid-area: cap; text-align: left; }
.ql-editor .fw-image.has-side > .fw-image__side { grid-area: side; }
.ql-editor .fw-image.has-side.side-left  { grid-template-areas: "side img" "side cap"; }
.ql-editor .fw-image.has-side.side-right { grid-template-areas: "img side" "cap side"; }

.ql-editor .fw-image__side {
  padding: .5rem .65rem;
  font-size: .95rem;
  line-height: 1.55;
  color: #333;
  min-height: 4em;
  align-self: stretch;
}
.ql-editor .fw-image__side:focus {
  outline: 1px dashed var(--admin-primary);
  outline-offset: 2px;
  background: #f8fafc;
}
.ql-editor .fw-image__side.is-empty::before {
  content: attr(data-placeholder);
  color: #bbb;
  font-style: italic;
}

@media (max-width: 600px) {
  .ql-editor .fw-image.has-side {
    grid-template-columns: 1fr !important;
    grid-template-areas: "img" "cap" "side" !important;
  }
}

/* "Noop"-Button (erster Toolbar-Slot vor B): unsichtbar, ohne Funktion, ohne Klick.
   Bleibt aber im DOM, weil dadurch ein Layout-Problem im ersten Button vermieden wird. */
.ql-toolbar .ql-noop {
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

/* ==========================================================================
   Image-Toolbar (Bubble-Style)
   ========================================================================== */
.fw-image-toolbar[hidden] { display: none; }
.fw-image-toolbar {
  position: absolute;
  /* Über dem Text+-Block-Dialog (900), aber unter dem Medien-Picker (1000),
     damit die Bild-Bubble im Dialog anklickbar ist, ohne über dem Picker zu
     schweben. */
  z-index: 950;
  background: #1f2937;
  color: #fff;
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  display: flex;
  gap: 4px;
  font-size: .85rem;
}
.fw-image-toolbar::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1f2937;
  border-bottom: 0;
}
.fw-image-toolbar .tb-group {
  display: flex;
  gap: 2px;
  padding: 0 4px;
  border-right: 1px solid #374151;
}
.fw-image-toolbar .tb-group:last-child { border-right: 0; }
.fw-image-toolbar button {
  background: transparent;
  color: #fff;
  border: 0;
  padding: .35rem .55rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  min-width: 32px;
  line-height: 1;
  transition: background .15s;
}
.fw-image-toolbar button:hover { background: #374151; }
.fw-image-toolbar button.active {
  background: var(--admin-primary);
}
.fw-image-toolbar button.tb-danger:hover {
  background: #dc2626;
}

/* ==========================================================================
   Table-Toolbar (Bubble-Style, übernimmt Look der Image-Toolbar)
   ========================================================================== */
.fw-table-toolbar[hidden] { display: none; }
.fw-table-toolbar {
  position: absolute;
  /* siehe .fw-image-toolbar: über dem Dialog (900), unter dem Medien-Picker (1000) */
  z-index: 950;
  background: #1f2937;
  color: #fff;
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  display: flex;
  gap: 4px;
  font-size: .85rem;
  flex-wrap: wrap;
  max-width: min(640px, calc(100vw - 16px));
}
.fw-table-toolbar::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1f2937;
  border-bottom: 0;
}
.fw-table-toolbar.below::after {
  bottom: auto;
  top: -6px;
  border-top: 0;
  border-bottom-color: #1f2937;
}
.fw-table-toolbar .tb-group {
  display: flex;
  gap: 2px;
  padding: 0 4px;
  border-right: 1px solid #374151;
}
.fw-table-toolbar .tb-group:last-child { border-right: 0; }
.fw-table-toolbar button {
  background: transparent;
  color: #fff;
  border: 0;
  padding: .35rem .55rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  line-height: 1;
  transition: background .15s;
  white-space: nowrap;
}
.fw-table-toolbar button:hover { background: #374151; }
.fw-table-toolbar button.tb-danger:hover { background: #dc2626; }

/* ==========================================================================
   Editor: fw-table
   ========================================================================== */
.ql-editor .fw-table {
  margin: 1.2rem 0;
  /* Default-Cursor wäre 'pointer' (Tabelle als Block anwählen).
     Sobald der User aber innerhalb von <td> steht, soll der Caret-Cursor
     erscheinen — sonst fühlt sich das Tippen nicht wie Tippen an. */
  cursor: default;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color .15s;
  overflow-x: auto;
}
.ql-editor .fw-table:hover { outline-color: var(--admin-primary-light); }
.ql-editor .fw-table.is-selected { outline-color: var(--admin-primary); }
.ql-editor .fw-table table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}
.ql-editor .fw-table td {
  border: 1px solid var(--admin-border, #d1d5db);
  padding: .5rem .65rem;
  min-width: 60px;
  /* Mindesthöhe: leere Zellen sollen anklickbar bleiben. Ohne diese
     Höhe kollabiert eine leere Zeile auf 0 px und der User kann sie
     nicht mehr per Klick ansteuern. */
  min-height: 1.6em;
  vertical-align: top;
  word-break: break-word;
  cursor: text;
}
.ql-editor .fw-table td:focus {
  outline: 2px solid var(--admin-primary);
  outline-offset: -2px;
}
/* Aktive Zelle dezent hervorheben — aber nicht den Lesefluss stören.
   Der echte Fokus-Outline (oben) bleibt der primäre Indikator. */
.ql-editor .fw-table td.is-active-cell {
  background: color-mix(in srgb, var(--admin-primary, #0ea5e9) 8%, transparent);
}
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
  .ql-editor .fw-table td.is-active-cell { background: var(--admin-primary-light, #e0f2fe); }
}
.ql-editor .fw-table td img,
.ql-editor .fw-table td .fw-table-img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: .25rem 0;
  border-radius: var(--radius-sm, 4px);
}

/* Tabellen-Insert-Popover (erbt Grundlayout vom fontSize-Popover) */
.fw-table-insert-popover { width: 260px; }
.fw-table-insert-popover .fw-tbl-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.fw-table-insert-popover .fw-tbl-row label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .8rem;
  color: var(--admin-text-muted, #6b7280);
}
.fw-table-insert-popover .fw-tbl-row input {
  height: 32px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  font: inherit;
  font-size: .95rem;
  text-align: center;
  -moz-appearance: textfield;
}
.fw-table-insert-popover .fw-tbl-row input::-webkit-outer-spin-button,
.fw-table-insert-popover .fw-tbl-row input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.fw-table-insert-popover .fw-tbl-row input:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px var(--admin-primary-light);
}

/* ==========================================================================
   Editor: fw-gallery
   ========================================================================== */
.ql-editor .fw-gallery {
  display: grid;
  gap: .5rem;
  margin: 1.2rem 0;
  cursor: pointer;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color .15s;
}
.ql-editor .fw-gallery:hover { outline-color: var(--admin-primary-light); }
.ql-editor .fw-gallery.is-selected { outline-color: var(--admin-primary); }

.ql-editor .fw-gallery a {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-sm);
  pointer-events: none; /* Klick geht an Gallery */
}
.ql-editor .fw-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Layouts */
.ql-editor .fw-gallery.layout-grid2  { grid-template-columns: repeat(2, 1fr); }
.ql-editor .fw-gallery.layout-grid3  { grid-template-columns: repeat(3, 1fr); }
.ql-editor .fw-gallery.layout-grid4  { grid-template-columns: repeat(4, 1fr); }
.ql-editor .fw-gallery.layout-grid2 a,
.ql-editor .fw-gallery.layout-grid3 a,
.ql-editor .fw-gallery.layout-grid4 a { aspect-ratio: 1/1; }

.ql-editor .fw-gallery.layout-masonry {
  display: block;
  column-count: 3;
  column-gap: .5rem;
}
.ql-editor .fw-gallery.layout-masonry a {
  display: block;
  margin-bottom: .5rem;
  break-inside: avoid;
}
.ql-editor .fw-gallery.layout-masonry img { height: auto; aspect-ratio: auto; }

.ql-editor .fw-gallery.layout-carousel {
  display: flex;
  overflow-x: auto;
  gap: .5rem;
  scroll-snap-type: x mandatory;
}
.ql-editor .fw-gallery.layout-carousel a {
  flex: 0 0 280px;
  aspect-ratio: 4/3;
  scroll-snap-align: start;
}

/* ==========================================================================
   Multi-Select Picker
   ========================================================================== */
.picker-item { position: relative; }
.picker-item .picker-check {
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: 24px;
  height: 24px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(0,0,0,.3);
  box-shadow: 0 0 0 1px rgba(0,0,0,.2);
  transition: background .15s;
}
.picker-item.is-picked .picker-check {
  background: var(--admin-primary);
  border-color: #fff;
}
.picker-item.is-picked .picker-check::after {
  content: "✓";
  color: #fff;
  font-weight: 700;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
}
.picker-item.is-picked .media-thumb {
  outline: 3px solid var(--admin-primary);
  outline-offset: -3px;
}

.media-picker-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.picker-count {
  font-size: .85rem;
  color: var(--admin-text-muted);
  background: var(--admin-primary-light);
  padding: .2rem .6rem;
  border-radius: 999px;
  color: var(--admin-primary);
  font-weight: 600;
}

.media-picker-footer > div {
  display: flex;
  gap: .5rem;
}

/* ==========================================================================
   Galerie-Manager (Sort-Dialog)
   ========================================================================== */
.gallery-manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .8rem;
  margin-top: 1rem;
}
.gm-item {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  user-select: none;
}
.gm-item.is-dragging {
  opacity: .4;
  cursor: grabbing;
}
.gm-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.gm-remove {
  position: absolute;
  top: .3rem; right: .3rem;
  width: 24px; height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.7);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.gm-remove:hover { background: var(--admin-danger); }

/* ==========================================================================
   Seitenliste: Toolbar, Filter, Suche
   ========================================================================== */
.list-toolbar {
  background: var(--admin-surface);
  padding: .8rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.list-filters {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
}
.filter-chip {
  padding: .4rem .9rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--admin-text);
  background: #f1f5f9;
  font-size: .88rem;
  transition: background .15s, color .15s;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.filter-chip:hover { background: #e2e8f0; }
.filter-chip.is-active {
  background: var(--admin-primary);
  color: #fff;
}
.chip-count {
  background: rgba(255,255,255,.2);
  padding: .05rem .4rem;
  border-radius: 999px;
  font-size: .75rem;
}
.filter-chip:not(.is-active) .chip-count {
  background: var(--admin-surface);
  color: var(--admin-text-muted);
}

.list-search {
  display: flex;
  gap: .3rem;
  align-items: center;
}
.list-search input[type="search"] {
  min-width: 240px;
  padding: .5rem .8rem;
}

/* Bulk-Bar */
.bulk-bar {
  background: #fff7e6;
  border: 1px solid #fbd38d;
  padding: .7rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.bulk-bar > span:first-child {
  font-weight: 600;
  margin-right: .5rem;
}

/* Tabelle Anpassungen für Checkbox */
.data-table .col-check { width: 36px; }
.data-table .col-actions { width: 1%; white-space: nowrap; }
.data-table .col-date { white-space: nowrap; color: var(--admin-text-muted); font-size: .85rem; }
.row-title {
  color: var(--admin-text);
  text-decoration: none;
  font-weight: 600;
}
.row-title:hover { color: var(--admin-primary); }
.row-title-muted {
  color: var(--admin-text-muted);
  text-decoration: line-through;
}

/* Pagination */
.pagination {
  display: flex;
  gap: .3rem;
  margin-top: 1.5rem;
  justify-content: center;
}
.pagination a {
  padding: .4rem .8rem;
  background: var(--admin-surface);
  border-radius: var(--radius-sm);
  color: var(--admin-text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  font-size: .9rem;
}
.pagination a:hover { background: var(--admin-primary-light); }
.pagination a.is-active {
  background: var(--admin-primary);
  color: #fff;
}

/* Autosave Status */
.autosave-status {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: .5rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  color: var(--admin-text-muted);
  background: rgba(255,255,255,0);
  transition: background .2s;
  z-index: 100;
  pointer-events: none;
}
.autosave-status.saving {
  background: #fef3c7;
  color: #92400e;
}
.autosave-status.saved {
  background: var(--admin-success-light);
  color: var(--admin-success);
}
.autosave-status.error {
  background: var(--admin-danger-light);
  color: var(--admin-danger);
}
.autosave-status:empty { display: none; }

/* ==========================================================================
   Medien: Drag & Drop Zone
   ========================================================================== */
.drop-zone {
  background: #fafbfc;
  border: 2px dashed var(--admin-border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
  transition: background .15s, border-color .15s;
}
.drop-zone.is-drag {
  background: var(--admin-primary-light);
  border-color: var(--admin-primary);
  border-style: solid;
}
.drop-zone-hint {
  color: var(--admin-text-muted);
  font-size: .95rem;
  pointer-events: none;
}
.drop-zone.is-drag .drop-zone-hint {
  color: var(--admin-primary);
  font-weight: 600;
}

.drop-zone-progress {
  max-width: 400px;
  margin: 0 auto;
}
.progress-bar {
  background: #e5e9f0;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: .5rem;
}
.progress-bar-inner {
  background: var(--admin-primary);
  height: 100%;
  width: 0%;
  transition: width .3s;
}
.progress-text {
  font-size: .9rem;
  color: var(--admin-text-muted);
}

/* ==========================================================================
   Medien: Alt-Warnung
   ========================================================================== */
.alt-warning {
  color: #b45309;
  background: #fffbeb;
  padding: .15rem .4rem;
  border-radius: 3px;
  font-size: .72rem;
  margin-top: .3rem;
  display: inline-block;
}

/* ==========================================================================
   Medien-Detail-Seite
   ========================================================================== */
.media-detail-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
}
@media (max-width: 900px) {
  .media-detail-layout { grid-template-columns: 1fr; }
}

.media-detail-preview {
  background: #1f2937;
  padding: 1.5rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}
.media-detail-preview img {
  max-width: 100%;
  max-height: 600px;
  display: block;
  border-radius: var(--radius-sm);
}

.media-detail-info .sidebar-box {
  margin-bottom: 1rem;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.detail-table td {
  padding: .3rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.detail-table td:first-child {
  color: var(--admin-text-muted);
  width: 40%;
}

.size-variants { display: flex; flex-direction: column; gap: .5rem; }
.size-variant {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.size-variant > span:first-child {
  font-size: .8rem;
  color: var(--admin-text-muted);
  width: 60px;
}
.size-variant input {
  flex: 1;
  font-size: .75rem;
  padding: .3rem .5rem;
  border: 1px solid var(--admin-border);
  border-radius: 3px;
  font-family: "SF Mono", Monaco, Consolas, monospace;
  background: #f8fafc;
}

.usage-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.usage-list li {
  padding: .4rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.usage-list li:last-child { border-bottom: 0; }
.usage-list a {
  color: var(--admin-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.usage-list a:hover { color: var(--admin-primary); }
.usage-type {
  background: #f1f5f9;
  padding: .1rem .4rem;
  border-radius: 3px;
  font-size: .7rem;
  text-transform: uppercase;
  color: var(--admin-text-muted);
}

/* ==========================================================================
   Menüs: Übersicht
   ========================================================================== */
.menu-overview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.menu-overview-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.3rem;
  background: var(--admin-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform .1s, box-shadow .15s;
  border-left: 4px solid transparent;
}
.menu-overview-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-left-color: var(--admin-primary);
}
.menu-overview-icon {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  background: var(--admin-primary-light);
  color: var(--admin-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.menu-overview-body h3 {
  margin: 0 0 .3rem;
  font-size: 1.05rem;
}
.menu-overview-body p {
  margin: 0 0 .4rem;
  color: var(--admin-text-muted);
  font-size: .88rem;
}
.menu-slug {
  font-size: .7rem;
  background: #f1f5f9;
  padding: .1rem .4rem;
  border-radius: 3px;
  margin-left: .3rem;
  color: var(--admin-text-muted);
}
.menu-overview-arrow {
  color: var(--admin-primary);
  font-size: 1.3rem;
}

/* ==========================================================================
   Menü-Editor
   ========================================================================== */
.menu-editor-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
}
@media (max-width: 900px) {
  .menu-editor-layout { grid-template-columns: 1fr; }
}

.menu-editor-sidebar .sidebar-box {
  margin-bottom: 1rem;
}
.add-item-section hr {
  border: 0;
  border-top: 1px solid var(--admin-border);
  margin: 1rem 0;
}

.menu-editor-main {
  background: var(--admin-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}
.menu-editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--admin-border);
  flex-wrap: wrap;
  gap: 1rem;
}
.menu-editor-toolbar h2 { margin: 0; font-size: 1.1rem; }

/* Menü-Baum */
.menu-tree {
  min-height: 100px;
}
.menu-tree-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.menu-tree-list[data-depth="1"] { padding-left: 1.5rem; border-left: 2px dashed var(--admin-border); margin-left: .6rem; }
.menu-tree-list[data-depth="2"] { padding-left: 1.5rem; border-left: 2px dashed var(--admin-border); margin-left: .6rem; }
.menu-tree-list[data-depth="3"] { padding-left: 1.5rem; border-left: 2px dashed var(--admin-border); margin-left: .6rem; }

.menu-tree-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: .5rem;
  background: #fafbfc;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  padding: .5rem .7rem;
  margin-bottom: .5rem;
  transition: background .15s, border-color .15s, transform .1s;
  position: relative;
}
.menu-tree-item:hover {
  background: #fff;
  border-color: var(--admin-primary-light);
}
.menu-tree-item.is-dragging {
  opacity: .4;
}
.menu-tree-item.drop-target-before::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--admin-primary);
  border-radius: 2px;
}
.menu-tree-item.drop-target-after::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--admin-primary);
  border-radius: 2px;
}
.menu-tree-item.drop-target-inside {
  border-color: var(--admin-primary);
  background: var(--admin-primary-light);
}

.mti-handle {
  cursor: grab;
  color: var(--admin-text-muted);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  font-weight: 700;
}
.menu-tree-item.is-dragging .mti-handle {
  cursor: grabbing;
}

.mti-body {
  min-width: 0;
}
.mti-row {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}
.mti-type {
  font-size: .7rem;
  text-transform: uppercase;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 3px;
  letter-spacing: .3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.mti-type.page { background: #e0eefc; color: #0a6ebd; }
.mti-type.url  { background: #fef3c7; color: #92400e; } /* Default url (Externer Link) — warnendes Gelb */
.mti-type.url.is-external { background: #fef3c7; color: #92400e; }
.mti-type.url.is-internal { background: #cffafe; color: #0e7490; } /* dezentes Türkis — interne Routen (Module/Pfade) */
.mti-type.url.is-contact  { background: #ede9fe; color: #5b21b6; } /* sanftes Lila — mailto/tel */
.mti-type.separator { background: #f1f5f9; color: #6b7380; }

.mti-label {
  flex: 1;
  min-width: 120px;
  padding: .3rem .5rem !important;
  font-size: .9rem !important;
  box-shadow: none !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  font-weight: 600;
}
.mti-label:focus {
  background: #fff !important;
  border-color: var(--admin-primary) !important;
}
.mti-url {
  flex: 2;
  min-width: 180px;
  padding: .3rem .5rem !important;
  font-size: .82rem !important;
  font-family: "SF Mono", Monaco, Consolas, monospace;
  box-shadow: none !important;
}

.mti-checkbox {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  margin: 0 !important;
  font-size: .85rem;
  color: var(--admin-text-muted);
  padding: .2rem .4rem;
  background: #f1f5f9;
  border-radius: 3px;
  cursor: pointer;
}
.mti-checkbox input {
  margin: 0;
  transform: scale(.9);
}
.mti-checkbox:has(input:checked) {
  background: var(--admin-primary-light);
  color: var(--admin-primary);
  font-weight: 600;
}

.mti-remove {
  background: transparent;
  border: 0;
  color: var(--admin-text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  line-height: 1;
  flex-shrink: 0;
}
.mti-remove:hover {
  background: var(--admin-danger-light);
  color: var(--admin-danger);
}

.mti-meta {
  font-size: .78rem;
  color: var(--admin-text-muted);
  margin-top: .2rem;
}

/* Hero-Box hervorheben, damit sie deutlich als spezieller Bereich wirkt */
.hero-box {
  border-left: 4px solid var(--admin-accent);
  background: linear-gradient(to right, #fff8ee, #fff 40%);
}
.hero-box h3 {
  color: var(--admin-accent);
}

.hero-divider {
  border: 0;
  border-top: 1px solid var(--admin-border);
  margin: 1.2rem 0 1rem;
}
.hero-subhead {
  font-size: .9rem;
  color: var(--admin-primary-dark);
  margin-bottom: .3rem;
}
.hero-img-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: .7rem;
  align-items: center;
  padding: .55rem .65rem;
  margin-bottom: .4rem;
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  transition: border-color .12s, box-shadow .12s;
}
.hero-img-row:has(input[value]:not([value=""])) {
  border-color: var(--admin-accent);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.hero-img-row:last-of-type {
  margin-bottom: 0;
}
.hero-img-preview {
  width: 60px;
  height: 60px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  color: var(--admin-muted, #6b7280);
}
.hero-img-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-img-fields {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.hero-img-label {
  font-size: .85rem !important;
  padding: .35rem .55rem !important;
}
.hero-img-buttons {
  display: flex;
  gap: .3rem;
}
.hero-img-buttons .btn-sm {
  padding: .25rem .6rem;
  font-size: .75rem;
}

/* ==========================================================================
   Hero-Box: Vertikale Tabs (Texte / Bilder / Theme-Inhalte)
   Sidebar-Platz ist knapp — daher gestapelte Pills statt überlappender Tabs.
   ========================================================================== */
.hero-intro {
  margin-bottom: .8rem;
  font-size: .82rem;
  color: var(--admin-muted, #6b7280);
}
.hero-tabs {
  margin-top: .4rem;
}
.hero-tabs__nav {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  margin-bottom: 1rem;
  background: #f5f6f8;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  padding: .25rem;
}
.hero-tabs__btn {
  width: 100%;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: .55rem;
  padding: .5rem .65rem;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  color: var(--admin-text, #1f2937);
  cursor: pointer;
  border-radius: 4px;
  text-align: left;
  transition: background .12s, color .12s;
}
.hero-tabs__btn:hover {
  background: rgba(0,0,0,.04);
}
.hero-tabs__btn.is-active {
  background: #fff;
  color: var(--admin-accent);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.hero-tabs__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 1rem;
  line-height: 1;
  border-radius: 4px;
  background: var(--admin-border);
  color: var(--admin-primary-dark);
  flex-shrink: 0;
}
.hero-tabs__btn.is-active .hero-tabs__icon {
  background: var(--admin-accent);
  color: #fff;
}
.hero-tabs__btn > span:nth-child(2) {
  /* Label-Text */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.hero-tabs__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 .4rem;
  border-radius: 10px;
  background: rgba(0,0,0,.08);
  color: var(--admin-primary-dark);
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}
.hero-tabs__btn.is-active .hero-tabs__badge {
  background: var(--admin-accent);
  color: #fff;
}
.hero-tabs__panel {
  display: none;
}
.hero-tabs__panel.is-active {
  display: block;
  animation: heroTabFade .18s ease-out;
}
@keyframes heroTabFade {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Field-Groups innerhalb eines Tabs */
.hero-field-group {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  padding: .85rem 1rem 1rem;
  margin-bottom: .7rem;
  position: relative;
}
.hero-field-group__title {
  font-size: .72rem;
  margin: 0 0 .7rem;
  color: var(--admin-muted, #6b7280);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.hero-field-group__title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 12px;
  background: var(--admin-accent);
  border-radius: 2px;
}
.hero-field-group__row {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: .6rem;
}
.hero-field-group__row label { margin-bottom: 0; }
.hero-field-group label { margin-bottom: .5rem; }
.hero-field-group label:last-child { margin-bottom: 0; }
@media (max-width: 540px) {
  .hero-field-group__row { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Theme-Fields (theme-fields.php Schema-System)
   Sektionen sind kollabierbar (<details>) damit der Tab nicht endlos wird.
   ========================================================================== */
.tf-section {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  margin-bottom: .5rem;
  overflow: hidden;
  transition: border-color .12s, box-shadow .12s;
}
.tf-section[open] {
  border-color: var(--admin-accent);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.tf-section-summary {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: .5rem;
  padding: .65rem .85rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-weight: 600;
  color: var(--admin-primary-dark);
  transition: background .12s;
}
.tf-section-summary::-webkit-details-marker { display: none; }
.tf-section-summary:hover {
  background: rgba(0,0,0,.02);
}
.tf-section-title {
  font-size: .87rem;
  font-weight: 700;
  color: var(--admin-primary-dark);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tf-section-tags {
  display: inline-flex;
  gap: .25rem;
}
.tf-section-tags {
  display: inline-flex;
  gap: .25rem;
}
.tf-tag {
  display: inline-block;
  padding: .12rem .5rem;
  background: rgba(0,0,0,.06);
  color: var(--admin-primary-dark);
  border-radius: 3px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.tf-section[open] .tf-tag {
  background: var(--admin-accent);
  color: #fff;
}
.tf-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 .35rem;
  border-radius: 10px;
  background: rgba(0,0,0,.06);
  color: var(--admin-primary-dark);
  font-size: .7rem;
  font-weight: 700;
}
.tf-section[open] .tf-section-count {
  background: var(--admin-accent);
  color: #fff;
}
.tf-section-chevron {
  font-size: .72rem;
  color: var(--admin-muted, #6b7280);
  transition: transform .2s;
  margin-left: .1rem;
  width: 14px;
  text-align: center;
}
.tf-section[open] .tf-section-chevron {
  transform: rotate(180deg);
  color: var(--admin-accent);
}
.tf-section[open] .tf-section-summary {
  border-bottom: 1px solid var(--admin-border);
  background: rgba(0,0,0,.015);
}
.tf-section-body {
  padding: .8rem 1rem 1rem;
}
.tf-section-desc {
  font-size: .8rem;
  color: var(--admin-muted, #6b7280);
  margin: 0 0 .8rem;
  line-height: 1.45;
}
.tf-label {
  display: block;
  margin-bottom: .6rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--admin-text, #1f2937);
}
.tf-label input[type="text"],
.tf-label input[type="number"],
.tf-label textarea,
.tf-label select {
  width: 100%;
  margin-top: .25rem;
  font-weight: 400;
  font-size: .9rem;
}
.tf-label--inline {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-right: 1rem;
}
.tf-label--inline input[type="checkbox"] {
  margin: 0;
}

/* Repeater */
.tf-repeater {
  margin-bottom: .6rem;
}
.tf-repeater-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .4rem;
}
.tf-repeater-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--admin-primary-dark);
  letter-spacing: .02em;
}
.tf-repeater-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: .5rem;
}
.tf-repeater-row {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 4px;
  padding: .6rem .8rem;
  position: relative;
}
.tf-repeater-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .5rem;
  padding-bottom: .4rem;
  border-bottom: 1px dashed var(--admin-border);
}
.tf-repeater-row-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--admin-muted, #6b7280);
}
.tf-repeater-row-body .tf-label:last-child {
  margin-bottom: 0;
}
.tf-repeater-add {
  width: 100%;
  padding: .5rem .8rem;
  background: var(--admin-accent);
  color: #fff;
  border: 0;
  border-radius: 4px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.tf-repeater-add:hover {
  background: var(--admin-primary-dark);
}
.tf-repeater-add[disabled] {
  background: var(--admin-border);
  color: var(--admin-muted, #6b7280);
  cursor: not-allowed;
}
.tf-repeater[data-empty="1"] .tf-repeater-list {
  border: 1px dashed var(--admin-border);
  border-radius: 4px;
  padding: .8rem;
  text-align: center;
  color: var(--admin-muted, #6b7280);
  font-size: .82rem;
  font-style: italic;
}

/* ==========================================================================
   Theme-Carousel
   ========================================================================== */
.theme-carousel {
  position: relative;
  margin: 0 -1rem 2rem;
  padding: 0 3rem;
}

.theme-carousel-viewport {
  overflow: hidden;
  padding: 0.5rem 0;
}

.theme-carousel-track {
  display: flex;
  gap: 1rem;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.theme-carousel .theme-card {
  flex: 0 0 calc(33.333% - 0.667rem); /* 3 sichtbar, mit gap berücksichtigt */
  min-width: 280px;
  scroll-snap-align: start;
}

@media (max-width: 1100px) {
  .theme-carousel .theme-card {
    flex: 0 0 calc(50% - 0.5rem); /* 2 sichtbar */
  }
}

@media (max-width: 700px) {
  .theme-carousel .theme-card {
    flex: 0 0 100%;              /* 1 sichtbar */
  }
  .theme-carousel { padding: 0 2.5rem; }
}

/* Carousel-Buttons */
.theme-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 1px solid var(--admin-border);
  background: var(--admin-surface);
  color: var(--admin-text);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  z-index: 5;
}
.theme-carousel-btn:hover:not(:disabled) {
  background: var(--admin-primary);
  color: #fff;
  border-color: var(--admin-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-50%) scale(1.05);
}
.theme-carousel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.theme-carousel-prev { left: 0; }
.theme-carousel-next { right: 0; }

/* Dots */
.theme-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1rem;
}
.theme-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--admin-border);
  border: 0;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
}
.theme-carousel-dot.is-active {
  background: var(--admin-primary);
  width: 24px;
  border-radius: 4px;
}
.theme-carousel-dot:hover {
  background: var(--admin-primary-light);
}

/* ==========================================================================
   Dashboard – Redesign
   ========================================================================== */
.dash-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  background: linear-gradient(135deg, var(--admin-primary) 0%, #1c4f8a 100%);
  color: #fff;
  padding: 1.8rem 2rem;
  border-radius: var(--radius);
  margin-bottom: 1.6rem;
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
}
.dash-hero h1 {
  margin: 0 0 .3rem;
  color: #fff;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.dash-hero .muted {
  color: rgba(255,255,255,.78);
}
.dash-hero strong { color: #fff; }
.dash-hero-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}
.dash-hero-actions .btn-primary {
  background: #fff;
  color: var(--admin-primary);
  font-weight: 600;
}
.dash-hero-actions .btn-primary:hover { background: #f3f6fa; }
.dash-hero-actions .btn-secondary {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
}
.dash-hero-actions .btn-secondary:hover { background: rgba(255,255,255,.25); }

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.kpi-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--admin-surface);
  padding: 1.1rem 1.3rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--admin-border);
  text-decoration: none;
  color: inherit;
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s;
  position: relative;
  overflow: hidden;
}
a.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--admin-primary-light);
}
.kpi-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--admin-primary);
}
.kpi-pages::before    { background: #2563eb; }
.kpi-media::before    { background: #8b5cf6; }
.kpi-messages::before { background: #f59e0b; }
.kpi-modules::before  { background: #10b981; }

.kpi-icon {
  font-size: 1.7rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--admin-primary-light);
  border-radius: 10px;
  color: var(--admin-primary);
  flex-shrink: 0;
}
.kpi-pages    .kpi-icon { background: #dbeafe; color: #2563eb; }
.kpi-media    .kpi-icon { background: #ede9fe; color: #8b5cf6; }
.kpi-messages .kpi-icon { background: #fef3c7; color: #d97706; }
.kpi-modules  .kpi-icon { background: #d1fae5; color: #059669; }

.kpi-body { min-width: 0; flex: 1; }
.kpi-value {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--admin-text);
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: .4rem;
  flex-wrap: wrap;
}
.kpi-of {
  font-size: 1rem;
  color: var(--admin-text-muted);
  font-weight: 500;
}
.kpi-label {
  color: var(--admin-text-muted);
  font-size: .85rem;
  margin-top: .15rem;
  font-weight: 500;
}
.kpi-meta {
  margin-top: .35rem;
  font-size: .78rem;
  color: var(--admin-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  align-items: center;
}
.kpi-warn { color: var(--admin-danger); font-weight: 600; }
.badge-new {
  display: inline-block;
  background: #f59e0b;
  color: #fff;
  font-size: .65rem;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  vertical-align: middle;
}
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: .25rem;
}
.dot-green { background: #10b981; }
.dot-amber { background: #f59e0b; }

/* Inhalts-Kacheln (Module mit Counts) */
.content-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .7rem;
  margin-bottom: 1.6rem;
}
.content-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--admin-surface);
  padding: 1rem .8rem;
  border-radius: var(--radius);
  border: 1px solid var(--admin-border);
  text-decoration: none;
  color: inherit;
  transition: transform .1s, box-shadow .15s, border-color .15s;
  text-align: center;
}
.content-tile:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--admin-primary-light);
}
.ct-icon { font-size: 1.4rem; opacity: .85; }
.ct-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--admin-primary);
  margin-top: .1rem;
}
.ct-label {
  font-size: .78rem;
  color: var(--admin-text-muted);
  margin-top: .1rem;
}

/* Zwei-Spalten-Layout */
.dash-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.2rem;
}
@media (max-width: 1100px) {
  .dash-cols { grid-template-columns: 1fr; }
}
.dash-col {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  min-width: 0;
}

/* Panel */
.panel {
  background: var(--admin-surface);
  border-radius: var(--radius);
  border: 1px solid var(--admin-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .9rem 1.2rem;
  border-bottom: 1px solid var(--admin-border);
  background: #fafbfc;
}
.panel-head h2 {
  margin: 0;
  font-size: .95rem;
  font-weight: 600;
  color: var(--admin-text);
  letter-spacing: 0;
}
.panel-link {
  font-size: .82rem;
  color: var(--admin-primary);
  text-decoration: none;
  font-weight: 500;
}
.panel-link:hover { text-decoration: underline; }

/* List rows */
.list-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list-rows li + li { border-top: 1px solid var(--admin-border); }
.list-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .75rem 1.2rem;
  text-decoration: none;
  color: inherit;
  transition: background .12s;
}
.list-row:hover { background: #f7f9fc; }
.lr-title {
  flex: 1;
  font-size: .9rem;
  font-weight: 500;
  color: var(--admin-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lr-title .muted { font-weight: 400; }
.lr-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  flex-shrink: 0;
}
.pill {
  display: inline-block;
  font-size: .68rem;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.pill-green { background: var(--admin-success-light); color: var(--admin-success); }
.pill-amber { background: #fef3c7; color: #92400e; }

/* Event date badge */
.lr-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 42px;
  background: var(--admin-primary-light);
  color: var(--admin-primary);
  border-radius: 6px;
  padding: .25rem;
  flex-shrink: 0;
  line-height: 1;
}
.lr-day { font-size: 1.05rem; font-weight: 700; }
.lr-mon { font-size: .65rem; font-weight: 600; letter-spacing: .5px; }

.empty-mini {
  padding: 1.4rem 1.2rem;
  margin: 0;
  color: var(--admin-text-muted);
  font-size: .9rem;
  text-align: center;
}
.empty-mini a { font-weight: 500; }

/* Action grid (Schnellaktionen) */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .6rem;
  padding: 1rem 1.2rem;
}
.action-tile {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem .9rem;
  background: #f7f9fc;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 500;
  color: var(--admin-text);
  text-decoration: none;
  transition: all .15s;
}
.action-tile span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #fff;
  border-radius: 6px;
  font-size: 1rem;
  color: var(--admin-primary);
  border: 1px solid var(--admin-border);
}
.action-tile:hover {
  background: var(--admin-primary-light);
  border-color: var(--admin-primary);
  color: var(--admin-primary);
  transform: translateX(2px);
}

/* Module list */
.module-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.module-list li + li { border-top: 1px solid var(--admin-border); }
.mod-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .7rem 1.2rem;
  text-decoration: none;
  color: inherit;
  transition: background .12s;
}
.mod-row:hover { background: #f7f9fc; }
.mod-row-static { cursor: default; }
.mod-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--admin-primary-light);
  border-radius: 8px;
  font-size: 1rem;
  color: var(--admin-primary);
  flex-shrink: 0;
}
.mod-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.mod-name { font-size: .88rem; font-weight: 600; color: var(--admin-text); }
.mod-desc {
  font-size: .76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mod-version {
  font-size: .7rem;
  color: var(--admin-text-muted);
  background: #f1f5f9;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-family: "SF Mono", Monaco, Consolas, monospace;
  flex-shrink: 0;
}

/* System list */
.sys-list {
  margin: 0;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.sys-list > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: .85rem;
  flex-wrap: wrap;
}
.sys-list dt {
  color: var(--admin-text-muted);
  font-weight: 500;
  margin: 0;
}
.sys-list dd {
  margin: 0;
  text-align: right;
  color: var(--admin-text);
}
.sys-list code {
  background: #f1f5f9;
  padding: .15rem .5rem;
  border-radius: 3px;
  font-size: .78rem;
  font-family: "SF Mono", Monaco, Consolas, monospace;
}
.disk-bar {
  width: 140px;
  height: 6px;
  background: var(--admin-border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: .25rem;
  margin-left: auto;
}
.disk-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--admin-success) 0%, var(--admin-primary) 100%);
  transition: width .4s;
}

/* ==========================================================================
   Backup & Restore
   ========================================================================== */
.backup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
@media (max-width: 1000px) {
  .backup-grid { grid-template-columns: 1fr; }
}
.backup-grid .panel-body { padding: 1.2rem 1.4rem; }
.backup-grid .panel h2 { font-size: 1rem; }

.backup-form { display: flex; flex-direction: column; gap: .8rem; margin-top: .8rem; }
.backup-form .check {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  background: #f7f9fc;
  padding: .7rem .9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--admin-border);
  cursor: pointer;
  font-size: .9rem;
}
.backup-form .check input[type=checkbox] {
  margin-top: .15rem;
  flex-shrink: 0;
}
.backup-form .check small {
  display: block;
  color: var(--admin-text-muted);
  font-size: .78rem;
  margin-top: .2rem;
  font-weight: 400;
}
.backup-form .check span { font-weight: 500; }

.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fafbfc;
  border: 2px dashed var(--admin-border);
  border-radius: var(--radius);
  padding: 1.6rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.file-drop:hover {
  border-color: var(--admin-primary);
  background: var(--admin-primary-light);
}
.file-drop input[type=file] {
  display: block;
  margin-bottom: .5rem;
  font-size: .9rem;
}
.file-drop span {
  font-size: .85rem;
  color: var(--admin-text-muted);
}

.backup-tables { font-size: .88rem; }
.backup-tables td, .backup-tables th { padding: .5rem .9rem !important; }
.backup-tables code { font-size: .82rem; }

.preview-panel {
  border: 2px solid #f59e0b;
  margin-bottom: 1.2rem;
}
.preview-panel h3 { margin: 0 0 .3rem; font-size: 1rem; }

.danger-form .confirm-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: .9rem 1rem;
  margin: .5rem 0;
}
.danger-form .confirm-box code {
  background: #fff;
  padding: .15rem .55rem;
  border: 1px solid #fecaca;
  border-radius: 3px;
  font-size: .85rem;
  color: var(--admin-danger);
  font-weight: 600;
  letter-spacing: .03em;
}
.danger-form .confirm-box input[type=text] {
  display: block;
  width: 100%;
  margin-top: .6rem;
  padding: .6rem .8rem;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  font-family: "SF Mono", Monaco, Consolas, monospace;
  font-size: .92rem;
}
.danger-form .confirm-box input[type=text]:focus {
  outline: 2px solid var(--admin-danger);
  outline-offset: -1px;
}
.danger-form .btn-danger {
  background: var(--admin-danger);
  color: #fff;
  padding: .7rem 1.3rem;
  font-size: .92rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 0;
  cursor: pointer;
  text-decoration: none;
}
.danger-form .btn-danger:hover { background: #a02818; }

.restore-msg-list { margin: .4rem 0 0 1.2rem; padding: 0; font-size: .82rem; }
.restore-msg-list li { margin-bottom: .2rem; }

/* ==========================================================================
   Setup-Wizard / Branchen-Presets
   ========================================================================== */
.setup-toast {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  border-left: 4px solid var(--admin-danger);
  padding: .9rem 1.1rem;
  margin-bottom: 1.5rem;
}
.setup-toast .btn-sm {
  background: var(--admin-danger);
  color: #fff;
  font-weight: 600;
}
.setup-toast .btn-sm:hover { background: #a02818; }

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1rem;
}
.preset-card {
  display: flex;
  flex-direction: column;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  position: relative;
}
.preset-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--admin-primary);
}
.preset-icon {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: rgba(255,255,255,.95);
  background: var(--admin-primary);
  text-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.preset-body { padding: 1rem 1.2rem; flex: 1; }
.preset-industry {
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--admin-text-muted);
  font-weight: 600;
  margin-bottom: .2rem;
}
.preset-body h3 {
  margin: 0 0 .4rem;
  font-size: 1.05rem;
  color: var(--admin-text);
}
.preset-body p { margin: 0; font-size: .85rem; line-height: 1.45; }
.preset-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .8rem;
  font-size: .75rem;
  color: var(--admin-text-muted);
}
.preset-meta span { white-space: nowrap; }
.preset-meta code {
  background: #f1f5f9;
  padding: .05rem .35rem;
  border-radius: 3px;
  font-size: .72rem;
}
.preset-cta {
  padding: .65rem 1.2rem;
  background: var(--admin-primary-light);
  color: var(--admin-primary);
  font-size: .85rem;
  font-weight: 600;
  text-align: right;
  transition: background .15s;
}
.preset-card:hover .preset-cta {
  background: var(--admin-primary);
  color: #fff;
}

/* Preset-Detail */
.preset-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  background: #f7f9fc;
  padding: 1.1rem 1.3rem;
  border-radius: var(--radius);
  margin: 1rem 0;
}
.preset-summary h4 {
  margin: 0 0 .5rem;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--admin-text-muted);
}
.preset-summary ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .85rem;
}
.preset-summary li {
  padding: .25rem 0;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.preset-summary code {
  background: #fff;
  padding: .05rem .4rem;
  border-radius: 3px;
  font-size: .76rem;
  border: 1px solid var(--admin-border);
}
.color-dot {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,.1);
  flex-shrink: 0;
}

.preset-form { margin-top: 1.5rem; }
.preset-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .9rem;
  margin-bottom: .9rem;
}
@media (max-width: 700px) {
  .preset-form .form-row { grid-template-columns: 1fr; }
}
.preset-form label {
  display: block;
  margin-bottom: .9rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--admin-text);
}
.preset-form label > input {
  display: block;
  width: 100%;
  margin-top: .3rem;
  padding: .55rem .8rem;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: inherit;
}
.preset-form label > input:focus {
  outline: 2px solid var(--admin-primary);
  outline-offset: -1px;
  border-color: var(--admin-primary);
}

/* Image-Slots */
.image-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .8rem;
  margin: .8rem 0 1.2rem;
}
.image-slot {
  background: #f7f9fc;
  border: 1px dashed var(--admin-border);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  transition: border-color .15s, background .15s;
}
.image-slot:hover {
  border-color: var(--admin-primary);
  background: var(--admin-primary-light);
}
.image-slot label {
  display: block;
  margin: 0;
  cursor: pointer;
}
.image-slot .img-slot-title {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: .15rem;
  color: var(--admin-text);
}
.image-slot small {
  display: block;
  color: var(--admin-text-muted);
  font-size: .75rem;
  margin-bottom: .5rem;
  font-weight: 400;
}
.image-slot input[type=file] {
  display: block;
  width: 100%;
  font-size: .82rem;
  padding: .3rem 0;
}

/* Image-Vorschau im Confirm-Step */
.img-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .8rem;
  margin-top: .6rem;
}
.img-preview {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.img-preview img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  background: #f1f5f9;
}
.img-preview span {
  padding: .4rem .6rem;
  font-size: .78rem;
  color: var(--admin-text-muted);
  text-align: center;
  border-top: 1px solid var(--admin-border);
}

/* Wizard-Fehler-Popup */
.wizard-error-popup {
  border: 2px solid var(--admin-danger);
  background: #fff5f5;
  position: relative;
  animation: wizard-shake .35s cubic-bezier(.36,.07,.19,.97);
}
@keyframes wizard-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}