/* FS25 LiveMap Forum - Base CSS
   Gemeinsame Grundregeln für alle Forumseiten.
   Seiten-spezifische Größen und Abstände liegen in eigenen Dateien:
   - forum-home-custom.css
   - forum-category-custom.css
   Weitere Bereiche können später ergänzt werden.
*/

/* Standard-Layout nur für Forumseiten, die noch keine eigene Bereichs-CSS haben.
   Startseite und Kategorie-Seiten bekommen ihre Werte aus ihren eigenen CSS-Dateien. */
.forum-body:not(.forum-page-index):not(.forum-page-category) .forum-main { padding: 38px 0 60px; }
.forum-body:not(.forum-page-index):not(.forum-page-category) .forum-wrap { max-width: 1120px; }
.forum-body:not(.forum-page-index):not(.forum-page-category) .forum-hero { margin-bottom: 24px; }
.forum-body:not(.forum-page-index):not(.forum-page-category) .forum-hero h1 { font-size: clamp(2.1rem, 4vw, 3.6rem); margin: 14px 0 12px; letter-spacing: -.03em; }
.forum-body:not(.forum-page-index):not(.forum-page-category) .forum-hero p { color: var(--muted); line-height: 1.7; max-width: 760px; }

.forum-panel,
.post-card {
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(219, 228, 239, .9);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.forum-panel { padding: 24px; margin-bottom: 18px; }
.forum-panel h2 { margin: 0 0 8px; }


.badge { display: inline-flex; align-items: center; margin-right: 8px; padding: 4px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: .78rem; font-weight: 800; }
.badge-muted { background: #eef2f7; color: #5c6c7c; }

.forum-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.inline-form { display: inline-flex; flex-wrap: wrap; gap: 12px; }

.forum-form { display: grid; gap: 12px; }
.forum-form label { font-weight: 800; }
.forum-form input, .forum-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
  color: var(--text);
}
.forum-form textarea { resize: vertical; }

.posts { display: grid; gap: 16px; background: transparent; border: 0; box-shadow: none; padding: 0; }
.post-card { padding: 20px; }
.post-card header { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; color: var(--muted); }
.post-content { white-space: normal; line-height: 1.7; }
.post-admin { margin-top: 12px; }
.text-button { border: 0; background: transparent; color: #9b1c1c; font-weight: 800; cursor: pointer; padding: 0; }

.forum-flash { padding: 14px 16px; border-radius: 16px; margin-bottom: 16px; font-weight: 700; }
.forum-flash-success { background: #eaf8f0; color: #1f7b51; }
.forum-flash-error { background: #fff1f2; color: #9f1239; }
.forum-flash-info { background: #eef5ff; color: #1e3a8a; }

.admin-user-row { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.admin-user-row:last-child { border-bottom: 0; }
.admin-user-row span { margin-left: 10px; color: var(--muted); }

@media (max-width: 760px) {
  .admin-user-row { flex-direction: column; }
}

.bbcode-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 6px;
}

.bbcode-toolbar button {
  min-width: 42px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.bbcode-toolbar button:hover {
  background: var(--accent-soft);
  border-color: rgba(129, 170, 48, .45);
}

.post-content blockquote {
  margin: 12px 0;
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 12px;
}

.post-content pre {
  overflow-x: auto;
  padding: 12px;
  border-radius: 12px;
  background: #13202b;
  color: #eef5ff;
}

.post-content a {
  color: var(--accent-dark);
  font-weight: 800;
}

.bbcode-preview-button {
  margin-left: auto;
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}

.bbcode-preview {
  margin: 4px 0 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .92);
  line-height: 1.7;
}

.bbcode-preview::before {
  content: "Vorschau";
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 800;
}

.forum-post-image {
  display: block;
  max-width: 100%;
  max-height: 520px;
  margin: 14px 0;
  border-radius: 16px;
  border: 1px solid var(--line);
  object-fit: contain;
}

.bbcode-image-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .52);
}

.bbcode-image-modal.is-open {
  display: flex;
}

.bbcode-image-dialog {
  position: relative;
  width: min(430px, 100%);
  padding: 22px;
  border-radius: 18px;
  background: #2f3133;
  color: #e8edf2;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

.bbcode-image-dialog h2 {
  margin: 0 0 18px;
  font-size: 1.15rem;
}

.bbcode-image-dialog label {
  display: block;
  margin-bottom: 8px;
  color: #aab2bd;
  font-weight: 700;
}

.bbcode-image-dialog input {
  width: 100%;
  height: 42px;
  border: 2px solid #b7d4f8;
  border-radius: 7px;
  background: #3a3d40;
  color: #fff;
  padding: 0 10px;
  font: inherit;
}

.bbcode-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 42px;
  height: 36px;
  border: 0;
  border-radius: 7px;
  background: #81c53b;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.bbcode-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.bbcode-modal-actions button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  padding: 0 16px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.bbcode-modal-cancel {
  background: #75b832;
}

.bbcode-modal-insert {
  background: #81c53b;
}


.btn-danger {
  background: #9b1c1c !important;
  color: #fff !important;
  border-color: #9b1c1c !important;
}

.danger-link {
  color: #9b1c1c !important;
}

.inline-post-action {
  display: inline;
  margin-left: 12px;
}

.post-admin {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}



/* v5: Beitrag bearbeiten/löschen einheitlich und rechts */
.post-admin {
  justify-content: flex-end;
  margin-top: 14px;
}

.post-admin .text-button,
.post-admin a.text-button,
.post-admin button.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(155, 28, 28, .25);
  border-radius: 10px;
  background: #fff;
  color: #9b1c1c !important;
  font: inherit;
  font-size: .92rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.post-admin .text-button:hover {
  background: #fff1f2;
}

.inline-post-action {
  margin-left: 0;
}

@media (max-width: 760px) {
  .post-admin {
    justify-content: flex-start;
  }
}


.quote-button {
  color: var(--accent-dark) !important;
  border-color: rgba(129, 170, 48, .35) !important;
}

.quote-button:hover {
  background: var(--accent-soft) !important;
}


/* v12: Admin-Bildupload */
.forum-help {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .95rem;
}

.copy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 8px 0 18px;
}

.copy-row input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.uploaded-preview {
  margin-top: 18px;
}

.uploaded-preview img {
  display: block;
  max-width: 100%;
  max-height: 520px;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.image-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.image-admin-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,.72);
}

.image-admin-card img {
  width: 100%;
  height: 110px;
  display: block;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
}

.image-admin-card strong {
  display: block;
  font-size: .9rem;
  overflow-wrap: anywhere;
  margin-bottom: 8px;
}

@media (max-width: 760px) {
  .copy-row {
    grid-template-columns: 1fr;
  }
}


/* v13: Admin-Upload direkt im Editor */
.bbcode-upload-button {
  background: var(--accent-soft) !important;
  color: var(--accent-dark) !important;
  border-color: rgba(129, 170, 48, .45) !important;
}

.bbcode-upload-button:disabled {
  opacity: .65;
  cursor: wait;
}


/* v14: Ungelesene Beiträge */
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  margin-left: 9px;
  border-radius: 999px;
  background: #b01717;
  color: #fff;
  font-size: .78rem;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
  box-shadow: 0 4px 12px rgba(176, 23, 23, .25);
}


/* v15: Überschrift-BBCode, Bildgröße und Vorschau-Position */
.bbcode-heading {
  display: block;
  margin: 14px 0 10px;
  font-size: 1.55rem;
  line-height: 1.25;
  font-weight: 900;
  color: var(--text);
}

.forum-post-image {
  width: auto;
  max-width: 100%;
  height: auto;
}

.bbcode-preview {
  margin-top: 12px;
  margin-bottom: 0;
}

.bbcode-image-dialog input[type="number"] {
  width: 100%;
  height: 42px;
  border: 2px solid #b7d4f8;
  border-radius: 7px;
  background: #3a3d40;
  color: #fff;
  padding: 0 10px;
  font: inherit;
  margin-bottom: 4px;
}


/* v16: Links und Aufzählungslisten */
.post-content a,
.bbcode-preview a {
  color: #84ad31 !important;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.post-content a:hover,
.bbcode-preview a:hover {
  color: #6f9427 !important;
}

.bbcode-list {
  margin: 12px 0 12px 1.3rem;
  padding-left: 1.2rem;
  line-height: 1.7;
}

.bbcode-list li {
  margin: 4px 0;
  padding-left: .2rem;
}

.bbcode-list li::marker {
  color: #84ad31;
  font-size: 1.15em;
}


/* v17: kompaktere Abstände in Beiträgen */
.post-content,
.bbcode-preview {
  line-height: 1.55;
}

.bbcode-heading {
  margin: 6px 0 6px !important;
  font-size: 1.45rem;
  line-height: 1.2;
}

.bbcode-image-link {
  display: inline-block;
  margin: 8px 0 8px;
  max-width: 100%;
}

.bbcode-image-link .forum-post-image,
.forum-post-image {
  display: block;
  margin: 0 !important;
  width: auto;
  max-width: 100%;
  height: auto;
}

.bbcode-list {
  margin-top: 6px !important;
  margin-bottom: 8px !important;
  line-height: 1.55;
}

.bbcode-list li {
  margin: 2px 0 !important;
}

/* nl2br erzeugt nach Block-BBCodes zusätzliche <br>. Diese werden hier entfernt. */
.post-content .bbcode-heading + br,
.post-content .bbcode-image-link + br,
.post-content .bbcode-list + br,
.bbcode-preview .bbcode-heading + br,
.bbcode-preview .bbcode-image-link + br,
.bbcode-preview .bbcode-list + br {
  display: none;
}


/* v18: Admin-Statistiken */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.admin-stat-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .78);
}

.admin-stat-label {
  display: block;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 10px;
}

.admin-stat-card strong {
  display: block;
  font-size: 2.2rem;
  line-height: 1;
  color: var(--text);
  letter-spacing: -.03em;
}

.admin-stat-note {
  display: block;
  color: var(--muted);
  margin-top: 8px;
  font-size: .92rem;
}


/* v19: Statistik-Ausgabe als rahmenlose Tabelle */
.admin-stats-panel {
  max-width: 760px;
}

.admin-stats-table {
  display: grid;
  gap: 0;
  margin-top: 12px;
}

.admin-stats-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid rgba(86, 103, 122, .16);
}

.admin-stats-row:last-child {
  border-bottom: 0;
}

.admin-stats-row strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.2;
}

.admin-stats-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .94rem;
}

.admin-stats-row b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 1.2rem;
  font-weight: 900;
}

@media (max-width: 640px) {
  .admin-stats-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .admin-stats-row b {
    justify-self: start;
  }
}


/* v20: Statistik mit Reset-Schalter */
.admin-stats-row {
  grid-template-columns: 1fr auto auto;
}

.admin-stat-title {
  color: var(--text);
  font-weight: 800;
}

.admin-stat-reset {
  margin: 0;
}

.admin-stat-reset button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(155, 28, 28, .22);
  border-radius: 999px;
  background: #fff;
  color: #9b1c1c;
  font: inherit;
  font-size: .9rem;
  font-weight: 800;
  cursor: pointer;
}

.admin-stat-reset button:hover {
  background: #fff1f2;
}

@media (max-width: 640px) {
  .admin-stats-row {
    grid-template-columns: 1fr auto;
  }

  .admin-stat-reset {
    grid-column: 1 / -1;
  }
}


/* v21: Statistik optisch ruhiger und Boxbreite wie Nutzer-Box */
.admin-stats-panel {
  max-width: none !important;
  width: auto !important;
}

.admin-stats-row {
  grid-template-columns: 1fr auto auto !important;
  padding: 10px 0 !important;
  gap: 14px !important;
}

.admin-stat-title {
  font-size: 1rem !important;
  font-weight: 400 !important;
  color: var(--text) !important;
}

.admin-stats-row b {
  display: inline !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--text) !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  line-height: inherit !important;
}

.admin-stat-reset button {
  min-height: 30px !important;
  padding: 0 10px !important;
  font-size: .86rem !important;
  font-weight: 700 !important;
}

@media (max-width: 640px) {
  .admin-stats-row {
    grid-template-columns: 1fr auto !important;
  }

  .admin-stat-reset {
    grid-column: 1 / -1;
  }
}



/* v43: Erweiterter BBCode-Editor */
.bbcode-toolbar {
  align-items: center;
}

.bbcode-select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  padding: 0 10px;
  cursor: pointer;
}

.bbcode-select:hover,
.bbcode-select:focus {
  background: var(--accent-soft);
  border-color: rgba(129, 170, 48, .45);
  outline: none;
}

.bbcode-align {
  margin: 8px 0;
}

.bbcode-align-left {
  text-align: left;
}

.bbcode-align-center {
  text-align: center;
}

.bbcode-align-right {
  text-align: right;
}

.bbcode-spoiler {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(234, 248, 240, .72);
}

.bbcode-spoiler summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--accent-dark);
}

.bbcode-spoiler > div {
  margin-top: 10px;
}

.bbcode-hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

.bbcode-youtube {
  position: relative;
  width: min(100%, 760px);
  aspect-ratio: 16 / 9;
  margin: 14px 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #111827;
}

.bbcode-youtube iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@media (max-width: 760px) {
  .bbcode-select {
    width: 100%;
  }

  .bbcode-preview-button {
    margin-left: 0;
  }
}


/* v44: Smiley-Auswahl unter dem Textfeld */
.bbcode-smiley-row {
  position: relative;
  margin: 8px 0 12px;
}

.bbcode-smiley-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--accent-dark);
  font-weight: 800;
  padding: 0 12px;
  cursor: pointer;
}

.bbcode-smiley-toggle:hover,
.bbcode-smiley-toggle.is-open {
  background: var(--accent-soft);
  border-color: rgba(129, 170, 48, .45);
}

.bbcode-smiley-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
}

.bbcode-smiley-menu[hidden] {
  display: none;
}

.bbcode-smiley-menu button {
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.bbcode-smiley-menu button:hover {
  background: var(--accent-soft);
  border-color: rgba(129, 170, 48, .45);
}

@media (max-width: 640px) {
  .bbcode-smiley-menu button {
    width: 38px;
    height: 38px;
  }
}


/* v45: Erwähnungen */
.bbcode-mention {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 900;
}

.mention-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: var(--muted);
  font-weight: 700;
}

.mention-nav-link:hover {
  color: var(--text);
}

.mention-list {
  display: grid;
  gap: 14px;
}

.mention-item {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.mention-item:last-child {
  border-bottom: 0;
}

.mention-item h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.mention-item p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .95rem;
}

.mention-preview {
  color: var(--text);
  line-height: 1.55;
}

.mention-item.is-unread {
  background: rgba(234, 248, 240, .45);
  border-radius: 16px;
  padding: 16px;
}

@media (max-width: 760px) {
  .mention-item {
    flex-direction: column;
    align-items: stretch;
  }
}


/* v46: Markierungs-Benachrichtigung und @User-Auswahl */
.mention-notification-link {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-weight: 800;
}

.mention-notification-link:hover {
  color: var(--text);
}

.mention-notification-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 900;
}

.mention-suggest-menu {
  position: absolute;
  z-index: 9999;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--shadow);
}

.mention-suggest-menu[hidden] {
  display: none;
}

.mention-suggest-item {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  text-align: left;
  padding: 0 10px;
  cursor: pointer;
}

.mention-suggest-item:hover,
.mention-suggest-item.is-active {
  background: var(--accent-soft);
  color: var(--accent-dark);
}


/* v47: Bedanken-Funktion */
.inline-post-action {
  display: inline;
}

.thanks-button {
  color: var(--accent-dark);
}

.post-thanks {
  margin-top: 12px;
  text-align: right;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 700;
}

.post-thanks::before {
  content: "✓ ";
  color: var(--accent-dark);
  font-weight: 900;
}

.mention-suggest-menu {
  max-width: 320px;
}


/* v48: Kompakte Nutzerverwaltung */
.admin-users-panel {
  padding: 20px 24px;
}

.admin-users-table {
  display: grid;
  gap: 0;
  margin-top: 10px;
}

.admin-users-head,
.compact-user-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.1fr) minmax(180px, 1.4fr) 80px 80px minmax(190px, auto);
  gap: 12px;
  align-items: center;
}

.admin-users-head {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 900;
}

.compact-user-row {
  padding: 9px 0;
  border-bottom: 1px solid rgba(86, 103, 122, .14);
  font-size: .92rem;
}

.compact-user-row:last-child {
  border-bottom: 0;
}

.compact-user-row span {
  margin-left: 0;
}

.admin-user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.admin-mini-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  padding: 0 12px;
  cursor: pointer;
}

.admin-mini-button:hover {
  background: var(--accent-soft);
  border-color: rgba(129, 170, 48, .45);
}

.admin-mini-danger {
  color: #9b1c1c;
  border-color: rgba(155, 28, 28, .26);
}

.admin-mini-danger:hover {
  background: #fff1f2;
  border-color: rgba(155, 28, 28, .38);
}

.admin-user-note {
  justify-self: end;
  color: var(--muted);
  font-size: .86rem;
}

@media (max-width: 900px) {
  .admin-users-head {
    display: none;
  }

  .compact-user-row {
    grid-template-columns: 1fr;
    gap: 5px;
    align-items: flex-start;
    padding: 12px 0;
  }

  .admin-user-actions {
    justify-content: flex-start;
    margin-top: 4px;
  }
}


/* v49: Admin-Mail-Benachrichtigung */
.admin-mail-panel {
  max-width: 760px;
}

.admin-mail-setting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.admin-mail-setting span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.admin-mail-setting p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.setting-enabled {
  color: var(--accent-dark);
}

.setting-disabled {
  color: #9b1c1c;
}

@media (max-width: 760px) {
  .admin-mail-setting {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* v50: Admin kompakter + Mailbox passend */
.admin-stats-panel,
.admin-mail-panel {
  max-width: none !important;
  width: auto !important;
}

.admin-stats-panel,
.admin-mail-panel,
.admin-users-panel {
  padding: 18px 22px !important;
}

.admin-stats-panel h2,
.admin-mail-panel h2,
.admin-users-panel h2 {
  margin-top: 0;
  margin-bottom: 8px;
}

.admin-stats-table {
  margin-top: 6px !important;
}

.admin-stats-row {
  padding: 6px 0 !important;
  gap: 10px !important;
}

.admin-stat-title,
.admin-stats-row b {
  font-size: .92rem !important;
}

.admin-stat-reset button {
  min-height: 26px !important;
  padding: 0 9px !important;
  font-size: .78rem !important;
}

.admin-mail-setting {
  min-height: 42px;
}

.admin-mail-setting span {
  margin-top: 4px !important;
  font-size: .92rem;
}

.admin-mail-setting p {
  display: none;
}

.admin-mail-setting .btn {
  min-height: 38px;
  padding: 0 14px;
  font-size: .9rem;
}


/* v51: Benutzerkonto und Profilbilder */
.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 900;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-avatar-post {
  width: 34px;
  height: 34px;
  font-size: .82rem;
}

.user-avatar-profile {
  width: 128px;
  height: 128px;
  font-size: 2.1rem;
  box-shadow: 0 12px 28px rgba(11, 31, 51, .16);
}

.post-user-header {
  gap: 9px !important;
}

.profile-grid {
  display: grid;
  gap: 18px;
}

.profile-card h2 {
  margin-top: 0;
}

.profile-warning {
  background: #fff7ed;
  color: #9a3412;
  border-color: rgba(154, 52, 18, .2);
}

.profile-muted {
  color: var(--muted);
  line-height: 1.6;
}

.profile-avatar-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
}

.profile-avatar-preview-wrap {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.avatar-adjust {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.72);
}

.profile-checkline {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
}

.profile-checkline input {
  width: auto !important;
}

.profile-danger-card {
  border-color: rgba(155, 28, 28, .2);
}

@media (max-width: 760px) {
  .profile-avatar-layout {
    grid-template-columns: 1fr;
  }

  .profile-avatar-preview-wrap {
    justify-items: start;
  }
}



.profile-hero {
  margin-bottom: 18px;
}

.profile-account-card {
  order: 2;
}

.profile-danger-card {
  order: 3;
}

.profile-account-card .forum-form,
.profile-danger-card .forum-form {
  gap: 10px;
}

.profile-account-card button[type="submit"] {
  margin-top: 6px;
}

.profile-avatar-card {
  order: 1;
}

.profile-avatar-card .profile-muted,
.profile-warning {
  display: none !important;
}

.profile-account-card input[readonly] {
  background: #eef2f7;
  color: var(--muted);
  cursor: not-allowed;
}


/* v55: Profilbild-Zuschnitt ohne Slider */
.avatar-adjust {
  display: none !important;
}

.avatar-cropper {
  width: 160px;
  height: 160px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.avatar-cropper.is-dragging {
  cursor: grabbing;
}

.avatar-cropper .profile-avatar-preview {
  width: 160px;
  height: 160px;
  display: grid;
  place-items: center;
}

.avatar-cropper .user-avatar-profile {
  width: 160px;
  height: 160px;
}

.avatar-crop-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}

.avatar-crop-controls[hidden] {
  display: none;
}

.avatar-crop-controls button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  padding: 0 14px;
  cursor: pointer;
}

.avatar-crop-controls button:hover {
  background: var(--accent-soft);
  border-color: rgba(129, 170, 48, .45);
}

.profile-avatar-preview-wrap small {
  color: var(--muted);
  font-size: .86rem;
  text-align: center;
}


/* v56: Profilbild-Vorschau ohne Flackern */
.avatar-cropper canvas {
  width: 160px;
  height: 160px;
  border-radius: 999px;
  display: block;
}

.avatar-cropper canvas[hidden],
.avatar-cropper .profile-avatar-preview[hidden] {
  display: none !important;
}


/* v59: Angemeldet bleiben */
.remember-login-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.remember-login-row input {
  width: auto !important;
  margin: 0;
}


/* v91: Admin-Statistik Detailzeilen + Abschnittsabstände */
.admin-stats-spacer {
  height: 10px;
  border-bottom: 0px solid rgba(86, 103, 122, .16);
  margin-bottom: 4px;
}

.admin-stats-page-row .admin-stat-title {
  color: var(--muted) !important;
}

.admin-stats-page-row .admin-stat-reset {
  justify-self: end;
}
