@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #04060e;
  --card: #0c1220;
  --surface: #10182b;
  --accent: #2cf1a0;
  --accent-2: #7ad1ff;
  --muted: #a4b6d0;
  --text: #f0f4fb;
  --danger: #ff6b8f;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.35);
  --topbar-pad: 86px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  background: radial-gradient(circle at 20% 20%, rgba(44, 241, 160, 0.08), transparent 20%),
              radial-gradient(circle at 80% 0%, rgba(96, 184, 255, 0.1), transparent 22%),
              linear-gradient(135deg, #05060c 0%, #090f1d 50%, #060812 100%);
  color: var(--text);
  padding-top: var(--topbar-pad);
}

.background { position: fixed; inset: 0; pointer-events: none; }

.container {
  width: min(1180px, 94vw);
  margin: 0 auto 70px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 0 10px;
}

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 16px;
  min-height: 64px;
  backdrop-filter: blur(12px);
  background: linear-gradient(120deg, rgba(10, 15, 26, 0.9), rgba(6, 10, 18, 0.82));
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
}

nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}
nav a {
  color: var(--text);
  margin-right: 0;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 9px;
  transition: all 0.2s ease;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
  font-size: 14px;
}
nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
nav a.active { background: rgba(44, 241, 160, 0.12); border-color: rgba(44, 241, 160, 0.4); }
nav::-webkit-scrollbar { height: 6px; }
nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 999px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
}

.card {
  background: linear-gradient(145deg, var(--card), var(--surface));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card h1, .card h2 { margin: 0 0 10px; }

.stack { display: flex; flex-direction: column; gap: 10px; }
.stack.inline { flex-direction: row; flex-wrap: wrap; }

input, button, .pill, .ghost, .danger, select {
  font-family: inherit;
  font-size: 15px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 14px;
  background: rgba(255,255,255,0.02);
  color: var(--text);
}

button { cursor: pointer; background: var(--accent); border: none; color: #04130b; font-weight: 700; }
button:hover { filter: brightness(1.05); }
button.ghost { background: rgba(255,255,255,0.05); color: var(--text); }
button.danger { background: var(--danger); color: #14060a; }

input { width: 100%; }

.muted { color: var(--muted); }
.label { font-size: 12px; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; }
.title { font-size: 28px; font-weight: 700; line-height: 1.3; }
.badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.15s ease;
}
.pill:hover { transform: translateY(-1px); }

.grid.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.grid.guilds { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }

.guild { display: grid; gap: 10px; }
.guild-head { display: flex; align-items: center; justify-content: space-between; }
.actions { margin: 0; }
.link { color: var(--accent-2); text-decoration: none; font-weight: 600; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.section-head h1 { margin: 0 0 4px; }

.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.list li { padding: 10px; border-radius: 12px; background: rgba(255,255,255,0.04); }

.danger.card { border-color: rgba(255, 107, 143, 0.4); }
.success.card { border-color: rgba(44, 241, 160, 0.5); }

table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.08); text-align: left; }
table th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
table tr:hover td { background: rgba(255,255,255,0.02); }

.chat-grid { display: grid; grid-template-columns: 260px 1fr; gap: 14px; align-items: start; }
.channel-list { display: flex; flex-direction: column; gap: 8px; }
.channel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s ease;
}
.channel:hover { background: rgba(255,255,255,0.06); }
.channel.active { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(44,241,160,0.3); }
.channel .name { font-weight: 700; }
.message-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}
.message { padding: 10px; border-radius: 12px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06); }
.message .meta { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.message .content { line-height: 1.4; }
.roles-panel .stack.inline { align-items: stretch; }
.role-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.role-name { font-weight: 700; }
.security-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
.modal.hidden { display: none; }
.modal-card {
  background: var(--card);
  padding: 20px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  max-width: 420px;
  box-shadow: var(--shadow);
}

@media (max-width: 700px) {
  :root { --topbar-pad: 128px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  nav { max-width: 100%; }
  .chat-grid { grid-template-columns: 1fr; }
}
