body.admin-body { background:#f4f8fc; font-family: Arial, Helvetica, sans-serif; color:#1a2b3d; }
.admin-layout { display:grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.admin-sidebar { background:#0b3868; color:#e9f5ff; padding:24px; }
.admin-sidebar h1 { font-size:1.1rem; line-height:1.25; margin:0 0 22px; }
.admin-sidebar a { color:#e9f5ff; display:block; padding:10px 12px; border-radius:10px; font-weight:700; }
.admin-sidebar a:hover, .admin-sidebar a.active { background:rgba(255,255,255,.14); text-decoration:none; }
.admin-main { padding:28px; }
.admin-panel { background:#fff; border:1px solid rgba(21,83,137,.18); border-radius:14px; box-shadow:0 14px 34px rgba(13,61,108,.12); padding:24px; margin-bottom:22px; }
.admin-top { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:20px; }
.table { width:100%; border-collapse:collapse; background:white; border-radius:12px; overflow:hidden; }
.table th, .table td { padding:12px; border-bottom:1px solid #dce9f5; text-align:left; vertical-align:top; }
.table th { background:#125c9c; color:#fff; }
.table tr:hover td { background:#f8fbff; }
.form-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:16px; }
.form-row { margin-bottom:16px; }
label { display:block; font-weight:800; margin-bottom:6px; color:#0b3868; }
input[type=text], input[type=email], input[type=password], input[type=datetime-local], select, textarea { width:100%; padding:11px 12px; border:1px solid #b8d7f0; border-radius:10px; font:inherit; background:#fff; }
textarea { min-height:180px; resize:vertical; }
.editor-toolbar { display:flex; gap:6px; flex-wrap:wrap; margin:0 0 8px; }
.editor-toolbar button { padding:7px 10px; border-radius:10px; background:#125c9c; color:white; }
.rich-editor { min-height:280px; background:#fff; border:1px solid #b8d7f0; border-radius:10px; padding:14px; overflow:auto; }
.badge { display:inline-flex; align-items:center; border-radius:999px; padding:4px 9px; font-size:.82rem; font-weight:800; }
.badge.published { background:#eaf7e9; color:#246b2d; }
.badge.draft { background:#fff6d6; color:#755000; }
.badge.withdrawn { background:#ffecec; color:#8b1b1b; }
.login-page { min-height:100vh; display:grid; place-items:center; padding:24px; background:linear-gradient(135deg,#f8fbff,#e8f2fb); }
.login-card { width:min(470px,100%); background:#fff; border-radius:18px; box-shadow:0 20px 50px rgba(13,61,108,.18); padding:30px; border:1px solid rgba(21,83,137,.18); }
.login-card h1 { color:#0b3868; margin-top:0; }
.thumb { width:110px; height:74px; object-fit:cover; border-radius:10px; background:#e8f2fb; border:1px solid #b8d7f0; }
.import-status { display:inline-flex; gap:6px; align-items:center; border-radius:999px; padding:4px 9px; font-size:.82rem; font-weight:800; }
.import-status.ok { background:#eaf7e9; color:#246b2d; }
.import-status.missing { background:#fff6d6; color:#755000; }
.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size:.88rem; word-break:break-all; }
@media (max-width: 900px) { .admin-layout { grid-template-columns:1fr; } .admin-sidebar { position:static; } .form-grid { grid-template-columns:1fr; } }

/* v006 Rich-Text-Bearbeitung für Titel, Kurzbeschreibung und Text */
.rich-toolbar { align-items:center; background:#f4f8fc; border:1px solid #dce9f5; border-radius:12px; padding:8px; }
.rich-toolbar .toolbar-select { width:auto; min-width:120px; padding:7px 9px; border-radius:9px; font-size:.92rem; }
.rich-toolbar button { padding:7px 10px; border-radius:9px; }
.rich-editor[data-placeholder]:empty:before { content: attr(data-placeholder); color:#8196aa; pointer-events:none; }
.rich-editor-title { min-height:64px; font-size:1.7rem; font-weight:800; line-height:1.18; }
.rich-editor-intro { min-height:86px; line-height:1.45; }
.rich-editor:focus { outline:3px solid rgba(45,143,214,.22); border-color:#2d8fd6; }
.form-row small { display:block; margin-top:6px; color:#60758a; }

/* v007: Beitragssortierung im Backend */
.admin-muted { margin:.25rem 0 0; color:#60758a; }
.sort-controls { display:flex; gap:10px; flex-wrap:wrap; margin:-4px 0 18px; }
.sort-pill { display:inline-flex; align-items:center; justify-content:center; padding:9px 13px; border-radius:999px; border:1px solid #b8d7f0; background:#fff; color:#0b3868; font-weight:800; text-decoration:none; }
.sort-pill:hover { background:#f0f7ff; text-decoration:none; }
.sort-pill.active { background:#125c9c; border-color:#125c9c; color:#fff; }
.table th .table-sort-link { color:#fff; display:inline-flex; gap:6px; align-items:center; text-decoration:none; }
.table th .table-sort-link:hover { text-decoration:underline; }

/* v008: sauberere Editor-Auswahl und Beitrag löschen */
.table-action-form { display:inline-flex; margin:0; }
.inline-delete-form { display:none; }
.rich-toolbar .toolbar-select { min-width:112px; }
.rich-toolbar .toolbar-select[data-action="fontSizePx"] { min-width:96px; }
/* v011: kompaktere Beitragsliste, Archiv-Aktion und sichtbare Galerie-Bilder */
.posts-table { table-layout:fixed; font-size:.9rem; line-height:1.22; }
.posts-table th, .posts-table td { padding:7px 8px; vertical-align:middle; }
.posts-table .posts-col-title { width:auto; }
.posts-table .posts-col-category { width:78px; }
.posts-table .posts-col-status { width:86px; }
.posts-table .posts-col-date { width:108px; }
.posts-table .posts-col-author { width:104px; }
.posts-table .posts-col-actions { width:318px; }
.posts-table td:first-child { overflow-wrap:anywhere; }
.posts-table td.actions { white-space:nowrap; overflow:visible; }
.post-action-row { display:flex; flex-wrap:nowrap; gap:5px; align-items:center; justify-content:flex-start; }
.posts-table .btn, .posts-table button { padding:5px 8px; font-size:.82rem; line-height:1.15; min-height:30px; gap:4px; }
.posts-table .table-action-form { flex:0 0 auto; display:inline-flex; margin:0; }
button.archive, .btn.archive { background:#2d6f9f; color:#fff; }
button.archive:hover, .btn.archive:hover { background:#245b84; color:#fff; }
.gallery-preview-section { margin-top:12px; padding:12px; border:1px solid #dce9f5; border-radius:12px; background:#f8fbff; }
.gallery-preview-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(120px, 1fr)); gap:10px; margin-top:10px; }
.gallery-preview-item { margin:0; border:1px solid #dce9f5; border-radius:10px; background:#fff; overflow:hidden; }
.gallery-preview-item img { width:100%; height:86px; object-fit:cover; background:#e8f2fb; }
.gallery-preview-item figcaption { padding:6px 8px; font-size:.82rem; color:#60758a; }
/* v012: Aktionen nicht mehr abschneiden; Archivieren arbeitet nur noch per Update plus Dubletten-Schutz. */
.admin-panel { overflow-x:auto; }
.posts-table { min-width:1120px; }
@media (max-width: 1180px) {
  .posts-table { table-layout:auto; min-width:1120px; }
  .posts-table .posts-col-actions { width:auto; }
}

/* v014: Dubletten-Bereinigung und noch kompaktere Beitragsaktionen */
.posts-table .posts-col-actions { width:340px; }
.posts-table .btn, .posts-table button { padding:4px 7px; font-size:.8rem; }
.post-action-row { gap:4px; }

/* v013: Bilder im Beitragseditor gezielt entfernen */
.image-delete-card { display:inline-flex; gap:12px; align-items:center; margin-top:10px; padding:10px; border:1px solid #dce9f5; border-radius:12px; background:#f8fbff; }
.main-image-delete-card .thumb { flex:0 0 auto; }
.delete-image-check { display:inline-flex; align-items:center; gap:6px; margin:0; color:#8b1b1b; font-weight:800; cursor:pointer; }
.delete-image-check input { accent-color:#b42318; }
.gallery-preview-item figcaption { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.gallery-preview-item .delete-image-check { font-size:.78rem; }


/* v015: Sortierung nach Bearbeitung beibehalten und Bilder direkt in den Beitragstext einfügen */
.mini-insert-image { padding:5px 7px; border-radius:8px; background:#125c9c; color:#fff; font-size:.78rem; line-height:1.1; }
.mini-insert-image:hover { background:#0b3868; color:#fff; }
.rich-editor figure.inline-post-image { margin:12px 0; padding:8px; border:1px dashed #b8d7f0; border-radius:12px; background:#f8fbff; }
.rich-editor figure.inline-post-image img { display:block; max-width:100%; height:auto; border-radius:10px; }
.rich-editor img { max-width:100%; height:auto; }
.gallery-preview-item figcaption { align-items:flex-start; flex-direction:column; }
.main-image-delete-card { flex-wrap:wrap; }

/* v017: Aktive Formatierungen in der Toolbar sichtbar markieren */
.rich-toolbar button.is-active,
.rich-toolbar button[aria-pressed="true"] {
  background:#0b3868;
  color:#fff;
  box-shadow:inset 0 0 0 2px #ffffff, 0 0 0 2px rgba(45,143,214,.35);
  transform:translateY(-1px);
}
.rich-toolbar button.is-active:hover,
.rich-toolbar button[aria-pressed="true"]:hover {
  background:#073056;
}

/* v019: Kontextbezogene Toolbar-Anzeige; Überschrift/Blockschrift an aktueller Textstelle sauber umschaltbar */
.rich-editor h1,
.rich-editor h2,
.rich-editor h3,
.rich-editor h4,
.rich-editor h5,
.rich-editor h6 {
  margin: .12em 0;
  line-height: 1.25;
}
.rich-editor h1:first-child,
.rich-editor h2:first-child,
.rich-editor h3:first-child,
.rich-editor h4:first-child,
.rich-editor h5:first-child,
.rich-editor h6:first-child { margin-top: 0; }
.rich-editor h1:last-child,
.rich-editor h2:last-child,
.rich-editor h3:last-child,
.rich-editor h4:last-child,
.rich-editor h5:last-child,
.rich-editor h6:last-child { margin-bottom: 0; }
.rich-editor p { margin: .25em 0; }
.rich-editor p:first-child { margin-top: 0; }
.rich-editor p:last-child { margin-bottom: 0; }

/* v021: Inline-Bilder im Editor mit Links/Zentriert/Rechts ausrichten */
.rich-editor figure.inline-post-image { max-width:100%; width:fit-content; }
.rich-editor figure.inline-post-image.align-left { margin-left:0; margin-right:auto; text-align:left; }
.rich-editor figure.inline-post-image.align-center { margin-left:auto; margin-right:auto; text-align:center; }
.rich-editor figure.inline-post-image.align-right { margin-left:auto; margin-right:0; text-align:right; }
.rich-editor figure.inline-post-image.align-left img { margin-left:0; margin-right:auto; }
.rich-editor figure.inline-post-image.align-center img { margin-left:auto; margin-right:auto; }
.rich-editor figure.inline-post-image.align-right img { margin-left:auto; margin-right:0; }

/* v023: Beitrag bearbeiten oben neu gegliedert */
.form-grid-three { grid-template-columns: minmax(150px, .8fr) minmax(220px, 1fr) minmax(260px, 1.4fr); align-items:end; }
.post-edit-meta-grid { margin-bottom:12px; }
.post-edit-meta-grid .form-row { margin-bottom:0; }
.post-edit-title-row { width:100%; margin-bottom:18px; }
.post-edit-title-row .rich-toolbar { width:100%; }
.post-edit-title-row .rich-editor-title { width:100%; box-sizing:border-box; }
@media (max-width: 900px) { .form-grid-three { grid-template-columns:1fr; } .post-edit-meta-grid .form-row { margin-bottom:16px; } }

/* v027: Rosenkranzweg-Editor für Einleitung, Stationen und Bildslots */
.admin-hint { color:#47657f; background:#eef7ff; border:1px solid #c7e4fb; border-radius:12px; padding:12px 14px; margin:0 0 18px; }
.rosary-admin-panel .rich-editor { min-height:180px; }
.rosary-station-editor-list { display:grid; gap:14px; margin:22px 0; }
.rosary-station-editor { border:1px solid #c9dff2; border-radius:14px; background:#f8fbff; overflow:hidden; }
.rosary-station-editor summary { cursor:pointer; display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 16px; background:#eaf5ff; color:#0b3868; font-weight:900; }
.rosary-station-editor summary small { color:#54728e; font-weight:800; }
.rosary-station-editor-body { padding:18px; }
.rosary-station-editor textarea { min-height:110px; }
.rosary-image-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:16px; }
.rosary-image-slot { border:1px dashed #9ec8ea; border-radius:14px; background:#fff; padding:14px; }
.rosary-current-image { display:grid; grid-template-columns:120px 1fr; gap:12px; align-items:center; margin-bottom:12px; }
.rosary-current-image img { width:120px; height:86px; object-fit:cover; border-radius:10px; background:#e8f2fb; border:1px solid #cfe4f6; }
.rosary-empty-image { border-radius:10px; background:#eef4fa; color:#58738c; font-weight:700; padding:18px; margin-bottom:12px; text-align:center; }
.checkbox-inline { display:flex; align-items:center; gap:8px; margin-top:8px; font-weight:700; color:#8b1b1b; }
.rosary-image-slot input[type=file] { width:100%; padding:10px; border:1px solid #b8d7f0; border-radius:10px; background:#fbfdff; }
@media (max-width: 900px) { .rosary-image-grid, .rosary-current-image { grid-template-columns:1fr; } .rosary-current-image img { width:100%; height:180px; } }

/* v028: eigener Backend-Block für die Wegbeschreibung */
.rosary-route-editor summary { background:#eef7ea; color:#25521f; }
.rosary-route-editor { border-color:#b9d9ae; }

/* v031: strukturierter Über-uns-/Vorstands-Editor */
.admin-section-title { margin:24px 0 14px; color:#0b3868; border-bottom:2px solid #dcecf8; padding-bottom:.4rem; }
.about-admin-panel .rich-editor { min-height:180px; }
.about-person-editor-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:16px; margin:16px 0 22px; }
.about-person-editor-card { border:1px solid #c9dff2; border-radius:14px; background:#f8fbff; padding:16px; }
.about-person-editor-card h3 { margin:0 0 12px; color:#0b3868; }
.about-person-editor-card textarea { min-height:76px; }
.about-person-image-slot { border:1px dashed #9ec8ea; border-radius:14px; background:#fff; padding:14px; margin-bottom:14px; }
.about-current-image { display:grid; grid-template-columns:92px 1fr; gap:12px; align-items:center; margin-bottom:12px; }
.about-current-image img { width:92px; height:92px; object-fit:cover; border-radius:50%; background:#e8f2fb; border:1px solid #cfe4f6; }
.about-empty-image { border-radius:12px; background:#eef4fa; color:#58738c; font-weight:700; padding:18px; margin-bottom:12px; text-align:center; }
.about-person-image-slot input[type=file] { width:100%; padding:10px; border:1px solid #b8d7f0; border-radius:10px; background:#fbfdff; }
@media (max-width: 900px) {
  .about-person-editor-grid { grid-template-columns:1fr; }
  .about-current-image { grid-template-columns:1fr; }
}

/* v033: strukturierter Kontakt-Editor mit dynamischer Maps-Adresse */
.contact-admin-panel .rich-editor { min-height:120px; }
.contact-editor-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:16px; margin:16px 0 18px; }
.contact-editor-grid .form-row { margin-bottom:0; }
.contact-map-toggle { align-self:end; }
.contact-preview-hint { margin-top:6px; }
@media (max-width: 900px) { .contact-editor-grid { grid-template-columns:1fr; } }

/* v037: Passwortwechsel als zentraler Dialog, damit er immer im sichtbaren Bereich bleibt */
.users-table .user-action-row { align-items:center; gap:8px; }
.password-modal[hidden] { display:none; }
.password-modal { position:fixed; inset:0; z-index:9999; display:grid; place-items:center; padding:24px; }
.password-modal-backdrop { position:absolute; inset:0; background:rgba(4,25,45,.44); backdrop-filter: blur(2px); }
.password-modal-card { position:relative; width:min(520px, calc(100vw - 32px)); max-height:calc(100vh - 48px); overflow:auto; background:#fff; border:1px solid #b8d7f0; border-radius:18px; box-shadow:0 28px 70px rgba(4,25,45,.34); padding:22px; }
.password-modal-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:16px; }
.password-modal-head h2 { margin:0; color:#0b3868; }
.password-modal-head p { margin:.25rem 0 0; color:#58738c; font-weight:700; }
.password-modal-x { font-size:1.35rem; line-height:1; min-width:42px; padding:8px 12px; }
.password-modal-form .form-row { margin-bottom:14px; }
.password-modal-form input[type=password] { width:100%; box-sizing:border-box; }
.password-modal-form .admin-hint { margin:6px 0 14px; }
.password-modal-actions { justify-content:flex-start; }
body.has-password-modal { overflow:hidden; }
@media (max-width: 700px) {
  .password-modal { align-items:start; padding:14px; }
  .password-modal-card { width:100%; max-height:calc(100vh - 28px); padding:18px; }
  .password-modal-actions { flex-direction:column; align-items:stretch; }
  .password-modal-actions button { width:100%; }
}
/* v038: Allgemein-Editor mit Kontakt/Maps */
.general-admin-panel .admin-section-title {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid #d8e5f2;
}
.general-document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 12px 0 18px;
}
.document-upload-card {
  border: 1px solid #cfe0f1;
  border-radius: 14px;
  background: #f8fbff;
  padding: 16px;
}
.document-upload-card h3 {
  margin-top: 0;
}
.document-upload-card input[type="file"] {
  margin-top: 8px;
}
.danger-hint {
  border-left: 4px solid #b91c1c;
  background: #fff7f7;
  padding: 10px 12px;
  border-radius: 10px;
}

/* v040: Security-Hardening nach OWASP-Audit */


/* v040: Security-Finish */
.sidebar-logout-form{margin:0}.sidebar-logout-form button{display:block;width:100%;text-align:left;background:transparent;border:0;color:inherit;padding:12px 14px;border-radius:14px;font:inherit;cursor:pointer}.sidebar-logout-form button:hover{background:rgba(255,255,255,.12)}
.security-check-table td,.security-check-table th{vertical-align:top}.security-status{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border-radius:999px;font-weight:700;font-size:.84rem}.security-status.ok{background:#e7f6eb;color:#176b32}.security-status.warn{background:#fff4cf;color:#7a5600}.security-status.fail{background:#fde5e5;color:#8a1f1f}.security-meta{color:#667085;font-size:.92rem}.system-check-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px}.system-check-note{border-left:4px solid #d0d8e8;padding:10px 12px;background:#f7f9fc;border-radius:12px}

/* v041: Home-Seite vollständig im Backend pflegen */
.home-admin-panel .rich-editor { min-height: 240px; }
.home-image-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 14px 0 18px; }
.home-image-grid-single { grid-template-columns: minmax(280px, 520px); }
.home-image-slot { border: 1px solid #cfe0f1; border-radius: 14px; background: #f8fbff; padding: 16px; }
.home-image-slot h3 { margin: 0 0 12px; color: #0b3868; }
.home-current-image { display: grid; grid-template-columns: 160px 1fr; gap: 14px; align-items: center; margin-bottom: 12px; }
.home-current-image img { width: 160px; height: 110px; object-fit: cover; border-radius: 12px; background: #e8f2fb; border: 1px solid #cfe4f6; }
.home-image-slot input[type=file] { width: 100%; padding: 10px; border: 1px solid #b8d7f0; border-radius: 10px; background: #fff; }
.home-toggle-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 12px 0 20px; }
.home-toggle-card { display: flex; gap: 10px; align-items: center; border: 1px solid #cfe0f1; border-radius: 14px; background: #f8fbff; padding: 16px; font-weight: 900; color: #0b3868; }
.home-toggle-card input { transform: scale(1.2); }
.home-normal-checkbox { color: #0b3868; background: #f8fbff; border: 1px solid #cfe0f1; border-radius: 12px; padding: 10px 12px; display: inline-flex; margin: 0 0 14px; }
@media (max-width: 900px) {
  .home-image-grid, .home-image-grid-single, .home-current-image, .home-toggle-grid { grid-template-columns: 1fr; }
  .home-current-image img { width: 100%; height: 180px; }
}
