:root {
  --bg:        #0a0a12;
  --surface:   #14142a;
  --surface-2: #1a1a36;
  --border:    #2a2a4a;
  --text:      #e8e8f0;
  --muted:     #8888a8;
  --purple:    #8800ff;
  --purple-bg: rgba(136,0,255,.12);
  --cyan:      #06e6d4;
  --cyan-bg:   rgba(6,230,212,.12);
  --red:       #ff4d6d;
  --green:     #2ecc71;
  --radius:    10px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Segoe UI', Arial, sans-serif; font-size: 15px; line-height: 1.6;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header { background: linear-gradient(135deg,#1a0030,#0d0d20); border-bottom: 1px solid var(--border); }
.site-header-inner {
  max-width: 960px; margin: 0 auto; padding: 1rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem;
}
.brand { display: flex; flex-direction: column; line-height: 1.2; }
.brand-mark {
  font-weight: 900; font-size: 1.2rem;
  background: linear-gradient(90deg,#ff00aa,#00ffee); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-sub { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.site-nav { display: flex; align-items: center; gap: 1.1rem; font-size: .88rem; flex-wrap: wrap; }
.site-nav a { color: var(--text); opacity: .85; }
.site-nav a:hover { opacity: 1; color: var(--cyan); text-decoration: none; }
.nav-user { color: var(--muted); font-size: .85rem; }

.account-menu { position: relative; }
.account-menu-trigger {
  display: flex; align-items: center; gap: .5rem; background: none; border: none; cursor: pointer;
  color: var(--text); font: inherit; font-size: .88rem; padding: .3rem .4rem; border-radius: 50px;
}
.account-menu-trigger:hover { background: var(--surface-2); }
.account-menu-caret { font-size: .65rem; color: var(--muted); transition: transform .15s; }
.account-menu.open .account-menu-caret { transform: rotate(180deg); }
.account-menu-dropdown {
  position: absolute; top: 100%; right: 0; margin-top: .4rem; min-width: 190px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.35); padding: .4rem; z-index: 50;
  display: none; flex-direction: column;
}
.account-menu-dropdown a {
  display: flex; align-items: center; gap: .55rem; padding: .55rem .7rem; border-radius: 8px;
  color: var(--text); font-size: .85rem;
}
.account-menu-dropdown a:hover { background: var(--surface-2); text-decoration: none; color: var(--cyan); }
.account-menu:hover .account-menu-dropdown,
.account-menu.open .account-menu-dropdown { display: flex; }
/* Kleine unsichtbare Brücke, damit der Hover beim Wandern von Trigger zu
   Dropdown nicht durch den Zwischenraum abreißt. */
.account-menu::after {
  content: ''; position: absolute; top: 100%; right: 0; height: .4rem; width: 100%;
}
.staff-badge {
  background: var(--purple-bg); color: #c090ff; border: 1px solid rgba(136,0,255,.35);
  border-radius: 20px; padding: .1rem .5rem; font-size: .7rem; font-weight: 700; margin-left: .3rem;
}

.site-main { max-width: 960px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; min-height: 60vh; }
.site-main.wide { max-width: 1100px; }
.site-footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 2rem 1rem; border-top: 1px solid var(--border); margin-top: 2rem; }
.footer-brand { font-weight: 800; color: var(--text); margin-bottom: .3rem; }
.footer-copy a { color: var(--muted); text-decoration: underline; }
.footer-links { margin-top: .6rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--cyan); }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid;
  font-weight: 800; font-size: .85rem; flex-shrink: 0;
}
.nav-user .avatar { width: 26px; height: 26px; font-size: .68rem; vertical-align: middle; margin-right: .3rem; }

.stats-strip { display: grid; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.stat-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; text-align: center; }
.stat-box .num { font-size: 1.5rem; font-weight: 900; color: var(--cyan); }
.stat-box .label { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: .2rem; }

.cat-icon {
  width: 46px; height: 46px; border-radius: var(--radius); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  background: var(--purple-bg); color: var(--purple);
}
.cat-icon.announce { background: var(--cyan-bg); color: var(--cyan); }

h1 { font-size: 1.5rem; margin: 0 0 .3rem; }
h1 small, .page-desc { color: var(--muted); font-size: .88rem; font-weight: 400; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

.breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--cyan); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; }
.card-body { padding: 1.25rem; }

.list { list-style: none; margin: 0; padding: 0; }
.list-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--surface-2); }
.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-weight: 700; color: var(--text); font-size: 1rem; }
.list-item-title:hover { color: var(--cyan); }
.list-item-meta { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.list-item-stats { text-align: right; font-size: .78rem; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.list-item-stats .num { font-size: 1.05rem; font-weight: 800; color: var(--text); display: block; }

.badge { display: inline-flex; align-items: center; gap: .3rem; border-radius: 20px; padding: .15rem .55rem; font-size: .7rem; font-weight: 700; border: 1px solid transparent; }
.badge-pin { background: var(--cyan-bg); color: var(--cyan); border-color: rgba(6,230,212,.3); }
.badge-lock { background: rgba(255,77,109,.12); color: var(--red); border-color: rgba(255,77,109,.3); }
.badge-staff { background: var(--purple-bg); color: #c090ff; border-color: rgba(136,0,255,.35); }

.btn {
  display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1.1rem;
  border-radius: 50px; font-weight: 700; font-size: .85rem; border: 1px solid transparent;
  cursor: pointer; background: var(--surface-2); color: var(--text); text-decoration: none;
}
.btn:hover { text-decoration: none; opacity: .9; }
.btn-primary { background: var(--purple); color: #fff; }
.btn-danger { background: rgba(255,77,109,.12); color: var(--red); border-color: rgba(255,77,109,.3); }
.btn-sm { padding: .35rem .8rem; font-size: .78rem; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .82rem; font-weight: 700; color: var(--muted); margin-bottom: .35rem; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field textarea {
  width: 100%; padding: .65rem .8rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: .92rem; font-family: inherit;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--purple); }

.flash { max-width: 960px; margin: 0 auto 1rem; padding: .8rem 1.1rem; border-radius: var(--radius); font-size: .88rem; }
.flash-success { background: rgba(46,204,113,.12); color: #4ade80; border: 1px solid rgba(46,204,113,.3); }
.flash-error   { background: rgba(255,77,109,.12); color: var(--red); border: 1px solid rgba(255,77,109,.3); }

.post { display: flex; gap: 1.1rem; padding: 1.25rem; border-bottom: 1px solid var(--border); }
.post:last-child { border-bottom: none; }
.post-author {
  width: 110px; flex-shrink: 0; font-size: .82rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
}
.post-author-name { font-weight: 700; }
.post-body { white-space: pre-wrap; word-wrap: break-word; }
.post-meta { color: var(--muted); font-size: .76rem; margin-top: .6rem; display: flex; gap: .8rem; align-items: center; }
.post-meta .btn { background: transparent; }
.post-meta .btn:hover { background: var(--surface-2); }

.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-icon { font-size: 2rem; margin-bottom: .6rem; opacity: .5; }

.login-wrap { max-width: 400px; margin: 3rem auto; }
.login-hint { font-size: .82rem; color: var(--muted); margin-top: 1rem; text-align: center; }

@media (max-width: 600px) {
  .post { flex-direction: column; }
  .post-author { width: auto; flex-direction: row; }
}

/* ── Admin-Bereich ── */
.admin-nav { display: flex; gap: .5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.admin-nav a {
  padding: .5rem 1rem; border-radius: 50px; font-size: .85rem; font-weight: 700;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.admin-nav a:hover { text-decoration: none; border-color: var(--purple); }
.admin-nav a.active { background: var(--purple); border-color: var(--purple); color: #fff; }

.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.data-table th {
  text-align: left; padding: .7rem 1rem; background: var(--surface-2); color: var(--muted);
  font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
table.data-table td { padding: .7rem 1rem; border-top: 1px solid var(--border); vertical-align: top; }
table.data-table tr:hover td { background: var(--surface-2); }

.event-tag { font-family: monospace; font-size: .76rem; padding: .15rem .5rem; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.event-tag.ev-login { color: #4ade80; }
.event-tag.ev-logout { color: var(--muted); }
.event-tag.ev-create { color: var(--cyan); }
.event-tag.ev-edit { color: #f5a623; }
.event-tag.ev-delete { color: var(--red); }
.event-tag.ev-visit { color: #6b7280; }

.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 1.25rem; }
.pagination a, .pagination span { padding: .4rem .8rem; border-radius: 8px; font-size: .82rem; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.pagination a:hover { text-decoration: none; border-color: var(--purple); }
.pagination .current { background: var(--purple); border-color: var(--purple); color: #fff; }
