/* ============================================================
   State Life Online Forum – main.css
   Schrift: Outfit (Google Fonts) + JetBrains Mono
   Design:  Dunkles Theme, blaue Akzente
   ============================================================ */

/* ── CSS Custom Properties ─────────────────────────────── */
:root {
  /* Hintergrundfarben */
  --bg-base:     #0c0e14;
  --bg-surface:  #111420;
  --bg-elevated: #161a28;
  --bg-hover:    #1c2133;
  --bg-input:    #0f1119;

  /* Rahmen */
  --border:       #1e2438;
  --border-light: #232840;

  /* Blau-Akzente */
  --blue:         #3b7ff5;
  --blue-dim:     #1e3a6e;
  --blue-glow:    rgba(59, 127, 245, 0.15);
  --blue-hover:   #5191ff;

  /* Text */
  --text-primary: #dde3f0;
  --text-muted:   #5a6480;
  --text-subtle:  #3d4561;

  /* Status */
  --green:  #22c55e;
  --red:    #ef4444;
  --yellow: #f59e0b;
  --purple: #a855f7;
  --orange: #f97316;

  /* Rollenfarben */
  --role-owner:  #f59e0b;
  --role-admin:  #ef4444;
  --role-mod:    #3b7ff5;
  --role-support:#22c55e;
  --role-user:   #5a6480;

  /* Layout */
  --sidebar-w:   280px;
  --topnav-h:    60px;
  --radius:      10px;
  --radius-sm:   6px;
  --radius-lg:   14px;

  /* Schatten */
  --shadow:      0 2px 12px rgba(0,0,0,0.4);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.5);

  /* Transition */
  --ease: 0.18s ease;
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: var(--blue); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--blue-hover); }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }
code, pre { font-family: 'JetBrains Mono', monospace; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue-dim); }

/* ── Typografie ─────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

.text-muted  { color: var(--text-muted); font-size: 0.875rem; }
.text-subtle { color: var(--text-subtle); font-size: 0.8rem; }

/* ── Icons (Lucide) ─────────────────────────────────────── */
.icon { width: 16px; height: 16px; display: inline-flex; align-items: center;
        font-size: 16px; line-height: 1; vertical-align: middle; flex-shrink: 0; }
.icon--lg { font-size: 20px; width: 20px; height: 20px; }
.icon--xl { font-size: 24px; width: 24px; height: 24px; }

/* ── Avatare ────────────────────────────────────────────── */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar--xs  { width: 28px; height: 28px; }
.avatar--sm  { width: 36px; height: 36px; }
.avatar--md  { width: 48px; height: 48px; }
.avatar--lg  { width: 72px; height: 72px; }
.avatar--xl  { width: 96px; height: 96px; }

/* ── Divider ────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 6px 0; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500; font-family: inherit;
  transition: all var(--ease); cursor: pointer; border: 1px solid transparent;
  white-space: nowrap; line-height: 1;
}
.btn--primary {
  background: var(--blue); color: #fff; border-color: var(--blue);
}
.btn--primary:hover {
  background: var(--blue-hover); border-color: var(--blue-hover); color: #fff;
}
.btn--ghost {
  background: transparent; color: var(--text-muted);
  border-color: var(--border-light);
}
.btn--ghost:hover {
  background: var(--bg-hover); color: var(--text-primary);
  border-color: var(--border-light);
}
.btn--danger {
  background: rgba(239,68,68,.12); color: var(--red); border-color: rgba(239,68,68,.2);
}
.btn--danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn--sm  { padding: 6px 13px; font-size: 0.8125rem; }
.btn--xs  { padding: 4px 9px;  font-size: 0.75rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

/* Nur-Icon-Button */
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all var(--ease); position: relative;
  background: var(--bg-elevated); border: 1px solid var(--border);
}
.icon-btn:hover { color: var(--text-primary); background: var(--bg-hover); }

/* ── Badge ──────────────────────────────────────────────── */
.badge {
  position: absolute; top: -5px; right: -5px;
  background: var(--red); color: #fff;
  font-size: 0.65rem; font-weight: 700; min-width: 18px; height: 18px;
  border-radius: 99px; display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid var(--bg-base);
}

/* Rollen-Badge */
.role-badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 99px; font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.role-owner   { background: rgba(245,158,11,.15); color: var(--role-owner); }
.role-admin   { background: rgba(239,68,68,.15);  color: var(--role-admin); }
.role-mod     { background: rgba(59,127,245,.15); color: var(--role-mod); }
.role-support { background: rgba(34,197,94,.15);  color: var(--role-support); }
.role-user    { background: rgba(90,100,128,.15); color: var(--role-user); }

/* ── Formulare ──────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.875rem; font-weight: 500; color: var(--text-muted); }

.form-input,
.form-textarea,
.form-select {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  padding: 10px 13px; font-size: 0.9rem; font-family: inherit;
  transition: border-color var(--ease), box-shadow var(--ease);
  width: 100%;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-subtle); }
.form-textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a6480' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; cursor: pointer; }

.form-error { font-size: 0.8rem; color: var(--red); }
.form-hint  { font-size: 0.8rem; color: var(--text-subtle); }

/* ── Flash-Meldungen ────────────────────────────────────── */
.flash {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  font-size: 0.875rem; border-left: 3px solid transparent; position: relative;
}
.flash--success { background: rgba(34,197,94,.1);  border-color: var(--green); color: #86efac; }
.flash--error   { background: rgba(239,68,68,.1);  border-color: var(--red);   color: #fca5a5; }
.flash--info    { background: rgba(59,127,245,.1); border-color: var(--blue);  color: #93c5fd; }
.flash--warning { background: rgba(245,158,11,.1); border-color: var(--yellow);color: #fcd34d; }
.flash__close { margin-left: auto; color: inherit; opacity: 0.6; padding: 2px; }
.flash__close:hover { opacity: 1; }

/* ── Top-Navigation ─────────────────────────────────────── */
.topnav {
  position: sticky; top: 0; z-index: 100;
  height: var(--topnav-h);
  background: rgba(12,14,20,0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.topnav__inner {
  max-width: 1400px; margin: 0 auto; padding: 0 20px;
  height: 100%; display: flex; align-items: center; gap: 24px;
}

/* Logo */
.topnav__logo {
  display: flex; align-items: center; gap: 9px;
  font-size: 1rem; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.02em; flex-shrink: 0;
}
.topnav__logo:hover { color: var(--text-primary); }
.topnav__logo-img {
  width: 1px; height: 1px; object-fit: contain; border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* Links */
.topnav__links {
  display: flex; align-items: center; gap: 4px; flex: 1;
}
.topnav__link {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500; color: var(--text-muted);
  transition: all var(--ease);
}
.topnav__link:hover, .topnav__link.active {
  color: var(--text-primary); background: var(--bg-elevated);
}
.topnav__link.active { color: var(--blue); }

/* Rechte Seite */
.topnav__right {
  display: flex; align-items: center; gap: 8px; margin-left: auto;
}

/* Avatar-Dropdown */
.avatar-menu { position: relative; }
.avatar-menu__trigger {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text-primary);
  font-size: 0.875rem; font-weight: 500; cursor: pointer;
  transition: all var(--ease);
}
.avatar-menu__trigger:hover { background: var(--bg-hover); border-color: var(--border-light); }
.avatar-menu__name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar-menu__dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px; min-width: 220px;
  box-shadow: var(--shadow-lg); z-index: 200;
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: all var(--ease);
}
.avatar-menu__dropdown.open {
  opacity: 1; pointer-events: all; transform: translateY(0);
}
.avatar-menu__header {
  display: flex; align-items: center; gap: 10px; padding: 8px;
}
.avatar-menu__uname { font-weight: 600; font-size: 0.9rem; line-height: 1.2; }
.avatar-menu__item {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px;
  border-radius: var(--radius-sm); color: var(--text-muted);
  font-size: 0.875rem; font-weight: 500; transition: all var(--ease);
}
.avatar-menu__item:hover { background: var(--bg-hover); color: var(--text-primary); }
.avatar-menu__item--danger:hover { background: rgba(239,68,68,.1); color: var(--red); }

/* Hamburger */
.topnav__hamburger {
  display: none; width: 36px; height: 36px; border-radius: var(--radius-sm);
  align-items: center; justify-content: center;
  color: var(--text-muted); background: var(--bg-elevated);
  border: 1px solid var(--border); transition: all var(--ease);
}
.topnav__hamburger:hover { color: var(--text-primary); background: var(--bg-hover); }

/* ── Benachrichtigungs-Dropdown ─────────────────────────── */
.notif-wrap { position: relative; }

.notif-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 300px; max-width: 340px;
  box-shadow: var(--shadow-lg); z-index: 200;
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: all var(--ease); overflow: hidden;
}
.notif-dropdown.open {
  opacity: 1; pointer-events: all; transform: translateY(0);
}
.notif-dropdown__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  font-size: .8rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.notif-dropdown__empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 28px 16px; color: var(--text-subtle); font-size: .85rem;
}
.notif-dropdown__list { list-style: none; max-height: 320px; overflow-y: auto; }

.notif-item { border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: none; }
.notif-item--unread { background: var(--blue-glow); }

.notif-item__inner {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; color: var(--text-muted); font-size: .83rem;
  transition: background var(--ease);
}
.notif-item__inner:hover { background: var(--bg-hover); color: var(--text-primary); }
.notif-item__text { flex: 1; line-height: 1.4; }
.notif-item__text strong { color: var(--text-primary); }
.notif-item__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--blue); flex-shrink: 0;
}

/* ── Layout (Sidebar + Content) ─────────────────────────── */
.layout {
  max-width: 1400px; margin: 0 auto; padding: 28px 20px;
  display: grid; grid-template-columns: var(--sidebar-w) 1fr;
  gap: 24px; align-items: start;
}
.layout__main { min-width: 0; }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: calc(var(--topnav-h) + 20px);
}
.sidebar__card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.sidebar__card-header {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  font-size: 0.8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-subtle);
  border-bottom: 1px solid var(--border);
}
.sidebar__list { padding: 6px; }
.sidebar__item {
  display: flex; align-items: center; gap: 9px; padding: 8px 9px;
  border-radius: var(--radius-sm); color: var(--text-muted);
  font-size: 0.875rem; font-weight: 500; transition: all var(--ease);
}
.sidebar__item:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar__item.active { background: var(--blue-glow); color: var(--blue); }
.sidebar__count {
  margin-left: auto; font-size: 0.75rem; color: var(--text-subtle);
  background: var(--bg-hover); border-radius: 99px; padding: 1px 7px;
}

/* Statistiken */
.sidebar__stats {
  display: grid; grid-template-columns: repeat(3,1fr); padding: 12px;
}
.stat-item { text-align: center; padding: 8px 4px; }
.stat-item__value { display: block; font-size: 1.25rem; font-weight: 700; color: var(--blue); }
.stat-item__label { font-size: 0.7rem; color: var(--text-subtle); text-transform: uppercase; letter-spacing: 0.05em; }

/* Letzte Aktivität */
.sidebar__activity-item {
  display: flex; flex-direction: column; padding: 8px 9px;
  border-radius: var(--radius-sm); transition: background var(--ease);
}
.sidebar__activity-item:hover { background: var(--bg-hover); }
.sidebar__activity-title { font-size: 0.8rem; color: var(--text-primary); font-weight: 500; line-height: 1.4; }
.sidebar__activity-meta  { font-size: 0.72rem; color: var(--text-subtle); margin-top: 2px; }

/* ── Seiten-Kopf (Breadcrumb etc.) ──────────────────────── */
.page-header { margin-bottom: 20px; }
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--text-subtle); margin-bottom: 10px;
}
.breadcrumb a { color: var(--text-subtle); }
.breadcrumb a:hover { color: var(--text-muted); }
.breadcrumb__sep { color: var(--text-subtle); }
.page-header__row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.page-header__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Karten ─────────────────────────────────────────────── */
.card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.card--hover:hover { border-color: var(--border-light); }

/* ── Post-Liste ─────────────────────────────────────────── */
.post-list { display: flex; flex-direction: column; gap: 2px; }

.post-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px; align-items: center;
  padding: 16px 18px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); transition: all var(--ease);
  text-decoration: none;
}
.post-item:hover {
  background: var(--bg-elevated); border-color: var(--border-light);
  transform: translateY(-1px); box-shadow: var(--shadow);
}
.post-item--pinned { border-left: 3px solid var(--blue); }
.post-item--locked { opacity: 0.75; }

.post-item__icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--bg-elevated); display: flex; align-items: center;
  justify-content: center; color: var(--text-subtle); flex-shrink: 0;
  border: 1px solid var(--border);
}
.post-item--pinned .post-item__icon { background: var(--blue-glow); color: var(--blue); }

.post-item__title {
  font-size: 0.95rem; font-weight: 600; color: var(--text-primary);
  line-height: 1.3; margin-bottom: 4px; display: -webkit-box;
  -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.post-item__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.post-item__tags { display: flex; gap: 5px; }

.post-item__stats {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 4px; flex-shrink: 0; font-size: 0.78rem; color: var(--text-subtle);
}
.post-item__stat { display: flex; align-items: center; gap: 4px; }

/* Tags / Badges */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 99px;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.03em;
  white-space: nowrap;
}
.tag--pinned { background: var(--blue-glow); color: var(--blue); }
.tag--locked { background: rgba(239,68,68,.1); color: var(--red); }
.tag--cat    { background: var(--bg-elevated); color: var(--text-subtle); border: 1px solid var(--border); }

/* ── Kategorie-Abschnitt ────────────────────────────────── */
.cat-section { margin-bottom: 28px; }
.cat-section__header {
  display: flex; align-items: center; gap: 10px;
  padding: 0 0 10px; margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.cat-section__icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--blue-glow); color: var(--blue);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.cat-section__name { font-size: 1rem; font-weight: 600; }
.cat-section__desc { font-size: 0.8rem; color: var(--text-subtle); }
.cat-section__count { margin-left: auto; font-size: 0.8rem; color: var(--text-subtle); }

/* ── Einzelner Post ─────────────────────────────────────── */
.post-detail { }
.post-detail__header {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 16px;
}
.post-detail__title {
  font-size: 1.5rem; font-weight: 700; line-height: 1.3;
  margin-bottom: 14px; letter-spacing: -0.02em;
}
.post-detail__meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  font-size: 0.825rem; color: var(--text-subtle);
}

/* Post-Körper */
.post-body {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); display: grid;
  grid-template-columns: auto 1fr; gap: 0;
}
.post-body__aside {
  padding: 20px 16px; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; min-width: 110px; background: var(--bg-elevated);
}
.post-body__username { font-size: 0.8rem; font-weight: 600; text-align: center; }
.post-body__content  { padding: 24px; line-height: 1.75; font-size: 0.95rem; min-width: 0; }

/* Gerenderte Inhalte */
.post-body__content p          { margin-bottom: 1em; }
.post-body__content strong     { font-weight: 700; color: var(--text-primary); }
.post-body__content em         { font-style: italic; }
.post-body__content a          { color: var(--blue); }
.post-body__content mark       { background: rgba(245,158,11,.25); color: var(--yellow); border-radius: 3px; padding: 0 3px; }
.post-body__content code       { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 0.875em; }
.post-body__content pre        { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; overflow-x: auto; margin: 1em 0; }
.post-body__content blockquote { border-left: 3px solid var(--blue); padding-left: 14px; color: var(--text-muted); margin: 1em 0; }
.post-body__content .mention   { color: var(--blue); font-weight: 500; background: var(--blue-glow); border-radius: 4px; padding: 0 4px; }

/* Post-Footer (Aktionen) */
.post-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-top: 1px solid var(--border);
  background: var(--bg-elevated); flex-wrap: wrap; gap: 8px;
}
.post-footer__actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Kommentare ─────────────────────────────────────────── */
.comments-section { margin-top: 20px; }
.comments-header  {
  font-size: 0.875rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}

.comment {
  display: grid; grid-template-columns: auto 1fr;
  gap: 0; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px; overflow: hidden;
}
.comment__aside {
  padding: 14px 12px; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; min-width: 90px; background: var(--bg-elevated);
}
.comment__aside-name { font-size: 0.75rem; font-weight: 600; text-align: center; }
.comment__body { padding: 14px 18px; min-width: 0; }
.comment__content { font-size: 0.9rem; line-height: 1.65; margin-bottom: 8px; }
.comment__meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.75rem; color: var(--text-subtle);
}
.comment__actions { display: flex; gap: 6px; }

/* Kommentar-Editor */
.comment-form {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-top: 16px;
}
.comment-form h3 { font-size: 0.9rem; margin-bottom: 12px; }

/* ── Rich-Text-Editor ───────────────────────────────────── */
.editor-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.editor-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-glow); }

.editor-toolbar {
  display: flex; align-items: center; gap: 2px; padding: 6px 8px;
  background: var(--bg-elevated); border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.editor-toolbar__sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }

.toolbar-btn {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 14px; cursor: pointer;
  transition: all var(--ease); background: transparent;
  border: 1px solid transparent;
}
.toolbar-btn:hover  { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border); }
.toolbar-btn.active { background: var(--blue-glow); color: var(--blue); border-color: var(--blue-dim); }
.toolbar-btn--bold   { font-weight: 700; font-size: 13px; font-family: serif; }

.editor-body {
  background: var(--bg-input); color: var(--text-primary);
  padding: 14px; min-height: 160px; outline: none;
  font-size: 0.925rem; line-height: 1.7; overflow-y: auto;
}
.editor-body:empty::before { content: attr(data-placeholder); color: var(--text-subtle); }

/* Mention-Autocomplete */
.mention-popup {
  position: absolute; z-index: 300; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  min-width: 180px; overflow: hidden; box-shadow: var(--shadow-lg);
}
.mention-popup__item {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  cursor: pointer; font-size: 0.85rem; transition: background var(--ease);
}
.mention-popup__item:hover, .mention-popup__item.selected { background: var(--bg-hover); }

/* ── Login / Register ───────────────────────────────────── */
.auth-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - var(--topnav-h)); padding: 40px 20px;
  background: radial-gradient(ellipse at 50% 0%, rgba(59,127,245,.06) 0%, transparent 60%);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}
.auth-card__logo {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
}
.auth-card__logo-icon {
  width: 48px; height: 48px; background: var(--blue); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px;
}
.auth-card h2 { text-align: center; margin-bottom: 6px; }
.auth-card__sub { text-align: center; color: var(--text-subtle); font-size: 0.875rem; margin-bottom: 28px; }

.auth-form { display: flex; flex-direction: column; gap: 16px; }

.discord-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px; border-radius: var(--radius-sm);
  background: #5865F2; color: #fff; font-weight: 600; font-size: 0.9rem;
  transition: background var(--ease); border: none; cursor: pointer; font-family: inherit;
}
.discord-btn:hover { background: #4752C4; color: #fff; }

.auth-sep {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-subtle); font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.auth-sep::before, .auth-sep::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.auth-footer { text-align: center; font-size: 0.85rem; color: var(--text-muted); margin-top: 20px; }

/* ── Profil-Seite ───────────────────────────────────────── */
.profile-header {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  display: flex; align-items: center; gap: 20px; margin-bottom: 20px;
}
.profile-header__info { flex: 1; }
.profile-header__name { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.profile-header__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }

/* ── Admin Panel ─────────────────────────────────────────── */
.admin-wrap {
  display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start;
}
.admin-sidebar {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  position: sticky; top: calc(var(--topnav-h) + 20px);
}
.admin-sidebar__header {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-subtle);
}
.admin-nav { padding: 6px; }
.admin-nav__item {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px;
  border-radius: var(--radius-sm); color: var(--text-muted);
  font-size: 0.875rem; font-weight: 500; transition: all var(--ease);
}
.admin-nav__item:hover  { background: var(--bg-hover); color: var(--text-primary); }
.admin-nav__item.active { background: var(--blue-glow); color: var(--blue); }

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 10px 14px; font-size: 0.75rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-subtle); border-bottom: 1px solid var(--border); background: var(--bg-elevated);
}
.data-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-size: 0.875rem; color: var(--text-muted);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-hover); }

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 4px; justify-content: center; margin-top: 20px; }
.pagination__btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.875rem; transition: all var(--ease);
}
.pagination__btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-light); }
.pagination__btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.pagination__btn[disabled] { opacity: 0.4; pointer-events: none; }

/* ── Leer-Zustand ───────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; text-align: center;
}
.empty-state__icon { font-size: 40px; color: var(--text-subtle); margin-bottom: 14px; }
.empty-state__title { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.empty-state__desc  { font-size: 0.875rem; color: var(--text-subtle); max-width: 320px; }

/* ── Locked-Banner ───────────────────────────────────────── */
.locked-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.2); border-radius: var(--radius-sm);
  color: var(--red); font-size: 0.875rem; font-weight: 500; margin-bottom: 14px;
}

/* ── Site-Footer ─────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border); padding: 20px 0;
  margin-top: 40px; background: var(--bg-base);
}
.site-footer__inner {
  max-width: 1400px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.site-footer__copy  { font-size: 0.8rem; color: var(--text-subtle); }
.site-footer__links { display: flex; gap: 16px; }
.site-footer__links a { font-size: 0.8rem; color: var(--text-subtle); }
.site-footer__links a:hover { color: var(--text-muted); }

/* ── Suchleiste ─────────────────────────────────────────── */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 14px;
  margin-bottom: 20px; transition: border-color var(--ease), box-shadow var(--ease);
}
.search-bar:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-glow); }
.search-bar input { background: transparent; border: none; outline: none; flex: 1; color: var(--text-primary); font-size: 0.9rem; }
.search-bar input::placeholder { color: var(--text-subtle); }

/* ── Erstelle-Post / Edit ────────────────────────────────── */
.create-wrap {
  max-width: 860px;
}
.create-form { display: flex; flex-direction: column; gap: 18px; }

/* ── Einstellungen ───────────────────────────────────────── */
.settings-layout {
  display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start;
}
.settings-nav {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px; overflow: hidden;
  position: sticky; top: calc(var(--topnav-h) + 20px);
}
.settings-nav__item {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px;
  border-radius: var(--radius-sm); color: var(--text-muted);
  font-size: 0.875rem; font-weight: 500; transition: all var(--ease);
}
.settings-nav__item:hover  { background: var(--bg-hover); color: var(--text-primary); }
.settings-nav__item.active { background: var(--blue-glow); color: var(--blue); }

.settings-section {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 16px; overflow: hidden;
}
.settings-section__header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.settings-section__body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  :root { --sidebar-w: 240px; }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  .sidebar {
    position: static;
    order: 2;
  }
  .layout__main { order: 1; }
  .topnav__links { display: none; }
  .topnav__hamburger { display: inline-flex; }
  .avatar-menu__name { display: none; }
  .settings-layout,
  .admin-wrap { grid-template-columns: 1fr; }
  .post-body { grid-template-columns: 1fr; }
  .post-body__aside { border-right: none; border-bottom: 1px solid var(--border); flex-direction: row; justify-content: flex-start; min-width: unset; padding: 12px 16px; }
  .comment { grid-template-columns: 1fr; }
  .comment__aside { border-right: none; border-bottom: 1px solid var(--border); flex-direction: row; min-width: unset; padding: 10px 14px; }
  .profile-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
  body { font-size: 15px; }
  .layout { padding: 16px 12px; gap: 16px; }
  .auth-card { padding: 24px 18px; }
  .post-item { grid-template-columns: 1fr; }
  .post-item__stats { flex-direction: row; align-items: center; }
  .post-detail__title { font-size: 1.2rem; }
  .topnav__inner { padding: 0 12px; }
  .site-footer__inner { flex-direction: column; align-items: center; text-align: center; }
}

/* ── Mobile Navigation Overlay ───────────────────────────── */
.mobile-nav {
  display: none; position: fixed; top: var(--topnav-h); left: 0; right: 0;
  bottom: 0; background: rgba(12,14,20,.97); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 99; flex-direction: column; padding: 16px;
  gap: 2px; border-top: 1px solid var(--border);
  overflow-y: auto;
}
.mobile-nav.open { display: flex; }
.mobile-nav__item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-radius: var(--radius-sm); color: var(--text-muted);
  font-size: 1rem; font-weight: 500; transition: all var(--ease);
}
.mobile-nav__item:hover { background: var(--bg-elevated); color: var(--text-primary); }

/* ── Animationen ─────────────────────────────────────────── */
@keyframes fadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
.animate-in { animation: fadeIn 0.22s ease both; }
.topnav {
  overflow: hidden;
}

.topnav__logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.topnav__logo-img {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  flex: 0 0 20px !important;
  display: block !important;
  object-fit: contain !important;
}