:root {
  --bg: #0b0d10;
  --card: #12151a;
  --card2: #171b21;
  --line: #1f242c;
  --text: #ecedee;
  --muted: #8a919c;
  --faint: #5b626c;
  --lime: #c8f542;
  --danger: #ff5f56;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
}

.wrap { max-width: 1000px; margin: 0 auto; padding: 22px 18px 70px; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.topbar.compact { margin-bottom: 16px; }
.topbar h1 { font-weight: 900; letter-spacing: 2.5px; font-size: 21px; margin: 0; }
.topbar h1 span { color: var(--lime); }
.topbar .spacer { flex: 1; }
.profile-menu { position: relative; }

.logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--lime);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--card2);
  border: 1px solid var(--line);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  padding: 0;
}

.avatar:hover { background: var(--card2); }

.menu {
  position: absolute;
  top: 46px;
  right: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  min-width: 220px;
  z-index: 20;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}

.menu .mi { padding: 9px 12px; font-size: 13px; color: var(--muted); }
.menu button {
  width: 100%;
  text-align: left;
  background: none;
  color: var(--text);
  border: none;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.menu button:hover { background: var(--card2); }

h2 {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--muted);
  text-transform: uppercase;
  margin: 24px 0 9px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.card.pad { padding: 16px; }
.card.pad-sm { padding: 14px; }
.stack-gap { margin-bottom: 14px; }
.stack-gap-lg { margin-bottom: 18px; }
.space-top { margin-top: 10px; }
.space-top-lg { margin-top: 12px; }

table { border-collapse: collapse; width: 100%; }
th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 13px;
}
th {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
}
tr:last-child td { border-bottom: none; }

/* Lange Listen (Activity log, Waitlist) scrollen in sich, statt die Seite endlos
   wachsen zu lassen — sonst rutscht alles darunter aus dem Blick. Der Kopf bleibt
   beim Scrollen stehen, damit die Spalten zuordenbar bleiben. */
.tablescroll {
  max-height: 46vh;
  overflow-y: auto;
}
.tablescroll thead th {
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}
tr.click { cursor: pointer; }
tr.click:hover,
tr.click:focus { background: var(--card2); outline: none; }

.muted { color: var(--muted); font-size: 12px; }
.faint { color: var(--faint); font-size: 11px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.break-all { word-break: break-all; }

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: #22272f;
  color: var(--muted);
}
.pill.ok { color: #0b0d10; background: var(--lime); }
.pill.warn { color: #f5c542; background: rgba(245, 197, 66, .14); }
.pill.bad { color: var(--danger); background: rgba(255, 95, 86, .14); }

input,
select,
textarea {
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  padding: 11px 13px;
  font-size: 14px;
  width: 100%;
  font-family: inherit;
}

textarea { min-height: 90px; resize: vertical; }
button {
  background: #fff;
  color: #000;
  border: none;
  border-radius: 99px;
  padding: 10px 18px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}
button.ghost { background: var(--card2); color: var(--text); border: 1px solid var(--line); }
button.danger { background: transparent; color: var(--danger); border: 1px solid rgba(255, 95, 86, .5); }
button:disabled { opacity: .4; cursor: default; }
.full { width: 100%; }

.login { max-width: 360px; margin: 13vh auto 0; padding: 24px; }
.login input { margin-bottom: 11px; }
.login h1 { font-weight: 900; letter-spacing: 2px; font-size: 19px; margin: 0; }
.err { color: var(--danger); font-size: 12px; margin-top: 8px; }
.row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.tight { gap: 8px; }
.back {
  color: var(--lime);
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 16px;
  display: inline-block;
  padding: 0;
  border: 0;
  background: transparent;
}
.hidden { display: none !important; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 9px 17px;
  border-radius: 99px;
  background: var(--card2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}
.tab.active { background: #fff; color: #000; border-color: #fff; }
.subtabs { display: flex; gap: 7px; margin-bottom: 14px; }
.subtab {
  padding: 6px 14px;
  border-radius: 99px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.subtab.active { background: var(--card2); color: var(--text); border-color: var(--faint); }

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: #000;
  font-weight: 800;
  padding: 11px 22px;
  border-radius: 99px;
  font-size: 13px;
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
  z-index: 50;
}
.toast.show { opacity: 1; }

.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.stat .n { font-size: 30px; font-weight: 900; letter-spacing: -1px; }
.stat .n.lime { color: var(--lime); }
.stat .l { font-size: 11px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; margin-top: 2px; }

.dhead { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.dhead .av,
.avatar-image {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--line);
  flex: none;
}
.dhead .av {
  background: var(--card2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: var(--muted);
}
.avatar-image { object-fit: cover; }
.dhead .nm { font-size: 22px; font-weight: 900; }

.inforow { display: flex; justify-content: space-between; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.inforow:last-child { border-bottom: none; }
.inforow.click { cursor: pointer; }
.inforow.click:hover,
.inforow.click:focus { background: var(--card2); outline: none; }
.inforow .k { color: var(--muted); font-size: 12px; }
.inforow .v { font-weight: 600; text-align: right; word-break: break-all; }

.act { padding: 14px; border-bottom: 1px solid var(--line); }
.act:last-child { border-bottom: none; }
.act .lbl { font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.act .cur { color: var(--faint); font-size: 11px; }
.act .form { display: flex; gap: 9px; margin-top: 8px; }
.act .form input { flex: 1; }

.bubble { background: var(--card2); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.bubble.reply { border-left: 3px solid var(--lime); }
.thread { max-height: 52vh; overflow-y: auto; padding: 6px 2px; margin-bottom: 6px; }
.thread.card { padding: 12px; }
.mrow { display: flex; margin-bottom: 5px; }
.mrow.team { justify-content: flex-end; }
.msg {
  max-width: 62%;
  background: #1d2127;
  border-radius: 16px;
  padding: 9px 13px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}
.mrow.team .msg { background: #fff; color: #0b0d10; }
.mmeta { display: block; font-size: 10px; color: var(--faint); margin-top: 3px; }
.mrow.team .mmeta { color: #8a919c; }
button.mdel {
  background: none;
  border: 0;
  border-radius: 0;
  color: var(--danger);
  cursor: pointer;
  font-size: 10px;
  opacity: 0;
  padding: 0;
  transition: opacity .15s;
  text-decoration: none;
}
.msg:hover .mdel,
.msg:focus-within .mdel { opacity: 1; }
.daychip { text-align: center; margin: 10px 0 8px; }
.daychip span { font-size: 10px; color: var(--muted); background: var(--card2); border-radius: 99px; padding: 3px 12px; }

.media-link {
  display: inline-flex;
  width: 52px;
  height: 52px;
  border-radius: 9px;
  align-items: center;
  justify-content: center;
  background: var(--card2);
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  overflow: hidden;
}
.media-thumb { width: 52px; height: 52px; object-fit: cover; }
.media-cell { width: 60px; }
.search { max-width: 380px; margin-bottom: 14px; }
.state-pad { padding: 20px; }
.inline-link { color: var(--lime); text-decoration: none; margin-left: 8px; }

@media (max-width: 680px) {
  .wrap { padding-inline: 12px; }
  .card { overflow-x: auto; }
  th,
  td { padding: 10px; }
  .msg { max-width: 86%; }
  .act .form { flex-direction: column; }
}
