:root {
  --bg: #080510;
  --surface: #120a1c;
  --surface-2: #1a1028;
  --ink: #f7f1fc;
  --ink-soft: #d8cee6;
  --mute: #9586ad;
  --line: rgba(242, 238, 248, 0.1);
  --line-strong: rgba(242, 238, 248, 0.16);
  --primary: #d946ef;
  --primary-2: #22d3ee;
  --primary-soft: rgba(217, 70, 239, 0.14);
  --discord: #5865f2;
  --discord-hover: #4752c4;
  --err: #f87171;
  --ok: #34d399;
  --sidebar: 260px;
  --font: "Sora", system-ui, "Segoe UI", sans-serif;
  --display: "Exo 2", "Sora", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 16px;
}

@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("https://exomc.net/assets/fonts/sora/sora-latin.woff2") format("woff2");
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink-soft);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 12% -5%, rgba(34, 211, 238, 0.16), transparent 55%),
    radial-gradient(ellipse 60% 40% at 95% 0%, rgba(217, 70, 239, 0.2), transparent 50%),
    radial-gradient(ellipse 50% 35% at 50% 110%, rgba(99, 102, 241, 0.12), transparent 55%),
    var(--bg);
}

.view {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}

.view[hidden],
.page[hidden],
[hidden] {
  display: none !important;
}

.panel {
  width: min(420px, 100%);
  padding: 2rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(18, 10, 28, 0.88);
  backdrop-filter: blur(16px);
  text-align: center;
  animation: up 0.5s var(--ease) both;
}

.panel--plain {
  border: none;
  background: transparent;
  backdrop-filter: none;
}

.brand {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #7dd3fc 0%, #d946ef 55%, #f0abfc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.85rem;
}

h1,
h2 {
  color: var(--ink);
  letter-spacing: -0.03em;
}

.panel h1 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 800;
}

.lead {
  margin-top: 0.65rem;
  color: var(--mute);
  font-size: 0.95rem;
}

.err {
  margin-top: 1rem;
  color: var(--err);
  font-size: 0.88rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.55rem;
  padding: 0 1.1rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, opacity 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn--primary {
  background: linear-gradient(135deg, #c026d3, #7c3aed);
  color: #fff;
  box-shadow: 0 8px 28px rgba(192, 38, 211, 0.28);
}

.btn--primary:hover {
  filter: brightness(1.06);
}

.btn--discord {
  margin-top: 1.5rem;
  width: 100%;
  background: var(--discord);
  color: #fff;
}

.btn--discord:hover {
  background: var(--discord-hover);
}

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: rgba(217, 70, 239, 0.45);
  background: var(--primary-soft);
}

.btn--danger {
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.btn--danger:hover {
  background: rgba(248, 113, 113, 0.12);
}

.btn--sm {
  min-height: 2.1rem;
  padding: 0 0.75rem;
  font-size: 0.8rem;
}

.foot {
  margin-top: 1.35rem;
  font-size: 0.85rem;
  color: var(--mute);
}

.foot a:hover {
  color: var(--ink);
}

.userchip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem auto 0;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: left;
}

.userchip img,
.topbar__user img {
  border-radius: 50%;
  border: 1px solid var(--line);
}

.userchip strong,
.topbar__user strong {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
}

.userchip span,
.topbar__user span {
  display: block;
  font-size: 0.72rem;
  color: var(--mute);
  font-family: ui-monospace, monospace;
}

/* —— Shell / Sidebar —— */
.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100svh;
  animation: up 0.45s var(--ease) both;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 0.75rem;
  border-right: 1px solid var(--line);
  background: rgba(9, 5, 16, 0.94);
  backdrop-filter: blur(18px);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0.55rem 0.9rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.25rem;
}

.sidebar__brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(217, 70, 239, 0.28);
}

.sidebar__brand strong {
  display: block;
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.03em;
}

.sidebar__brand span {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sidebar__nav {
  display: grid;
  gap: 0.15rem;
  flex: 1;
  overflow: auto;
  padding: 0.15rem 0;
}

/* Section labels: Übersicht + Administration — same size */
.nav-section {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  min-height: 2rem;
  padding: 0 0.7rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--mute);
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
}

.nav-section > span {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.nav-section svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  opacity: 0.55;
}

.nav-section:hover {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.035);
}

.nav-section:hover svg {
  opacity: 0.85;
}

.nav-section.is-active {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.72rem;
  background: rgba(217, 70, 239, 0.1);
  box-shadow: inset 2px 0 0 0 rgba(217, 70, 239, 0.75);
}

.nav-section.is-active svg {
  opacity: 1;
  color: #e879f9;
}

.nav-section--toggle {
  justify-content: space-between;
}

.nav-section--toggle .chev {
  width: 14px;
  height: 14px;
  opacity: 0.45;
  transition: transform 0.2s var(--ease);
}

.nav-group.is-open .nav-section--toggle .chev {
  transform: rotate(180deg);
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.15rem;
  padding: 0 0.7rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--mute);
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: background 0.15s, color 0.15s;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  opacity: 0.7;
}

.nav-item:hover {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.035);
}

.nav-item:hover svg {
  opacity: 0.9;
}

.nav-item.is-active {
  color: var(--ink-soft);
  font-weight: 500;
  background: rgba(217, 70, 239, 0.1);
  box-shadow: inset 2px 0 0 0 rgba(217, 70, 239, 0.75);
}

.nav-item.is-active svg {
  opacity: 1;
  color: #e879f9;
}

.nav-item--sub {
  padding-left: 2.15rem;
}

.nav-group {
  margin-top: 0.2rem;
}

.nav-group__items {
  display: none;
  padding: 0.1rem 0 0.25rem;
  gap: 0.1rem;
}

.nav-group.is-open .nav-group__items {
  display: grid;
}

.sidebar__foot {
  display: grid;
  gap: 0.3rem;
  padding: 0.85rem 0.55rem 0.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--mute);
}

.sidebar__foot a:hover {
  color: var(--ink-soft);
}

.mainwrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 4rem;
  padding: 0.75rem 1.35rem;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 5, 16, 0.85);
  backdrop-filter: blur(14px);
}

.topbar__title {
  flex: 1;
  min-width: 0;
}

.topbar__title h1 {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 800;
}

.topbar__title p {
  font-size: 0.8rem;
  color: var(--mute);
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.iconbtn {
  display: none;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.content {
  padding: 1.35rem 1.35rem 3rem;
}

.hero-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(217, 70, 239, 0.12), transparent 45%),
    linear-gradient(225deg, rgba(34, 211, 238, 0.1), transparent 40%),
    rgba(18, 10, 28, 0.75);
  margin-bottom: 1.25rem;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-2);
  margin-bottom: 0.35rem;
}

.hero-strip h2 {
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.hero-strip p {
  color: var(--mute);
  max-width: 36rem;
}

.hero-strip a {
  color: #e879f9;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.statgrid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat {
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(18, 10, 28, 0.7);
}

.stat span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 0.45rem;
}

.stat strong {
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 700;
  word-break: break-word;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 1.1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(18, 10, 28, 0.65);
}

.toolbar__left {
  flex: 1;
  min-width: min(100%, 280px);
}

.toolbar__right {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.field {
  display: grid;
  gap: 0.4rem;
  text-align: left;
}

.field span {
  font-size: 0.78rem;
  color: var(--mute);
}

.field span em {
  font-style: normal;
  opacity: 0.75;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(8, 5, 16, 0.65);
  padding: 0.7rem 0.85rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field textarea {
  resize: vertical;
  min-height: 180px;
  line-height: 1.55;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(217, 70, 239, 0.55);
  box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.15);
}

.rules-list {
  display: grid;
  gap: 0.75rem;
}

.rule-card {
  display: grid;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(18, 10, 28, 0.72);
  transition: border-color 0.15s, transform 0.15s;
  animation: up 0.35s var(--ease) both;
}

.rule-card:hover {
  border-color: rgba(217, 70, 239, 0.35);
}

.rule-card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.rule-card__meta {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  min-width: 0;
}

.rule-card__nr {
  flex: 0 0 auto;
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary-2);
  padding-top: 0.2rem;
}

.rule-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.rule-card__id {
  font-size: 0.72rem;
  color: var(--mute);
  font-family: ui-monospace, monospace;
}

.rule-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.rule-card__body {
  color: var(--mute);
  font-size: 0.92rem;
}

.rule-card__body p + p {
  margin-top: 0.45rem;
}

.empty {
  text-align: center;
  color: var(--mute);
  padding: 2.5rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 16px;
}

.modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(560px, calc(100vw - 1.5rem));
  width: 100%;
}

.modal::backdrop {
  background: rgba(4, 2, 10, 0.72);
  backdrop-filter: blur(6px);
}

.modal__box {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #140c20;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.modal__head h2 {
  font-size: 1.15rem;
  font-weight: 800;
}

.modal__head .iconbtn {
  display: grid;
}

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.25rem;
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  background: #1f1230;
  border: 1px solid rgba(217, 70, 239, 0.4);
  color: var(--ink);
  font-size: 0.88rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  animation: up 0.25s var(--ease) both;
}

.drawer-bg {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.55);
}

@keyframes up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 40;
    left: 0;
    top: 0;
    width: min(288px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.25s var(--ease);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .iconbtn {
    display: grid;
  }

  .topbar__user > div {
    display: none;
  }
}
