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

:root {
  color-scheme: dark;
  --background: #06091a;
  --foreground: #e2e8f0;
  --surface: rgba(15, 23, 62, 0.7);
  --surface-solid: #0b1030;
  --muted: rgba(15, 23, 62, 0.4);
  --muted-foreground: #94a3b8;
  --border: rgba(59, 130, 246, 0.15);
  --border-strong: rgba(59, 130, 246, 0.35);
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --accent-foreground: #ffffff;
  --discord: #5865f2;
  --discord-hover: #4752c4;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html { background-color: var(--background); }

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(600px circle at 15% 10%, rgba(59, 130, 246, 0.1), transparent 45%),
    radial-gradient(700px circle at 85% 90%, rgba(96, 165, 250, 0.08), transparent 45%);
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

* { scrollbar-width: thin; scrollbar-color: rgba(59, 130, 246, 0.4) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(59, 130, 246, 0.35); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(59, 130, 246, 0.6); }

/* ── Animations ───────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
  50% { box-shadow: 0 0 24px 4px rgba(59, 130, 246, 0.35); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-24px) translateX(12px); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes borderGlow {
  0%, 100% { border-color: rgba(59, 130, 246, 0.2); }
  50% { border-color: rgba(96, 165, 250, 0.6); }
}
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-fade-in-up { animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
.animate-fade-in { animation: fadeIn 0.6s ease both; }
.animate-slide-in { animation: slideIn 0.4s ease both; }
.animate-float { animation: float 14s ease-in-out infinite; }
.animate-pulse-glow { animation: pulseGlow 2.4s ease-in-out infinite; }
.animate-border-glow { animation: borderGlow 3s ease-in-out infinite; }

/* ── Gradient Text ─────────────────────────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(90deg, #3b82f6, #60a5fa, #93c5fd, #3b82f6);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: gradientShift 6s ease infinite;
}

/* ── Glass Surfaces ────────────────────────────────────────────────────────── */
.glass {
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--border);
}
.glass-strong {
  background: rgba(15, 23, 62, 0.82);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border);
}

/* ── Shimmer Skeleton ──────────────────────────────────────────────────────── */
.shimmer {
  background: linear-gradient(90deg, rgba(59,130,246,0.06) 25%, rgba(96,165,250,0.16) 50%, rgba(59,130,246,0.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

/* ── Floating Orbs ─────────────────────────────────────────────────────────── */
.floating-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.floating-orbs .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}
.floating-orbs .orb-1 {
  left: -8rem;
  top: 6rem;
  width: 20rem;
  height: 20rem;
  opacity: 0.4;
  background: radial-gradient(circle, rgba(59,130,246,0.45), transparent 70%);
  animation: float 14s ease-in-out infinite;
}
.floating-orbs .orb-2 {
  right: -6rem;
  top: 50%;
  width: 24rem;
  height: 24rem;
  opacity: 0.3;
  background: radial-gradient(circle, rgba(96,165,250,0.4), transparent 70%);
  animation: float 14s ease-in-out infinite 4s;
}
.floating-orbs .orb-3 {
  bottom: 0;
  left: 33%;
  width: 18rem;
  height: 18rem;
  opacity: 0.25;
  background: radial-gradient(circle, rgba(59,130,246,0.35), transparent 70%);
  animation: float 14s ease-in-out infinite 8s;
}

/* ── Container ─────────────────────────────────────────────────────────────── */
.container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}
@media (min-width: 640px) { .container { padding: 2.5rem 1.5rem; } }

/* ── Navigation ────────────────────────────────────────────────────────────── */
.nav-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 80rem;
  margin: 0 auto;
  height: 4rem;
  padding: 0 1rem;
}
@media (min-width: 640px) { .nav-inner { padding: 0 1.5rem; } }

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}
@media (min-width: 1024px) { .nav-links { display: flex; } }

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: all 0.2s ease;
}
.nav-link:hover {
  background: rgba(59,130,246,0.1);
  color: var(--foreground);
}
.nav-link.active {
  background: rgba(59,130,246,0.15);
  color: var(--accent-light);
  box-shadow: 0 0 18px rgba(59,130,246,0.35);
  ring: 1px solid rgba(59,130,246,0.4);
}
.nav-link i { font-size: 1rem; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-user-info {
  display: none;
  align-items: center;
  gap: 0.625rem;
}
@media (min-width: 640px) { .nav-user-info { display: flex; } }

.nav-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-foreground);
}

.nav-username {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

.nav-badge {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(59,130,246,0.15);
  color: var(--accent-light);
  ring: 1px solid rgba(59,130,246,0.3);
}

.nav-logout {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 1.125rem;
  transition: all 0.2s;
}
.nav-logout:hover {
  background: rgba(239,68,68,0.15);
  color: var(--danger);
}

.nav-mobile-toggle {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--foreground);
  font-size: 1.25rem;
}
@media (min-width: 1024px) { .nav-mobile-toggle { display: none; } }

.nav-mobile-menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem;
}
.nav-mobile-menu .nav-link {
  padding: 0.625rem 0.875rem;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn i { font-size: 1rem; }

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: var(--accent-foreground);
  box-shadow: 0 4px 20px rgba(59,130,246,0.35);
}
.btn-accent:hover {
  box-shadow: 0 6px 28px rgba(59,130,246,0.5);
  filter: brightness(1.05);
}

.btn-ghost {
  background: rgba(59,130,246,0.1);
  color: var(--foreground);
  ring: 1px solid var(--border);
}
.btn-ghost:hover {
  background: rgba(59,130,246,0.15);
  ring: 1px solid var(--border-strong);
}

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--danger);
  ring: 1px solid rgba(239,68,68,0.3);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-discord {
  background: var(--discord);
  color: white;
  box-shadow: 0 8px 30px rgba(88,101,242,0.4);
}
.btn-discord:hover {
  background: var(--discord-hover);
  box-shadow: 0 10px 38px rgba(88,101,242,0.55);
}

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-xs { padding: 0.25rem 0.625rem; font-size: 0.75rem; }

/* ── Page Header ───────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@media (min-width: 640px) {
  .page-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}
.page-header-text h1 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
@media (min-width: 640px) { .page-header-text h1 { font-size: 1.875rem; } }
.page-header-text h1 i { color: var(--accent-light); }
.page-header-text p {
  margin-top: 0.375rem;
  max-width: 36rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* ── Module Grid ───────────────────────────────────────────────────────────── */
.module-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 640px) { .module-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .module-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .module-grid { grid-template-columns: repeat(4, 1fr); } }

.module-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}
.module-card::before {
  content: '';
  position: absolute;
  inset-x: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.module-card::after {
  content: '';
  position: absolute;
  right: -2rem;
  top: -2rem;
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: rgba(59,130,246,0.1);
  filter: blur(24px);
  transition: all 0.3s ease;
}
.module-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 16px 50px rgba(59,130,246,0.25);
}
.module-card:hover::before { transform: scaleX(1); }
.module-card:hover::after { background: rgba(59,130,246,0.25); }

.module-card-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  background: rgba(59,130,246,0.15);
  color: var(--accent-light);
  font-size: 1.5rem;
  ring: 1px solid rgba(59,130,246,0.2);
  transition: all 0.3s ease;
}
.module-card:hover .module-card-icon {
  background: rgba(59,130,246,0.25);
  ring: 1px solid rgba(59,130,246,0.4);
}

.module-card h3 {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
}
.module-card h3 .arrow {
  font-size: 0.875rem;
  color: var(--accent-light);
  opacity: 0;
  transform: translateX(0);
  transition: all 0.3s ease;
}
.module-card:hover h3 .arrow {
  opacity: 1;
  transform: translateX(4px);
}
.module-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

/* ── Glass Card ────────────────────────────────────────────────────────────── */
.glass-card {
  border-radius: 12px;
  padding: 1.25rem;
}
.glass-card-p0 {
  border-radius: 12px;
  overflow: hidden;
}

/* ── Stat Card ─────────────────────────────────────────────────────────────── */
.stat-card {
  position: relative;
  overflow: hidden;
}
.stat-card-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.stat-card-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}
.stat-card-value {
  margin-top: 0.375rem;
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--foreground);
}
.stat-card-hint {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.stat-card-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(59,130,246,0.15);
  color: var(--accent-light);
  font-size: 1.25rem;
}

/* ── Status Badge ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
}
.badge-running { background: rgba(34,197,94,0.15); color: var(--success); ring: 1px solid rgba(34,197,94,0.3); }
.badge-running .badge-dot { background: var(--success); }
.badge-scheduled { background: rgba(59,130,246,0.15); color: var(--accent-light); ring: 1px solid rgba(59,130,246,0.3); }
.badge-scheduled .badge-dot { background: var(--accent-light); }
.badge-ended { background: rgba(255,255,255,0.05); color: var(--muted-foreground); ring: 1px solid var(--border); }
.badge-ended .badge-dot { background: var(--muted-foreground); }
.badge-draft { background: rgba(245,158,11,0.15); color: var(--warning); ring: 1px solid rgba(245,158,11,0.3); }
.badge-draft .badge-dot { background: var(--warning); }

/* Category badges */
.badge-cat { padding: 0.125rem 0.5rem; border-radius: 6px; ring: 1px solid; font-size: 0.75rem; font-weight: 500; }
.badge-cat-Allgemein { background: rgba(59,130,246,0.15); color: var(--accent-light); ring-color: rgba(59,130,246,0.3); }
.badge-cat-Event { background: rgba(34,197,94,0.15); color: var(--success); ring-color: rgba(34,197,94,0.3); }
.badge-cat-Important, .badge-cat-Wichtig { background: rgba(239,68,68,0.15); color: var(--danger); ring-color: rgba(239,68,68,0.3); }

/* Status badges for registrations */
.badge-confirmed { background: rgba(34,197,94,0.15); color: var(--success); ring: 1px solid rgba(34,197,94,0.3); }
.badge-pending { background: rgba(245,158,11,0.15); color: var(--warning); ring: 1px solid rgba(245,158,11,0.3); }

/* ── Tab Navigation ────────────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  border-radius: 12px;
  padding: 0.375rem;
  margin-bottom: 1.5rem;
}
.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}
.tab-btn:hover {
  background: rgba(59,130,246,0.1);
  color: var(--foreground);
}
.tab-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: var(--accent-foreground);
  box-shadow: 0 4px 16px rgba(59,130,246,0.4);
}
.tab-btn i { font-size: 1rem; }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease both; }

/* ── Tables ────────────────────────────────────────────────────────────────── */
.table-wrap {
  border-radius: 12px;
  overflow: hidden;
}
.table-wrap table {
  width: 100%;
  text-align: left;
  font-size: 0.875rem;
}
.table-wrap thead tr {
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}
.table-wrap th {
  padding: 0.875rem 1.25rem;
  font-weight: 500;
}
.table-wrap td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(59,130,246,0.08);
}
.table-wrap tbody tr:last-child td { border-bottom: none; }
.table-wrap tbody tr { transition: background 0.15s ease; }
.table-wrap tbody tr:hover { background: rgba(59,130,246,0.05); }
.table-mono { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--accent-light); }

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ── Empty State ───────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 3.5rem 1.5rem;
  text-align: center;
}
.empty-state-icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: rgba(59,130,246,0.1);
  color: var(--accent-light);
  font-size: 1.5rem;
}
.empty-state h3 { font-size: 1rem; font-weight: 600; }
.empty-state p { max-width: 24rem; font-size: 0.875rem; color: var(--muted-foreground); }

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border-radius: 8px;
  background: rgba(6,9,26,0.4);
  color: var(--foreground);
  font-size: 0.875rem;
  ring: 1px solid var(--border);
  border: none;
  outline: none;
  transition: ring 0.2s ease;
}
.form-input:focus { ring: 1px solid var(--border-strong); }
.form-input::placeholder { color: var(--muted-foreground); }

.form-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

.form-group { margin-bottom: 1rem; }

/* ── Category Buttons (for Updates form) ──────────────────────────────────── */
.cat-btn {
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(6,9,26,0.4);
  color: var(--muted-foreground);
  ring: 1px solid var(--border);
}
.cat-btn:hover { color: var(--foreground); }
.cat-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: var(--accent-foreground);
}

/* ── Moon Phase Level ──────────────────────────────────────────────────────── */
.moon-phase {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.moon-phase i { font-size: 1rem; }
.moon-view { color: var(--muted-foreground); }
.moon-edit { color: var(--accent-light); }
.moon-admin { color: var(--accent); }

/* ── Role Chips ────────────────────────────────────────────────────────────── */
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  ring: 1px solid;
  cursor: pointer;
  transition: all 0.15s ease;
}
.role-chip:hover { transform: scale(1.05); }
.role-chip-Owner { background: rgba(239,68,68,0.15); color: var(--danger); ring-color: rgba(239,68,68,0.3); }
.role-chip-Admin { background: rgba(59,130,246,0.15); color: var(--accent-light); ring-color: rgba(59,130,246,0.3); }
.role-chip-Dev { background: rgba(245,158,11,0.15); color: var(--warning); ring-color: rgba(245,158,11,0.3); }
.role-chip-Moderator { background: rgba(34,197,94,0.15); color: var(--success); ring-color: rgba(34,197,94,0.3); }
.role-chip-Event-Team { background: rgba(59,130,246,0.15); color: var(--accent-light); ring-color: rgba(59,130,246,0.3); }
.role-chip-default { background: rgba(255,255,255,0.05); color: var(--muted-foreground); ring-color: var(--border); }

/* ── Permission Entry List ─────────────────────────────────────────────────── */
.perm-entry {
  border-bottom: 1px solid rgba(59,130,246,0.08);
}
.perm-entry:last-child { border-bottom: none; }

.perm-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  align-items: center;
}
@media (min-width: 768px) {
  .perm-grid {
    grid-template-columns: 1.4fr 2fr 1fr auto;
    gap: 1rem;
  }
}

.perm-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.perm-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-foreground);
}
.perm-name { font-size: 0.875rem; font-weight: 500; }

.perm-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.perm-actions {
  display: flex;
  gap: 0.5rem;
}
@media (min-width: 768px) { .perm-actions { justify-content: flex-end; } }

.perm-edit-panel {
  margin: 0 1.25rem 1rem;
  border-radius: 12px;
  padding: 1rem;
}
.perm-edit-panel p {
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

/* ── Permission Legend ──────────────────────────────────────────────────────── */
.perm-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  border-radius: 12px;
  padding: 0.875rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}
.perm-legend-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

/* ── Conversation List (DM) ────────────────────────────────────────────────── */
.conv-list {
  max-height: 26rem;
  overflow-y: auto;
}
.conv-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(59,130,246,0.06);
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
}
.conv-item:hover { background: rgba(59,130,246,0.05); }
.conv-item.active { background: rgba(59,130,246,0.1); }

.conv-avatar {
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-foreground);
}

.conv-info { min-width: 0; flex: 1; }
.conv-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.conv-name { font-size: 0.875rem; font-weight: 500; color: var(--foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: 0.75rem; color: var(--muted-foreground); }
.conv-preview { font-size: 0.75rem; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.conv-unread {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--accent-foreground);
}

/* ── Chat Thread (DM) ──────────────────────────────────────────────────────── */
.chat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding: 1rem;
}
.chat-header-status { font-size: 0.75rem; color: var(--success); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-bubble {
  max-width: 75%;
  padding: 0.625rem 1rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
}
.chat-bubble-them {
  border-bottom-left-radius: 0.25rem;
  background: rgba(6,9,26,0.5);
  color: var(--foreground);
  ring: 1px solid var(--border);
  align-self: flex-start;
}
.chat-bubble-me {
  border-bottom-right-radius: 0.25rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: var(--accent-foreground);
  align-self: flex-end;
}
.chat-bubble-time {
  margin-top: 0.25rem;
  font-size: 0.625rem;
}
.chat-bubble-them .chat-bubble-time { color: var(--muted-foreground); }
.chat-bubble-me .chat-bubble-time { color: rgba(255,255,255,0.7); }

.chat-input-bar {
  border-top: 1px solid var(--border);
  padding: 0.75rem;
}
.chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 8px;
  background: rgba(6,9,26,0.4);
  padding: 0.5rem 0.75rem;
  ring: 1px solid var(--border);
}
.chat-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--foreground);
  font-size: 0.875rem;
}
.chat-input-wrap input::placeholder { color: var(--muted-foreground); }
.chat-send-btn {
  display: grid;
  place-items:: center;
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: var(--accent-foreground);
  cursor: pointer;
  font-size: 0.875rem;
}

/* ── Broadcast List ────────────────────────────────────────────────────────── */
.broadcast-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(59,130,246,0.06);
  padding: 1rem 1.25rem;
}
.broadcast-item:last-child { border-bottom: none; }
.broadcast-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  background: rgba(59,130,246,0.15);
  color: var(--accent-light);
  flex-shrink: 0;
}
.broadcast-info p { font-size: 0.875rem; font-weight: 500; }
.broadcast-info span { font-size: 0.75rem; color: var(--muted-foreground); }
.badge-sent { background: rgba(34,197,94,0.15); color: var(--success); ring: 1px solid rgba(34,197,94,0.3); }

/* ── Survey Cards ──────────────────────────────────────────────────────────── */
.survey-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) { .survey-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── Activity Log ──────────────────────────────────────────────────────────── */
.activity-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(59,130,246,0.06);
  padding: 0.75rem 1.25rem;
  animation: slideIn 0.4s ease both;
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(59,130,246,0.15);
  color: var(--accent-light);
  font-size: 0.875rem;
  flex-shrink: 0;
}
.activity-text { flex: 1; font-size: 0.875rem; color: var(--foreground); }
.activity-time { font-size: 0.75rem; color: var(--muted-foreground); }

.live-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--success);
  animation: pulseGlow 2s ease-in-out infinite;
}

/* ── Tournament Cards ──────────────────────────────────────────────────────── */
.tournament-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 640px) { .tournament-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .tournament-grid { grid-template-columns: repeat(3, 1fr); } }

.tournament-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  border-radius: 12px;
  transition: all 0.3s ease;
}
.tournament-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 16px 50px rgba(59,130,246,0.2);
}
.tournament-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.tournament-card-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  background: rgba(59,130,246,0.15);
  color: var(--accent-light);
  font-size: 1.25rem;
}
.tournament-card-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.tournament-card-meta i { margin-right: 0.375rem; }

/* ── Registration Table ────────────────────────────────────────────────────── */
.reg-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
}
@media (min-width: 768px) {
  .reg-grid { grid-template-columns: 1.4fr 1fr 1.2fr auto; align-items: center; gap: 1rem; }
}
.reg-header {
  display: none;
  grid-template-columns: 1.4fr 1fr 1.2fr auto;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding: 0.875rem 1.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}
@media (min-width: 768px) { .reg-header { display: grid; } }

/* ── DM Stats Grid ─────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 640px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }

/* ── DM Two-Column Layout ──────────────────────────────────────────────────── */
.dm-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 1024px) { .dm-two-col { grid-template-columns: 320px 1fr; } }

/* ── Broadcast Two-Column Layout ───────────────────────────────────────────── */
.broadcast-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 1024px) { .broadcast-two-col { grid-template-columns: 1fr 340px; } }

/* ── Section Headers ───────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.section-header i { color: var(--accent-light); }
.section-header-muted i { color: var(--muted-foreground); }

/* ── Admin Link (Home) ─────────────────────────────────────────────────────── */
.admin-link-wrap {
  margin-top: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-link {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1.25rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(16px);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: all 0.2s ease;
}
.admin-link:hover {
  border-color: var(--border-strong);
  color: var(--foreground);
}
.admin-link .arrow {
  font-size: 0.875rem;
  transition: transform 0.2s ease;
}
.admin-link:hover .arrow { transform: translateX(4px); }

/* ── Login Page ────────────────────────────────────────────────────────────── */
.login-wrap {
  position: relative;
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2.5rem 1rem;
}

.login-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 28rem;
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 20px 70px rgba(0,0,0,0.5);
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@media (min-width: 640px) { .login-card { padding: 2.5rem; } }

.login-card h1 {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
@media (min-width: 640px) { .login-card h1 { font-size: 2.25rem; } }

.login-card .subtitle {
  margin-top: 0.75rem;
  max-width: 20rem;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
}
.login-divider-line { flex: 1; height: 1px; background: var(--border); }
.login-divider i { font-size: 0.875rem; color: var(--muted-foreground); }

.login-footer {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.login-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.login-ambient .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}
.login-ambient .orb-1 {
  left: 25%;
  top: 25%;
  width: 18rem;
  height: 18rem;
  opacity: 0.4;
  background: radial-gradient(circle, rgba(59,130,246,0.4), transparent 70%);
  animation: float 14s ease-in-out infinite;
}
.login-ambient .orb-2 {
  right: 25%;
  bottom: 25%;
  width: 20rem;
  height: 20rem;
  opacity: 0.3;
  background: radial-gradient(circle, rgba(96,165,250,0.35), transparent 70%);
  animation: float 14s ease-in-out infinite 5s;
}

/* ── Moon Logo (CSS-only) ─────────────────────────────────────────────────── */
.moon-logo {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}
.moon-logo-circle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
}
.moon-logo-circle.glow {
  box-shadow: 0 0 18px rgba(59,130,246,0.55);
}
.moon-logo-overlay {
  position: absolute;
  border-radius: 50%;
  background: var(--background);
}

/* ── Responsive Table Mobile Cards ─────────────────────────────────────────── */
.table-mobile-cards {
  display: none;
}
@media (max-width: 767px) {
  .table-desktop { display: none !important; }
  .table-mobile-cards { display: block; }
  .table-mobile-cards .mob-card {
    border-bottom: 1px solid rgba(59,130,246,0.06);
    padding: 1rem 1.25rem;
  }
  .table-mobile-cards .mob-card:last-child { border-bottom: none; }
  .mob-card-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
  .mob-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; font-size: 0.75rem; color: var(--muted-foreground); }
  .mob-card-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
}

/* ── Alert ─────────────────────────────────────────────────────────────────── */
.alert-error {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.25);
  color: #fca5a5;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: fadeIn 0.3s ease both;
}

/* ── Misc ──────────────────────────────────────────────────────────────────── */
.flex-center { display: grid; place-items: center; }
.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.w-full { width: 100%; }
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: flex-end;
  border-radius: 12px;
  padding: 1.125rem;
  margin-top: 0.5rem;
}
.inline-form .field { display: flex; flex-direction: column; gap: 0.3125rem; }
.inline-form label {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Tooltips (data-tip) ─────────────────────────────────────────────────── */
[data-tip] { position: relative; }

/* ── Mobile Responsive ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .container { padding: 1rem 0.75rem; }
  .glass-card { padding: 1rem; }
  .page-header-text h1 { font-size: 1.25rem; }
  .page-header-text h1 i { font-size: 1.125rem; }
  .stat-card-value { font-size: 1.5rem; }
  .btn { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
  .tab-btn { padding: 0.375rem 0.625rem; font-size: 0.75rem; }
  .tab-nav { gap: 0.125rem; padding: 0.25rem; }
}

@media (max-width: 480px) {
  .container { padding: 0.75rem 0.5rem; }
  .glass-card { padding: 0.75rem; border-radius: 8px; }
  .page-header-text h1 { font-size: 1.125rem; }
  .stat-card-value { font-size: 1.25rem; }
  .module-grid { gap: 0.75rem; }
  .tournament-grid { gap: 0.75rem; }
}

/* ── Mobile Tables → Cards ───────────────────────────────────────────────── */
@media (max-width: 767px) {
  .table-wrap table { font-size: 0.75rem; }
  .table-wrap th, .table-wrap td { padding: 0.5rem 0.75rem; }
}
