:root {
  --bg: #0f1117; --panel: #171a23; --panel2: #1e2230; --line: #2a2f3f;
  --text: #e6e8ee; --muted: #8b92a8; --accent: #5865f2; --ok: #22c55e; --warn: #f59e0b; --ban: #dc2626;
  --r: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: #8ea1ff; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0; }
h2 { margin-top: 0; }
.wrap { max-width: 1150px; margin: 0 auto; padding: 24px 18px 60px; }
.muted { color: var(--muted); }
.sm { font-size: .85rem; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .85em; }
.nowrap { white-space: nowrap; }
.c { text-align: center; }
.center { text-align: center; }
.inline { display: flex; align-items: center; gap: 10px; }

/* Topbar */
.topbar { display: flex; align-items: center; gap: 24px; padding: 10px 22px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; color: var(--text); font-size: 1.05rem; }
.topbar nav { display: flex; gap: 16px; flex: 1; }
.topbar nav a { color: var(--muted); }
.topbar nav a:hover { color: var(--text); text-decoration: none; }
.me { display: flex; align-items: center; gap: 10px; }
.me img { width: 32px; height: 32px; border-radius: 50%; }
.me span { display: flex; flex-direction: column; line-height: 1.2; font-size: .9rem; }
.me small { color: var(--muted); font-size: .75rem; }

/* Buttons & Inputs */
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; }
.btn:hover { filter: brightness(1.1); }
.btn.sm { padding: 5px 11px; font-size: .85rem; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.ghost:hover { background: var(--panel2); }
.btn.danger { color: #f87171; }
.btn.discord { background: #5865f2; font-size: 1rem; padding: 12px 22px; }
input[type=text], input[type=search], input[type=datetime-local], textarea, select {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font: inherit;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }

/* Cards & Layout */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow-x: auto; }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.flash { padding: 11px 16px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.flash.ok { background: #14321f; border-color: #1f6f3d; color: #a7f3c0; }
.flash.err { background: #3a1416; border-color: #7f1d1d; color: #fecaca; }
.back { display: inline-block; margin-bottom: 12px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 30px; }

.login { min-height: 80vh; display: grid; place-items: center; }
.login .card { max-width: 380px; padding: 36px 30px; }
.login .logo { font-size: 3rem; }
.login h1 { margin: 6px 0 8px; }
.login p { margin-bottom: 24px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; border-left: 4px solid var(--accent); }
.stat.warn { border-left-color: var(--warn); }
.stat.ban { border-left-color: var(--ban); }
.stat b { display: block; font-size: 1.7rem; }
.stat span { color: var(--muted); font-size: .85rem; }

.toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 6px 13px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); cursor: pointer; font-size: .88rem; user-select: none; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Tabelle */
table.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.list td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.list tbody tr { cursor: pointer; }
.list tbody tr:hover { background: var(--panel2); }
.list tr:last-child td { border-bottom: 0; }
.who { display: flex; align-items: center; gap: 10px; color: var(--text); }
.who:hover { text-decoration: none; }
.who img { width: 34px; height: 34px; border-radius: 50%; }
.who span { display: flex; flex-direction: column; line-height: 1.25; font-weight: 600; }
.who small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 16px; }

/* Pills */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--panel2); border: 1px solid var(--line); vertical-align: middle; }
.pill.ok { color: #86efac; border-color: #1f6f3d; }
.pill.warn { color: #fcd34d; border-color: #92600a; }
.pill.ban { color: #fca5a5; border-color: #7f1d1d; background: #3a1416; }
.pill.timeout { color: #fdba74; border-color: #9a3412; }
.pill.grey { color: var(--muted); }
.pill.team { color: #c7d2fe; border-color: #4338ca; background: #1e1b4b; }
.pill.on { color: #fff; background: var(--c); border-color: var(--c); }

/* Profil */
.profile { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile .avatar { width: 88px; height: 88px; border-radius: 50%; border: 3px solid var(--line); }
.pinfo { flex: 1; min-width: 220px; }
.pinfo h1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.copy { background: none; border: 0; cursor: pointer; font-size: .85rem; padding: 0 4px; }
.psum { display: flex; gap: 10px; }
.psum div { background: var(--panel2); border-radius: 10px; padding: 10px 16px; text-align: center; min-width: 92px; }
.psum b { display: block; font-size: 1.4rem; }
.psum b.tw { color: var(--warn); }
.psum span { color: var(--muted); font-size: .75rem; }
.alert { background: color-mix(in srgb, var(--c) 15%, var(--panel)); border: 1px solid var(--c); border-radius: 10px; padding: 11px 16px; margin-bottom: 12px; }

/* Neuer Eintrag */
.addbox > summary { font-weight: 700; }
.addbox[open] > summary { margin-bottom: 14px; }
.entryform { display: flex; flex-direction: column; gap: 10px; }
.entryform .row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.entryform .row > label { flex: 1; min-width: 170px; }
.entryform .row > input { flex: 1; }
.typepick { display: flex; flex-wrap: wrap; gap: 8px; }
.typepick label { flex-direction: row; }
.typepick input { display: none; }
.typepick span { padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); cursor: pointer; font-size: .9rem; }
.typepick input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 25%, var(--panel2)); box-shadow: 0 0 0 1px var(--c); }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 12px; }
.entry { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--r); padding: 14px 18px; scroll-margin-top: 80px; }
.entry:target { box-shadow: 0 0 0 2px var(--accent); }
.entry.dim { opacity: .7; }
.entry header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tbadge { font-weight: 700; color: var(--c); }
.vis { font-size: .78rem; color: var(--muted); background: var(--panel2); border-radius: 6px; padding: 1px 8px; }
.when { margin-left: auto; color: var(--muted); font-size: .82rem; }
.entry h3 { margin: 8px 0 2px; font-size: 1.02rem; }
.entry .content { margin: 6px 0 10px; white-space: normal; word-wrap: break-word; }
.entry footer { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.author { display: inline-flex; align-items: center; gap: 6px; }
.author img { width: 20px; height: 20px; border-radius: 50%; }
.revoked { margin-top: 10px; padding: 8px 12px; background: var(--panel2); border-radius: 8px; font-size: .88rem; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.actions details[open] { flex-basis: 100%; order: 10; }
.actions details[open] > summary { margin-bottom: 10px; }

@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .me span { display: none; }
  .psum { width: 100%; }
  .psum div { flex: 1; }
  .list th:nth-child(2), .list td:nth-child(2), .list th:nth-child(3), .list td:nth-child(3) { display: none; }
}
